]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - sound/pci/hda/patch_realtek.c
ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks
[mirror_ubuntu-jammy-kernel.git] / sound / pci / hda / patch_realtek.c
CommitLineData
d0fa1179 1// SPDX-License-Identifier: GPL-2.0-or-later
1da177e4
LT
2/*
3 * Universal Interface for Intel High Definition Audio Codec
4 *
1d045db9 5 * HD audio interface patch for Realtek ALC codecs
1da177e4 6 *
df694daa
KY
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
1da177e4 9 * Takashi Iwai <tiwai@suse.de>
409a3e98 10 * Jonathan Woithe <jwoithe@just42.net>
1da177e4
LT
11 */
12
1da177e4
LT
13#include <linux/init.h>
14#include <linux/delay.h>
15#include <linux/slab.h>
16#include <linux/pci.h>
08fb0d0e 17#include <linux/dmi.h>
da155d5b 18#include <linux/module.h>
33f4acd3 19#include <linux/input.h>
87dc3648 20#include <linux/leds.h>
1da177e4 21#include <sound/core.h>
9ad0e496 22#include <sound/jack.h>
be57bfff 23#include <sound/hda_codec.h>
1da177e4 24#include "hda_local.h"
23d30f28 25#include "hda_auto_parser.h"
1835a0f9 26#include "hda_jack.h"
08c189f2 27#include "hda_generic.h"
1da177e4 28
cd63a5ff
TI
29/* keep halting ALC5505 DSP, for power saving */
30#define HALT_REALTEK_ALC5505
31
4a79ba34
TI
32/* extra amp-initialization sequence types */
33enum {
1c76aa5f 34 ALC_INIT_UNDEFINED,
4a79ba34
TI
35 ALC_INIT_NONE,
36 ALC_INIT_DEFAULT,
4a79ba34
TI
37};
38
73bdd597
DH
39enum {
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
43 ALC_HEADSET_MODE_MIC,
44 ALC_HEADSET_MODE_HEADPHONE,
45};
46
47enum {
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
51};
52
c7b60a89
HW
53enum {
54 ALC_KEY_MICMUTE_INDEX,
55};
56
da00c244
KY
57struct alc_customize_define {
58 unsigned int sku_cfg;
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
65 unsigned int swap:1;
66 unsigned int override:1;
90622917 67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
da00c244
KY
68};
69
766538ac
TI
70struct alc_coef_led {
71 unsigned int idx;
72 unsigned int mask;
73 unsigned int on;
74 unsigned int off;
75};
76
1da177e4 77struct alc_spec {
08c189f2 78 struct hda_gen_spec gen; /* must be at head */
23d30f28 79
1da177e4 80 /* codec parameterization */
da00c244 81 struct alc_customize_define cdefine;
08c189f2 82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
834be88d 83
5579cd6f
TI
84 /* GPIO bits */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
215c850c 88 bool gpio_write_delay; /* add a delay before writing gpio_data */
5579cd6f 89
8d3d1ece 90 /* mute LED for HP laptops, see vref_mute_led_set() */
08fb0d0e 91 int mute_led_polarity;
dbd13179 92 int micmute_led_polarity;
08fb0d0e 93 hda_nid_t mute_led_nid;
9c5dc3bf 94 hda_nid_t cap_mute_led_nid;
08fb0d0e 95
0f32fd19
TI
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
766538ac
TI
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
1b35106e 100 struct mutex coef_mutex;
9f5c6faf 101
73bdd597
DH
102 hda_nid_t headset_mic_pin;
103 hda_nid_t headphone_mic_pin;
104 int current_headset_mode;
105 int current_headset_type;
106
ae6b813a
TI
107 /* hooks */
108 void (*init_hook)(struct hda_codec *codec);
83012a7c 109#ifdef CONFIG_PM
c97259df 110 void (*power_hook)(struct hda_codec *codec);
f5de24b0 111#endif
1c716153 112 void (*shutup)(struct hda_codec *codec);
d922b51d 113
4a79ba34 114 int init_amp;
d433a678 115 int codec_variant; /* flag for other variants */
97a26570
KY
116 unsigned int has_alc5505_dsp:1;
117 unsigned int no_depop_delay:1;
693abe11 118 unsigned int done_hp_init:1;
c0ca5ece 119 unsigned int no_shutup_pins:1;
d3ba58bb 120 unsigned int ultra_low_power:1;
476c02e0 121 unsigned int has_hs_key:1;
92666d45 122 unsigned int no_internal_mic_pin:1;
e64f14f4 123
2c3bf9ab
TI
124 /* for PLL fix */
125 hda_nid_t pll_nid;
126 unsigned int pll_coef_idx, pll_coef_bit;
1bb7e43e 127 unsigned int coef0;
33f4acd3 128 struct input_dev *kb_dev;
c7b60a89 129 u8 alc_mute_keycode_map[1];
df694daa
KY
130};
131
f2a227cd
TI
132/*
133 * COEF access helper functions
134 */
135
1b35106e
TI
136static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
137 unsigned int coef_idx)
f2a227cd
TI
138{
139 unsigned int val;
140
141 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
142 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
143 return val;
144}
145
1b35106e
TI
146static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
147 unsigned int coef_idx)
148{
149 struct alc_spec *spec = codec->spec;
150 unsigned int val;
151
152 mutex_lock(&spec->coef_mutex);
153 val = __alc_read_coefex_idx(codec, nid, coef_idx);
154 mutex_unlock(&spec->coef_mutex);
155 return val;
156}
157
f2a227cd
TI
158#define alc_read_coef_idx(codec, coef_idx) \
159 alc_read_coefex_idx(codec, 0x20, coef_idx)
160
1b35106e
TI
161static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
162 unsigned int coef_idx, unsigned int coef_val)
f2a227cd
TI
163{
164 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
165 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
166}
167
1b35106e
TI
168static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
169 unsigned int coef_idx, unsigned int coef_val)
170{
171 struct alc_spec *spec = codec->spec;
172
173 mutex_lock(&spec->coef_mutex);
174 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
175 mutex_unlock(&spec->coef_mutex);
176}
177
f2a227cd
TI
178#define alc_write_coef_idx(codec, coef_idx, coef_val) \
179 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
180
1b35106e
TI
181static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
182 unsigned int coef_idx, unsigned int mask,
183 unsigned int bits_set)
184{
185 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
186
187 if (val != -1)
188 __alc_write_coefex_idx(codec, nid, coef_idx,
189 (val & ~mask) | bits_set);
190}
191
98b24883
TI
192static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
193 unsigned int coef_idx, unsigned int mask,
194 unsigned int bits_set)
195{
1b35106e 196 struct alc_spec *spec = codec->spec;
98b24883 197
1b35106e
TI
198 mutex_lock(&spec->coef_mutex);
199 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
200 mutex_unlock(&spec->coef_mutex);
98b24883
TI
201}
202
203#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
204 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
205
f2a227cd
TI
206/* a special bypass for COEF 0; read the cached value at the second time */
207static unsigned int alc_get_coef0(struct hda_codec *codec)
208{
209 struct alc_spec *spec = codec->spec;
210
211 if (!spec->coef0)
212 spec->coef0 = alc_read_coef_idx(codec, 0);
213 return spec->coef0;
214}
215
54db6c39
TI
216/* coef writes/updates batch */
217struct coef_fw {
218 unsigned char nid;
219 unsigned char idx;
220 unsigned short mask;
221 unsigned short val;
222};
223
224#define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
225 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
226#define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
227#define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
228#define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
229
230static void alc_process_coef_fw(struct hda_codec *codec,
231 const struct coef_fw *fw)
232{
1b35106e
TI
233 struct alc_spec *spec = codec->spec;
234
235 mutex_lock(&spec->coef_mutex);
54db6c39
TI
236 for (; fw->nid; fw++) {
237 if (fw->mask == (unsigned short)-1)
1b35106e 238 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
54db6c39 239 else
1b35106e
TI
240 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
241 fw->mask, fw->val);
54db6c39 242 }
1b35106e 243 mutex_unlock(&spec->coef_mutex);
54db6c39
TI
244}
245
df694daa 246/*
1d045db9 247 * GPIO setup tables, used in initialization
df694daa 248 */
5579cd6f 249
bc9f98a9 250/* Enable GPIO mask and set output */
5579cd6f
TI
251static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
252{
253 struct alc_spec *spec = codec->spec;
bc9f98a9 254
5579cd6f
TI
255 spec->gpio_mask |= mask;
256 spec->gpio_dir |= mask;
257 spec->gpio_data |= mask;
258}
bc9f98a9 259
5579cd6f
TI
260static void alc_write_gpio_data(struct hda_codec *codec)
261{
262 struct alc_spec *spec = codec->spec;
263
264 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
265 spec->gpio_data);
266}
267
aaf312de
TI
268static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
269 bool on)
270{
271 struct alc_spec *spec = codec->spec;
272 unsigned int oldval = spec->gpio_data;
273
274 if (on)
275 spec->gpio_data |= mask;
276 else
277 spec->gpio_data &= ~mask;
278 if (oldval != spec->gpio_data)
279 alc_write_gpio_data(codec);
280}
281
5579cd6f
TI
282static void alc_write_gpio(struct hda_codec *codec)
283{
284 struct alc_spec *spec = codec->spec;
285
286 if (!spec->gpio_mask)
287 return;
288
289 snd_hda_codec_write(codec, codec->core.afg, 0,
290 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
291 snd_hda_codec_write(codec, codec->core.afg, 0,
292 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
215c850c
TI
293 if (spec->gpio_write_delay)
294 msleep(1);
5579cd6f
TI
295 alc_write_gpio_data(codec);
296}
297
298static void alc_fixup_gpio(struct hda_codec *codec, int action,
299 unsigned int mask)
300{
301 if (action == HDA_FIXUP_ACT_PRE_PROBE)
302 alc_setup_gpio(codec, mask);
303}
304
305static void alc_fixup_gpio1(struct hda_codec *codec,
306 const struct hda_fixup *fix, int action)
307{
308 alc_fixup_gpio(codec, action, 0x01);
309}
310
311static void alc_fixup_gpio2(struct hda_codec *codec,
312 const struct hda_fixup *fix, int action)
313{
314 alc_fixup_gpio(codec, action, 0x02);
315}
316
317static void alc_fixup_gpio3(struct hda_codec *codec,
318 const struct hda_fixup *fix, int action)
319{
320 alc_fixup_gpio(codec, action, 0x03);
321}
bdd148a3 322
ae065f1c
TI
323static void alc_fixup_gpio4(struct hda_codec *codec,
324 const struct hda_fixup *fix, int action)
325{
326 alc_fixup_gpio(codec, action, 0x04);
327}
328
8a503555
TI
329static void alc_fixup_micmute_led(struct hda_codec *codec,
330 const struct hda_fixup *fix, int action)
331{
e65bf997 332 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8a503555
TI
333 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
334}
335
2c3bf9ab
TI
336/*
337 * Fix hardware PLL issue
338 * On some codecs, the analog PLL gating control must be off while
339 * the default value is 1.
340 */
341static void alc_fix_pll(struct hda_codec *codec)
342{
343 struct alc_spec *spec = codec->spec;
2c3bf9ab 344
98b24883
TI
345 if (spec->pll_nid)
346 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
347 1 << spec->pll_coef_bit, 0);
2c3bf9ab
TI
348}
349
350static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
351 unsigned int coef_idx, unsigned int coef_bit)
352{
353 struct alc_spec *spec = codec->spec;
354 spec->pll_nid = nid;
355 spec->pll_coef_idx = coef_idx;
356 spec->pll_coef_bit = coef_bit;
357 alc_fix_pll(codec);
358}
359
cf5a2279 360/* update the master volume per volume-knob's unsol event */
1a4f69d5
TI
361static void alc_update_knob_master(struct hda_codec *codec,
362 struct hda_jack_callback *jack)
cf5a2279
TI
363{
364 unsigned int val;
365 struct snd_kcontrol *kctl;
366 struct snd_ctl_elem_value *uctl;
367
368 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
369 if (!kctl)
370 return;
371 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
372 if (!uctl)
373 return;
2ebab40e 374 val = snd_hda_codec_read(codec, jack->nid, 0,
cf5a2279
TI
375 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
376 val &= HDA_AMP_VOLMASK;
377 uctl->value.integer.value[0] = val;
378 uctl->value.integer.value[1] = val;
379 kctl->put(kctl, uctl);
380 kfree(uctl);
381}
382
29adc4b9 383static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
f21d78e2 384{
29adc4b9
DH
385 /* For some reason, the res given from ALC880 is broken.
386 Here we adjust it properly. */
387 snd_hda_jack_unsol_event(codec, res >> 2);
f21d78e2
TI
388}
389
394c97f8
KY
390/* Change EAPD to verb control */
391static void alc_fill_eapd_coef(struct hda_codec *codec)
392{
393 int coef;
394
395 coef = alc_get_coef0(codec);
396
7639a06c 397 switch (codec->core.vendor_id) {
394c97f8
KY
398 case 0x10ec0262:
399 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
400 break;
401 case 0x10ec0267:
402 case 0x10ec0268:
403 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
404 break;
405 case 0x10ec0269:
406 if ((coef & 0x00f0) == 0x0010)
407 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
408 if ((coef & 0x00f0) == 0x0020)
409 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
410 if ((coef & 0x00f0) == 0x0030)
411 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
412 break;
413 case 0x10ec0280:
414 case 0x10ec0284:
415 case 0x10ec0290:
416 case 0x10ec0292:
417 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
418 break;
4231430d 419 case 0x10ec0225:
44be77c5
TI
420 case 0x10ec0295:
421 case 0x10ec0299:
422 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
c0dbbdad 423 fallthrough;
44be77c5 424 case 0x10ec0215:
1948fc06 425 case 0x10ec0230:
394c97f8 426 case 0x10ec0233:
ea04a1db 427 case 0x10ec0235:
c4473744 428 case 0x10ec0236:
7fbdcd83 429 case 0x10ec0245:
394c97f8 430 case 0x10ec0255:
c4473744 431 case 0x10ec0256:
f429e7e4 432 case 0x10ec0257:
394c97f8
KY
433 case 0x10ec0282:
434 case 0x10ec0283:
435 case 0x10ec0286:
436 case 0x10ec0288:
0a6f0600 437 case 0x10ec0285:
506b62c3 438 case 0x10ec0298:
0a6f0600 439 case 0x10ec0289:
1078bef0 440 case 0x10ec0300:
394c97f8
KY
441 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
442 break;
3aabf94c
KY
443 case 0x10ec0275:
444 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
445 break;
8822702f
HW
446 case 0x10ec0287:
447 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
448 alc_write_coef_idx(codec, 0x8, 0x4ab7);
449 break;
394c97f8
KY
450 case 0x10ec0293:
451 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
452 break;
dcd4f0db
KY
453 case 0x10ec0234:
454 case 0x10ec0274:
455 case 0x10ec0294:
6fbae35a
KY
456 case 0x10ec0700:
457 case 0x10ec0701:
458 case 0x10ec0703:
83629532 459 case 0x10ec0711:
dcd4f0db
KY
460 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
461 break;
394c97f8
KY
462 case 0x10ec0662:
463 if ((coef & 0x00f0) == 0x0030)
464 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
465 break;
466 case 0x10ec0272:
467 case 0x10ec0273:
468 case 0x10ec0663:
469 case 0x10ec0665:
470 case 0x10ec0670:
471 case 0x10ec0671:
472 case 0x10ec0672:
473 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
474 break;
9194a1eb 475 case 0x10ec0222:
f0778871
KY
476 case 0x10ec0623:
477 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
478 break;
394c97f8
KY
479 case 0x10ec0668:
480 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
481 break;
482 case 0x10ec0867:
483 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
484 break;
485 case 0x10ec0888:
486 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
487 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
488 break;
489 case 0x10ec0892:
e5782a5d 490 case 0x10ec0897:
394c97f8
KY
491 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
492 break;
493 case 0x10ec0899:
494 case 0x10ec0900:
6d9ffcff 495 case 0x10ec0b00:
65553b12 496 case 0x10ec1168:
a535ad57 497 case 0x10ec1220:
394c97f8
KY
498 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
499 break;
500 }
501}
502
f9423e7a
KY
503/* additional initialization for ALC888 variants */
504static void alc888_coef_init(struct hda_codec *codec)
505{
1df8874b
KY
506 switch (alc_get_coef0(codec) & 0x00f0) {
507 /* alc888-VA */
508 case 0x00:
509 /* alc888-VB */
510 case 0x10:
511 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
512 break;
513 }
87a8c370
JK
514}
515
3fb4a508
TI
516/* turn on/off EAPD control (only if available) */
517static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
518{
519 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
520 return;
521 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
522 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
523 on ? 2 : 0);
524}
525
691f1fcc
TI
526/* turn on/off EAPD controls of the codec */
527static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
528{
529 /* We currently only handle front, HP */
caf3c043 530 static const hda_nid_t pins[] = {
af95b414 531 0x0f, 0x10, 0x14, 0x15, 0x17, 0
39fa84e9 532 };
caf3c043 533 const hda_nid_t *p;
39fa84e9
TI
534 for (p = pins; *p; p++)
535 set_eapd(codec, *p, on);
691f1fcc
TI
536}
537
dad3197d
KY
538static int find_ext_mic_pin(struct hda_codec *codec);
539
540static void alc_headset_mic_no_shutup(struct hda_codec *codec)
541{
542 const struct hda_pincfg *pin;
543 int mic_pin = find_ext_mic_pin(codec);
544 int i;
545
546 /* don't shut up pins when unloading the driver; otherwise it breaks
547 * the default pin setup at the next load of the driver
548 */
549 if (codec->bus->shutdown)
550 return;
551
552 snd_array_for_each(&codec->init_pins, i, pin) {
553 /* use read here for syncing after issuing each verb */
554 if (pin->nid != mic_pin)
555 snd_hda_codec_read(codec, pin->nid, 0,
556 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
557 }
558
559 codec->pins_shutup = 1;
560}
561
c0ca5ece
TI
562static void alc_shutup_pins(struct hda_codec *codec)
563{
564 struct alc_spec *spec = codec->spec;
565
dad3197d 566 switch (codec->core.vendor_id) {
5aec9891
KY
567 case 0x10ec0236:
568 case 0x10ec0256:
66c5d718 569 case 0x10ec0283:
dad3197d
KY
570 case 0x10ec0286:
571 case 0x10ec0288:
572 case 0x10ec0298:
573 alc_headset_mic_no_shutup(codec);
574 break;
575 default:
576 if (!spec->no_shutup_pins)
577 snd_hda_shutup_pins(codec);
578 break;
579 }
c0ca5ece
TI
580}
581
1c716153 582/* generic shutup callback;
4ce8e6a5 583 * just turning off EAPD and a little pause for avoiding pop-noise
1c716153
TI
584 */
585static void alc_eapd_shutup(struct hda_codec *codec)
586{
97a26570
KY
587 struct alc_spec *spec = codec->spec;
588
1c716153 589 alc_auto_setup_eapd(codec, false);
97a26570
KY
590 if (!spec->no_depop_delay)
591 msleep(200);
c0ca5ece 592 alc_shutup_pins(codec);
1c716153
TI
593}
594
1d045db9 595/* generic EAPD initialization */
4a79ba34 596static void alc_auto_init_amp(struct hda_codec *codec, int type)
bc9f98a9 597{
39fa84e9 598 alc_auto_setup_eapd(codec, true);
5579cd6f 599 alc_write_gpio(codec);
4a79ba34 600 switch (type) {
4a79ba34 601 case ALC_INIT_DEFAULT:
7639a06c 602 switch (codec->core.vendor_id) {
c9b58006 603 case 0x10ec0260:
98b24883 604 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
c9b58006 605 break;
c9b58006
KY
606 case 0x10ec0880:
607 case 0x10ec0882:
608 case 0x10ec0883:
609 case 0x10ec0885:
1df8874b 610 alc_update_coef_idx(codec, 7, 0, 0x2030);
c9b58006 611 break;
f9423e7a 612 case 0x10ec0888:
4a79ba34 613 alc888_coef_init(codec);
f9423e7a 614 break;
bc9f98a9 615 }
4a79ba34
TI
616 break;
617 }
618}
619
35a39f98
TI
620/* get a primary headphone pin if available */
621static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
622{
623 if (spec->gen.autocfg.hp_pins[0])
624 return spec->gen.autocfg.hp_pins[0];
625 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
626 return spec->gen.autocfg.line_out_pins[0];
627 return 0;
628}
08c189f2 629
1d045db9 630/*
08c189f2 631 * Realtek SSID verification
1d045db9 632 */
42cf0d01 633
08c189f2
TI
634/* Could be any non-zero and even value. When used as fixup, tells
635 * the driver to ignore any present sku defines.
636 */
637#define ALC_FIXUP_SKU_IGNORE (2)
1a1455de 638
08c189f2
TI
639static void alc_fixup_sku_ignore(struct hda_codec *codec,
640 const struct hda_fixup *fix, int action)
1a1455de 641{
1a1455de 642 struct alc_spec *spec = codec->spec;
08c189f2
TI
643 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
644 spec->cdefine.fixup = 1;
645 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
1a1455de 646 }
1a1455de
TI
647}
648
b5c6611f
ML
649static void alc_fixup_no_depop_delay(struct hda_codec *codec,
650 const struct hda_fixup *fix, int action)
651{
652 struct alc_spec *spec = codec->spec;
653
84d2dc3e 654 if (action == HDA_FIXUP_ACT_PROBE) {
b5c6611f 655 spec->no_depop_delay = 1;
84d2dc3e
ML
656 codec->depop_delay = 0;
657 }
b5c6611f
ML
658}
659
08c189f2 660static int alc_auto_parse_customize_define(struct hda_codec *codec)
4a79ba34 661{
08c189f2
TI
662 unsigned int ass, tmp, i;
663 unsigned nid = 0;
4a79ba34
TI
664 struct alc_spec *spec = codec->spec;
665
08c189f2 666 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
4a79ba34 667
08c189f2
TI
668 if (spec->cdefine.fixup) {
669 ass = spec->cdefine.sku_cfg;
670 if (ass == ALC_FIXUP_SKU_IGNORE)
671 return -1;
672 goto do_sku;
bb35febd
TI
673 }
674
5100cd07
TI
675 if (!codec->bus->pci)
676 return -1;
7639a06c 677 ass = codec->core.subsystem_id & 0xffff;
08c189f2
TI
678 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
679 goto do_sku;
4a79ba34 680
08c189f2 681 nid = 0x1d;
7639a06c 682 if (codec->core.vendor_id == 0x10ec0260)
08c189f2
TI
683 nid = 0x17;
684 ass = snd_hda_codec_get_pincfg(codec, nid);
42cf0d01 685
08c189f2 686 if (!(ass & 1)) {
4e76a883 687 codec_info(codec, "%s: SKU not ready 0x%08x\n",
7639a06c 688 codec->core.chip_name, ass);
08c189f2 689 return -1;
42cf0d01
DH
690 }
691
08c189f2
TI
692 /* check sum */
693 tmp = 0;
694 for (i = 1; i < 16; i++) {
695 if ((ass >> i) & 1)
696 tmp++;
ae8a60a5 697 }
08c189f2
TI
698 if (((ass >> 16) & 0xf) != tmp)
699 return -1;
ae8a60a5 700
da00c244
KY
701 spec->cdefine.port_connectivity = ass >> 30;
702 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
703 spec->cdefine.check_sum = (ass >> 16) & 0xf;
704 spec->cdefine.customization = ass >> 8;
705do_sku:
706 spec->cdefine.sku_cfg = ass;
707 spec->cdefine.external_amp = (ass & 0x38) >> 3;
708 spec->cdefine.platform_type = (ass & 0x4) >> 2;
709 spec->cdefine.swap = (ass & 0x2) >> 1;
710 spec->cdefine.override = ass & 0x1;
711
4e76a883 712 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
da00c244 713 nid, spec->cdefine.sku_cfg);
4e76a883 714 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
da00c244 715 spec->cdefine.port_connectivity);
4e76a883
TI
716 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
717 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
718 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
719 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
720 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
721 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
722 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
da00c244
KY
723
724 return 0;
725}
726
08c189f2
TI
727/* return the position of NID in the list, or -1 if not found */
728static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
729{
730 int i;
731 for (i = 0; i < nums; i++)
732 if (list[i] == nid)
733 return i;
734 return -1;
735}
1d045db9 736/* return true if the given NID is found in the list */
3af9ee6b
TI
737static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
738{
21268961 739 return find_idx_in_nid_list(nid, list, nums) >= 0;
3af9ee6b
TI
740}
741
4a79ba34
TI
742/* check subsystem ID and set up device-specific initialization;
743 * return 1 if initialized, 0 if invalid SSID
744 */
745/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
746 * 31 ~ 16 : Manufacture ID
747 * 15 ~ 8 : SKU ID
748 * 7 ~ 0 : Assembly ID
749 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
750 */
58c57cfa 751static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34
TI
752{
753 unsigned int ass, tmp, i;
754 unsigned nid;
755 struct alc_spec *spec = codec->spec;
756
90622917
DH
757 if (spec->cdefine.fixup) {
758 ass = spec->cdefine.sku_cfg;
759 if (ass == ALC_FIXUP_SKU_IGNORE)
760 return 0;
761 goto do_sku;
762 }
763
7639a06c 764 ass = codec->core.subsystem_id & 0xffff;
5100cd07
TI
765 if (codec->bus->pci &&
766 ass != codec->bus->pci->subsystem_device && (ass & 1))
4a79ba34
TI
767 goto do_sku;
768
769 /* invalid SSID, check the special NID pin defcfg instead */
770 /*
def319f9 771 * 31~30 : port connectivity
4a79ba34
TI
772 * 29~21 : reserve
773 * 20 : PCBEEP input
774 * 19~16 : Check sum (15:1)
775 * 15~1 : Custom
776 * 0 : override
777 */
778 nid = 0x1d;
7639a06c 779 if (codec->core.vendor_id == 0x10ec0260)
4a79ba34
TI
780 nid = 0x17;
781 ass = snd_hda_codec_get_pincfg(codec, nid);
4e76a883
TI
782 codec_dbg(codec,
783 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
cb6605c1 784 ass, nid);
6227cdce 785 if (!(ass & 1))
4a79ba34
TI
786 return 0;
787 if ((ass >> 30) != 1) /* no physical connection */
788 return 0;
789
790 /* check sum */
791 tmp = 0;
792 for (i = 1; i < 16; i++) {
793 if ((ass >> i) & 1)
794 tmp++;
795 }
796 if (((ass >> 16) & 0xf) != tmp)
797 return 0;
798do_sku:
4e76a883 799 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
7639a06c 800 ass & 0xffff, codec->core.vendor_id);
4a79ba34
TI
801 /*
802 * 0 : override
803 * 1 : Swap Jack
804 * 2 : 0 --> Desktop, 1 --> Laptop
805 * 3~5 : External Amplifier control
806 * 7~6 : Reserved
807 */
808 tmp = (ass & 0x38) >> 3; /* external Amp control */
1c76aa5f
TI
809 if (spec->init_amp == ALC_INIT_UNDEFINED) {
810 switch (tmp) {
811 case 1:
5579cd6f 812 alc_setup_gpio(codec, 0x01);
1c76aa5f
TI
813 break;
814 case 3:
5579cd6f 815 alc_setup_gpio(codec, 0x02);
1c76aa5f
TI
816 break;
817 case 7:
5579cd6f 818 alc_setup_gpio(codec, 0x03);
1c76aa5f
TI
819 break;
820 case 5:
821 default:
822 spec->init_amp = ALC_INIT_DEFAULT;
823 break;
824 }
bc9f98a9 825 }
ea1fb29a 826
8c427226 827 /* is laptop or Desktop and enable the function "Mute internal speaker
c9b58006
KY
828 * when the external headphone out jack is plugged"
829 */
8c427226 830 if (!(ass & 0x8000))
4a79ba34 831 return 1;
c9b58006
KY
832 /*
833 * 10~8 : Jack location
834 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
835 * 14~13: Resvered
836 * 15 : 1 --> enable the function "Mute internal speaker
837 * when the external headphone out jack is plugged"
838 */
35a39f98 839 if (!alc_get_hp_pin(spec)) {
01d4825d 840 hda_nid_t nid;
c9b58006 841 tmp = (ass >> 11) & 0x3; /* HP to chassis */
58c57cfa 842 nid = ports[tmp];
08c189f2
TI
843 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
844 spec->gen.autocfg.line_outs))
3af9ee6b 845 return 1;
08c189f2 846 spec->gen.autocfg.hp_pins[0] = nid;
c9b58006 847 }
4a79ba34
TI
848 return 1;
849}
ea1fb29a 850
3e6179b8
TI
851/* Check the validity of ALC subsystem-id
852 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
853static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34 854{
58c57cfa 855 if (!alc_subsystem_id(codec, ports)) {
4a79ba34 856 struct alc_spec *spec = codec->spec;
67791202
TI
857 if (spec->init_amp == ALC_INIT_UNDEFINED) {
858 codec_dbg(codec,
859 "realtek: Enable default setup for auto mode as fallback\n");
860 spec->init_amp = ALC_INIT_DEFAULT;
861 }
4a79ba34 862 }
21268961 863}
1a1455de 864
1d045db9 865/*
ef8ef5fb 866 */
f9e336f6 867
9d36a7dc
DH
868static void alc_fixup_inv_dmic(struct hda_codec *codec,
869 const struct hda_fixup *fix, int action)
125821ae
TI
870{
871 struct alc_spec *spec = codec->spec;
668d1e96 872
9d36a7dc 873 spec->gen.inv_dmic_split = 1;
6e72aa5f
TI
874}
875
e9edcee0 876
08c189f2 877static int alc_build_controls(struct hda_codec *codec)
1d045db9 878{
a5cb463a 879 int err;
e9427969 880
08c189f2
TI
881 err = snd_hda_gen_build_controls(codec);
882 if (err < 0)
883 return err;
1da177e4 884
1727a771 885 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
1c4a54b4 886 return 0;
a361d84b
KY
887}
888
a361d84b 889
df694daa 890/*
08c189f2 891 * Common callbacks
df694daa 892 */
a361d84b 893
c9af753f
TI
894static void alc_pre_init(struct hda_codec *codec)
895{
896 alc_fill_eapd_coef(codec);
897}
898
aeac1a0d
KY
899#define is_s3_resume(codec) \
900 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
c9af753f
TI
901#define is_s4_resume(codec) \
902 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
903
08c189f2 904static int alc_init(struct hda_codec *codec)
1d045db9
TI
905{
906 struct alc_spec *spec = codec->spec;
a361d84b 907
c9af753f
TI
908 /* hibernation resume needs the full chip initialization */
909 if (is_s4_resume(codec))
910 alc_pre_init(codec);
911
08c189f2
TI
912 if (spec->init_hook)
913 spec->init_hook(codec);
a361d84b 914
89781d08 915 spec->gen.skip_verbs = 1; /* applied in below */
607ca3bd 916 snd_hda_gen_init(codec);
08c189f2
TI
917 alc_fix_pll(codec);
918 alc_auto_init_amp(codec, spec->init_amp);
89781d08 919 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
3abf2f36 920
1727a771 921 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
a361d84b 922
1d045db9
TI
923 return 0;
924}
a361d84b 925
08c189f2 926static inline void alc_shutup(struct hda_codec *codec)
1d045db9
TI
927{
928 struct alc_spec *spec = codec->spec;
a361d84b 929
c7273bd6
TI
930 if (!snd_hda_get_bool_hint(codec, "shutup"))
931 return; /* disabled explicitly by hints */
932
08c189f2
TI
933 if (spec && spec->shutup)
934 spec->shutup(codec);
9bfb2844 935 else
c0ca5ece 936 alc_shutup_pins(codec);
1d045db9
TI
937}
938
8a02c0cc 939#define alc_free snd_hda_gen_free
2134ea4f 940
08c189f2
TI
941#ifdef CONFIG_PM
942static void alc_power_eapd(struct hda_codec *codec)
1d045db9 943{
08c189f2 944 alc_auto_setup_eapd(codec, false);
1d045db9 945}
2134ea4f 946
08c189f2 947static int alc_suspend(struct hda_codec *codec)
1d045db9
TI
948{
949 struct alc_spec *spec = codec->spec;
08c189f2
TI
950 alc_shutup(codec);
951 if (spec && spec->power_hook)
952 spec->power_hook(codec);
a361d84b
KY
953 return 0;
954}
08c189f2 955#endif
a361d84b 956
08c189f2
TI
957#ifdef CONFIG_PM
958static int alc_resume(struct hda_codec *codec)
1d045db9 959{
97a26570
KY
960 struct alc_spec *spec = codec->spec;
961
962 if (!spec->no_depop_delay)
963 msleep(150); /* to avoid pop noise */
08c189f2 964 codec->patch_ops.init(codec);
1a462be5 965 snd_hda_regmap_sync(codec);
08c189f2
TI
966 hda_call_check_power_status(codec, 0x01);
967 return 0;
1d045db9 968}
08c189f2 969#endif
f6a92248 970
1d045db9 971/*
1d045db9 972 */
08c189f2
TI
973static const struct hda_codec_ops alc_patch_ops = {
974 .build_controls = alc_build_controls,
975 .build_pcms = snd_hda_gen_build_pcms,
976 .init = alc_init,
977 .free = alc_free,
978 .unsol_event = snd_hda_jack_unsol_event,
979#ifdef CONFIG_PM
980 .resume = alc_resume,
08c189f2 981 .suspend = alc_suspend,
fce52a3b 982 .check_power_status = snd_hda_gen_check_power_status,
08c189f2 983#endif
08c189f2 984};
f6a92248 985
f53281e6 986
ded255be 987#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
e01bf509 988
e4770629 989/*
4b016931 990 * Rename codecs appropriately from COEF value or subvendor id
e4770629 991 */
08c189f2
TI
992struct alc_codec_rename_table {
993 unsigned int vendor_id;
994 unsigned short coef_mask;
995 unsigned short coef_bits;
996 const char *name;
997};
84898e87 998
4b016931
KY
999struct alc_codec_rename_pci_table {
1000 unsigned int codec_vendor_id;
1001 unsigned short pci_subvendor;
1002 unsigned short pci_subdevice;
1003 const char *name;
1004};
1005
6b0f95c4 1006static const struct alc_codec_rename_table rename_tbl[] = {
e6e5f7ad 1007 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
08c189f2
TI
1008 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1009 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1010 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1011 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1012 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1013 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1014 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1015 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
e6e5f7ad 1016 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
08c189f2
TI
1017 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1018 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1019 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1020 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1021 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1022 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1023 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1024 { } /* terminator */
1025};
84898e87 1026
6b0f95c4 1027static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
4b016931
KY
1028 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1029 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1030 { 0x10ec0283, 0x1028, 0, "ALC3223" },
193177de 1031 { 0x10ec0288, 0x1028, 0, "ALC3263" },
4b016931 1032 { 0x10ec0292, 0x1028, 0, "ALC3226" },
193177de 1033 { 0x10ec0293, 0x1028, 0, "ALC3235" },
4b016931
KY
1034 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1035 { 0x10ec0668, 0x1028, 0, "ALC3661" },
e6e5f7ad
KY
1036 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1037 { 0x10ec0899, 0x1028, 0, "ALC3861" },
2c674fac 1038 { 0x10ec0298, 0x1028, 0, "ALC3266" },
736f20a7 1039 { 0x10ec0236, 0x1028, 0, "ALC3204" },
82324502 1040 { 0x10ec0256, 0x1028, 0, "ALC3246" },
4231430d 1041 { 0x10ec0225, 0x1028, 0, "ALC3253" },
7d727869 1042 { 0x10ec0295, 0x1028, 0, "ALC3254" },
28f1f9b2 1043 { 0x10ec0299, 0x1028, 0, "ALC3271" },
e6e5f7ad
KY
1044 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1045 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1046 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1047 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1048 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1049 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1050 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1051 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1052 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1053 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1054 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
4b016931
KY
1055 { } /* terminator */
1056};
1057
08c189f2 1058static int alc_codec_rename_from_preset(struct hda_codec *codec)
1d045db9 1059{
08c189f2 1060 const struct alc_codec_rename_table *p;
4b016931 1061 const struct alc_codec_rename_pci_table *q;
60db6b53 1062
08c189f2 1063 for (p = rename_tbl; p->vendor_id; p++) {
7639a06c 1064 if (p->vendor_id != codec->core.vendor_id)
08c189f2
TI
1065 continue;
1066 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1067 return alc_codec_rename(codec, p->name);
1d045db9 1068 }
4b016931 1069
5100cd07
TI
1070 if (!codec->bus->pci)
1071 return 0;
4b016931 1072 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
7639a06c 1073 if (q->codec_vendor_id != codec->core.vendor_id)
4b016931
KY
1074 continue;
1075 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1076 continue;
1077 if (!q->pci_subdevice ||
1078 q->pci_subdevice == codec->bus->pci->subsystem_device)
1079 return alc_codec_rename(codec, q->name);
1080 }
1081
08c189f2 1082 return 0;
1d045db9 1083}
f53281e6 1084
e4770629 1085
1d045db9
TI
1086/*
1087 * Digital-beep handlers
1088 */
1089#ifdef CONFIG_SND_HDA_INPUT_BEEP
fea80fae
TI
1090
1091/* additional beep mixers; private_value will be overwritten */
1092static const struct snd_kcontrol_new alc_beep_mixer[] = {
1093 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1094 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1095};
1096
1097/* set up and create beep controls */
1098static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1099 int idx, int dir)
1100{
1101 struct snd_kcontrol_new *knew;
1102 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1103 int i;
1104
1105 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1106 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1107 &alc_beep_mixer[i]);
1108 if (!knew)
1109 return -ENOMEM;
1110 knew->private_value = beep_amp;
1111 }
1112 return 0;
1113}
84898e87 1114
6317e5eb 1115static const struct snd_pci_quirk beep_allow_list[] = {
7110005e 1116 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
a4b7f21d 1117 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1d045db9 1118 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
8554ee40 1119 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1d045db9
TI
1120 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1121 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1122 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
78f8baf1 1123 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1d045db9 1124 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
6317e5eb 1125 /* denylist -- no beep available */
051c78af
TI
1126 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1127 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1d045db9 1128 {}
fe3eb0a7
KY
1129};
1130
1d045db9
TI
1131static inline int has_cdefine_beep(struct hda_codec *codec)
1132{
1133 struct alc_spec *spec = codec->spec;
1134 const struct snd_pci_quirk *q;
6317e5eb 1135 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1d045db9
TI
1136 if (q)
1137 return q->value;
1138 return spec->cdefine.enable_pcbeep;
1139}
1140#else
fea80fae 1141#define set_beep_amp(spec, nid, idx, dir) 0
1d045db9
TI
1142#define has_cdefine_beep(codec) 0
1143#endif
84898e87 1144
1d045db9
TI
1145/* parse the BIOS configuration and set up the alc_spec */
1146/* return 1 if successful, 0 if the proper config is not found,
1147 * or a negative error code
1148 */
3e6179b8
TI
1149static int alc_parse_auto_config(struct hda_codec *codec,
1150 const hda_nid_t *ignore_nids,
1151 const hda_nid_t *ssid_nids)
1d045db9
TI
1152{
1153 struct alc_spec *spec = codec->spec;
08c189f2 1154 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1d045db9 1155 int err;
26f5df26 1156
53c334ad
TI
1157 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1158 spec->parse_flags);
1d045db9
TI
1159 if (err < 0)
1160 return err;
3e6179b8
TI
1161
1162 if (ssid_nids)
1163 alc_ssid_check(codec, ssid_nids);
64154835 1164
08c189f2
TI
1165 err = snd_hda_gen_parse_auto_config(codec, cfg);
1166 if (err < 0)
1167 return err;
070cff4c 1168
1d045db9 1169 return 1;
60db6b53 1170}
f6a92248 1171
3de95173
TI
1172/* common preparation job for alc_spec */
1173static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1174{
1175 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1176 int err;
1177
1178 if (!spec)
1179 return -ENOMEM;
1180 codec->spec = spec;
08c189f2
TI
1181 snd_hda_gen_spec_init(&spec->gen);
1182 spec->gen.mixer_nid = mixer_nid;
1183 spec->gen.own_eapd_ctl = 1;
1098b7c2 1184 codec->single_adc_amp = 1;
08c189f2
TI
1185 /* FIXME: do we need this for all Realtek codec models? */
1186 codec->spdif_status_reset = 1;
a6e7d0a4 1187 codec->forced_resume = 1;
225068ab 1188 codec->patch_ops = alc_patch_ops;
1b35106e 1189 mutex_init(&spec->coef_mutex);
3de95173
TI
1190
1191 err = alc_codec_rename_from_preset(codec);
1192 if (err < 0) {
1193 kfree(spec);
1194 return err;
1195 }
1196 return 0;
1197}
1198
3e6179b8
TI
1199static int alc880_parse_auto_config(struct hda_codec *codec)
1200{
1201 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
7d7eb9ea 1202 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3e6179b8
TI
1203 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1204}
1205
ee3b2969
TI
1206/*
1207 * ALC880 fix-ups
1208 */
1209enum {
411225a0 1210 ALC880_FIXUP_GPIO1,
ee3b2969
TI
1211 ALC880_FIXUP_GPIO2,
1212 ALC880_FIXUP_MEDION_RIM,
dc6af52d 1213 ALC880_FIXUP_LG,
db8a38e5 1214 ALC880_FIXUP_LG_LW25,
f02aab5d 1215 ALC880_FIXUP_W810,
27e917f8 1216 ALC880_FIXUP_EAPD_COEF,
b9368f5c 1217 ALC880_FIXUP_TCL_S700,
cf5a2279
TI
1218 ALC880_FIXUP_VOL_KNOB,
1219 ALC880_FIXUP_FUJITSU,
ba533818 1220 ALC880_FIXUP_F1734,
817de92f 1221 ALC880_FIXUP_UNIWILL,
967b88c4 1222 ALC880_FIXUP_UNIWILL_DIG,
96e225f6 1223 ALC880_FIXUP_Z71V,
487a588d 1224 ALC880_FIXUP_ASUS_W5A,
67b6ec31
TI
1225 ALC880_FIXUP_3ST_BASE,
1226 ALC880_FIXUP_3ST,
1227 ALC880_FIXUP_3ST_DIG,
1228 ALC880_FIXUP_5ST_BASE,
1229 ALC880_FIXUP_5ST,
1230 ALC880_FIXUP_5ST_DIG,
1231 ALC880_FIXUP_6ST_BASE,
1232 ALC880_FIXUP_6ST,
1233 ALC880_FIXUP_6ST_DIG,
5397145f 1234 ALC880_FIXUP_6ST_AUTOMUTE,
ee3b2969
TI
1235};
1236
cf5a2279
TI
1237/* enable the volume-knob widget support on NID 0x21 */
1238static void alc880_fixup_vol_knob(struct hda_codec *codec,
1727a771 1239 const struct hda_fixup *fix, int action)
cf5a2279 1240{
1727a771 1241 if (action == HDA_FIXUP_ACT_PROBE)
62f949bf
TI
1242 snd_hda_jack_detect_enable_callback(codec, 0x21,
1243 alc_update_knob_master);
cf5a2279
TI
1244}
1245
1727a771 1246static const struct hda_fixup alc880_fixups[] = {
411225a0 1247 [ALC880_FIXUP_GPIO1] = {
5579cd6f
TI
1248 .type = HDA_FIXUP_FUNC,
1249 .v.func = alc_fixup_gpio1,
411225a0 1250 },
ee3b2969 1251 [ALC880_FIXUP_GPIO2] = {
5579cd6f
TI
1252 .type = HDA_FIXUP_FUNC,
1253 .v.func = alc_fixup_gpio2,
ee3b2969
TI
1254 },
1255 [ALC880_FIXUP_MEDION_RIM] = {
1727a771 1256 .type = HDA_FIXUP_VERBS,
ee3b2969
TI
1257 .v.verbs = (const struct hda_verb[]) {
1258 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1259 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1260 { }
1261 },
1262 .chained = true,
1263 .chain_id = ALC880_FIXUP_GPIO2,
1264 },
dc6af52d 1265 [ALC880_FIXUP_LG] = {
1727a771
TI
1266 .type = HDA_FIXUP_PINS,
1267 .v.pins = (const struct hda_pintbl[]) {
dc6af52d
TI
1268 /* disable bogus unused pins */
1269 { 0x16, 0x411111f0 },
1270 { 0x18, 0x411111f0 },
1271 { 0x1a, 0x411111f0 },
1272 { }
1273 }
1274 },
db8a38e5
TI
1275 [ALC880_FIXUP_LG_LW25] = {
1276 .type = HDA_FIXUP_PINS,
1277 .v.pins = (const struct hda_pintbl[]) {
1278 { 0x1a, 0x0181344f }, /* line-in */
1279 { 0x1b, 0x0321403f }, /* headphone */
1280 { }
1281 }
1282 },
f02aab5d 1283 [ALC880_FIXUP_W810] = {
1727a771
TI
1284 .type = HDA_FIXUP_PINS,
1285 .v.pins = (const struct hda_pintbl[]) {
f02aab5d
TI
1286 /* disable bogus unused pins */
1287 { 0x17, 0x411111f0 },
1288 { }
1289 },
1290 .chained = true,
1291 .chain_id = ALC880_FIXUP_GPIO2,
1292 },
27e917f8 1293 [ALC880_FIXUP_EAPD_COEF] = {
1727a771 1294 .type = HDA_FIXUP_VERBS,
27e917f8
TI
1295 .v.verbs = (const struct hda_verb[]) {
1296 /* change to EAPD mode */
1297 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1298 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1299 {}
1300 },
1301 },
b9368f5c 1302 [ALC880_FIXUP_TCL_S700] = {
1727a771 1303 .type = HDA_FIXUP_VERBS,
b9368f5c
TI
1304 .v.verbs = (const struct hda_verb[]) {
1305 /* change to EAPD mode */
1306 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1307 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1308 {}
1309 },
1310 .chained = true,
1311 .chain_id = ALC880_FIXUP_GPIO2,
1312 },
cf5a2279 1313 [ALC880_FIXUP_VOL_KNOB] = {
1727a771 1314 .type = HDA_FIXUP_FUNC,
cf5a2279
TI
1315 .v.func = alc880_fixup_vol_knob,
1316 },
1317 [ALC880_FIXUP_FUJITSU] = {
1318 /* override all pins as BIOS on old Amilo is broken */
1727a771
TI
1319 .type = HDA_FIXUP_PINS,
1320 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1321 { 0x14, 0x0121401f }, /* HP */
cf5a2279
TI
1322 { 0x15, 0x99030120 }, /* speaker */
1323 { 0x16, 0x99030130 }, /* bass speaker */
1324 { 0x17, 0x411111f0 }, /* N/A */
1325 { 0x18, 0x411111f0 }, /* N/A */
1326 { 0x19, 0x01a19950 }, /* mic-in */
1327 { 0x1a, 0x411111f0 }, /* N/A */
1328 { 0x1b, 0x411111f0 }, /* N/A */
1329 { 0x1c, 0x411111f0 }, /* N/A */
1330 { 0x1d, 0x411111f0 }, /* N/A */
1331 { 0x1e, 0x01454140 }, /* SPDIF out */
1332 { }
1333 },
1334 .chained = true,
1335 .chain_id = ALC880_FIXUP_VOL_KNOB,
1336 },
ba533818
TI
1337 [ALC880_FIXUP_F1734] = {
1338 /* almost compatible with FUJITSU, but no bass and SPDIF */
1727a771
TI
1339 .type = HDA_FIXUP_PINS,
1340 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1341 { 0x14, 0x0121401f }, /* HP */
ba533818
TI
1342 { 0x15, 0x99030120 }, /* speaker */
1343 { 0x16, 0x411111f0 }, /* N/A */
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, 0x411111f0 }, /* N/A */
1352 { }
1353 },
1354 .chained = true,
1355 .chain_id = ALC880_FIXUP_VOL_KNOB,
1356 },
817de92f
TI
1357 [ALC880_FIXUP_UNIWILL] = {
1358 /* need to fix HP and speaker pins to be parsed correctly */
1727a771
TI
1359 .type = HDA_FIXUP_PINS,
1360 .v.pins = (const struct hda_pintbl[]) {
817de92f
TI
1361 { 0x14, 0x0121411f }, /* HP */
1362 { 0x15, 0x99030120 }, /* speaker */
1363 { 0x16, 0x99030130 }, /* bass speaker */
1364 { }
1365 },
1366 },
967b88c4 1367 [ALC880_FIXUP_UNIWILL_DIG] = {
1727a771
TI
1368 .type = HDA_FIXUP_PINS,
1369 .v.pins = (const struct hda_pintbl[]) {
967b88c4
TI
1370 /* disable bogus unused pins */
1371 { 0x17, 0x411111f0 },
1372 { 0x19, 0x411111f0 },
1373 { 0x1b, 0x411111f0 },
1374 { 0x1f, 0x411111f0 },
1375 { }
1376 }
1377 },
96e225f6 1378 [ALC880_FIXUP_Z71V] = {
1727a771
TI
1379 .type = HDA_FIXUP_PINS,
1380 .v.pins = (const struct hda_pintbl[]) {
96e225f6
TI
1381 /* set up the whole pins as BIOS is utterly broken */
1382 { 0x14, 0x99030120 }, /* speaker */
1383 { 0x15, 0x0121411f }, /* HP */
1384 { 0x16, 0x411111f0 }, /* N/A */
1385 { 0x17, 0x411111f0 }, /* N/A */
1386 { 0x18, 0x01a19950 }, /* mic-in */
1387 { 0x19, 0x411111f0 }, /* N/A */
1388 { 0x1a, 0x01813031 }, /* line-in */
1389 { 0x1b, 0x411111f0 }, /* N/A */
1390 { 0x1c, 0x411111f0 }, /* N/A */
1391 { 0x1d, 0x411111f0 }, /* N/A */
1392 { 0x1e, 0x0144111e }, /* SPDIF */
1393 { }
1394 }
1395 },
487a588d
TI
1396 [ALC880_FIXUP_ASUS_W5A] = {
1397 .type = HDA_FIXUP_PINS,
1398 .v.pins = (const struct hda_pintbl[]) {
1399 /* set up the whole pins as BIOS is utterly broken */
1400 { 0x14, 0x0121411f }, /* HP */
1401 { 0x15, 0x411111f0 }, /* N/A */
1402 { 0x16, 0x411111f0 }, /* N/A */
1403 { 0x17, 0x411111f0 }, /* N/A */
1404 { 0x18, 0x90a60160 }, /* mic */
1405 { 0x19, 0x411111f0 }, /* N/A */
1406 { 0x1a, 0x411111f0 }, /* N/A */
1407 { 0x1b, 0x411111f0 }, /* N/A */
1408 { 0x1c, 0x411111f0 }, /* N/A */
1409 { 0x1d, 0x411111f0 }, /* N/A */
1410 { 0x1e, 0xb743111e }, /* SPDIF out */
1411 { }
1412 },
1413 .chained = true,
1414 .chain_id = ALC880_FIXUP_GPIO1,
1415 },
67b6ec31 1416 [ALC880_FIXUP_3ST_BASE] = {
1727a771
TI
1417 .type = HDA_FIXUP_PINS,
1418 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1419 { 0x14, 0x01014010 }, /* line-out */
1420 { 0x15, 0x411111f0 }, /* N/A */
1421 { 0x16, 0x411111f0 }, /* N/A */
1422 { 0x17, 0x411111f0 }, /* N/A */
1423 { 0x18, 0x01a19c30 }, /* mic-in */
1424 { 0x19, 0x0121411f }, /* HP */
1425 { 0x1a, 0x01813031 }, /* line-in */
1426 { 0x1b, 0x02a19c40 }, /* front-mic */
1427 { 0x1c, 0x411111f0 }, /* N/A */
1428 { 0x1d, 0x411111f0 }, /* N/A */
1429 /* 0x1e is filled in below */
1430 { 0x1f, 0x411111f0 }, /* N/A */
1431 { }
1432 }
1433 },
1434 [ALC880_FIXUP_3ST] = {
1727a771
TI
1435 .type = HDA_FIXUP_PINS,
1436 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1437 { 0x1e, 0x411111f0 }, /* N/A */
1438 { }
1439 },
1440 .chained = true,
1441 .chain_id = ALC880_FIXUP_3ST_BASE,
1442 },
1443 [ALC880_FIXUP_3ST_DIG] = {
1727a771
TI
1444 .type = HDA_FIXUP_PINS,
1445 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1446 { 0x1e, 0x0144111e }, /* SPDIF */
1447 { }
1448 },
1449 .chained = true,
1450 .chain_id = ALC880_FIXUP_3ST_BASE,
1451 },
1452 [ALC880_FIXUP_5ST_BASE] = {
1727a771
TI
1453 .type = HDA_FIXUP_PINS,
1454 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1455 { 0x14, 0x01014010 }, /* front */
1456 { 0x15, 0x411111f0 }, /* N/A */
1457 { 0x16, 0x01011411 }, /* CLFE */
1458 { 0x17, 0x01016412 }, /* surr */
1459 { 0x18, 0x01a19c30 }, /* mic-in */
1460 { 0x19, 0x0121411f }, /* HP */
1461 { 0x1a, 0x01813031 }, /* line-in */
1462 { 0x1b, 0x02a19c40 }, /* front-mic */
1463 { 0x1c, 0x411111f0 }, /* N/A */
1464 { 0x1d, 0x411111f0 }, /* N/A */
1465 /* 0x1e is filled in below */
1466 { 0x1f, 0x411111f0 }, /* N/A */
1467 { }
1468 }
1469 },
1470 [ALC880_FIXUP_5ST] = {
1727a771
TI
1471 .type = HDA_FIXUP_PINS,
1472 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1473 { 0x1e, 0x411111f0 }, /* N/A */
1474 { }
1475 },
1476 .chained = true,
1477 .chain_id = ALC880_FIXUP_5ST_BASE,
1478 },
1479 [ALC880_FIXUP_5ST_DIG] = {
1727a771
TI
1480 .type = HDA_FIXUP_PINS,
1481 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1482 { 0x1e, 0x0144111e }, /* SPDIF */
1483 { }
1484 },
1485 .chained = true,
1486 .chain_id = ALC880_FIXUP_5ST_BASE,
1487 },
1488 [ALC880_FIXUP_6ST_BASE] = {
1727a771
TI
1489 .type = HDA_FIXUP_PINS,
1490 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1491 { 0x14, 0x01014010 }, /* front */
1492 { 0x15, 0x01016412 }, /* surr */
1493 { 0x16, 0x01011411 }, /* CLFE */
1494 { 0x17, 0x01012414 }, /* side */
1495 { 0x18, 0x01a19c30 }, /* mic-in */
1496 { 0x19, 0x02a19c40 }, /* front-mic */
1497 { 0x1a, 0x01813031 }, /* line-in */
1498 { 0x1b, 0x0121411f }, /* HP */
1499 { 0x1c, 0x411111f0 }, /* N/A */
1500 { 0x1d, 0x411111f0 }, /* N/A */
1501 /* 0x1e is filled in below */
1502 { 0x1f, 0x411111f0 }, /* N/A */
1503 { }
1504 }
1505 },
1506 [ALC880_FIXUP_6ST] = {
1727a771
TI
1507 .type = HDA_FIXUP_PINS,
1508 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1509 { 0x1e, 0x411111f0 }, /* N/A */
1510 { }
1511 },
1512 .chained = true,
1513 .chain_id = ALC880_FIXUP_6ST_BASE,
1514 },
1515 [ALC880_FIXUP_6ST_DIG] = {
1727a771
TI
1516 .type = HDA_FIXUP_PINS,
1517 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1518 { 0x1e, 0x0144111e }, /* SPDIF */
1519 { }
1520 },
1521 .chained = true,
1522 .chain_id = ALC880_FIXUP_6ST_BASE,
1523 },
5397145f
TI
1524 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1525 .type = HDA_FIXUP_PINS,
1526 .v.pins = (const struct hda_pintbl[]) {
1527 { 0x1b, 0x0121401f }, /* HP with jack detect */
1528 { }
1529 },
1530 .chained_before = true,
1531 .chain_id = ALC880_FIXUP_6ST_BASE,
1532 },
ee3b2969
TI
1533};
1534
1535static const struct snd_pci_quirk alc880_fixup_tbl[] = {
f02aab5d 1536 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
487a588d 1537 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
96e225f6 1538 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
29e3fdcc 1539 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
6538de03 1540 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
29e3fdcc 1541 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
27e917f8 1542 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
967b88c4 1543 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
ba533818 1544 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
817de92f 1545 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
7833c7e8 1546 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
f02aab5d 1547 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
ee3b2969 1548 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
5397145f 1549 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
a161574e 1550 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
cf5a2279 1551 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
ba533818 1552 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
cf5a2279 1553 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
dc6af52d
TI
1554 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1555 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1556 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
db8a38e5 1557 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
b9368f5c 1558 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
67b6ec31
TI
1559
1560 /* Below is the copied entries from alc880_quirks.c.
1561 * It's not quite sure whether BIOS sets the correct pin-config table
1562 * on these machines, thus they are kept to be compatible with
1563 * the old static quirks. Once when it's confirmed to work without
1564 * these overrides, it'd be better to remove.
1565 */
1566 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1567 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1568 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1569 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1570 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1571 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1572 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1573 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1574 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1575 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1576 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1577 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1578 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1579 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1580 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1581 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1582 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1583 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1584 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1585 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1586 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1587 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1588 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1589 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1590 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1591 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1592 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1593 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1594 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1595 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1596 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1597 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1598 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1599 /* default Intel */
1600 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1601 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1602 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1603 {}
1604};
1605
1727a771 1606static const struct hda_model_fixup alc880_fixup_models[] = {
67b6ec31
TI
1607 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1608 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1609 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1610 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1611 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1612 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
5397145f 1613 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
ee3b2969
TI
1614 {}
1615};
1616
1617
1d045db9
TI
1618/*
1619 * OK, here we have finally the patch for ALC880
1620 */
1d045db9 1621static int patch_alc880(struct hda_codec *codec)
60db6b53 1622{
1d045db9 1623 struct alc_spec *spec;
1d045db9 1624 int err;
f6a92248 1625
3de95173
TI
1626 err = alc_alloc_spec(codec, 0x0b);
1627 if (err < 0)
1628 return err;
64154835 1629
3de95173 1630 spec = codec->spec;
08c189f2 1631 spec->gen.need_dac_fix = 1;
7504b6cd 1632 spec->gen.beep_nid = 0x01;
f53281e6 1633
225068ab
TI
1634 codec->patch_ops.unsol_event = alc880_unsol_event;
1635
c9af753f
TI
1636 alc_pre_init(codec);
1637
1727a771 1638 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
67b6ec31 1639 alc880_fixups);
1727a771 1640 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ee3b2969 1641
67b6ec31
TI
1642 /* automatic parse from the BIOS config */
1643 err = alc880_parse_auto_config(codec);
1644 if (err < 0)
1645 goto error;
fe3eb0a7 1646
fea80fae
TI
1647 if (!spec->gen.no_analog) {
1648 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1649 if (err < 0)
1650 goto error;
1651 }
f53281e6 1652
1727a771 1653 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1654
1d045db9 1655 return 0;
e16fb6d1
TI
1656
1657 error:
1658 alc_free(codec);
1659 return err;
226b1ec8
KY
1660}
1661
1d045db9 1662
60db6b53 1663/*
1d045db9 1664 * ALC260 support
60db6b53 1665 */
1d045db9 1666static int alc260_parse_auto_config(struct hda_codec *codec)
f6a92248 1667{
1d045db9 1668 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
3e6179b8
TI
1669 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1670 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
f6a92248
KY
1671}
1672
1d045db9
TI
1673/*
1674 * Pin config fixes
1675 */
1676enum {
ca8f0424
TI
1677 ALC260_FIXUP_HP_DC5750,
1678 ALC260_FIXUP_HP_PIN_0F,
1679 ALC260_FIXUP_COEF,
15317ab2 1680 ALC260_FIXUP_GPIO1,
20f7d928
TI
1681 ALC260_FIXUP_GPIO1_TOGGLE,
1682 ALC260_FIXUP_REPLACER,
0a1c4fa2 1683 ALC260_FIXUP_HP_B1900,
118cb4a4 1684 ALC260_FIXUP_KN1,
39aedee7 1685 ALC260_FIXUP_FSC_S7020,
5ebd3bbd 1686 ALC260_FIXUP_FSC_S7020_JWSE,
d08c5ef2 1687 ALC260_FIXUP_VAIO_PINS,
1d045db9
TI
1688};
1689
20f7d928
TI
1690static void alc260_gpio1_automute(struct hda_codec *codec)
1691{
1692 struct alc_spec *spec = codec->spec;
aaf312de
TI
1693
1694 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
20f7d928
TI
1695}
1696
1697static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1727a771 1698 const struct hda_fixup *fix, int action)
20f7d928
TI
1699{
1700 struct alc_spec *spec = codec->spec;
1727a771 1701 if (action == HDA_FIXUP_ACT_PROBE) {
20f7d928
TI
1702 /* although the machine has only one output pin, we need to
1703 * toggle GPIO1 according to the jack state
1704 */
08c189f2
TI
1705 spec->gen.automute_hook = alc260_gpio1_automute;
1706 spec->gen.detect_hp = 1;
1707 spec->gen.automute_speaker = 1;
1708 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
62f949bf 1709 snd_hda_jack_detect_enable_callback(codec, 0x0f,
08c189f2 1710 snd_hda_gen_hp_automute);
5579cd6f 1711 alc_setup_gpio(codec, 0x01);
20f7d928
TI
1712 }
1713}
1714
118cb4a4 1715static void alc260_fixup_kn1(struct hda_codec *codec,
1727a771 1716 const struct hda_fixup *fix, int action)
118cb4a4
TI
1717{
1718 struct alc_spec *spec = codec->spec;
1727a771 1719 static const struct hda_pintbl pincfgs[] = {
118cb4a4
TI
1720 { 0x0f, 0x02214000 }, /* HP/speaker */
1721 { 0x12, 0x90a60160 }, /* int mic */
1722 { 0x13, 0x02a19000 }, /* ext mic */
1723 { 0x18, 0x01446000 }, /* SPDIF out */
1724 /* disable bogus I/O pins */
1725 { 0x10, 0x411111f0 },
1726 { 0x11, 0x411111f0 },
1727 { 0x14, 0x411111f0 },
1728 { 0x15, 0x411111f0 },
1729 { 0x16, 0x411111f0 },
1730 { 0x17, 0x411111f0 },
1731 { 0x19, 0x411111f0 },
1732 { }
1733 };
1734
1735 switch (action) {
1727a771
TI
1736 case HDA_FIXUP_ACT_PRE_PROBE:
1737 snd_hda_apply_pincfgs(codec, pincfgs);
118cb4a4
TI
1738 spec->init_amp = ALC_INIT_NONE;
1739 break;
1740 }
1741}
1742
39aedee7
TI
1743static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1744 const struct hda_fixup *fix, int action)
1745{
1746 struct alc_spec *spec = codec->spec;
1c76aa5f 1747 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5ebd3bbd
TI
1748 spec->init_amp = ALC_INIT_NONE;
1749}
39aedee7 1750
5ebd3bbd
TI
1751static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1752 const struct hda_fixup *fix, int action)
1753{
1754 struct alc_spec *spec = codec->spec;
1755 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
f811c3cf 1756 spec->gen.add_jack_modes = 1;
5ebd3bbd 1757 spec->gen.hp_mic = 1;
e6e0ee50 1758 }
39aedee7
TI
1759}
1760
1727a771 1761static const struct hda_fixup alc260_fixups[] = {
ca8f0424 1762 [ALC260_FIXUP_HP_DC5750] = {
1727a771
TI
1763 .type = HDA_FIXUP_PINS,
1764 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
1765 { 0x11, 0x90130110 }, /* speaker */
1766 { }
1767 }
1768 },
ca8f0424 1769 [ALC260_FIXUP_HP_PIN_0F] = {
1727a771
TI
1770 .type = HDA_FIXUP_PINS,
1771 .v.pins = (const struct hda_pintbl[]) {
ca8f0424
TI
1772 { 0x0f, 0x01214000 }, /* HP */
1773 { }
1774 }
1775 },
1776 [ALC260_FIXUP_COEF] = {
1727a771 1777 .type = HDA_FIXUP_VERBS,
ca8f0424 1778 .v.verbs = (const struct hda_verb[]) {
e30cf2d2
RM
1779 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1780 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
ca8f0424
TI
1781 { }
1782 },
ca8f0424 1783 },
15317ab2 1784 [ALC260_FIXUP_GPIO1] = {
5579cd6f
TI
1785 .type = HDA_FIXUP_FUNC,
1786 .v.func = alc_fixup_gpio1,
15317ab2 1787 },
20f7d928 1788 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1727a771 1789 .type = HDA_FIXUP_FUNC,
20f7d928
TI
1790 .v.func = alc260_fixup_gpio1_toggle,
1791 .chained = true,
1792 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1793 },
1794 [ALC260_FIXUP_REPLACER] = {
1727a771 1795 .type = HDA_FIXUP_VERBS,
20f7d928 1796 .v.verbs = (const struct hda_verb[]) {
192a98e2
TI
1797 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1798 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
20f7d928
TI
1799 { }
1800 },
1801 .chained = true,
1802 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1803 },
0a1c4fa2 1804 [ALC260_FIXUP_HP_B1900] = {
1727a771 1805 .type = HDA_FIXUP_FUNC,
0a1c4fa2
TI
1806 .v.func = alc260_fixup_gpio1_toggle,
1807 .chained = true,
1808 .chain_id = ALC260_FIXUP_COEF,
118cb4a4
TI
1809 },
1810 [ALC260_FIXUP_KN1] = {
1727a771 1811 .type = HDA_FIXUP_FUNC,
118cb4a4
TI
1812 .v.func = alc260_fixup_kn1,
1813 },
39aedee7
TI
1814 [ALC260_FIXUP_FSC_S7020] = {
1815 .type = HDA_FIXUP_FUNC,
1816 .v.func = alc260_fixup_fsc_s7020,
1817 },
5ebd3bbd
TI
1818 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1819 .type = HDA_FIXUP_FUNC,
1820 .v.func = alc260_fixup_fsc_s7020_jwse,
1821 .chained = true,
1822 .chain_id = ALC260_FIXUP_FSC_S7020,
1823 },
d08c5ef2
TI
1824 [ALC260_FIXUP_VAIO_PINS] = {
1825 .type = HDA_FIXUP_PINS,
1826 .v.pins = (const struct hda_pintbl[]) {
1827 /* Pin configs are missing completely on some VAIOs */
1828 { 0x0f, 0x01211020 },
1829 { 0x10, 0x0001003f },
1830 { 0x11, 0x411111f0 },
1831 { 0x12, 0x01a15930 },
1832 { 0x13, 0x411111f0 },
1833 { 0x14, 0x411111f0 },
1834 { 0x15, 0x411111f0 },
1835 { 0x16, 0x411111f0 },
1836 { 0x17, 0x411111f0 },
1837 { 0x18, 0x411111f0 },
1838 { 0x19, 0x411111f0 },
1839 { }
1840 }
1841 },
1d045db9
TI
1842};
1843
1844static const struct snd_pci_quirk alc260_fixup_tbl[] = {
15317ab2 1845 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
ca8f0424 1846 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
15317ab2 1847 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
ca8f0424 1848 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
0a1c4fa2 1849 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
d08c5ef2 1850 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
0f5a5b85 1851 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
39aedee7 1852 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
b1f58085 1853 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
118cb4a4 1854 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
20f7d928 1855 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
ca8f0424 1856 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1d045db9
TI
1857 {}
1858};
1859
5ebd3bbd
TI
1860static const struct hda_model_fixup alc260_fixup_models[] = {
1861 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1862 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1863 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1864 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1865 {}
1866};
1867
1d045db9
TI
1868/*
1869 */
1d045db9 1870static int patch_alc260(struct hda_codec *codec)
977ddd6b 1871{
1d045db9 1872 struct alc_spec *spec;
c3c2c9e7 1873 int err;
1d045db9 1874
3de95173
TI
1875 err = alc_alloc_spec(codec, 0x07);
1876 if (err < 0)
1877 return err;
1d045db9 1878
3de95173 1879 spec = codec->spec;
ea46c3c8
TI
1880 /* as quite a few machines require HP amp for speaker outputs,
1881 * it's easier to enable it unconditionally; even if it's unneeded,
1882 * it's almost harmless.
1883 */
1884 spec->gen.prefer_hp_amp = 1;
7504b6cd 1885 spec->gen.beep_nid = 0x01;
1d045db9 1886
225068ab
TI
1887 spec->shutup = alc_eapd_shutup;
1888
c9af753f
TI
1889 alc_pre_init(codec);
1890
5ebd3bbd
TI
1891 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1892 alc260_fixups);
1727a771 1893 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
977ddd6b 1894
c3c2c9e7
TI
1895 /* automatic parse from the BIOS config */
1896 err = alc260_parse_auto_config(codec);
1897 if (err < 0)
1898 goto error;
977ddd6b 1899
fea80fae
TI
1900 if (!spec->gen.no_analog) {
1901 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1902 if (err < 0)
1903 goto error;
1904 }
977ddd6b 1905
1727a771 1906 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1907
1d045db9 1908 return 0;
e16fb6d1
TI
1909
1910 error:
1911 alc_free(codec);
1912 return err;
6981d184
TI
1913}
1914
1d045db9
TI
1915
1916/*
1917 * ALC882/883/885/888/889 support
1918 *
1919 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1920 * configuration. Each pin widget can choose any input DACs and a mixer.
1921 * Each ADC is connected from a mixer of all inputs. This makes possible
1922 * 6-channel independent captures.
1923 *
1924 * In addition, an independent DAC for the multi-playback (not used in this
1925 * driver yet).
1926 */
1d045db9
TI
1927
1928/*
1929 * Pin config fixes
1930 */
ff818c24 1931enum {
5c0ebfbe
TI
1932 ALC882_FIXUP_ABIT_AW9D_MAX,
1933 ALC882_FIXUP_LENOVO_Y530,
1934 ALC882_FIXUP_PB_M5210,
1935 ALC882_FIXUP_ACER_ASPIRE_7736,
1936 ALC882_FIXUP_ASUS_W90V,
8f239214 1937 ALC889_FIXUP_CD,
b2c53e20 1938 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
5c0ebfbe 1939 ALC889_FIXUP_VAIO_TT,
0e7cc2e7 1940 ALC888_FIXUP_EEE1601,
4841b8e6 1941 ALC886_FIXUP_EAPD,
177943a3 1942 ALC882_FIXUP_EAPD,
7a6069bf 1943 ALC883_FIXUP_EAPD,
8812c4f9 1944 ALC883_FIXUP_ACER_EAPD,
1a97b7f2
TI
1945 ALC882_FIXUP_GPIO1,
1946 ALC882_FIXUP_GPIO2,
eb844d51 1947 ALC882_FIXUP_GPIO3,
68ef0561
TI
1948 ALC889_FIXUP_COEF,
1949 ALC882_FIXUP_ASUS_W2JC,
c3e837bb
TI
1950 ALC882_FIXUP_ACER_ASPIRE_4930G,
1951 ALC882_FIXUP_ACER_ASPIRE_8930G,
1952 ALC882_FIXUP_ASPIRE_8930G_VERBS,
5671087f 1953 ALC885_FIXUP_MACPRO_GPIO,
02a237b2 1954 ALC889_FIXUP_DAC_ROUTE,
1a97b7f2
TI
1955 ALC889_FIXUP_MBP_VREF,
1956 ALC889_FIXUP_IMAC91_VREF,
e7729a41 1957 ALC889_FIXUP_MBA11_VREF,
0756f09c 1958 ALC889_FIXUP_MBA21_VREF,
c20f31ec 1959 ALC889_FIXUP_MP11_VREF,
9f660a1c 1960 ALC889_FIXUP_MP41_VREF,
6e72aa5f 1961 ALC882_FIXUP_INV_DMIC,
e427c237 1962 ALC882_FIXUP_NO_PRIMARY_HP,
1f0bbf03 1963 ALC887_FIXUP_ASUS_BASS,
eb9ca3ab 1964 ALC887_FIXUP_BASS_CHMAP,
7beb3a6e 1965 ALC1220_FIXUP_GB_DUAL_CODECS,
5853e364 1966 ALC1220_FIXUP_GB_X570,
0202f5cd 1967 ALC1220_FIXUP_CLEVO_P950,
80690a27
RS
1968 ALC1220_FIXUP_CLEVO_PB51ED,
1969 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
ca184355
JHP
1970 ALC887_FIXUP_ASUS_AUDIO,
1971 ALC887_FIXUP_ASUS_HMIC,
ff818c24
TI
1972};
1973
68ef0561 1974static void alc889_fixup_coef(struct hda_codec *codec,
1727a771 1975 const struct hda_fixup *fix, int action)
68ef0561 1976{
1727a771 1977 if (action != HDA_FIXUP_ACT_INIT)
68ef0561 1978 return;
1df8874b 1979 alc_update_coef_idx(codec, 7, 0, 0x2030);
68ef0561
TI
1980}
1981
5671087f
TI
1982/* set up GPIO at initialization */
1983static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1727a771 1984 const struct hda_fixup *fix, int action)
5671087f 1985{
215c850c
TI
1986 struct alc_spec *spec = codec->spec;
1987
1988 spec->gpio_write_delay = true;
1989 alc_fixup_gpio3(codec, fix, action);
5671087f
TI
1990}
1991
02a237b2
TI
1992/* Fix the connection of some pins for ALC889:
1993 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1994 * work correctly (bko#42740)
1995 */
1996static void alc889_fixup_dac_route(struct hda_codec *codec,
1727a771 1997 const struct hda_fixup *fix, int action)
02a237b2 1998{
1727a771 1999 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ef8d60fb 2000 /* fake the connections during parsing the tree */
caf3c043
MM
2001 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2002 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2003 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2004 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2005 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2006 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1727a771 2007 } else if (action == HDA_FIXUP_ACT_PROBE) {
ef8d60fb 2008 /* restore the connections */
caf3c043
MM
2009 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2010 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2011 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2012 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2013 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
02a237b2
TI
2014 }
2015}
2016
1a97b7f2
TI
2017/* Set VREF on HP pin */
2018static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1727a771 2019 const struct hda_fixup *fix, int action)
1a97b7f2 2020{
caf3c043 2021 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1a97b7f2 2022 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2023 int i;
2024
1727a771 2025 if (action != HDA_FIXUP_ACT_INIT)
1a97b7f2
TI
2026 return;
2027 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2028 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2029 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2030 continue;
d3f02d60 2031 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2032 val |= AC_PINCTL_VREF_80;
cdd03ced 2033 snd_hda_set_pin_ctl(codec, nids[i], val);
08c189f2 2034 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2035 break;
2036 }
2037}
2038
0756f09c
TI
2039static void alc889_fixup_mac_pins(struct hda_codec *codec,
2040 const hda_nid_t *nids, int num_nids)
1a97b7f2
TI
2041{
2042 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2043 int i;
2044
0756f09c 2045 for (i = 0; i < num_nids; i++) {
1a97b7f2 2046 unsigned int val;
d3f02d60 2047 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2048 val |= AC_PINCTL_VREF_50;
cdd03ced 2049 snd_hda_set_pin_ctl(codec, nids[i], val);
1a97b7f2 2050 }
08c189f2 2051 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2052}
2053
0756f09c
TI
2054/* Set VREF on speaker pins on imac91 */
2055static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2056 const struct hda_fixup *fix, int action)
2057{
caf3c043 2058 static const hda_nid_t nids[] = { 0x18, 0x1a };
0756f09c
TI
2059
2060 if (action == HDA_FIXUP_ACT_INIT)
2061 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2062}
2063
e7729a41
AV
2064/* Set VREF on speaker pins on mba11 */
2065static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2066 const struct hda_fixup *fix, int action)
2067{
caf3c043 2068 static const hda_nid_t nids[] = { 0x18 };
e7729a41
AV
2069
2070 if (action == HDA_FIXUP_ACT_INIT)
2071 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2072}
2073
0756f09c
TI
2074/* Set VREF on speaker pins on mba21 */
2075static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2076 const struct hda_fixup *fix, int action)
2077{
caf3c043 2078 static const hda_nid_t nids[] = { 0x18, 0x19 };
0756f09c
TI
2079
2080 if (action == HDA_FIXUP_ACT_INIT)
2081 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2082}
2083
e427c237 2084/* Don't take HP output as primary
d9111496
FLVC
2085 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2086 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
e427c237
TI
2087 */
2088static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1727a771 2089 const struct hda_fixup *fix, int action)
e427c237
TI
2090{
2091 struct alc_spec *spec = codec->spec;
da96fb5b 2092 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
08c189f2 2093 spec->gen.no_primary_hp = 1;
da96fb5b
TI
2094 spec->gen.no_multi_io = 1;
2095 }
e427c237
TI
2096}
2097
eb9ca3ab
TI
2098static void alc_fixup_bass_chmap(struct hda_codec *codec,
2099 const struct hda_fixup *fix, int action);
2100
7beb3a6e
TI
2101/* For dual-codec configuration, we need to disable some features to avoid
2102 * conflicts of kctls and PCM streams
2103 */
2104static void alc_fixup_dual_codecs(struct hda_codec *codec,
2105 const struct hda_fixup *fix, int action)
2106{
2107 struct alc_spec *spec = codec->spec;
2108
2109 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2110 return;
2111 /* disable vmaster */
2112 spec->gen.suppress_vmaster = 1;
2113 /* auto-mute and auto-mic switch don't work with multiple codecs */
2114 spec->gen.suppress_auto_mute = 1;
2115 spec->gen.suppress_auto_mic = 1;
2116 /* disable aamix as well */
2117 spec->gen.mixer_nid = 0;
2118 /* add location prefix to avoid conflicts */
2119 codec->force_pin_prefix = 1;
2120}
2121
2122static void rename_ctl(struct hda_codec *codec, const char *oldname,
2123 const char *newname)
2124{
2125 struct snd_kcontrol *kctl;
2126
2127 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2128 if (kctl)
2129 strcpy(kctl->id.name, newname);
2130}
2131
2132static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2133 const struct hda_fixup *fix,
2134 int action)
2135{
2136 alc_fixup_dual_codecs(codec, fix, action);
2137 switch (action) {
2138 case HDA_FIXUP_ACT_PRE_PROBE:
2139 /* override card longname to provide a unique UCM profile */
2140 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2141 break;
2142 case HDA_FIXUP_ACT_BUILD:
2143 /* rename Capture controls depending on the codec */
2144 rename_ctl(codec, "Capture Volume",
2145 codec->addr == 0 ?
2146 "Rear-Panel Capture Volume" :
2147 "Front-Panel Capture Volume");
2148 rename_ctl(codec, "Capture Switch",
2149 codec->addr == 0 ?
2150 "Rear-Panel Capture Switch" :
2151 "Front-Panel Capture Switch");
2152 break;
2153 }
2154}
2155
5853e364
CL
2156static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2157 const struct hda_fixup *fix,
2158 int action)
2159{
2160 static const hda_nid_t conn1[] = { 0x0c };
2161 static const struct coef_fw gb_x570_coefs[] = {
2162 WRITE_COEF(0x1a, 0x01c1),
2163 WRITE_COEF(0x1b, 0x0202),
2164 WRITE_COEF(0x43, 0x3005),
2165 {}
2166 };
2167
2168 switch (action) {
2169 case HDA_FIXUP_ACT_PRE_PROBE:
2170 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2171 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2172 break;
2173 case HDA_FIXUP_ACT_INIT:
2174 alc_process_coef_fw(codec, gb_x570_coefs);
2175 break;
2176 }
2177}
2178
0202f5cd
P
2179static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2180 const struct hda_fixup *fix,
2181 int action)
2182{
caf3c043 2183 static const hda_nid_t conn1[] = { 0x0c };
0202f5cd
P
2184
2185 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2186 return;
2187
2188 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2189 /* We therefore want to make sure 0x14 (front headphone) and
2190 * 0x1b (speakers) use the stereo DAC 0x02
2191 */
caf3c043
MM
2192 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2193 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
0202f5cd
P
2194}
2195
7f665b1c
JS
2196static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2197 const struct hda_fixup *fix, int action);
2198
80690a27 2199static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
7f665b1c
JS
2200 const struct hda_fixup *fix,
2201 int action)
2202{
2203 alc1220_fixup_clevo_p950(codec, fix, action);
2204 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2205}
2206
ca184355
JHP
2207static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2208 struct hda_jack_callback *jack)
2209{
2210 struct alc_spec *spec = codec->spec;
2211 unsigned int vref;
2212
2213 snd_hda_gen_hp_automute(codec, jack);
2214
2215 if (spec->gen.hp_jack_present)
2216 vref = AC_PINCTL_VREF_80;
2217 else
2218 vref = AC_PINCTL_VREF_HIZ;
2219 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2220}
2221
2222static void alc887_fixup_asus_jack(struct hda_codec *codec,
2223 const struct hda_fixup *fix, int action)
2224{
2225 struct alc_spec *spec = codec->spec;
2226 if (action != HDA_FIXUP_ACT_PROBE)
2227 return;
2228 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2229 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2230}
2231
1727a771 2232static const struct hda_fixup alc882_fixups[] = {
5c0ebfbe 2233 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
1727a771
TI
2234 .type = HDA_FIXUP_PINS,
2235 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2236 { 0x15, 0x01080104 }, /* side */
2237 { 0x16, 0x01011012 }, /* rear */
2238 { 0x17, 0x01016011 }, /* clfe */
2785591a 2239 { }
145a902b
DH
2240 }
2241 },
5c0ebfbe 2242 [ALC882_FIXUP_LENOVO_Y530] = {
1727a771
TI
2243 .type = HDA_FIXUP_PINS,
2244 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2245 { 0x15, 0x99130112 }, /* rear int speakers */
2246 { 0x16, 0x99130111 }, /* subwoofer */
ac612407
DH
2247 { }
2248 }
2249 },
5c0ebfbe 2250 [ALC882_FIXUP_PB_M5210] = {
fd108215
TI
2251 .type = HDA_FIXUP_PINCTLS,
2252 .v.pins = (const struct hda_pintbl[]) {
2253 { 0x19, PIN_VREF50 },
357f915e
KY
2254 {}
2255 }
2256 },
5c0ebfbe 2257 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
1727a771 2258 .type = HDA_FIXUP_FUNC,
23d30f28 2259 .v.func = alc_fixup_sku_ignore,
6981d184 2260 },
5c0ebfbe 2261 [ALC882_FIXUP_ASUS_W90V] = {
1727a771
TI
2262 .type = HDA_FIXUP_PINS,
2263 .v.pins = (const struct hda_pintbl[]) {
5cdf745e
TI
2264 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2265 { }
2266 }
2267 },
8f239214 2268 [ALC889_FIXUP_CD] = {
1727a771
TI
2269 .type = HDA_FIXUP_PINS,
2270 .v.pins = (const struct hda_pintbl[]) {
8f239214
MB
2271 { 0x1c, 0x993301f0 }, /* CD */
2272 { }
2273 }
2274 },
b2c53e20
DH
2275 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2276 .type = HDA_FIXUP_PINS,
2277 .v.pins = (const struct hda_pintbl[]) {
2278 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2279 { }
2280 },
2281 .chained = true,
2282 .chain_id = ALC889_FIXUP_CD,
2283 },
5c0ebfbe 2284 [ALC889_FIXUP_VAIO_TT] = {
1727a771
TI
2285 .type = HDA_FIXUP_PINS,
2286 .v.pins = (const struct hda_pintbl[]) {
5c0ebfbe
TI
2287 { 0x17, 0x90170111 }, /* hidden surround speaker */
2288 { }
2289 }
2290 },
0e7cc2e7 2291 [ALC888_FIXUP_EEE1601] = {
1727a771 2292 .type = HDA_FIXUP_VERBS,
0e7cc2e7
TI
2293 .v.verbs = (const struct hda_verb[]) {
2294 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2295 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2296 { }
2297 }
177943a3 2298 },
4841b8e6
PH
2299 [ALC886_FIXUP_EAPD] = {
2300 .type = HDA_FIXUP_VERBS,
2301 .v.verbs = (const struct hda_verb[]) {
2302 /* change to EAPD mode */
2303 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2304 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2305 { }
2306 }
2307 },
177943a3 2308 [ALC882_FIXUP_EAPD] = {
1727a771 2309 .type = HDA_FIXUP_VERBS,
177943a3
TI
2310 .v.verbs = (const struct hda_verb[]) {
2311 /* change to EAPD mode */
2312 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2313 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2314 { }
2315 }
2316 },
7a6069bf 2317 [ALC883_FIXUP_EAPD] = {
1727a771 2318 .type = HDA_FIXUP_VERBS,
7a6069bf
TI
2319 .v.verbs = (const struct hda_verb[]) {
2320 /* change to EAPD mode */
2321 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2322 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2323 { }
2324 }
2325 },
8812c4f9 2326 [ALC883_FIXUP_ACER_EAPD] = {
1727a771 2327 .type = HDA_FIXUP_VERBS,
8812c4f9
TI
2328 .v.verbs = (const struct hda_verb[]) {
2329 /* eanable EAPD on Acer laptops */
2330 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2331 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2332 { }
2333 }
2334 },
1a97b7f2 2335 [ALC882_FIXUP_GPIO1] = {
5579cd6f
TI
2336 .type = HDA_FIXUP_FUNC,
2337 .v.func = alc_fixup_gpio1,
1a97b7f2
TI
2338 },
2339 [ALC882_FIXUP_GPIO2] = {
5579cd6f
TI
2340 .type = HDA_FIXUP_FUNC,
2341 .v.func = alc_fixup_gpio2,
1a97b7f2 2342 },
eb844d51 2343 [ALC882_FIXUP_GPIO3] = {
5579cd6f
TI
2344 .type = HDA_FIXUP_FUNC,
2345 .v.func = alc_fixup_gpio3,
eb844d51 2346 },
68ef0561 2347 [ALC882_FIXUP_ASUS_W2JC] = {
5579cd6f
TI
2348 .type = HDA_FIXUP_FUNC,
2349 .v.func = alc_fixup_gpio1,
68ef0561
TI
2350 .chained = true,
2351 .chain_id = ALC882_FIXUP_EAPD,
2352 },
2353 [ALC889_FIXUP_COEF] = {
1727a771 2354 .type = HDA_FIXUP_FUNC,
68ef0561
TI
2355 .v.func = alc889_fixup_coef,
2356 },
c3e837bb 2357 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
1727a771
TI
2358 .type = HDA_FIXUP_PINS,
2359 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2360 { 0x16, 0x99130111 }, /* CLFE speaker */
2361 { 0x17, 0x99130112 }, /* surround speaker */
2362 { }
038d4fef
TI
2363 },
2364 .chained = true,
2365 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb
TI
2366 },
2367 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
1727a771
TI
2368 .type = HDA_FIXUP_PINS,
2369 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2370 { 0x16, 0x99130111 }, /* CLFE speaker */
2371 { 0x1b, 0x99130112 }, /* surround speaker */
2372 { }
2373 },
2374 .chained = true,
2375 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2376 },
2377 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2378 /* additional init verbs for Acer Aspire 8930G */
1727a771 2379 .type = HDA_FIXUP_VERBS,
c3e837bb
TI
2380 .v.verbs = (const struct hda_verb[]) {
2381 /* Enable all DACs */
2382 /* DAC DISABLE/MUTE 1? */
2383 /* setting bits 1-5 disables DAC nids 0x02-0x06
2384 * apparently. Init=0x38 */
2385 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2386 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2387 /* DAC DISABLE/MUTE 2? */
2388 /* some bit here disables the other DACs.
2389 * Init=0x4900 */
2390 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2391 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2392 /* DMIC fix
2393 * This laptop has a stereo digital microphone.
2394 * The mics are only 1cm apart which makes the stereo
2395 * useless. However, either the mic or the ALC889
2396 * makes the signal become a difference/sum signal
2397 * instead of standard stereo, which is annoying.
2398 * So instead we flip this bit which makes the
2399 * codec replicate the sum signal to both channels,
2400 * turning it into a normal mono mic.
2401 */
2402 /* DMIC_CONTROL? Init value = 0x0001 */
2403 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2404 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2405 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2406 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2407 { }
038d4fef
TI
2408 },
2409 .chained = true,
2410 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb 2411 },
5671087f 2412 [ALC885_FIXUP_MACPRO_GPIO] = {
1727a771 2413 .type = HDA_FIXUP_FUNC,
5671087f
TI
2414 .v.func = alc885_fixup_macpro_gpio,
2415 },
02a237b2 2416 [ALC889_FIXUP_DAC_ROUTE] = {
1727a771 2417 .type = HDA_FIXUP_FUNC,
02a237b2
TI
2418 .v.func = alc889_fixup_dac_route,
2419 },
1a97b7f2 2420 [ALC889_FIXUP_MBP_VREF] = {
1727a771 2421 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2422 .v.func = alc889_fixup_mbp_vref,
2423 .chained = true,
2424 .chain_id = ALC882_FIXUP_GPIO1,
2425 },
2426 [ALC889_FIXUP_IMAC91_VREF] = {
1727a771 2427 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2428 .v.func = alc889_fixup_imac91_vref,
2429 .chained = true,
2430 .chain_id = ALC882_FIXUP_GPIO1,
2431 },
e7729a41
AV
2432 [ALC889_FIXUP_MBA11_VREF] = {
2433 .type = HDA_FIXUP_FUNC,
2434 .v.func = alc889_fixup_mba11_vref,
2435 .chained = true,
2436 .chain_id = ALC889_FIXUP_MBP_VREF,
2437 },
0756f09c
TI
2438 [ALC889_FIXUP_MBA21_VREF] = {
2439 .type = HDA_FIXUP_FUNC,
2440 .v.func = alc889_fixup_mba21_vref,
2441 .chained = true,
2442 .chain_id = ALC889_FIXUP_MBP_VREF,
2443 },
c20f31ec
TI
2444 [ALC889_FIXUP_MP11_VREF] = {
2445 .type = HDA_FIXUP_FUNC,
2446 .v.func = alc889_fixup_mba11_vref,
2447 .chained = true,
2448 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2449 },
9f660a1c
MK
2450 [ALC889_FIXUP_MP41_VREF] = {
2451 .type = HDA_FIXUP_FUNC,
2452 .v.func = alc889_fixup_mbp_vref,
2453 .chained = true,
2454 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2455 },
6e72aa5f 2456 [ALC882_FIXUP_INV_DMIC] = {
1727a771 2457 .type = HDA_FIXUP_FUNC,
9d36a7dc 2458 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2459 },
e427c237 2460 [ALC882_FIXUP_NO_PRIMARY_HP] = {
1727a771 2461 .type = HDA_FIXUP_FUNC,
e427c237
TI
2462 .v.func = alc882_fixup_no_primary_hp,
2463 },
1f0bbf03
TI
2464 [ALC887_FIXUP_ASUS_BASS] = {
2465 .type = HDA_FIXUP_PINS,
2466 .v.pins = (const struct hda_pintbl[]) {
2467 {0x16, 0x99130130}, /* bass speaker */
2468 {}
2469 },
eb9ca3ab
TI
2470 .chained = true,
2471 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2472 },
2473 [ALC887_FIXUP_BASS_CHMAP] = {
2474 .type = HDA_FIXUP_FUNC,
2475 .v.func = alc_fixup_bass_chmap,
1f0bbf03 2476 },
7beb3a6e
TI
2477 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2478 .type = HDA_FIXUP_FUNC,
2479 .v.func = alc1220_fixup_gb_dual_codecs,
2480 },
5853e364
CL
2481 [ALC1220_FIXUP_GB_X570] = {
2482 .type = HDA_FIXUP_FUNC,
2483 .v.func = alc1220_fixup_gb_x570,
2484 },
0202f5cd
P
2485 [ALC1220_FIXUP_CLEVO_P950] = {
2486 .type = HDA_FIXUP_FUNC,
2487 .v.func = alc1220_fixup_clevo_p950,
2488 },
80690a27 2489 [ALC1220_FIXUP_CLEVO_PB51ED] = {
7f665b1c 2490 .type = HDA_FIXUP_FUNC,
80690a27 2491 .v.func = alc1220_fixup_clevo_pb51ed,
7f665b1c 2492 },
80690a27 2493 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
7f665b1c
JS
2494 .type = HDA_FIXUP_PINS,
2495 .v.pins = (const struct hda_pintbl[]) {
2496 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2497 {}
2498 },
2499 .chained = true,
80690a27 2500 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
7f665b1c 2501 },
ca184355
JHP
2502 [ALC887_FIXUP_ASUS_AUDIO] = {
2503 .type = HDA_FIXUP_PINS,
2504 .v.pins = (const struct hda_pintbl[]) {
2505 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2506 { 0x19, 0x22219420 },
2507 {}
2508 },
2509 },
2510 [ALC887_FIXUP_ASUS_HMIC] = {
2511 .type = HDA_FIXUP_FUNC,
2512 .v.func = alc887_fixup_asus_jack,
2513 .chained = true,
2514 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2515 },
ff818c24
TI
2516};
2517
1d045db9 2518static const struct snd_pci_quirk alc882_fixup_tbl[] = {
8812c4f9
TI
2519 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2520 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
b5d724b1 2521 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
8812c4f9
TI
2522 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2523 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2524 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2525 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
c3e837bb
TI
2526 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2527 ALC882_FIXUP_ACER_ASPIRE_4930G),
2528 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2529 ALC882_FIXUP_ACER_ASPIRE_4930G),
2530 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2531 ALC882_FIXUP_ACER_ASPIRE_8930G),
2532 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2533 ALC882_FIXUP_ACER_ASPIRE_8930G),
b265047a
TI
2534 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2535 ALC882_FIXUP_ACER_ASPIRE_4930G),
2536 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
c3e837bb
TI
2537 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2538 ALC882_FIXUP_ACER_ASPIRE_4930G),
2539 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2540 ALC882_FIXUP_ACER_ASPIRE_4930G),
f5c53d89
TI
2541 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2542 ALC882_FIXUP_ACER_ASPIRE_4930G),
02a237b2 2543 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
fe97da1f 2544 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
ac9b1cdd 2545 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
177943a3 2546 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
5c0ebfbe 2547 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
68ef0561 2548 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
ca184355 2549 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
0e7cc2e7 2550 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
1f0bbf03 2551 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
85bcf96c 2552 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
b7529c18
TI
2553 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2554 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
ac9b1cdd 2555 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
e427c237 2556 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
3f3c3714 2557 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
5671087f
TI
2558
2559 /* All Apple entries are in codec SSIDs */
1a97b7f2
TI
2560 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2561 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2562 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
c20f31ec 2563 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
5671087f
TI
2564 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2565 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2566 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2567 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
5671087f 2568 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
e7729a41 2569 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
0756f09c 2570 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
1a97b7f2
TI
2571 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2572 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
5671087f 2573 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2574 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2575 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2576 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
9f660a1c 2577 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
05193639 2578 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
1a97b7f2
TI
2579 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2580 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
649ccd08 2581 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
5671087f 2582
7a6069bf 2583 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
4841b8e6 2584 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
b2c53e20 2585 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
7beb3a6e 2586 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
5853e364 2587 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
d9e8fe0c 2588 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
a0b03952 2589 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
a655e2b1 2590 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
09926202 2591 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
1d3aa4a5 2592 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
7dafba37 2593 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
cc5049ae 2594 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
d2c3b14e 2595 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
26af1772 2596 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
63691587 2597 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
d2c3b14e 2598 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5c0ebfbe 2599 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
13e1a4cd
TI
2600 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2601 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2602 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2603 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2604 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2605 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2606 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2607 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2608 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
a7182ce8 2609 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2610 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2611 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2612 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2613 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2614 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2615 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2616 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2617 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2618 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2619 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2620 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2621 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2622 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2623 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2624 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
7a6069bf
TI
2625 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2626 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2627 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2628 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2629 {}
2630};
2631
1727a771 2632static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2633 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2634 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2635 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2636 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2637 {.id = ALC889_FIXUP_CD, .name = "cd"},
2638 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2639 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2640 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2641 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2642 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2643 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2644 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2645 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2646 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2647 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2648 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2649 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2650 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2651 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2652 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2653 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2654 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2655 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2656 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2657 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2658 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2659 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2660 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2661 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2662 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
f05b4fdb 2663 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2664 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2665 {}
2666};
2667
119b75c1
HW
2668static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2669 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2670 {0x14, 0x01014010},
2671 {0x15, 0x01011012},
2672 {0x16, 0x01016011},
2673 {0x18, 0x01a19040},
2674 {0x19, 0x02a19050},
2675 {0x1a, 0x0181304f},
2676 {0x1b, 0x0221401f},
2677 {0x1e, 0x01456130}),
2678 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2679 {0x14, 0x01015010},
2680 {0x15, 0x01011012},
2681 {0x16, 0x01011011},
2682 {0x18, 0x01a11040},
2683 {0x19, 0x02a19050},
2684 {0x1a, 0x0181104f},
2685 {0x1b, 0x0221401f},
2686 {0x1e, 0x01451130}),
2687 {}
2688};
2689
f6a92248 2690/*
1d045db9 2691 * BIOS auto configuration
f6a92248 2692 */
1d045db9
TI
2693/* almost identical with ALC880 parser... */
2694static int alc882_parse_auto_config(struct hda_codec *codec)
2695{
1d045db9 2696 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2697 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2698 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2699}
b896b4eb 2700
1d045db9
TI
2701/*
2702 */
1d045db9 2703static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2704{
2705 struct alc_spec *spec;
1a97b7f2 2706 int err;
f6a92248 2707
3de95173
TI
2708 err = alc_alloc_spec(codec, 0x0b);
2709 if (err < 0)
2710 return err;
f6a92248 2711
3de95173 2712 spec = codec->spec;
1f0f4b80 2713
7639a06c 2714 switch (codec->core.vendor_id) {
1d045db9
TI
2715 case 0x10ec0882:
2716 case 0x10ec0885:
acf08081 2717 case 0x10ec0900:
6d9ffcff 2718 case 0x10ec0b00:
a535ad57 2719 case 0x10ec1220:
1d045db9
TI
2720 break;
2721 default:
2722 /* ALC883 and variants */
2723 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2724 break;
c793bec5 2725 }
977ddd6b 2726
c9af753f
TI
2727 alc_pre_init(codec);
2728
1727a771 2729 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2730 alc882_fixups);
119b75c1 2731 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2732 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2733
1d045db9
TI
2734 alc_auto_parse_customize_define(codec);
2735
7504b6cd
TI
2736 if (has_cdefine_beep(codec))
2737 spec->gen.beep_nid = 0x01;
2738
1a97b7f2
TI
2739 /* automatic parse from the BIOS config */
2740 err = alc882_parse_auto_config(codec);
2741 if (err < 0)
2742 goto error;
f6a92248 2743
fea80fae
TI
2744 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2745 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2746 if (err < 0)
2747 goto error;
2748 }
f6a92248 2749
1727a771 2750 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2751
f6a92248 2752 return 0;
e16fb6d1
TI
2753
2754 error:
2755 alc_free(codec);
2756 return err;
f6a92248
KY
2757}
2758
df694daa 2759
df694daa 2760/*
1d045db9 2761 * ALC262 support
df694daa 2762 */
1d045db9 2763static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2764{
1d045db9 2765 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2766 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2767 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2768}
2769
df694daa 2770/*
1d045db9 2771 * Pin config fixes
df694daa 2772 */
cfc9b06f 2773enum {
ea4e7af1 2774 ALC262_FIXUP_FSC_H270,
7513e6da 2775 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2776 ALC262_FIXUP_HP_Z200,
2777 ALC262_FIXUP_TYAN,
c470150c 2778 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2779 ALC262_FIXUP_BENQ,
2780 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2781 ALC262_FIXUP_INV_DMIC,
b5c6611f 2782 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2783};
2784
1727a771 2785static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2786 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2787 .type = HDA_FIXUP_PINS,
2788 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2789 { 0x14, 0x99130110 }, /* speaker */
2790 { 0x15, 0x0221142f }, /* front HP */
2791 { 0x1b, 0x0121141f }, /* rear HP */
2792 { }
2793 }
2794 },
7513e6da
TI
2795 [ALC262_FIXUP_FSC_S7110] = {
2796 .type = HDA_FIXUP_PINS,
2797 .v.pins = (const struct hda_pintbl[]) {
2798 { 0x15, 0x90170110 }, /* speaker */
2799 { }
2800 },
2801 .chained = true,
2802 .chain_id = ALC262_FIXUP_BENQ,
2803 },
ea4e7af1 2804 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2805 .type = HDA_FIXUP_PINS,
2806 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2807 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2808 { }
2809 }
cfc9b06f 2810 },
ea4e7af1 2811 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2812 .type = HDA_FIXUP_PINS,
2813 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2814 { 0x14, 0x1993e1f0 }, /* int AUX */
2815 { }
2816 }
2817 },
c470150c 2818 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2819 .type = HDA_FIXUP_PINCTLS,
2820 .v.pins = (const struct hda_pintbl[]) {
2821 { 0x19, PIN_VREF50 },
b42590b8
TI
2822 {}
2823 },
2824 .chained = true,
2825 .chain_id = ALC262_FIXUP_BENQ,
2826 },
2827 [ALC262_FIXUP_BENQ] = {
1727a771 2828 .type = HDA_FIXUP_VERBS,
b42590b8 2829 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2830 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2831 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2832 {}
2833 }
2834 },
b42590b8 2835 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2836 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2837 .v.verbs = (const struct hda_verb[]) {
2838 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2839 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2840 {}
2841 }
2842 },
6e72aa5f 2843 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2844 .type = HDA_FIXUP_FUNC,
9d36a7dc 2845 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2846 },
b5c6611f
ML
2847 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2848 .type = HDA_FIXUP_FUNC,
2849 .v.func = alc_fixup_no_depop_delay,
2850 },
cfc9b06f
TI
2851};
2852
1d045db9 2853static const struct snd_pci_quirk alc262_fixup_tbl[] = {
ea4e7af1 2854 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2855 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2856 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2857 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2858 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2859 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2860 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2861 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2862 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2863 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2864 {}
2865};
df694daa 2866
1727a771 2867static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2868 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2869 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2870 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2871 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2872 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2873 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2874 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2875 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2876 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2877 {}
2878};
1d045db9 2879
1d045db9
TI
2880/*
2881 */
1d045db9 2882static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2883{
2884 struct alc_spec *spec;
df694daa
KY
2885 int err;
2886
3de95173
TI
2887 err = alc_alloc_spec(codec, 0x0b);
2888 if (err < 0)
2889 return err;
df694daa 2890
3de95173 2891 spec = codec->spec;
08c189f2 2892 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2893
225068ab
TI
2894 spec->shutup = alc_eapd_shutup;
2895
1d045db9
TI
2896#if 0
2897 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2898 * under-run
2899 */
98b24883 2900 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2901#endif
1d045db9
TI
2902 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2903
c9af753f
TI
2904 alc_pre_init(codec);
2905
1727a771 2906 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2907 alc262_fixups);
1727a771 2908 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2909
af741c15
TI
2910 alc_auto_parse_customize_define(codec);
2911
7504b6cd
TI
2912 if (has_cdefine_beep(codec))
2913 spec->gen.beep_nid = 0x01;
2914
42399f7a
TI
2915 /* automatic parse from the BIOS config */
2916 err = alc262_parse_auto_config(codec);
2917 if (err < 0)
2918 goto error;
df694daa 2919
fea80fae
TI
2920 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2921 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2922 if (err < 0)
2923 goto error;
2924 }
2134ea4f 2925
1727a771 2926 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2927
1da177e4 2928 return 0;
e16fb6d1
TI
2929
2930 error:
2931 alc_free(codec);
2932 return err;
1da177e4
LT
2933}
2934
f32610ed 2935/*
1d045db9 2936 * ALC268
f32610ed 2937 */
1d045db9 2938/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
2939static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2940 struct snd_ctl_elem_value *ucontrol)
2941{
2942 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2943 unsigned long pval;
2944 int err;
2945
2946 mutex_lock(&codec->control_mutex);
2947 pval = kcontrol->private_value;
2948 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2949 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2950 if (err >= 0) {
2951 kcontrol->private_value = (pval & ~0xff) | 0x10;
2952 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2953 }
2954 kcontrol->private_value = pval;
2955 mutex_unlock(&codec->control_mutex);
2956 return err;
2957}
f32610ed 2958
1d045db9
TI
2959static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2960 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
2961 {
2962 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2963 .name = "Beep Playback Switch",
2964 .subdevice = HDA_SUBDEV_AMP_FLAG,
2965 .info = snd_hda_mixer_amp_switch_info,
2966 .get = snd_hda_mixer_amp_switch_get,
2967 .put = alc268_beep_switch_put,
2968 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2969 },
f32610ed
JS
2970};
2971
1d045db9
TI
2972/* set PCBEEP vol = 0, mute connections */
2973static const struct hda_verb alc268_beep_init_verbs[] = {
2974 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2975 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2976 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2977 { }
f32610ed
JS
2978};
2979
6e72aa5f
TI
2980enum {
2981 ALC268_FIXUP_INV_DMIC,
cb766404 2982 ALC268_FIXUP_HP_EAPD,
24eff328 2983 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
2984};
2985
1727a771 2986static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 2987 [ALC268_FIXUP_INV_DMIC] = {
1727a771 2988 .type = HDA_FIXUP_FUNC,
9d36a7dc 2989 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2990 },
cb766404 2991 [ALC268_FIXUP_HP_EAPD] = {
1727a771 2992 .type = HDA_FIXUP_VERBS,
cb766404
TI
2993 .v.verbs = (const struct hda_verb[]) {
2994 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2995 {}
2996 }
2997 },
24eff328
TI
2998 [ALC268_FIXUP_SPDIF] = {
2999 .type = HDA_FIXUP_PINS,
3000 .v.pins = (const struct hda_pintbl[]) {
3001 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3002 {}
3003 }
3004 },
6e72aa5f
TI
3005};
3006
1727a771 3007static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3008 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3009 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3010 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3011 {}
3012};
3013
3014static const struct snd_pci_quirk alc268_fixup_tbl[] = {
24eff328 3015 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3016 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3017 /* below is codec SSID since multiple Toshiba laptops have the
3018 * same PCI SSID 1179:ff00
3019 */
3020 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3021 {}
3022};
3023
f32610ed
JS
3024/*
3025 * BIOS auto configuration
3026 */
1d045db9 3027static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3028{
3e6179b8 3029 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3030 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3031}
3032
1d045db9
TI
3033/*
3034 */
1d045db9 3035static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3036{
3037 struct alc_spec *spec;
a5cb463a 3038 int i, err;
f32610ed 3039
1d045db9 3040 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3041 err = alc_alloc_spec(codec, 0);
3042 if (err < 0)
3043 return err;
3044
3045 spec = codec->spec;
2722b535
TI
3046 if (has_cdefine_beep(codec))
3047 spec->gen.beep_nid = 0x01;
1f0f4b80 3048
225068ab
TI
3049 spec->shutup = alc_eapd_shutup;
3050
c9af753f
TI
3051 alc_pre_init(codec);
3052
1727a771
TI
3053 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3054 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3055
6ebb8053
TI
3056 /* automatic parse from the BIOS config */
3057 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3058 if (err < 0)
3059 goto error;
f32610ed 3060
7504b6cd
TI
3061 if (err > 0 && !spec->gen.no_analog &&
3062 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3063 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3064 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3065 &alc268_beep_mixer[i])) {
3066 err = -ENOMEM;
3067 goto error;
3068 }
3069 }
7504b6cd 3070 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3071 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3072 /* override the amp caps for beep generator */
3073 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3074 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3075 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3076 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3077 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3078 }
3079
1727a771 3080 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3081
f32610ed 3082 return 0;
e16fb6d1
TI
3083
3084 error:
3085 alc_free(codec);
3086 return err;
f32610ed
JS
3087}
3088
bc9f98a9 3089/*
1d045db9 3090 * ALC269
bc9f98a9 3091 */
08c189f2 3092
1d045db9 3093static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3094 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3095};
3096
1d045db9 3097static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3098 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3099};
291702f0 3100
1d045db9
TI
3101/* different alc269-variants */
3102enum {
3103 ALC269_TYPE_ALC269VA,
3104 ALC269_TYPE_ALC269VB,
3105 ALC269_TYPE_ALC269VC,
adcc70b2 3106 ALC269_TYPE_ALC269VD,
065380f0
KY
3107 ALC269_TYPE_ALC280,
3108 ALC269_TYPE_ALC282,
2af02be7 3109 ALC269_TYPE_ALC283,
065380f0 3110 ALC269_TYPE_ALC284,
4731d5de 3111 ALC269_TYPE_ALC293,
7fc7d047 3112 ALC269_TYPE_ALC286,
506b62c3 3113 ALC269_TYPE_ALC298,
1d04c9de 3114 ALC269_TYPE_ALC255,
4344aec8 3115 ALC269_TYPE_ALC256,
f429e7e4 3116 ALC269_TYPE_ALC257,
0a6f0600 3117 ALC269_TYPE_ALC215,
4231430d 3118 ALC269_TYPE_ALC225,
99cee034 3119 ALC269_TYPE_ALC287,
dcd4f0db 3120 ALC269_TYPE_ALC294,
1078bef0 3121 ALC269_TYPE_ALC300,
f0778871 3122 ALC269_TYPE_ALC623,
6fbae35a 3123 ALC269_TYPE_ALC700,
bc9f98a9
KY
3124};
3125
3126/*
1d045db9 3127 * BIOS auto configuration
bc9f98a9 3128 */
1d045db9
TI
3129static int alc269_parse_auto_config(struct hda_codec *codec)
3130{
1d045db9 3131 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3132 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3133 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3134 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3135 const hda_nid_t *ssids;
3136
3137 switch (spec->codec_variant) {
3138 case ALC269_TYPE_ALC269VA:
3139 case ALC269_TYPE_ALC269VC:
065380f0
KY
3140 case ALC269_TYPE_ALC280:
3141 case ALC269_TYPE_ALC284:
4731d5de 3142 case ALC269_TYPE_ALC293:
adcc70b2
KY
3143 ssids = alc269va_ssids;
3144 break;
3145 case ALC269_TYPE_ALC269VB:
3146 case ALC269_TYPE_ALC269VD:
065380f0 3147 case ALC269_TYPE_ALC282:
2af02be7 3148 case ALC269_TYPE_ALC283:
7fc7d047 3149 case ALC269_TYPE_ALC286:
506b62c3 3150 case ALC269_TYPE_ALC298:
1d04c9de 3151 case ALC269_TYPE_ALC255:
4344aec8 3152 case ALC269_TYPE_ALC256:
f429e7e4 3153 case ALC269_TYPE_ALC257:
0a6f0600 3154 case ALC269_TYPE_ALC215:
4231430d 3155 case ALC269_TYPE_ALC225:
99cee034 3156 case ALC269_TYPE_ALC287:
dcd4f0db 3157 case ALC269_TYPE_ALC294:
1078bef0 3158 case ALC269_TYPE_ALC300:
f0778871 3159 case ALC269_TYPE_ALC623:
6fbae35a 3160 case ALC269_TYPE_ALC700:
adcc70b2
KY
3161 ssids = alc269_ssids;
3162 break;
3163 default:
3164 ssids = alc269_ssids;
3165 break;
3166 }
bc9f98a9 3167
3e6179b8 3168 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3169}
bc9f98a9 3170
476c02e0
HW
3171static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3172 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3173 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3174 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3175 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3176 {}
3177};
3178
3179static void alc_headset_btn_callback(struct hda_codec *codec,
3180 struct hda_jack_callback *jack)
3181{
3182 int report = 0;
3183
3184 if (jack->unsol_res & (7 << 13))
3185 report |= SND_JACK_BTN_0;
3186
3187 if (jack->unsol_res & (1 << 16 | 3 << 8))
3188 report |= SND_JACK_BTN_1;
3189
3190 /* Volume up key */
3191 if (jack->unsol_res & (7 << 23))
3192 report |= SND_JACK_BTN_2;
3193
3194 /* Volume down key */
3195 if (jack->unsol_res & (7 << 10))
3196 report |= SND_JACK_BTN_3;
3197
04f7791b 3198 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3199}
3200
3201static void alc_disable_headset_jack_key(struct hda_codec *codec)
3202{
3203 struct alc_spec *spec = codec->spec;
3204
3205 if (!spec->has_hs_key)
3206 return;
3207
3208 switch (codec->core.vendor_id) {
3209 case 0x10ec0215:
3210 case 0x10ec0225:
3211 case 0x10ec0285:
c72b9bfe 3212 case 0x10ec0287:
476c02e0
HW
3213 case 0x10ec0295:
3214 case 0x10ec0289:
3215 case 0x10ec0299:
3216 alc_write_coef_idx(codec, 0x48, 0x0);
3217 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3218 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3219 break;
1948fc06 3220 case 0x10ec0230:
476c02e0
HW
3221 case 0x10ec0236:
3222 case 0x10ec0256:
3223 alc_write_coef_idx(codec, 0x48, 0x0);
3224 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3225 break;
3226 }
3227}
3228
3229static void alc_enable_headset_jack_key(struct hda_codec *codec)
3230{
3231 struct alc_spec *spec = codec->spec;
3232
3233 if (!spec->has_hs_key)
3234 return;
3235
3236 switch (codec->core.vendor_id) {
3237 case 0x10ec0215:
3238 case 0x10ec0225:
3239 case 0x10ec0285:
c72b9bfe 3240 case 0x10ec0287:
476c02e0
HW
3241 case 0x10ec0295:
3242 case 0x10ec0289:
3243 case 0x10ec0299:
3244 alc_write_coef_idx(codec, 0x48, 0xd011);
3245 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3246 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3247 break;
1948fc06 3248 case 0x10ec0230:
476c02e0
HW
3249 case 0x10ec0236:
3250 case 0x10ec0256:
3251 alc_write_coef_idx(codec, 0x48, 0xd011);
3252 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3253 break;
3254 }
3255}
3256
3257static void alc_fixup_headset_jack(struct hda_codec *codec,
3258 const struct hda_fixup *fix, int action)
3259{
3260 struct alc_spec *spec = codec->spec;
04f7791b 3261 hda_nid_t hp_pin;
476c02e0
HW
3262
3263 switch (action) {
3264 case HDA_FIXUP_ACT_PRE_PROBE:
3265 spec->has_hs_key = 1;
3266 snd_hda_jack_detect_enable_callback(codec, 0x55,
3267 alc_headset_btn_callback);
476c02e0 3268 break;
04f7791b
HW
3269 case HDA_FIXUP_ACT_BUILD:
3270 hp_pin = alc_get_hp_pin(spec);
3271 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3272 alc_headset_btn_keymap,
3273 hp_pin))
3274 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3275 false, SND_JACK_HEADSET,
3276 alc_headset_btn_keymap);
3277
476c02e0
HW
3278 alc_enable_headset_jack_key(codec);
3279 break;
3280 }
3281}
3282
1387e2d1 3283static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3284{
98b24883 3285 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3286}
291702f0 3287
1d045db9
TI
3288static void alc269_shutup(struct hda_codec *codec)
3289{
adcc70b2
KY
3290 struct alc_spec *spec = codec->spec;
3291
1387e2d1
KY
3292 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3293 alc269vb_toggle_power_output(codec, 0);
3294 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3295 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3296 msleep(150);
3297 }
c0ca5ece 3298 alc_shutup_pins(codec);
1d045db9 3299}
291702f0 3300
6b0f95c4 3301static const struct coef_fw alc282_coefs[] = {
54db6c39 3302 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3303 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3304 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3305 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3306 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3307 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3308 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3309 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3310 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3311 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3312 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3313 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3314 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3315 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3316 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3317 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3318 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3319 WRITE_COEF(0x63, 0x2902), /* PLL */
3320 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3321 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3322 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3323 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3324 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3325 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3326 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3327 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3328 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3329 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3330 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3331 {}
3332};
3333
cb149cb3
KY
3334static void alc282_restore_default_value(struct hda_codec *codec)
3335{
54db6c39 3336 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3337}
3338
7b5c7a02
KY
3339static void alc282_init(struct hda_codec *codec)
3340{
3341 struct alc_spec *spec = codec->spec;
35a39f98 3342 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3343 bool hp_pin_sense;
3344 int coef78;
3345
cb149cb3
KY
3346 alc282_restore_default_value(codec);
3347
7b5c7a02
KY
3348 if (!hp_pin)
3349 return;
3350 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3351 coef78 = alc_read_coef_idx(codec, 0x78);
3352
3353 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3354 /* Headphone capless set to high power mode */
3355 alc_write_coef_idx(codec, 0x78, 0x9004);
3356
3357 if (hp_pin_sense)
3358 msleep(2);
3359
3360 snd_hda_codec_write(codec, hp_pin, 0,
3361 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3362
3363 if (hp_pin_sense)
3364 msleep(85);
3365
3366 snd_hda_codec_write(codec, hp_pin, 0,
3367 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3368
3369 if (hp_pin_sense)
3370 msleep(100);
3371
3372 /* Headphone capless set to normal mode */
3373 alc_write_coef_idx(codec, 0x78, coef78);
3374}
3375
3376static void alc282_shutup(struct hda_codec *codec)
3377{
3378 struct alc_spec *spec = codec->spec;
35a39f98 3379 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3380 bool hp_pin_sense;
3381 int coef78;
3382
3383 if (!hp_pin) {
3384 alc269_shutup(codec);
3385 return;
3386 }
3387
3388 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3389 coef78 = alc_read_coef_idx(codec, 0x78);
3390 alc_write_coef_idx(codec, 0x78, 0x9004);
3391
3392 if (hp_pin_sense)
3393 msleep(2);
3394
3395 snd_hda_codec_write(codec, hp_pin, 0,
3396 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3397
3398 if (hp_pin_sense)
3399 msleep(85);
3400
c0ca5ece
TI
3401 if (!spec->no_shutup_pins)
3402 snd_hda_codec_write(codec, hp_pin, 0,
3403 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3404
3405 if (hp_pin_sense)
3406 msleep(100);
3407
3408 alc_auto_setup_eapd(codec, false);
c0ca5ece 3409 alc_shutup_pins(codec);
7b5c7a02
KY
3410 alc_write_coef_idx(codec, 0x78, coef78);
3411}
3412
6b0f95c4 3413static const struct coef_fw alc283_coefs[] = {
54db6c39 3414 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3415 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3416 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3417 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3418 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3419 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3420 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3421 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3422 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3423 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3424 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3425 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3426 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3427 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3428 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3429 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3430 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3431 WRITE_COEF(0x2e, 0x2902), /* PLL */
3432 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3433 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3434 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3435 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3436 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3437 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3438 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3439 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3440 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3441 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3442 WRITE_COEF(0x49, 0x0), /* test mode */
3443 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3444 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3445 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3446 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3447 {}
3448};
3449
6bd55b04
KY
3450static void alc283_restore_default_value(struct hda_codec *codec)
3451{
54db6c39 3452 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3453}
3454
2af02be7
KY
3455static void alc283_init(struct hda_codec *codec)
3456{
3457 struct alc_spec *spec = codec->spec;
35a39f98 3458 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3459 bool hp_pin_sense;
2af02be7 3460
6bd55b04
KY
3461 alc283_restore_default_value(codec);
3462
2af02be7
KY
3463 if (!hp_pin)
3464 return;
a59d7199
KY
3465
3466 msleep(30);
2af02be7
KY
3467 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3468
3469 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3470 /* Headphone capless set to high power mode */
3471 alc_write_coef_idx(codec, 0x43, 0x9004);
3472
3473 snd_hda_codec_write(codec, hp_pin, 0,
3474 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3475
3476 if (hp_pin_sense)
3477 msleep(85);
3478
3479 snd_hda_codec_write(codec, hp_pin, 0,
3480 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3481
3482 if (hp_pin_sense)
3483 msleep(85);
3484 /* Index 0x46 Combo jack auto switch control 2 */
3485 /* 3k pull low control for Headset jack. */
98b24883 3486 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3487 /* Headphone capless set to normal mode */
3488 alc_write_coef_idx(codec, 0x43, 0x9614);
3489}
3490
3491static void alc283_shutup(struct hda_codec *codec)
3492{
3493 struct alc_spec *spec = codec->spec;
35a39f98 3494 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3495 bool hp_pin_sense;
2af02be7
KY
3496
3497 if (!hp_pin) {
3498 alc269_shutup(codec);
3499 return;
3500 }
3501
3502 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3503
3504 alc_write_coef_idx(codec, 0x43, 0x9004);
3505
b450b17c
HP
3506 /*depop hp during suspend*/
3507 alc_write_coef_idx(codec, 0x06, 0x2100);
3508
2af02be7
KY
3509 snd_hda_codec_write(codec, hp_pin, 0,
3510 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3511
3512 if (hp_pin_sense)
88011c09 3513 msleep(100);
2af02be7 3514
c0ca5ece
TI
3515 if (!spec->no_shutup_pins)
3516 snd_hda_codec_write(codec, hp_pin, 0,
3517 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3518
98b24883 3519 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3520
3521 if (hp_pin_sense)
88011c09 3522 msleep(100);
0435b3ff 3523 alc_auto_setup_eapd(codec, false);
c0ca5ece 3524 alc_shutup_pins(codec);
2af02be7
KY
3525 alc_write_coef_idx(codec, 0x43, 0x9614);
3526}
3527
4a219ef8
KY
3528static void alc256_init(struct hda_codec *codec)
3529{
3530 struct alc_spec *spec = codec->spec;
35a39f98 3531 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3532 bool hp_pin_sense;
3533
3534 if (!hp_pin)
6447c962 3535 hp_pin = 0x21;
4a219ef8
KY
3536
3537 msleep(30);
3538
3539 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3540
3541 if (hp_pin_sense)
3542 msleep(2);
3543
3544 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
6447c962
KY
3545 if (spec->ultra_low_power) {
3546 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3547 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3548 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3549 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3550 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3551 msleep(30);
3552 }
4a219ef8
KY
3553
3554 snd_hda_codec_write(codec, hp_pin, 0,
3555 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3556
6447c962 3557 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3558 msleep(85);
3559
3560 snd_hda_codec_write(codec, hp_pin, 0,
3561 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3562
6447c962 3563 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3564 msleep(100);
3565
3566 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3567 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
88d42b2b
KY
3568 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3569 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3570 /*
3571 * Expose headphone mic (or possibly Line In on some machines) instead
3572 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3573 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3574 * this register.
3575 */
3576 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3577}
3578
3579static void alc256_shutup(struct hda_codec *codec)
3580{
3581 struct alc_spec *spec = codec->spec;
35a39f98 3582 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3583 bool hp_pin_sense;
3584
6447c962
KY
3585 if (!hp_pin)
3586 hp_pin = 0x21;
4a219ef8
KY
3587
3588 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3589
3590 if (hp_pin_sense)
3591 msleep(2);
3592
3593 snd_hda_codec_write(codec, hp_pin, 0,
3594 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3595
6447c962 3596 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3597 msleep(85);
3598
1c9609e3
TI
3599 /* 3k pull low control for Headset jack. */
3600 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3601 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3602 * when booting with headset plugged. So skip setting it for the codec alc257
3603 */
5aec9891
KY
3604 if (spec->codec_variant != ALC269_TYPE_ALC257 &&
3605 spec->codec_variant != ALC269_TYPE_ALC256)
3f742490 3606 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3607
c0ca5ece
TI
3608 if (!spec->no_shutup_pins)
3609 snd_hda_codec_write(codec, hp_pin, 0,
3610 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3611
6447c962 3612 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3613 msleep(100);
3614
3615 alc_auto_setup_eapd(codec, false);
c0ca5ece 3616 alc_shutup_pins(codec);
6447c962
KY
3617 if (spec->ultra_low_power) {
3618 msleep(50);
3619 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3620 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3621 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3622 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3623 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3624 msleep(30);
3625 }
4a219ef8
KY
3626}
3627
3c24e483
KY
3628static void alc285_hp_init(struct hda_codec *codec)
3629{
3630 struct alc_spec *spec = codec->spec;
3631 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3632 int i, val;
3633 int coef38, coef0d, coef36;
3634
3635 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3636 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3637 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3638 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3639 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3640 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3641
3642 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3643
3644 if (hp_pin)
3645 snd_hda_codec_write(codec, hp_pin, 0,
3646 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3647
3648 msleep(130);
3649 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3650 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3651
3652 if (hp_pin)
3653 snd_hda_codec_write(codec, hp_pin, 0,
3654 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3655 msleep(10);
3656 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3657 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3658 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3659 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3660
3661 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3662 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3663 for (i = 0; i < 20 && val & 0x8000; i++) {
3664 msleep(50);
3665 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3666 } /* Wait for depop procedure finish */
3667
3668 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3669 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3670 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3671 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3672
3673 msleep(50);
3674 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3675}
3676
da911b1f
KY
3677static void alc225_init(struct hda_codec *codec)
3678{
3679 struct alc_spec *spec = codec->spec;
35a39f98 3680 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3681 bool hp1_pin_sense, hp2_pin_sense;
3682
3c24e483
KY
3683 if (spec->codec_variant != ALC269_TYPE_ALC287)
3684 /* required only at boot or S3 and S4 resume time */
3685 if (!spec->done_hp_init ||
3686 is_s3_resume(codec) ||
3687 is_s4_resume(codec)) {
3688 alc285_hp_init(codec);
3689 spec->done_hp_init = true;
3690 }
3691
da911b1f 3692 if (!hp_pin)
d3ba58bb 3693 hp_pin = 0x21;
da911b1f
KY
3694 msleep(30);
3695
3696 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3697 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3698
3699 if (hp1_pin_sense || hp2_pin_sense)
3700 msleep(2);
3701
3702 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
d3ba58bb
KY
3703 if (spec->ultra_low_power) {
3704 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3705 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3706 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3707 msleep(30);
3708 }
da911b1f 3709
d3ba58bb 3710 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3711 snd_hda_codec_write(codec, hp_pin, 0,
3712 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3713 if (hp2_pin_sense)
3714 snd_hda_codec_write(codec, 0x16, 0,
3715 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3716
d3ba58bb 3717 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3718 msleep(85);
3719
d3ba58bb 3720 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3721 snd_hda_codec_write(codec, hp_pin, 0,
3722 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3723 if (hp2_pin_sense)
3724 snd_hda_codec_write(codec, 0x16, 0,
3725 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3726
d3ba58bb 3727 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3728 msleep(100);
3729
3730 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3731 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3732}
3733
3734static void alc225_shutup(struct hda_codec *codec)
3735{
3736 struct alc_spec *spec = codec->spec;
35a39f98 3737 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3738 bool hp1_pin_sense, hp2_pin_sense;
3739
d3ba58bb
KY
3740 if (!hp_pin)
3741 hp_pin = 0x21;
476c02e0
HW
3742
3743 alc_disable_headset_jack_key(codec);
da911b1f
KY
3744 /* 3k pull low control for Headset jack. */
3745 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3746
3747 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3748 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3749
3750 if (hp1_pin_sense || hp2_pin_sense)
3751 msleep(2);
3752
d3ba58bb 3753 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3754 snd_hda_codec_write(codec, hp_pin, 0,
3755 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3756 if (hp2_pin_sense)
3757 snd_hda_codec_write(codec, 0x16, 0,
3758 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3759
d3ba58bb 3760 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3761 msleep(85);
3762
d3ba58bb 3763 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3764 snd_hda_codec_write(codec, hp_pin, 0,
3765 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3766 if (hp2_pin_sense)
3767 snd_hda_codec_write(codec, 0x16, 0,
3768 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3769
d3ba58bb 3770 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3771 msleep(100);
3772
3773 alc_auto_setup_eapd(codec, false);
c0ca5ece 3774 alc_shutup_pins(codec);
d3ba58bb
KY
3775 if (spec->ultra_low_power) {
3776 msleep(50);
3777 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3778 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3779 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3780 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3781 msleep(30);
3782 }
476c02e0
HW
3783
3784 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3785 alc_enable_headset_jack_key(codec);
da911b1f
KY
3786}
3787
c2d6af53
KY
3788static void alc_default_init(struct hda_codec *codec)
3789{
3790 struct alc_spec *spec = codec->spec;
35a39f98 3791 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3792 bool hp_pin_sense;
3793
3794 if (!hp_pin)
3795 return;
3796
3797 msleep(30);
3798
3799 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3800
3801 if (hp_pin_sense)
3802 msleep(2);
3803
3804 snd_hda_codec_write(codec, hp_pin, 0,
3805 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3806
3807 if (hp_pin_sense)
3808 msleep(85);
3809
3810 snd_hda_codec_write(codec, hp_pin, 0,
3811 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3812
3813 if (hp_pin_sense)
3814 msleep(100);
3815}
3816
3817static void alc_default_shutup(struct hda_codec *codec)
3818{
3819 struct alc_spec *spec = codec->spec;
35a39f98 3820 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3821 bool hp_pin_sense;
3822
3823 if (!hp_pin) {
3824 alc269_shutup(codec);
3825 return;
3826 }
3827
3828 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3829
3830 if (hp_pin_sense)
3831 msleep(2);
3832
3833 snd_hda_codec_write(codec, hp_pin, 0,
3834 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3835
3836 if (hp_pin_sense)
3837 msleep(85);
3838
c0ca5ece
TI
3839 if (!spec->no_shutup_pins)
3840 snd_hda_codec_write(codec, hp_pin, 0,
3841 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53
KY
3842
3843 if (hp_pin_sense)
3844 msleep(100);
3845
3846 alc_auto_setup_eapd(codec, false);
c0ca5ece 3847 alc_shutup_pins(codec);
c2d6af53
KY
3848}
3849
693abe11
KY
3850static void alc294_hp_init(struct hda_codec *codec)
3851{
3852 struct alc_spec *spec = codec->spec;
35a39f98 3853 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3854 int i, val;
3855
3856 if (!hp_pin)
3857 return;
3858
3859 snd_hda_codec_write(codec, hp_pin, 0,
3860 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3861
3862 msleep(100);
3863
c0ca5ece
TI
3864 if (!spec->no_shutup_pins)
3865 snd_hda_codec_write(codec, hp_pin, 0,
3866 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3867
3868 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3869 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3870
3871 /* Wait for depop procedure finish */
3872 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3873 for (i = 0; i < 20 && val & 0x0080; i++) {
3874 msleep(50);
3875 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3876 }
3877 /* Set HP depop to auto mode */
3878 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3879 msleep(50);
3880}
3881
3882static void alc294_init(struct hda_codec *codec)
3883{
3884 struct alc_spec *spec = codec->spec;
3885
f6ef4e0e
TI
3886 /* required only at boot or S4 resume time */
3887 if (!spec->done_hp_init ||
3888 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
3889 alc294_hp_init(codec);
3890 spec->done_hp_init = true;
3891 }
3892 alc_default_init(codec);
3893}
3894
ad60d502
KY
3895static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3896 unsigned int val)
3897{
3898 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3899 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3900 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3901}
3902
3903static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3904{
3905 unsigned int val;
3906
3907 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3908 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3909 & 0xffff;
3910 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3911 << 16;
3912 return val;
3913}
3914
3915static void alc5505_dsp_halt(struct hda_codec *codec)
3916{
3917 unsigned int val;
3918
3919 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3920 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3921 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3922 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3923 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3924 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3925 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3926 val = alc5505_coef_get(codec, 0x6220);
3927 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3928}
3929
3930static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3931{
3932 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3933 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3934 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3935 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3936 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3937 alc5505_coef_set(codec, 0x880c, 0x00000004);
3938}
3939
3940static void alc5505_dsp_init(struct hda_codec *codec)
3941{
3942 unsigned int val;
3943
3944 alc5505_dsp_halt(codec);
3945 alc5505_dsp_back_from_halt(codec);
3946 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3947 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3948 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3949 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3950 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3951 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3952 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3953 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3954 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3955 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3956 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3957 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3958 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3959
3960 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3961 if (val <= 3)
3962 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3963 else
3964 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3965
3966 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3967 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3968 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3969 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3970 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3971 alc5505_coef_set(codec, 0x880c, 0x00000003);
3972 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
3973
3974#ifdef HALT_REALTEK_ALC5505
3975 alc5505_dsp_halt(codec);
3976#endif
ad60d502
KY
3977}
3978
cd63a5ff 3979#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
3980#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3981#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
3982#else
3983#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3984#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3985#endif
3986
2a43952a 3987#ifdef CONFIG_PM
ad60d502
KY
3988static int alc269_suspend(struct hda_codec *codec)
3989{
3990 struct alc_spec *spec = codec->spec;
3991
3992 if (spec->has_alc5505_dsp)
cd63a5ff 3993 alc5505_dsp_suspend(codec);
ad60d502
KY
3994 return alc_suspend(codec);
3995}
3996
1d045db9
TI
3997static int alc269_resume(struct hda_codec *codec)
3998{
adcc70b2
KY
3999 struct alc_spec *spec = codec->spec;
4000
1387e2d1
KY
4001 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4002 alc269vb_toggle_power_output(codec, 0);
4003 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4004 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4005 msleep(150);
4006 }
8c427226 4007
1d045db9 4008 codec->patch_ops.init(codec);
f1d4e28b 4009
1387e2d1
KY
4010 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4011 alc269vb_toggle_power_output(codec, 1);
4012 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4013 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4014 msleep(200);
4015 }
f1d4e28b 4016
1a462be5 4017 snd_hda_regmap_sync(codec);
1d045db9 4018 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4019
4020 /* on some machine, the BIOS will clear the codec gpio data when enter
4021 * suspend, and won't restore the data after resume, so we restore it
4022 * in the driver.
4023 */
d261eec8
TI
4024 if (spec->gpio_data)
4025 alc_write_gpio_data(codec);
f475371a 4026
ad60d502 4027 if (spec->has_alc5505_dsp)
cd63a5ff 4028 alc5505_dsp_resume(codec);
c5177c86 4029
1d045db9
TI
4030 return 0;
4031}
2a43952a 4032#endif /* CONFIG_PM */
f1d4e28b 4033
108cc108 4034static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4035 const struct hda_fixup *fix, int action)
108cc108
DH
4036{
4037 struct alc_spec *spec = codec->spec;
4038
1727a771 4039 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4040 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4041}
4042
fdcc968a
JMG
4043static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4044 const struct hda_fixup *fix,
4045 int action)
4046{
4047 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4048 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4049
4050 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4051 snd_hda_codec_set_pincfg(codec, 0x19,
4052 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4053 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4054}
4055
1d045db9 4056static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4057 const struct hda_fixup *fix, int action)
1d045db9 4058{
98b24883
TI
4059 if (action == HDA_FIXUP_ACT_INIT)
4060 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4061}
f1d4e28b 4062
7c478f03
DH
4063static void alc269_fixup_headset_mic(struct hda_codec *codec,
4064 const struct hda_fixup *fix, int action)
4065{
4066 struct alc_spec *spec = codec->spec;
4067
4068 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4069 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4070}
4071
1d045db9 4072static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4073 const struct hda_fixup *fix, int action)
1d045db9
TI
4074{
4075 static const struct hda_verb verbs[] = {
4076 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4077 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4078 {}
4079 };
4080 unsigned int cfg;
f1d4e28b 4081
7639a06c
TI
4082 if (strcmp(codec->core.chip_name, "ALC271X") &&
4083 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4084 return;
4085 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4086 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4087 snd_hda_sequence_write(codec, verbs);
4088}
f1d4e28b 4089
c8426b27
TI
4090/* Fix the speaker amp after resume, etc */
4091static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4092 const struct hda_fixup *fix,
4093 int action)
4094{
4095 if (action == HDA_FIXUP_ACT_INIT)
4096 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4097}
4098
017f2a10 4099static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4100 const struct hda_fixup *fix, int action)
017f2a10
TI
4101{
4102 struct alc_spec *spec = codec->spec;
4103
1727a771 4104 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4105 return;
4106
4107 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4108 * fix the sample rate of analog I/O to 44.1kHz
4109 */
08c189f2
TI
4110 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4111 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4112}
4113
adabb3ec 4114static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4115 const struct hda_fixup *fix, int action)
adabb3ec 4116{
adabb3ec
TI
4117 /* The digital-mic unit sends PDM (differential signal) instead of
4118 * the standard PCM, thus you can't record a valid mono stream as is.
4119 * Below is a workaround specific to ALC269 to control the dmic
4120 * signal source as mono.
4121 */
98b24883
TI
4122 if (action == HDA_FIXUP_ACT_INIT)
4123 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4124}
4125
24519911
TI
4126static void alc269_quanta_automute(struct hda_codec *codec)
4127{
08c189f2 4128 snd_hda_gen_update_outputs(codec);
24519911 4129
1687ccc8
TI
4130 alc_write_coef_idx(codec, 0x0c, 0x680);
4131 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4132}
4133
4134static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4135 const struct hda_fixup *fix, int action)
24519911
TI
4136{
4137 struct alc_spec *spec = codec->spec;
1727a771 4138 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4139 return;
08c189f2 4140 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4141}
4142
d240d1dc 4143static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4144 struct hda_jack_callback *jack)
d240d1dc
DH
4145{
4146 struct alc_spec *spec = codec->spec;
4147 int vref;
4148 msleep(200);
4149 snd_hda_gen_hp_automute(codec, jack);
4150
4151 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4152 msleep(100);
4153 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4154 vref);
4155 msleep(500);
4156 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4157 vref);
4158}
4159
a2ef03fe
TE
4160/*
4161 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4162 */
4163struct hda_alc298_mbxinit {
4164 unsigned char value_0x23;
4165 unsigned char value_0x25;
4166};
4167
4168static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4169 const struct hda_alc298_mbxinit *initval,
4170 bool first)
4171{
4172 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4173 alc_write_coef_idx(codec, 0x26, 0xb000);
4174
4175 if (first)
4176 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4177
4178 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4179 alc_write_coef_idx(codec, 0x26, 0xf000);
4180 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4181
4182 if (initval->value_0x23 != 0x1e)
4183 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4184
4185 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4186 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4187}
4188
4189static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4190 const struct hda_fixup *fix,
4191 int action)
4192{
4193 /* Initialization magic */
4194 static const struct hda_alc298_mbxinit dac_init[] = {
4195 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4196 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4197 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4198 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4199 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4200 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4201 {0x2f, 0x00},
4202 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4203 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4204 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4205 {}
4206 };
4207 const struct hda_alc298_mbxinit *seq;
4208
4209 if (action != HDA_FIXUP_ACT_INIT)
4210 return;
4211
4212 /* Start */
4213 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4214 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4215 alc_write_coef_idx(codec, 0x26, 0xf000);
4216 alc_write_coef_idx(codec, 0x22, 0x31);
4217 alc_write_coef_idx(codec, 0x23, 0x0b);
4218 alc_write_coef_idx(codec, 0x25, 0x00);
4219 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4220 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4221
4222 for (seq = dac_init; seq->value_0x23; seq++)
4223 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4224}
4225
d240d1dc
DH
4226static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4227 const struct hda_fixup *fix, int action)
4228{
4229 struct alc_spec *spec = codec->spec;
4230 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4231 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4232 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4233 }
4234}
4235
766538ac
TI
4236static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4237 bool polarity, bool on)
4238{
4239 unsigned int pinval;
4240
4241 if (!pin)
4242 return;
4243 if (polarity)
4244 on = !on;
4245 pinval = snd_hda_codec_get_pin_target(codec, pin);
4246 pinval &= ~AC_PINCTL_VREFEN;
4247 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4248 /* temporarily power up/down for setting VREF */
4249 snd_hda_power_up_pm(codec);
4250 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4251 snd_hda_power_down_pm(codec);
4252}
d240d1dc 4253
08fb0d0e 4254/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4255static int vref_mute_led_set(struct led_classdev *led_cdev,
4256 enum led_brightness brightness)
6d3cd5d4 4257{
8d3d1ece 4258 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4259 struct alc_spec *spec = codec->spec;
08fb0d0e 4260
766538ac
TI
4261 alc_update_vref_led(codec, spec->mute_led_nid,
4262 spec->mute_led_polarity, brightness);
8d3d1ece 4263 return 0;
6d3cd5d4
DH
4264}
4265
d5b6b65e
DH
4266/* Make sure the led works even in runtime suspend */
4267static unsigned int led_power_filter(struct hda_codec *codec,
4268 hda_nid_t nid,
4269 unsigned int power_state)
4270{
4271 struct alc_spec *spec = codec->spec;
4272
50dd9050
HW
4273 if (power_state != AC_PWRST_D3 || nid == 0 ||
4274 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4275 return power_state;
4276
4277 /* Set pin ctl again, it might have just been set to 0 */
4278 snd_hda_set_pin_ctl(codec, nid,
4279 snd_hda_codec_get_pin_target(codec, nid));
4280
cffd3966 4281 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4282}
4283
08fb0d0e
TI
4284static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4285 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4286{
4287 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4288 const struct dmi_device *dev = NULL;
4289
4290 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4291 return;
4292
4293 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4294 int pol, pin;
4295 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4296 continue;
4297 if (pin < 0x0a || pin >= 0x10)
4298 break;
4299 spec->mute_led_polarity = pol;
4300 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4301 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4302 codec->power_filter = led_power_filter;
4e76a883
TI
4303 codec_dbg(codec,
4304 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4305 spec->mute_led_polarity);
6d3cd5d4
DH
4306 break;
4307 }
4308}
4309
85c467dc
TI
4310static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4311 const struct hda_fixup *fix,
4312 int action, hda_nid_t pin)
d06ac143
DH
4313{
4314 struct alc_spec *spec = codec->spec;
85c467dc 4315
d06ac143
DH
4316 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4317 spec->mute_led_polarity = 0;
85c467dc 4318 spec->mute_led_nid = pin;
8d3d1ece 4319 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4320 codec->power_filter = led_power_filter;
d06ac143
DH
4321 }
4322}
4323
85c467dc
TI
4324static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4325 const struct hda_fixup *fix, int action)
4326{
4327 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4328}
4329
08fb0d0e
TI
4330static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4331 const struct hda_fixup *fix, int action)
420b0feb 4332{
85c467dc 4333 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4334}
4335
7f783bd5
TB
4336static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4337 const struct hda_fixup *fix, int action)
4338{
85c467dc 4339 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4340}
4341
0f32fd19
TI
4342/* update LED status via GPIO */
4343static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4344 int polarity, bool enabled)
9f5c6faf 4345{
dbd13179 4346 if (polarity)
0f32fd19 4347 enabled = !enabled;
d261eec8 4348 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4349}
4350
0f32fd19 4351/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4352static int gpio_mute_led_set(struct led_classdev *led_cdev,
4353 enum led_brightness brightness)
9f5c6faf 4354{
8d3d1ece 4355 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4356 struct alc_spec *spec = codec->spec;
9f5c6faf 4357
dbd13179 4358 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4359 spec->mute_led_polarity, !brightness);
4360 return 0;
0f32fd19 4361}
9f5c6faf 4362
0f32fd19 4363/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4364static int micmute_led_set(struct led_classdev *led_cdev,
4365 enum led_brightness brightness)
4366{
4367 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4368 struct alc_spec *spec = codec->spec;
4369
4370 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4371 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4372 return 0;
4373}
4374
01e4a275
TI
4375/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4376static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4377 int action,
4378 unsigned int mute_mask,
4379 unsigned int micmute_mask)
9f5c6faf
TI
4380{
4381 struct alc_spec *spec = codec->spec;
9f5c6faf 4382
01e4a275
TI
4383 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4384
4385 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4386 return;
4387 if (mute_mask) {
4388 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4389 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4390 }
4391 if (micmute_mask) {
4392 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4393 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4394 }
4395}
4396
e7d66cf7
JS
4397static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4398 const struct hda_fixup *fix, int action)
4399{
4400 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4401}
4402
01e4a275 4403static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4404 const struct hda_fixup *fix, int action)
4405{
01e4a275
TI
4406 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4407}
eaa8e5ef 4408
f5a88b0a
KHF
4409static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4410 const struct hda_fixup *fix, int action)
4411{
3e0650ab 4412 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4413}
4414
01e4a275
TI
4415static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4416 const struct hda_fixup *fix, int action)
4417{
4418 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4419}
4420
a0ccbc53
KY
4421static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4422 const struct hda_fixup *fix, int action)
4423{
4424 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4425}
4426
c47b3112
JC
4427static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4428 const struct hda_fixup *fix, int action)
4429{
4430 struct alc_spec *spec = codec->spec;
4431
4432 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4433 spec->micmute_led_polarity = 1;
4434 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4435}
4436
8a503555
TI
4437/* turn on/off mic-mute LED per capture hook via VREF change */
4438static int vref_micmute_led_set(struct led_classdev *led_cdev,
4439 enum led_brightness brightness)
9c5dc3bf 4440{
8a503555 4441 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4442 struct alc_spec *spec = codec->spec;
9c5dc3bf 4443
766538ac
TI
4444 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4445 spec->micmute_led_polarity, brightness);
8a503555 4446 return 0;
9c5dc3bf
KY
4447}
4448
4449static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4450 const struct hda_fixup *fix, int action)
4451{
4452 struct alc_spec *spec = codec->spec;
9c5dc3bf 4453
01e4a275 4454 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4455 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4456 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4457 * enable headphone amp
4458 */
4459 spec->gpio_mask |= 0x10;
4460 spec->gpio_dir |= 0x10;
9c5dc3bf 4461 spec->cap_mute_led_nid = 0x18;
8a503555 4462 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4463 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4464 }
4465}
4466
7a5255f1
DH
4467static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4468 const struct hda_fixup *fix, int action)
4469{
7a5255f1 4470 struct alc_spec *spec = codec->spec;
7a5255f1 4471
01e4a275 4472 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4473 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4474 spec->cap_mute_led_nid = 0x18;
8a503555 4475 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4476 codec->power_filter = led_power_filter;
4477 }
4478}
4479
c3bb2b52
TI
4480/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4481 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4482 */
4483static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4484 const struct hda_fixup *fix, int action)
4485{
4486 struct alc_spec *spec = codec->spec;
4487
4488 switch (action) {
4489 case HDA_FIXUP_ACT_PRE_PROBE:
4490 spec->gpio_mask |= 0x01;
4491 spec->gpio_dir |= 0x01;
4492 break;
4493 case HDA_FIXUP_ACT_INIT:
4494 /* need to toggle GPIO to enable the amp */
4495 alc_update_gpio_data(codec, 0x01, true);
4496 msleep(100);
4497 alc_update_gpio_data(codec, 0x01, false);
4498 break;
4499 }
4500}
4501
622464c8
TI
4502/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4503static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4504 struct hda_codec *codec,
4505 struct snd_pcm_substream *substream,
4506 int action)
4507{
4508 switch (action) {
4509 case HDA_GEN_PCM_ACT_PREPARE:
4510 alc_update_gpio_data(codec, 0x04, true);
4511 break;
4512 case HDA_GEN_PCM_ACT_CLEANUP:
4513 alc_update_gpio_data(codec, 0x04, false);
4514 break;
4515 }
4516}
4517
4518static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4519 const struct hda_fixup *fix,
4520 int action)
4521{
4522 struct alc_spec *spec = codec->spec;
4523
4524 if (action == HDA_FIXUP_ACT_PROBE) {
4525 spec->gpio_mask |= 0x04;
4526 spec->gpio_dir |= 0x04;
4527 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4528 }
4529}
4530
766538ac
TI
4531static void alc_update_coef_led(struct hda_codec *codec,
4532 struct alc_coef_led *led,
4533 bool polarity, bool on)
4534{
4535 if (polarity)
4536 on = !on;
4537 /* temporarily power up/down for setting COEF bit */
4538 alc_update_coef_idx(codec, led->idx, led->mask,
4539 on ? led->on : led->off);
4540}
4541
431e76c3 4542/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4543static int coef_mute_led_set(struct led_classdev *led_cdev,
4544 enum led_brightness brightness)
431e76c3 4545{
8d3d1ece 4546 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4547 struct alc_spec *spec = codec->spec;
4548
766538ac
TI
4549 alc_update_coef_led(codec, &spec->mute_led_coef,
4550 spec->mute_led_polarity, brightness);
8d3d1ece 4551 return 0;
431e76c3
KY
4552}
4553
4554static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4555 const struct hda_fixup *fix,
4556 int action)
4557{
4558 struct alc_spec *spec = codec->spec;
4559
4560 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4561 spec->mute_led_polarity = 0;
766538ac
TI
4562 spec->mute_led_coef.idx = 0x0b;
4563 spec->mute_led_coef.mask = 1 << 3;
4564 spec->mute_led_coef.on = 1 << 3;
4565 spec->mute_led_coef.off = 0;
8d3d1ece 4566 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4567 }
4568}
4569
24164f43
KY
4570static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4571 const struct hda_fixup *fix,
4572 int action)
4573{
4574 struct alc_spec *spec = codec->spec;
4575
4576 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4577 spec->mute_led_polarity = 0;
766538ac
TI
4578 spec->mute_led_coef.idx = 0x34;
4579 spec->mute_led_coef.mask = 1 << 5;
4580 spec->mute_led_coef.on = 0;
4581 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4582 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4583 }
4584}
4585
431e76c3 4586/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4587static int coef_micmute_led_set(struct led_classdev *led_cdev,
4588 enum led_brightness brightness)
431e76c3 4589{
8a503555 4590 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4591 struct alc_spec *spec = codec->spec;
4592
766538ac
TI
4593 alc_update_coef_led(codec, &spec->mic_led_coef,
4594 spec->micmute_led_polarity, brightness);
8a503555 4595 return 0;
431e76c3
KY
4596}
4597
4598static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4599 const struct hda_fixup *fix, int action)
4600{
4601 struct alc_spec *spec = codec->spec;
4602
4603 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4604 spec->mic_led_coef.idx = 0x19;
4605 spec->mic_led_coef.mask = 1 << 13;
4606 spec->mic_led_coef.on = 1 << 13;
4607 spec->mic_led_coef.off = 0;
8a503555 4608 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4609 }
4610}
4611
24164f43
KY
4612static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4613 const struct hda_fixup *fix, int action)
4614{
4615 struct alc_spec *spec = codec->spec;
4616
4617 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4618 spec->mic_led_coef.idx = 0x35;
4619 spec->mic_led_coef.mask = 3 << 2;
4620 spec->mic_led_coef.on = 2 << 2;
4621 spec->mic_led_coef.off = 1 << 2;
8a503555 4622 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4623 }
4624}
4625
431e76c3
KY
4626static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4627 const struct hda_fixup *fix, int action)
4628{
4629 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4630 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4631}
4632
24164f43
KY
4633static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4634 const struct hda_fixup *fix, int action)
4635{
4636 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4637 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4638}
4639
75b62ab6
JW
4640static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4641 const struct hda_fixup *fix, int action)
4642{
4643 struct alc_spec *spec = codec->spec;
4644
4645 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4646 spec->cap_mute_led_nid = 0x1a;
4647 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4648 codec->power_filter = led_power_filter;
4649 }
4650}
4651
4652static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4653 const struct hda_fixup *fix, int action)
4654{
4655 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4656 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4657}
4658
6a30abaa 4659#if IS_REACHABLE(CONFIG_INPUT)
33f4acd3
DH
4660static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4661 struct hda_jack_callback *event)
4662{
4663 struct alc_spec *spec = codec->spec;
4664
4665 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4666 send both key on and key off event for every interrupt. */
c7b60a89 4667 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 4668 input_sync(spec->kb_dev);
c7b60a89 4669 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
4670 input_sync(spec->kb_dev);
4671}
33f4acd3 4672
3694cb29
K
4673static int alc_register_micmute_input_device(struct hda_codec *codec)
4674{
4675 struct alc_spec *spec = codec->spec;
c7b60a89 4676 int i;
3694cb29
K
4677
4678 spec->kb_dev = input_allocate_device();
4679 if (!spec->kb_dev) {
4680 codec_err(codec, "Out of memory (input_allocate_device)\n");
4681 return -ENOMEM;
4682 }
c7b60a89
HW
4683
4684 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4685
3694cb29
K
4686 spec->kb_dev->name = "Microphone Mute Button";
4687 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
4688 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4689 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4690 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4691 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4692 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
4693
4694 if (input_register_device(spec->kb_dev)) {
4695 codec_err(codec, "input_register_device failed\n");
4696 input_free_device(spec->kb_dev);
4697 spec->kb_dev = NULL;
4698 return -ENOMEM;
4699 }
4700
4701 return 0;
4702}
4703
01e4a275
TI
4704/* GPIO1 = set according to SKU external amp
4705 * GPIO2 = mic mute hotkey
4706 * GPIO3 = mute LED
4707 * GPIO4 = mic mute LED
4708 */
33f4acd3
DH
4709static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4710 const struct hda_fixup *fix, int action)
4711{
33f4acd3
DH
4712 struct alc_spec *spec = codec->spec;
4713
01e4a275 4714 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 4715 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4716 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 4717 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 4718 return;
33f4acd3 4719
01e4a275
TI
4720 spec->gpio_mask |= 0x06;
4721 spec->gpio_dir |= 0x02;
4722 spec->gpio_data |= 0x02;
7639a06c 4723 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 4724 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 4725 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 4726 gpio2_mic_hotkey_event);
33f4acd3
DH
4727 return;
4728 }
4729
4730 if (!spec->kb_dev)
4731 return;
4732
4733 switch (action) {
33f4acd3
DH
4734 case HDA_FIXUP_ACT_FREE:
4735 input_unregister_device(spec->kb_dev);
33f4acd3
DH
4736 spec->kb_dev = NULL;
4737 }
33f4acd3
DH
4738}
4739
01e4a275
TI
4740/* Line2 = mic mute hotkey
4741 * GPIO2 = mic mute LED
4742 */
3694cb29
K
4743static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4744 const struct hda_fixup *fix, int action)
4745{
3694cb29
K
4746 struct alc_spec *spec = codec->spec;
4747
01e4a275 4748 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 4749 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4750 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
4751 if (alc_register_micmute_input_device(codec) != 0)
4752 return;
4753
3694cb29
K
4754 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4755 gpio2_mic_hotkey_event);
3694cb29
K
4756 return;
4757 }
4758
4759 if (!spec->kb_dev)
4760 return;
4761
4762 switch (action) {
3694cb29
K
4763 case HDA_FIXUP_ACT_FREE:
4764 input_unregister_device(spec->kb_dev);
4765 spec->kb_dev = NULL;
4766 }
4767}
c469652b
TI
4768#else /* INPUT */
4769#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4770#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4771#endif /* INPUT */
3694cb29 4772
9c5dc3bf
KY
4773static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4774 const struct hda_fixup *fix, int action)
4775{
4776 struct alc_spec *spec = codec->spec;
4777
1bce62a6 4778 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 4779 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 4780 spec->cap_mute_led_nid = 0x18;
8a503555 4781 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
4782 }
4783}
4784
6b0f95c4 4785static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
4786 UPDATE_COEF(0x4a, 1<<8, 0),
4787 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4788 UPDATE_COEF(0x63, 3<<14, 3<<14),
4789 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4790 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4791 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4792 UPDATE_COEF(0x4a, 3<<10, 0),
4793 {}
4794};
4795
73bdd597
DH
4796static void alc_headset_mode_unplugged(struct hda_codec *codec)
4797{
92666d45 4798 struct alc_spec *spec = codec->spec;
6b0f95c4 4799 static const struct coef_fw coef0255[] = {
717f43d8 4800 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
4801 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4802 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4803 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4804 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4805 {}
4806 };
6b0f95c4 4807 static const struct coef_fw coef0256[] = {
e69e7e03 4808 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
4809 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4810 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4811 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4812 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
4813 {}
4814 };
6b0f95c4 4815 static const struct coef_fw coef0233[] = {
54db6c39
TI
4816 WRITE_COEF(0x1b, 0x0c0b),
4817 WRITE_COEF(0x45, 0xc429),
4818 UPDATE_COEF(0x35, 0x4000, 0),
4819 WRITE_COEF(0x06, 0x2104),
4820 WRITE_COEF(0x1a, 0x0001),
4821 WRITE_COEF(0x26, 0x0004),
4822 WRITE_COEF(0x32, 0x42a3),
4823 {}
4824 };
6b0f95c4 4825 static const struct coef_fw coef0288[] = {
f3b70332
KY
4826 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4827 UPDATE_COEF(0x50, 0x2000, 0x2000),
4828 UPDATE_COEF(0x56, 0x0006, 0x0006),
4829 UPDATE_COEF(0x66, 0x0008, 0),
4830 UPDATE_COEF(0x67, 0x2000, 0),
4831 {}
4832 };
6b0f95c4 4833 static const struct coef_fw coef0298[] = {
89542936
KY
4834 UPDATE_COEF(0x19, 0x1300, 0x0300),
4835 {}
4836 };
6b0f95c4 4837 static const struct coef_fw coef0292[] = {
54db6c39
TI
4838 WRITE_COEF(0x76, 0x000e),
4839 WRITE_COEF(0x6c, 0x2400),
4840 WRITE_COEF(0x18, 0x7308),
4841 WRITE_COEF(0x6b, 0xc429),
4842 {}
4843 };
6b0f95c4 4844 static const struct coef_fw coef0293[] = {
54db6c39
TI
4845 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4846 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4847 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4848 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4849 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4850 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4851 {}
4852 };
6b0f95c4 4853 static const struct coef_fw coef0668[] = {
54db6c39
TI
4854 WRITE_COEF(0x15, 0x0d40),
4855 WRITE_COEF(0xb7, 0x802b),
4856 {}
4857 };
6b0f95c4 4858 static const struct coef_fw coef0225[] = {
5a36767a 4859 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
4860 {}
4861 };
6b0f95c4 4862 static const struct coef_fw coef0274[] = {
71683c32
KY
4863 UPDATE_COEF(0x4a, 0x0100, 0),
4864 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4865 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4866 UPDATE_COEF(0x4a, 0x0010, 0),
4867 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4868 WRITE_COEF(0x45, 0x5289),
4869 UPDATE_COEF(0x4a, 0x0c00, 0),
4870 {}
4871 };
54db6c39 4872
92666d45
KY
4873 if (spec->no_internal_mic_pin) {
4874 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4875 return;
4876 }
4877
7639a06c 4878 switch (codec->core.vendor_id) {
9a22a8f5 4879 case 0x10ec0255:
e69e7e03
KY
4880 alc_process_coef_fw(codec, coef0255);
4881 break;
1948fc06 4882 case 0x10ec0230:
736f20a7 4883 case 0x10ec0236:
7081adf3 4884 case 0x10ec0256:
e69e7e03 4885 alc_process_coef_fw(codec, coef0256);
9a22a8f5 4886 break;
71683c32
KY
4887 case 0x10ec0234:
4888 case 0x10ec0274:
4889 case 0x10ec0294:
4890 alc_process_coef_fw(codec, coef0274);
4891 break;
13fd08a3 4892 case 0x10ec0233:
73bdd597 4893 case 0x10ec0283:
54db6c39 4894 alc_process_coef_fw(codec, coef0233);
73bdd597 4895 break;
f3b70332
KY
4896 case 0x10ec0286:
4897 case 0x10ec0288:
89542936
KY
4898 alc_process_coef_fw(codec, coef0288);
4899 break;
1a5bc8d9 4900 case 0x10ec0298:
89542936 4901 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
4902 alc_process_coef_fw(codec, coef0288);
4903 break;
73bdd597 4904 case 0x10ec0292:
54db6c39 4905 alc_process_coef_fw(codec, coef0292);
73bdd597 4906 break;
a22aa26f 4907 case 0x10ec0293:
54db6c39 4908 alc_process_coef_fw(codec, coef0293);
a22aa26f 4909 break;
73bdd597 4910 case 0x10ec0668:
54db6c39 4911 alc_process_coef_fw(codec, coef0668);
73bdd597 4912 break;
c2b691ee 4913 case 0x10ec0215:
4cc9b9d6 4914 case 0x10ec0225:
c2b691ee 4915 case 0x10ec0285:
7d727869 4916 case 0x10ec0295:
c2b691ee 4917 case 0x10ec0289:
28f1f9b2 4918 case 0x10ec0299:
4d4b0c52 4919 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
4920 alc_process_coef_fw(codec, coef0225);
4921 break;
78f4f7c2
KY
4922 case 0x10ec0867:
4923 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4924 break;
73bdd597 4925 }
4e76a883 4926 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
4927}
4928
4929
4930static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4931 hda_nid_t mic_pin)
4932{
6b0f95c4 4933 static const struct coef_fw coef0255[] = {
54db6c39
TI
4934 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4935 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4936 {}
4937 };
6b0f95c4 4938 static const struct coef_fw coef0256[] = {
717f43d8
KY
4939 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4940 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4941 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4942 {}
4943 };
6b0f95c4 4944 static const struct coef_fw coef0233[] = {
54db6c39
TI
4945 UPDATE_COEF(0x35, 0, 1<<14),
4946 WRITE_COEF(0x06, 0x2100),
4947 WRITE_COEF(0x1a, 0x0021),
4948 WRITE_COEF(0x26, 0x008c),
4949 {}
4950 };
6b0f95c4 4951 static const struct coef_fw coef0288[] = {
89542936 4952 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
4953 UPDATE_COEF(0x50, 0x2000, 0),
4954 UPDATE_COEF(0x56, 0x0006, 0),
4955 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4956 UPDATE_COEF(0x66, 0x0008, 0x0008),
4957 UPDATE_COEF(0x67, 0x2000, 0x2000),
4958 {}
4959 };
6b0f95c4 4960 static const struct coef_fw coef0292[] = {
54db6c39
TI
4961 WRITE_COEF(0x19, 0xa208),
4962 WRITE_COEF(0x2e, 0xacf0),
4963 {}
4964 };
6b0f95c4 4965 static const struct coef_fw coef0293[] = {
54db6c39
TI
4966 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4967 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4968 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4969 {}
4970 };
6b0f95c4 4971 static const struct coef_fw coef0688[] = {
54db6c39
TI
4972 WRITE_COEF(0xb7, 0x802b),
4973 WRITE_COEF(0xb5, 0x1040),
4974 UPDATE_COEF(0xc3, 0, 1<<12),
4975 {}
4976 };
6b0f95c4 4977 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
4978 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4979 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4980 UPDATE_COEF(0x63, 3<<14, 0),
4981 {}
4982 };
6b0f95c4 4983 static const struct coef_fw coef0274[] = {
71683c32
KY
4984 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4985 UPDATE_COEF(0x4a, 0x0010, 0),
4986 UPDATE_COEF(0x6b, 0xf000, 0),
4987 {}
4988 };
54db6c39 4989
7639a06c 4990 switch (codec->core.vendor_id) {
9a22a8f5
KY
4991 case 0x10ec0255:
4992 alc_write_coef_idx(codec, 0x45, 0xc489);
4993 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 4994 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
4995 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4996 break;
1948fc06 4997 case 0x10ec0230:
717f43d8
KY
4998 case 0x10ec0236:
4999 case 0x10ec0256:
5000 alc_write_coef_idx(codec, 0x45, 0xc489);
5001 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5002 alc_process_coef_fw(codec, coef0256);
5003 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5004 break;
71683c32
KY
5005 case 0x10ec0234:
5006 case 0x10ec0274:
5007 case 0x10ec0294:
5008 alc_write_coef_idx(codec, 0x45, 0x4689);
5009 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5010 alc_process_coef_fw(codec, coef0274);
5011 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5012 break;
13fd08a3 5013 case 0x10ec0233:
73bdd597
DH
5014 case 0x10ec0283:
5015 alc_write_coef_idx(codec, 0x45, 0xc429);
5016 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5017 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5018 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5019 break;
f3b70332
KY
5020 case 0x10ec0286:
5021 case 0x10ec0288:
1a5bc8d9 5022 case 0x10ec0298:
f3b70332
KY
5023 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5024 alc_process_coef_fw(codec, coef0288);
5025 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5026 break;
73bdd597
DH
5027 case 0x10ec0292:
5028 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5029 alc_process_coef_fw(codec, coef0292);
73bdd597 5030 break;
a22aa26f
KY
5031 case 0x10ec0293:
5032 /* Set to TRS mode */
5033 alc_write_coef_idx(codec, 0x45, 0xc429);
5034 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5035 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5036 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5037 break;
78f4f7c2
KY
5038 case 0x10ec0867:
5039 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5040 fallthrough;
9eb5d0e6 5041 case 0x10ec0221:
1f8b46cd
DH
5042 case 0x10ec0662:
5043 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5044 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5045 break;
73bdd597
DH
5046 case 0x10ec0668:
5047 alc_write_coef_idx(codec, 0x11, 0x0001);
5048 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5049 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5050 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5051 break;
c2b691ee 5052 case 0x10ec0215:
4cc9b9d6 5053 case 0x10ec0225:
c2b691ee 5054 case 0x10ec0285:
7d727869 5055 case 0x10ec0295:
c2b691ee 5056 case 0x10ec0289:
28f1f9b2 5057 case 0x10ec0299:
5a36767a 5058 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5059 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5060 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5061 alc_process_coef_fw(codec, coef0225);
5062 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5063 break;
73bdd597 5064 }
4e76a883 5065 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5066}
5067
5068static void alc_headset_mode_default(struct hda_codec *codec)
5069{
6b0f95c4 5070 static const struct coef_fw coef0225[] = {
5a36767a
KY
5071 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5072 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5073 UPDATE_COEF(0x49, 3<<8, 0<<8),
5074 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5075 UPDATE_COEF(0x63, 3<<14, 0),
5076 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5077 {}
5078 };
6b0f95c4 5079 static const struct coef_fw coef0255[] = {
54db6c39
TI
5080 WRITE_COEF(0x45, 0xc089),
5081 WRITE_COEF(0x45, 0xc489),
5082 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5083 WRITE_COEF(0x49, 0x0049),
5084 {}
5085 };
6b0f95c4 5086 static const struct coef_fw coef0256[] = {
717f43d8
KY
5087 WRITE_COEF(0x45, 0xc489),
5088 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5089 WRITE_COEF(0x49, 0x0049),
5090 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5091 WRITE_COEF(0x06, 0x6100),
5092 {}
5093 };
6b0f95c4 5094 static const struct coef_fw coef0233[] = {
54db6c39
TI
5095 WRITE_COEF(0x06, 0x2100),
5096 WRITE_COEF(0x32, 0x4ea3),
5097 {}
5098 };
6b0f95c4 5099 static const struct coef_fw coef0288[] = {
f3b70332
KY
5100 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5101 UPDATE_COEF(0x50, 0x2000, 0x2000),
5102 UPDATE_COEF(0x56, 0x0006, 0x0006),
5103 UPDATE_COEF(0x66, 0x0008, 0),
5104 UPDATE_COEF(0x67, 0x2000, 0),
5105 {}
5106 };
6b0f95c4 5107 static const struct coef_fw coef0292[] = {
54db6c39
TI
5108 WRITE_COEF(0x76, 0x000e),
5109 WRITE_COEF(0x6c, 0x2400),
5110 WRITE_COEF(0x6b, 0xc429),
5111 WRITE_COEF(0x18, 0x7308),
5112 {}
5113 };
6b0f95c4 5114 static const struct coef_fw coef0293[] = {
54db6c39
TI
5115 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5116 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
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(0x11, 0x0041),
5122 WRITE_COEF(0x15, 0x0d40),
5123 WRITE_COEF(0xb7, 0x802b),
5124 {}
5125 };
6b0f95c4 5126 static const struct coef_fw coef0274[] = {
71683c32
KY
5127 WRITE_COEF(0x45, 0x4289),
5128 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5129 UPDATE_COEF(0x6b, 0x0f00, 0),
5130 UPDATE_COEF(0x49, 0x0300, 0x0300),
5131 {}
5132 };
54db6c39 5133
7639a06c 5134 switch (codec->core.vendor_id) {
c2b691ee 5135 case 0x10ec0215:
2ae95577 5136 case 0x10ec0225:
c2b691ee 5137 case 0x10ec0285:
7d727869 5138 case 0x10ec0295:
c2b691ee 5139 case 0x10ec0289:
28f1f9b2 5140 case 0x10ec0299:
5a36767a 5141 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577
DH
5142 alc_process_coef_fw(codec, coef0225);
5143 break;
9a22a8f5 5144 case 0x10ec0255:
54db6c39 5145 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5146 break;
1948fc06 5147 case 0x10ec0230:
717f43d8
KY
5148 case 0x10ec0236:
5149 case 0x10ec0256:
5150 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5151 alc_write_coef_idx(codec, 0x45, 0xc089);
5152 msleep(50);
5153 alc_process_coef_fw(codec, coef0256);
5154 break;
71683c32
KY
5155 case 0x10ec0234:
5156 case 0x10ec0274:
5157 case 0x10ec0294:
5158 alc_process_coef_fw(codec, coef0274);
5159 break;
13fd08a3 5160 case 0x10ec0233:
73bdd597 5161 case 0x10ec0283:
54db6c39 5162 alc_process_coef_fw(codec, coef0233);
73bdd597 5163 break;
f3b70332
KY
5164 case 0x10ec0286:
5165 case 0x10ec0288:
1a5bc8d9 5166 case 0x10ec0298:
f3b70332
KY
5167 alc_process_coef_fw(codec, coef0288);
5168 break;
73bdd597 5169 case 0x10ec0292:
54db6c39 5170 alc_process_coef_fw(codec, coef0292);
73bdd597 5171 break;
a22aa26f 5172 case 0x10ec0293:
54db6c39 5173 alc_process_coef_fw(codec, coef0293);
a22aa26f 5174 break;
73bdd597 5175 case 0x10ec0668:
54db6c39 5176 alc_process_coef_fw(codec, coef0688);
73bdd597 5177 break;
78f4f7c2
KY
5178 case 0x10ec0867:
5179 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5180 break;
73bdd597 5181 }
4e76a883 5182 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5183}
5184
5185/* Iphone type */
5186static void alc_headset_mode_ctia(struct hda_codec *codec)
5187{
89542936
KY
5188 int val;
5189
6b0f95c4 5190 static const struct coef_fw coef0255[] = {
54db6c39
TI
5191 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5192 WRITE_COEF(0x1b, 0x0c2b),
5193 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5194 {}
5195 };
6b0f95c4 5196 static const struct coef_fw coef0256[] = {
e69e7e03 5197 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5198 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5199 {}
5200 };
6b0f95c4 5201 static const struct coef_fw coef0233[] = {
54db6c39
TI
5202 WRITE_COEF(0x45, 0xd429),
5203 WRITE_COEF(0x1b, 0x0c2b),
5204 WRITE_COEF(0x32, 0x4ea3),
5205 {}
5206 };
6b0f95c4 5207 static const struct coef_fw coef0288[] = {
f3b70332
KY
5208 UPDATE_COEF(0x50, 0x2000, 0x2000),
5209 UPDATE_COEF(0x56, 0x0006, 0x0006),
5210 UPDATE_COEF(0x66, 0x0008, 0),
5211 UPDATE_COEF(0x67, 0x2000, 0),
5212 {}
5213 };
6b0f95c4 5214 static const struct coef_fw coef0292[] = {
54db6c39
TI
5215 WRITE_COEF(0x6b, 0xd429),
5216 WRITE_COEF(0x76, 0x0008),
5217 WRITE_COEF(0x18, 0x7388),
5218 {}
5219 };
6b0f95c4 5220 static const struct coef_fw coef0293[] = {
54db6c39
TI
5221 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5222 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5223 {}
5224 };
6b0f95c4 5225 static const struct coef_fw coef0688[] = {
54db6c39
TI
5226 WRITE_COEF(0x11, 0x0001),
5227 WRITE_COEF(0x15, 0x0d60),
5228 WRITE_COEF(0xc3, 0x0000),
5229 {}
5230 };
6b0f95c4 5231 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5232 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5233 UPDATE_COEF(0x63, 3<<14, 2<<14),
5234 {}
5235 };
6b0f95c4 5236 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5237 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5238 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5239 {}
5240 };
54db6c39 5241
7639a06c 5242 switch (codec->core.vendor_id) {
9a22a8f5 5243 case 0x10ec0255:
54db6c39 5244 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5245 break;
1948fc06 5246 case 0x10ec0230:
736f20a7 5247 case 0x10ec0236:
e69e7e03
KY
5248 case 0x10ec0256:
5249 alc_process_coef_fw(codec, coef0256);
5250 break;
71683c32
KY
5251 case 0x10ec0234:
5252 case 0x10ec0274:
5253 case 0x10ec0294:
5254 alc_write_coef_idx(codec, 0x45, 0xd689);
5255 break;
13fd08a3 5256 case 0x10ec0233:
73bdd597 5257 case 0x10ec0283:
54db6c39 5258 alc_process_coef_fw(codec, coef0233);
73bdd597 5259 break;
1a5bc8d9 5260 case 0x10ec0298:
89542936
KY
5261 val = alc_read_coef_idx(codec, 0x50);
5262 if (val & (1 << 12)) {
5263 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5264 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5265 msleep(300);
5266 } else {
5267 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5268 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5269 msleep(300);
5270 }
5271 break;
f3b70332
KY
5272 case 0x10ec0286:
5273 case 0x10ec0288:
5274 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5275 msleep(300);
5276 alc_process_coef_fw(codec, coef0288);
5277 break;
73bdd597 5278 case 0x10ec0292:
54db6c39 5279 alc_process_coef_fw(codec, coef0292);
73bdd597 5280 break;
a22aa26f 5281 case 0x10ec0293:
54db6c39 5282 alc_process_coef_fw(codec, coef0293);
a22aa26f 5283 break;
73bdd597 5284 case 0x10ec0668:
54db6c39 5285 alc_process_coef_fw(codec, coef0688);
73bdd597 5286 break;
c2b691ee 5287 case 0x10ec0215:
4cc9b9d6 5288 case 0x10ec0225:
c2b691ee 5289 case 0x10ec0285:
7d727869 5290 case 0x10ec0295:
c2b691ee 5291 case 0x10ec0289:
28f1f9b2 5292 case 0x10ec0299:
5a36767a
KY
5293 val = alc_read_coef_idx(codec, 0x45);
5294 if (val & (1 << 9))
5295 alc_process_coef_fw(codec, coef0225_2);
5296 else
5297 alc_process_coef_fw(codec, coef0225_1);
4cc9b9d6 5298 break;
78f4f7c2
KY
5299 case 0x10ec0867:
5300 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5301 break;
73bdd597 5302 }
4e76a883 5303 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5304}
5305
5306/* Nokia type */
5307static void alc_headset_mode_omtp(struct hda_codec *codec)
5308{
6b0f95c4 5309 static const struct coef_fw coef0255[] = {
54db6c39
TI
5310 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5311 WRITE_COEF(0x1b, 0x0c2b),
5312 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5313 {}
5314 };
6b0f95c4 5315 static const struct coef_fw coef0256[] = {
e69e7e03 5316 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5317 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5318 {}
5319 };
6b0f95c4 5320 static const struct coef_fw coef0233[] = {
54db6c39
TI
5321 WRITE_COEF(0x45, 0xe429),
5322 WRITE_COEF(0x1b, 0x0c2b),
5323 WRITE_COEF(0x32, 0x4ea3),
5324 {}
5325 };
6b0f95c4 5326 static const struct coef_fw coef0288[] = {
f3b70332
KY
5327 UPDATE_COEF(0x50, 0x2000, 0x2000),
5328 UPDATE_COEF(0x56, 0x0006, 0x0006),
5329 UPDATE_COEF(0x66, 0x0008, 0),
5330 UPDATE_COEF(0x67, 0x2000, 0),
5331 {}
5332 };
6b0f95c4 5333 static const struct coef_fw coef0292[] = {
54db6c39
TI
5334 WRITE_COEF(0x6b, 0xe429),
5335 WRITE_COEF(0x76, 0x0008),
5336 WRITE_COEF(0x18, 0x7388),
5337 {}
5338 };
6b0f95c4 5339 static const struct coef_fw coef0293[] = {
54db6c39
TI
5340 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5341 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5342 {}
5343 };
6b0f95c4 5344 static const struct coef_fw coef0688[] = {
54db6c39
TI
5345 WRITE_COEF(0x11, 0x0001),
5346 WRITE_COEF(0x15, 0x0d50),
5347 WRITE_COEF(0xc3, 0x0000),
5348 {}
5349 };
6b0f95c4 5350 static const struct coef_fw coef0225[] = {
4cc9b9d6 5351 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5352 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5353 {}
5354 };
54db6c39 5355
7639a06c 5356 switch (codec->core.vendor_id) {
9a22a8f5 5357 case 0x10ec0255:
54db6c39 5358 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5359 break;
1948fc06 5360 case 0x10ec0230:
736f20a7 5361 case 0x10ec0236:
e69e7e03
KY
5362 case 0x10ec0256:
5363 alc_process_coef_fw(codec, coef0256);
5364 break;
71683c32
KY
5365 case 0x10ec0234:
5366 case 0x10ec0274:
5367 case 0x10ec0294:
5368 alc_write_coef_idx(codec, 0x45, 0xe689);
5369 break;
13fd08a3 5370 case 0x10ec0233:
73bdd597 5371 case 0x10ec0283:
54db6c39 5372 alc_process_coef_fw(codec, coef0233);
73bdd597 5373 break;
1a5bc8d9
KY
5374 case 0x10ec0298:
5375 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5376 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5377 msleep(300);
5378 break;
f3b70332
KY
5379 case 0x10ec0286:
5380 case 0x10ec0288:
5381 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5382 msleep(300);
5383 alc_process_coef_fw(codec, coef0288);
5384 break;
73bdd597 5385 case 0x10ec0292:
54db6c39 5386 alc_process_coef_fw(codec, coef0292);
73bdd597 5387 break;
a22aa26f 5388 case 0x10ec0293:
54db6c39 5389 alc_process_coef_fw(codec, coef0293);
a22aa26f 5390 break;
73bdd597 5391 case 0x10ec0668:
54db6c39 5392 alc_process_coef_fw(codec, coef0688);
73bdd597 5393 break;
c2b691ee 5394 case 0x10ec0215:
4cc9b9d6 5395 case 0x10ec0225:
c2b691ee 5396 case 0x10ec0285:
7d727869 5397 case 0x10ec0295:
c2b691ee 5398 case 0x10ec0289:
28f1f9b2 5399 case 0x10ec0299:
4cc9b9d6
KY
5400 alc_process_coef_fw(codec, coef0225);
5401 break;
73bdd597 5402 }
4e76a883 5403 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5404}
5405
5406static void alc_determine_headset_type(struct hda_codec *codec)
5407{
5408 int val;
5409 bool is_ctia = false;
5410 struct alc_spec *spec = codec->spec;
6b0f95c4 5411 static const struct coef_fw coef0255[] = {
54db6c39
TI
5412 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5413 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5414 conteol) */
5415 {}
5416 };
6b0f95c4 5417 static const struct coef_fw coef0288[] = {
f3b70332
KY
5418 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5419 {}
5420 };
6b0f95c4 5421 static const struct coef_fw coef0298[] = {
89542936
KY
5422 UPDATE_COEF(0x50, 0x2000, 0x2000),
5423 UPDATE_COEF(0x56, 0x0006, 0x0006),
5424 UPDATE_COEF(0x66, 0x0008, 0),
5425 UPDATE_COEF(0x67, 0x2000, 0),
5426 UPDATE_COEF(0x19, 0x1300, 0x1300),
5427 {}
5428 };
6b0f95c4 5429 static const struct coef_fw coef0293[] = {
54db6c39
TI
5430 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5431 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5432 {}
5433 };
6b0f95c4 5434 static const struct coef_fw coef0688[] = {
54db6c39
TI
5435 WRITE_COEF(0x11, 0x0001),
5436 WRITE_COEF(0xb7, 0x802b),
5437 WRITE_COEF(0x15, 0x0d60),
5438 WRITE_COEF(0xc3, 0x0c00),
5439 {}
5440 };
6b0f95c4 5441 static const struct coef_fw coef0274[] = {
71683c32
KY
5442 UPDATE_COEF(0x4a, 0x0010, 0),
5443 UPDATE_COEF(0x4a, 0x8000, 0),
5444 WRITE_COEF(0x45, 0xd289),
5445 UPDATE_COEF(0x49, 0x0300, 0x0300),
5446 {}
5447 };
73bdd597 5448
92666d45
KY
5449 if (spec->no_internal_mic_pin) {
5450 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5451 return;
5452 }
5453
7639a06c 5454 switch (codec->core.vendor_id) {
9a22a8f5 5455 case 0x10ec0255:
717f43d8
KY
5456 alc_process_coef_fw(codec, coef0255);
5457 msleep(300);
5458 val = alc_read_coef_idx(codec, 0x46);
5459 is_ctia = (val & 0x0070) == 0x0070;
5460 break;
1948fc06 5461 case 0x10ec0230:
717f43d8 5462 case 0x10ec0236:
7081adf3 5463 case 0x10ec0256:
717f43d8
KY
5464 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5465 alc_write_coef_idx(codec, 0x06, 0x6104);
5466 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5467
5468 snd_hda_codec_write(codec, 0x21, 0,
5469 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5470 msleep(80);
5471 snd_hda_codec_write(codec, 0x21, 0,
5472 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5473
54db6c39 5474 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5475 msleep(300);
5476 val = alc_read_coef_idx(codec, 0x46);
5477 is_ctia = (val & 0x0070) == 0x0070;
717f43d8
KY
5478
5479 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5480 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5481
5482 snd_hda_codec_write(codec, 0x21, 0,
5483 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5484 msleep(80);
5485 snd_hda_codec_write(codec, 0x21, 0,
5486 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
9a22a8f5 5487 break;
71683c32
KY
5488 case 0x10ec0234:
5489 case 0x10ec0274:
5490 case 0x10ec0294:
5491 alc_process_coef_fw(codec, coef0274);
febf2256 5492 msleep(850);
71683c32
KY
5493 val = alc_read_coef_idx(codec, 0x46);
5494 is_ctia = (val & 0x00f0) == 0x00f0;
5495 break;
13fd08a3 5496 case 0x10ec0233:
73bdd597
DH
5497 case 0x10ec0283:
5498 alc_write_coef_idx(codec, 0x45, 0xd029);
5499 msleep(300);
5500 val = alc_read_coef_idx(codec, 0x46);
5501 is_ctia = (val & 0x0070) == 0x0070;
5502 break;
1a5bc8d9 5503 case 0x10ec0298:
89542936
KY
5504 snd_hda_codec_write(codec, 0x21, 0,
5505 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5506 msleep(100);
5507 snd_hda_codec_write(codec, 0x21, 0,
5508 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5509 msleep(200);
5510
5511 val = alc_read_coef_idx(codec, 0x50);
5512 if (val & (1 << 12)) {
5513 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5514 alc_process_coef_fw(codec, coef0288);
5515 msleep(350);
5516 val = alc_read_coef_idx(codec, 0x50);
5517 is_ctia = (val & 0x0070) == 0x0070;
5518 } else {
5519 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5520 alc_process_coef_fw(codec, coef0288);
5521 msleep(350);
5522 val = alc_read_coef_idx(codec, 0x50);
5523 is_ctia = (val & 0x0070) == 0x0070;
5524 }
5525 alc_process_coef_fw(codec, coef0298);
5526 snd_hda_codec_write(codec, 0x21, 0,
5527 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5528 msleep(75);
5529 snd_hda_codec_write(codec, 0x21, 0,
5530 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5531 break;
f3b70332
KY
5532 case 0x10ec0286:
5533 case 0x10ec0288:
5534 alc_process_coef_fw(codec, coef0288);
5535 msleep(350);
5536 val = alc_read_coef_idx(codec, 0x50);
5537 is_ctia = (val & 0x0070) == 0x0070;
5538 break;
73bdd597
DH
5539 case 0x10ec0292:
5540 alc_write_coef_idx(codec, 0x6b, 0xd429);
5541 msleep(300);
5542 val = alc_read_coef_idx(codec, 0x6c);
5543 is_ctia = (val & 0x001c) == 0x001c;
5544 break;
a22aa26f 5545 case 0x10ec0293:
54db6c39 5546 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5547 msleep(300);
5548 val = alc_read_coef_idx(codec, 0x46);
5549 is_ctia = (val & 0x0070) == 0x0070;
5550 break;
73bdd597 5551 case 0x10ec0668:
54db6c39 5552 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5553 msleep(300);
5554 val = alc_read_coef_idx(codec, 0xbe);
5555 is_ctia = (val & 0x1c02) == 0x1c02;
5556 break;
c2b691ee 5557 case 0x10ec0215:
4cc9b9d6 5558 case 0x10ec0225:
c2b691ee 5559 case 0x10ec0285:
7d727869 5560 case 0x10ec0295:
c2b691ee 5561 case 0x10ec0289:
28f1f9b2 5562 case 0x10ec0299:
da911b1f
KY
5563 snd_hda_codec_write(codec, 0x21, 0,
5564 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5565 msleep(80);
5566 snd_hda_codec_write(codec, 0x21, 0,
5567 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5568
5a36767a
KY
5569 alc_process_coef_fw(codec, alc225_pre_hsmode);
5570 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5571 val = alc_read_coef_idx(codec, 0x45);
5572 if (val & (1 << 9)) {
5573 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5574 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5575 msleep(800);
5576 val = alc_read_coef_idx(codec, 0x46);
5577 is_ctia = (val & 0x00f0) == 0x00f0;
5578 } else {
5579 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5580 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5581 msleep(800);
5582 val = alc_read_coef_idx(codec, 0x46);
5583 is_ctia = (val & 0x00f0) == 0x00f0;
5584 }
5585 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5586 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5587 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
da911b1f
KY
5588
5589 snd_hda_codec_write(codec, 0x21, 0,
5590 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5591 msleep(80);
5592 snd_hda_codec_write(codec, 0x21, 0,
5593 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4cc9b9d6 5594 break;
78f4f7c2
KY
5595 case 0x10ec0867:
5596 is_ctia = true;
5597 break;
73bdd597
DH
5598 }
5599
4e76a883 5600 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
73bdd597
DH
5601 is_ctia ? "yes" : "no");
5602 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5603}
5604
5605static void alc_update_headset_mode(struct hda_codec *codec)
5606{
5607 struct alc_spec *spec = codec->spec;
5608
5609 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 5610 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
5611
5612 int new_headset_mode;
5613
5614 if (!snd_hda_jack_detect(codec, hp_pin))
5615 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5616 else if (mux_pin == spec->headset_mic_pin)
5617 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5618 else if (mux_pin == spec->headphone_mic_pin)
5619 new_headset_mode = ALC_HEADSET_MODE_MIC;
5620 else
5621 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5622
5959a6bc
DH
5623 if (new_headset_mode == spec->current_headset_mode) {
5624 snd_hda_gen_update_outputs(codec);
73bdd597 5625 return;
5959a6bc 5626 }
73bdd597
DH
5627
5628 switch (new_headset_mode) {
5629 case ALC_HEADSET_MODE_UNPLUGGED:
5630 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
5631 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5632 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
5633 spec->gen.hp_jack_present = false;
5634 break;
5635 case ALC_HEADSET_MODE_HEADSET:
5636 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5637 alc_determine_headset_type(codec);
5638 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5639 alc_headset_mode_ctia(codec);
5640 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5641 alc_headset_mode_omtp(codec);
5642 spec->gen.hp_jack_present = true;
5643 break;
5644 case ALC_HEADSET_MODE_MIC:
5645 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5646 spec->gen.hp_jack_present = false;
5647 break;
5648 case ALC_HEADSET_MODE_HEADPHONE:
5649 alc_headset_mode_default(codec);
5650 spec->gen.hp_jack_present = true;
5651 break;
5652 }
5653 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5654 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5655 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 5656 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
5657 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5658 PIN_VREFHIZ);
5659 }
5660 spec->current_headset_mode = new_headset_mode;
5661
5662 snd_hda_gen_update_outputs(codec);
5663}
5664
5665static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
5666 struct snd_kcontrol *kcontrol,
5667 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
5668{
5669 alc_update_headset_mode(codec);
5670}
5671
1a4f69d5
TI
5672static void alc_update_headset_jack_cb(struct hda_codec *codec,
5673 struct hda_jack_callback *jack)
73bdd597 5674{
73bdd597 5675 snd_hda_gen_hp_automute(codec, jack);
e54f30be 5676 alc_update_headset_mode(codec);
73bdd597
DH
5677}
5678
5679static void alc_probe_headset_mode(struct hda_codec *codec)
5680{
5681 int i;
5682 struct alc_spec *spec = codec->spec;
5683 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5684
5685 /* Find mic pins */
5686 for (i = 0; i < cfg->num_inputs; i++) {
5687 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5688 spec->headset_mic_pin = cfg->inputs[i].pin;
5689 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5690 spec->headphone_mic_pin = cfg->inputs[i].pin;
5691 }
5692
0bed2aa3 5693 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
5694 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5695 spec->gen.automute_hook = alc_update_headset_mode;
5696 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5697}
5698
5699static void alc_fixup_headset_mode(struct hda_codec *codec,
5700 const struct hda_fixup *fix, int action)
5701{
5702 struct alc_spec *spec = codec->spec;
5703
5704 switch (action) {
5705 case HDA_FIXUP_ACT_PRE_PROBE:
5706 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5707 break;
5708 case HDA_FIXUP_ACT_PROBE:
5709 alc_probe_headset_mode(codec);
5710 break;
5711 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
5712 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5713 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5714 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5715 }
73bdd597
DH
5716 alc_update_headset_mode(codec);
5717 break;
5718 }
5719}
5720
5721static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5722 const struct hda_fixup *fix, int action)
5723{
5724 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5725 struct alc_spec *spec = codec->spec;
5726 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5727 }
5728 else
5729 alc_fixup_headset_mode(codec, fix, action);
5730}
5731
31278997
KY
5732static void alc255_set_default_jack_type(struct hda_codec *codec)
5733{
5734 /* Set to iphone type */
6b0f95c4 5735 static const struct coef_fw alc255fw[] = {
54db6c39
TI
5736 WRITE_COEF(0x1b, 0x880b),
5737 WRITE_COEF(0x45, 0xd089),
5738 WRITE_COEF(0x1b, 0x080b),
5739 WRITE_COEF(0x46, 0x0004),
5740 WRITE_COEF(0x1b, 0x0c0b),
5741 {}
5742 };
6b0f95c4 5743 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
5744 WRITE_COEF(0x1b, 0x884b),
5745 WRITE_COEF(0x45, 0xd089),
5746 WRITE_COEF(0x1b, 0x084b),
5747 WRITE_COEF(0x46, 0x0004),
5748 WRITE_COEF(0x1b, 0x0c4b),
5749 {}
5750 };
5751 switch (codec->core.vendor_id) {
5752 case 0x10ec0255:
5753 alc_process_coef_fw(codec, alc255fw);
5754 break;
1948fc06 5755 case 0x10ec0230:
736f20a7 5756 case 0x10ec0236:
e69e7e03
KY
5757 case 0x10ec0256:
5758 alc_process_coef_fw(codec, alc256fw);
5759 break;
5760 }
31278997
KY
5761 msleep(30);
5762}
5763
9a22a8f5
KY
5764static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5765 const struct hda_fixup *fix, int action)
5766{
5767 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 5768 alc255_set_default_jack_type(codec);
9a22a8f5
KY
5769 }
5770 alc_fixup_headset_mode(codec, fix, action);
5771}
5772
31278997
KY
5773static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5774 const struct hda_fixup *fix, int action)
5775{
5776 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5777 struct alc_spec *spec = codec->spec;
5778 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5779 alc255_set_default_jack_type(codec);
5780 }
5781 else
5782 alc_fixup_headset_mode(codec, fix, action);
5783}
5784
e1e62b98
KY
5785static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5786 struct hda_jack_callback *jack)
5787{
5788 struct alc_spec *spec = codec->spec;
e1e62b98
KY
5789
5790 alc_update_headset_jack_cb(codec, jack);
5791 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 5792 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
5793}
5794
5795static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5796 const struct hda_fixup *fix, int action)
5797{
5798 alc_fixup_headset_mode(codec, fix, action);
5799 if (action == HDA_FIXUP_ACT_PROBE) {
5800 struct alc_spec *spec = codec->spec;
d44a6864
TI
5801 /* toggled via hp_automute_hook */
5802 spec->gpio_mask |= 0x40;
5803 spec->gpio_dir |= 0x40;
e1e62b98
KY
5804 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5805 }
5806}
5807
493a52a9
HW
5808static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5809 const struct hda_fixup *fix, int action)
5810{
5811 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5812 struct alc_spec *spec = codec->spec;
5813 spec->gen.auto_mute_via_amp = 1;
5814 }
5815}
5816
9b745ab8
TI
5817static void alc_fixup_no_shutup(struct hda_codec *codec,
5818 const struct hda_fixup *fix, int action)
5819{
efe55732 5820 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 5821 struct alc_spec *spec = codec->spec;
c0ca5ece 5822 spec->no_shutup_pins = 1;
9b745ab8
TI
5823 }
5824}
5825
5e6db669
GM
5826static void alc_fixup_disable_aamix(struct hda_codec *codec,
5827 const struct hda_fixup *fix, int action)
5828{
5829 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5830 struct alc_spec *spec = codec->spec;
5831 /* Disable AA-loopback as it causes white noise */
5832 spec->gen.mixer_nid = 0;
5833 }
5834}
5835
7f57d803
TI
5836/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5837static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5838 const struct hda_fixup *fix, int action)
5839{
5840 static const struct hda_pintbl pincfgs[] = {
5841 { 0x16, 0x21211010 }, /* dock headphone */
5842 { 0x19, 0x21a11010 }, /* dock mic */
5843 { }
5844 };
5845 struct alc_spec *spec = codec->spec;
5846
5847 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5848 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5849 codec->power_save_node = 0; /* avoid click noises */
5850 snd_hda_apply_pincfgs(codec, pincfgs);
5851 }
5852}
5853
61fcf8ec
KY
5854static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5855 const struct hda_fixup *fix, int action)
5856{
5857 static const struct hda_pintbl pincfgs[] = {
5858 { 0x17, 0x21211010 }, /* dock headphone */
5859 { 0x19, 0x21a11010 }, /* dock mic */
5860 { }
5861 };
5862 struct alc_spec *spec = codec->spec;
5863
5864 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5865 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
5866 snd_hda_apply_pincfgs(codec, pincfgs);
5867 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
5868 /* Enable DOCK device */
5869 snd_hda_codec_write(codec, 0x17, 0,
5870 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5871 /* Enable DOCK device */
5872 snd_hda_codec_write(codec, 0x19, 0,
5873 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
5874 }
5875}
5876
399c01aa
TI
5877static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5878 const struct hda_fixup *fix, int action)
5879{
5880 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5881 * the speaker output becomes too low by some reason on Thinkpads with
5882 * ALC298 codec
5883 */
5884 static const hda_nid_t preferred_pairs[] = {
5885 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5886 0
5887 };
5888 struct alc_spec *spec = codec->spec;
5889
5890 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5891 spec->gen.preferred_dacs = preferred_pairs;
5892}
5893
8eedd3a7
TI
5894static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5895 const struct hda_fixup *fix, int action)
5896{
5897 static const hda_nid_t preferred_pairs[] = {
5898 0x17, 0x02, 0x21, 0x03, 0
5899 };
5900 struct alc_spec *spec = codec->spec;
5901
5902 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5903 spec->gen.preferred_dacs = preferred_pairs;
5904}
5905
9476d369 5906static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
5907{
5908 struct alc_spec *spec = codec->spec;
35a39f98 5909 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 5910
9476d369
GM
5911 /* Prevent pop noises when headphones are plugged in */
5912 snd_hda_codec_write(codec, hp_pin, 0,
5913 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5914 msleep(20);
033b0a7c
GM
5915}
5916
5917static void alc_fixup_dell_xps13(struct hda_codec *codec,
5918 const struct hda_fixup *fix, int action)
5919{
3e1b0c4a
TI
5920 struct alc_spec *spec = codec->spec;
5921 struct hda_input_mux *imux = &spec->gen.input_mux;
5922 int i;
f38663ab 5923
3e1b0c4a
TI
5924 switch (action) {
5925 case HDA_FIXUP_ACT_PRE_PROBE:
5926 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5927 * it causes a click noise at start up
5928 */
5929 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 5930 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
5931 break;
5932 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
5933 /* Make the internal mic the default input source. */
5934 for (i = 0; i < imux->num_items; i++) {
5935 if (spec->gen.imux_pins[i] == 0x12) {
5936 spec->gen.cur_mux[0] = i;
5937 break;
5938 }
5939 }
3e1b0c4a 5940 break;
033b0a7c
GM
5941 }
5942}
5943
1f8b46cd
DH
5944static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5945 const struct hda_fixup *fix, int action)
5946{
5947 struct alc_spec *spec = codec->spec;
5948
5949 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5950 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5951 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
5952
5953 /* Disable boost for mic-in permanently. (This code is only called
5954 from quirks that guarantee that the headphone is at NID 0x1b.) */
5955 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5956 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
5957 } else
5958 alc_fixup_headset_mode(codec, fix, action);
5959}
5960
73bdd597
DH
5961static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5962 const struct hda_fixup *fix, int action)
5963{
5964 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 5965 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 5966 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
5967 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5968 }
5969 alc_fixup_headset_mode(codec, fix, action);
5970}
5971
bde7bc60
CCC
5972/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5973static int find_ext_mic_pin(struct hda_codec *codec)
5974{
5975 struct alc_spec *spec = codec->spec;
5976 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5977 hda_nid_t nid;
5978 unsigned int defcfg;
5979 int i;
5980
5981 for (i = 0; i < cfg->num_inputs; i++) {
5982 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5983 continue;
5984 nid = cfg->inputs[i].pin;
5985 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5986 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5987 continue;
5988 return nid;
5989 }
5990
5991 return 0;
5992}
5993
08a978db 5994static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 5995 const struct hda_fixup *fix,
08a978db
DR
5996 int action)
5997{
5998 struct alc_spec *spec = codec->spec;
5999
0db75790 6000 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6001 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6002 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6003
6004 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6005 return;
bde7bc60 6006 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6007 }
08a978db 6008}
693b613d 6009
3e0d611b
DH
6010static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6011 const struct hda_fixup *fix,
6012 int action)
6013{
6014 struct alc_spec *spec = codec->spec;
6015 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6016 int i;
6017
6018 /* The mic boosts on level 2 and 3 are too noisy
6019 on the internal mic input.
6020 Therefore limit the boost to 0 or 1. */
6021
6022 if (action != HDA_FIXUP_ACT_PROBE)
6023 return;
6024
6025 for (i = 0; i < cfg->num_inputs; i++) {
6026 hda_nid_t nid = cfg->inputs[i].pin;
6027 unsigned int defcfg;
6028 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6029 continue;
6030 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6031 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6032 continue;
6033
6034 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6035 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6036 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6037 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6038 (0 << AC_AMPCAP_MUTE_SHIFT));
6039 }
6040}
6041
cd217a63 6042static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6043 struct hda_jack_callback *jack)
cd217a63
KY
6044{
6045 struct alc_spec *spec = codec->spec;
6046 int vref;
6047
6048 msleep(200);
6049 snd_hda_gen_hp_automute(codec, jack);
6050
6051 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6052
6053 msleep(600);
6054 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6055 vref);
6056}
6057
cd217a63
KY
6058static void alc283_fixup_chromebook(struct hda_codec *codec,
6059 const struct hda_fixup *fix, int action)
6060{
6061 struct alc_spec *spec = codec->spec;
cd217a63
KY
6062
6063 switch (action) {
6064 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6065 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6066 /* Disable AA-loopback as it causes white noise */
6067 spec->gen.mixer_nid = 0;
38070219 6068 break;
0202e99c 6069 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6070 /* MIC2-VREF control */
6071 /* Set to manual mode */
98b24883 6072 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6073 /* Enable Line1 input control by verb */
98b24883 6074 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6075 break;
6076 }
6077}
6078
6079static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6080 const struct hda_fixup *fix, int action)
6081{
6082 struct alc_spec *spec = codec->spec;
0202e99c
KY
6083
6084 switch (action) {
6085 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6086 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6087 break;
6088 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6089 /* MIC2-VREF control */
6090 /* Set to manual mode */
98b24883 6091 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6092 break;
6093 }
6094}
6095
7bba2157
TI
6096/* mute tablet speaker pin (0x14) via dock plugging in addition */
6097static void asus_tx300_automute(struct hda_codec *codec)
6098{
6099 struct alc_spec *spec = codec->spec;
6100 snd_hda_gen_update_outputs(codec);
6101 if (snd_hda_jack_detect(codec, 0x1b))
6102 spec->gen.mute_bits |= (1ULL << 0x14);
6103}
6104
6105static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6106 const struct hda_fixup *fix, int action)
6107{
6108 struct alc_spec *spec = codec->spec;
7bba2157
TI
6109 static const struct hda_pintbl dock_pins[] = {
6110 { 0x1b, 0x21114000 }, /* dock speaker pin */
6111 {}
6112 };
7bba2157
TI
6113
6114 switch (action) {
6115 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6116 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6117 /* TX300 needs to set up GPIO2 for the speaker amp */
6118 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6119 snd_hda_apply_pincfgs(codec, dock_pins);
6120 spec->gen.auto_mute_via_amp = 1;
6121 spec->gen.automute_hook = asus_tx300_automute;
6122 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6123 snd_hda_gen_hp_automute);
6124 break;
5579cd6f
TI
6125 case HDA_FIXUP_ACT_PROBE:
6126 spec->init_amp = ALC_INIT_DEFAULT;
6127 break;
7bba2157
TI
6128 case HDA_FIXUP_ACT_BUILD:
6129 /* this is a bit tricky; give more sane names for the main
6130 * (tablet) speaker and the dock speaker, respectively
6131 */
56798e6b
TI
6132 rename_ctl(codec, "Speaker Playback Switch",
6133 "Dock Speaker Playback Switch");
6134 rename_ctl(codec, "Bass Speaker Playback Switch",
6135 "Speaker Playback Switch");
7bba2157
TI
6136 break;
6137 }
6138}
6139
338cae56
DH
6140static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6141 const struct hda_fixup *fix, int action)
6142{
0f4881dc
DH
6143 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6144 /* DAC node 0x03 is giving mono output. We therefore want to
6145 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6146 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6147 static const hda_nid_t conn1[] = { 0x0c };
6148 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6149 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6150 }
338cae56
DH
6151}
6152
dd9aa335
HW
6153static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6154 const struct hda_fixup *fix, int action)
6155{
6156 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6157 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6158 we can't adjust the speaker's volume since this node does not has
6159 Amp-out capability. we change the speaker's route to:
6160 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6161 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6162 speaker's volume now. */
6163
caf3c043
MM
6164 static const hda_nid_t conn1[] = { 0x0c };
6165 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6166 }
6167}
6168
e312a869
TI
6169/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6170static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6171 const struct hda_fixup *fix, int action)
6172{
6173 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6174 static const hda_nid_t conn[] = { 0x02, 0x03 };
6175 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6176 }
6177}
6178
d2cd795c
JK
6179/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6180static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6181 const struct hda_fixup *fix, int action)
6182{
6183 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6184 static const hda_nid_t conn[] = { 0x02 };
6185 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6186 }
6187}
6188
98973f2f
KP
6189/* Hook to update amp GPIO4 for automute */
6190static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6191 struct hda_jack_callback *jack)
6192{
6193 struct alc_spec *spec = codec->spec;
6194
6195 snd_hda_gen_hp_automute(codec, jack);
6196 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6197 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6198 !spec->gen.hp_jack_present);
98973f2f
KP
6199}
6200
6201/* Manage GPIOs for HP EliteBook Folio 9480m.
6202 *
6203 * GPIO4 is the headphone amplifier power control
6204 * GPIO3 is the audio output mute indicator LED
6205 */
6206
6207static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6208 const struct hda_fixup *fix,
6209 int action)
6210{
6211 struct alc_spec *spec = codec->spec;
98973f2f 6212
01e4a275 6213 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6214 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6215 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6216 spec->gpio_mask |= 0x10;
6217 spec->gpio_dir |= 0x10;
98973f2f 6218 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6219 }
6220}
6221
ae065f1c
TI
6222static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6223 const struct hda_fixup *fix,
6224 int action)
6225{
6226 struct alc_spec *spec = codec->spec;
6227
6228 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6229 spec->gpio_mask |= 0x04;
6230 spec->gpio_dir |= 0x04;
6231 /* set data bit low */
6232 }
6233}
6234
6a6660d0
TI
6235/* Quirk for Thinkpad X1 7th and 8th Gen
6236 * The following fixed routing needed
6237 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6238 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6239 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6240 */
6241static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6242 const struct hda_fixup *fix, int action)
6243{
6244 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6245 static const hda_nid_t preferred_pairs[] = {
6246 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6247 };
6248 struct alc_spec *spec = codec->spec;
6249
6250 switch (action) {
6251 case HDA_FIXUP_ACT_PRE_PROBE:
6252 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6253 spec->gen.preferred_dacs = preferred_pairs;
6254 break;
6255 case HDA_FIXUP_ACT_BUILD:
6256 /* The generic parser creates somewhat unintuitive volume ctls
6257 * with the fixed routing above, and the shared DAC2 may be
6258 * confusing for PA.
6259 * Rename those to unique names so that PA doesn't touch them
6260 * and use only Master volume.
6261 */
6262 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6263 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6264 break;
6265 }
6266}
6267
ca169cc2
KY
6268static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6269 const struct hda_fixup *fix,
6270 int action)
6271{
6272 alc_fixup_dual_codecs(codec, fix, action);
6273 switch (action) {
6274 case HDA_FIXUP_ACT_PRE_PROBE:
6275 /* override card longname to provide a unique UCM profile */
6276 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6277 break;
6278 case HDA_FIXUP_ACT_BUILD:
6279 /* rename Capture controls depending on the codec */
6280 rename_ctl(codec, "Capture Volume",
6281 codec->addr == 0 ?
6282 "Rear-Panel Capture Volume" :
6283 "Front-Panel Capture Volume");
6284 rename_ctl(codec, "Capture Switch",
6285 codec->addr == 0 ?
6286 "Rear-Panel Capture Switch" :
6287 "Front-Panel Capture Switch");
6288 break;
6289 }
6290}
6291
52e4e368
KHF
6292static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6293 const struct hda_fixup *fix, int action)
6294{
6295 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6296 return;
6297
6298 codec->power_save_node = 1;
6299}
6300
92266651
KY
6301/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6302static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6303 const struct hda_fixup *fix, int action)
6304{
6305 struct alc_spec *spec = codec->spec;
caf3c043 6306 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6307 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6308 0
6309 };
6310
6311 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6312 return;
6313
6314 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6315 spec->gen.auto_mute_via_amp = 1;
6316 codec->power_save_node = 0;
92266651
KY
6317}
6318
c84bfedc
TI
6319/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6320static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6321 const struct hda_fixup *fix, int action)
6322{
6323 static const hda_nid_t preferred_pairs[] = {
6324 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6325 };
6326 struct alc_spec *spec = codec->spec;
6327
6328 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6329 spec->gen.preferred_dacs = preferred_pairs;
6330 spec->gen.obey_preferred_dacs = 1;
6331 }
6332}
6333
c4cfcf6f
HW
6334/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6335static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6336 const struct hda_fixup *fix, int action)
6337{
6338 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6339 return;
6340
6341 snd_hda_override_wcaps(codec, 0x03, 0);
6342}
6343
8a8de09c
KY
6344static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6345{
6346 switch (codec->core.vendor_id) {
6347 case 0x10ec0274:
6348 case 0x10ec0294:
6349 case 0x10ec0225:
6350 case 0x10ec0295:
6351 case 0x10ec0299:
6352 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6353 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6354 break;
1948fc06 6355 case 0x10ec0230:
8a8de09c
KY
6356 case 0x10ec0235:
6357 case 0x10ec0236:
6358 case 0x10ec0255:
6359 case 0x10ec0256:
6360 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6361 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6362 break;
6363 }
6364}
6365
8983eb60
KY
6366static void alc295_fixup_chromebook(struct hda_codec *codec,
6367 const struct hda_fixup *fix, int action)
6368{
d3ba58bb
KY
6369 struct alc_spec *spec = codec->spec;
6370
8983eb60 6371 switch (action) {
d3ba58bb
KY
6372 case HDA_FIXUP_ACT_PRE_PROBE:
6373 spec->ultra_low_power = true;
6374 break;
8983eb60 6375 case HDA_FIXUP_ACT_INIT:
8a8de09c 6376 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6377 break;
6378 }
6379}
6380
d1dd4211
KY
6381static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6382 const struct hda_fixup *fix, int action)
6383{
6384 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6385 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6386}
6387
c3cdf189
LJ
6388
6389static void alc294_gx502_toggle_output(struct hda_codec *codec,
6390 struct hda_jack_callback *cb)
6391{
6392 /* The Windows driver sets the codec up in a very different way where
6393 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6394 */
6395 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6396 alc_write_coef_idx(codec, 0x10, 0x8a20);
6397 else
6398 alc_write_coef_idx(codec, 0x10, 0x0a20);
6399}
6400
6401static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6402 const struct hda_fixup *fix, int action)
6403{
6404 /* Pin 0x21: headphones/headset mic */
6405 if (!is_jack_detectable(codec, 0x21))
6406 return;
6407
6408 switch (action) {
6409 case HDA_FIXUP_ACT_PRE_PROBE:
6410 snd_hda_jack_detect_enable_callback(codec, 0x21,
6411 alc294_gx502_toggle_output);
6412 break;
6413 case HDA_FIXUP_ACT_INIT:
6414 /* Make sure to start in a correct state, i.e. if
6415 * headphones have been plugged in before powering up the system
6416 */
6417 alc294_gx502_toggle_output(codec, NULL);
6418 break;
6419 }
6420}
6421
c1b55029
DC
6422static void alc294_gu502_toggle_output(struct hda_codec *codec,
6423 struct hda_jack_callback *cb)
6424{
6425 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6426 * responsible from changes between speakers and headphones
6427 */
6428 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6429 alc_write_coef_idx(codec, 0x10, 0x8420);
6430 else
6431 alc_write_coef_idx(codec, 0x10, 0x0a20);
6432}
6433
6434static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6435 const struct hda_fixup *fix, int action)
6436{
6437 if (!is_jack_detectable(codec, 0x21))
6438 return;
6439
6440 switch (action) {
6441 case HDA_FIXUP_ACT_PRE_PROBE:
6442 snd_hda_jack_detect_enable_callback(codec, 0x21,
6443 alc294_gu502_toggle_output);
6444 break;
6445 case HDA_FIXUP_ACT_INIT:
6446 alc294_gu502_toggle_output(codec, NULL);
6447 break;
6448 }
6449}
6450
56496253
KY
6451static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6452 const struct hda_fixup *fix, int action)
6453{
6454 if (action != HDA_FIXUP_ACT_INIT)
6455 return;
6456
6457 msleep(100);
6458 alc_write_coef_idx(codec, 0x65, 0x0);
6459}
6460
8a8de09c
KY
6461static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6462 const struct hda_fixup *fix, int action)
6463{
6464 switch (action) {
6465 case HDA_FIXUP_ACT_INIT:
6466 alc_combo_jack_hp_jd_restart(codec);
6467 break;
6468 }
6469}
6470
92666d45
KY
6471static void alc_fixup_no_int_mic(struct hda_codec *codec,
6472 const struct hda_fixup *fix, int action)
6473{
6474 struct alc_spec *spec = codec->spec;
6475
6476 switch (action) {
6477 case HDA_FIXUP_ACT_PRE_PROBE:
6478 /* Mic RING SLEEVE swap for combo jack */
6479 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6480 spec->no_internal_mic_pin = true;
6481 break;
6482 case HDA_FIXUP_ACT_INIT:
6483 alc_combo_jack_hp_jd_restart(codec);
6484 break;
6485 }
6486}
6487
d94befbb
DB
6488/* GPIO1 = amplifier on/off
6489 * GPIO3 = mic mute LED
6490 */
6491static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6492 const struct hda_fixup *fix, int action)
6493{
6494 static const hda_nid_t conn[] = { 0x02 };
6495
6496 struct alc_spec *spec = codec->spec;
6497 static const struct hda_pintbl pincfgs[] = {
6498 { 0x14, 0x90170110 }, /* front/high speakers */
6499 { 0x17, 0x90170130 }, /* back/bass speakers */
6500 { }
6501 };
6502
6503 //enable micmute led
6504 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6505
6506 switch (action) {
6507 case HDA_FIXUP_ACT_PRE_PROBE:
6508 spec->micmute_led_polarity = 1;
6509 /* needed for amp of back speakers */
6510 spec->gpio_mask |= 0x01;
6511 spec->gpio_dir |= 0x01;
6512 snd_hda_apply_pincfgs(codec, pincfgs);
6513 /* share DAC to have unified volume control */
6514 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6515 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6516 break;
6517 case HDA_FIXUP_ACT_INIT:
6518 /* need to toggle GPIO to enable the amp of back speakers */
6519 alc_update_gpio_data(codec, 0x01, true);
6520 msleep(100);
6521 alc_update_gpio_data(codec, 0x01, false);
6522 break;
6523 }
6524}
6525
434591b2
ED
6526static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6527 const struct hda_fixup *fix, int action)
6528{
6529 static const hda_nid_t conn[] = { 0x02 };
6530 static const struct hda_pintbl pincfgs[] = {
6531 { 0x14, 0x90170110 }, /* rear speaker */
6532 { }
6533 };
6534
6535 switch (action) {
6536 case HDA_FIXUP_ACT_PRE_PROBE:
6537 snd_hda_apply_pincfgs(codec, pincfgs);
6538 /* force front speaker to DAC1 */
6539 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6540 break;
6541 }
6542}
6543
b317b032
TI
6544/* for hda_fixup_thinkpad_acpi() */
6545#include "thinkpad_helper.c"
b67ae3f1 6546
d5a6cabf
TI
6547static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6548 const struct hda_fixup *fix, int action)
6549{
6550 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6551 hda_fixup_thinkpad_acpi(codec, fix, action);
6552}
6553
ad7cc2d4
CB
6554/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6555static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6556 const struct hda_fixup *fix,
6557 int action)
6558{
6559 struct alc_spec *spec = codec->spec;
6560
6561 switch (action) {
6562 case HDA_FIXUP_ACT_PRE_PROBE:
6563 spec->gen.suppress_auto_mute = 1;
6564 break;
6565 }
6566}
6567
bbf8ff6b
TB
6568/* for alc295_fixup_hp_top_speakers */
6569#include "hp_x360_helper.c"
6570
26928ca1
TI
6571/* for alc285_fixup_ideapad_s740_coef() */
6572#include "ideapad_s740_helper.c"
6573
b9145ede
WS
6574static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6575 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6576 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6577 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6578 {}
6579};
6580
6581static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6582 const struct hda_fixup *fix,
6583 int action)
dd6dd6e3
WS
6584{
6585 /*
b9145ede
WS
6586 * A certain other OS sets these coeffs to different values. On at least
6587 * one TongFang barebone these settings might survive even a cold
6588 * reboot. So to restore a clean slate the values are explicitly reset
6589 * to default here. Without this, the external microphone is always in a
6590 * plugged-in state, while the internal microphone is always in an
6591 * unplugged state, breaking the ability to use the internal microphone.
6592 */
6593 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
6594}
6595
e1abacd3
WS
6596static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6597 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6598 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6599 WRITE_COEF(0x49, 0x0149),
6600 {}
6601};
6602
6603static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6604 const struct hda_fixup *fix,
6605 int action)
6606{
6607 /*
6608 * The audio jack input and output is not detected on the ASRock NUC Box
6609 * 1100 series when cold booting without this fix. Warm rebooting from a
6610 * certain other OS makes the audio functional, as COEF settings are
6611 * preserved in this case. This fix sets these altered COEF values as
6612 * the default.
6613 */
6614 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6615}
6616
f2ca7e35
WS
6617static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6618 const struct hda_fixup *fix,
6619 int action)
6620{
6621 /*
6622 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6623 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6624 * needs an additional quirk for sound working after suspend and resume.
6625 */
6626 if (codec->core.vendor_id == 0x10ec0256) {
6627 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6628 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6629 } else {
6630 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6631 }
6632}
6633
1d045db9 6634enum {
f73bbf63 6635 ALC269_FIXUP_GPIO2,
1d045db9
TI
6636 ALC269_FIXUP_SONY_VAIO,
6637 ALC275_FIXUP_SONY_VAIO_GPIO2,
6638 ALC269_FIXUP_DELL_M101Z,
6639 ALC269_FIXUP_SKU_IGNORE,
6640 ALC269_FIXUP_ASUS_G73JW,
6641 ALC269_FIXUP_LENOVO_EAPD,
6642 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 6643 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 6644 ALC271_FIXUP_DMIC,
017f2a10 6645 ALC269_FIXUP_PCM_44K,
adabb3ec 6646 ALC269_FIXUP_STEREO_DMIC,
7c478f03 6647 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
6648 ALC269_FIXUP_QUANTA_MUTE,
6649 ALC269_FIXUP_LIFEBOOK,
2041d564 6650 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 6651 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 6652 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 6653 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
6654 ALC269_FIXUP_AMIC,
6655 ALC269_FIXUP_DMIC,
6656 ALC269VB_FIXUP_AMIC,
6657 ALC269VB_FIXUP_DMIC,
08fb0d0e 6658 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 6659 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 6660 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 6661 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 6662 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
6663 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6664 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 6665 ALC269_FIXUP_INV_DMIC,
108cc108 6666 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 6667 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 6668 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 6669 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 6670 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597
DH
6671 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6672 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 6673 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 6674 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
73bdd597
DH
6675 ALC269_FIXUP_HEADSET_MODE,
6676 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 6677 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
6678 ALC269_FIXUP_ASUS_X101_FUNC,
6679 ALC269_FIXUP_ASUS_X101_VERB,
6680 ALC269_FIXUP_ASUS_X101,
08a978db
DR
6681 ALC271_FIXUP_AMIC_MIC2,
6682 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 6683 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 6684 ALC269_FIXUP_ACER_AC700,
3e0d611b 6685 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 6686 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 6687 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
8e35cd4a 6688 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 6689 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 6690 ALC283_FIXUP_CHROME_BOOK,
0202e99c 6691 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 6692 ALC282_FIXUP_ASUS_TX300,
1bb3e062 6693 ALC283_FIXUP_INT_MIC,
338cae56 6694 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
6695 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6696 ALC290_FIXUP_SUBWOOFER,
6697 ALC290_FIXUP_SUBWOOFER_HSJACK,
b67ae3f1 6698 ALC269_FIXUP_THINKPAD_ACPI,
56f27013 6699 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5824ce8d 6700 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 6701 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 6702 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
31278997 6703 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 6704 ALC255_FIXUP_HEADSET_MODE,
31278997 6705 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 6706 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 6707 ALC292_FIXUP_TPT440_DOCK,
9a811230 6708 ALC292_FIXUP_TPT440,
abaa2274 6709 ALC283_FIXUP_HEADSET_MIC,
b3802783 6710 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 6711 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 6712 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 6713 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 6714 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 6715 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 6716 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 6717 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 6718 ALC280_FIXUP_HP_9480M,
c3bb2b52 6719 ALC245_FIXUP_HP_X360_AMP,
d94befbb 6720 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
e1e62b98
KY
6721 ALC288_FIXUP_DELL_HEADSET_MODE,
6722 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
6723 ALC288_FIXUP_DELL_XPS_13,
6724 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 6725 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
6726 ALC292_FIXUP_DELL_E7X,
6727 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 6728 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 6729 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 6730 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 6731 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 6732 ALC275_FIXUP_DELL_XPS,
23adc192 6733 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 6734 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
3b43b71f 6735 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 6736 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 6737 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 6738 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 6739 ALC285_FIXUP_SPEAKER2_TO_DAC1,
f883982d 6740 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 6741 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 6742 ALC292_FIXUP_TPT460,
dd9aa335 6743 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 6744 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 6745 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 6746 ALC269_FIXUP_ATIV_BOOK_8,
9eb5d0e6 6747 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
6748 ALC256_FIXUP_ASUS_HEADSET_MODE,
6749 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 6750 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
6751 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6752 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 6753 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 6754 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 6755 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 6756 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 6757 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 6758 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
6759 ALC274_FIXUP_DELL_BIND_DACS,
6760 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 6761 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 6762 ALC298_FIXUP_TPT470_DOCK,
ae104a21 6763 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 6764 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 6765 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 6766 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 6767 ALC295_FIXUP_HP_X360,
8a328ac1 6768 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 6769 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 6770 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 6771 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 6772 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
6773 ALC294_FIXUP_ASUS_HEADSET_MIC,
6774 ALC294_FIXUP_ASUS_SPK,
89e3a568 6775 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 6776 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 6777 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 6778 ALC295_FIXUP_CHROME_BOOK,
8983eb60 6779 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
6780 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6781 ALC225_FIXUP_WYSE_AUTO_MUTE,
6782 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 6783 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 6784 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 6785 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
e2a829b3 6786 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 6787 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
e79c2269
KY
6788 ALC289_FIXUP_DELL_SPK2,
6789 ALC289_FIXUP_DUAL_SPK,
48e01504
CC
6790 ALC294_FIXUP_SPK2_TO_DAC1,
6791 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 6792 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 6793 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8b33a134 6794 ALC294_FIXUP_ASUS_HPE,
1b94e59d 6795 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
6796 ALC294_FIXUP_ASUS_GX502_HP,
6797 ALC294_FIXUP_ASUS_GX502_PINS,
6798 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
6799 ALC294_FIXUP_ASUS_GU502_HP,
6800 ALC294_FIXUP_ASUS_GU502_PINS,
6801 ALC294_FIXUP_ASUS_GU502_VERBS,
f5a88b0a 6802 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 6803 ALC285_FIXUP_HP_MUTE_LED,
e7d66cf7 6804 ALC236_FIXUP_HP_GPIO_LED,
24164f43 6805 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 6806 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
14425f1f 6807 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 6808 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 6809 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 6810 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 6811 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 6812 ALC289_FIXUP_ASUS_GA401,
4b43d05a 6813 ALC289_FIXUP_ASUS_GA502,
f50a121d 6814 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 6815 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
6816 ALC269_FIXUP_CZC_B20,
6817 ALC269_FIXUP_CZC_TMI,
6818 ALC269_FIXUP_CZC_L101,
6819 ALC269_FIXUP_LEMOTE_A1802,
6820 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 6821 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
6822 ALC233_FIXUP_INTEL_NUC8_DMIC,
6823 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 6824 ALC256_FIXUP_INTEL_NUC10,
fc19d559 6825 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 6826 ALC274_FIXUP_HP_MIC,
8a8de09c 6827 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 6828 ALC274_FIXUP_HP_ENVY_GPIO,
ef9ce66f 6829 ALC256_FIXUP_ASUS_HPE,
446b8185 6830 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 6831 ALC287_FIXUP_HP_GPIO_LED,
9e885770 6832 ALC256_FIXUP_HP_HEADSET_MIC,
c47b3112 6833 ALC245_FIXUP_HP_GPIO_LED,
92666d45 6834 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 6835 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 6836 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 6837 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 6838 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 6839 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 6840 ALC295_FIXUP_ASUS_DACS,
5d84b531 6841 ALC295_FIXUP_HP_OMEN,
f2be77fe 6842 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 6843 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 6844 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 6845 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 6846 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
6847 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6848 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6849 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
dd6dd6e3 6850 ALC287_FIXUP_13S_GEN2_SPEAKERS,
b9145ede 6851 ALC256_FIXUP_SET_COEF_DEFAULTS,
4803b99a 6852 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
e1abacd3 6853 ALC233_FIXUP_NO_AUDIO_JACK,
f2ca7e35 6854 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
e7e2503a
BF
6855 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
6856 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
f1d4e28b
KY
6857};
6858
1727a771 6859static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
6860 [ALC269_FIXUP_GPIO2] = {
6861 .type = HDA_FIXUP_FUNC,
6862 .v.func = alc_fixup_gpio2,
6863 },
1d045db9 6864 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
6865 .type = HDA_FIXUP_PINCTLS,
6866 .v.pins = (const struct hda_pintbl[]) {
6867 {0x19, PIN_VREFGRD},
1d045db9
TI
6868 {}
6869 }
f1d4e28b 6870 },
1d045db9 6871 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
6872 .type = HDA_FIXUP_FUNC,
6873 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
6874 .chained = true,
6875 .chain_id = ALC269_FIXUP_SONY_VAIO
6876 },
6877 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 6878 .type = HDA_FIXUP_VERBS,
1d045db9
TI
6879 .v.verbs = (const struct hda_verb[]) {
6880 /* Enables internal speaker */
6881 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6882 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6883 {}
6884 }
6885 },
6886 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 6887 .type = HDA_FIXUP_FUNC,
23d30f28 6888 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
6889 },
6890 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
6891 .type = HDA_FIXUP_PINS,
6892 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
6893 { 0x17, 0x99130111 }, /* subwoofer */
6894 { }
6895 }
6896 },
6897 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 6898 .type = HDA_FIXUP_VERBS,
1d045db9
TI
6899 .v.verbs = (const struct hda_verb[]) {
6900 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6901 {}
6902 }
6903 },
6904 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 6905 .type = HDA_FIXUP_FUNC,
1d045db9
TI
6906 .v.func = alc269_fixup_hweq,
6907 .chained = true,
6908 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6909 },
e9bd7d5c
TI
6910 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6911 .type = HDA_FIXUP_FUNC,
6912 .v.func = alc_fixup_disable_aamix,
6913 .chained = true,
6914 .chain_id = ALC269_FIXUP_SONY_VAIO
6915 },
1d045db9 6916 [ALC271_FIXUP_DMIC] = {
1727a771 6917 .type = HDA_FIXUP_FUNC,
1d045db9 6918 .v.func = alc271_fixup_dmic,
f1d4e28b 6919 },
017f2a10 6920 [ALC269_FIXUP_PCM_44K] = {
1727a771 6921 .type = HDA_FIXUP_FUNC,
017f2a10 6922 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
6923 .chained = true,
6924 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 6925 },
adabb3ec 6926 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 6927 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
6928 .v.func = alc269_fixup_stereo_dmic,
6929 },
7c478f03
DH
6930 [ALC269_FIXUP_HEADSET_MIC] = {
6931 .type = HDA_FIXUP_FUNC,
6932 .v.func = alc269_fixup_headset_mic,
6933 },
24519911 6934 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 6935 .type = HDA_FIXUP_FUNC,
24519911
TI
6936 .v.func = alc269_fixup_quanta_mute,
6937 },
6938 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
6939 .type = HDA_FIXUP_PINS,
6940 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
6941 { 0x1a, 0x2101103f }, /* dock line-out */
6942 { 0x1b, 0x23a11040 }, /* dock mic-in */
6943 { }
6944 },
6945 .chained = true,
6946 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6947 },
2041d564
DH
6948 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6949 .type = HDA_FIXUP_PINS,
6950 .v.pins = (const struct hda_pintbl[]) {
6951 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6952 { }
6953 },
6954 },
cc7016ab
TI
6955 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6956 .type = HDA_FIXUP_PINS,
6957 .v.pins = (const struct hda_pintbl[]) {
6958 { 0x21, 0x0221102f }, /* HP out */
6959 { }
6960 },
6961 },
4df3fd17
TI
6962 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6963 .type = HDA_FIXUP_FUNC,
6964 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6965 },
fdcc968a
JMG
6966 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6967 .type = HDA_FIXUP_FUNC,
6968 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6969 },
a4297b5d 6970 [ALC269_FIXUP_AMIC] = {
1727a771
TI
6971 .type = HDA_FIXUP_PINS,
6972 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
6973 { 0x14, 0x99130110 }, /* speaker */
6974 { 0x15, 0x0121401f }, /* HP out */
6975 { 0x18, 0x01a19c20 }, /* mic */
6976 { 0x19, 0x99a3092f }, /* int-mic */
6977 { }
6978 },
6979 },
6980 [ALC269_FIXUP_DMIC] = {
1727a771
TI
6981 .type = HDA_FIXUP_PINS,
6982 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
6983 { 0x12, 0x99a3092f }, /* int-mic */
6984 { 0x14, 0x99130110 }, /* speaker */
6985 { 0x15, 0x0121401f }, /* HP out */
6986 { 0x18, 0x01a19c20 }, /* mic */
6987 { }
6988 },
6989 },
6990 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
6991 .type = HDA_FIXUP_PINS,
6992 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
6993 { 0x14, 0x99130110 }, /* speaker */
6994 { 0x18, 0x01a19c20 }, /* mic */
6995 { 0x19, 0x99a3092f }, /* int-mic */
6996 { 0x21, 0x0121401f }, /* HP out */
6997 { }
6998 },
6999 },
2267ea97 7000 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
7001 .type = HDA_FIXUP_PINS,
7002 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7003 { 0x12, 0x99a3092f }, /* int-mic */
7004 { 0x14, 0x99130110 }, /* speaker */
7005 { 0x18, 0x01a19c20 }, /* mic */
7006 { 0x21, 0x0121401f }, /* HP out */
7007 { }
7008 },
7009 },
08fb0d0e 7010 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 7011 .type = HDA_FIXUP_FUNC,
08fb0d0e 7012 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 7013 },
d06ac143
DH
7014 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7015 .type = HDA_FIXUP_FUNC,
7016 .v.func = alc269_fixup_hp_mute_led_mic1,
7017 },
08fb0d0e 7018 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 7019 .type = HDA_FIXUP_FUNC,
08fb0d0e 7020 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 7021 },
7f783bd5
TB
7022 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7023 .type = HDA_FIXUP_FUNC,
7024 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
7025 .chained = true,
7026 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 7027 },
9f5c6faf
TI
7028 [ALC269_FIXUP_HP_GPIO_LED] = {
7029 .type = HDA_FIXUP_FUNC,
7030 .v.func = alc269_fixup_hp_gpio_led,
7031 },
9c5dc3bf
KY
7032 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7033 .type = HDA_FIXUP_FUNC,
7034 .v.func = alc269_fixup_hp_gpio_mic1_led,
7035 },
7036 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7037 .type = HDA_FIXUP_FUNC,
7038 .v.func = alc269_fixup_hp_line1_mic1_led,
7039 },
693b613d 7040 [ALC269_FIXUP_INV_DMIC] = {
1727a771 7041 .type = HDA_FIXUP_FUNC,
9d36a7dc 7042 .v.func = alc_fixup_inv_dmic,
693b613d 7043 },
9b745ab8
TI
7044 [ALC269_FIXUP_NO_SHUTUP] = {
7045 .type = HDA_FIXUP_FUNC,
7046 .v.func = alc_fixup_no_shutup,
7047 },
108cc108 7048 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
7049 .type = HDA_FIXUP_PINS,
7050 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
7051 { 0x19, 0x23a11040 }, /* dock mic */
7052 { 0x1b, 0x2121103f }, /* dock headphone */
7053 { }
7054 },
7055 .chained = true,
7056 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7057 },
b590b38c
TI
7058 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7059 .type = HDA_FIXUP_FUNC,
7060 .v.func = alc269_fixup_limit_int_mic_boost,
7061 .chained = true,
7062 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7063 },
108cc108 7064 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 7065 .type = HDA_FIXUP_FUNC,
108cc108 7066 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
7067 .chained = true,
7068 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 7069 },
73bdd597
DH
7070 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7071 .type = HDA_FIXUP_PINS,
7072 .v.pins = (const struct hda_pintbl[]) {
7073 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7074 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7075 { }
7076 },
7077 .chained = true,
7078 .chain_id = ALC269_FIXUP_HEADSET_MODE
7079 },
7080 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7081 .type = HDA_FIXUP_PINS,
7082 .v.pins = (const struct hda_pintbl[]) {
7083 { 0x16, 0x21014020 }, /* dock line out */
7084 { 0x19, 0x21a19030 }, /* dock mic */
7085 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7086 { }
7087 },
7088 .chained = true,
7089 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7090 },
338cae56
DH
7091 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7092 .type = HDA_FIXUP_PINS,
7093 .v.pins = (const struct hda_pintbl[]) {
7094 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7095 { }
7096 },
7097 .chained = true,
7098 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7099 },
fcc6c877
KY
7100 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7101 .type = HDA_FIXUP_PINS,
7102 .v.pins = (const struct hda_pintbl[]) {
7103 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7104 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7105 { }
7106 },
7107 .chained = true,
7108 .chain_id = ALC269_FIXUP_HEADSET_MODE
7109 },
73bdd597
DH
7110 [ALC269_FIXUP_HEADSET_MODE] = {
7111 .type = HDA_FIXUP_FUNC,
7112 .v.func = alc_fixup_headset_mode,
6676f308 7113 .chained = true,
b3802783 7114 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
7115 },
7116 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7117 .type = HDA_FIXUP_FUNC,
7118 .v.func = alc_fixup_headset_mode_no_hp_mic,
7119 },
7819717b
TI
7120 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7121 .type = HDA_FIXUP_PINS,
7122 .v.pins = (const struct hda_pintbl[]) {
7123 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7124 { }
7125 },
7126 .chained = true,
7127 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7128 },
88cfcf86
DH
7129 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7130 .type = HDA_FIXUP_PINS,
7131 .v.pins = (const struct hda_pintbl[]) {
7132 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7133 { }
7134 },
fbc78ad6
DH
7135 .chained = true,
7136 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 7137 },
0fbf21c3 7138 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
7139 .type = HDA_FIXUP_PINS,
7140 .v.pins = (const struct hda_pintbl[]) {
7141 {0x12, 0x90a60130},
7142 {0x13, 0x40000000},
7143 {0x14, 0x90170110},
7144 {0x18, 0x411111f0},
7145 {0x19, 0x04a11040},
7146 {0x1a, 0x411111f0},
7147 {0x1b, 0x90170112},
7148 {0x1d, 0x40759a05},
7149 {0x1e, 0x411111f0},
7150 {0x21, 0x04211020},
7151 { }
7152 },
e2744fd7
AB
7153 .chained = true,
7154 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 7155 },
a2ef03fe
TE
7156 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7157 .type = HDA_FIXUP_FUNC,
7158 .v.func = alc298_fixup_huawei_mbx_stereo,
7159 .chained = true,
7160 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7161 },
d240d1dc
DH
7162 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7163 .type = HDA_FIXUP_FUNC,
7164 .v.func = alc269_fixup_x101_headset_mic,
7165 },
7166 [ALC269_FIXUP_ASUS_X101_VERB] = {
7167 .type = HDA_FIXUP_VERBS,
7168 .v.verbs = (const struct hda_verb[]) {
7169 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7170 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7171 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7172 { }
7173 },
7174 .chained = true,
7175 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7176 },
7177 [ALC269_FIXUP_ASUS_X101] = {
7178 .type = HDA_FIXUP_PINS,
7179 .v.pins = (const struct hda_pintbl[]) {
7180 { 0x18, 0x04a1182c }, /* Headset mic */
7181 { }
7182 },
7183 .chained = true,
7184 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7185 },
08a978db 7186 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
7187 .type = HDA_FIXUP_PINS,
7188 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
7189 { 0x14, 0x99130110 }, /* speaker */
7190 { 0x19, 0x01a19c20 }, /* mic */
7191 { 0x1b, 0x99a7012f }, /* int-mic */
7192 { 0x21, 0x0121401f }, /* HP out */
7193 { }
7194 },
7195 },
7196 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 7197 .type = HDA_FIXUP_FUNC,
08a978db
DR
7198 .v.func = alc271_hp_gate_mic_jack,
7199 .chained = true,
7200 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7201 },
b1e8972e
OR
7202 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7203 .type = HDA_FIXUP_FUNC,
7204 .v.func = alc269_fixup_limit_int_mic_boost,
7205 .chained = true,
7206 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7207 },
42397004
DR
7208 [ALC269_FIXUP_ACER_AC700] = {
7209 .type = HDA_FIXUP_PINS,
7210 .v.pins = (const struct hda_pintbl[]) {
7211 { 0x12, 0x99a3092f }, /* int-mic */
7212 { 0x14, 0x99130110 }, /* speaker */
7213 { 0x18, 0x03a11c20 }, /* mic */
7214 { 0x1e, 0x0346101e }, /* SPDIF1 */
7215 { 0x21, 0x0321101f }, /* HP out */
7216 { }
7217 },
7218 .chained = true,
7219 .chain_id = ALC271_FIXUP_DMIC,
7220 },
3e0d611b
DH
7221 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7222 .type = HDA_FIXUP_FUNC,
7223 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
7224 .chained = true,
7225 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 7226 },
2cede303
OR
7227 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7228 .type = HDA_FIXUP_FUNC,
7229 .v.func = alc269_fixup_limit_int_mic_boost,
7230 .chained = true,
7231 .chain_id = ALC269VB_FIXUP_DMIC,
7232 },
23870831
TI
7233 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7234 .type = HDA_FIXUP_VERBS,
7235 .v.verbs = (const struct hda_verb[]) {
7236 /* class-D output amp +5dB */
7237 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7238 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7239 {}
7240 },
7241 .chained = true,
7242 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7243 },
8e35cd4a
DH
7244 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7245 .type = HDA_FIXUP_FUNC,
7246 .v.func = alc269_fixup_limit_int_mic_boost,
7247 .chained = true,
7248 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7249 },
02b504d9
AA
7250 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7251 .type = HDA_FIXUP_PINS,
7252 .v.pins = (const struct hda_pintbl[]) {
7253 { 0x12, 0x99a3092f }, /* int-mic */
7254 { 0x18, 0x03a11d20 }, /* mic */
7255 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7256 { }
7257 },
7258 },
cd217a63
KY
7259 [ALC283_FIXUP_CHROME_BOOK] = {
7260 .type = HDA_FIXUP_FUNC,
7261 .v.func = alc283_fixup_chromebook,
7262 },
0202e99c
KY
7263 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7264 .type = HDA_FIXUP_FUNC,
7265 .v.func = alc283_fixup_sense_combo_jack,
7266 .chained = true,
7267 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7268 },
7bba2157
TI
7269 [ALC282_FIXUP_ASUS_TX300] = {
7270 .type = HDA_FIXUP_FUNC,
7271 .v.func = alc282_fixup_asus_tx300,
7272 },
1bb3e062
KY
7273 [ALC283_FIXUP_INT_MIC] = {
7274 .type = HDA_FIXUP_VERBS,
7275 .v.verbs = (const struct hda_verb[]) {
7276 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7277 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7278 { }
7279 },
7280 .chained = true,
7281 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7282 },
0f4881dc
DH
7283 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7284 .type = HDA_FIXUP_PINS,
7285 .v.pins = (const struct hda_pintbl[]) {
7286 { 0x17, 0x90170112 }, /* subwoofer */
7287 { }
7288 },
7289 .chained = true,
7290 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7291 },
7292 [ALC290_FIXUP_SUBWOOFER] = {
7293 .type = HDA_FIXUP_PINS,
7294 .v.pins = (const struct hda_pintbl[]) {
7295 { 0x17, 0x90170112 }, /* subwoofer */
7296 { }
7297 },
7298 .chained = true,
7299 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7300 },
338cae56
DH
7301 [ALC290_FIXUP_MONO_SPEAKERS] = {
7302 .type = HDA_FIXUP_FUNC,
7303 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
7304 },
7305 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7306 .type = HDA_FIXUP_FUNC,
7307 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
7308 .chained = true,
7309 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7310 },
b67ae3f1
DH
7311 [ALC269_FIXUP_THINKPAD_ACPI] = {
7312 .type = HDA_FIXUP_FUNC,
d5a6cabf 7313 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
7314 .chained = true,
7315 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 7316 },
56f27013
DH
7317 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7318 .type = HDA_FIXUP_FUNC,
7319 .v.func = alc_fixup_inv_dmic,
7320 .chained = true,
7321 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7322 },
5824ce8d 7323 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
7324 .type = HDA_FIXUP_PINS,
7325 .v.pins = (const struct hda_pintbl[]) {
7326 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7327 { }
5824ce8d
CC
7328 },
7329 .chained = true,
17d30460 7330 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 7331 },
615966ad
CC
7332 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7333 .type = HDA_FIXUP_PINS,
7334 .v.pins = (const struct hda_pintbl[]) {
7335 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7336 { }
7337 },
7338 .chained = true,
7339 .chain_id = ALC255_FIXUP_HEADSET_MODE
7340 },
9a22a8f5
KY
7341 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7342 .type = HDA_FIXUP_PINS,
7343 .v.pins = (const struct hda_pintbl[]) {
7344 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7345 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7346 { }
7347 },
7348 .chained = true,
7349 .chain_id = ALC255_FIXUP_HEADSET_MODE
7350 },
31278997
KY
7351 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7352 .type = HDA_FIXUP_PINS,
7353 .v.pins = (const struct hda_pintbl[]) {
7354 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7355 { }
7356 },
7357 .chained = true,
7358 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7359 },
9a22a8f5
KY
7360 [ALC255_FIXUP_HEADSET_MODE] = {
7361 .type = HDA_FIXUP_FUNC,
7362 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 7363 .chained = true,
b3802783 7364 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 7365 },
31278997
KY
7366 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7367 .type = HDA_FIXUP_FUNC,
7368 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7369 },
a22aa26f
KY
7370 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7371 .type = HDA_FIXUP_PINS,
7372 .v.pins = (const struct hda_pintbl[]) {
7373 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7374 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7375 { }
7376 },
7377 .chained = true,
7378 .chain_id = ALC269_FIXUP_HEADSET_MODE
7379 },
1c37c223 7380 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 7381 .type = HDA_FIXUP_FUNC,
7f57d803 7382 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
7383 .chained = true,
7384 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7385 },
9a811230
TI
7386 [ALC292_FIXUP_TPT440] = {
7387 .type = HDA_FIXUP_FUNC,
157f0b7f 7388 .v.func = alc_fixup_disable_aamix,
9a811230
TI
7389 .chained = true,
7390 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7391 },
abaa2274 7392 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
7393 .type = HDA_FIXUP_PINS,
7394 .v.pins = (const struct hda_pintbl[]) {
7395 { 0x19, 0x04a110f0 },
7396 { },
7397 },
7398 },
b3802783 7399 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 7400 .type = HDA_FIXUP_FUNC,
8a503555 7401 .v.func = alc_fixup_micmute_led,
00ef9940 7402 },
1a22e775
TI
7403 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7404 .type = HDA_FIXUP_PINS,
7405 .v.pins = (const struct hda_pintbl[]) {
7406 { 0x12, 0x90a60130 },
7407 { 0x14, 0x90170110 },
7408 { 0x17, 0x40000008 },
7409 { 0x18, 0x411111f0 },
0420694d 7410 { 0x19, 0x01a1913c },
1a22e775
TI
7411 { 0x1a, 0x411111f0 },
7412 { 0x1b, 0x411111f0 },
7413 { 0x1d, 0x40f89b2d },
7414 { 0x1e, 0x411111f0 },
7415 { 0x21, 0x0321101f },
7416 { },
7417 },
7418 },
c8426b27
TI
7419 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7420 .type = HDA_FIXUP_FUNC,
7421 .v.func = alc269vb_fixup_aspire_e1_coef,
7422 },
7a5255f1
DH
7423 [ALC280_FIXUP_HP_GPIO4] = {
7424 .type = HDA_FIXUP_FUNC,
7425 .v.func = alc280_fixup_hp_gpio4,
7426 },
eaa8e5ef
KY
7427 [ALC286_FIXUP_HP_GPIO_LED] = {
7428 .type = HDA_FIXUP_FUNC,
7429 .v.func = alc286_fixup_hp_gpio_led,
7430 },
33f4acd3
DH
7431 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7432 .type = HDA_FIXUP_FUNC,
7433 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7434 },
b4b33f9d
TC
7435 [ALC280_FIXUP_HP_DOCK_PINS] = {
7436 .type = HDA_FIXUP_PINS,
7437 .v.pins = (const struct hda_pintbl[]) {
7438 { 0x1b, 0x21011020 }, /* line-out */
7439 { 0x1a, 0x01a1903c }, /* headset mic */
7440 { 0x18, 0x2181103f }, /* line-in */
7441 { },
7442 },
7443 .chained = true,
7444 .chain_id = ALC280_FIXUP_HP_GPIO4
7445 },
04d5466a
JK
7446 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7447 .type = HDA_FIXUP_PINS,
7448 .v.pins = (const struct hda_pintbl[]) {
7449 { 0x1b, 0x21011020 }, /* line-out */
7450 { 0x18, 0x2181103f }, /* line-in */
7451 { },
7452 },
7453 .chained = true,
7454 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7455 },
98973f2f
KP
7456 [ALC280_FIXUP_HP_9480M] = {
7457 .type = HDA_FIXUP_FUNC,
7458 .v.func = alc280_fixup_hp_9480m,
7459 },
c3bb2b52
TI
7460 [ALC245_FIXUP_HP_X360_AMP] = {
7461 .type = HDA_FIXUP_FUNC,
7462 .v.func = alc245_fixup_hp_x360_amp,
c47b3112
JC
7463 .chained = true,
7464 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 7465 },
e1e62b98
KY
7466 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7467 .type = HDA_FIXUP_FUNC,
7468 .v.func = alc_fixup_headset_mode_dell_alc288,
7469 .chained = true,
b3802783 7470 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
7471 },
7472 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7473 .type = HDA_FIXUP_PINS,
7474 .v.pins = (const struct hda_pintbl[]) {
7475 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7476 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7477 { }
7478 },
7479 .chained = true,
7480 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7481 },
831bfdf9
HW
7482 [ALC288_FIXUP_DISABLE_AAMIX] = {
7483 .type = HDA_FIXUP_FUNC,
7484 .v.func = alc_fixup_disable_aamix,
7485 .chained = true,
d44a6864 7486 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
7487 },
7488 [ALC288_FIXUP_DELL_XPS_13] = {
7489 .type = HDA_FIXUP_FUNC,
7490 .v.func = alc_fixup_dell_xps13,
7491 .chained = true,
7492 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7493 },
8b99aba7
TI
7494 [ALC292_FIXUP_DISABLE_AAMIX] = {
7495 .type = HDA_FIXUP_FUNC,
7496 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
7497 .chained = true,
7498 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 7499 },
c04017ea
DH
7500 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7501 .type = HDA_FIXUP_FUNC,
7502 .v.func = alc_fixup_disable_aamix,
7503 .chained = true,
7504 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7505 },
5fab5829 7506 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
7507 .type = HDA_FIXUP_FUNC,
7508 .v.func = alc_fixup_dell_xps13,
7509 .chained = true,
7510 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7511 },
5fab5829
TI
7512 [ALC292_FIXUP_DELL_E7X] = {
7513 .type = HDA_FIXUP_FUNC,
8a503555 7514 .v.func = alc_fixup_micmute_led,
5fab5829
TI
7515 /* micmute fixup must be applied at last */
7516 .chained_before = true,
7517 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7518 },
54324221
JM
7519 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7520 .type = HDA_FIXUP_PINS,
7521 .v.pins = (const struct hda_pintbl[]) {
7522 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7523 { }
7524 },
7525 .chained_before = true,
7526 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7527 },
977e6276
KY
7528 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7529 .type = HDA_FIXUP_PINS,
7530 .v.pins = (const struct hda_pintbl[]) {
7531 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7532 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7533 { }
7534 },
7535 .chained = true,
7536 .chain_id = ALC269_FIXUP_HEADSET_MODE
7537 },
2f726aec
HW
7538 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7539 .type = HDA_FIXUP_PINS,
7540 .v.pins = (const struct hda_pintbl[]) {
7541 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7542 { }
7543 },
7544 .chained = true,
7545 .chain_id = ALC269_FIXUP_HEADSET_MODE
7546 },
6ed1131f
KY
7547 [ALC275_FIXUP_DELL_XPS] = {
7548 .type = HDA_FIXUP_VERBS,
7549 .v.verbs = (const struct hda_verb[]) {
7550 /* Enables internal speaker */
7551 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7552 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7553 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7554 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7555 {}
7556 }
7557 },
23adc192
HW
7558 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7559 .type = HDA_FIXUP_FUNC,
7560 .v.func = alc_fixup_disable_aamix,
7561 .chained = true,
7562 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7563 },
3694cb29
K
7564 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7565 .type = HDA_FIXUP_FUNC,
7566 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7567 },
d1ee66c5
PC
7568 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7569 .type = HDA_FIXUP_FUNC,
7570 .v.func = alc_fixup_inv_dmic,
7571 .chained = true,
7572 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7573 },
7574 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7575 .type = HDA_FIXUP_FUNC,
7576 .v.func = alc269_fixup_limit_int_mic_boost
7577 },
3b43b71f
KHF
7578 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7579 .type = HDA_FIXUP_FUNC,
7580 .v.func = alc_fixup_disable_aamix,
7581 .chained = true,
7582 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7583 },
d1dd4211
KY
7584 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7585 .type = HDA_FIXUP_FUNC,
7586 .v.func = alc_fixup_disable_mic_vref,
7587 .chained = true,
7588 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7589 },
2ae95577
DH
7590 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7591 .type = HDA_FIXUP_VERBS,
7592 .v.verbs = (const struct hda_verb[]) {
7593 /* Disable pass-through path for FRONT 14h */
7594 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7595 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7596 {}
7597 },
7598 .chained = true,
d1dd4211 7599 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 7600 },
f883982d
TI
7601 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7602 .type = HDA_FIXUP_FUNC,
7603 .v.func = alc_fixup_disable_aamix,
7604 .chained = true,
7605 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7606 },
e549d190
HW
7607 [ALC221_FIXUP_HP_FRONT_MIC] = {
7608 .type = HDA_FIXUP_PINS,
7609 .v.pins = (const struct hda_pintbl[]) {
7610 { 0x19, 0x02a19020 }, /* Front Mic */
7611 { }
7612 },
7613 },
c636b95e
SE
7614 [ALC292_FIXUP_TPT460] = {
7615 .type = HDA_FIXUP_FUNC,
7616 .v.func = alc_fixup_tpt440_dock,
7617 .chained = true,
7618 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7619 },
dd9aa335
HW
7620 [ALC298_FIXUP_SPK_VOLUME] = {
7621 .type = HDA_FIXUP_FUNC,
7622 .v.func = alc298_fixup_speaker_volume,
59ec4b57 7623 .chained = true,
2f726aec 7624 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 7625 },
f86de9b1
KY
7626 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7627 .type = HDA_FIXUP_FUNC,
7628 .v.func = alc298_fixup_speaker_volume,
7629 },
e312a869
TI
7630 [ALC295_FIXUP_DISABLE_DAC3] = {
7631 .type = HDA_FIXUP_FUNC,
7632 .v.func = alc295_fixup_disable_dac3,
7633 },
d2cd795c
JK
7634 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7635 .type = HDA_FIXUP_FUNC,
7636 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
7637 .chained = true,
7638 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 7639 },
fd06c77e
KHF
7640 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7641 .type = HDA_FIXUP_PINS,
7642 .v.pins = (const struct hda_pintbl[]) {
7643 { 0x1b, 0x90170151 },
7644 { }
7645 },
7646 .chained = true,
7647 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7648 },
823ff161
GM
7649 [ALC269_FIXUP_ATIV_BOOK_8] = {
7650 .type = HDA_FIXUP_FUNC,
7651 .v.func = alc_fixup_auto_mute_via_amp,
7652 .chained = true,
7653 .chain_id = ALC269_FIXUP_NO_SHUTUP
7654 },
9eb5d0e6
KY
7655 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7656 .type = HDA_FIXUP_PINS,
7657 .v.pins = (const struct hda_pintbl[]) {
7658 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7659 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7660 { }
7661 },
7662 .chained = true,
7663 .chain_id = ALC269_FIXUP_HEADSET_MODE
7664 },
c1732ede
CC
7665 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7666 .type = HDA_FIXUP_FUNC,
7667 .v.func = alc_fixup_headset_mode,
7668 },
7669 [ALC256_FIXUP_ASUS_MIC] = {
7670 .type = HDA_FIXUP_PINS,
7671 .v.pins = (const struct hda_pintbl[]) {
7672 { 0x13, 0x90a60160 }, /* use as internal mic */
7673 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7674 { }
7675 },
7676 .chained = true,
7677 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7678 },
eeed4cd1 7679 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
7680 .type = HDA_FIXUP_FUNC,
7681 /* Set up GPIO2 for the speaker amp */
7682 .v.func = alc_fixup_gpio4,
eeed4cd1 7683 },
216d7aeb
CC
7684 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7685 .type = HDA_FIXUP_PINS,
7686 .v.pins = (const struct hda_pintbl[]) {
7687 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7688 { }
7689 },
7690 .chained = true,
7691 .chain_id = ALC269_FIXUP_HEADSET_MIC
7692 },
7693 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7694 .type = HDA_FIXUP_VERBS,
7695 .v.verbs = (const struct hda_verb[]) {
7696 /* Enables internal speaker */
7697 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7698 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7699 {}
7700 },
7701 .chained = true,
7702 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7703 },
ca169cc2
KY
7704 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7705 .type = HDA_FIXUP_FUNC,
7706 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
7707 .chained = true,
7708 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 7709 },
ea5c7eba
JHP
7710 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7711 .type = HDA_FIXUP_VERBS,
7712 .v.verbs = (const struct hda_verb[]) {
7713 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7714 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7715 { }
7716 },
7717 .chained = true,
7718 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7719 },
f33f79f3
HW
7720 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7721 .type = HDA_FIXUP_PINS,
7722 .v.pins = (const struct hda_pintbl[]) {
7723 /* Change the mic location from front to right, otherwise there are
7724 two front mics with the same name, pulseaudio can't handle them.
7725 This is just a temporary workaround, after applying this fixup,
7726 there will be one "Front Mic" and one "Mic" in this machine.
7727 */
7728 { 0x1a, 0x04a19040 },
7729 { }
7730 },
7731 },
5f364135
KY
7732 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7733 .type = HDA_FIXUP_PINS,
7734 .v.pins = (const struct hda_pintbl[]) {
7735 { 0x16, 0x0101102f }, /* Rear Headset HP */
7736 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7737 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7738 { 0x1b, 0x02011020 },
7739 { }
7740 },
7741 .chained = true,
52e4e368
KHF
7742 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7743 },
7744 [ALC225_FIXUP_S3_POP_NOISE] = {
7745 .type = HDA_FIXUP_FUNC,
7746 .v.func = alc225_fixup_s3_pop_noise,
7747 .chained = true,
5f364135
KY
7748 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7749 },
b84e8436
PH
7750 [ALC700_FIXUP_INTEL_REFERENCE] = {
7751 .type = HDA_FIXUP_VERBS,
7752 .v.verbs = (const struct hda_verb[]) {
7753 /* Enables internal speaker */
7754 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7755 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7756 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7757 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7758 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7759 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7760 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7761 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7762 {}
7763 }
7764 },
92266651
KY
7765 [ALC274_FIXUP_DELL_BIND_DACS] = {
7766 .type = HDA_FIXUP_FUNC,
7767 .v.func = alc274_fixup_bind_dacs,
7768 .chained = true,
7769 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7770 },
7771 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7772 .type = HDA_FIXUP_PINS,
7773 .v.pins = (const struct hda_pintbl[]) {
7774 { 0x1b, 0x0401102f },
7775 { }
7776 },
7777 .chained = true,
7778 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7779 },
399c01aa 7780 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
7781 .type = HDA_FIXUP_FUNC,
7782 .v.func = alc_fixup_tpt470_dock,
7783 .chained = true,
7784 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7785 },
399c01aa
TI
7786 [ALC298_FIXUP_TPT470_DOCK] = {
7787 .type = HDA_FIXUP_FUNC,
7788 .v.func = alc_fixup_tpt470_dacs,
7789 .chained = true,
7790 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7791 },
ae104a21
KY
7792 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7793 .type = HDA_FIXUP_PINS,
7794 .v.pins = (const struct hda_pintbl[]) {
7795 { 0x14, 0x0201101f },
7796 { }
7797 },
7798 .chained = true,
7799 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7800 },
f0ba9d69
KY
7801 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7802 .type = HDA_FIXUP_PINS,
7803 .v.pins = (const struct hda_pintbl[]) {
7804 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7805 { }
7806 },
3ce0d5aa
HW
7807 .chained = true,
7808 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 7809 },
bbf8ff6b
TB
7810 [ALC295_FIXUP_HP_X360] = {
7811 .type = HDA_FIXUP_FUNC,
7812 .v.func = alc295_fixup_hp_top_speakers,
7813 .chained = true,
7814 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
7815 },
7816 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7817 .type = HDA_FIXUP_PINS,
7818 .v.pins = (const struct hda_pintbl[]) {
7819 { 0x19, 0x0181313f},
7820 { }
7821 },
7822 .chained = true,
7823 .chain_id = ALC269_FIXUP_HEADSET_MIC
7824 },
c4cfcf6f
HW
7825 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7826 .type = HDA_FIXUP_FUNC,
7827 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
7828 .chained = true,
7829 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 7830 },
e8ed64b0
GKK
7831 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7832 .type = HDA_FIXUP_FUNC,
7833 .v.func = alc_fixup_auto_mute_via_amp,
7834 },
33aaebd4
CC
7835 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7836 .type = HDA_FIXUP_PINS,
7837 .v.pins = (const struct hda_pintbl[]) {
7838 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7839 { }
7840 },
7841 .chained = true,
7842 .chain_id = ALC269_FIXUP_HEADSET_MIC
7843 },
d8ae458e
CC
7844 [ALC294_FIXUP_ASUS_MIC] = {
7845 .type = HDA_FIXUP_PINS,
7846 .v.pins = (const struct hda_pintbl[]) {
7847 { 0x13, 0x90a60160 }, /* use as internal mic */
7848 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7849 { }
7850 },
7851 .chained = true,
ef9ddb9d 7852 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 7853 },
4e051106
JHP
7854 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7855 .type = HDA_FIXUP_PINS,
7856 .v.pins = (const struct hda_pintbl[]) {
82b01149 7857 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
7858 { }
7859 },
7860 .chained = true,
ef9ddb9d 7861 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
7862 },
7863 [ALC294_FIXUP_ASUS_SPK] = {
7864 .type = HDA_FIXUP_VERBS,
7865 .v.verbs = (const struct hda_verb[]) {
7866 /* Set EAPD high */
7867 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7868 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
7869 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7870 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
7871 { }
7872 },
7873 .chained = true,
7874 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7875 },
c8a9afa6 7876 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 7877 .type = HDA_FIXUP_FUNC,
c8a9afa6 7878 .v.func = alc295_fixup_chromebook,
8983eb60
KY
7879 .chained = true,
7880 .chain_id = ALC225_FIXUP_HEADSET_JACK
7881 },
7882 [ALC225_FIXUP_HEADSET_JACK] = {
7883 .type = HDA_FIXUP_FUNC,
7884 .v.func = alc_fixup_headset_jack,
e854747d 7885 },
89e3a568
JS
7886 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7887 .type = HDA_FIXUP_PINS,
7888 .v.pins = (const struct hda_pintbl[]) {
7889 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7890 { }
7891 },
7892 .chained = true,
7893 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7894 },
c8c6ee61
HW
7895 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7896 .type = HDA_FIXUP_VERBS,
7897 .v.verbs = (const struct hda_verb[]) {
7898 /* Disable PCBEEP-IN passthrough */
7899 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7900 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7901 { }
7902 },
7903 .chained = true,
7904 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7905 },
cbc05fd6
JHP
7906 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7907 .type = HDA_FIXUP_PINS,
7908 .v.pins = (const struct hda_pintbl[]) {
7909 { 0x19, 0x03a11130 },
7910 { 0x1a, 0x90a60140 }, /* use as internal mic */
7911 { }
7912 },
7913 .chained = true,
7914 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7915 },
136824ef
KY
7916 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7917 .type = HDA_FIXUP_PINS,
7918 .v.pins = (const struct hda_pintbl[]) {
7919 { 0x16, 0x01011020 }, /* Rear Line out */
7920 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7921 { }
7922 },
7923 .chained = true,
7924 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7925 },
7926 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7927 .type = HDA_FIXUP_FUNC,
7928 .v.func = alc_fixup_auto_mute_via_amp,
7929 .chained = true,
7930 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7931 },
7932 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7933 .type = HDA_FIXUP_FUNC,
7934 .v.func = alc_fixup_disable_mic_vref,
7935 .chained = true,
7936 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7937 },
667a8f73
JHP
7938 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7939 .type = HDA_FIXUP_VERBS,
7940 .v.verbs = (const struct hda_verb[]) {
7941 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7942 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7943 { }
7944 },
7945 .chained = true,
7946 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7947 },
8c8967a7
DD
7948 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7949 .type = HDA_FIXUP_PINS,
7950 .v.pins = (const struct hda_pintbl[]) {
7951 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7952 { }
7953 },
7954 .chained = true,
7955 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7956 },
e1037354
JHP
7957 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7958 .type = HDA_FIXUP_PINS,
7959 .v.pins = (const struct hda_pintbl[]) {
7960 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7961 { }
7962 },
7963 .chained = true,
7964 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7965 },
e2a829b3
BR
7966 [ALC299_FIXUP_PREDATOR_SPK] = {
7967 .type = HDA_FIXUP_PINS,
7968 .v.pins = (const struct hda_pintbl[]) {
7969 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7970 { }
7971 }
7972 },
bd9c10bc 7973 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
7974 .type = HDA_FIXUP_PINS,
7975 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
7976 { 0x19, 0x04a11040 },
7977 { 0x21, 0x04211020 },
60083f9e
JHP
7978 { }
7979 },
7980 .chained = true,
bd9c10bc 7981 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 7982 },
e79c2269 7983 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
7984 .type = HDA_FIXUP_PINS,
7985 .v.pins = (const struct hda_pintbl[]) {
e79c2269 7986 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
7987 { }
7988 },
7989 .chained = true,
e79c2269 7990 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 7991 },
e79c2269
KY
7992 [ALC289_FIXUP_DUAL_SPK] = {
7993 .type = HDA_FIXUP_FUNC,
7994 .v.func = alc285_fixup_speaker2_to_dac1,
7995 .chained = true,
7996 .chain_id = ALC289_FIXUP_DELL_SPK2
7997 },
48e01504
CC
7998 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7999 .type = HDA_FIXUP_FUNC,
8000 .v.func = alc285_fixup_speaker2_to_dac1,
8001 .chained = true,
8002 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8003 },
8004 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
8005 .type = HDA_FIXUP_FUNC,
8006 /* The GPIO must be pulled to initialize the AMP */
8007 .v.func = alc_fixup_gpio4,
8008 .chained = true,
48e01504 8009 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 8010 },
6a6660d0
TI
8011 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8012 .type = HDA_FIXUP_FUNC,
8013 .v.func = alc285_fixup_thinkpad_x1_gen7,
8014 .chained = true,
8015 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8016 },
76f7dec0
KY
8017 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8018 .type = HDA_FIXUP_FUNC,
8019 .v.func = alc_fixup_headset_jack,
8020 .chained = true,
6a6660d0 8021 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 8022 },
8b33a134
JHP
8023 [ALC294_FIXUP_ASUS_HPE] = {
8024 .type = HDA_FIXUP_VERBS,
8025 .v.verbs = (const struct hda_verb[]) {
8026 /* Set EAPD high */
8027 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8028 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8029 { }
8030 },
8031 .chained = true,
8032 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8033 },
c3cdf189
LJ
8034 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8035 .type = HDA_FIXUP_PINS,
8036 .v.pins = (const struct hda_pintbl[]) {
8037 { 0x19, 0x03a11050 }, /* front HP mic */
8038 { 0x1a, 0x01a11830 }, /* rear external mic */
8039 { 0x21, 0x03211020 }, /* front HP out */
8040 { }
8041 },
8042 .chained = true,
8043 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8044 },
8045 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8046 .type = HDA_FIXUP_VERBS,
8047 .v.verbs = (const struct hda_verb[]) {
8048 /* set 0x15 to HP-OUT ctrl */
8049 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8050 /* unmute the 0x15 amp */
8051 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8052 { }
8053 },
8054 .chained = true,
8055 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8056 },
8057 [ALC294_FIXUP_ASUS_GX502_HP] = {
8058 .type = HDA_FIXUP_FUNC,
8059 .v.func = alc294_fixup_gx502_hp,
8060 },
c1b55029
DC
8061 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8062 .type = HDA_FIXUP_PINS,
8063 .v.pins = (const struct hda_pintbl[]) {
8064 { 0x19, 0x01a11050 }, /* rear HP mic */
8065 { 0x1a, 0x01a11830 }, /* rear external mic */
8066 { 0x21, 0x012110f0 }, /* rear HP out */
8067 { }
8068 },
8069 .chained = true,
8070 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8071 },
8072 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8073 .type = HDA_FIXUP_VERBS,
8074 .v.verbs = (const struct hda_verb[]) {
8075 /* set 0x15 to HP-OUT ctrl */
8076 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8077 /* unmute the 0x15 amp */
8078 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8079 /* set 0x1b to HP-OUT */
8080 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8081 { }
8082 },
8083 .chained = true,
8084 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8085 },
8086 [ALC294_FIXUP_ASUS_GU502_HP] = {
8087 .type = HDA_FIXUP_FUNC,
8088 .v.func = alc294_fixup_gu502_hp,
8089 },
1b94e59d
TI
8090 [ALC294_FIXUP_ASUS_COEF_1B] = {
8091 .type = HDA_FIXUP_VERBS,
8092 .v.verbs = (const struct hda_verb[]) {
8093 /* Set bit 10 to correct noisy output after reboot from
8094 * Windows 10 (due to pop noise reduction?)
8095 */
8096 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8097 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8098 { }
8099 },
f8fbcdfb
TI
8100 .chained = true,
8101 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 8102 },
f5a88b0a
KHF
8103 [ALC285_FIXUP_HP_GPIO_LED] = {
8104 .type = HDA_FIXUP_FUNC,
8105 .v.func = alc285_fixup_hp_gpio_led,
8106 },
431e76c3
KY
8107 [ALC285_FIXUP_HP_MUTE_LED] = {
8108 .type = HDA_FIXUP_FUNC,
8109 .v.func = alc285_fixup_hp_mute_led,
8110 },
e7d66cf7
JS
8111 [ALC236_FIXUP_HP_GPIO_LED] = {
8112 .type = HDA_FIXUP_FUNC,
8113 .v.func = alc236_fixup_hp_gpio_led,
8114 },
24164f43
KY
8115 [ALC236_FIXUP_HP_MUTE_LED] = {
8116 .type = HDA_FIXUP_FUNC,
8117 .v.func = alc236_fixup_hp_mute_led,
8118 },
75b62ab6
JW
8119 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8120 .type = HDA_FIXUP_FUNC,
8121 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8122 },
14425f1f
MP
8123 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8124 .type = HDA_FIXUP_VERBS,
8125 .v.verbs = (const struct hda_verb[]) {
8126 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8127 { }
8128 },
8129 },
9e43342b
CC
8130 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8131 .type = HDA_FIXUP_PINS,
8132 .v.pins = (const struct hda_pintbl[]) {
8133 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8134 { }
8135 },
8136 .chained = true,
8137 .chain_id = ALC269_FIXUP_HEADSET_MODE
8138 },
8eae7e9b
JHP
8139 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8140 .type = HDA_FIXUP_PINS,
8141 .v.pins = (const struct hda_pintbl[]) {
8142 { 0x14, 0x90100120 }, /* use as internal speaker */
8143 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8144 { 0x1a, 0x01011020 }, /* use as line out */
8145 { },
8146 },
8147 .chained = true,
8148 .chain_id = ALC269_FIXUP_HEADSET_MIC
8149 },
6e15d126
JHP
8150 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8151 .type = HDA_FIXUP_PINS,
8152 .v.pins = (const struct hda_pintbl[]) {
8153 { 0x18, 0x02a11030 }, /* use as headset mic */
8154 { }
8155 },
8156 .chained = true,
8157 .chain_id = ALC269_FIXUP_HEADSET_MIC
8158 },
781c90c0
JHP
8159 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8160 .type = HDA_FIXUP_PINS,
8161 .v.pins = (const struct hda_pintbl[]) {
8162 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8163 { }
8164 },
8165 .chained = true,
8166 .chain_id = ALC269_FIXUP_HEADSET_MIC
8167 },
293a92c1 8168 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
8169 .type = HDA_FIXUP_FUNC,
8170 .v.func = alc289_fixup_asus_ga401,
8171 .chained = true,
8172 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 8173 },
4b43d05a
AS
8174 [ALC289_FIXUP_ASUS_GA502] = {
8175 .type = HDA_FIXUP_PINS,
8176 .v.pins = (const struct hda_pintbl[]) {
8177 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8178 { }
8179 },
8180 },
f50a121d
JHP
8181 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8182 .type = HDA_FIXUP_PINS,
8183 .v.pins = (const struct hda_pintbl[]) {
8184 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8185 { }
8186 },
8187 .chained = true,
8188 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8189 },
56496253
KY
8190 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8191 .type = HDA_FIXUP_FUNC,
8192 .v.func = alc285_fixup_hp_gpio_amp_init,
8193 .chained = true,
8194 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8195 },
f1ec5be1
HC
8196 [ALC269_FIXUP_CZC_B20] = {
8197 .type = HDA_FIXUP_PINS,
8198 .v.pins = (const struct hda_pintbl[]) {
8199 { 0x12, 0x411111f0 },
8200 { 0x14, 0x90170110 }, /* speaker */
8201 { 0x15, 0x032f1020 }, /* HP out */
8202 { 0x17, 0x411111f0 },
8203 { 0x18, 0x03ab1040 }, /* mic */
8204 { 0x19, 0xb7a7013f },
8205 { 0x1a, 0x0181305f },
8206 { 0x1b, 0x411111f0 },
8207 { 0x1d, 0x411111f0 },
8208 { 0x1e, 0x411111f0 },
8209 { }
8210 },
8211 .chain_id = ALC269_FIXUP_DMIC,
8212 },
8213 [ALC269_FIXUP_CZC_TMI] = {
8214 .type = HDA_FIXUP_PINS,
8215 .v.pins = (const struct hda_pintbl[]) {
8216 { 0x12, 0x4000c000 },
8217 { 0x14, 0x90170110 }, /* speaker */
8218 { 0x15, 0x0421401f }, /* HP out */
8219 { 0x17, 0x411111f0 },
8220 { 0x18, 0x04a19020 }, /* mic */
8221 { 0x19, 0x411111f0 },
8222 { 0x1a, 0x411111f0 },
8223 { 0x1b, 0x411111f0 },
8224 { 0x1d, 0x40448505 },
8225 { 0x1e, 0x411111f0 },
8226 { 0x20, 0x8000ffff },
8227 { }
8228 },
8229 .chain_id = ALC269_FIXUP_DMIC,
8230 },
8231 [ALC269_FIXUP_CZC_L101] = {
8232 .type = HDA_FIXUP_PINS,
8233 .v.pins = (const struct hda_pintbl[]) {
8234 { 0x12, 0x40000000 },
8235 { 0x14, 0x01014010 }, /* speaker */
8236 { 0x15, 0x411111f0 }, /* HP out */
8237 { 0x16, 0x411111f0 },
8238 { 0x18, 0x01a19020 }, /* mic */
8239 { 0x19, 0x02a19021 },
8240 { 0x1a, 0x0181302f },
8241 { 0x1b, 0x0221401f },
8242 { 0x1c, 0x411111f0 },
8243 { 0x1d, 0x4044c601 },
8244 { 0x1e, 0x411111f0 },
8245 { }
8246 },
8247 .chain_id = ALC269_FIXUP_DMIC,
8248 },
8249 [ALC269_FIXUP_LEMOTE_A1802] = {
8250 .type = HDA_FIXUP_PINS,
8251 .v.pins = (const struct hda_pintbl[]) {
8252 { 0x12, 0x40000000 },
8253 { 0x14, 0x90170110 }, /* speaker */
8254 { 0x17, 0x411111f0 },
8255 { 0x18, 0x03a19040 }, /* mic1 */
8256 { 0x19, 0x90a70130 }, /* mic2 */
8257 { 0x1a, 0x411111f0 },
8258 { 0x1b, 0x411111f0 },
8259 { 0x1d, 0x40489d2d },
8260 { 0x1e, 0x411111f0 },
8261 { 0x20, 0x0003ffff },
8262 { 0x21, 0x03214020 },
8263 { }
8264 },
8265 .chain_id = ALC269_FIXUP_DMIC,
8266 },
8267 [ALC269_FIXUP_LEMOTE_A190X] = {
8268 .type = HDA_FIXUP_PINS,
8269 .v.pins = (const struct hda_pintbl[]) {
8270 { 0x14, 0x99130110 }, /* speaker */
8271 { 0x15, 0x0121401f }, /* HP out */
8272 { 0x18, 0x01a19c20 }, /* rear mic */
8273 { 0x19, 0x99a3092f }, /* front mic */
8274 { 0x1b, 0x0201401f }, /* front lineout */
8275 { }
8276 },
8277 .chain_id = ALC269_FIXUP_DMIC,
8278 },
e2d2fded
KHF
8279 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8280 .type = HDA_FIXUP_PINS,
8281 .v.pins = (const struct hda_pintbl[]) {
8282 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8283 { }
8284 },
8285 .chained = true,
8286 .chain_id = ALC269_FIXUP_HEADSET_MODE
8287 },
73e7161e
WS
8288 [ALC256_FIXUP_INTEL_NUC10] = {
8289 .type = HDA_FIXUP_PINS,
8290 .v.pins = (const struct hda_pintbl[]) {
8291 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8292 { }
8293 },
8294 .chained = true,
8295 .chain_id = ALC269_FIXUP_HEADSET_MODE
8296 },
fc19d559
HW
8297 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8298 .type = HDA_FIXUP_VERBS,
8299 .v.verbs = (const struct hda_verb[]) {
8300 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8301 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8302 { }
8303 },
8304 .chained = true,
c84bfedc 8305 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 8306 },
13468bfa
HW
8307 [ALC274_FIXUP_HP_MIC] = {
8308 .type = HDA_FIXUP_VERBS,
8309 .v.verbs = (const struct hda_verb[]) {
8310 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8311 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8312 { }
8313 },
8314 },
8a8de09c
KY
8315 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8316 .type = HDA_FIXUP_FUNC,
8317 .v.func = alc274_fixup_hp_headset_mic,
8318 .chained = true,
8319 .chain_id = ALC274_FIXUP_HP_MIC
8320 },
622464c8
TI
8321 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8322 .type = HDA_FIXUP_FUNC,
8323 .v.func = alc274_fixup_hp_envy_gpio,
8324 },
ef9ce66f
KY
8325 [ALC256_FIXUP_ASUS_HPE] = {
8326 .type = HDA_FIXUP_VERBS,
8327 .v.verbs = (const struct hda_verb[]) {
8328 /* Set EAPD high */
8329 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8330 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8331 { }
8332 },
8333 .chained = true,
8334 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8335 },
446b8185
KY
8336 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8337 .type = HDA_FIXUP_FUNC,
8338 .v.func = alc_fixup_headset_jack,
8339 .chained = true,
8340 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8341 },
a0ccbc53
KY
8342 [ALC287_FIXUP_HP_GPIO_LED] = {
8343 .type = HDA_FIXUP_FUNC,
8344 .v.func = alc287_fixup_hp_gpio_led,
8345 },
9e885770
KY
8346 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8347 .type = HDA_FIXUP_FUNC,
8348 .v.func = alc274_fixup_hp_headset_mic,
8349 },
92666d45
KY
8350 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8351 .type = HDA_FIXUP_FUNC,
8352 .v.func = alc_fixup_no_int_mic,
8353 .chained = true,
8354 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8355 },
34cdf405
CC
8356 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8357 .type = HDA_FIXUP_PINS,
8358 .v.pins = (const struct hda_pintbl[]) {
8359 { 0x1b, 0x411111f0 },
8360 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8361 { },
8362 },
8363 .chained = true,
8364 .chain_id = ALC269_FIXUP_HEADSET_MODE
8365 },
495dc763
CC
8366 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8367 .type = HDA_FIXUP_FUNC,
8368 .v.func = alc269_fixup_limit_int_mic_boost,
8369 .chained = true,
8370 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8371 },
d0e18561
CC
8372 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8373 .type = HDA_FIXUP_PINS,
8374 .v.pins = (const struct hda_pintbl[]) {
8375 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8376 { 0x1a, 0x90a1092f }, /* use as internal mic */
8377 { }
8378 },
8379 .chained = true,
8380 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8381 },
26928ca1
TI
8382 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8383 .type = HDA_FIXUP_FUNC,
8384 .v.func = alc285_fixup_ideapad_s740_coef,
8385 .chained = true,
8386 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8387 },
bd15b155
KHF
8388 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8389 .type = HDA_FIXUP_FUNC,
8390 .v.func = alc269_fixup_limit_int_mic_boost,
8391 .chained = true,
8392 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8393 },
8eedd3a7
TI
8394 [ALC295_FIXUP_ASUS_DACS] = {
8395 .type = HDA_FIXUP_FUNC,
8396 .v.func = alc295_fixup_asus_dacs,
8397 },
5d84b531
TI
8398 [ALC295_FIXUP_HP_OMEN] = {
8399 .type = HDA_FIXUP_PINS,
8400 .v.pins = (const struct hda_pintbl[]) {
8401 { 0x12, 0xb7a60130 },
8402 { 0x13, 0x40000000 },
8403 { 0x14, 0x411111f0 },
8404 { 0x16, 0x411111f0 },
8405 { 0x17, 0x90170110 },
8406 { 0x18, 0x411111f0 },
8407 { 0x19, 0x02a11030 },
8408 { 0x1a, 0x411111f0 },
8409 { 0x1b, 0x04a19030 },
8410 { 0x1d, 0x40600001 },
8411 { 0x1e, 0x411111f0 },
8412 { 0x21, 0x03211020 },
8413 {}
8414 },
8415 .chained = true,
8416 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8417 },
f2be77fe 8418 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
8419 .type = HDA_FIXUP_FUNC,
8420 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 8421 },
d94befbb
DB
8422 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8423 .type = HDA_FIXUP_FUNC,
8424 .v.func = alc285_fixup_hp_spectre_x360_eb1
8425 },
9ebaef05
HW
8426 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8427 .type = HDA_FIXUP_FUNC,
8428 .v.func = alc285_fixup_ideapad_s740_coef,
8429 .chained = true,
8430 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8431 },
29c8f40b
PU
8432 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8433 .type = HDA_FIXUP_FUNC,
8434 .v.func = alc_fixup_no_shutup,
8435 .chained = true,
8436 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8437 },
57c9e21a
HW
8438 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8439 .type = HDA_FIXUP_PINS,
8440 .v.pins = (const struct hda_pintbl[]) {
8441 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8442 { }
8443 },
8444 .chained = true,
8445 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8446 },
8903376d
KHF
8447 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8448 .type = HDA_FIXUP_FUNC,
8449 .v.func = alc269_fixup_limit_int_mic_boost,
8450 .chained = true,
8451 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8452 },
e7e2503a
BF
8453 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8454 .type = HDA_FIXUP_FUNC,
8455 .v.func = alc285_fixup_ideapad_s740_coef,
8456 .chained = true,
8457 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8458 },
8459 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8460 .type = HDA_FIXUP_FUNC,
8461 .v.func = alc287_fixup_legion_15imhg05_speakers,
8462 .chained = true,
8463 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8464 },
ad7cc2d4
CB
8465 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8466 .type = HDA_FIXUP_VERBS,
8467 //.v.verbs = legion_15imhg05_coefs,
8468 .v.verbs = (const struct hda_verb[]) {
8469 // set left speaker Legion 7i.
8470 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8471 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8472
8473 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8474 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8475 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8476 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8477 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8478
8479 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8480 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8481 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8482 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8483 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8484
8485 // set right speaker Legion 7i.
8486 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8487 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8488
8489 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8490 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8491 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8492 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8493 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8494
8495 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8496 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8497 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8498 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8499 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8500 {}
8501 },
8502 .chained = true,
8503 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8504 },
8505 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8506 .type = HDA_FIXUP_FUNC,
8507 .v.func = alc287_fixup_legion_15imhg05_speakers,
8508 .chained = true,
8509 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8510 },
8511 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8512 .type = HDA_FIXUP_VERBS,
8513 .v.verbs = (const struct hda_verb[]) {
8514 // set left speaker Yoga 7i.
8515 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8516 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8517
8518 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8519 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8520 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8521 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8522 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8523
8524 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8525 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8526 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8527 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8528 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8529
8530 // set right speaker Yoga 7i.
8531 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8532 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8533
8534 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8535 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8536 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8537 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8538 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8539
8540 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8541 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8542 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8543 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8544 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8545 {}
8546 },
8547 .chained = true,
8548 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8549 },
8550 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8551 .type = HDA_FIXUP_VERBS,
8552 .v.verbs = (const struct hda_verb[]) {
8553 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8554 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 8555 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
8556 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8557 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8558 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8559 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8560 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8561 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8562 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8563 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8564 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8565 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8566 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8567 {}
8568 },
8569 .chained = true,
8570 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8571 },
b9145ede 8572 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 8573 .type = HDA_FIXUP_FUNC,
b9145ede 8574 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 8575 },
c47b3112
JC
8576 [ALC245_FIXUP_HP_GPIO_LED] = {
8577 .type = HDA_FIXUP_FUNC,
8578 .v.func = alc245_fixup_hp_gpio_led,
8579 },
4803b99a
JS
8580 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8581 .type = HDA_FIXUP_PINS,
8582 .v.pins = (const struct hda_pintbl[]) {
8583 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8584 { }
8585 },
8586 .chained = true,
8587 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8588 },
e1abacd3
WS
8589 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8590 .type = HDA_FIXUP_FUNC,
8591 .v.func = alc233_fixup_no_audio_jack,
8592 },
f2ca7e35
WS
8593 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8594 .type = HDA_FIXUP_FUNC,
8595 .v.func = alc256_fixup_mic_no_presence_and_resume,
8596 .chained = true,
8597 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8598 },
f1d4e28b
KY
8599};
8600
1d045db9 8601static const struct snd_pci_quirk alc269_fixup_tbl[] = {
a6b92b66 8602 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
8603 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8604 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 8605 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 8606 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
8607 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8608 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 8609 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 8610 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 8611 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 8612 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 8613 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
13be30f1 8614 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 8615 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 8616 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 8617 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 8618 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
8619 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8620 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
8621 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8622 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
e2a829b3 8623 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 8624 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 8625 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 8626 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
667a8f73
JHP
8627 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8628 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8629 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 8630 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
35171fbf 8631 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 8632 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 8633 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 8634 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
204a71b0 8635 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 8636 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 8637 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 8638 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
aaedfb47 8639 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
6ed1131f 8640 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 8641 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 8642 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
8643 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8644 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 8645 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
8646 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8647 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8648 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
0f4881dc
DH
8649 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8650 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 8651 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 8652 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 8653 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
8654 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8655 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 8656 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 8657 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 8658 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 8659 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
8660 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8661 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
8662 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8663 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8664 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8665 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8666 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 8667 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 8668 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 8669 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 8670 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 8671 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 8672 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 8673 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 8674 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
8675 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8676 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
8677 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8678 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 8679 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
136824ef 8680 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 8681 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 8682 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 8683 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 8684 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
8685 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8686 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
8687 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8688 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
c1e89523 8689 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 8690 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 8691 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
8692 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8693 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
a22aa26f
KY
8694 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8695 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 8696 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 8697 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 8698 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 8699 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 8700 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 8701 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8702 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8703 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8704 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8705 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
8706 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8707 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8708 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8709 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 8710 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
8711 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8712 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8713 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8714 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8715 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 8716 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 8717 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 8718 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 8719 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
8720 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8721 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8722 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8723 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8724 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8725 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8726 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8727 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 8728 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 8729 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 8730 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 8731 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 8732 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 8733 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8734 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8735 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8736 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8737 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8738 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8739 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8740 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8741 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8742 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
8743 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8744 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8745 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8746 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8747 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8748 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
8749 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8750 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8751 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8752 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
167897f4
JK
8753 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8754 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
8755 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8756 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
563785ed 8757 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
e549d190 8758 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 8759 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 8760 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
8761 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8762 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 8763 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 8764 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 8765 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
5d84b531 8766 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 8767 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 8768 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
a94c91b4 8769 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 8770 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 8771 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
622464c8 8772 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
15d295b5 8773 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 8774 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 8775 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
afbac2a3 8776 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 8777 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 8778 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
de1c4c2b 8779 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 8780 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
08befca4 8781 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
431e76c3 8782 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 8783 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
8784 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8785 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8786 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8787 ALC285_FIXUP_HP_GPIO_AMP_INIT),
ba28051e 8788 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
48422958 8789 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
e7d66cf7 8790 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 8791 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 8792 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 8793 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
8794 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8795 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 8796 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 8797 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
d07149ab 8798 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 8799 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
8800 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8801 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
53b861be 8802 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 8803 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 8804 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 8805 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
8806 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8807 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 8808 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 8809 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 8810 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
600dd2a7 8811 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
0e68c4b1 8812 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 8813 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 8814 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
0aa32e54 8815 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
1e30191c 8816 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
c1732ede 8817 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 8818 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3e0d611b 8819 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9cf6533e 8820 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
c1732ede 8821 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 8822 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3e0d611b 8823 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4eab0ea1 8824 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3cd0ed63 8825 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 8826 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1
TI
8827 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8828 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
c1732ede 8829 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
3cd0ed63 8830 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
c1732ede 8831 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
2cede303 8832 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
23870831 8833 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
3e0d611b 8834 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8eedd3a7 8835 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 8836 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
739d0959 8837 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
3cd0ed63 8838 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 8839 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
4963d66b 8840 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 8841 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
d3a9b1ce 8842 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 8843 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 8844 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 8845 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 8846 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
28e8af8a 8847 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
1b94e59d 8848 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
693b613d 8849 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
615966ad 8850 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1 8851 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
c1732ede 8852 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
ef9ce66f 8853 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
4b43d05a 8854 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
c1b55029 8855 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
76fae618 8856 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
293a92c1 8857 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
ff2ca018 8858 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
eeed4cd1 8859 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
adabb3ec
TI
8860 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8861 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8862 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8863 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 8864 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
8865 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8866 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8867 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 8868 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
8869 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8870 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 8871 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 8872 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 8873 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 8874 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 8875 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 8876 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 8877 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 8878 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
6fa38ef1 8879 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
8880 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8881 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
0fca97a2 8882 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
a33cc48d 8883 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
14425f1f
MP
8884 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8885 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
f70fff83 8886 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8bcea6cb 8887 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
823ff161 8888 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
568e4e82 8889 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
c656f747 8890 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
abaa2274
AA
8891 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8892 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 8893 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 8894 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
b5acfe15 8895 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 8896 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8897 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8898 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8899 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8900 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8901 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8902 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8903 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8904 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8905 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8906 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
4803b99a
JS
8907 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8908 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8909 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8910 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8911 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8912 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8913 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
4803b99a
JS
8914 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8915 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 8916 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 8917 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 8918 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
8919 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8920 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8921 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8922 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8923 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8924 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8925 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
8926 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8927 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8928 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8929 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8930 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8931 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8932 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8933 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8934 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
8935 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8936 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8937 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8938 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8939 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15
PH
8940 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8941 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
f2ca7e35 8942 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
8943 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8944 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8945 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8946 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 8947 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8948 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8949 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
8950 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8951 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
8952 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8953 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8954 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8955 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8956 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8957 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 8958 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 8959 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
8960 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8961 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8962 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8963 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8964 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 8965 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 8966 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 8967 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 8968 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 8969 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 8970 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 8971 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 8972 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 8973 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 8974 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 8975 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 8976 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 8977 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 8978 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 8979 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 8980 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
8981 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8982 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 8983 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 8984 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
8985 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
8986 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8987 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 8988 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
8989 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8990 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8991 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 8992 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 8993 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 8994 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
8995 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8996 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
3694cb29 8997 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 8998 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 8999 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 9000 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 9001 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 9002 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 9003 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 9004 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
9005 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9006 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 9007 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
c6e388f4 9008 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
f86de9b1 9009 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
c6e388f4 9010 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
e7e2503a 9011 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
c6e388f4 9012 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b67ef1ff 9013 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9ebaef05 9014 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
c6e388f4 9015 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
9016 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9017 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
56f27013 9018 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
fedb2245 9019 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 9020 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 9021 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 9022 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 9023 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 9024 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 9025 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 9026 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 9027 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 9028 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 9029 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 9030 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 9031 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 9032 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 9033 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9034 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9035 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9036 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
cd5302c0 9037 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
9038 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9039 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 9040 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
e1abacd3 9041 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
0fbf21c3 9042 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
f1ec5be1
HC
9043 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9044 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9045 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 9046 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
9047 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9048 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
b9145ede 9049 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
fc19d559 9050 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 9051 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 9052 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 9053 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
d1ee66c5 9054 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 9055 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 9056 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
a4297b5d 9057
a7f3eedc 9058#if 0
a4297b5d
TI
9059 /* Below is a quirk table taken from the old code.
9060 * Basically the device should work as is without the fixup table.
9061 * If BIOS doesn't give a proper info, enable the corresponding
9062 * fixup entry.
7d7eb9ea 9063 */
a4297b5d
TI
9064 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9065 ALC269_FIXUP_AMIC),
9066 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
9067 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9068 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9069 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9070 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9071 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9072 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9073 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9074 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9075 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9076 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9077 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9078 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9079 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9080 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9081 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9082 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9083 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9084 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9085 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9086 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9087 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9088 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9089 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9090 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9091 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9092 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9093 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9094 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9095 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9096 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9097 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9098 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9099 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9100 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9101 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9102 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9103 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9104 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9105#endif
9106 {}
9107};
9108
214eef76
DH
9109static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9110 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9111 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9112 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9113 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
0fbf21c3 9114 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
9115 {}
9116};
9117
1727a771 9118static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
9119 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9120 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
9121 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9122 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9123 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 9124 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
9125 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9126 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 9127 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 9128 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 9129 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 9130 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
9131 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9132 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
9133 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9134 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
be8ef16a 9135 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 9136 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 9137 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 9138 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 9139 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 9140 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 9141 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 9142 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 9143 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
9144 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9145 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9146 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9147 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9148 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9149 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9150 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9151 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9152 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9153 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9154 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9155 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9156 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9157 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9158 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9159 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9160 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9161 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9162 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9163 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9164 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9165 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9166 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9167 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9168 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9169 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9170 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9171 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9172 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9173 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9174 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9175 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9176 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9177 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9178 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9179 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9180 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9181 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9182 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9183 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 9184 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 9185 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 9186 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
9187 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9188 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9189 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9190 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9191 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9192 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9193 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9194 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9195 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9196 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9197 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9198 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9199 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9200 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
9201 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9202 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9203 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 9204 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 9205 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 9206 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
9207 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9208 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9209 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9210 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9211 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9212 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9213 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9214 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9215 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9216 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9217 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9218 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9219 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9220 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9221 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9222 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9223 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
9224 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9225 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
e2a829b3 9226 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 9227 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 9228 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
23dc9586 9229 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
fc19d559 9230 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 9231 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 9232 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 9233 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 9234 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 9235 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9ebaef05 9236 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
29c8f40b 9237 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 9238 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
657da58e 9239 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
1d045db9 9240 {}
6dda9f4a 9241};
cfc5a845 9242#define ALC225_STANDARD_PINS \
cfc5a845 9243 {0x21, 0x04211020}
6dda9f4a 9244
e8191a8e
HW
9245#define ALC256_STANDARD_PINS \
9246 {0x12, 0x90a60140}, \
9247 {0x14, 0x90170110}, \
e8191a8e
HW
9248 {0x21, 0x02211020}
9249
fea185e2 9250#define ALC282_STANDARD_PINS \
11580297 9251 {0x14, 0x90170110}
e1e62b98 9252
fea185e2 9253#define ALC290_STANDARD_PINS \
11580297 9254 {0x12, 0x99a30130}
fea185e2
DH
9255
9256#define ALC292_STANDARD_PINS \
9257 {0x14, 0x90170110}, \
11580297 9258 {0x15, 0x0221401f}
977e6276 9259
3f640970
HW
9260#define ALC295_STANDARD_PINS \
9261 {0x12, 0xb7a60130}, \
9262 {0x14, 0x90170110}, \
3f640970
HW
9263 {0x21, 0x04211020}
9264
703867e2
WS
9265#define ALC298_STANDARD_PINS \
9266 {0x12, 0x90a60130}, \
9267 {0x21, 0x03211020}
9268
e1918938 9269static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
9270 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9271 {0x14, 0x01014020},
9272 {0x17, 0x90170110},
9273 {0x18, 0x02a11030},
9274 {0x19, 0x0181303F},
9275 {0x21, 0x0221102f}),
5824ce8d
CC
9276 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9277 {0x12, 0x90a601c0},
9278 {0x14, 0x90171120},
9279 {0x21, 0x02211030}),
615966ad
CC
9280 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9281 {0x14, 0x90170110},
9282 {0x1b, 0x90a70130},
9283 {0x21, 0x03211020}),
9284 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9285 {0x1a, 0x90a70130},
9286 {0x1b, 0x90170110},
9287 {0x21, 0x03211020}),
2ae95577 9288 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 9289 ALC225_STANDARD_PINS,
8a132099 9290 {0x12, 0xb7a60130},
cfc5a845 9291 {0x14, 0x901701a0}),
2ae95577 9292 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 9293 ALC225_STANDARD_PINS,
8a132099 9294 {0x12, 0xb7a60130},
cfc5a845 9295 {0x14, 0x901701b0}),
8a132099
HW
9296 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9297 ALC225_STANDARD_PINS,
9298 {0x12, 0xb7a60150},
9299 {0x14, 0x901701a0}),
9300 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9301 ALC225_STANDARD_PINS,
9302 {0x12, 0xb7a60150},
9303 {0x14, 0x901701b0}),
9304 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9305 ALC225_STANDARD_PINS,
9306 {0x12, 0xb7a60130},
9307 {0x1b, 0x90170110}),
0ce48e17
KHF
9308 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9309 {0x1b, 0x01111010},
9310 {0x1e, 0x01451130},
9311 {0x21, 0x02211020}),
986376b6
HW
9312 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9313 {0x12, 0x90a60140},
9314 {0x14, 0x90170110},
9315 {0x19, 0x02a11030},
9316 {0x21, 0x02211020}),
e41fc8c5
HW
9317 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9318 {0x14, 0x90170110},
9319 {0x19, 0x02a11030},
9320 {0x1a, 0x02a11040},
9321 {0x1b, 0x01014020},
9322 {0x21, 0x0221101f}),
d06fb562
HW
9323 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9324 {0x14, 0x90170110},
9325 {0x19, 0x02a11030},
9326 {0x1a, 0x02a11040},
9327 {0x1b, 0x01011020},
9328 {0x21, 0x0221101f}),
c6b17f10
HW
9329 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9330 {0x14, 0x90170110},
9331 {0x19, 0x02a11020},
9332 {0x1a, 0x02a11030},
9333 {0x21, 0x0221101f}),
92666d45
KY
9334 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9335 {0x21, 0x02211010}),
9e885770
KY
9336 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9337 {0x14, 0x90170110},
9338 {0x19, 0x02a11020},
9339 {0x21, 0x02211030}),
c77900e6 9340 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 9341 {0x14, 0x90170110},
c77900e6 9342 {0x21, 0x02211020}),
86c72d1c
HW
9343 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9344 {0x14, 0x90170130},
9345 {0x21, 0x02211040}),
76c2132e
DH
9346 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9347 {0x12, 0x90a60140},
9348 {0x14, 0x90170110},
76c2132e
DH
9349 {0x21, 0x02211020}),
9350 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9351 {0x12, 0x90a60160},
9352 {0x14, 0x90170120},
76c2132e 9353 {0x21, 0x02211030}),
392c9da2
HW
9354 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9355 {0x14, 0x90170110},
9356 {0x1b, 0x02011020},
9357 {0x21, 0x0221101f}),
6aecd871
HW
9358 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9359 {0x14, 0x90170110},
9360 {0x1b, 0x01011020},
9361 {0x21, 0x0221101f}),
cba59972 9362 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 9363 {0x14, 0x90170130},
cba59972 9364 {0x1b, 0x01014020},
cba59972 9365 {0x21, 0x0221103f}),
6aecd871
HW
9366 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9367 {0x14, 0x90170130},
9368 {0x1b, 0x01011020},
9369 {0x21, 0x0221103f}),
59ec4b57
HW
9370 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9371 {0x14, 0x90170130},
9372 {0x1b, 0x02011020},
9373 {0x21, 0x0221103f}),
e9c28e16 9374 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 9375 {0x14, 0x90170150},
e9c28e16 9376 {0x1b, 0x02011020},
e9c28e16
WS
9377 {0x21, 0x0221105f}),
9378 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 9379 {0x14, 0x90170110},
e9c28e16 9380 {0x1b, 0x01014020},
e9c28e16 9381 {0x21, 0x0221101f}),
76c2132e
DH
9382 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9383 {0x12, 0x90a60160},
9384 {0x14, 0x90170120},
9385 {0x17, 0x90170140},
76c2132e
DH
9386 {0x21, 0x0321102f}),
9387 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9388 {0x12, 0x90a60160},
9389 {0x14, 0x90170130},
76c2132e
DH
9390 {0x21, 0x02211040}),
9391 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9392 {0x12, 0x90a60160},
9393 {0x14, 0x90170140},
76c2132e
DH
9394 {0x21, 0x02211050}),
9395 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9396 {0x12, 0x90a60170},
9397 {0x14, 0x90170120},
76c2132e
DH
9398 {0x21, 0x02211030}),
9399 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9400 {0x12, 0x90a60170},
9401 {0x14, 0x90170130},
76c2132e 9402 {0x21, 0x02211040}),
0a1f90a9
HW
9403 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9404 {0x12, 0x90a60170},
9405 {0x14, 0x90171130},
9406 {0x21, 0x02211040}),
70658b99 9407 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
9408 {0x12, 0x90a60170},
9409 {0x14, 0x90170140},
70658b99 9410 {0x21, 0x02211050}),
9b5a4e39 9411 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
9412 {0x12, 0x90a60180},
9413 {0x14, 0x90170130},
9b5a4e39 9414 {0x21, 0x02211040}),
f90d83b3
AK
9415 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9416 {0x12, 0x90a60180},
9417 {0x14, 0x90170120},
9418 {0x21, 0x02211030}),
989dbe4a
HW
9419 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9420 {0x1b, 0x01011020},
9421 {0x21, 0x02211010}),
c1732ede
CC
9422 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9423 {0x14, 0x90170110},
9424 {0x1b, 0x90a70130},
9425 {0x21, 0x04211020}),
9426 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9427 {0x14, 0x90170110},
9428 {0x1b, 0x90a70130},
9429 {0x21, 0x03211020}),
a806ef1c
CC
9430 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9431 {0x12, 0x90a60130},
9432 {0x14, 0x90170110},
9433 {0x21, 0x03211020}),
6ac371aa
JHP
9434 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9435 {0x12, 0x90a60130},
9436 {0x14, 0x90170110},
9437 {0x21, 0x04211020}),
e1037354
JHP
9438 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9439 {0x1a, 0x90a70130},
9440 {0x1b, 0x90170110},
9441 {0x21, 0x03211020}),
9e885770
KY
9442 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9443 {0x14, 0x90170110},
9444 {0x19, 0x02a11020},
9445 {0x21, 0x0221101f}),
8a8de09c
KY
9446 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9447 {0x17, 0x90170110},
9448 {0x19, 0x03a11030},
9449 {0x21, 0x03211020}),
cf51eb9d
DH
9450 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9451 {0x12, 0x90a60130},
cf51eb9d
DH
9452 {0x14, 0x90170110},
9453 {0x15, 0x0421101f},
11580297 9454 {0x1a, 0x04a11020}),
0279661b
HW
9455 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9456 {0x12, 0x90a60140},
0279661b
HW
9457 {0x14, 0x90170110},
9458 {0x15, 0x0421101f},
0279661b 9459 {0x18, 0x02811030},
0279661b 9460 {0x1a, 0x04a1103f},
11580297 9461 {0x1b, 0x02011020}),
42304474 9462 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9463 ALC282_STANDARD_PINS,
42304474 9464 {0x12, 0x99a30130},
42304474 9465 {0x19, 0x03a11020},
42304474 9466 {0x21, 0x0321101f}),
2c609999 9467 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9468 ALC282_STANDARD_PINS,
2c609999 9469 {0x12, 0x99a30130},
2c609999 9470 {0x19, 0x03a11020},
2c609999
HW
9471 {0x21, 0x03211040}),
9472 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9473 ALC282_STANDARD_PINS,
2c609999 9474 {0x12, 0x99a30130},
2c609999 9475 {0x19, 0x03a11030},
2c609999
HW
9476 {0x21, 0x03211020}),
9477 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9478 ALC282_STANDARD_PINS,
2c609999 9479 {0x12, 0x99a30130},
2c609999 9480 {0x19, 0x04a11020},
2c609999 9481 {0x21, 0x0421101f}),
200afc09 9482 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 9483 ALC282_STANDARD_PINS,
200afc09 9484 {0x12, 0x90a60140},
200afc09 9485 {0x19, 0x04a11030},
200afc09 9486 {0x21, 0x04211020}),
34cdf405
CC
9487 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9488 ALC282_STANDARD_PINS,
9489 {0x12, 0x90a609c0},
9490 {0x18, 0x03a11830},
9491 {0x19, 0x04a19831},
9492 {0x1a, 0x0481303f},
9493 {0x1b, 0x04211020},
9494 {0x21, 0x0321101f}),
9495 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9496 ALC282_STANDARD_PINS,
9497 {0x12, 0x90a60940},
9498 {0x18, 0x03a11830},
9499 {0x19, 0x04a19831},
9500 {0x1a, 0x0481303f},
9501 {0x1b, 0x04211020},
9502 {0x21, 0x0321101f}),
76c2132e 9503 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9504 ALC282_STANDARD_PINS,
76c2132e 9505 {0x12, 0x90a60130},
76c2132e
DH
9506 {0x21, 0x0321101f}),
9507 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9508 {0x12, 0x90a60160},
9509 {0x14, 0x90170120},
76c2132e 9510 {0x21, 0x02211030}),
bc262179 9511 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9512 ALC282_STANDARD_PINS,
bc262179 9513 {0x12, 0x90a60130},
bc262179 9514 {0x19, 0x03a11020},
bc262179 9515 {0x21, 0x0321101f}),
c8c6ee61 9516 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
9517 {0x12, 0x90a60130},
9518 {0x14, 0x90170110},
9519 {0x19, 0x04a11040},
9520 {0x21, 0x04211020}),
9521 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9522 {0x14, 0x90170110},
9523 {0x19, 0x04a11040},
9524 {0x1d, 0x40600001},
9525 {0x21, 0x04211020}),
9526 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
9527 {0x14, 0x90170110},
9528 {0x19, 0x04a11040},
9529 {0x21, 0x04211020}),
c72b9bfe
HW
9530 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9531 {0x14, 0x90170110},
9532 {0x17, 0x90170111},
9533 {0x19, 0x03a11030},
9534 {0x21, 0x03211020}),
33aaebd4
CC
9535 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9536 {0x12, 0x90a60130},
9537 {0x17, 0x90170110},
9538 {0x21, 0x02211020}),
d44a6864 9539 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 9540 {0x12, 0x90a60120},
e1e62b98 9541 {0x14, 0x90170110},
e1e62b98 9542 {0x21, 0x0321101f}),
e4442bcf 9543 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9544 ALC290_STANDARD_PINS,
e4442bcf 9545 {0x15, 0x04211040},
e4442bcf 9546 {0x18, 0x90170112},
11580297 9547 {0x1a, 0x04a11020}),
e4442bcf 9548 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9549 ALC290_STANDARD_PINS,
e4442bcf 9550 {0x15, 0x04211040},
e4442bcf 9551 {0x18, 0x90170110},
11580297 9552 {0x1a, 0x04a11020}),
e4442bcf 9553 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9554 ALC290_STANDARD_PINS,
e4442bcf 9555 {0x15, 0x0421101f},
11580297 9556 {0x1a, 0x04a11020}),
e4442bcf 9557 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9558 ALC290_STANDARD_PINS,
e4442bcf 9559 {0x15, 0x04211020},
11580297 9560 {0x1a, 0x04a11040}),
e4442bcf 9561 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9562 ALC290_STANDARD_PINS,
e4442bcf
HW
9563 {0x14, 0x90170110},
9564 {0x15, 0x04211020},
11580297 9565 {0x1a, 0x04a11040}),
e4442bcf 9566 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9567 ALC290_STANDARD_PINS,
e4442bcf
HW
9568 {0x14, 0x90170110},
9569 {0x15, 0x04211020},
11580297 9570 {0x1a, 0x04a11020}),
e4442bcf 9571 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9572 ALC290_STANDARD_PINS,
e4442bcf
HW
9573 {0x14, 0x90170110},
9574 {0x15, 0x0421101f},
11580297 9575 {0x1a, 0x04a11020}),
e8818fa8 9576 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 9577 ALC292_STANDARD_PINS,
e8818fa8 9578 {0x12, 0x90a60140},
e8818fa8 9579 {0x16, 0x01014020},
11580297 9580 {0x19, 0x01a19030}),
e8818fa8 9581 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 9582 ALC292_STANDARD_PINS,
e8818fa8 9583 {0x12, 0x90a60140},
e8818fa8
HW
9584 {0x16, 0x01014020},
9585 {0x18, 0x02a19031},
11580297 9586 {0x19, 0x01a1903e}),
76c2132e 9587 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 9588 ALC292_STANDARD_PINS,
11580297 9589 {0x12, 0x90a60140}),
76c2132e 9590 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9591 ALC292_STANDARD_PINS,
76c2132e 9592 {0x13, 0x90a60140},
76c2132e 9593 {0x16, 0x21014020},
11580297 9594 {0x19, 0x21a19030}),
e03fdbde 9595 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9596 ALC292_STANDARD_PINS,
11580297 9597 {0x13, 0x90a60140}),
eeacd80f
JHP
9598 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9599 {0x17, 0x90170110},
9600 {0x21, 0x04211020}),
d8ae458e
CC
9601 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9602 {0x14, 0x90170110},
9603 {0x1b, 0x90a70130},
9604 {0x21, 0x04211020}),
8bb37a2a
JHP
9605 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9606 {0x12, 0x90a60130},
9607 {0x17, 0x90170110},
9608 {0x21, 0x03211020}),
0bea4cc8
JHP
9609 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9610 {0x12, 0x90a60130},
9611 {0x17, 0x90170110},
9612 {0x21, 0x04211020}),
3887c26c
TI
9613 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9614 {0x12, 0x90a60130},
9615 {0x17, 0x90170110},
9616 {0x21, 0x03211020}),
9e43342b 9617 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
9618 {0x12, 0x90a60120},
9619 {0x17, 0x90170110},
9620 {0x21, 0x04211030}),
9621 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
9622 {0x12, 0x90a60130},
9623 {0x17, 0x90170110},
9624 {0x21, 0x03211020}),
9625 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9626 {0x12, 0x90a60130},
9627 {0x17, 0x90170110},
9628 {0x21, 0x03211020}),
fbc57129 9629 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
0a29c57b
KY
9630 {0x14, 0x90170110},
9631 {0x21, 0x04211020}),
fbc57129
KY
9632 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9633 {0x14, 0x90170110},
9634 {0x21, 0x04211030}),
3f640970 9635 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
f771d5bb
HW
9636 ALC295_STANDARD_PINS,
9637 {0x17, 0x21014020},
9638 {0x18, 0x21a19030}),
9639 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9640 ALC295_STANDARD_PINS,
9641 {0x17, 0x21014040},
9642 {0x18, 0x21a19050}),
3f307834
HW
9643 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9644 ALC295_STANDARD_PINS),
9f502ff5
TI
9645 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9646 ALC298_STANDARD_PINS,
9647 {0x17, 0x90170110}),
977e6276 9648 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
9649 ALC298_STANDARD_PINS,
9650 {0x17, 0x90170140}),
9651 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9652 ALC298_STANDARD_PINS,
9f502ff5 9653 {0x17, 0x90170150}),
9f1bc2c4
KHF
9654 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9655 {0x12, 0xb7a60140},
9656 {0x13, 0xb7a60150},
9657 {0x17, 0x90170110},
9658 {0x1a, 0x03011020},
9659 {0x21, 0x03211030}),
54324221
JM
9660 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9661 {0x12, 0xb7a60140},
9662 {0x17, 0x90170110},
9663 {0x1a, 0x03a11030},
9664 {0x21, 0x03211020}),
fcc6c877
KY
9665 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9666 ALC225_STANDARD_PINS,
9667 {0x12, 0xb7a60130},
fcc6c877 9668 {0x17, 0x90170110}),
573fcbfd
HW
9669 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9670 {0x14, 0x01014010},
9671 {0x17, 0x90170120},
9672 {0x18, 0x02a11030},
9673 {0x19, 0x02a1103f},
9674 {0x21, 0x0221101f}),
e1918938
HW
9675 {}
9676};
6dda9f4a 9677
7c0a6939
HW
9678/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9679 * more machines, don't need to match all valid pins, just need to match
9680 * all the pins defined in the tbl. Just because of this reason, it is possible
9681 * that a single machine matches multiple tbls, so there is one limitation:
9682 * at most one tbl is allowed to define for the same vendor and same codec
9683 */
9684static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9685 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9686 {0x19, 0x40000000},
9687 {0x1b, 0x40000000}),
aed8c7f4
HW
9688 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9689 {0x19, 0x40000000},
9690 {0x1a, 0x40000000}),
d64ebdbf
HW
9691 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9692 {0x19, 0x40000000},
9693 {0x1a, 0x40000000}),
5815bdfd
HW
9694 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9695 {0x19, 0x40000000},
9696 {0x1a, 0x40000000}),
7c0a6939
HW
9697 {}
9698};
9699
546bb678 9700static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 9701{
526af6eb 9702 struct alc_spec *spec = codec->spec;
1d045db9 9703 int val;
ebb83eeb 9704
526af6eb 9705 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 9706 return;
526af6eb 9707
1bb7e43e 9708 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
9709 alc_write_coef_idx(codec, 0xf, 0x960b);
9710 alc_write_coef_idx(codec, 0xe, 0x8817);
9711 }
ebb83eeb 9712
1bb7e43e 9713 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
9714 alc_write_coef_idx(codec, 0xf, 0x960b);
9715 alc_write_coef_idx(codec, 0xe, 0x8814);
9716 }
ebb83eeb 9717
1bb7e43e 9718 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 9719 /* Power up output pin */
98b24883 9720 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 9721 }
ebb83eeb 9722
1bb7e43e 9723 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 9724 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 9725 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
9726 /* Capless ramp up clock control */
9727 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9728 }
9729 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 9730 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
9731 /* Class D power on reset */
9732 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9733 }
9734 }
ebb83eeb 9735
98b24883
TI
9736 /* HP */
9737 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 9738}
a7f2371f 9739
1d045db9
TI
9740/*
9741 */
1d045db9
TI
9742static int patch_alc269(struct hda_codec *codec)
9743{
9744 struct alc_spec *spec;
3de95173 9745 int err;
f1d4e28b 9746
3de95173 9747 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 9748 if (err < 0)
3de95173
TI
9749 return err;
9750
9751 spec = codec->spec;
08c189f2 9752 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 9753 codec->power_save_node = 0;
e16fb6d1 9754
225068ab
TI
9755#ifdef CONFIG_PM
9756 codec->patch_ops.suspend = alc269_suspend;
9757 codec->patch_ops.resume = alc269_resume;
9758#endif
c2d6af53
KY
9759 spec->shutup = alc_default_shutup;
9760 spec->init_hook = alc_default_init;
225068ab 9761
7639a06c 9762 switch (codec->core.vendor_id) {
065380f0 9763 case 0x10ec0269:
1d045db9 9764 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
9765 switch (alc_get_coef0(codec) & 0x00f0) {
9766 case 0x0010:
5100cd07
TI
9767 if (codec->bus->pci &&
9768 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 9769 spec->cdefine.platform_type == 1)
20ca0c35 9770 err = alc_codec_rename(codec, "ALC271X");
1d045db9 9771 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
9772 break;
9773 case 0x0020:
5100cd07
TI
9774 if (codec->bus->pci &&
9775 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 9776 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 9777 err = alc_codec_rename(codec, "ALC3202");
1d045db9 9778 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 9779 break;
adcc70b2
KY
9780 case 0x0030:
9781 spec->codec_variant = ALC269_TYPE_ALC269VD;
9782 break;
1bb7e43e 9783 default:
1d045db9 9784 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 9785 }
e16fb6d1
TI
9786 if (err < 0)
9787 goto error;
c2d6af53 9788 spec->shutup = alc269_shutup;
546bb678 9789 spec->init_hook = alc269_fill_coef;
1d045db9 9790 alc269_fill_coef(codec);
065380f0
KY
9791 break;
9792
9793 case 0x10ec0280:
9794 case 0x10ec0290:
9795 spec->codec_variant = ALC269_TYPE_ALC280;
9796 break;
9797 case 0x10ec0282:
065380f0 9798 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
9799 spec->shutup = alc282_shutup;
9800 spec->init_hook = alc282_init;
065380f0 9801 break;
2af02be7
KY
9802 case 0x10ec0233:
9803 case 0x10ec0283:
9804 spec->codec_variant = ALC269_TYPE_ALC283;
9805 spec->shutup = alc283_shutup;
9806 spec->init_hook = alc283_init;
9807 break;
065380f0
KY
9808 case 0x10ec0284:
9809 case 0x10ec0292:
9810 spec->codec_variant = ALC269_TYPE_ALC284;
9811 break;
161ebf29 9812 case 0x10ec0293:
4731d5de 9813 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 9814 break;
7fc7d047 9815 case 0x10ec0286:
7c665932 9816 case 0x10ec0288:
7fc7d047
KY
9817 spec->codec_variant = ALC269_TYPE_ALC286;
9818 break;
506b62c3
KY
9819 case 0x10ec0298:
9820 spec->codec_variant = ALC269_TYPE_ALC298;
9821 break;
ea04a1db 9822 case 0x10ec0235:
1d04c9de
KY
9823 case 0x10ec0255:
9824 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
9825 spec->shutup = alc256_shutup;
9826 spec->init_hook = alc256_init;
1d04c9de 9827 break;
1948fc06 9828 case 0x10ec0230:
736f20a7 9829 case 0x10ec0236:
4344aec8
KY
9830 case 0x10ec0256:
9831 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
9832 spec->shutup = alc256_shutup;
9833 spec->init_hook = alc256_init;
7d1b6e29 9834 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
4344aec8 9835 break;
f429e7e4
KY
9836 case 0x10ec0257:
9837 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
9838 spec->shutup = alc256_shutup;
9839 spec->init_hook = alc256_init;
f429e7e4
KY
9840 spec->gen.mixer_nid = 0;
9841 break;
0a6f0600 9842 case 0x10ec0215:
7fbdcd83 9843 case 0x10ec0245:
0a6f0600
KY
9844 case 0x10ec0285:
9845 case 0x10ec0289:
9846 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
9847 spec->shutup = alc225_shutup;
9848 spec->init_hook = alc225_init;
0a6f0600
KY
9849 spec->gen.mixer_nid = 0;
9850 break;
4231430d 9851 case 0x10ec0225:
7d727869 9852 case 0x10ec0295:
28f1f9b2 9853 case 0x10ec0299:
4231430d 9854 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
9855 spec->shutup = alc225_shutup;
9856 spec->init_hook = alc225_init;
c1350bff 9857 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 9858 break;
99cee034
KY
9859 case 0x10ec0287:
9860 spec->codec_variant = ALC269_TYPE_ALC287;
9861 spec->shutup = alc225_shutup;
9862 spec->init_hook = alc225_init;
9863 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
9864 break;
dcd4f0db
KY
9865 case 0x10ec0234:
9866 case 0x10ec0274:
9867 case 0x10ec0294:
9868 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 9869 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 9870 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 9871 spec->init_hook = alc294_init;
dcd4f0db 9872 break;
1078bef0
KY
9873 case 0x10ec0300:
9874 spec->codec_variant = ALC269_TYPE_ALC300;
9875 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 9876 break;
f0778871
KY
9877 case 0x10ec0623:
9878 spec->codec_variant = ALC269_TYPE_ALC623;
9879 break;
6fbae35a
KY
9880 case 0x10ec0700:
9881 case 0x10ec0701:
9882 case 0x10ec0703:
83629532 9883 case 0x10ec0711:
6fbae35a
KY
9884 spec->codec_variant = ALC269_TYPE_ALC700;
9885 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 9886 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 9887 spec->init_hook = alc294_init;
6fbae35a
KY
9888 break;
9889
1d045db9 9890 }
6dda9f4a 9891
ad60d502 9892 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 9893 spec->has_alc5505_dsp = 1;
ad60d502
KY
9894 spec->init_hook = alc5505_dsp_init;
9895 }
9896
c9af753f
TI
9897 alc_pre_init(codec);
9898
efe55732
TI
9899 snd_hda_pick_fixup(codec, alc269_fixup_models,
9900 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
9901 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
9902 * the quirk breaks the latter (bko#214101).
9903 * Clear the wrong entry.
9904 */
9905 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
9906 codec->core.vendor_id == 0x10ec0294) {
9907 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
9908 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
9909 }
9910
0fc1e447 9911 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 9912 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
9913 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
9914 alc269_fixups);
9915 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9916
9917 alc_auto_parse_customize_define(codec);
9918
9919 if (has_cdefine_beep(codec))
9920 spec->gen.beep_nid = 0x01;
9921
a4297b5d
TI
9922 /* automatic parse from the BIOS config */
9923 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
9924 if (err < 0)
9925 goto error;
6dda9f4a 9926
fea80fae
TI
9927 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
9928 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9929 if (err < 0)
9930 goto error;
9931 }
f1d4e28b 9932
1727a771 9933 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 9934
1d045db9 9935 return 0;
e16fb6d1
TI
9936
9937 error:
9938 alc_free(codec);
9939 return err;
1d045db9 9940}
f1d4e28b 9941
1d045db9
TI
9942/*
9943 * ALC861
9944 */
622e84cd 9945
1d045db9 9946static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 9947{
1d045db9 9948 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
9949 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9950 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
9951}
9952
1d045db9
TI
9953/* Pin config fixes */
9954enum {
e652f4c8
TI
9955 ALC861_FIXUP_FSC_AMILO_PI1505,
9956 ALC861_FIXUP_AMP_VREF_0F,
9957 ALC861_FIXUP_NO_JACK_DETECT,
9958 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 9959 ALC660_FIXUP_ASUS_W7J,
1d045db9 9960};
7085ec12 9961
31150f23
TI
9962/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9963static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 9964 const struct hda_fixup *fix, int action)
31150f23
TI
9965{
9966 struct alc_spec *spec = codec->spec;
9967 unsigned int val;
9968
1727a771 9969 if (action != HDA_FIXUP_ACT_INIT)
31150f23 9970 return;
d3f02d60 9971 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
9972 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9973 val |= AC_PINCTL_IN_EN;
9974 val |= AC_PINCTL_VREF_50;
cdd03ced 9975 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 9976 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
9977}
9978
e652f4c8
TI
9979/* suppress the jack-detection */
9980static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 9981 const struct hda_fixup *fix, int action)
e652f4c8 9982{
1727a771 9983 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 9984 codec->no_jack_detect = 1;
7d7eb9ea 9985}
e652f4c8 9986
1727a771 9987static const struct hda_fixup alc861_fixups[] = {
e652f4c8 9988 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
9989 .type = HDA_FIXUP_PINS,
9990 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
9991 { 0x0b, 0x0221101f }, /* HP */
9992 { 0x0f, 0x90170310 }, /* speaker */
9993 { }
9994 }
9995 },
e652f4c8 9996 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 9997 .type = HDA_FIXUP_FUNC,
31150f23 9998 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 9999 },
e652f4c8 10000 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 10001 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10002 .v.func = alc_fixup_no_jack_detect,
10003 },
10004 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 10005 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10006 .v.func = alc861_fixup_asus_amp_vref_0f,
10007 .chained = true,
10008 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
10009 },
10010 [ALC660_FIXUP_ASUS_W7J] = {
10011 .type = HDA_FIXUP_VERBS,
10012 .v.verbs = (const struct hda_verb[]) {
10013 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10014 * for enabling outputs
10015 */
10016 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10017 { }
10018 },
e652f4c8 10019 }
1d045db9 10020};
7085ec12 10021
1d045db9 10022static const struct snd_pci_quirk alc861_fixup_tbl[] = {
6ddf0fd1 10023 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 10024 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
10025 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10026 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10027 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 10028 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 10029 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
10030 {}
10031};
3af9ee6b 10032
1d045db9
TI
10033/*
10034 */
1d045db9 10035static int patch_alc861(struct hda_codec *codec)
7085ec12 10036{
1d045db9 10037 struct alc_spec *spec;
1d045db9 10038 int err;
7085ec12 10039
3de95173
TI
10040 err = alc_alloc_spec(codec, 0x15);
10041 if (err < 0)
10042 return err;
1d045db9 10043
3de95173 10044 spec = codec->spec;
2722b535
TI
10045 if (has_cdefine_beep(codec))
10046 spec->gen.beep_nid = 0x23;
1d045db9 10047
225068ab
TI
10048#ifdef CONFIG_PM
10049 spec->power_hook = alc_power_eapd;
10050#endif
10051
c9af753f
TI
10052 alc_pre_init(codec);
10053
1727a771
TI
10054 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10055 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 10056
cb4e4824
TI
10057 /* automatic parse from the BIOS config */
10058 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
10059 if (err < 0)
10060 goto error;
3af9ee6b 10061
fea80fae
TI
10062 if (!spec->gen.no_analog) {
10063 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10064 if (err < 0)
10065 goto error;
10066 }
7085ec12 10067
1727a771 10068 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10069
1d045db9 10070 return 0;
e16fb6d1
TI
10071
10072 error:
10073 alc_free(codec);
10074 return err;
7085ec12
TI
10075}
10076
1d045db9
TI
10077/*
10078 * ALC861-VD support
10079 *
10080 * Based on ALC882
10081 *
10082 * In addition, an independent DAC
10083 */
1d045db9 10084static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 10085{
1d045db9 10086 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10087 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10088 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
10089}
10090
1d045db9 10091enum {
8fdcb6fe
TI
10092 ALC660VD_FIX_ASUS_GPIO1,
10093 ALC861VD_FIX_DALLAS,
1d045db9 10094};
ce764ab2 10095
8fdcb6fe
TI
10096/* exclude VREF80 */
10097static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 10098 const struct hda_fixup *fix, int action)
8fdcb6fe 10099{
1727a771 10100 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
10101 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10102 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
10103 }
10104}
10105
df73d83f
TI
10106/* reset GPIO1 */
10107static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10108 const struct hda_fixup *fix, int action)
10109{
10110 struct alc_spec *spec = codec->spec;
10111
10112 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10113 spec->gpio_mask |= 0x02;
10114 alc_fixup_gpio(codec, action, 0x01);
10115}
10116
1727a771 10117static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 10118 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
10119 .type = HDA_FIXUP_FUNC,
10120 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 10121 },
8fdcb6fe 10122 [ALC861VD_FIX_DALLAS] = {
1727a771 10123 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
10124 .v.func = alc861vd_fixup_dallas,
10125 },
1d045db9 10126};
ce764ab2 10127
1d045db9 10128static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 10129 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 10130 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 10131 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
10132 {}
10133};
ce764ab2 10134
1d045db9
TI
10135/*
10136 */
1d045db9 10137static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 10138{
1d045db9 10139 struct alc_spec *spec;
cb4e4824 10140 int err;
ce764ab2 10141
3de95173
TI
10142 err = alc_alloc_spec(codec, 0x0b);
10143 if (err < 0)
10144 return err;
1d045db9 10145
3de95173 10146 spec = codec->spec;
2722b535
TI
10147 if (has_cdefine_beep(codec))
10148 spec->gen.beep_nid = 0x23;
1d045db9 10149
225068ab
TI
10150 spec->shutup = alc_eapd_shutup;
10151
c9af753f
TI
10152 alc_pre_init(codec);
10153
1727a771
TI
10154 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10155 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 10156
cb4e4824
TI
10157 /* automatic parse from the BIOS config */
10158 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
10159 if (err < 0)
10160 goto error;
ce764ab2 10161
fea80fae
TI
10162 if (!spec->gen.no_analog) {
10163 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10164 if (err < 0)
10165 goto error;
10166 }
1d045db9 10167
1727a771 10168 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10169
ce764ab2 10170 return 0;
e16fb6d1
TI
10171
10172 error:
10173 alc_free(codec);
10174 return err;
ce764ab2
TI
10175}
10176
1d045db9
TI
10177/*
10178 * ALC662 support
10179 *
10180 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10181 * configuration. Each pin widget can choose any input DACs and a mixer.
10182 * Each ADC is connected from a mixer of all inputs. This makes possible
10183 * 6-channel independent captures.
10184 *
10185 * In addition, an independent DAC for the multi-playback (not used in this
10186 * driver yet).
10187 */
1d045db9
TI
10188
10189/*
10190 * BIOS auto configuration
10191 */
10192
bc9f98a9
KY
10193static int alc662_parse_auto_config(struct hda_codec *codec)
10194{
4c6d72d1 10195 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10196 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10197 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10198 const hda_nid_t *ssids;
ee979a14 10199
7639a06c
TI
10200 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10201 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10202 codec->core.vendor_id == 0x10ec0671)
3e6179b8 10203 ssids = alc663_ssids;
6227cdce 10204 else
3e6179b8
TI
10205 ssids = alc662_ssids;
10206 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
10207}
10208
6be7948f 10209static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 10210 const struct hda_fixup *fix, int action)
6fc398cb 10211{
9bb1f06f 10212 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 10213 return;
6be7948f
TB
10214 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10215 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10216 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10217 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10218 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 10219 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
10220}
10221
8e383953
TI
10222static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10223 { .channels = 2,
10224 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10225 { .channels = 4,
10226 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10227 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10228 { }
10229};
10230
10231/* override the 2.1 chmap */
eb9ca3ab 10232static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
10233 const struct hda_fixup *fix, int action)
10234{
10235 if (action == HDA_FIXUP_ACT_BUILD) {
10236 struct alc_spec *spec = codec->spec;
bbbc7e85 10237 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
10238 }
10239}
10240
bf68665d
TI
10241/* avoid D3 for keeping GPIO up */
10242static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10243 hda_nid_t nid,
10244 unsigned int power_state)
10245{
10246 struct alc_spec *spec = codec->spec;
d261eec8 10247 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
10248 return AC_PWRST_D0;
10249 return power_state;
10250}
10251
3e887f37
TI
10252static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10253 const struct hda_fixup *fix, int action)
10254{
10255 struct alc_spec *spec = codec->spec;
3e887f37 10256
01e4a275 10257 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 10258 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 10259 spec->mute_led_polarity = 1;
bf68665d 10260 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
10261 }
10262}
10263
c6790c8e
KY
10264static void alc662_usi_automute_hook(struct hda_codec *codec,
10265 struct hda_jack_callback *jack)
10266{
10267 struct alc_spec *spec = codec->spec;
10268 int vref;
10269 msleep(200);
10270 snd_hda_gen_hp_automute(codec, jack);
10271
10272 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10273 msleep(100);
10274 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10275 vref);
10276}
10277
10278static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10279 const struct hda_fixup *fix, int action)
10280{
10281 struct alc_spec *spec = codec->spec;
10282 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10283 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10284 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10285 }
10286}
10287
00066e97
SB
10288static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10289 struct hda_jack_callback *cb)
10290{
10291 /* surround speakers at 0x1b already get muted automatically when
10292 * headphones are plugged in, but we have to mute/unmute the remaining
10293 * channels manually:
10294 * 0x15 - front left/front right
10295 * 0x18 - front center/ LFE
10296 */
10297 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10298 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10299 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10300 } else {
10301 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10302 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10303 }
10304}
10305
10306static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10307 const struct hda_fixup *fix, int action)
10308{
10309 /* Pin 0x1b: shared headphones jack and surround speakers */
10310 if (!is_jack_detectable(codec, 0x1b))
10311 return;
10312
10313 switch (action) {
10314 case HDA_FIXUP_ACT_PRE_PROBE:
10315 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10316 alc662_aspire_ethos_mute_speakers);
336820c4
TI
10317 /* subwoofer needs an extra GPIO setting to become audible */
10318 alc_setup_gpio(codec, 0x02);
00066e97
SB
10319 break;
10320 case HDA_FIXUP_ACT_INIT:
10321 /* Make sure to start in a correct state, i.e. if
10322 * headphones have been plugged in before powering up the system
10323 */
10324 alc662_aspire_ethos_mute_speakers(codec, NULL);
10325 break;
10326 }
10327}
10328
5af29028
KY
10329static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10330 const struct hda_fixup *fix, int action)
10331{
10332 struct alc_spec *spec = codec->spec;
10333
10334 static const struct hda_pintbl pincfgs[] = {
10335 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10336 { 0x1b, 0x0181304f },
10337 { }
10338 };
10339
10340 switch (action) {
10341 case HDA_FIXUP_ACT_PRE_PROBE:
10342 spec->gen.mixer_nid = 0;
10343 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10344 snd_hda_apply_pincfgs(codec, pincfgs);
10345 break;
10346 case HDA_FIXUP_ACT_INIT:
10347 alc_write_coef_idx(codec, 0x19, 0xa054);
10348 break;
10349 }
10350}
10351
09ad269c
KY
10352static void alc897_hp_automute_hook(struct hda_codec *codec,
10353 struct hda_jack_callback *jack)
10354{
10355 struct alc_spec *spec = codec->spec;
10356 int vref;
10357
10358 snd_hda_gen_hp_automute(codec, jack);
10359 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10360 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10361 vref);
10362}
10363
10364static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10365 const struct hda_fixup *fix, int action)
10366{
10367 struct alc_spec *spec = codec->spec;
10368 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10369 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10370 }
10371}
10372
6b0f95c4 10373static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
10374 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10375 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10376 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10377 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10378 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10379 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10380 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10381 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10382 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10383 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10384 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10385 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10386 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10387 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10388 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10389 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10390 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10391 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10392 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10393 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10394 {}
10395};
10396
10397static void alc668_restore_default_value(struct hda_codec *codec)
10398{
10399 alc_process_coef_fw(codec, alc668_coefs);
10400}
10401
6cb3b707 10402enum {
2df03514 10403 ALC662_FIXUP_ASPIRE,
3e887f37 10404 ALC662_FIXUP_LED_GPIO1,
6cb3b707 10405 ALC662_FIXUP_IDEAPAD,
6be7948f 10406 ALC272_FIXUP_MARIO,
f1ec5be1 10407 ALC662_FIXUP_CZC_ET26,
d2ebd479 10408 ALC662_FIXUP_CZC_P10T,
94024cd1 10409 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 10410 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
10411 ALC662_FIXUP_ASUS_MODE1,
10412 ALC662_FIXUP_ASUS_MODE2,
10413 ALC662_FIXUP_ASUS_MODE3,
10414 ALC662_FIXUP_ASUS_MODE4,
10415 ALC662_FIXUP_ASUS_MODE5,
10416 ALC662_FIXUP_ASUS_MODE6,
10417 ALC662_FIXUP_ASUS_MODE7,
10418 ALC662_FIXUP_ASUS_MODE8,
1565cc35 10419 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 10420 ALC662_FIXUP_ZOTAC_Z68,
125821ae 10421 ALC662_FIXUP_INV_DMIC,
1f8b46cd 10422 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 10423 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 10424 ALC662_FIXUP_HEADSET_MODE,
73bdd597 10425 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 10426 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 10427 ALC662_FIXUP_BASS_16,
a30c9aaa 10428 ALC662_FIXUP_BASS_1A,
8e54b4ac 10429 ALC662_FIXUP_BASS_CHMAP,
493a52a9 10430 ALC668_FIXUP_AUTO_MUTE,
5e6db669 10431 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 10432 ALC668_FIXUP_DELL_XPS13,
9d4dc584 10433 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 10434 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 10435 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 10436 ALC668_FIXUP_MIC_COEF,
11ba6111 10437 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
10438 ALC891_FIXUP_HEADSET_MODE,
10439 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 10440 ALC662_FIXUP_ACER_VERITON,
1a3f0991 10441 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
10442 ALC662_FIXUP_USI_FUNC,
10443 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 10444 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 10445 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 10446 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 10447 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 10448 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 10449 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
10450 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10451 ALC668_FIXUP_HEADSET_MIC,
10452 ALC668_FIXUP_MIC_DET_COEF,
09ad269c
KY
10453 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10454 ALC897_FIXUP_HEADSET_MIC_PIN,
6cb3b707
DH
10455};
10456
1727a771 10457static const struct hda_fixup alc662_fixups[] = {
2df03514 10458 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
10459 .type = HDA_FIXUP_PINS,
10460 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
10461 { 0x15, 0x99130112 }, /* subwoofer */
10462 { }
10463 }
10464 },
3e887f37
TI
10465 [ALC662_FIXUP_LED_GPIO1] = {
10466 .type = HDA_FIXUP_FUNC,
10467 .v.func = alc662_fixup_led_gpio1,
10468 },
6cb3b707 10469 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
10470 .type = HDA_FIXUP_PINS,
10471 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
10472 { 0x17, 0x99130112 }, /* subwoofer */
10473 { }
3e887f37
TI
10474 },
10475 .chained = true,
10476 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 10477 },
6be7948f 10478 [ALC272_FIXUP_MARIO] = {
1727a771 10479 .type = HDA_FIXUP_FUNC,
b5bfbc67 10480 .v.func = alc272_fixup_mario,
d2ebd479 10481 },
f1ec5be1
HC
10482 [ALC662_FIXUP_CZC_ET26] = {
10483 .type = HDA_FIXUP_PINS,
10484 .v.pins = (const struct hda_pintbl[]) {
10485 {0x12, 0x403cc000},
10486 {0x14, 0x90170110}, /* speaker */
10487 {0x15, 0x411111f0},
10488 {0x16, 0x411111f0},
10489 {0x18, 0x01a19030}, /* mic */
10490 {0x19, 0x90a7013f}, /* int-mic */
10491 {0x1a, 0x01014020},
10492 {0x1b, 0x0121401f},
10493 {0x1c, 0x411111f0},
10494 {0x1d, 0x411111f0},
10495 {0x1e, 0x40478e35},
10496 {}
10497 },
10498 .chained = true,
10499 .chain_id = ALC662_FIXUP_SKU_IGNORE
10500 },
d2ebd479 10501 [ALC662_FIXUP_CZC_P10T] = {
1727a771 10502 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
10503 .v.verbs = (const struct hda_verb[]) {
10504 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10505 {}
10506 }
10507 },
94024cd1 10508 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 10509 .type = HDA_FIXUP_FUNC,
23d30f28 10510 .v.func = alc_fixup_sku_ignore,
c6b35874 10511 },
e59ea3ed 10512 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
10513 .type = HDA_FIXUP_PINS,
10514 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
10515 { 0x14, 0x0221201f }, /* HP out */
10516 { }
10517 },
10518 .chained = true,
10519 .chain_id = ALC662_FIXUP_SKU_IGNORE
10520 },
53c334ad 10521 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
10522 .type = HDA_FIXUP_PINS,
10523 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10524 { 0x14, 0x99130110 }, /* speaker */
10525 { 0x18, 0x01a19c20 }, /* mic */
10526 { 0x19, 0x99a3092f }, /* int-mic */
10527 { 0x21, 0x0121401f }, /* HP out */
10528 { }
10529 },
10530 .chained = true,
10531 .chain_id = ALC662_FIXUP_SKU_IGNORE
10532 },
10533 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
10534 .type = HDA_FIXUP_PINS,
10535 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
10536 { 0x14, 0x99130110 }, /* speaker */
10537 { 0x18, 0x01a19820 }, /* mic */
10538 { 0x19, 0x99a3092f }, /* int-mic */
10539 { 0x1b, 0x0121401f }, /* HP out */
10540 { }
10541 },
53c334ad
TI
10542 .chained = true,
10543 .chain_id = ALC662_FIXUP_SKU_IGNORE
10544 },
10545 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
10546 .type = HDA_FIXUP_PINS,
10547 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10548 { 0x14, 0x99130110 }, /* speaker */
10549 { 0x15, 0x0121441f }, /* HP */
10550 { 0x18, 0x01a19840 }, /* mic */
10551 { 0x19, 0x99a3094f }, /* int-mic */
10552 { 0x21, 0x01211420 }, /* HP2 */
10553 { }
10554 },
10555 .chained = true,
10556 .chain_id = ALC662_FIXUP_SKU_IGNORE
10557 },
10558 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
10559 .type = HDA_FIXUP_PINS,
10560 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10561 { 0x14, 0x99130110 }, /* speaker */
10562 { 0x16, 0x99130111 }, /* speaker */
10563 { 0x18, 0x01a19840 }, /* mic */
10564 { 0x19, 0x99a3094f }, /* int-mic */
10565 { 0x21, 0x0121441f }, /* HP */
10566 { }
10567 },
10568 .chained = true,
10569 .chain_id = ALC662_FIXUP_SKU_IGNORE
10570 },
10571 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
10572 .type = HDA_FIXUP_PINS,
10573 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10574 { 0x14, 0x99130110 }, /* speaker */
10575 { 0x15, 0x0121441f }, /* HP */
10576 { 0x16, 0x99130111 }, /* speaker */
10577 { 0x18, 0x01a19840 }, /* mic */
10578 { 0x19, 0x99a3094f }, /* int-mic */
10579 { }
10580 },
10581 .chained = true,
10582 .chain_id = ALC662_FIXUP_SKU_IGNORE
10583 },
10584 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
10585 .type = HDA_FIXUP_PINS,
10586 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10587 { 0x14, 0x99130110 }, /* speaker */
10588 { 0x15, 0x01211420 }, /* HP2 */
10589 { 0x18, 0x01a19840 }, /* mic */
10590 { 0x19, 0x99a3094f }, /* int-mic */
10591 { 0x1b, 0x0121441f }, /* HP */
10592 { }
10593 },
10594 .chained = true,
10595 .chain_id = ALC662_FIXUP_SKU_IGNORE
10596 },
10597 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
10598 .type = HDA_FIXUP_PINS,
10599 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10600 { 0x14, 0x99130110 }, /* speaker */
10601 { 0x17, 0x99130111 }, /* speaker */
10602 { 0x18, 0x01a19840 }, /* mic */
10603 { 0x19, 0x99a3094f }, /* int-mic */
10604 { 0x1b, 0x01214020 }, /* HP */
10605 { 0x21, 0x0121401f }, /* HP */
10606 { }
10607 },
10608 .chained = true,
10609 .chain_id = ALC662_FIXUP_SKU_IGNORE
10610 },
10611 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
10612 .type = HDA_FIXUP_PINS,
10613 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10614 { 0x14, 0x99130110 }, /* speaker */
10615 { 0x12, 0x99a30970 }, /* int-mic */
10616 { 0x15, 0x01214020 }, /* HP */
10617 { 0x17, 0x99130111 }, /* speaker */
10618 { 0x18, 0x01a19840 }, /* mic */
10619 { 0x21, 0x0121401f }, /* HP */
10620 { }
10621 },
10622 .chained = true,
10623 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 10624 },
1565cc35 10625 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 10626 .type = HDA_FIXUP_FUNC,
1565cc35
TI
10627 .v.func = alc_fixup_no_jack_detect,
10628 },
edfe3bfc 10629 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
10630 .type = HDA_FIXUP_PINS,
10631 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
10632 { 0x1b, 0x02214020 }, /* Front HP */
10633 { }
10634 }
10635 },
125821ae 10636 [ALC662_FIXUP_INV_DMIC] = {
1727a771 10637 .type = HDA_FIXUP_FUNC,
9d36a7dc 10638 .v.func = alc_fixup_inv_dmic,
125821ae 10639 },
033b0a7c
GM
10640 [ALC668_FIXUP_DELL_XPS13] = {
10641 .type = HDA_FIXUP_FUNC,
10642 .v.func = alc_fixup_dell_xps13,
10643 .chained = true,
10644 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10645 },
5e6db669
GM
10646 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10647 .type = HDA_FIXUP_FUNC,
10648 .v.func = alc_fixup_disable_aamix,
10649 .chained = true,
10650 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10651 },
493a52a9
HW
10652 [ALC668_FIXUP_AUTO_MUTE] = {
10653 .type = HDA_FIXUP_FUNC,
10654 .v.func = alc_fixup_auto_mute_via_amp,
10655 .chained = true,
10656 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10657 },
1f8b46cd
DH
10658 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10659 .type = HDA_FIXUP_PINS,
10660 .v.pins = (const struct hda_pintbl[]) {
10661 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10662 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10663 { }
10664 },
10665 .chained = true,
10666 .chain_id = ALC662_FIXUP_HEADSET_MODE
10667 },
10668 [ALC662_FIXUP_HEADSET_MODE] = {
10669 .type = HDA_FIXUP_FUNC,
10670 .v.func = alc_fixup_headset_mode_alc662,
10671 },
73bdd597
DH
10672 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10673 .type = HDA_FIXUP_PINS,
10674 .v.pins = (const struct hda_pintbl[]) {
10675 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10676 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10677 { }
10678 },
10679 .chained = true,
10680 .chain_id = ALC668_FIXUP_HEADSET_MODE
10681 },
10682 [ALC668_FIXUP_HEADSET_MODE] = {
10683 .type = HDA_FIXUP_FUNC,
10684 .v.func = alc_fixup_headset_mode_alc668,
10685 },
8e54b4ac 10686 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 10687 .type = HDA_FIXUP_FUNC,
eb9ca3ab 10688 .v.func = alc_fixup_bass_chmap,
8e383953
TI
10689 .chained = true,
10690 .chain_id = ALC662_FIXUP_ASUS_MODE4
10691 },
61a75f13
DH
10692 [ALC662_FIXUP_BASS_16] = {
10693 .type = HDA_FIXUP_PINS,
10694 .v.pins = (const struct hda_pintbl[]) {
10695 {0x16, 0x80106111}, /* bass speaker */
10696 {}
10697 },
10698 .chained = true,
10699 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10700 },
a30c9aaa
TI
10701 [ALC662_FIXUP_BASS_1A] = {
10702 .type = HDA_FIXUP_PINS,
10703 .v.pins = (const struct hda_pintbl[]) {
10704 {0x1a, 0x80106111}, /* bass speaker */
10705 {}
10706 },
8e54b4ac
DH
10707 .chained = true,
10708 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 10709 },
8e54b4ac 10710 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 10711 .type = HDA_FIXUP_FUNC,
eb9ca3ab 10712 .v.func = alc_fixup_bass_chmap,
a30c9aaa 10713 },
9d4dc584
BM
10714 [ALC662_FIXUP_ASUS_Nx50] = {
10715 .type = HDA_FIXUP_FUNC,
10716 .v.func = alc_fixup_auto_mute_via_amp,
10717 .chained = true,
10718 .chain_id = ALC662_FIXUP_BASS_1A
10719 },
fc7438b1
MP
10720 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10721 .type = HDA_FIXUP_FUNC,
10722 .v.func = alc_fixup_headset_mode_alc668,
10723 .chain_id = ALC662_FIXUP_BASS_CHMAP
10724 },
3231e205
YP
10725 [ALC668_FIXUP_ASUS_Nx51] = {
10726 .type = HDA_FIXUP_PINS,
10727 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
10728 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10729 { 0x1a, 0x90170151 }, /* bass speaker */
10730 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
10731 {}
10732 },
10733 .chained = true,
fc7438b1 10734 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 10735 },
5b7c5e1f 10736 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
10737 .type = HDA_FIXUP_VERBS,
10738 .v.verbs = (const struct hda_verb[]) {
10739 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10740 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10741 {}
10742 },
10743 },
5b7c5e1f
TI
10744 [ALC668_FIXUP_ASUS_G751] = {
10745 .type = HDA_FIXUP_PINS,
10746 .v.pins = (const struct hda_pintbl[]) {
10747 { 0x16, 0x0421101f }, /* HP */
10748 {}
10749 },
10750 .chained = true,
10751 .chain_id = ALC668_FIXUP_MIC_COEF
10752 },
78f4f7c2
KY
10753 [ALC891_FIXUP_HEADSET_MODE] = {
10754 .type = HDA_FIXUP_FUNC,
10755 .v.func = alc_fixup_headset_mode,
10756 },
10757 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10758 .type = HDA_FIXUP_PINS,
10759 .v.pins = (const struct hda_pintbl[]) {
10760 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10761 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10762 { }
10763 },
10764 .chained = true,
10765 .chain_id = ALC891_FIXUP_HEADSET_MODE
10766 },
9b51fe3e
SB
10767 [ALC662_FIXUP_ACER_VERITON] = {
10768 .type = HDA_FIXUP_PINS,
10769 .v.pins = (const struct hda_pintbl[]) {
10770 { 0x15, 0x50170120 }, /* no internal speaker */
10771 { }
10772 }
10773 },
1a3f0991
TI
10774 [ALC892_FIXUP_ASROCK_MOBO] = {
10775 .type = HDA_FIXUP_PINS,
10776 .v.pins = (const struct hda_pintbl[]) {
10777 { 0x15, 0x40f000f0 }, /* disabled */
10778 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
10779 { }
10780 }
10781 },
c6790c8e
KY
10782 [ALC662_FIXUP_USI_FUNC] = {
10783 .type = HDA_FIXUP_FUNC,
10784 .v.func = alc662_fixup_usi_headset_mic,
10785 },
10786 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10787 .type = HDA_FIXUP_PINS,
10788 .v.pins = (const struct hda_pintbl[]) {
10789 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10790 { 0x18, 0x01a1903d },
10791 { }
10792 },
10793 .chained = true,
10794 .chain_id = ALC662_FIXUP_USI_FUNC
10795 },
ca169cc2
KY
10796 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10797 .type = HDA_FIXUP_FUNC,
10798 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10799 },
00066e97
SB
10800 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10801 .type = HDA_FIXUP_FUNC,
10802 .v.func = alc662_fixup_aspire_ethos_hp,
10803 },
00066e97
SB
10804 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10805 .type = HDA_FIXUP_PINS,
10806 .v.pins = (const struct hda_pintbl[]) {
10807 { 0x15, 0x92130110 }, /* front speakers */
10808 { 0x18, 0x99130111 }, /* center/subwoofer */
10809 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10810 { }
10811 },
10812 .chained = true,
336820c4 10813 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 10814 },
5af29028
KY
10815 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10816 .type = HDA_FIXUP_FUNC,
10817 .v.func = alc671_fixup_hp_headset_mic2,
10818 },
d858c706
JHP
10819 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10820 .type = HDA_FIXUP_PINS,
10821 .v.pins = (const struct hda_pintbl[]) {
10822 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10823 { }
10824 },
10825 .chained = true,
10826 .chain_id = ALC662_FIXUP_USI_FUNC
10827 },
a124458a
JHP
10828 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10829 .type = HDA_FIXUP_PINS,
10830 .v.pins = (const struct hda_pintbl[]) {
10831 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10832 { 0x1b, 0x0221144f },
10833 { }
10834 },
10835 .chained = true,
10836 .chain_id = ALC662_FIXUP_USI_FUNC
10837 },
a3fd1a98
HW
10838 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
10839 .type = HDA_FIXUP_PINS,
10840 .v.pins = (const struct hda_pintbl[]) {
10841 { 0x1b, 0x04a1112c },
10842 { }
10843 },
10844 .chained = true,
10845 .chain_id = ALC668_FIXUP_HEADSET_MIC
10846 },
10847 [ALC668_FIXUP_HEADSET_MIC] = {
10848 .type = HDA_FIXUP_FUNC,
10849 .v.func = alc269_fixup_headset_mic,
10850 .chained = true,
10851 .chain_id = ALC668_FIXUP_MIC_DET_COEF
10852 },
10853 [ALC668_FIXUP_MIC_DET_COEF] = {
10854 .type = HDA_FIXUP_VERBS,
10855 .v.verbs = (const struct hda_verb[]) {
10856 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
10857 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
10858 {}
10859 },
10860 },
09ad269c
KY
10861 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
10862 .type = HDA_FIXUP_FUNC,
10863 .v.func = alc897_fixup_lenovo_headset_mic,
10864 },
10865 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
10866 .type = HDA_FIXUP_PINS,
10867 .v.pins = (const struct hda_pintbl[]) {
10868 { 0x1a, 0x03a11050 },
10869 { }
10870 },
10871 .chained = true,
10872 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
10873 },
6cb3b707
DH
10874};
10875
a9111321 10876static const struct snd_pci_quirk alc662_fixup_tbl[] = {
53c334ad 10877 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
d3d3835c 10878 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 10879 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 10880 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 10881 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 10882 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 10883 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 10884 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 10885 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 10886 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 10887 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
10888 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10889 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 10890 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 10891 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 10892 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 10893 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 10894 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
10895 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10896 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 10897 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 10898 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
148ebf54 10899 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 10900 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 10901 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 10902 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 10903 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 10904 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 10905 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 10906 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
10907 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
10908 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 10909 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 10910 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 10911 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 10912 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 10913 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 10914 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 10915 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 10916 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 10917 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
09ad269c
KY
10918 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
10919 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
10920 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
10921 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
d4118588 10922 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 10923 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 10924 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 10925 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 10926 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 10927 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 10928 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
53c334ad
TI
10929
10930#if 0
10931 /* Below is a quirk table taken from the old code.
10932 * Basically the device should work as is without the fixup table.
10933 * If BIOS doesn't give a proper info, enable the corresponding
10934 * fixup entry.
7d7eb9ea 10935 */
53c334ad
TI
10936 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
10937 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
10938 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
10939 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
10940 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10941 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10942 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10943 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
10944 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
10945 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10946 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
10947 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
10948 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
10949 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
10950 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
10951 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10952 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
10953 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
10954 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10955 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10956 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10957 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10958 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
10959 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
10960 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
10961 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10962 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
10963 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10964 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10965 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
10966 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10967 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10968 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
10969 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
10970 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
10971 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
10972 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
10973 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
10974 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
10975 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10976 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
10977 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
10978 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10979 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
10980 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
10981 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
10982 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
10983 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
10984 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10985 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
10986#endif
6cb3b707
DH
10987 {}
10988};
10989
1727a771 10990static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
10991 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
10992 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 10993 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 10994 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
10995 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
10996 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
10997 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
10998 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
10999 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11000 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11001 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11002 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 11003 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 11004 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 11005 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 11006 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
11007 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11008 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11009 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11010 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11011 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11012 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11013 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11014 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 11015 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
11016 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11017 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11018 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11019 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11020 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 11021 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 11022 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
6be7948f
TB
11023 {}
11024};
6cb3b707 11025
532895c5 11026static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
11027 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11028 {0x17, 0x02211010},
11029 {0x18, 0x01a19030},
11030 {0x1a, 0x01813040},
11031 {0x21, 0x01014020}),
4b4e0e32
HW
11032 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11033 {0x16, 0x01813030},
11034 {0x17, 0x02211010},
11035 {0x18, 0x01a19040},
11036 {0x21, 0x01014020}),
1f8b46cd 11037 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11038 {0x14, 0x01014010},
1f8b46cd 11039 {0x18, 0x01a19020},
1f8b46cd 11040 {0x1a, 0x0181302f},
11580297 11041 {0x1b, 0x0221401f}),
76c2132e
DH
11042 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11043 {0x12, 0x99a30130},
11044 {0x14, 0x90170110},
11045 {0x15, 0x0321101f},
11580297 11046 {0x16, 0x03011020}),
76c2132e
DH
11047 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11048 {0x12, 0x99a30140},
11049 {0x14, 0x90170110},
11050 {0x15, 0x0321101f},
11580297 11051 {0x16, 0x03011020}),
76c2132e
DH
11052 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11053 {0x12, 0x99a30150},
11054 {0x14, 0x90170110},
11055 {0x15, 0x0321101f},
11580297 11056 {0x16, 0x03011020}),
76c2132e 11057 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
11058 {0x14, 0x90170110},
11059 {0x15, 0x0321101f},
11580297 11060 {0x16, 0x03011020}),
76c2132e
DH
11061 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11062 {0x12, 0x90a60130},
11063 {0x14, 0x90170110},
11580297 11064 {0x15, 0x0321101f}),
5af29028
KY
11065 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11066 {0x14, 0x01014010},
11067 {0x17, 0x90170150},
f2adbae0 11068 {0x19, 0x02a11060},
5af29028
KY
11069 {0x1b, 0x01813030},
11070 {0x21, 0x02211020}),
11071 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11072 {0x14, 0x01014010},
11073 {0x18, 0x01a19040},
11074 {0x1b, 0x01813030},
11075 {0x21, 0x02211020}),
11076 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11077 {0x14, 0x01014020},
11078 {0x17, 0x90170110},
11079 {0x18, 0x01a19050},
11080 {0x1b, 0x01813040},
11081 {0x21, 0x02211030}),
532895c5
HW
11082 {}
11083};
11084
1d045db9
TI
11085/*
11086 */
bc9f98a9
KY
11087static int patch_alc662(struct hda_codec *codec)
11088{
11089 struct alc_spec *spec;
3de95173 11090 int err;
bc9f98a9 11091
3de95173
TI
11092 err = alc_alloc_spec(codec, 0x0b);
11093 if (err < 0)
11094 return err;
bc9f98a9 11095
3de95173 11096 spec = codec->spec;
1f0f4b80 11097
225068ab
TI
11098 spec->shutup = alc_eapd_shutup;
11099
53c334ad
TI
11100 /* handle multiple HPs as is */
11101 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11102
2c3bf9ab
TI
11103 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11104
7639a06c 11105 switch (codec->core.vendor_id) {
f3f9185f
KY
11106 case 0x10ec0668:
11107 spec->init_hook = alc668_restore_default_value;
11108 break;
f3f9185f 11109 }
8663ff75 11110
c9af753f
TI
11111 alc_pre_init(codec);
11112
1727a771 11113 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 11114 alc662_fixup_tbl, alc662_fixups);
0fc1e447 11115 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 11116 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
11117
11118 alc_auto_parse_customize_define(codec);
11119
7504b6cd
TI
11120 if (has_cdefine_beep(codec))
11121 spec->gen.beep_nid = 0x01;
11122
1bb7e43e 11123 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 11124 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 11125 spec->cdefine.platform_type == 1) {
6134b1a2
WY
11126 err = alc_codec_rename(codec, "ALC272X");
11127 if (err < 0)
e16fb6d1 11128 goto error;
20ca0c35 11129 }
274693f3 11130
b9c5106c
TI
11131 /* automatic parse from the BIOS config */
11132 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
11133 if (err < 0)
11134 goto error;
bc9f98a9 11135
7504b6cd 11136 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 11137 switch (codec->core.vendor_id) {
da00c244 11138 case 0x10ec0662:
fea80fae 11139 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
11140 break;
11141 case 0x10ec0272:
11142 case 0x10ec0663:
11143 case 0x10ec0665:
9ad54547 11144 case 0x10ec0668:
fea80fae 11145 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
11146 break;
11147 case 0x10ec0273:
fea80fae 11148 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
11149 break;
11150 }
fea80fae
TI
11151 if (err < 0)
11152 goto error;
cec27c89 11153 }
2134ea4f 11154
1727a771 11155 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11156
bc9f98a9 11157 return 0;
801f49d3 11158
e16fb6d1
TI
11159 error:
11160 alc_free(codec);
11161 return err;
b478b998
KY
11162}
11163
d1eb57f4
KY
11164/*
11165 * ALC680 support
11166 */
d1eb57f4 11167
d1eb57f4
KY
11168static int alc680_parse_auto_config(struct hda_codec *codec)
11169{
3e6179b8 11170 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
11171}
11172
d1eb57f4 11173/*
d1eb57f4 11174 */
d1eb57f4
KY
11175static int patch_alc680(struct hda_codec *codec)
11176{
d1eb57f4
KY
11177 int err;
11178
1f0f4b80 11179 /* ALC680 has no aa-loopback mixer */
3de95173
TI
11180 err = alc_alloc_spec(codec, 0);
11181 if (err < 0)
11182 return err;
1f0f4b80 11183
1ebec5f2
TI
11184 /* automatic parse from the BIOS config */
11185 err = alc680_parse_auto_config(codec);
11186 if (err < 0) {
11187 alc_free(codec);
11188 return err;
d1eb57f4
KY
11189 }
11190
d1eb57f4
KY
11191 return 0;
11192}
11193
1da177e4
LT
11194/*
11195 * patch entries
11196 */
b9a94a9c 11197static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 11198 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 11199 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 11200 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 11201 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 11202 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
11203 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11204 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 11205 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 11206 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 11207 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 11208 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
11209 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11210 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 11211 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
11212 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11213 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11214 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11215 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11216 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11217 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11218 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 11219 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
11220 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11221 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11222 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11223 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11224 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11225 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 11226 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 11227 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 11228 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 11229 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 11230 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
11231 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11232 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11233 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 11234 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 11235 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 11236 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 11237 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 11238 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 11239 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
11240 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11241 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11242 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11243 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11244 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11245 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11246 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11247 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11248 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11249 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11250 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11251 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11252 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11253 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
11254 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11255 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11256 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 11257 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 11258 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
11259 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11260 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11261 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11262 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11263 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11264 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11265 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11266 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11267 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11268 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11269 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 11270 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
11271 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11272 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 11273 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 11274 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 11275 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
1da177e4
LT
11276 {} /* terminator */
11277};
b9a94a9c 11278MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
11279
11280MODULE_LICENSE("GPL");
11281MODULE_DESCRIPTION("Realtek HD-audio codec");
11282
d8a766a1 11283static struct hda_codec_driver realtek_driver = {
b9a94a9c 11284 .id = snd_hda_id_realtek,
1289e9e8
TI
11285};
11286
d8a766a1 11287module_hda_codec_driver(realtek_driver);