]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - sound/pci/hda/patch_realtek.c
media: atomisp: fix bad usage at error handling logic
[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
514fb532
TI
136static void coef_mutex_lock(struct hda_codec *codec)
137{
138 struct alc_spec *spec = codec->spec;
139
140 snd_hda_power_up_pm(codec);
141 mutex_lock(&spec->coef_mutex);
142}
143
144static void coef_mutex_unlock(struct hda_codec *codec)
145{
146 struct alc_spec *spec = codec->spec;
147
148 mutex_unlock(&spec->coef_mutex);
149 snd_hda_power_down_pm(codec);
150}
151
1b35106e
TI
152static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
153 unsigned int coef_idx)
f2a227cd
TI
154{
155 unsigned int val;
156
157 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
158 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
159 return val;
160}
161
1b35106e
TI
162static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
163 unsigned int coef_idx)
164{
1b35106e
TI
165 unsigned int val;
166
514fb532 167 coef_mutex_lock(codec);
1b35106e 168 val = __alc_read_coefex_idx(codec, nid, coef_idx);
514fb532 169 coef_mutex_unlock(codec);
1b35106e
TI
170 return val;
171}
172
f2a227cd
TI
173#define alc_read_coef_idx(codec, coef_idx) \
174 alc_read_coefex_idx(codec, 0x20, coef_idx)
175
1b35106e
TI
176static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
177 unsigned int coef_idx, unsigned int coef_val)
f2a227cd
TI
178{
179 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
180 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
181}
182
1b35106e
TI
183static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
184 unsigned int coef_idx, unsigned int coef_val)
185{
514fb532 186 coef_mutex_lock(codec);
1b35106e 187 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
514fb532 188 coef_mutex_unlock(codec);
1b35106e
TI
189}
190
f2a227cd
TI
191#define alc_write_coef_idx(codec, coef_idx, coef_val) \
192 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
193
1b35106e
TI
194static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
195 unsigned int coef_idx, unsigned int mask,
196 unsigned int bits_set)
197{
198 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
199
200 if (val != -1)
201 __alc_write_coefex_idx(codec, nid, coef_idx,
202 (val & ~mask) | bits_set);
203}
204
98b24883
TI
205static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
206 unsigned int coef_idx, unsigned int mask,
207 unsigned int bits_set)
208{
514fb532 209 coef_mutex_lock(codec);
1b35106e 210 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
514fb532 211 coef_mutex_unlock(codec);
98b24883
TI
212}
213
214#define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
215 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
216
f2a227cd
TI
217/* a special bypass for COEF 0; read the cached value at the second time */
218static unsigned int alc_get_coef0(struct hda_codec *codec)
219{
220 struct alc_spec *spec = codec->spec;
221
222 if (!spec->coef0)
223 spec->coef0 = alc_read_coef_idx(codec, 0);
224 return spec->coef0;
225}
226
54db6c39
TI
227/* coef writes/updates batch */
228struct coef_fw {
229 unsigned char nid;
230 unsigned char idx;
231 unsigned short mask;
232 unsigned short val;
233};
234
235#define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
236 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
237#define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
238#define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
239#define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
240
241static void alc_process_coef_fw(struct hda_codec *codec,
242 const struct coef_fw *fw)
243{
514fb532 244 coef_mutex_lock(codec);
54db6c39
TI
245 for (; fw->nid; fw++) {
246 if (fw->mask == (unsigned short)-1)
1b35106e 247 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
54db6c39 248 else
1b35106e
TI
249 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
250 fw->mask, fw->val);
54db6c39 251 }
514fb532 252 coef_mutex_unlock(codec);
54db6c39
TI
253}
254
df694daa 255/*
1d045db9 256 * GPIO setup tables, used in initialization
df694daa 257 */
5579cd6f 258
bc9f98a9 259/* Enable GPIO mask and set output */
5579cd6f
TI
260static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
261{
262 struct alc_spec *spec = codec->spec;
bc9f98a9 263
5579cd6f
TI
264 spec->gpio_mask |= mask;
265 spec->gpio_dir |= mask;
266 spec->gpio_data |= mask;
267}
bc9f98a9 268
5579cd6f
TI
269static void alc_write_gpio_data(struct hda_codec *codec)
270{
271 struct alc_spec *spec = codec->spec;
272
273 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
274 spec->gpio_data);
275}
276
aaf312de
TI
277static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
278 bool on)
279{
280 struct alc_spec *spec = codec->spec;
281 unsigned int oldval = spec->gpio_data;
282
283 if (on)
284 spec->gpio_data |= mask;
285 else
286 spec->gpio_data &= ~mask;
287 if (oldval != spec->gpio_data)
288 alc_write_gpio_data(codec);
289}
290
5579cd6f
TI
291static void alc_write_gpio(struct hda_codec *codec)
292{
293 struct alc_spec *spec = codec->spec;
294
295 if (!spec->gpio_mask)
296 return;
297
298 snd_hda_codec_write(codec, codec->core.afg, 0,
299 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
300 snd_hda_codec_write(codec, codec->core.afg, 0,
301 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
215c850c
TI
302 if (spec->gpio_write_delay)
303 msleep(1);
5579cd6f
TI
304 alc_write_gpio_data(codec);
305}
306
307static void alc_fixup_gpio(struct hda_codec *codec, int action,
308 unsigned int mask)
309{
310 if (action == HDA_FIXUP_ACT_PRE_PROBE)
311 alc_setup_gpio(codec, mask);
312}
313
314static void alc_fixup_gpio1(struct hda_codec *codec,
315 const struct hda_fixup *fix, int action)
316{
317 alc_fixup_gpio(codec, action, 0x01);
318}
319
320static void alc_fixup_gpio2(struct hda_codec *codec,
321 const struct hda_fixup *fix, int action)
322{
323 alc_fixup_gpio(codec, action, 0x02);
324}
325
326static void alc_fixup_gpio3(struct hda_codec *codec,
327 const struct hda_fixup *fix, int action)
328{
329 alc_fixup_gpio(codec, action, 0x03);
330}
bdd148a3 331
ae065f1c
TI
332static void alc_fixup_gpio4(struct hda_codec *codec,
333 const struct hda_fixup *fix, int action)
334{
335 alc_fixup_gpio(codec, action, 0x04);
336}
337
8a503555
TI
338static void alc_fixup_micmute_led(struct hda_codec *codec,
339 const struct hda_fixup *fix, int action)
340{
e65bf997 341 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8a503555
TI
342 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
343}
344
2c3bf9ab
TI
345/*
346 * Fix hardware PLL issue
347 * On some codecs, the analog PLL gating control must be off while
348 * the default value is 1.
349 */
350static void alc_fix_pll(struct hda_codec *codec)
351{
352 struct alc_spec *spec = codec->spec;
2c3bf9ab 353
98b24883
TI
354 if (spec->pll_nid)
355 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
356 1 << spec->pll_coef_bit, 0);
2c3bf9ab
TI
357}
358
359static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
360 unsigned int coef_idx, unsigned int coef_bit)
361{
362 struct alc_spec *spec = codec->spec;
363 spec->pll_nid = nid;
364 spec->pll_coef_idx = coef_idx;
365 spec->pll_coef_bit = coef_bit;
366 alc_fix_pll(codec);
367}
368
cf5a2279 369/* update the master volume per volume-knob's unsol event */
1a4f69d5
TI
370static void alc_update_knob_master(struct hda_codec *codec,
371 struct hda_jack_callback *jack)
cf5a2279
TI
372{
373 unsigned int val;
374 struct snd_kcontrol *kctl;
375 struct snd_ctl_elem_value *uctl;
376
377 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
378 if (!kctl)
379 return;
380 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
381 if (!uctl)
382 return;
2ebab40e 383 val = snd_hda_codec_read(codec, jack->nid, 0,
cf5a2279
TI
384 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
385 val &= HDA_AMP_VOLMASK;
386 uctl->value.integer.value[0] = val;
387 uctl->value.integer.value[1] = val;
388 kctl->put(kctl, uctl);
389 kfree(uctl);
390}
391
29adc4b9 392static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
f21d78e2 393{
29adc4b9
DH
394 /* For some reason, the res given from ALC880 is broken.
395 Here we adjust it properly. */
396 snd_hda_jack_unsol_event(codec, res >> 2);
f21d78e2
TI
397}
398
394c97f8
KY
399/* Change EAPD to verb control */
400static void alc_fill_eapd_coef(struct hda_codec *codec)
401{
402 int coef;
403
404 coef = alc_get_coef0(codec);
405
7639a06c 406 switch (codec->core.vendor_id) {
394c97f8
KY
407 case 0x10ec0262:
408 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
409 break;
410 case 0x10ec0267:
411 case 0x10ec0268:
412 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
413 break;
414 case 0x10ec0269:
415 if ((coef & 0x00f0) == 0x0010)
416 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
417 if ((coef & 0x00f0) == 0x0020)
418 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
419 if ((coef & 0x00f0) == 0x0030)
420 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
421 break;
422 case 0x10ec0280:
423 case 0x10ec0284:
424 case 0x10ec0290:
425 case 0x10ec0292:
426 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
427 break;
4231430d 428 case 0x10ec0225:
44be77c5
TI
429 case 0x10ec0295:
430 case 0x10ec0299:
431 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
c0dbbdad 432 fallthrough;
44be77c5 433 case 0x10ec0215:
1948fc06 434 case 0x10ec0230:
394c97f8 435 case 0x10ec0233:
ea04a1db 436 case 0x10ec0235:
c4473744 437 case 0x10ec0236:
7fbdcd83 438 case 0x10ec0245:
394c97f8 439 case 0x10ec0255:
c4473744 440 case 0x10ec0256:
f429e7e4 441 case 0x10ec0257:
394c97f8
KY
442 case 0x10ec0282:
443 case 0x10ec0283:
444 case 0x10ec0286:
445 case 0x10ec0288:
0a6f0600 446 case 0x10ec0285:
506b62c3 447 case 0x10ec0298:
0a6f0600 448 case 0x10ec0289:
1078bef0 449 case 0x10ec0300:
394c97f8
KY
450 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
451 break;
3aabf94c
KY
452 case 0x10ec0275:
453 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
454 break;
8822702f
HW
455 case 0x10ec0287:
456 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
457 alc_write_coef_idx(codec, 0x8, 0x4ab7);
458 break;
394c97f8
KY
459 case 0x10ec0293:
460 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
461 break;
dcd4f0db
KY
462 case 0x10ec0234:
463 case 0x10ec0274:
464 case 0x10ec0294:
6fbae35a
KY
465 case 0x10ec0700:
466 case 0x10ec0701:
467 case 0x10ec0703:
83629532 468 case 0x10ec0711:
dcd4f0db
KY
469 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
470 break;
394c97f8
KY
471 case 0x10ec0662:
472 if ((coef & 0x00f0) == 0x0030)
473 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
474 break;
475 case 0x10ec0272:
476 case 0x10ec0273:
477 case 0x10ec0663:
478 case 0x10ec0665:
479 case 0x10ec0670:
480 case 0x10ec0671:
481 case 0x10ec0672:
482 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
483 break;
9194a1eb 484 case 0x10ec0222:
f0778871
KY
485 case 0x10ec0623:
486 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
487 break;
394c97f8
KY
488 case 0x10ec0668:
489 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
490 break;
491 case 0x10ec0867:
492 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
493 break;
494 case 0x10ec0888:
495 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
496 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
497 break;
498 case 0x10ec0892:
e5782a5d 499 case 0x10ec0897:
394c97f8
KY
500 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
501 break;
502 case 0x10ec0899:
503 case 0x10ec0900:
6d9ffcff 504 case 0x10ec0b00:
65553b12 505 case 0x10ec1168:
a535ad57 506 case 0x10ec1220:
394c97f8
KY
507 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
508 break;
509 }
510}
511
f9423e7a
KY
512/* additional initialization for ALC888 variants */
513static void alc888_coef_init(struct hda_codec *codec)
514{
1df8874b
KY
515 switch (alc_get_coef0(codec) & 0x00f0) {
516 /* alc888-VA */
517 case 0x00:
518 /* alc888-VB */
519 case 0x10:
520 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
521 break;
522 }
87a8c370
JK
523}
524
3fb4a508
TI
525/* turn on/off EAPD control (only if available) */
526static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
527{
528 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
529 return;
530 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
531 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
532 on ? 2 : 0);
533}
534
691f1fcc
TI
535/* turn on/off EAPD controls of the codec */
536static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
537{
538 /* We currently only handle front, HP */
caf3c043 539 static const hda_nid_t pins[] = {
af95b414 540 0x0f, 0x10, 0x14, 0x15, 0x17, 0
39fa84e9 541 };
caf3c043 542 const hda_nid_t *p;
39fa84e9
TI
543 for (p = pins; *p; p++)
544 set_eapd(codec, *p, on);
691f1fcc
TI
545}
546
dad3197d
KY
547static int find_ext_mic_pin(struct hda_codec *codec);
548
549static void alc_headset_mic_no_shutup(struct hda_codec *codec)
550{
551 const struct hda_pincfg *pin;
552 int mic_pin = find_ext_mic_pin(codec);
553 int i;
554
555 /* don't shut up pins when unloading the driver; otherwise it breaks
556 * the default pin setup at the next load of the driver
557 */
558 if (codec->bus->shutdown)
559 return;
560
561 snd_array_for_each(&codec->init_pins, i, pin) {
562 /* use read here for syncing after issuing each verb */
563 if (pin->nid != mic_pin)
564 snd_hda_codec_read(codec, pin->nid, 0,
565 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
566 }
567
568 codec->pins_shutup = 1;
569}
570
c0ca5ece
TI
571static void alc_shutup_pins(struct hda_codec *codec)
572{
573 struct alc_spec *spec = codec->spec;
574
dad3197d 575 switch (codec->core.vendor_id) {
5aec9891
KY
576 case 0x10ec0236:
577 case 0x10ec0256:
66c5d718 578 case 0x10ec0283:
dad3197d
KY
579 case 0x10ec0286:
580 case 0x10ec0288:
581 case 0x10ec0298:
582 alc_headset_mic_no_shutup(codec);
583 break;
584 default:
585 if (!spec->no_shutup_pins)
586 snd_hda_shutup_pins(codec);
587 break;
588 }
c0ca5ece
TI
589}
590
1c716153 591/* generic shutup callback;
4ce8e6a5 592 * just turning off EAPD and a little pause for avoiding pop-noise
1c716153
TI
593 */
594static void alc_eapd_shutup(struct hda_codec *codec)
595{
97a26570
KY
596 struct alc_spec *spec = codec->spec;
597
1c716153 598 alc_auto_setup_eapd(codec, false);
97a26570
KY
599 if (!spec->no_depop_delay)
600 msleep(200);
c0ca5ece 601 alc_shutup_pins(codec);
1c716153
TI
602}
603
1d045db9 604/* generic EAPD initialization */
4a79ba34 605static void alc_auto_init_amp(struct hda_codec *codec, int type)
bc9f98a9 606{
39fa84e9 607 alc_auto_setup_eapd(codec, true);
5579cd6f 608 alc_write_gpio(codec);
4a79ba34 609 switch (type) {
4a79ba34 610 case ALC_INIT_DEFAULT:
7639a06c 611 switch (codec->core.vendor_id) {
c9b58006 612 case 0x10ec0260:
98b24883 613 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
c9b58006 614 break;
c9b58006
KY
615 case 0x10ec0880:
616 case 0x10ec0882:
617 case 0x10ec0883:
618 case 0x10ec0885:
1df8874b 619 alc_update_coef_idx(codec, 7, 0, 0x2030);
c9b58006 620 break;
f9423e7a 621 case 0x10ec0888:
4a79ba34 622 alc888_coef_init(codec);
f9423e7a 623 break;
bc9f98a9 624 }
4a79ba34
TI
625 break;
626 }
627}
628
35a39f98
TI
629/* get a primary headphone pin if available */
630static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
631{
632 if (spec->gen.autocfg.hp_pins[0])
633 return spec->gen.autocfg.hp_pins[0];
634 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
635 return spec->gen.autocfg.line_out_pins[0];
636 return 0;
637}
08c189f2 638
1d045db9 639/*
08c189f2 640 * Realtek SSID verification
1d045db9 641 */
42cf0d01 642
08c189f2
TI
643/* Could be any non-zero and even value. When used as fixup, tells
644 * the driver to ignore any present sku defines.
645 */
646#define ALC_FIXUP_SKU_IGNORE (2)
1a1455de 647
08c189f2
TI
648static void alc_fixup_sku_ignore(struct hda_codec *codec,
649 const struct hda_fixup *fix, int action)
1a1455de 650{
1a1455de 651 struct alc_spec *spec = codec->spec;
08c189f2
TI
652 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
653 spec->cdefine.fixup = 1;
654 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
1a1455de 655 }
1a1455de
TI
656}
657
b5c6611f
ML
658static void alc_fixup_no_depop_delay(struct hda_codec *codec,
659 const struct hda_fixup *fix, int action)
660{
661 struct alc_spec *spec = codec->spec;
662
84d2dc3e 663 if (action == HDA_FIXUP_ACT_PROBE) {
b5c6611f 664 spec->no_depop_delay = 1;
84d2dc3e
ML
665 codec->depop_delay = 0;
666 }
b5c6611f
ML
667}
668
08c189f2 669static int alc_auto_parse_customize_define(struct hda_codec *codec)
4a79ba34 670{
08c189f2
TI
671 unsigned int ass, tmp, i;
672 unsigned nid = 0;
4a79ba34
TI
673 struct alc_spec *spec = codec->spec;
674
08c189f2 675 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
4a79ba34 676
08c189f2
TI
677 if (spec->cdefine.fixup) {
678 ass = spec->cdefine.sku_cfg;
679 if (ass == ALC_FIXUP_SKU_IGNORE)
680 return -1;
681 goto do_sku;
bb35febd
TI
682 }
683
5100cd07
TI
684 if (!codec->bus->pci)
685 return -1;
7639a06c 686 ass = codec->core.subsystem_id & 0xffff;
08c189f2
TI
687 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
688 goto do_sku;
4a79ba34 689
08c189f2 690 nid = 0x1d;
7639a06c 691 if (codec->core.vendor_id == 0x10ec0260)
08c189f2
TI
692 nid = 0x17;
693 ass = snd_hda_codec_get_pincfg(codec, nid);
42cf0d01 694
08c189f2 695 if (!(ass & 1)) {
4e76a883 696 codec_info(codec, "%s: SKU not ready 0x%08x\n",
7639a06c 697 codec->core.chip_name, ass);
08c189f2 698 return -1;
42cf0d01
DH
699 }
700
08c189f2
TI
701 /* check sum */
702 tmp = 0;
703 for (i = 1; i < 16; i++) {
704 if ((ass >> i) & 1)
705 tmp++;
ae8a60a5 706 }
08c189f2
TI
707 if (((ass >> 16) & 0xf) != tmp)
708 return -1;
ae8a60a5 709
da00c244
KY
710 spec->cdefine.port_connectivity = ass >> 30;
711 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
712 spec->cdefine.check_sum = (ass >> 16) & 0xf;
713 spec->cdefine.customization = ass >> 8;
714do_sku:
715 spec->cdefine.sku_cfg = ass;
716 spec->cdefine.external_amp = (ass & 0x38) >> 3;
717 spec->cdefine.platform_type = (ass & 0x4) >> 2;
718 spec->cdefine.swap = (ass & 0x2) >> 1;
719 spec->cdefine.override = ass & 0x1;
720
4e76a883 721 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
da00c244 722 nid, spec->cdefine.sku_cfg);
4e76a883 723 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
da00c244 724 spec->cdefine.port_connectivity);
4e76a883
TI
725 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
726 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
727 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
728 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
729 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
730 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
731 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
da00c244
KY
732
733 return 0;
734}
735
08c189f2
TI
736/* return the position of NID in the list, or -1 if not found */
737static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
738{
739 int i;
740 for (i = 0; i < nums; i++)
741 if (list[i] == nid)
742 return i;
743 return -1;
744}
1d045db9 745/* return true if the given NID is found in the list */
3af9ee6b
TI
746static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
747{
21268961 748 return find_idx_in_nid_list(nid, list, nums) >= 0;
3af9ee6b
TI
749}
750
4a79ba34
TI
751/* check subsystem ID and set up device-specific initialization;
752 * return 1 if initialized, 0 if invalid SSID
753 */
754/* 32-bit subsystem ID for BIOS loading in HD Audio codec.
755 * 31 ~ 16 : Manufacture ID
756 * 15 ~ 8 : SKU ID
757 * 7 ~ 0 : Assembly ID
758 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
759 */
58c57cfa 760static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34
TI
761{
762 unsigned int ass, tmp, i;
763 unsigned nid;
764 struct alc_spec *spec = codec->spec;
765
90622917
DH
766 if (spec->cdefine.fixup) {
767 ass = spec->cdefine.sku_cfg;
768 if (ass == ALC_FIXUP_SKU_IGNORE)
769 return 0;
770 goto do_sku;
771 }
772
7639a06c 773 ass = codec->core.subsystem_id & 0xffff;
5100cd07
TI
774 if (codec->bus->pci &&
775 ass != codec->bus->pci->subsystem_device && (ass & 1))
4a79ba34
TI
776 goto do_sku;
777
778 /* invalid SSID, check the special NID pin defcfg instead */
779 /*
def319f9 780 * 31~30 : port connectivity
4a79ba34
TI
781 * 29~21 : reserve
782 * 20 : PCBEEP input
783 * 19~16 : Check sum (15:1)
784 * 15~1 : Custom
785 * 0 : override
786 */
787 nid = 0x1d;
7639a06c 788 if (codec->core.vendor_id == 0x10ec0260)
4a79ba34
TI
789 nid = 0x17;
790 ass = snd_hda_codec_get_pincfg(codec, nid);
4e76a883
TI
791 codec_dbg(codec,
792 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
cb6605c1 793 ass, nid);
6227cdce 794 if (!(ass & 1))
4a79ba34
TI
795 return 0;
796 if ((ass >> 30) != 1) /* no physical connection */
797 return 0;
798
799 /* check sum */
800 tmp = 0;
801 for (i = 1; i < 16; i++) {
802 if ((ass >> i) & 1)
803 tmp++;
804 }
805 if (((ass >> 16) & 0xf) != tmp)
806 return 0;
807do_sku:
4e76a883 808 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
7639a06c 809 ass & 0xffff, codec->core.vendor_id);
4a79ba34
TI
810 /*
811 * 0 : override
812 * 1 : Swap Jack
813 * 2 : 0 --> Desktop, 1 --> Laptop
814 * 3~5 : External Amplifier control
815 * 7~6 : Reserved
816 */
817 tmp = (ass & 0x38) >> 3; /* external Amp control */
1c76aa5f
TI
818 if (spec->init_amp == ALC_INIT_UNDEFINED) {
819 switch (tmp) {
820 case 1:
5579cd6f 821 alc_setup_gpio(codec, 0x01);
1c76aa5f
TI
822 break;
823 case 3:
5579cd6f 824 alc_setup_gpio(codec, 0x02);
1c76aa5f
TI
825 break;
826 case 7:
5579cd6f 827 alc_setup_gpio(codec, 0x03);
1c76aa5f
TI
828 break;
829 case 5:
830 default:
831 spec->init_amp = ALC_INIT_DEFAULT;
832 break;
833 }
bc9f98a9 834 }
ea1fb29a 835
8c427226 836 /* is laptop or Desktop and enable the function "Mute internal speaker
c9b58006
KY
837 * when the external headphone out jack is plugged"
838 */
8c427226 839 if (!(ass & 0x8000))
4a79ba34 840 return 1;
c9b58006
KY
841 /*
842 * 10~8 : Jack location
843 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
844 * 14~13: Resvered
845 * 15 : 1 --> enable the function "Mute internal speaker
846 * when the external headphone out jack is plugged"
847 */
35a39f98 848 if (!alc_get_hp_pin(spec)) {
01d4825d 849 hda_nid_t nid;
c9b58006 850 tmp = (ass >> 11) & 0x3; /* HP to chassis */
58c57cfa 851 nid = ports[tmp];
08c189f2
TI
852 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
853 spec->gen.autocfg.line_outs))
3af9ee6b 854 return 1;
08c189f2 855 spec->gen.autocfg.hp_pins[0] = nid;
c9b58006 856 }
4a79ba34
TI
857 return 1;
858}
ea1fb29a 859
3e6179b8
TI
860/* Check the validity of ALC subsystem-id
861 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
862static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
4a79ba34 863{
58c57cfa 864 if (!alc_subsystem_id(codec, ports)) {
4a79ba34 865 struct alc_spec *spec = codec->spec;
67791202
TI
866 if (spec->init_amp == ALC_INIT_UNDEFINED) {
867 codec_dbg(codec,
868 "realtek: Enable default setup for auto mode as fallback\n");
869 spec->init_amp = ALC_INIT_DEFAULT;
870 }
4a79ba34 871 }
21268961 872}
1a1455de 873
1d045db9 874/*
ef8ef5fb 875 */
f9e336f6 876
9d36a7dc
DH
877static void alc_fixup_inv_dmic(struct hda_codec *codec,
878 const struct hda_fixup *fix, int action)
125821ae
TI
879{
880 struct alc_spec *spec = codec->spec;
668d1e96 881
9d36a7dc 882 spec->gen.inv_dmic_split = 1;
6e72aa5f
TI
883}
884
e9edcee0 885
08c189f2 886static int alc_build_controls(struct hda_codec *codec)
1d045db9 887{
a5cb463a 888 int err;
e9427969 889
08c189f2
TI
890 err = snd_hda_gen_build_controls(codec);
891 if (err < 0)
892 return err;
1da177e4 893
1727a771 894 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
1c4a54b4 895 return 0;
a361d84b
KY
896}
897
a361d84b 898
df694daa 899/*
08c189f2 900 * Common callbacks
df694daa 901 */
a361d84b 902
c9af753f
TI
903static void alc_pre_init(struct hda_codec *codec)
904{
905 alc_fill_eapd_coef(codec);
906}
907
aeac1a0d
KY
908#define is_s3_resume(codec) \
909 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
c9af753f
TI
910#define is_s4_resume(codec) \
911 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
912
08c189f2 913static int alc_init(struct hda_codec *codec)
1d045db9
TI
914{
915 struct alc_spec *spec = codec->spec;
a361d84b 916
c9af753f
TI
917 /* hibernation resume needs the full chip initialization */
918 if (is_s4_resume(codec))
919 alc_pre_init(codec);
920
08c189f2
TI
921 if (spec->init_hook)
922 spec->init_hook(codec);
a361d84b 923
89781d08 924 spec->gen.skip_verbs = 1; /* applied in below */
607ca3bd 925 snd_hda_gen_init(codec);
08c189f2
TI
926 alc_fix_pll(codec);
927 alc_auto_init_amp(codec, spec->init_amp);
89781d08 928 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
3abf2f36 929
1727a771 930 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
a361d84b 931
1d045db9
TI
932 return 0;
933}
a361d84b 934
08c189f2 935static inline void alc_shutup(struct hda_codec *codec)
1d045db9
TI
936{
937 struct alc_spec *spec = codec->spec;
a361d84b 938
c7273bd6
TI
939 if (!snd_hda_get_bool_hint(codec, "shutup"))
940 return; /* disabled explicitly by hints */
941
08c189f2
TI
942 if (spec && spec->shutup)
943 spec->shutup(codec);
9bfb2844 944 else
c0ca5ece 945 alc_shutup_pins(codec);
1d045db9
TI
946}
947
8a02c0cc 948#define alc_free snd_hda_gen_free
2134ea4f 949
08c189f2
TI
950#ifdef CONFIG_PM
951static void alc_power_eapd(struct hda_codec *codec)
1d045db9 952{
08c189f2 953 alc_auto_setup_eapd(codec, false);
1d045db9 954}
2134ea4f 955
08c189f2 956static int alc_suspend(struct hda_codec *codec)
1d045db9
TI
957{
958 struct alc_spec *spec = codec->spec;
08c189f2
TI
959 alc_shutup(codec);
960 if (spec && spec->power_hook)
961 spec->power_hook(codec);
a361d84b
KY
962 return 0;
963}
08c189f2 964#endif
a361d84b 965
08c189f2
TI
966#ifdef CONFIG_PM
967static int alc_resume(struct hda_codec *codec)
1d045db9 968{
97a26570
KY
969 struct alc_spec *spec = codec->spec;
970
971 if (!spec->no_depop_delay)
972 msleep(150); /* to avoid pop noise */
08c189f2 973 codec->patch_ops.init(codec);
1a462be5 974 snd_hda_regmap_sync(codec);
08c189f2
TI
975 hda_call_check_power_status(codec, 0x01);
976 return 0;
1d045db9 977}
08c189f2 978#endif
f6a92248 979
1d045db9 980/*
1d045db9 981 */
08c189f2
TI
982static const struct hda_codec_ops alc_patch_ops = {
983 .build_controls = alc_build_controls,
984 .build_pcms = snd_hda_gen_build_pcms,
985 .init = alc_init,
986 .free = alc_free,
987 .unsol_event = snd_hda_jack_unsol_event,
988#ifdef CONFIG_PM
989 .resume = alc_resume,
08c189f2 990 .suspend = alc_suspend,
fce52a3b 991 .check_power_status = snd_hda_gen_check_power_status,
08c189f2 992#endif
08c189f2 993};
f6a92248 994
f53281e6 995
ded255be 996#define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
e01bf509 997
e4770629 998/*
4b016931 999 * Rename codecs appropriately from COEF value or subvendor id
e4770629 1000 */
08c189f2
TI
1001struct alc_codec_rename_table {
1002 unsigned int vendor_id;
1003 unsigned short coef_mask;
1004 unsigned short coef_bits;
1005 const char *name;
1006};
84898e87 1007
4b016931
KY
1008struct alc_codec_rename_pci_table {
1009 unsigned int codec_vendor_id;
1010 unsigned short pci_subvendor;
1011 unsigned short pci_subdevice;
1012 const char *name;
1013};
1014
6b0f95c4 1015static const struct alc_codec_rename_table rename_tbl[] = {
e6e5f7ad 1016 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
08c189f2
TI
1017 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1018 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1019 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1020 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1021 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1022 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1023 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1024 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
e6e5f7ad 1025 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
08c189f2
TI
1026 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1027 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1028 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1029 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1030 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1031 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1032 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1033 { } /* terminator */
1034};
84898e87 1035
6b0f95c4 1036static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
4b016931
KY
1037 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1038 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1039 { 0x10ec0283, 0x1028, 0, "ALC3223" },
193177de 1040 { 0x10ec0288, 0x1028, 0, "ALC3263" },
4b016931 1041 { 0x10ec0292, 0x1028, 0, "ALC3226" },
193177de 1042 { 0x10ec0293, 0x1028, 0, "ALC3235" },
4b016931
KY
1043 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1044 { 0x10ec0668, 0x1028, 0, "ALC3661" },
e6e5f7ad
KY
1045 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1046 { 0x10ec0899, 0x1028, 0, "ALC3861" },
2c674fac 1047 { 0x10ec0298, 0x1028, 0, "ALC3266" },
736f20a7 1048 { 0x10ec0236, 0x1028, 0, "ALC3204" },
82324502 1049 { 0x10ec0256, 0x1028, 0, "ALC3246" },
4231430d 1050 { 0x10ec0225, 0x1028, 0, "ALC3253" },
7d727869 1051 { 0x10ec0295, 0x1028, 0, "ALC3254" },
28f1f9b2 1052 { 0x10ec0299, 0x1028, 0, "ALC3271" },
e6e5f7ad
KY
1053 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1054 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1055 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1056 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1057 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1058 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1059 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1060 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1061 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1062 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1063 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
4b016931
KY
1064 { } /* terminator */
1065};
1066
08c189f2 1067static int alc_codec_rename_from_preset(struct hda_codec *codec)
1d045db9 1068{
08c189f2 1069 const struct alc_codec_rename_table *p;
4b016931 1070 const struct alc_codec_rename_pci_table *q;
60db6b53 1071
08c189f2 1072 for (p = rename_tbl; p->vendor_id; p++) {
7639a06c 1073 if (p->vendor_id != codec->core.vendor_id)
08c189f2
TI
1074 continue;
1075 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1076 return alc_codec_rename(codec, p->name);
1d045db9 1077 }
4b016931 1078
5100cd07
TI
1079 if (!codec->bus->pci)
1080 return 0;
4b016931 1081 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
7639a06c 1082 if (q->codec_vendor_id != codec->core.vendor_id)
4b016931
KY
1083 continue;
1084 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1085 continue;
1086 if (!q->pci_subdevice ||
1087 q->pci_subdevice == codec->bus->pci->subsystem_device)
1088 return alc_codec_rename(codec, q->name);
1089 }
1090
08c189f2 1091 return 0;
1d045db9 1092}
f53281e6 1093
e4770629 1094
1d045db9
TI
1095/*
1096 * Digital-beep handlers
1097 */
1098#ifdef CONFIG_SND_HDA_INPUT_BEEP
fea80fae
TI
1099
1100/* additional beep mixers; private_value will be overwritten */
1101static const struct snd_kcontrol_new alc_beep_mixer[] = {
1102 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1103 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1104};
1105
1106/* set up and create beep controls */
1107static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1108 int idx, int dir)
1109{
1110 struct snd_kcontrol_new *knew;
1111 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1112 int i;
1113
1114 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1115 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1116 &alc_beep_mixer[i]);
1117 if (!knew)
1118 return -ENOMEM;
1119 knew->private_value = beep_amp;
1120 }
1121 return 0;
1122}
84898e87 1123
6317e5eb 1124static const struct snd_pci_quirk beep_allow_list[] = {
7110005e 1125 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
a4b7f21d 1126 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1d045db9 1127 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
8554ee40 1128 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1d045db9
TI
1129 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1130 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1131 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
78f8baf1 1132 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1d045db9 1133 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
6317e5eb 1134 /* denylist -- no beep available */
051c78af
TI
1135 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1136 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1d045db9 1137 {}
fe3eb0a7
KY
1138};
1139
1d045db9
TI
1140static inline int has_cdefine_beep(struct hda_codec *codec)
1141{
1142 struct alc_spec *spec = codec->spec;
1143 const struct snd_pci_quirk *q;
6317e5eb 1144 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1d045db9
TI
1145 if (q)
1146 return q->value;
1147 return spec->cdefine.enable_pcbeep;
1148}
1149#else
fea80fae 1150#define set_beep_amp(spec, nid, idx, dir) 0
1d045db9
TI
1151#define has_cdefine_beep(codec) 0
1152#endif
84898e87 1153
1d045db9
TI
1154/* parse the BIOS configuration and set up the alc_spec */
1155/* return 1 if successful, 0 if the proper config is not found,
1156 * or a negative error code
1157 */
3e6179b8
TI
1158static int alc_parse_auto_config(struct hda_codec *codec,
1159 const hda_nid_t *ignore_nids,
1160 const hda_nid_t *ssid_nids)
1d045db9
TI
1161{
1162 struct alc_spec *spec = codec->spec;
08c189f2 1163 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1d045db9 1164 int err;
26f5df26 1165
53c334ad
TI
1166 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1167 spec->parse_flags);
1d045db9
TI
1168 if (err < 0)
1169 return err;
3e6179b8
TI
1170
1171 if (ssid_nids)
1172 alc_ssid_check(codec, ssid_nids);
64154835 1173
08c189f2
TI
1174 err = snd_hda_gen_parse_auto_config(codec, cfg);
1175 if (err < 0)
1176 return err;
070cff4c 1177
1d045db9 1178 return 1;
60db6b53 1179}
f6a92248 1180
3de95173
TI
1181/* common preparation job for alc_spec */
1182static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1183{
1184 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1185 int err;
1186
1187 if (!spec)
1188 return -ENOMEM;
1189 codec->spec = spec;
08c189f2
TI
1190 snd_hda_gen_spec_init(&spec->gen);
1191 spec->gen.mixer_nid = mixer_nid;
1192 spec->gen.own_eapd_ctl = 1;
1098b7c2 1193 codec->single_adc_amp = 1;
08c189f2
TI
1194 /* FIXME: do we need this for all Realtek codec models? */
1195 codec->spdif_status_reset = 1;
a6e7d0a4 1196 codec->forced_resume = 1;
225068ab 1197 codec->patch_ops = alc_patch_ops;
1b35106e 1198 mutex_init(&spec->coef_mutex);
3de95173
TI
1199
1200 err = alc_codec_rename_from_preset(codec);
1201 if (err < 0) {
1202 kfree(spec);
1203 return err;
1204 }
1205 return 0;
1206}
1207
3e6179b8
TI
1208static int alc880_parse_auto_config(struct hda_codec *codec)
1209{
1210 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
7d7eb9ea 1211 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3e6179b8
TI
1212 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1213}
1214
ee3b2969
TI
1215/*
1216 * ALC880 fix-ups
1217 */
1218enum {
411225a0 1219 ALC880_FIXUP_GPIO1,
ee3b2969
TI
1220 ALC880_FIXUP_GPIO2,
1221 ALC880_FIXUP_MEDION_RIM,
dc6af52d 1222 ALC880_FIXUP_LG,
db8a38e5 1223 ALC880_FIXUP_LG_LW25,
f02aab5d 1224 ALC880_FIXUP_W810,
27e917f8 1225 ALC880_FIXUP_EAPD_COEF,
b9368f5c 1226 ALC880_FIXUP_TCL_S700,
cf5a2279
TI
1227 ALC880_FIXUP_VOL_KNOB,
1228 ALC880_FIXUP_FUJITSU,
ba533818 1229 ALC880_FIXUP_F1734,
817de92f 1230 ALC880_FIXUP_UNIWILL,
967b88c4 1231 ALC880_FIXUP_UNIWILL_DIG,
96e225f6 1232 ALC880_FIXUP_Z71V,
487a588d 1233 ALC880_FIXUP_ASUS_W5A,
67b6ec31
TI
1234 ALC880_FIXUP_3ST_BASE,
1235 ALC880_FIXUP_3ST,
1236 ALC880_FIXUP_3ST_DIG,
1237 ALC880_FIXUP_5ST_BASE,
1238 ALC880_FIXUP_5ST,
1239 ALC880_FIXUP_5ST_DIG,
1240 ALC880_FIXUP_6ST_BASE,
1241 ALC880_FIXUP_6ST,
1242 ALC880_FIXUP_6ST_DIG,
5397145f 1243 ALC880_FIXUP_6ST_AUTOMUTE,
ee3b2969
TI
1244};
1245
cf5a2279
TI
1246/* enable the volume-knob widget support on NID 0x21 */
1247static void alc880_fixup_vol_knob(struct hda_codec *codec,
1727a771 1248 const struct hda_fixup *fix, int action)
cf5a2279 1249{
1727a771 1250 if (action == HDA_FIXUP_ACT_PROBE)
62f949bf
TI
1251 snd_hda_jack_detect_enable_callback(codec, 0x21,
1252 alc_update_knob_master);
cf5a2279
TI
1253}
1254
1727a771 1255static const struct hda_fixup alc880_fixups[] = {
411225a0 1256 [ALC880_FIXUP_GPIO1] = {
5579cd6f
TI
1257 .type = HDA_FIXUP_FUNC,
1258 .v.func = alc_fixup_gpio1,
411225a0 1259 },
ee3b2969 1260 [ALC880_FIXUP_GPIO2] = {
5579cd6f
TI
1261 .type = HDA_FIXUP_FUNC,
1262 .v.func = alc_fixup_gpio2,
ee3b2969
TI
1263 },
1264 [ALC880_FIXUP_MEDION_RIM] = {
1727a771 1265 .type = HDA_FIXUP_VERBS,
ee3b2969
TI
1266 .v.verbs = (const struct hda_verb[]) {
1267 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1268 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1269 { }
1270 },
1271 .chained = true,
1272 .chain_id = ALC880_FIXUP_GPIO2,
1273 },
dc6af52d 1274 [ALC880_FIXUP_LG] = {
1727a771
TI
1275 .type = HDA_FIXUP_PINS,
1276 .v.pins = (const struct hda_pintbl[]) {
dc6af52d
TI
1277 /* disable bogus unused pins */
1278 { 0x16, 0x411111f0 },
1279 { 0x18, 0x411111f0 },
1280 { 0x1a, 0x411111f0 },
1281 { }
1282 }
1283 },
db8a38e5
TI
1284 [ALC880_FIXUP_LG_LW25] = {
1285 .type = HDA_FIXUP_PINS,
1286 .v.pins = (const struct hda_pintbl[]) {
1287 { 0x1a, 0x0181344f }, /* line-in */
1288 { 0x1b, 0x0321403f }, /* headphone */
1289 { }
1290 }
1291 },
f02aab5d 1292 [ALC880_FIXUP_W810] = {
1727a771
TI
1293 .type = HDA_FIXUP_PINS,
1294 .v.pins = (const struct hda_pintbl[]) {
f02aab5d
TI
1295 /* disable bogus unused pins */
1296 { 0x17, 0x411111f0 },
1297 { }
1298 },
1299 .chained = true,
1300 .chain_id = ALC880_FIXUP_GPIO2,
1301 },
27e917f8 1302 [ALC880_FIXUP_EAPD_COEF] = {
1727a771 1303 .type = HDA_FIXUP_VERBS,
27e917f8
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, 0x3060 },
1308 {}
1309 },
1310 },
b9368f5c 1311 [ALC880_FIXUP_TCL_S700] = {
1727a771 1312 .type = HDA_FIXUP_VERBS,
b9368f5c
TI
1313 .v.verbs = (const struct hda_verb[]) {
1314 /* change to EAPD mode */
1315 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1316 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1317 {}
1318 },
1319 .chained = true,
1320 .chain_id = ALC880_FIXUP_GPIO2,
1321 },
cf5a2279 1322 [ALC880_FIXUP_VOL_KNOB] = {
1727a771 1323 .type = HDA_FIXUP_FUNC,
cf5a2279
TI
1324 .v.func = alc880_fixup_vol_knob,
1325 },
1326 [ALC880_FIXUP_FUJITSU] = {
1327 /* override all pins as BIOS on old Amilo is broken */
1727a771
TI
1328 .type = HDA_FIXUP_PINS,
1329 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1330 { 0x14, 0x0121401f }, /* HP */
cf5a2279
TI
1331 { 0x15, 0x99030120 }, /* speaker */
1332 { 0x16, 0x99030130 }, /* bass speaker */
1333 { 0x17, 0x411111f0 }, /* N/A */
1334 { 0x18, 0x411111f0 }, /* N/A */
1335 { 0x19, 0x01a19950 }, /* mic-in */
1336 { 0x1a, 0x411111f0 }, /* N/A */
1337 { 0x1b, 0x411111f0 }, /* N/A */
1338 { 0x1c, 0x411111f0 }, /* N/A */
1339 { 0x1d, 0x411111f0 }, /* N/A */
1340 { 0x1e, 0x01454140 }, /* SPDIF out */
1341 { }
1342 },
1343 .chained = true,
1344 .chain_id = ALC880_FIXUP_VOL_KNOB,
1345 },
ba533818
TI
1346 [ALC880_FIXUP_F1734] = {
1347 /* almost compatible with FUJITSU, but no bass and SPDIF */
1727a771
TI
1348 .type = HDA_FIXUP_PINS,
1349 .v.pins = (const struct hda_pintbl[]) {
bb148bde 1350 { 0x14, 0x0121401f }, /* HP */
ba533818
TI
1351 { 0x15, 0x99030120 }, /* speaker */
1352 { 0x16, 0x411111f0 }, /* N/A */
1353 { 0x17, 0x411111f0 }, /* N/A */
1354 { 0x18, 0x411111f0 }, /* N/A */
1355 { 0x19, 0x01a19950 }, /* mic-in */
1356 { 0x1a, 0x411111f0 }, /* N/A */
1357 { 0x1b, 0x411111f0 }, /* N/A */
1358 { 0x1c, 0x411111f0 }, /* N/A */
1359 { 0x1d, 0x411111f0 }, /* N/A */
1360 { 0x1e, 0x411111f0 }, /* N/A */
1361 { }
1362 },
1363 .chained = true,
1364 .chain_id = ALC880_FIXUP_VOL_KNOB,
1365 },
817de92f
TI
1366 [ALC880_FIXUP_UNIWILL] = {
1367 /* need to fix HP and speaker pins to be parsed correctly */
1727a771
TI
1368 .type = HDA_FIXUP_PINS,
1369 .v.pins = (const struct hda_pintbl[]) {
817de92f
TI
1370 { 0x14, 0x0121411f }, /* HP */
1371 { 0x15, 0x99030120 }, /* speaker */
1372 { 0x16, 0x99030130 }, /* bass speaker */
1373 { }
1374 },
1375 },
967b88c4 1376 [ALC880_FIXUP_UNIWILL_DIG] = {
1727a771
TI
1377 .type = HDA_FIXUP_PINS,
1378 .v.pins = (const struct hda_pintbl[]) {
967b88c4
TI
1379 /* disable bogus unused pins */
1380 { 0x17, 0x411111f0 },
1381 { 0x19, 0x411111f0 },
1382 { 0x1b, 0x411111f0 },
1383 { 0x1f, 0x411111f0 },
1384 { }
1385 }
1386 },
96e225f6 1387 [ALC880_FIXUP_Z71V] = {
1727a771
TI
1388 .type = HDA_FIXUP_PINS,
1389 .v.pins = (const struct hda_pintbl[]) {
96e225f6
TI
1390 /* set up the whole pins as BIOS is utterly broken */
1391 { 0x14, 0x99030120 }, /* speaker */
1392 { 0x15, 0x0121411f }, /* HP */
1393 { 0x16, 0x411111f0 }, /* N/A */
1394 { 0x17, 0x411111f0 }, /* N/A */
1395 { 0x18, 0x01a19950 }, /* mic-in */
1396 { 0x19, 0x411111f0 }, /* N/A */
1397 { 0x1a, 0x01813031 }, /* line-in */
1398 { 0x1b, 0x411111f0 }, /* N/A */
1399 { 0x1c, 0x411111f0 }, /* N/A */
1400 { 0x1d, 0x411111f0 }, /* N/A */
1401 { 0x1e, 0x0144111e }, /* SPDIF */
1402 { }
1403 }
1404 },
487a588d
TI
1405 [ALC880_FIXUP_ASUS_W5A] = {
1406 .type = HDA_FIXUP_PINS,
1407 .v.pins = (const struct hda_pintbl[]) {
1408 /* set up the whole pins as BIOS is utterly broken */
1409 { 0x14, 0x0121411f }, /* HP */
1410 { 0x15, 0x411111f0 }, /* N/A */
1411 { 0x16, 0x411111f0 }, /* N/A */
1412 { 0x17, 0x411111f0 }, /* N/A */
1413 { 0x18, 0x90a60160 }, /* mic */
1414 { 0x19, 0x411111f0 }, /* N/A */
1415 { 0x1a, 0x411111f0 }, /* N/A */
1416 { 0x1b, 0x411111f0 }, /* N/A */
1417 { 0x1c, 0x411111f0 }, /* N/A */
1418 { 0x1d, 0x411111f0 }, /* N/A */
1419 { 0x1e, 0xb743111e }, /* SPDIF out */
1420 { }
1421 },
1422 .chained = true,
1423 .chain_id = ALC880_FIXUP_GPIO1,
1424 },
67b6ec31 1425 [ALC880_FIXUP_3ST_BASE] = {
1727a771
TI
1426 .type = HDA_FIXUP_PINS,
1427 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1428 { 0x14, 0x01014010 }, /* line-out */
1429 { 0x15, 0x411111f0 }, /* N/A */
1430 { 0x16, 0x411111f0 }, /* N/A */
1431 { 0x17, 0x411111f0 }, /* N/A */
1432 { 0x18, 0x01a19c30 }, /* mic-in */
1433 { 0x19, 0x0121411f }, /* HP */
1434 { 0x1a, 0x01813031 }, /* line-in */
1435 { 0x1b, 0x02a19c40 }, /* front-mic */
1436 { 0x1c, 0x411111f0 }, /* N/A */
1437 { 0x1d, 0x411111f0 }, /* N/A */
1438 /* 0x1e is filled in below */
1439 { 0x1f, 0x411111f0 }, /* N/A */
1440 { }
1441 }
1442 },
1443 [ALC880_FIXUP_3ST] = {
1727a771
TI
1444 .type = HDA_FIXUP_PINS,
1445 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1446 { 0x1e, 0x411111f0 }, /* N/A */
1447 { }
1448 },
1449 .chained = true,
1450 .chain_id = ALC880_FIXUP_3ST_BASE,
1451 },
1452 [ALC880_FIXUP_3ST_DIG] = {
1727a771
TI
1453 .type = HDA_FIXUP_PINS,
1454 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1455 { 0x1e, 0x0144111e }, /* SPDIF */
1456 { }
1457 },
1458 .chained = true,
1459 .chain_id = ALC880_FIXUP_3ST_BASE,
1460 },
1461 [ALC880_FIXUP_5ST_BASE] = {
1727a771
TI
1462 .type = HDA_FIXUP_PINS,
1463 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1464 { 0x14, 0x01014010 }, /* front */
1465 { 0x15, 0x411111f0 }, /* N/A */
1466 { 0x16, 0x01011411 }, /* CLFE */
1467 { 0x17, 0x01016412 }, /* surr */
1468 { 0x18, 0x01a19c30 }, /* mic-in */
1469 { 0x19, 0x0121411f }, /* HP */
1470 { 0x1a, 0x01813031 }, /* line-in */
1471 { 0x1b, 0x02a19c40 }, /* front-mic */
1472 { 0x1c, 0x411111f0 }, /* N/A */
1473 { 0x1d, 0x411111f0 }, /* N/A */
1474 /* 0x1e is filled in below */
1475 { 0x1f, 0x411111f0 }, /* N/A */
1476 { }
1477 }
1478 },
1479 [ALC880_FIXUP_5ST] = {
1727a771
TI
1480 .type = HDA_FIXUP_PINS,
1481 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1482 { 0x1e, 0x411111f0 }, /* N/A */
1483 { }
1484 },
1485 .chained = true,
1486 .chain_id = ALC880_FIXUP_5ST_BASE,
1487 },
1488 [ALC880_FIXUP_5ST_DIG] = {
1727a771
TI
1489 .type = HDA_FIXUP_PINS,
1490 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1491 { 0x1e, 0x0144111e }, /* SPDIF */
1492 { }
1493 },
1494 .chained = true,
1495 .chain_id = ALC880_FIXUP_5ST_BASE,
1496 },
1497 [ALC880_FIXUP_6ST_BASE] = {
1727a771
TI
1498 .type = HDA_FIXUP_PINS,
1499 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1500 { 0x14, 0x01014010 }, /* front */
1501 { 0x15, 0x01016412 }, /* surr */
1502 { 0x16, 0x01011411 }, /* CLFE */
1503 { 0x17, 0x01012414 }, /* side */
1504 { 0x18, 0x01a19c30 }, /* mic-in */
1505 { 0x19, 0x02a19c40 }, /* front-mic */
1506 { 0x1a, 0x01813031 }, /* line-in */
1507 { 0x1b, 0x0121411f }, /* HP */
1508 { 0x1c, 0x411111f0 }, /* N/A */
1509 { 0x1d, 0x411111f0 }, /* N/A */
1510 /* 0x1e is filled in below */
1511 { 0x1f, 0x411111f0 }, /* N/A */
1512 { }
1513 }
1514 },
1515 [ALC880_FIXUP_6ST] = {
1727a771
TI
1516 .type = HDA_FIXUP_PINS,
1517 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1518 { 0x1e, 0x411111f0 }, /* N/A */
1519 { }
1520 },
1521 .chained = true,
1522 .chain_id = ALC880_FIXUP_6ST_BASE,
1523 },
1524 [ALC880_FIXUP_6ST_DIG] = {
1727a771
TI
1525 .type = HDA_FIXUP_PINS,
1526 .v.pins = (const struct hda_pintbl[]) {
67b6ec31
TI
1527 { 0x1e, 0x0144111e }, /* SPDIF */
1528 { }
1529 },
1530 .chained = true,
1531 .chain_id = ALC880_FIXUP_6ST_BASE,
1532 },
5397145f
TI
1533 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1534 .type = HDA_FIXUP_PINS,
1535 .v.pins = (const struct hda_pintbl[]) {
1536 { 0x1b, 0x0121401f }, /* HP with jack detect */
1537 { }
1538 },
1539 .chained_before = true,
1540 .chain_id = ALC880_FIXUP_6ST_BASE,
1541 },
ee3b2969
TI
1542};
1543
1544static const struct snd_pci_quirk alc880_fixup_tbl[] = {
f02aab5d 1545 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
487a588d 1546 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
96e225f6 1547 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
29e3fdcc 1548 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
6538de03 1549 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
29e3fdcc 1550 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
27e917f8 1551 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
967b88c4 1552 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
ba533818 1553 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
817de92f 1554 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
7833c7e8 1555 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
f02aab5d 1556 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
ee3b2969 1557 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
5397145f 1558 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
a161574e 1559 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
cf5a2279 1560 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
ba533818 1561 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
cf5a2279 1562 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
dc6af52d
TI
1563 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1564 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1565 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
db8a38e5 1566 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
b9368f5c 1567 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
67b6ec31
TI
1568
1569 /* Below is the copied entries from alc880_quirks.c.
1570 * It's not quite sure whether BIOS sets the correct pin-config table
1571 * on these machines, thus they are kept to be compatible with
1572 * the old static quirks. Once when it's confirmed to work without
1573 * these overrides, it'd be better to remove.
1574 */
1575 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1576 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1577 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1578 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1579 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1580 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1581 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1582 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1583 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1584 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1585 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1586 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1587 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1588 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1589 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1590 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1591 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1592 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1593 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1594 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1595 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1596 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1597 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1598 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1599 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1600 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1601 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1602 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1603 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1604 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1605 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1606 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1607 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1608 /* default Intel */
1609 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1610 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1611 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1612 {}
1613};
1614
1727a771 1615static const struct hda_model_fixup alc880_fixup_models[] = {
67b6ec31
TI
1616 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1617 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1618 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1619 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1620 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1621 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
5397145f 1622 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
ee3b2969
TI
1623 {}
1624};
1625
1626
1d045db9
TI
1627/*
1628 * OK, here we have finally the patch for ALC880
1629 */
1d045db9 1630static int patch_alc880(struct hda_codec *codec)
60db6b53 1631{
1d045db9 1632 struct alc_spec *spec;
1d045db9 1633 int err;
f6a92248 1634
3de95173
TI
1635 err = alc_alloc_spec(codec, 0x0b);
1636 if (err < 0)
1637 return err;
64154835 1638
3de95173 1639 spec = codec->spec;
08c189f2 1640 spec->gen.need_dac_fix = 1;
7504b6cd 1641 spec->gen.beep_nid = 0x01;
f53281e6 1642
225068ab
TI
1643 codec->patch_ops.unsol_event = alc880_unsol_event;
1644
c9af753f
TI
1645 alc_pre_init(codec);
1646
1727a771 1647 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
67b6ec31 1648 alc880_fixups);
1727a771 1649 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ee3b2969 1650
67b6ec31
TI
1651 /* automatic parse from the BIOS config */
1652 err = alc880_parse_auto_config(codec);
1653 if (err < 0)
1654 goto error;
fe3eb0a7 1655
fea80fae
TI
1656 if (!spec->gen.no_analog) {
1657 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1658 if (err < 0)
1659 goto error;
1660 }
f53281e6 1661
1727a771 1662 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1663
1d045db9 1664 return 0;
e16fb6d1
TI
1665
1666 error:
1667 alc_free(codec);
1668 return err;
226b1ec8
KY
1669}
1670
1d045db9 1671
60db6b53 1672/*
1d045db9 1673 * ALC260 support
60db6b53 1674 */
1d045db9 1675static int alc260_parse_auto_config(struct hda_codec *codec)
f6a92248 1676{
1d045db9 1677 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
3e6179b8
TI
1678 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1679 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
f6a92248
KY
1680}
1681
1d045db9
TI
1682/*
1683 * Pin config fixes
1684 */
1685enum {
ca8f0424
TI
1686 ALC260_FIXUP_HP_DC5750,
1687 ALC260_FIXUP_HP_PIN_0F,
1688 ALC260_FIXUP_COEF,
15317ab2 1689 ALC260_FIXUP_GPIO1,
20f7d928
TI
1690 ALC260_FIXUP_GPIO1_TOGGLE,
1691 ALC260_FIXUP_REPLACER,
0a1c4fa2 1692 ALC260_FIXUP_HP_B1900,
118cb4a4 1693 ALC260_FIXUP_KN1,
39aedee7 1694 ALC260_FIXUP_FSC_S7020,
5ebd3bbd 1695 ALC260_FIXUP_FSC_S7020_JWSE,
d08c5ef2 1696 ALC260_FIXUP_VAIO_PINS,
1d045db9
TI
1697};
1698
20f7d928
TI
1699static void alc260_gpio1_automute(struct hda_codec *codec)
1700{
1701 struct alc_spec *spec = codec->spec;
aaf312de
TI
1702
1703 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
20f7d928
TI
1704}
1705
1706static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1727a771 1707 const struct hda_fixup *fix, int action)
20f7d928
TI
1708{
1709 struct alc_spec *spec = codec->spec;
1727a771 1710 if (action == HDA_FIXUP_ACT_PROBE) {
20f7d928
TI
1711 /* although the machine has only one output pin, we need to
1712 * toggle GPIO1 according to the jack state
1713 */
08c189f2
TI
1714 spec->gen.automute_hook = alc260_gpio1_automute;
1715 spec->gen.detect_hp = 1;
1716 spec->gen.automute_speaker = 1;
1717 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
62f949bf 1718 snd_hda_jack_detect_enable_callback(codec, 0x0f,
08c189f2 1719 snd_hda_gen_hp_automute);
5579cd6f 1720 alc_setup_gpio(codec, 0x01);
20f7d928
TI
1721 }
1722}
1723
118cb4a4 1724static void alc260_fixup_kn1(struct hda_codec *codec,
1727a771 1725 const struct hda_fixup *fix, int action)
118cb4a4
TI
1726{
1727 struct alc_spec *spec = codec->spec;
1727a771 1728 static const struct hda_pintbl pincfgs[] = {
118cb4a4
TI
1729 { 0x0f, 0x02214000 }, /* HP/speaker */
1730 { 0x12, 0x90a60160 }, /* int mic */
1731 { 0x13, 0x02a19000 }, /* ext mic */
1732 { 0x18, 0x01446000 }, /* SPDIF out */
1733 /* disable bogus I/O pins */
1734 { 0x10, 0x411111f0 },
1735 { 0x11, 0x411111f0 },
1736 { 0x14, 0x411111f0 },
1737 { 0x15, 0x411111f0 },
1738 { 0x16, 0x411111f0 },
1739 { 0x17, 0x411111f0 },
1740 { 0x19, 0x411111f0 },
1741 { }
1742 };
1743
1744 switch (action) {
1727a771
TI
1745 case HDA_FIXUP_ACT_PRE_PROBE:
1746 snd_hda_apply_pincfgs(codec, pincfgs);
118cb4a4
TI
1747 spec->init_amp = ALC_INIT_NONE;
1748 break;
1749 }
1750}
1751
39aedee7
TI
1752static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1753 const struct hda_fixup *fix, int action)
1754{
1755 struct alc_spec *spec = codec->spec;
1c76aa5f 1756 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5ebd3bbd
TI
1757 spec->init_amp = ALC_INIT_NONE;
1758}
39aedee7 1759
5ebd3bbd
TI
1760static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1761 const struct hda_fixup *fix, int action)
1762{
1763 struct alc_spec *spec = codec->spec;
1764 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
f811c3cf 1765 spec->gen.add_jack_modes = 1;
5ebd3bbd 1766 spec->gen.hp_mic = 1;
e6e0ee50 1767 }
39aedee7
TI
1768}
1769
1727a771 1770static const struct hda_fixup alc260_fixups[] = {
ca8f0424 1771 [ALC260_FIXUP_HP_DC5750] = {
1727a771
TI
1772 .type = HDA_FIXUP_PINS,
1773 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
1774 { 0x11, 0x90130110 }, /* speaker */
1775 { }
1776 }
1777 },
ca8f0424 1778 [ALC260_FIXUP_HP_PIN_0F] = {
1727a771
TI
1779 .type = HDA_FIXUP_PINS,
1780 .v.pins = (const struct hda_pintbl[]) {
ca8f0424
TI
1781 { 0x0f, 0x01214000 }, /* HP */
1782 { }
1783 }
1784 },
1785 [ALC260_FIXUP_COEF] = {
1727a771 1786 .type = HDA_FIXUP_VERBS,
ca8f0424 1787 .v.verbs = (const struct hda_verb[]) {
e30cf2d2
RM
1788 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1789 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
ca8f0424
TI
1790 { }
1791 },
ca8f0424 1792 },
15317ab2 1793 [ALC260_FIXUP_GPIO1] = {
5579cd6f
TI
1794 .type = HDA_FIXUP_FUNC,
1795 .v.func = alc_fixup_gpio1,
15317ab2 1796 },
20f7d928 1797 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1727a771 1798 .type = HDA_FIXUP_FUNC,
20f7d928
TI
1799 .v.func = alc260_fixup_gpio1_toggle,
1800 .chained = true,
1801 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1802 },
1803 [ALC260_FIXUP_REPLACER] = {
1727a771 1804 .type = HDA_FIXUP_VERBS,
20f7d928 1805 .v.verbs = (const struct hda_verb[]) {
192a98e2
TI
1806 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1807 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
20f7d928
TI
1808 { }
1809 },
1810 .chained = true,
1811 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1812 },
0a1c4fa2 1813 [ALC260_FIXUP_HP_B1900] = {
1727a771 1814 .type = HDA_FIXUP_FUNC,
0a1c4fa2
TI
1815 .v.func = alc260_fixup_gpio1_toggle,
1816 .chained = true,
1817 .chain_id = ALC260_FIXUP_COEF,
118cb4a4
TI
1818 },
1819 [ALC260_FIXUP_KN1] = {
1727a771 1820 .type = HDA_FIXUP_FUNC,
118cb4a4
TI
1821 .v.func = alc260_fixup_kn1,
1822 },
39aedee7
TI
1823 [ALC260_FIXUP_FSC_S7020] = {
1824 .type = HDA_FIXUP_FUNC,
1825 .v.func = alc260_fixup_fsc_s7020,
1826 },
5ebd3bbd
TI
1827 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1828 .type = HDA_FIXUP_FUNC,
1829 .v.func = alc260_fixup_fsc_s7020_jwse,
1830 .chained = true,
1831 .chain_id = ALC260_FIXUP_FSC_S7020,
1832 },
d08c5ef2
TI
1833 [ALC260_FIXUP_VAIO_PINS] = {
1834 .type = HDA_FIXUP_PINS,
1835 .v.pins = (const struct hda_pintbl[]) {
1836 /* Pin configs are missing completely on some VAIOs */
1837 { 0x0f, 0x01211020 },
1838 { 0x10, 0x0001003f },
1839 { 0x11, 0x411111f0 },
1840 { 0x12, 0x01a15930 },
1841 { 0x13, 0x411111f0 },
1842 { 0x14, 0x411111f0 },
1843 { 0x15, 0x411111f0 },
1844 { 0x16, 0x411111f0 },
1845 { 0x17, 0x411111f0 },
1846 { 0x18, 0x411111f0 },
1847 { 0x19, 0x411111f0 },
1848 { }
1849 }
1850 },
1d045db9
TI
1851};
1852
1853static const struct snd_pci_quirk alc260_fixup_tbl[] = {
15317ab2 1854 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
ca8f0424 1855 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
15317ab2 1856 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
ca8f0424 1857 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
0a1c4fa2 1858 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
d08c5ef2 1859 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
0f5a5b85 1860 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
39aedee7 1861 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
b1f58085 1862 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
118cb4a4 1863 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
20f7d928 1864 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
ca8f0424 1865 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1d045db9
TI
1866 {}
1867};
1868
5ebd3bbd
TI
1869static const struct hda_model_fixup alc260_fixup_models[] = {
1870 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1871 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1872 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1873 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1874 {}
1875};
1876
1d045db9
TI
1877/*
1878 */
1d045db9 1879static int patch_alc260(struct hda_codec *codec)
977ddd6b 1880{
1d045db9 1881 struct alc_spec *spec;
c3c2c9e7 1882 int err;
1d045db9 1883
3de95173
TI
1884 err = alc_alloc_spec(codec, 0x07);
1885 if (err < 0)
1886 return err;
1d045db9 1887
3de95173 1888 spec = codec->spec;
ea46c3c8
TI
1889 /* as quite a few machines require HP amp for speaker outputs,
1890 * it's easier to enable it unconditionally; even if it's unneeded,
1891 * it's almost harmless.
1892 */
1893 spec->gen.prefer_hp_amp = 1;
7504b6cd 1894 spec->gen.beep_nid = 0x01;
1d045db9 1895
225068ab
TI
1896 spec->shutup = alc_eapd_shutup;
1897
c9af753f
TI
1898 alc_pre_init(codec);
1899
5ebd3bbd
TI
1900 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1901 alc260_fixups);
1727a771 1902 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
977ddd6b 1903
c3c2c9e7
TI
1904 /* automatic parse from the BIOS config */
1905 err = alc260_parse_auto_config(codec);
1906 if (err < 0)
1907 goto error;
977ddd6b 1908
fea80fae
TI
1909 if (!spec->gen.no_analog) {
1910 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1911 if (err < 0)
1912 goto error;
1913 }
977ddd6b 1914
1727a771 1915 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 1916
1d045db9 1917 return 0;
e16fb6d1
TI
1918
1919 error:
1920 alc_free(codec);
1921 return err;
6981d184
TI
1922}
1923
1d045db9
TI
1924
1925/*
1926 * ALC882/883/885/888/889 support
1927 *
1928 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1929 * configuration. Each pin widget can choose any input DACs and a mixer.
1930 * Each ADC is connected from a mixer of all inputs. This makes possible
1931 * 6-channel independent captures.
1932 *
1933 * In addition, an independent DAC for the multi-playback (not used in this
1934 * driver yet).
1935 */
1d045db9
TI
1936
1937/*
1938 * Pin config fixes
1939 */
ff818c24 1940enum {
5c0ebfbe
TI
1941 ALC882_FIXUP_ABIT_AW9D_MAX,
1942 ALC882_FIXUP_LENOVO_Y530,
1943 ALC882_FIXUP_PB_M5210,
1944 ALC882_FIXUP_ACER_ASPIRE_7736,
1945 ALC882_FIXUP_ASUS_W90V,
8f239214 1946 ALC889_FIXUP_CD,
b2c53e20 1947 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
5c0ebfbe 1948 ALC889_FIXUP_VAIO_TT,
0e7cc2e7 1949 ALC888_FIXUP_EEE1601,
4841b8e6 1950 ALC886_FIXUP_EAPD,
177943a3 1951 ALC882_FIXUP_EAPD,
7a6069bf 1952 ALC883_FIXUP_EAPD,
8812c4f9 1953 ALC883_FIXUP_ACER_EAPD,
1a97b7f2
TI
1954 ALC882_FIXUP_GPIO1,
1955 ALC882_FIXUP_GPIO2,
eb844d51 1956 ALC882_FIXUP_GPIO3,
68ef0561
TI
1957 ALC889_FIXUP_COEF,
1958 ALC882_FIXUP_ASUS_W2JC,
c3e837bb
TI
1959 ALC882_FIXUP_ACER_ASPIRE_4930G,
1960 ALC882_FIXUP_ACER_ASPIRE_8930G,
1961 ALC882_FIXUP_ASPIRE_8930G_VERBS,
5671087f 1962 ALC885_FIXUP_MACPRO_GPIO,
02a237b2 1963 ALC889_FIXUP_DAC_ROUTE,
1a97b7f2
TI
1964 ALC889_FIXUP_MBP_VREF,
1965 ALC889_FIXUP_IMAC91_VREF,
e7729a41 1966 ALC889_FIXUP_MBA11_VREF,
0756f09c 1967 ALC889_FIXUP_MBA21_VREF,
c20f31ec 1968 ALC889_FIXUP_MP11_VREF,
9f660a1c 1969 ALC889_FIXUP_MP41_VREF,
6e72aa5f 1970 ALC882_FIXUP_INV_DMIC,
e427c237 1971 ALC882_FIXUP_NO_PRIMARY_HP,
1f0bbf03 1972 ALC887_FIXUP_ASUS_BASS,
eb9ca3ab 1973 ALC887_FIXUP_BASS_CHMAP,
7beb3a6e 1974 ALC1220_FIXUP_GB_DUAL_CODECS,
5853e364 1975 ALC1220_FIXUP_GB_X570,
0202f5cd 1976 ALC1220_FIXUP_CLEVO_P950,
80690a27
RS
1977 ALC1220_FIXUP_CLEVO_PB51ED,
1978 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
ca184355
JHP
1979 ALC887_FIXUP_ASUS_AUDIO,
1980 ALC887_FIXUP_ASUS_HMIC,
ff818c24
TI
1981};
1982
68ef0561 1983static void alc889_fixup_coef(struct hda_codec *codec,
1727a771 1984 const struct hda_fixup *fix, int action)
68ef0561 1985{
1727a771 1986 if (action != HDA_FIXUP_ACT_INIT)
68ef0561 1987 return;
1df8874b 1988 alc_update_coef_idx(codec, 7, 0, 0x2030);
68ef0561
TI
1989}
1990
5671087f
TI
1991/* set up GPIO at initialization */
1992static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1727a771 1993 const struct hda_fixup *fix, int action)
5671087f 1994{
215c850c
TI
1995 struct alc_spec *spec = codec->spec;
1996
1997 spec->gpio_write_delay = true;
1998 alc_fixup_gpio3(codec, fix, action);
5671087f
TI
1999}
2000
02a237b2
TI
2001/* Fix the connection of some pins for ALC889:
2002 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2003 * work correctly (bko#42740)
2004 */
2005static void alc889_fixup_dac_route(struct hda_codec *codec,
1727a771 2006 const struct hda_fixup *fix, int action)
02a237b2 2007{
1727a771 2008 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
ef8d60fb 2009 /* fake the connections during parsing the tree */
caf3c043
MM
2010 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2011 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2012 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2013 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2014 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2015 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1727a771 2016 } else if (action == HDA_FIXUP_ACT_PROBE) {
ef8d60fb 2017 /* restore the connections */
caf3c043
MM
2018 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2019 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2020 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2021 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2022 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
02a237b2
TI
2023 }
2024}
2025
1a97b7f2
TI
2026/* Set VREF on HP pin */
2027static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1727a771 2028 const struct hda_fixup *fix, int action)
1a97b7f2 2029{
caf3c043 2030 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1a97b7f2 2031 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2032 int i;
2033
1727a771 2034 if (action != HDA_FIXUP_ACT_INIT)
1a97b7f2
TI
2035 return;
2036 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2037 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2038 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2039 continue;
d3f02d60 2040 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2041 val |= AC_PINCTL_VREF_80;
cdd03ced 2042 snd_hda_set_pin_ctl(codec, nids[i], val);
08c189f2 2043 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2044 break;
2045 }
2046}
2047
0756f09c
TI
2048static void alc889_fixup_mac_pins(struct hda_codec *codec,
2049 const hda_nid_t *nids, int num_nids)
1a97b7f2
TI
2050{
2051 struct alc_spec *spec = codec->spec;
1a97b7f2
TI
2052 int i;
2053
0756f09c 2054 for (i = 0; i < num_nids; i++) {
1a97b7f2 2055 unsigned int val;
d3f02d60 2056 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1a97b7f2 2057 val |= AC_PINCTL_VREF_50;
cdd03ced 2058 snd_hda_set_pin_ctl(codec, nids[i], val);
1a97b7f2 2059 }
08c189f2 2060 spec->gen.keep_vref_in_automute = 1;
1a97b7f2
TI
2061}
2062
0756f09c
TI
2063/* Set VREF on speaker pins on imac91 */
2064static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2065 const struct hda_fixup *fix, int action)
2066{
caf3c043 2067 static const hda_nid_t nids[] = { 0x18, 0x1a };
0756f09c
TI
2068
2069 if (action == HDA_FIXUP_ACT_INIT)
2070 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2071}
2072
e7729a41
AV
2073/* Set VREF on speaker pins on mba11 */
2074static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2075 const struct hda_fixup *fix, int action)
2076{
caf3c043 2077 static const hda_nid_t nids[] = { 0x18 };
e7729a41
AV
2078
2079 if (action == HDA_FIXUP_ACT_INIT)
2080 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2081}
2082
0756f09c
TI
2083/* Set VREF on speaker pins on mba21 */
2084static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2085 const struct hda_fixup *fix, int action)
2086{
caf3c043 2087 static const hda_nid_t nids[] = { 0x18, 0x19 };
0756f09c
TI
2088
2089 if (action == HDA_FIXUP_ACT_INIT)
2090 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2091}
2092
e427c237 2093/* Don't take HP output as primary
d9111496
FLVC
2094 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2095 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
e427c237
TI
2096 */
2097static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1727a771 2098 const struct hda_fixup *fix, int action)
e427c237
TI
2099{
2100 struct alc_spec *spec = codec->spec;
da96fb5b 2101 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
08c189f2 2102 spec->gen.no_primary_hp = 1;
da96fb5b
TI
2103 spec->gen.no_multi_io = 1;
2104 }
e427c237
TI
2105}
2106
eb9ca3ab
TI
2107static void alc_fixup_bass_chmap(struct hda_codec *codec,
2108 const struct hda_fixup *fix, int action);
2109
7beb3a6e
TI
2110/* For dual-codec configuration, we need to disable some features to avoid
2111 * conflicts of kctls and PCM streams
2112 */
2113static void alc_fixup_dual_codecs(struct hda_codec *codec,
2114 const struct hda_fixup *fix, int action)
2115{
2116 struct alc_spec *spec = codec->spec;
2117
2118 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2119 return;
2120 /* disable vmaster */
2121 spec->gen.suppress_vmaster = 1;
2122 /* auto-mute and auto-mic switch don't work with multiple codecs */
2123 spec->gen.suppress_auto_mute = 1;
2124 spec->gen.suppress_auto_mic = 1;
2125 /* disable aamix as well */
2126 spec->gen.mixer_nid = 0;
2127 /* add location prefix to avoid conflicts */
2128 codec->force_pin_prefix = 1;
2129}
2130
2131static void rename_ctl(struct hda_codec *codec, const char *oldname,
2132 const char *newname)
2133{
2134 struct snd_kcontrol *kctl;
2135
2136 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2137 if (kctl)
2138 strcpy(kctl->id.name, newname);
2139}
2140
2141static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2142 const struct hda_fixup *fix,
2143 int action)
2144{
2145 alc_fixup_dual_codecs(codec, fix, action);
2146 switch (action) {
2147 case HDA_FIXUP_ACT_PRE_PROBE:
2148 /* override card longname to provide a unique UCM profile */
2149 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2150 break;
2151 case HDA_FIXUP_ACT_BUILD:
2152 /* rename Capture controls depending on the codec */
2153 rename_ctl(codec, "Capture Volume",
2154 codec->addr == 0 ?
2155 "Rear-Panel Capture Volume" :
2156 "Front-Panel Capture Volume");
2157 rename_ctl(codec, "Capture Switch",
2158 codec->addr == 0 ?
2159 "Rear-Panel Capture Switch" :
2160 "Front-Panel Capture Switch");
2161 break;
2162 }
2163}
2164
5853e364
CL
2165static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2166 const struct hda_fixup *fix,
2167 int action)
2168{
2169 static const hda_nid_t conn1[] = { 0x0c };
2170 static const struct coef_fw gb_x570_coefs[] = {
37b950ed 2171 WRITE_COEF(0x07, 0x03c0),
5853e364
CL
2172 WRITE_COEF(0x1a, 0x01c1),
2173 WRITE_COEF(0x1b, 0x0202),
2174 WRITE_COEF(0x43, 0x3005),
2175 {}
2176 };
2177
2178 switch (action) {
2179 case HDA_FIXUP_ACT_PRE_PROBE:
2180 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2181 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2182 break;
2183 case HDA_FIXUP_ACT_INIT:
2184 alc_process_coef_fw(codec, gb_x570_coefs);
2185 break;
2186 }
2187}
2188
0202f5cd
P
2189static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2190 const struct hda_fixup *fix,
2191 int action)
2192{
caf3c043 2193 static const hda_nid_t conn1[] = { 0x0c };
0202f5cd
P
2194
2195 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2196 return;
2197
2198 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2199 /* We therefore want to make sure 0x14 (front headphone) and
2200 * 0x1b (speakers) use the stereo DAC 0x02
2201 */
caf3c043
MM
2202 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2203 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
0202f5cd
P
2204}
2205
7f665b1c
JS
2206static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2207 const struct hda_fixup *fix, int action);
2208
80690a27 2209static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
7f665b1c
JS
2210 const struct hda_fixup *fix,
2211 int action)
2212{
2213 alc1220_fixup_clevo_p950(codec, fix, action);
2214 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2215}
2216
ca184355
JHP
2217static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2218 struct hda_jack_callback *jack)
2219{
2220 struct alc_spec *spec = codec->spec;
2221 unsigned int vref;
2222
2223 snd_hda_gen_hp_automute(codec, jack);
2224
2225 if (spec->gen.hp_jack_present)
2226 vref = AC_PINCTL_VREF_80;
2227 else
2228 vref = AC_PINCTL_VREF_HIZ;
2229 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2230}
2231
2232static void alc887_fixup_asus_jack(struct hda_codec *codec,
2233 const struct hda_fixup *fix, int action)
2234{
2235 struct alc_spec *spec = codec->spec;
2236 if (action != HDA_FIXUP_ACT_PROBE)
2237 return;
2238 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2239 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2240}
2241
1727a771 2242static const struct hda_fixup alc882_fixups[] = {
5c0ebfbe 2243 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
1727a771
TI
2244 .type = HDA_FIXUP_PINS,
2245 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2246 { 0x15, 0x01080104 }, /* side */
2247 { 0x16, 0x01011012 }, /* rear */
2248 { 0x17, 0x01016011 }, /* clfe */
2785591a 2249 { }
145a902b
DH
2250 }
2251 },
5c0ebfbe 2252 [ALC882_FIXUP_LENOVO_Y530] = {
1727a771
TI
2253 .type = HDA_FIXUP_PINS,
2254 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2255 { 0x15, 0x99130112 }, /* rear int speakers */
2256 { 0x16, 0x99130111 }, /* subwoofer */
ac612407
DH
2257 { }
2258 }
2259 },
5c0ebfbe 2260 [ALC882_FIXUP_PB_M5210] = {
fd108215
TI
2261 .type = HDA_FIXUP_PINCTLS,
2262 .v.pins = (const struct hda_pintbl[]) {
2263 { 0x19, PIN_VREF50 },
357f915e
KY
2264 {}
2265 }
2266 },
5c0ebfbe 2267 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
1727a771 2268 .type = HDA_FIXUP_FUNC,
23d30f28 2269 .v.func = alc_fixup_sku_ignore,
6981d184 2270 },
5c0ebfbe 2271 [ALC882_FIXUP_ASUS_W90V] = {
1727a771
TI
2272 .type = HDA_FIXUP_PINS,
2273 .v.pins = (const struct hda_pintbl[]) {
5cdf745e
TI
2274 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2275 { }
2276 }
2277 },
8f239214 2278 [ALC889_FIXUP_CD] = {
1727a771
TI
2279 .type = HDA_FIXUP_PINS,
2280 .v.pins = (const struct hda_pintbl[]) {
8f239214
MB
2281 { 0x1c, 0x993301f0 }, /* CD */
2282 { }
2283 }
2284 },
b2c53e20
DH
2285 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2286 .type = HDA_FIXUP_PINS,
2287 .v.pins = (const struct hda_pintbl[]) {
2288 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2289 { }
2290 },
2291 .chained = true,
2292 .chain_id = ALC889_FIXUP_CD,
2293 },
5c0ebfbe 2294 [ALC889_FIXUP_VAIO_TT] = {
1727a771
TI
2295 .type = HDA_FIXUP_PINS,
2296 .v.pins = (const struct hda_pintbl[]) {
5c0ebfbe
TI
2297 { 0x17, 0x90170111 }, /* hidden surround speaker */
2298 { }
2299 }
2300 },
0e7cc2e7 2301 [ALC888_FIXUP_EEE1601] = {
1727a771 2302 .type = HDA_FIXUP_VERBS,
0e7cc2e7
TI
2303 .v.verbs = (const struct hda_verb[]) {
2304 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2305 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2306 { }
2307 }
177943a3 2308 },
4841b8e6
PH
2309 [ALC886_FIXUP_EAPD] = {
2310 .type = HDA_FIXUP_VERBS,
2311 .v.verbs = (const struct hda_verb[]) {
2312 /* change to EAPD mode */
2313 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2314 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2315 { }
2316 }
2317 },
177943a3 2318 [ALC882_FIXUP_EAPD] = {
1727a771 2319 .type = HDA_FIXUP_VERBS,
177943a3
TI
2320 .v.verbs = (const struct hda_verb[]) {
2321 /* change to EAPD mode */
2322 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2323 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2324 { }
2325 }
2326 },
7a6069bf 2327 [ALC883_FIXUP_EAPD] = {
1727a771 2328 .type = HDA_FIXUP_VERBS,
7a6069bf
TI
2329 .v.verbs = (const struct hda_verb[]) {
2330 /* change to EAPD mode */
2331 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2332 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2333 { }
2334 }
2335 },
8812c4f9 2336 [ALC883_FIXUP_ACER_EAPD] = {
1727a771 2337 .type = HDA_FIXUP_VERBS,
8812c4f9
TI
2338 .v.verbs = (const struct hda_verb[]) {
2339 /* eanable EAPD on Acer laptops */
2340 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2341 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2342 { }
2343 }
2344 },
1a97b7f2 2345 [ALC882_FIXUP_GPIO1] = {
5579cd6f
TI
2346 .type = HDA_FIXUP_FUNC,
2347 .v.func = alc_fixup_gpio1,
1a97b7f2
TI
2348 },
2349 [ALC882_FIXUP_GPIO2] = {
5579cd6f
TI
2350 .type = HDA_FIXUP_FUNC,
2351 .v.func = alc_fixup_gpio2,
1a97b7f2 2352 },
eb844d51 2353 [ALC882_FIXUP_GPIO3] = {
5579cd6f
TI
2354 .type = HDA_FIXUP_FUNC,
2355 .v.func = alc_fixup_gpio3,
eb844d51 2356 },
68ef0561 2357 [ALC882_FIXUP_ASUS_W2JC] = {
5579cd6f
TI
2358 .type = HDA_FIXUP_FUNC,
2359 .v.func = alc_fixup_gpio1,
68ef0561
TI
2360 .chained = true,
2361 .chain_id = ALC882_FIXUP_EAPD,
2362 },
2363 [ALC889_FIXUP_COEF] = {
1727a771 2364 .type = HDA_FIXUP_FUNC,
68ef0561
TI
2365 .v.func = alc889_fixup_coef,
2366 },
c3e837bb 2367 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
1727a771
TI
2368 .type = HDA_FIXUP_PINS,
2369 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2370 { 0x16, 0x99130111 }, /* CLFE speaker */
2371 { 0x17, 0x99130112 }, /* surround speaker */
2372 { }
038d4fef
TI
2373 },
2374 .chained = true,
2375 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb
TI
2376 },
2377 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
1727a771
TI
2378 .type = HDA_FIXUP_PINS,
2379 .v.pins = (const struct hda_pintbl[]) {
c3e837bb
TI
2380 { 0x16, 0x99130111 }, /* CLFE speaker */
2381 { 0x1b, 0x99130112 }, /* surround speaker */
2382 { }
2383 },
2384 .chained = true,
2385 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2386 },
2387 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2388 /* additional init verbs for Acer Aspire 8930G */
1727a771 2389 .type = HDA_FIXUP_VERBS,
c3e837bb
TI
2390 .v.verbs = (const struct hda_verb[]) {
2391 /* Enable all DACs */
2392 /* DAC DISABLE/MUTE 1? */
2393 /* setting bits 1-5 disables DAC nids 0x02-0x06
2394 * apparently. Init=0x38 */
2395 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2396 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2397 /* DAC DISABLE/MUTE 2? */
2398 /* some bit here disables the other DACs.
2399 * Init=0x4900 */
2400 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2401 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2402 /* DMIC fix
2403 * This laptop has a stereo digital microphone.
2404 * The mics are only 1cm apart which makes the stereo
2405 * useless. However, either the mic or the ALC889
2406 * makes the signal become a difference/sum signal
2407 * instead of standard stereo, which is annoying.
2408 * So instead we flip this bit which makes the
2409 * codec replicate the sum signal to both channels,
2410 * turning it into a normal mono mic.
2411 */
2412 /* DMIC_CONTROL? Init value = 0x0001 */
2413 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2414 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2415 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2416 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2417 { }
038d4fef
TI
2418 },
2419 .chained = true,
2420 .chain_id = ALC882_FIXUP_GPIO1,
c3e837bb 2421 },
5671087f 2422 [ALC885_FIXUP_MACPRO_GPIO] = {
1727a771 2423 .type = HDA_FIXUP_FUNC,
5671087f
TI
2424 .v.func = alc885_fixup_macpro_gpio,
2425 },
02a237b2 2426 [ALC889_FIXUP_DAC_ROUTE] = {
1727a771 2427 .type = HDA_FIXUP_FUNC,
02a237b2
TI
2428 .v.func = alc889_fixup_dac_route,
2429 },
1a97b7f2 2430 [ALC889_FIXUP_MBP_VREF] = {
1727a771 2431 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2432 .v.func = alc889_fixup_mbp_vref,
2433 .chained = true,
2434 .chain_id = ALC882_FIXUP_GPIO1,
2435 },
2436 [ALC889_FIXUP_IMAC91_VREF] = {
1727a771 2437 .type = HDA_FIXUP_FUNC,
1a97b7f2
TI
2438 .v.func = alc889_fixup_imac91_vref,
2439 .chained = true,
2440 .chain_id = ALC882_FIXUP_GPIO1,
2441 },
e7729a41
AV
2442 [ALC889_FIXUP_MBA11_VREF] = {
2443 .type = HDA_FIXUP_FUNC,
2444 .v.func = alc889_fixup_mba11_vref,
2445 .chained = true,
2446 .chain_id = ALC889_FIXUP_MBP_VREF,
2447 },
0756f09c
TI
2448 [ALC889_FIXUP_MBA21_VREF] = {
2449 .type = HDA_FIXUP_FUNC,
2450 .v.func = alc889_fixup_mba21_vref,
2451 .chained = true,
2452 .chain_id = ALC889_FIXUP_MBP_VREF,
2453 },
c20f31ec
TI
2454 [ALC889_FIXUP_MP11_VREF] = {
2455 .type = HDA_FIXUP_FUNC,
2456 .v.func = alc889_fixup_mba11_vref,
2457 .chained = true,
2458 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2459 },
9f660a1c
MK
2460 [ALC889_FIXUP_MP41_VREF] = {
2461 .type = HDA_FIXUP_FUNC,
2462 .v.func = alc889_fixup_mbp_vref,
2463 .chained = true,
2464 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2465 },
6e72aa5f 2466 [ALC882_FIXUP_INV_DMIC] = {
1727a771 2467 .type = HDA_FIXUP_FUNC,
9d36a7dc 2468 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2469 },
e427c237 2470 [ALC882_FIXUP_NO_PRIMARY_HP] = {
1727a771 2471 .type = HDA_FIXUP_FUNC,
e427c237
TI
2472 .v.func = alc882_fixup_no_primary_hp,
2473 },
1f0bbf03
TI
2474 [ALC887_FIXUP_ASUS_BASS] = {
2475 .type = HDA_FIXUP_PINS,
2476 .v.pins = (const struct hda_pintbl[]) {
2477 {0x16, 0x99130130}, /* bass speaker */
2478 {}
2479 },
eb9ca3ab
TI
2480 .chained = true,
2481 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2482 },
2483 [ALC887_FIXUP_BASS_CHMAP] = {
2484 .type = HDA_FIXUP_FUNC,
2485 .v.func = alc_fixup_bass_chmap,
1f0bbf03 2486 },
7beb3a6e
TI
2487 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2488 .type = HDA_FIXUP_FUNC,
2489 .v.func = alc1220_fixup_gb_dual_codecs,
2490 },
5853e364
CL
2491 [ALC1220_FIXUP_GB_X570] = {
2492 .type = HDA_FIXUP_FUNC,
2493 .v.func = alc1220_fixup_gb_x570,
2494 },
0202f5cd
P
2495 [ALC1220_FIXUP_CLEVO_P950] = {
2496 .type = HDA_FIXUP_FUNC,
2497 .v.func = alc1220_fixup_clevo_p950,
2498 },
80690a27 2499 [ALC1220_FIXUP_CLEVO_PB51ED] = {
7f665b1c 2500 .type = HDA_FIXUP_FUNC,
80690a27 2501 .v.func = alc1220_fixup_clevo_pb51ed,
7f665b1c 2502 },
80690a27 2503 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
7f665b1c
JS
2504 .type = HDA_FIXUP_PINS,
2505 .v.pins = (const struct hda_pintbl[]) {
2506 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2507 {}
2508 },
2509 .chained = true,
80690a27 2510 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
7f665b1c 2511 },
ca184355
JHP
2512 [ALC887_FIXUP_ASUS_AUDIO] = {
2513 .type = HDA_FIXUP_PINS,
2514 .v.pins = (const struct hda_pintbl[]) {
2515 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2516 { 0x19, 0x22219420 },
2517 {}
2518 },
2519 },
2520 [ALC887_FIXUP_ASUS_HMIC] = {
2521 .type = HDA_FIXUP_FUNC,
2522 .v.func = alc887_fixup_asus_jack,
2523 .chained = true,
2524 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2525 },
ff818c24
TI
2526};
2527
1d045db9 2528static const struct snd_pci_quirk alc882_fixup_tbl[] = {
8812c4f9
TI
2529 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2530 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
b5d724b1 2531 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
8812c4f9
TI
2532 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2533 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2534 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2535 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
c3e837bb
TI
2536 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2537 ALC882_FIXUP_ACER_ASPIRE_4930G),
2538 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2539 ALC882_FIXUP_ACER_ASPIRE_4930G),
2540 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2541 ALC882_FIXUP_ACER_ASPIRE_8930G),
2542 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2543 ALC882_FIXUP_ACER_ASPIRE_8930G),
b265047a
TI
2544 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2545 ALC882_FIXUP_ACER_ASPIRE_4930G),
2546 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
c3e837bb
TI
2547 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2548 ALC882_FIXUP_ACER_ASPIRE_4930G),
2549 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2550 ALC882_FIXUP_ACER_ASPIRE_4930G),
f5c53d89
TI
2551 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2552 ALC882_FIXUP_ACER_ASPIRE_4930G),
02a237b2 2553 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
fe97da1f 2554 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
ac9b1cdd 2555 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
177943a3 2556 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
5c0ebfbe 2557 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
68ef0561 2558 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
ca184355 2559 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
0e7cc2e7 2560 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
1f0bbf03 2561 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
85bcf96c 2562 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
b7529c18
TI
2563 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2564 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
ac9b1cdd 2565 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
e427c237 2566 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
3f3c3714 2567 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
5671087f
TI
2568
2569 /* All Apple entries are in codec SSIDs */
1a97b7f2
TI
2570 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2571 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2572 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
c20f31ec 2573 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
5671087f
TI
2574 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2575 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2576 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2577 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
5671087f 2578 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
e7729a41 2579 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
0756f09c 2580 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
1a97b7f2
TI
2581 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2582 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
5671087f 2583 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
1a97b7f2
TI
2584 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2585 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2586 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
9f660a1c 2587 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
05193639 2588 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
1a97b7f2
TI
2589 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2590 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
649ccd08 2591 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
5671087f 2592
7a6069bf 2593 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
4841b8e6 2594 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
b2c53e20 2595 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
7beb3a6e 2596 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
5853e364 2597 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
e6ff6e2c 2598 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
37b950ed 2599 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
a0b03952 2600 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
a655e2b1 2601 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
09926202 2602 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
1d3aa4a5 2603 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
7dafba37 2604 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
cc5049ae 2605 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
d2c3b14e 2606 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
26af1772 2607 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
63691587 2608 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
d2c3b14e 2609 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5c0ebfbe 2610 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
13e1a4cd
TI
2611 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2612 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2613 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2614 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2615 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
aef454b4 2616 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd
TI
2617 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2618 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2619 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
a7182ce8 2620 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
13e1a4cd 2621 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1f8d398e 2622 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
cc03069a 2623 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
0202f5cd 2624 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2625 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
13e1a4cd 2626 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
f3d737b6 2627 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2f0d520a 2628 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
b5acfe15
PH
2629 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2630 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2631 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2632 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
503d90b3
RS
2633 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2634 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
b5acfe15 2635 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
7a6069bf
TI
2636 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2637 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
ac9b1cdd 2638 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
68ef0561 2639 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
ff818c24
TI
2640 {}
2641};
2642
1727a771 2643static const struct hda_model_fixup alc882_fixup_models[] = {
772c2917
TI
2644 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2645 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2646 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2647 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2648 {.id = ALC889_FIXUP_CD, .name = "cd"},
2649 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2650 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2651 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2652 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2653 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2654 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2655 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2656 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2657 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2658 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
912093bc
TI
2659 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2660 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2661 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
772c2917
TI
2662 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2663 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2664 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2665 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2666 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2667 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2668 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2669 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
6e72aa5f 2670 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
e427c237 2671 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
772c2917 2672 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
ba90d6a6 2673 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
f05b4fdb 2674 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
772c2917 2675 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
912093bc
TI
2676 {}
2677};
2678
119b75c1
HW
2679static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2680 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2681 {0x14, 0x01014010},
2682 {0x15, 0x01011012},
2683 {0x16, 0x01016011},
2684 {0x18, 0x01a19040},
2685 {0x19, 0x02a19050},
2686 {0x1a, 0x0181304f},
2687 {0x1b, 0x0221401f},
2688 {0x1e, 0x01456130}),
2689 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2690 {0x14, 0x01015010},
2691 {0x15, 0x01011012},
2692 {0x16, 0x01011011},
2693 {0x18, 0x01a11040},
2694 {0x19, 0x02a19050},
2695 {0x1a, 0x0181104f},
2696 {0x1b, 0x0221401f},
2697 {0x1e, 0x01451130}),
2698 {}
2699};
2700
f6a92248 2701/*
1d045db9 2702 * BIOS auto configuration
f6a92248 2703 */
1d045db9
TI
2704/* almost identical with ALC880 parser... */
2705static int alc882_parse_auto_config(struct hda_codec *codec)
2706{
1d045db9 2707 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2708 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2709 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
1d045db9 2710}
b896b4eb 2711
1d045db9
TI
2712/*
2713 */
1d045db9 2714static int patch_alc882(struct hda_codec *codec)
f6a92248
KY
2715{
2716 struct alc_spec *spec;
1a97b7f2 2717 int err;
f6a92248 2718
3de95173
TI
2719 err = alc_alloc_spec(codec, 0x0b);
2720 if (err < 0)
2721 return err;
f6a92248 2722
3de95173 2723 spec = codec->spec;
1f0f4b80 2724
7639a06c 2725 switch (codec->core.vendor_id) {
1d045db9
TI
2726 case 0x10ec0882:
2727 case 0x10ec0885:
acf08081 2728 case 0x10ec0900:
6d9ffcff 2729 case 0x10ec0b00:
a535ad57 2730 case 0x10ec1220:
1d045db9
TI
2731 break;
2732 default:
2733 /* ALC883 and variants */
2734 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2735 break;
c793bec5 2736 }
977ddd6b 2737
c9af753f
TI
2738 alc_pre_init(codec);
2739
1727a771 2740 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
912093bc 2741 alc882_fixups);
119b75c1 2742 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
1727a771 2743 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
ff818c24 2744
1d045db9
TI
2745 alc_auto_parse_customize_define(codec);
2746
7504b6cd
TI
2747 if (has_cdefine_beep(codec))
2748 spec->gen.beep_nid = 0x01;
2749
1a97b7f2
TI
2750 /* automatic parse from the BIOS config */
2751 err = alc882_parse_auto_config(codec);
2752 if (err < 0)
2753 goto error;
f6a92248 2754
fea80fae
TI
2755 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2756 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2757 if (err < 0)
2758 goto error;
2759 }
f6a92248 2760
1727a771 2761 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2762
f6a92248 2763 return 0;
e16fb6d1
TI
2764
2765 error:
2766 alc_free(codec);
2767 return err;
f6a92248
KY
2768}
2769
df694daa 2770
df694daa 2771/*
1d045db9 2772 * ALC262 support
df694daa 2773 */
1d045db9 2774static int alc262_parse_auto_config(struct hda_codec *codec)
df694daa 2775{
1d045db9 2776 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
3e6179b8
TI
2777 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2778 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
df694daa
KY
2779}
2780
df694daa 2781/*
1d045db9 2782 * Pin config fixes
df694daa 2783 */
cfc9b06f 2784enum {
ea4e7af1 2785 ALC262_FIXUP_FSC_H270,
7513e6da 2786 ALC262_FIXUP_FSC_S7110,
ea4e7af1
TI
2787 ALC262_FIXUP_HP_Z200,
2788 ALC262_FIXUP_TYAN,
c470150c 2789 ALC262_FIXUP_LENOVO_3000,
b42590b8
TI
2790 ALC262_FIXUP_BENQ,
2791 ALC262_FIXUP_BENQ_T31,
6e72aa5f 2792 ALC262_FIXUP_INV_DMIC,
b5c6611f 2793 ALC262_FIXUP_INTEL_BAYLEYBAY,
cfc9b06f
TI
2794};
2795
1727a771 2796static const struct hda_fixup alc262_fixups[] = {
ea4e7af1 2797 [ALC262_FIXUP_FSC_H270] = {
1727a771
TI
2798 .type = HDA_FIXUP_PINS,
2799 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
2800 { 0x14, 0x99130110 }, /* speaker */
2801 { 0x15, 0x0221142f }, /* front HP */
2802 { 0x1b, 0x0121141f }, /* rear HP */
2803 { }
2804 }
2805 },
7513e6da
TI
2806 [ALC262_FIXUP_FSC_S7110] = {
2807 .type = HDA_FIXUP_PINS,
2808 .v.pins = (const struct hda_pintbl[]) {
2809 { 0x15, 0x90170110 }, /* speaker */
2810 { }
2811 },
2812 .chained = true,
2813 .chain_id = ALC262_FIXUP_BENQ,
2814 },
ea4e7af1 2815 [ALC262_FIXUP_HP_Z200] = {
1727a771
TI
2816 .type = HDA_FIXUP_PINS,
2817 .v.pins = (const struct hda_pintbl[]) {
1d045db9 2818 { 0x16, 0x99130120 }, /* internal speaker */
73413b12
TI
2819 { }
2820 }
cfc9b06f 2821 },
ea4e7af1 2822 [ALC262_FIXUP_TYAN] = {
1727a771
TI
2823 .type = HDA_FIXUP_PINS,
2824 .v.pins = (const struct hda_pintbl[]) {
ea4e7af1
TI
2825 { 0x14, 0x1993e1f0 }, /* int AUX */
2826 { }
2827 }
2828 },
c470150c 2829 [ALC262_FIXUP_LENOVO_3000] = {
fd108215
TI
2830 .type = HDA_FIXUP_PINCTLS,
2831 .v.pins = (const struct hda_pintbl[]) {
2832 { 0x19, PIN_VREF50 },
b42590b8
TI
2833 {}
2834 },
2835 .chained = true,
2836 .chain_id = ALC262_FIXUP_BENQ,
2837 },
2838 [ALC262_FIXUP_BENQ] = {
1727a771 2839 .type = HDA_FIXUP_VERBS,
b42590b8 2840 .v.verbs = (const struct hda_verb[]) {
c470150c
TI
2841 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2842 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2843 {}
2844 }
2845 },
b42590b8 2846 [ALC262_FIXUP_BENQ_T31] = {
1727a771 2847 .type = HDA_FIXUP_VERBS,
b42590b8
TI
2848 .v.verbs = (const struct hda_verb[]) {
2849 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2850 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2851 {}
2852 }
2853 },
6e72aa5f 2854 [ALC262_FIXUP_INV_DMIC] = {
1727a771 2855 .type = HDA_FIXUP_FUNC,
9d36a7dc 2856 .v.func = alc_fixup_inv_dmic,
6e72aa5f 2857 },
b5c6611f
ML
2858 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2859 .type = HDA_FIXUP_FUNC,
2860 .v.func = alc_fixup_no_depop_delay,
2861 },
cfc9b06f
TI
2862};
2863
1d045db9 2864static const struct snd_pci_quirk alc262_fixup_tbl[] = {
ea4e7af1 2865 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
7513e6da 2866 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
3dcd3be3 2867 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
ea4e7af1 2868 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
275ec0cb 2869 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
ea4e7af1 2870 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
c470150c 2871 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
b42590b8
TI
2872 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2873 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
b5c6611f 2874 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
cfc9b06f
TI
2875 {}
2876};
df694daa 2877
1727a771 2878static const struct hda_model_fixup alc262_fixup_models[] = {
6e72aa5f 2879 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
e43c44d6
TI
2880 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2881 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2882 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2883 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2884 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2885 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2886 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2887 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
6e72aa5f
TI
2888 {}
2889};
1d045db9 2890
1d045db9
TI
2891/*
2892 */
1d045db9 2893static int patch_alc262(struct hda_codec *codec)
df694daa
KY
2894{
2895 struct alc_spec *spec;
df694daa
KY
2896 int err;
2897
3de95173
TI
2898 err = alc_alloc_spec(codec, 0x0b);
2899 if (err < 0)
2900 return err;
df694daa 2901
3de95173 2902 spec = codec->spec;
08c189f2 2903 spec->gen.shared_mic_vref_pin = 0x18;
1d045db9 2904
225068ab
TI
2905 spec->shutup = alc_eapd_shutup;
2906
1d045db9
TI
2907#if 0
2908 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2909 * under-run
2910 */
98b24883 2911 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
1d045db9 2912#endif
1d045db9
TI
2913 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2914
c9af753f
TI
2915 alc_pre_init(codec);
2916
1727a771 2917 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
6e72aa5f 2918 alc262_fixups);
1727a771 2919 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9c7f852e 2920
af741c15
TI
2921 alc_auto_parse_customize_define(codec);
2922
7504b6cd
TI
2923 if (has_cdefine_beep(codec))
2924 spec->gen.beep_nid = 0x01;
2925
42399f7a
TI
2926 /* automatic parse from the BIOS config */
2927 err = alc262_parse_auto_config(codec);
2928 if (err < 0)
2929 goto error;
df694daa 2930
fea80fae
TI
2931 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2932 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2933 if (err < 0)
2934 goto error;
2935 }
2134ea4f 2936
1727a771 2937 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 2938
1da177e4 2939 return 0;
e16fb6d1
TI
2940
2941 error:
2942 alc_free(codec);
2943 return err;
1da177e4
LT
2944}
2945
f32610ed 2946/*
1d045db9 2947 * ALC268
f32610ed 2948 */
1d045db9 2949/* bind Beep switches of both NID 0x0f and 0x10 */
a717777d
TI
2950static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2951 struct snd_ctl_elem_value *ucontrol)
2952{
2953 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2954 unsigned long pval;
2955 int err;
2956
2957 mutex_lock(&codec->control_mutex);
2958 pval = kcontrol->private_value;
2959 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2960 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2961 if (err >= 0) {
2962 kcontrol->private_value = (pval & ~0xff) | 0x10;
2963 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2964 }
2965 kcontrol->private_value = pval;
2966 mutex_unlock(&codec->control_mutex);
2967 return err;
2968}
f32610ed 2969
1d045db9
TI
2970static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2971 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
a717777d
TI
2972 {
2973 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2974 .name = "Beep Playback Switch",
2975 .subdevice = HDA_SUBDEV_AMP_FLAG,
2976 .info = snd_hda_mixer_amp_switch_info,
2977 .get = snd_hda_mixer_amp_switch_get,
2978 .put = alc268_beep_switch_put,
2979 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2980 },
f32610ed
JS
2981};
2982
1d045db9
TI
2983/* set PCBEEP vol = 0, mute connections */
2984static const struct hda_verb alc268_beep_init_verbs[] = {
2985 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2986 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2987 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2988 { }
f32610ed
JS
2989};
2990
6e72aa5f
TI
2991enum {
2992 ALC268_FIXUP_INV_DMIC,
cb766404 2993 ALC268_FIXUP_HP_EAPD,
24eff328 2994 ALC268_FIXUP_SPDIF,
6e72aa5f
TI
2995};
2996
1727a771 2997static const struct hda_fixup alc268_fixups[] = {
6e72aa5f 2998 [ALC268_FIXUP_INV_DMIC] = {
1727a771 2999 .type = HDA_FIXUP_FUNC,
9d36a7dc 3000 .v.func = alc_fixup_inv_dmic,
6e72aa5f 3001 },
cb766404 3002 [ALC268_FIXUP_HP_EAPD] = {
1727a771 3003 .type = HDA_FIXUP_VERBS,
cb766404
TI
3004 .v.verbs = (const struct hda_verb[]) {
3005 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3006 {}
3007 }
3008 },
24eff328
TI
3009 [ALC268_FIXUP_SPDIF] = {
3010 .type = HDA_FIXUP_PINS,
3011 .v.pins = (const struct hda_pintbl[]) {
3012 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3013 {}
3014 }
3015 },
6e72aa5f
TI
3016};
3017
1727a771 3018static const struct hda_model_fixup alc268_fixup_models[] = {
6e72aa5f 3019 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
cb766404 3020 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
03bf11c9 3021 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
cb766404
TI
3022 {}
3023};
3024
3025static const struct snd_pci_quirk alc268_fixup_tbl[] = {
24eff328 3026 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
fcd8f3b1 3027 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
cb766404
TI
3028 /* below is codec SSID since multiple Toshiba laptops have the
3029 * same PCI SSID 1179:ff00
3030 */
3031 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
6e72aa5f
TI
3032 {}
3033};
3034
f32610ed
JS
3035/*
3036 * BIOS auto configuration
3037 */
1d045db9 3038static int alc268_parse_auto_config(struct hda_codec *codec)
f32610ed 3039{
3e6179b8 3040 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7504b6cd 3041 return alc_parse_auto_config(codec, NULL, alc268_ssids);
f32610ed
JS
3042}
3043
1d045db9
TI
3044/*
3045 */
1d045db9 3046static int patch_alc268(struct hda_codec *codec)
f32610ed
JS
3047{
3048 struct alc_spec *spec;
a5cb463a 3049 int i, err;
f32610ed 3050
1d045db9 3051 /* ALC268 has no aa-loopback mixer */
3de95173
TI
3052 err = alc_alloc_spec(codec, 0);
3053 if (err < 0)
3054 return err;
3055
3056 spec = codec->spec;
2722b535
TI
3057 if (has_cdefine_beep(codec))
3058 spec->gen.beep_nid = 0x01;
1f0f4b80 3059
225068ab
TI
3060 spec->shutup = alc_eapd_shutup;
3061
c9af753f
TI
3062 alc_pre_init(codec);
3063
1727a771
TI
3064 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3065 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
6e72aa5f 3066
6ebb8053
TI
3067 /* automatic parse from the BIOS config */
3068 err = alc268_parse_auto_config(codec);
e16fb6d1
TI
3069 if (err < 0)
3070 goto error;
f32610ed 3071
7504b6cd
TI
3072 if (err > 0 && !spec->gen.no_analog &&
3073 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
a5cb463a
TI
3074 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3075 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3076 &alc268_beep_mixer[i])) {
3077 err = -ENOMEM;
3078 goto error;
3079 }
3080 }
7504b6cd 3081 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
1d045db9
TI
3082 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3083 /* override the amp caps for beep generator */
3084 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3085 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3086 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3087 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3088 (0 << AC_AMPCAP_MUTE_SHIFT));
2f893286
KY
3089 }
3090
1727a771 3091 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
6e72aa5f 3092
f32610ed 3093 return 0;
e16fb6d1
TI
3094
3095 error:
3096 alc_free(codec);
3097 return err;
f32610ed
JS
3098}
3099
bc9f98a9 3100/*
1d045db9 3101 * ALC269
bc9f98a9 3102 */
08c189f2 3103
1d045db9 3104static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
1d045db9 3105 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9
KY
3106};
3107
1d045db9 3108static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
1d045db9 3109 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
bc9f98a9 3110};
291702f0 3111
1d045db9
TI
3112/* different alc269-variants */
3113enum {
3114 ALC269_TYPE_ALC269VA,
3115 ALC269_TYPE_ALC269VB,
3116 ALC269_TYPE_ALC269VC,
adcc70b2 3117 ALC269_TYPE_ALC269VD,
065380f0
KY
3118 ALC269_TYPE_ALC280,
3119 ALC269_TYPE_ALC282,
2af02be7 3120 ALC269_TYPE_ALC283,
065380f0 3121 ALC269_TYPE_ALC284,
4731d5de 3122 ALC269_TYPE_ALC293,
7fc7d047 3123 ALC269_TYPE_ALC286,
506b62c3 3124 ALC269_TYPE_ALC298,
1d04c9de 3125 ALC269_TYPE_ALC255,
4344aec8 3126 ALC269_TYPE_ALC256,
f429e7e4 3127 ALC269_TYPE_ALC257,
0a6f0600 3128 ALC269_TYPE_ALC215,
4231430d 3129 ALC269_TYPE_ALC225,
99cee034 3130 ALC269_TYPE_ALC287,
dcd4f0db 3131 ALC269_TYPE_ALC294,
1078bef0 3132 ALC269_TYPE_ALC300,
f0778871 3133 ALC269_TYPE_ALC623,
6fbae35a 3134 ALC269_TYPE_ALC700,
bc9f98a9
KY
3135};
3136
3137/*
1d045db9 3138 * BIOS auto configuration
bc9f98a9 3139 */
1d045db9
TI
3140static int alc269_parse_auto_config(struct hda_codec *codec)
3141{
1d045db9 3142 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3e6179b8
TI
3143 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3144 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3145 struct alc_spec *spec = codec->spec;
adcc70b2
KY
3146 const hda_nid_t *ssids;
3147
3148 switch (spec->codec_variant) {
3149 case ALC269_TYPE_ALC269VA:
3150 case ALC269_TYPE_ALC269VC:
065380f0
KY
3151 case ALC269_TYPE_ALC280:
3152 case ALC269_TYPE_ALC284:
4731d5de 3153 case ALC269_TYPE_ALC293:
adcc70b2
KY
3154 ssids = alc269va_ssids;
3155 break;
3156 case ALC269_TYPE_ALC269VB:
3157 case ALC269_TYPE_ALC269VD:
065380f0 3158 case ALC269_TYPE_ALC282:
2af02be7 3159 case ALC269_TYPE_ALC283:
7fc7d047 3160 case ALC269_TYPE_ALC286:
506b62c3 3161 case ALC269_TYPE_ALC298:
1d04c9de 3162 case ALC269_TYPE_ALC255:
4344aec8 3163 case ALC269_TYPE_ALC256:
f429e7e4 3164 case ALC269_TYPE_ALC257:
0a6f0600 3165 case ALC269_TYPE_ALC215:
4231430d 3166 case ALC269_TYPE_ALC225:
99cee034 3167 case ALC269_TYPE_ALC287:
dcd4f0db 3168 case ALC269_TYPE_ALC294:
1078bef0 3169 case ALC269_TYPE_ALC300:
f0778871 3170 case ALC269_TYPE_ALC623:
6fbae35a 3171 case ALC269_TYPE_ALC700:
adcc70b2
KY
3172 ssids = alc269_ssids;
3173 break;
3174 default:
3175 ssids = alc269_ssids;
3176 break;
3177 }
bc9f98a9 3178
3e6179b8 3179 return alc_parse_auto_config(codec, alc269_ignore, ssids);
1d045db9 3180}
bc9f98a9 3181
476c02e0
HW
3182static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3183 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3184 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3185 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3186 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3187 {}
3188};
3189
3190static void alc_headset_btn_callback(struct hda_codec *codec,
3191 struct hda_jack_callback *jack)
3192{
3193 int report = 0;
3194
3195 if (jack->unsol_res & (7 << 13))
3196 report |= SND_JACK_BTN_0;
3197
3198 if (jack->unsol_res & (1 << 16 | 3 << 8))
3199 report |= SND_JACK_BTN_1;
3200
3201 /* Volume up key */
3202 if (jack->unsol_res & (7 << 23))
3203 report |= SND_JACK_BTN_2;
3204
3205 /* Volume down key */
3206 if (jack->unsol_res & (7 << 10))
3207 report |= SND_JACK_BTN_3;
3208
04f7791b 3209 snd_hda_jack_set_button_state(codec, jack->nid, report);
476c02e0
HW
3210}
3211
3212static void alc_disable_headset_jack_key(struct hda_codec *codec)
3213{
3214 struct alc_spec *spec = codec->spec;
3215
3216 if (!spec->has_hs_key)
3217 return;
3218
3219 switch (codec->core.vendor_id) {
3220 case 0x10ec0215:
3221 case 0x10ec0225:
3222 case 0x10ec0285:
c72b9bfe 3223 case 0x10ec0287:
476c02e0
HW
3224 case 0x10ec0295:
3225 case 0x10ec0289:
3226 case 0x10ec0299:
3227 alc_write_coef_idx(codec, 0x48, 0x0);
3228 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3229 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3230 break;
1948fc06 3231 case 0x10ec0230:
476c02e0
HW
3232 case 0x10ec0236:
3233 case 0x10ec0256:
3234 alc_write_coef_idx(codec, 0x48, 0x0);
3235 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3236 break;
3237 }
3238}
3239
3240static void alc_enable_headset_jack_key(struct hda_codec *codec)
3241{
3242 struct alc_spec *spec = codec->spec;
3243
3244 if (!spec->has_hs_key)
3245 return;
3246
3247 switch (codec->core.vendor_id) {
3248 case 0x10ec0215:
3249 case 0x10ec0225:
3250 case 0x10ec0285:
c72b9bfe 3251 case 0x10ec0287:
476c02e0
HW
3252 case 0x10ec0295:
3253 case 0x10ec0289:
3254 case 0x10ec0299:
3255 alc_write_coef_idx(codec, 0x48, 0xd011);
3256 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3257 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3258 break;
1948fc06 3259 case 0x10ec0230:
476c02e0
HW
3260 case 0x10ec0236:
3261 case 0x10ec0256:
3262 alc_write_coef_idx(codec, 0x48, 0xd011);
3263 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3264 break;
3265 }
3266}
3267
3268static void alc_fixup_headset_jack(struct hda_codec *codec,
3269 const struct hda_fixup *fix, int action)
3270{
3271 struct alc_spec *spec = codec->spec;
04f7791b 3272 hda_nid_t hp_pin;
476c02e0
HW
3273
3274 switch (action) {
3275 case HDA_FIXUP_ACT_PRE_PROBE:
3276 spec->has_hs_key = 1;
3277 snd_hda_jack_detect_enable_callback(codec, 0x55,
3278 alc_headset_btn_callback);
476c02e0 3279 break;
04f7791b
HW
3280 case HDA_FIXUP_ACT_BUILD:
3281 hp_pin = alc_get_hp_pin(spec);
3282 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3283 alc_headset_btn_keymap,
3284 hp_pin))
3285 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3286 false, SND_JACK_HEADSET,
3287 alc_headset_btn_keymap);
3288
476c02e0
HW
3289 alc_enable_headset_jack_key(codec);
3290 break;
3291 }
3292}
3293
1387e2d1 3294static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
1d045db9 3295{
98b24883 3296 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
1d045db9 3297}
291702f0 3298
1d045db9
TI
3299static void alc269_shutup(struct hda_codec *codec)
3300{
adcc70b2
KY
3301 struct alc_spec *spec = codec->spec;
3302
1387e2d1
KY
3303 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3304 alc269vb_toggle_power_output(codec, 0);
3305 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3306 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
3307 msleep(150);
3308 }
c0ca5ece 3309 alc_shutup_pins(codec);
1d045db9 3310}
291702f0 3311
6b0f95c4 3312static const struct coef_fw alc282_coefs[] = {
54db6c39 3313 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
32fa7e49 3314 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3315 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3316 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3317 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3318 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3319 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3320 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3321 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3322 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3323 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3324 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3325 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3326 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3327 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3328 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3329 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3330 WRITE_COEF(0x63, 0x2902), /* PLL */
3331 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3332 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3333 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3334 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3335 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3336 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3337 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3338 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3339 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3340 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3341 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3342 {}
3343};
3344
cb149cb3
KY
3345static void alc282_restore_default_value(struct hda_codec *codec)
3346{
54db6c39 3347 alc_process_coef_fw(codec, alc282_coefs);
cb149cb3
KY
3348}
3349
7b5c7a02
KY
3350static void alc282_init(struct hda_codec *codec)
3351{
3352 struct alc_spec *spec = codec->spec;
35a39f98 3353 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3354 bool hp_pin_sense;
3355 int coef78;
3356
cb149cb3
KY
3357 alc282_restore_default_value(codec);
3358
7b5c7a02
KY
3359 if (!hp_pin)
3360 return;
3361 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3362 coef78 = alc_read_coef_idx(codec, 0x78);
3363
3364 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3365 /* Headphone capless set to high power mode */
3366 alc_write_coef_idx(codec, 0x78, 0x9004);
3367
3368 if (hp_pin_sense)
3369 msleep(2);
3370
3371 snd_hda_codec_write(codec, hp_pin, 0,
3372 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3373
3374 if (hp_pin_sense)
3375 msleep(85);
3376
3377 snd_hda_codec_write(codec, hp_pin, 0,
3378 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3379
3380 if (hp_pin_sense)
3381 msleep(100);
3382
3383 /* Headphone capless set to normal mode */
3384 alc_write_coef_idx(codec, 0x78, coef78);
3385}
3386
3387static void alc282_shutup(struct hda_codec *codec)
3388{
3389 struct alc_spec *spec = codec->spec;
35a39f98 3390 hda_nid_t hp_pin = alc_get_hp_pin(spec);
7b5c7a02
KY
3391 bool hp_pin_sense;
3392 int coef78;
3393
3394 if (!hp_pin) {
3395 alc269_shutup(codec);
3396 return;
3397 }
3398
3399 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3400 coef78 = alc_read_coef_idx(codec, 0x78);
3401 alc_write_coef_idx(codec, 0x78, 0x9004);
3402
3403 if (hp_pin_sense)
3404 msleep(2);
3405
3406 snd_hda_codec_write(codec, hp_pin, 0,
3407 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3408
3409 if (hp_pin_sense)
3410 msleep(85);
3411
c0ca5ece
TI
3412 if (!spec->no_shutup_pins)
3413 snd_hda_codec_write(codec, hp_pin, 0,
3414 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
7b5c7a02
KY
3415
3416 if (hp_pin_sense)
3417 msleep(100);
3418
3419 alc_auto_setup_eapd(codec, false);
c0ca5ece 3420 alc_shutup_pins(codec);
7b5c7a02
KY
3421 alc_write_coef_idx(codec, 0x78, coef78);
3422}
3423
6b0f95c4 3424static const struct coef_fw alc283_coefs[] = {
54db6c39 3425 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
56779864 3426 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
54db6c39
TI
3427 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3428 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3429 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3430 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3431 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3432 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3433 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3434 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3435 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3436 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3437 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3438 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3439 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3440 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3441 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3442 WRITE_COEF(0x2e, 0x2902), /* PLL */
3443 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3444 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3445 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3446 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3447 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3448 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3449 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3450 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3451 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3452 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3453 WRITE_COEF(0x49, 0x0), /* test mode */
3454 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3455 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3456 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
56779864 3457 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
54db6c39
TI
3458 {}
3459};
3460
6bd55b04
KY
3461static void alc283_restore_default_value(struct hda_codec *codec)
3462{
54db6c39 3463 alc_process_coef_fw(codec, alc283_coefs);
6bd55b04
KY
3464}
3465
2af02be7
KY
3466static void alc283_init(struct hda_codec *codec)
3467{
3468 struct alc_spec *spec = codec->spec;
35a39f98 3469 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3470 bool hp_pin_sense;
2af02be7 3471
6bd55b04
KY
3472 alc283_restore_default_value(codec);
3473
2af02be7
KY
3474 if (!hp_pin)
3475 return;
a59d7199
KY
3476
3477 msleep(30);
2af02be7
KY
3478 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3479
3480 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3481 /* Headphone capless set to high power mode */
3482 alc_write_coef_idx(codec, 0x43, 0x9004);
3483
3484 snd_hda_codec_write(codec, hp_pin, 0,
3485 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3486
3487 if (hp_pin_sense)
3488 msleep(85);
3489
3490 snd_hda_codec_write(codec, hp_pin, 0,
3491 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3492
3493 if (hp_pin_sense)
3494 msleep(85);
3495 /* Index 0x46 Combo jack auto switch control 2 */
3496 /* 3k pull low control for Headset jack. */
98b24883 3497 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
2af02be7
KY
3498 /* Headphone capless set to normal mode */
3499 alc_write_coef_idx(codec, 0x43, 0x9614);
3500}
3501
3502static void alc283_shutup(struct hda_codec *codec)
3503{
3504 struct alc_spec *spec = codec->spec;
35a39f98 3505 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2af02be7 3506 bool hp_pin_sense;
2af02be7
KY
3507
3508 if (!hp_pin) {
3509 alc269_shutup(codec);
3510 return;
3511 }
3512
3513 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3514
3515 alc_write_coef_idx(codec, 0x43, 0x9004);
3516
b450b17c
HP
3517 /*depop hp during suspend*/
3518 alc_write_coef_idx(codec, 0x06, 0x2100);
3519
2af02be7
KY
3520 snd_hda_codec_write(codec, hp_pin, 0,
3521 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3522
3523 if (hp_pin_sense)
88011c09 3524 msleep(100);
2af02be7 3525
c0ca5ece
TI
3526 if (!spec->no_shutup_pins)
3527 snd_hda_codec_write(codec, hp_pin, 0,
3528 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
2af02be7 3529
98b24883 3530 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
2af02be7
KY
3531
3532 if (hp_pin_sense)
88011c09 3533 msleep(100);
0435b3ff 3534 alc_auto_setup_eapd(codec, false);
c0ca5ece 3535 alc_shutup_pins(codec);
2af02be7
KY
3536 alc_write_coef_idx(codec, 0x43, 0x9614);
3537}
3538
4a219ef8
KY
3539static void alc256_init(struct hda_codec *codec)
3540{
3541 struct alc_spec *spec = codec->spec;
35a39f98 3542 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3543 bool hp_pin_sense;
3544
3545 if (!hp_pin)
6447c962 3546 hp_pin = 0x21;
4a219ef8
KY
3547
3548 msleep(30);
3549
3550 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3551
3552 if (hp_pin_sense)
3553 msleep(2);
3554
3555 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
6447c962
KY
3556 if (spec->ultra_low_power) {
3557 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3558 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3559 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3560 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3561 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3562 msleep(30);
3563 }
4a219ef8
KY
3564
3565 snd_hda_codec_write(codec, hp_pin, 0,
3566 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3567
6447c962 3568 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3569 msleep(85);
3570
3571 snd_hda_codec_write(codec, hp_pin, 0,
3572 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3573
6447c962 3574 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3575 msleep(100);
3576
3577 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3578 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
88d42b2b
KY
3579 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3580 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
c4473744
TH
3581 /*
3582 * Expose headphone mic (or possibly Line In on some machines) instead
3583 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3584 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3585 * this register.
3586 */
3587 alc_write_coef_idx(codec, 0x36, 0x5757);
4a219ef8
KY
3588}
3589
3590static void alc256_shutup(struct hda_codec *codec)
3591{
3592 struct alc_spec *spec = codec->spec;
35a39f98 3593 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4a219ef8
KY
3594 bool hp_pin_sense;
3595
6447c962
KY
3596 if (!hp_pin)
3597 hp_pin = 0x21;
4a219ef8
KY
3598
3599 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3600
3601 if (hp_pin_sense)
3602 msleep(2);
3603
3604 snd_hda_codec_write(codec, hp_pin, 0,
3605 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3606
6447c962 3607 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3608 msleep(85);
3609
1c9609e3
TI
3610 /* 3k pull low control for Headset jack. */
3611 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3f742490
HW
3612 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3613 * when booting with headset plugged. So skip setting it for the codec alc257
3614 */
7f29b168
KHF
3615 if (codec->core.vendor_id != 0x10ec0236 &&
3616 codec->core.vendor_id != 0x10ec0257)
3f742490 3617 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
1c9609e3 3618
c0ca5ece
TI
3619 if (!spec->no_shutup_pins)
3620 snd_hda_codec_write(codec, hp_pin, 0,
3621 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4a219ef8 3622
6447c962 3623 if (hp_pin_sense || spec->ultra_low_power)
4a219ef8
KY
3624 msleep(100);
3625
3626 alc_auto_setup_eapd(codec, false);
c0ca5ece 3627 alc_shutup_pins(codec);
6447c962
KY
3628 if (spec->ultra_low_power) {
3629 msleep(50);
3630 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3631 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3632 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3633 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3634 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3635 msleep(30);
3636 }
4a219ef8
KY
3637}
3638
3c24e483
KY
3639static void alc285_hp_init(struct hda_codec *codec)
3640{
3641 struct alc_spec *spec = codec->spec;
3642 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3643 int i, val;
3644 int coef38, coef0d, coef36;
3645
3646 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3647 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3648 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3649 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3650 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3651 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3652
3653 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3654
3655 if (hp_pin)
3656 snd_hda_codec_write(codec, hp_pin, 0,
3657 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3658
3659 msleep(130);
3660 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3661 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3662
3663 if (hp_pin)
3664 snd_hda_codec_write(codec, hp_pin, 0,
3665 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3666 msleep(10);
3667 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3668 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3669 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3670 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3671
3672 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3673 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3674 for (i = 0; i < 20 && val & 0x8000; i++) {
3675 msleep(50);
3676 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3677 } /* Wait for depop procedure finish */
3678
3679 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3680 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3681 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3682 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3683
3684 msleep(50);
3685 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3686}
3687
da911b1f
KY
3688static void alc225_init(struct hda_codec *codec)
3689{
3690 struct alc_spec *spec = codec->spec;
35a39f98 3691 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3692 bool hp1_pin_sense, hp2_pin_sense;
3693
3c24e483
KY
3694 if (spec->codec_variant != ALC269_TYPE_ALC287)
3695 /* required only at boot or S3 and S4 resume time */
3696 if (!spec->done_hp_init ||
3697 is_s3_resume(codec) ||
3698 is_s4_resume(codec)) {
3699 alc285_hp_init(codec);
3700 spec->done_hp_init = true;
3701 }
3702
da911b1f 3703 if (!hp_pin)
d3ba58bb 3704 hp_pin = 0x21;
da911b1f
KY
3705 msleep(30);
3706
3707 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3708 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3709
3710 if (hp1_pin_sense || hp2_pin_sense)
3711 msleep(2);
3712
3713 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
d3ba58bb
KY
3714 if (spec->ultra_low_power) {
3715 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3716 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3717 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3718 msleep(30);
3719 }
da911b1f 3720
d3ba58bb 3721 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3722 snd_hda_codec_write(codec, hp_pin, 0,
3723 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3724 if (hp2_pin_sense)
3725 snd_hda_codec_write(codec, 0x16, 0,
3726 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3727
d3ba58bb 3728 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3729 msleep(85);
3730
d3ba58bb 3731 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3732 snd_hda_codec_write(codec, hp_pin, 0,
3733 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3734 if (hp2_pin_sense)
3735 snd_hda_codec_write(codec, 0x16, 0,
3736 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3737
d3ba58bb 3738 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3739 msleep(100);
3740
3741 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3742 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3743}
3744
3745static void alc225_shutup(struct hda_codec *codec)
3746{
3747 struct alc_spec *spec = codec->spec;
35a39f98 3748 hda_nid_t hp_pin = alc_get_hp_pin(spec);
da911b1f
KY
3749 bool hp1_pin_sense, hp2_pin_sense;
3750
d3ba58bb
KY
3751 if (!hp_pin)
3752 hp_pin = 0x21;
476c02e0
HW
3753
3754 alc_disable_headset_jack_key(codec);
da911b1f
KY
3755 /* 3k pull low control for Headset jack. */
3756 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3757
3758 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3759 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3760
3761 if (hp1_pin_sense || hp2_pin_sense)
3762 msleep(2);
3763
d3ba58bb 3764 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3765 snd_hda_codec_write(codec, hp_pin, 0,
3766 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3767 if (hp2_pin_sense)
3768 snd_hda_codec_write(codec, 0x16, 0,
3769 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3770
d3ba58bb 3771 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3772 msleep(85);
3773
d3ba58bb 3774 if (hp1_pin_sense || spec->ultra_low_power)
da911b1f
KY
3775 snd_hda_codec_write(codec, hp_pin, 0,
3776 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3777 if (hp2_pin_sense)
3778 snd_hda_codec_write(codec, 0x16, 0,
3779 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3780
d3ba58bb 3781 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
da911b1f
KY
3782 msleep(100);
3783
3784 alc_auto_setup_eapd(codec, false);
c0ca5ece 3785 alc_shutup_pins(codec);
d3ba58bb
KY
3786 if (spec->ultra_low_power) {
3787 msleep(50);
3788 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3789 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3790 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3791 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3792 msleep(30);
3793 }
476c02e0
HW
3794
3795 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3796 alc_enable_headset_jack_key(codec);
da911b1f
KY
3797}
3798
c2d6af53
KY
3799static void alc_default_init(struct hda_codec *codec)
3800{
3801 struct alc_spec *spec = codec->spec;
35a39f98 3802 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3803 bool hp_pin_sense;
3804
3805 if (!hp_pin)
3806 return;
3807
3808 msleep(30);
3809
3810 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3811
3812 if (hp_pin_sense)
3813 msleep(2);
3814
3815 snd_hda_codec_write(codec, hp_pin, 0,
3816 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3817
3818 if (hp_pin_sense)
3819 msleep(85);
3820
3821 snd_hda_codec_write(codec, hp_pin, 0,
3822 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3823
3824 if (hp_pin_sense)
3825 msleep(100);
3826}
3827
3828static void alc_default_shutup(struct hda_codec *codec)
3829{
3830 struct alc_spec *spec = codec->spec;
35a39f98 3831 hda_nid_t hp_pin = alc_get_hp_pin(spec);
c2d6af53
KY
3832 bool hp_pin_sense;
3833
3834 if (!hp_pin) {
3835 alc269_shutup(codec);
3836 return;
3837 }
3838
3839 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3840
3841 if (hp_pin_sense)
3842 msleep(2);
3843
3844 snd_hda_codec_write(codec, hp_pin, 0,
3845 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3846
3847 if (hp_pin_sense)
3848 msleep(85);
3849
c0ca5ece
TI
3850 if (!spec->no_shutup_pins)
3851 snd_hda_codec_write(codec, hp_pin, 0,
3852 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
c2d6af53
KY
3853
3854 if (hp_pin_sense)
3855 msleep(100);
3856
3857 alc_auto_setup_eapd(codec, false);
c0ca5ece 3858 alc_shutup_pins(codec);
c2d6af53
KY
3859}
3860
693abe11
KY
3861static void alc294_hp_init(struct hda_codec *codec)
3862{
3863 struct alc_spec *spec = codec->spec;
35a39f98 3864 hda_nid_t hp_pin = alc_get_hp_pin(spec);
693abe11
KY
3865 int i, val;
3866
3867 if (!hp_pin)
3868 return;
3869
3870 snd_hda_codec_write(codec, hp_pin, 0,
3871 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3872
3873 msleep(100);
3874
c0ca5ece
TI
3875 if (!spec->no_shutup_pins)
3876 snd_hda_codec_write(codec, hp_pin, 0,
3877 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
693abe11
KY
3878
3879 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3880 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3881
3882 /* Wait for depop procedure finish */
3883 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3884 for (i = 0; i < 20 && val & 0x0080; i++) {
3885 msleep(50);
3886 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3887 }
3888 /* Set HP depop to auto mode */
3889 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3890 msleep(50);
3891}
3892
3893static void alc294_init(struct hda_codec *codec)
3894{
3895 struct alc_spec *spec = codec->spec;
3896
f6ef4e0e
TI
3897 /* required only at boot or S4 resume time */
3898 if (!spec->done_hp_init ||
3899 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
693abe11
KY
3900 alc294_hp_init(codec);
3901 spec->done_hp_init = true;
3902 }
3903 alc_default_init(codec);
3904}
3905
ad60d502
KY
3906static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3907 unsigned int val)
3908{
3909 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3910 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3911 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3912}
3913
3914static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3915{
3916 unsigned int val;
3917
3918 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3919 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3920 & 0xffff;
3921 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3922 << 16;
3923 return val;
3924}
3925
3926static void alc5505_dsp_halt(struct hda_codec *codec)
3927{
3928 unsigned int val;
3929
3930 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3931 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3932 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3933 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3934 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3935 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3936 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3937 val = alc5505_coef_get(codec, 0x6220);
3938 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3939}
3940
3941static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3942{
3943 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3944 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3945 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3946 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3947 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3948 alc5505_coef_set(codec, 0x880c, 0x00000004);
3949}
3950
3951static void alc5505_dsp_init(struct hda_codec *codec)
3952{
3953 unsigned int val;
3954
3955 alc5505_dsp_halt(codec);
3956 alc5505_dsp_back_from_halt(codec);
3957 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3958 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3959 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3960 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3961 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3962 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3963 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3964 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3965 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3966 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3967 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3968 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3969 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3970
3971 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3972 if (val <= 3)
3973 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3974 else
3975 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3976
3977 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3978 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3979 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3980 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3981 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3982 alc5505_coef_set(codec, 0x880c, 0x00000003);
3983 alc5505_coef_set(codec, 0x880c, 0x00000010);
cd63a5ff
TI
3984
3985#ifdef HALT_REALTEK_ALC5505
3986 alc5505_dsp_halt(codec);
3987#endif
ad60d502
KY
3988}
3989
cd63a5ff 3990#ifdef HALT_REALTEK_ALC5505
8a71821f
PLB
3991#define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3992#define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
cd63a5ff
TI
3993#else
3994#define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3995#define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3996#endif
3997
2a43952a 3998#ifdef CONFIG_PM
ad60d502
KY
3999static int alc269_suspend(struct hda_codec *codec)
4000{
4001 struct alc_spec *spec = codec->spec;
4002
4003 if (spec->has_alc5505_dsp)
cd63a5ff 4004 alc5505_dsp_suspend(codec);
ad60d502
KY
4005 return alc_suspend(codec);
4006}
4007
1d045db9
TI
4008static int alc269_resume(struct hda_codec *codec)
4009{
adcc70b2
KY
4010 struct alc_spec *spec = codec->spec;
4011
1387e2d1
KY
4012 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4013 alc269vb_toggle_power_output(codec, 0);
4014 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4015 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9
TI
4016 msleep(150);
4017 }
8c427226 4018
1d045db9 4019 codec->patch_ops.init(codec);
f1d4e28b 4020
1387e2d1
KY
4021 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4022 alc269vb_toggle_power_output(codec, 1);
4023 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
adcc70b2 4024 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9
TI
4025 msleep(200);
4026 }
f1d4e28b 4027
1a462be5 4028 snd_hda_regmap_sync(codec);
1d045db9 4029 hda_call_check_power_status(codec, 0x01);
f475371a
HW
4030
4031 /* on some machine, the BIOS will clear the codec gpio data when enter
4032 * suspend, and won't restore the data after resume, so we restore it
4033 * in the driver.
4034 */
d261eec8
TI
4035 if (spec->gpio_data)
4036 alc_write_gpio_data(codec);
f475371a 4037
ad60d502 4038 if (spec->has_alc5505_dsp)
cd63a5ff 4039 alc5505_dsp_resume(codec);
c5177c86 4040
1d045db9
TI
4041 return 0;
4042}
2a43952a 4043#endif /* CONFIG_PM */
f1d4e28b 4044
108cc108 4045static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
1727a771 4046 const struct hda_fixup *fix, int action)
108cc108
DH
4047{
4048 struct alc_spec *spec = codec->spec;
4049
1727a771 4050 if (action == HDA_FIXUP_ACT_PRE_PROBE)
108cc108
DH
4051 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4052}
4053
fdcc968a
JMG
4054static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4055 const struct hda_fixup *fix,
4056 int action)
4057{
4058 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4059 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4060
4061 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4062 snd_hda_codec_set_pincfg(codec, 0x19,
4063 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4064 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4065}
4066
1d045db9 4067static void alc269_fixup_hweq(struct hda_codec *codec,
1727a771 4068 const struct hda_fixup *fix, int action)
1d045db9 4069{
98b24883
TI
4070 if (action == HDA_FIXUP_ACT_INIT)
4071 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
1d045db9 4072}
f1d4e28b 4073
7c478f03
DH
4074static void alc269_fixup_headset_mic(struct hda_codec *codec,
4075 const struct hda_fixup *fix, int action)
4076{
4077 struct alc_spec *spec = codec->spec;
4078
4079 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4080 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4081}
4082
1d045db9 4083static void alc271_fixup_dmic(struct hda_codec *codec,
1727a771 4084 const struct hda_fixup *fix, int action)
1d045db9
TI
4085{
4086 static const struct hda_verb verbs[] = {
4087 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4088 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4089 {}
4090 };
4091 unsigned int cfg;
f1d4e28b 4092
7639a06c
TI
4093 if (strcmp(codec->core.chip_name, "ALC271X") &&
4094 strcmp(codec->core.chip_name, "ALC269VB"))
1d045db9
TI
4095 return;
4096 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4097 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4098 snd_hda_sequence_write(codec, verbs);
4099}
f1d4e28b 4100
c8426b27
TI
4101/* Fix the speaker amp after resume, etc */
4102static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4103 const struct hda_fixup *fix,
4104 int action)
4105{
4106 if (action == HDA_FIXUP_ACT_INIT)
4107 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4108}
4109
017f2a10 4110static void alc269_fixup_pcm_44k(struct hda_codec *codec,
1727a771 4111 const struct hda_fixup *fix, int action)
017f2a10
TI
4112{
4113 struct alc_spec *spec = codec->spec;
4114
1727a771 4115 if (action != HDA_FIXUP_ACT_PROBE)
017f2a10
TI
4116 return;
4117
4118 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4119 * fix the sample rate of analog I/O to 44.1kHz
4120 */
08c189f2
TI
4121 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4122 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
017f2a10
TI
4123}
4124
adabb3ec 4125static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
1727a771 4126 const struct hda_fixup *fix, int action)
adabb3ec 4127{
adabb3ec
TI
4128 /* The digital-mic unit sends PDM (differential signal) instead of
4129 * the standard PCM, thus you can't record a valid mono stream as is.
4130 * Below is a workaround specific to ALC269 to control the dmic
4131 * signal source as mono.
4132 */
98b24883
TI
4133 if (action == HDA_FIXUP_ACT_INIT)
4134 alc_update_coef_idx(codec, 0x07, 0, 0x80);
adabb3ec
TI
4135}
4136
24519911
TI
4137static void alc269_quanta_automute(struct hda_codec *codec)
4138{
08c189f2 4139 snd_hda_gen_update_outputs(codec);
24519911 4140
1687ccc8
TI
4141 alc_write_coef_idx(codec, 0x0c, 0x680);
4142 alc_write_coef_idx(codec, 0x0c, 0x480);
24519911
TI
4143}
4144
4145static void alc269_fixup_quanta_mute(struct hda_codec *codec,
1727a771 4146 const struct hda_fixup *fix, int action)
24519911
TI
4147{
4148 struct alc_spec *spec = codec->spec;
1727a771 4149 if (action != HDA_FIXUP_ACT_PROBE)
24519911 4150 return;
08c189f2 4151 spec->gen.automute_hook = alc269_quanta_automute;
24519911
TI
4152}
4153
d240d1dc 4154static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 4155 struct hda_jack_callback *jack)
d240d1dc
DH
4156{
4157 struct alc_spec *spec = codec->spec;
4158 int vref;
4159 msleep(200);
4160 snd_hda_gen_hp_automute(codec, jack);
4161
4162 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4163 msleep(100);
4164 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4165 vref);
4166 msleep(500);
4167 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4168 vref);
4169}
4170
a2ef03fe
TE
4171/*
4172 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4173 */
4174struct hda_alc298_mbxinit {
4175 unsigned char value_0x23;
4176 unsigned char value_0x25;
4177};
4178
4179static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4180 const struct hda_alc298_mbxinit *initval,
4181 bool first)
4182{
4183 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4184 alc_write_coef_idx(codec, 0x26, 0xb000);
4185
4186 if (first)
4187 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4188
4189 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4190 alc_write_coef_idx(codec, 0x26, 0xf000);
4191 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4192
4193 if (initval->value_0x23 != 0x1e)
4194 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4195
4196 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4197 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4198}
4199
4200static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4201 const struct hda_fixup *fix,
4202 int action)
4203{
4204 /* Initialization magic */
4205 static const struct hda_alc298_mbxinit dac_init[] = {
4206 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4207 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4208 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4209 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4210 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4211 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4212 {0x2f, 0x00},
4213 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4214 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4215 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4216 {}
4217 };
4218 const struct hda_alc298_mbxinit *seq;
4219
4220 if (action != HDA_FIXUP_ACT_INIT)
4221 return;
4222
4223 /* Start */
4224 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4225 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4226 alc_write_coef_idx(codec, 0x26, 0xf000);
4227 alc_write_coef_idx(codec, 0x22, 0x31);
4228 alc_write_coef_idx(codec, 0x23, 0x0b);
4229 alc_write_coef_idx(codec, 0x25, 0x00);
4230 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4231 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4232
4233 for (seq = dac_init; seq->value_0x23; seq++)
4234 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4235}
4236
d240d1dc
DH
4237static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4238 const struct hda_fixup *fix, int action)
4239{
4240 struct alc_spec *spec = codec->spec;
4241 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4242 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4243 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4244 }
4245}
4246
766538ac
TI
4247static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4248 bool polarity, bool on)
4249{
4250 unsigned int pinval;
4251
4252 if (!pin)
4253 return;
4254 if (polarity)
4255 on = !on;
4256 pinval = snd_hda_codec_get_pin_target(codec, pin);
4257 pinval &= ~AC_PINCTL_VREFEN;
4258 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4259 /* temporarily power up/down for setting VREF */
4260 snd_hda_power_up_pm(codec);
4261 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4262 snd_hda_power_down_pm(codec);
4263}
d240d1dc 4264
08fb0d0e 4265/* update mute-LED according to the speaker mute state via mic VREF pin */
8d3d1ece
TI
4266static int vref_mute_led_set(struct led_classdev *led_cdev,
4267 enum led_brightness brightness)
6d3cd5d4 4268{
8d3d1ece 4269 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
08fb0d0e 4270 struct alc_spec *spec = codec->spec;
08fb0d0e 4271
766538ac
TI
4272 alc_update_vref_led(codec, spec->mute_led_nid,
4273 spec->mute_led_polarity, brightness);
8d3d1ece 4274 return 0;
6d3cd5d4
DH
4275}
4276
d5b6b65e
DH
4277/* Make sure the led works even in runtime suspend */
4278static unsigned int led_power_filter(struct hda_codec *codec,
4279 hda_nid_t nid,
4280 unsigned int power_state)
4281{
4282 struct alc_spec *spec = codec->spec;
4283
50dd9050
HW
4284 if (power_state != AC_PWRST_D3 || nid == 0 ||
4285 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
d5b6b65e
DH
4286 return power_state;
4287
4288 /* Set pin ctl again, it might have just been set to 0 */
4289 snd_hda_set_pin_ctl(codec, nid,
4290 snd_hda_codec_get_pin_target(codec, nid));
4291
cffd3966 4292 return snd_hda_gen_path_power_filter(codec, nid, power_state);
d5b6b65e
DH
4293}
4294
08fb0d0e
TI
4295static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4296 const struct hda_fixup *fix, int action)
6d3cd5d4
DH
4297{
4298 struct alc_spec *spec = codec->spec;
08fb0d0e
TI
4299 const struct dmi_device *dev = NULL;
4300
4301 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4302 return;
4303
4304 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4305 int pol, pin;
4306 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4307 continue;
4308 if (pin < 0x0a || pin >= 0x10)
4309 break;
4310 spec->mute_led_polarity = pol;
4311 spec->mute_led_nid = pin - 0x0a + 0x18;
8d3d1ece 4312 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4313 codec->power_filter = led_power_filter;
4e76a883
TI
4314 codec_dbg(codec,
4315 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
08fb0d0e 4316 spec->mute_led_polarity);
6d3cd5d4
DH
4317 break;
4318 }
4319}
4320
85c467dc
TI
4321static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4322 const struct hda_fixup *fix,
4323 int action, hda_nid_t pin)
d06ac143
DH
4324{
4325 struct alc_spec *spec = codec->spec;
85c467dc 4326
d06ac143
DH
4327 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4328 spec->mute_led_polarity = 0;
85c467dc 4329 spec->mute_led_nid = pin;
8d3d1ece 4330 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
d5b6b65e 4331 codec->power_filter = led_power_filter;
d06ac143
DH
4332 }
4333}
4334
85c467dc
TI
4335static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4336 const struct hda_fixup *fix, int action)
4337{
4338 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4339}
4340
08fb0d0e
TI
4341static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4342 const struct hda_fixup *fix, int action)
420b0feb 4343{
85c467dc 4344 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
420b0feb
TI
4345}
4346
7f783bd5
TB
4347static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4348 const struct hda_fixup *fix, int action)
4349{
85c467dc 4350 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
7f783bd5
TB
4351}
4352
0f32fd19
TI
4353/* update LED status via GPIO */
4354static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
dbd13179 4355 int polarity, bool enabled)
9f5c6faf 4356{
dbd13179 4357 if (polarity)
0f32fd19 4358 enabled = !enabled;
d261eec8 4359 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
9f5c6faf
TI
4360}
4361
0f32fd19 4362/* turn on/off mute LED via GPIO per vmaster hook */
8d3d1ece
TI
4363static int gpio_mute_led_set(struct led_classdev *led_cdev,
4364 enum led_brightness brightness)
9f5c6faf 4365{
8d3d1ece 4366 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9f5c6faf 4367 struct alc_spec *spec = codec->spec;
9f5c6faf 4368
dbd13179 4369 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
8d3d1ece
TI
4370 spec->mute_led_polarity, !brightness);
4371 return 0;
0f32fd19 4372}
9f5c6faf 4373
0f32fd19 4374/* turn on/off mic-mute LED via GPIO per capture hook */
87dc3648
KHF
4375static int micmute_led_set(struct led_classdev *led_cdev,
4376 enum led_brightness brightness)
4377{
4378 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4379 struct alc_spec *spec = codec->spec;
4380
4381 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
40469064 4382 spec->micmute_led_polarity, !brightness);
87dc3648
KHF
4383 return 0;
4384}
4385
01e4a275
TI
4386/* setup mute and mic-mute GPIO bits, add hooks appropriately */
4387static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4388 int action,
4389 unsigned int mute_mask,
4390 unsigned int micmute_mask)
9f5c6faf
TI
4391{
4392 struct alc_spec *spec = codec->spec;
9f5c6faf 4393
01e4a275
TI
4394 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4395
4396 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4397 return;
4398 if (mute_mask) {
4399 spec->gpio_mute_led_mask = mute_mask;
8d3d1ece 4400 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
01e4a275
TI
4401 }
4402 if (micmute_mask) {
4403 spec->gpio_mic_led_mask = micmute_mask;
7cdf8c49 4404 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
9f5c6faf
TI
4405 }
4406}
4407
e7d66cf7
JS
4408static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4409 const struct hda_fixup *fix, int action)
4410{
4411 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4412}
4413
01e4a275 4414static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
eaa8e5ef
KY
4415 const struct hda_fixup *fix, int action)
4416{
01e4a275
TI
4417 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4418}
eaa8e5ef 4419
f5a88b0a
KHF
4420static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4421 const struct hda_fixup *fix, int action)
4422{
3e0650ab 4423 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
f5a88b0a
KHF
4424}
4425
01e4a275
TI
4426static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4427 const struct hda_fixup *fix, int action)
4428{
4429 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
9f5c6faf
TI
4430}
4431
a0ccbc53
KY
4432static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4433 const struct hda_fixup *fix, int action)
4434{
4435 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4436}
4437
c47b3112
JC
4438static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4439 const struct hda_fixup *fix, int action)
4440{
4441 struct alc_spec *spec = codec->spec;
4442
4443 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4444 spec->micmute_led_polarity = 1;
4445 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4446}
4447
8a503555
TI
4448/* turn on/off mic-mute LED per capture hook via VREF change */
4449static int vref_micmute_led_set(struct led_classdev *led_cdev,
4450 enum led_brightness brightness)
9c5dc3bf 4451{
8a503555 4452 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
9c5dc3bf 4453 struct alc_spec *spec = codec->spec;
9c5dc3bf 4454
766538ac
TI
4455 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4456 spec->micmute_led_polarity, brightness);
8a503555 4457 return 0;
9c5dc3bf
KY
4458}
4459
4460static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4461 const struct hda_fixup *fix, int action)
4462{
4463 struct alc_spec *spec = codec->spec;
9c5dc3bf 4464
01e4a275 4465 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
9c5dc3bf 4466 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
4467 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4468 * enable headphone amp
4469 */
4470 spec->gpio_mask |= 0x10;
4471 spec->gpio_dir |= 0x10;
9c5dc3bf 4472 spec->cap_mute_led_nid = 0x18;
8a503555 4473 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
50dd9050 4474 codec->power_filter = led_power_filter;
9c5dc3bf
KY
4475 }
4476}
4477
7a5255f1
DH
4478static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4479 const struct hda_fixup *fix, int action)
4480{
7a5255f1 4481 struct alc_spec *spec = codec->spec;
7a5255f1 4482
01e4a275 4483 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
7a5255f1 4484 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7a5255f1 4485 spec->cap_mute_led_nid = 0x18;
8a503555 4486 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
7a5255f1
DH
4487 codec->power_filter = led_power_filter;
4488 }
4489}
4490
c3bb2b52
TI
4491/* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4492 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4493 */
4494static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4495 const struct hda_fixup *fix, int action)
4496{
4497 struct alc_spec *spec = codec->spec;
4498
4499 switch (action) {
4500 case HDA_FIXUP_ACT_PRE_PROBE:
4501 spec->gpio_mask |= 0x01;
4502 spec->gpio_dir |= 0x01;
4503 break;
4504 case HDA_FIXUP_ACT_INIT:
4505 /* need to toggle GPIO to enable the amp */
4506 alc_update_gpio_data(codec, 0x01, true);
4507 msleep(100);
4508 alc_update_gpio_data(codec, 0x01, false);
4509 break;
4510 }
4511}
4512
622464c8
TI
4513/* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4514static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4515 struct hda_codec *codec,
4516 struct snd_pcm_substream *substream,
4517 int action)
4518{
4519 switch (action) {
4520 case HDA_GEN_PCM_ACT_PREPARE:
4521 alc_update_gpio_data(codec, 0x04, true);
4522 break;
4523 case HDA_GEN_PCM_ACT_CLEANUP:
4524 alc_update_gpio_data(codec, 0x04, false);
4525 break;
4526 }
4527}
4528
4529static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4530 const struct hda_fixup *fix,
4531 int action)
4532{
4533 struct alc_spec *spec = codec->spec;
4534
4535 if (action == HDA_FIXUP_ACT_PROBE) {
4536 spec->gpio_mask |= 0x04;
4537 spec->gpio_dir |= 0x04;
4538 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4539 }
4540}
4541
766538ac
TI
4542static void alc_update_coef_led(struct hda_codec *codec,
4543 struct alc_coef_led *led,
4544 bool polarity, bool on)
4545{
4546 if (polarity)
4547 on = !on;
4548 /* temporarily power up/down for setting COEF bit */
4549 alc_update_coef_idx(codec, led->idx, led->mask,
4550 on ? led->on : led->off);
4551}
4552
431e76c3 4553/* update mute-LED according to the speaker mute state via COEF bit */
8d3d1ece
TI
4554static int coef_mute_led_set(struct led_classdev *led_cdev,
4555 enum led_brightness brightness)
431e76c3 4556{
8d3d1ece 4557 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4558 struct alc_spec *spec = codec->spec;
4559
766538ac
TI
4560 alc_update_coef_led(codec, &spec->mute_led_coef,
4561 spec->mute_led_polarity, brightness);
8d3d1ece 4562 return 0;
431e76c3
KY
4563}
4564
4565static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4566 const struct hda_fixup *fix,
4567 int action)
4568{
4569 struct alc_spec *spec = codec->spec;
4570
4571 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4572 spec->mute_led_polarity = 0;
766538ac
TI
4573 spec->mute_led_coef.idx = 0x0b;
4574 spec->mute_led_coef.mask = 1 << 3;
4575 spec->mute_led_coef.on = 1 << 3;
4576 spec->mute_led_coef.off = 0;
8d3d1ece 4577 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
431e76c3
KY
4578 }
4579}
4580
24164f43
KY
4581static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4582 const struct hda_fixup *fix,
4583 int action)
4584{
4585 struct alc_spec *spec = codec->spec;
4586
4587 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4588 spec->mute_led_polarity = 0;
766538ac
TI
4589 spec->mute_led_coef.idx = 0x34;
4590 spec->mute_led_coef.mask = 1 << 5;
4591 spec->mute_led_coef.on = 0;
4592 spec->mute_led_coef.off = 1 << 5;
8d3d1ece 4593 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
24164f43
KY
4594 }
4595}
4596
431e76c3 4597/* turn on/off mic-mute LED per capture hook by coef bit */
8a503555
TI
4598static int coef_micmute_led_set(struct led_classdev *led_cdev,
4599 enum led_brightness brightness)
431e76c3 4600{
8a503555 4601 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
431e76c3
KY
4602 struct alc_spec *spec = codec->spec;
4603
766538ac
TI
4604 alc_update_coef_led(codec, &spec->mic_led_coef,
4605 spec->micmute_led_polarity, brightness);
8a503555 4606 return 0;
431e76c3
KY
4607}
4608
4609static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4610 const struct hda_fixup *fix, int action)
4611{
4612 struct alc_spec *spec = codec->spec;
4613
4614 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4615 spec->mic_led_coef.idx = 0x19;
4616 spec->mic_led_coef.mask = 1 << 13;
4617 spec->mic_led_coef.on = 1 << 13;
4618 spec->mic_led_coef.off = 0;
8a503555 4619 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
431e76c3
KY
4620 }
4621}
4622
24164f43
KY
4623static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4624 const struct hda_fixup *fix, int action)
4625{
4626 struct alc_spec *spec = codec->spec;
4627
4628 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
766538ac
TI
4629 spec->mic_led_coef.idx = 0x35;
4630 spec->mic_led_coef.mask = 3 << 2;
4631 spec->mic_led_coef.on = 2 << 2;
4632 spec->mic_led_coef.off = 1 << 2;
8a503555 4633 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
24164f43
KY
4634 }
4635}
4636
431e76c3
KY
4637static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4638 const struct hda_fixup *fix, int action)
4639{
4640 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4641 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4642}
4643
24164f43
KY
4644static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4645 const struct hda_fixup *fix, int action)
4646{
4647 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4648 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4649}
4650
75b62ab6
JW
4651static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4652 const struct hda_fixup *fix, int action)
4653{
4654 struct alc_spec *spec = codec->spec;
4655
4656 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4657 spec->cap_mute_led_nid = 0x1a;
4658 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4659 codec->power_filter = led_power_filter;
4660 }
4661}
4662
4663static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4664 const struct hda_fixup *fix, int action)
4665{
4666 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4667 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4668}
4669
6a30abaa 4670#if IS_REACHABLE(CONFIG_INPUT)
33f4acd3
DH
4671static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4672 struct hda_jack_callback *event)
4673{
4674 struct alc_spec *spec = codec->spec;
4675
4676 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4677 send both key on and key off event for every interrupt. */
c7b60a89 4678 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
33f4acd3 4679 input_sync(spec->kb_dev);
c7b60a89 4680 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
33f4acd3
DH
4681 input_sync(spec->kb_dev);
4682}
33f4acd3 4683
3694cb29
K
4684static int alc_register_micmute_input_device(struct hda_codec *codec)
4685{
4686 struct alc_spec *spec = codec->spec;
c7b60a89 4687 int i;
3694cb29
K
4688
4689 spec->kb_dev = input_allocate_device();
4690 if (!spec->kb_dev) {
4691 codec_err(codec, "Out of memory (input_allocate_device)\n");
4692 return -ENOMEM;
4693 }
c7b60a89
HW
4694
4695 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4696
3694cb29
K
4697 spec->kb_dev->name = "Microphone Mute Button";
4698 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
c7b60a89
HW
4699 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4700 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4701 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4702 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4703 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3694cb29
K
4704
4705 if (input_register_device(spec->kb_dev)) {
4706 codec_err(codec, "input_register_device failed\n");
4707 input_free_device(spec->kb_dev);
4708 spec->kb_dev = NULL;
4709 return -ENOMEM;
4710 }
4711
4712 return 0;
4713}
4714
01e4a275
TI
4715/* GPIO1 = set according to SKU external amp
4716 * GPIO2 = mic mute hotkey
4717 * GPIO3 = mute LED
4718 * GPIO4 = mic mute LED
4719 */
33f4acd3
DH
4720static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4721 const struct hda_fixup *fix, int action)
4722{
33f4acd3
DH
4723 struct alc_spec *spec = codec->spec;
4724
01e4a275 4725 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
33f4acd3 4726 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4727 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29 4728 if (alc_register_micmute_input_device(codec) != 0)
33f4acd3 4729 return;
33f4acd3 4730
01e4a275
TI
4731 spec->gpio_mask |= 0x06;
4732 spec->gpio_dir |= 0x02;
4733 spec->gpio_data |= 0x02;
7639a06c 4734 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
33f4acd3 4735 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
7639a06c 4736 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
33f4acd3 4737 gpio2_mic_hotkey_event);
33f4acd3
DH
4738 return;
4739 }
4740
4741 if (!spec->kb_dev)
4742 return;
4743
4744 switch (action) {
33f4acd3
DH
4745 case HDA_FIXUP_ACT_FREE:
4746 input_unregister_device(spec->kb_dev);
33f4acd3
DH
4747 spec->kb_dev = NULL;
4748 }
33f4acd3
DH
4749}
4750
01e4a275
TI
4751/* Line2 = mic mute hotkey
4752 * GPIO2 = mic mute LED
4753 */
3694cb29
K
4754static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4755 const struct hda_fixup *fix, int action)
4756{
3694cb29
K
4757 struct alc_spec *spec = codec->spec;
4758
01e4a275 4759 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
3694cb29 4760 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1c76aa5f 4761 spec->init_amp = ALC_INIT_DEFAULT;
3694cb29
K
4762 if (alc_register_micmute_input_device(codec) != 0)
4763 return;
4764
3694cb29
K
4765 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4766 gpio2_mic_hotkey_event);
3694cb29
K
4767 return;
4768 }
4769
4770 if (!spec->kb_dev)
4771 return;
4772
4773 switch (action) {
3694cb29
K
4774 case HDA_FIXUP_ACT_FREE:
4775 input_unregister_device(spec->kb_dev);
4776 spec->kb_dev = NULL;
4777 }
4778}
c469652b
TI
4779#else /* INPUT */
4780#define alc280_fixup_hp_gpio2_mic_hotkey NULL
4781#define alc233_fixup_lenovo_line2_mic_hotkey NULL
4782#endif /* INPUT */
3694cb29 4783
9c5dc3bf
KY
4784static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4785 const struct hda_fixup *fix, int action)
4786{
4787 struct alc_spec *spec = codec->spec;
4788
1bce62a6 4789 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
9c5dc3bf 4790 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9c5dc3bf 4791 spec->cap_mute_led_nid = 0x18;
8a503555 4792 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
9c5dc3bf
KY
4793 }
4794}
4795
6b0f95c4 4796static const struct coef_fw alc225_pre_hsmode[] = {
5a36767a
KY
4797 UPDATE_COEF(0x4a, 1<<8, 0),
4798 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4799 UPDATE_COEF(0x63, 3<<14, 3<<14),
4800 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4801 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4802 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4803 UPDATE_COEF(0x4a, 3<<10, 0),
4804 {}
4805};
4806
73bdd597
DH
4807static void alc_headset_mode_unplugged(struct hda_codec *codec)
4808{
92666d45 4809 struct alc_spec *spec = codec->spec;
6b0f95c4 4810 static const struct coef_fw coef0255[] = {
717f43d8 4811 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
54db6c39
TI
4812 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4813 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4814 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4815 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4816 {}
4817 };
6b0f95c4 4818 static const struct coef_fw coef0256[] = {
e69e7e03 4819 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
717f43d8
KY
4820 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4821 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4822 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4823 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
e69e7e03
KY
4824 {}
4825 };
6b0f95c4 4826 static const struct coef_fw coef0233[] = {
54db6c39
TI
4827 WRITE_COEF(0x1b, 0x0c0b),
4828 WRITE_COEF(0x45, 0xc429),
4829 UPDATE_COEF(0x35, 0x4000, 0),
4830 WRITE_COEF(0x06, 0x2104),
4831 WRITE_COEF(0x1a, 0x0001),
4832 WRITE_COEF(0x26, 0x0004),
4833 WRITE_COEF(0x32, 0x42a3),
4834 {}
4835 };
6b0f95c4 4836 static const struct coef_fw coef0288[] = {
f3b70332
KY
4837 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4838 UPDATE_COEF(0x50, 0x2000, 0x2000),
4839 UPDATE_COEF(0x56, 0x0006, 0x0006),
4840 UPDATE_COEF(0x66, 0x0008, 0),
4841 UPDATE_COEF(0x67, 0x2000, 0),
4842 {}
4843 };
6b0f95c4 4844 static const struct coef_fw coef0298[] = {
89542936
KY
4845 UPDATE_COEF(0x19, 0x1300, 0x0300),
4846 {}
4847 };
6b0f95c4 4848 static const struct coef_fw coef0292[] = {
54db6c39
TI
4849 WRITE_COEF(0x76, 0x000e),
4850 WRITE_COEF(0x6c, 0x2400),
4851 WRITE_COEF(0x18, 0x7308),
4852 WRITE_COEF(0x6b, 0xc429),
4853 {}
4854 };
6b0f95c4 4855 static const struct coef_fw coef0293[] = {
54db6c39
TI
4856 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4857 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4858 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4859 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4860 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4861 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4862 {}
4863 };
6b0f95c4 4864 static const struct coef_fw coef0668[] = {
54db6c39
TI
4865 WRITE_COEF(0x15, 0x0d40),
4866 WRITE_COEF(0xb7, 0x802b),
4867 {}
4868 };
6b0f95c4 4869 static const struct coef_fw coef0225[] = {
5a36767a 4870 UPDATE_COEF(0x63, 3<<14, 0),
4cc9b9d6
KY
4871 {}
4872 };
6b0f95c4 4873 static const struct coef_fw coef0274[] = {
71683c32
KY
4874 UPDATE_COEF(0x4a, 0x0100, 0),
4875 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4876 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4877 UPDATE_COEF(0x4a, 0x0010, 0),
4878 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4879 WRITE_COEF(0x45, 0x5289),
4880 UPDATE_COEF(0x4a, 0x0c00, 0),
4881 {}
4882 };
54db6c39 4883
92666d45
KY
4884 if (spec->no_internal_mic_pin) {
4885 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4886 return;
4887 }
4888
7639a06c 4889 switch (codec->core.vendor_id) {
9a22a8f5 4890 case 0x10ec0255:
e69e7e03
KY
4891 alc_process_coef_fw(codec, coef0255);
4892 break;
1948fc06 4893 case 0x10ec0230:
736f20a7 4894 case 0x10ec0236:
7081adf3 4895 case 0x10ec0256:
e69e7e03 4896 alc_process_coef_fw(codec, coef0256);
9a22a8f5 4897 break;
71683c32
KY
4898 case 0x10ec0234:
4899 case 0x10ec0274:
4900 case 0x10ec0294:
4901 alc_process_coef_fw(codec, coef0274);
4902 break;
13fd08a3 4903 case 0x10ec0233:
73bdd597 4904 case 0x10ec0283:
54db6c39 4905 alc_process_coef_fw(codec, coef0233);
73bdd597 4906 break;
f3b70332
KY
4907 case 0x10ec0286:
4908 case 0x10ec0288:
89542936
KY
4909 alc_process_coef_fw(codec, coef0288);
4910 break;
1a5bc8d9 4911 case 0x10ec0298:
89542936 4912 alc_process_coef_fw(codec, coef0298);
f3b70332
KY
4913 alc_process_coef_fw(codec, coef0288);
4914 break;
73bdd597 4915 case 0x10ec0292:
54db6c39 4916 alc_process_coef_fw(codec, coef0292);
73bdd597 4917 break;
a22aa26f 4918 case 0x10ec0293:
54db6c39 4919 alc_process_coef_fw(codec, coef0293);
a22aa26f 4920 break;
73bdd597 4921 case 0x10ec0668:
54db6c39 4922 alc_process_coef_fw(codec, coef0668);
73bdd597 4923 break;
c2b691ee 4924 case 0x10ec0215:
4cc9b9d6 4925 case 0x10ec0225:
c2b691ee 4926 case 0x10ec0285:
7d727869 4927 case 0x10ec0295:
c2b691ee 4928 case 0x10ec0289:
28f1f9b2 4929 case 0x10ec0299:
4d4b0c52 4930 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
4931 alc_process_coef_fw(codec, coef0225);
4932 break;
78f4f7c2
KY
4933 case 0x10ec0867:
4934 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4935 break;
73bdd597 4936 }
4e76a883 4937 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
73bdd597
DH
4938}
4939
4940
4941static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4942 hda_nid_t mic_pin)
4943{
6b0f95c4 4944 static const struct coef_fw coef0255[] = {
54db6c39
TI
4945 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4946 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4947 {}
4948 };
6b0f95c4 4949 static const struct coef_fw coef0256[] = {
717f43d8
KY
4950 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4951 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4952 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4953 {}
4954 };
6b0f95c4 4955 static const struct coef_fw coef0233[] = {
54db6c39
TI
4956 UPDATE_COEF(0x35, 0, 1<<14),
4957 WRITE_COEF(0x06, 0x2100),
4958 WRITE_COEF(0x1a, 0x0021),
4959 WRITE_COEF(0x26, 0x008c),
4960 {}
4961 };
6b0f95c4 4962 static const struct coef_fw coef0288[] = {
89542936 4963 UPDATE_COEF(0x4f, 0x00c0, 0),
f3b70332
KY
4964 UPDATE_COEF(0x50, 0x2000, 0),
4965 UPDATE_COEF(0x56, 0x0006, 0),
4966 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4967 UPDATE_COEF(0x66, 0x0008, 0x0008),
4968 UPDATE_COEF(0x67, 0x2000, 0x2000),
4969 {}
4970 };
6b0f95c4 4971 static const struct coef_fw coef0292[] = {
54db6c39
TI
4972 WRITE_COEF(0x19, 0xa208),
4973 WRITE_COEF(0x2e, 0xacf0),
4974 {}
4975 };
6b0f95c4 4976 static const struct coef_fw coef0293[] = {
54db6c39
TI
4977 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4978 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4979 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4980 {}
4981 };
6b0f95c4 4982 static const struct coef_fw coef0688[] = {
54db6c39
TI
4983 WRITE_COEF(0xb7, 0x802b),
4984 WRITE_COEF(0xb5, 0x1040),
4985 UPDATE_COEF(0xc3, 0, 1<<12),
4986 {}
4987 };
6b0f95c4 4988 static const struct coef_fw coef0225[] = {
4cc9b9d6
KY
4989 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4990 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4991 UPDATE_COEF(0x63, 3<<14, 0),
4992 {}
4993 };
6b0f95c4 4994 static const struct coef_fw coef0274[] = {
71683c32
KY
4995 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4996 UPDATE_COEF(0x4a, 0x0010, 0),
4997 UPDATE_COEF(0x6b, 0xf000, 0),
4998 {}
4999 };
54db6c39 5000
7639a06c 5001 switch (codec->core.vendor_id) {
9a22a8f5
KY
5002 case 0x10ec0255:
5003 alc_write_coef_idx(codec, 0x45, 0xc489);
5004 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5005 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5006 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5007 break;
1948fc06 5008 case 0x10ec0230:
717f43d8
KY
5009 case 0x10ec0236:
5010 case 0x10ec0256:
5011 alc_write_coef_idx(codec, 0x45, 0xc489);
5012 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5013 alc_process_coef_fw(codec, coef0256);
5014 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5015 break;
71683c32
KY
5016 case 0x10ec0234:
5017 case 0x10ec0274:
5018 case 0x10ec0294:
5019 alc_write_coef_idx(codec, 0x45, 0x4689);
5020 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5021 alc_process_coef_fw(codec, coef0274);
5022 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5023 break;
13fd08a3 5024 case 0x10ec0233:
73bdd597
DH
5025 case 0x10ec0283:
5026 alc_write_coef_idx(codec, 0x45, 0xc429);
5027 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5028 alc_process_coef_fw(codec, coef0233);
73bdd597
DH
5029 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5030 break;
f3b70332
KY
5031 case 0x10ec0286:
5032 case 0x10ec0288:
1a5bc8d9 5033 case 0x10ec0298:
f3b70332
KY
5034 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5035 alc_process_coef_fw(codec, coef0288);
5036 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5037 break;
73bdd597
DH
5038 case 0x10ec0292:
5039 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5040 alc_process_coef_fw(codec, coef0292);
73bdd597 5041 break;
a22aa26f
KY
5042 case 0x10ec0293:
5043 /* Set to TRS mode */
5044 alc_write_coef_idx(codec, 0x45, 0xc429);
5045 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5046 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5047 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5048 break;
78f4f7c2
KY
5049 case 0x10ec0867:
5050 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
c0dbbdad 5051 fallthrough;
9eb5d0e6 5052 case 0x10ec0221:
1f8b46cd
DH
5053 case 0x10ec0662:
5054 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5055 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5056 break;
73bdd597
DH
5057 case 0x10ec0668:
5058 alc_write_coef_idx(codec, 0x11, 0x0001);
5059 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
54db6c39 5060 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5061 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5062 break;
c2b691ee 5063 case 0x10ec0215:
4cc9b9d6 5064 case 0x10ec0225:
c2b691ee 5065 case 0x10ec0285:
7d727869 5066 case 0x10ec0295:
c2b691ee 5067 case 0x10ec0289:
28f1f9b2 5068 case 0x10ec0299:
5a36767a 5069 alc_process_coef_fw(codec, alc225_pre_hsmode);
4cc9b9d6
KY
5070 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5071 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5072 alc_process_coef_fw(codec, coef0225);
5073 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5074 break;
73bdd597 5075 }
4e76a883 5076 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
73bdd597
DH
5077}
5078
5079static void alc_headset_mode_default(struct hda_codec *codec)
5080{
6b0f95c4 5081 static const struct coef_fw coef0225[] = {
5a36767a
KY
5082 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5083 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5084 UPDATE_COEF(0x49, 3<<8, 0<<8),
5085 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5086 UPDATE_COEF(0x63, 3<<14, 0),
5087 UPDATE_COEF(0x67, 0xf000, 0x3000),
2ae95577
DH
5088 {}
5089 };
6b0f95c4 5090 static const struct coef_fw coef0255[] = {
54db6c39
TI
5091 WRITE_COEF(0x45, 0xc089),
5092 WRITE_COEF(0x45, 0xc489),
5093 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5094 WRITE_COEF(0x49, 0x0049),
5095 {}
5096 };
6b0f95c4 5097 static const struct coef_fw coef0256[] = {
717f43d8
KY
5098 WRITE_COEF(0x45, 0xc489),
5099 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5100 WRITE_COEF(0x49, 0x0049),
5101 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5102 WRITE_COEF(0x06, 0x6100),
5103 {}
5104 };
6b0f95c4 5105 static const struct coef_fw coef0233[] = {
54db6c39
TI
5106 WRITE_COEF(0x06, 0x2100),
5107 WRITE_COEF(0x32, 0x4ea3),
5108 {}
5109 };
6b0f95c4 5110 static const struct coef_fw coef0288[] = {
f3b70332
KY
5111 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5112 UPDATE_COEF(0x50, 0x2000, 0x2000),
5113 UPDATE_COEF(0x56, 0x0006, 0x0006),
5114 UPDATE_COEF(0x66, 0x0008, 0),
5115 UPDATE_COEF(0x67, 0x2000, 0),
5116 {}
5117 };
6b0f95c4 5118 static const struct coef_fw coef0292[] = {
54db6c39
TI
5119 WRITE_COEF(0x76, 0x000e),
5120 WRITE_COEF(0x6c, 0x2400),
5121 WRITE_COEF(0x6b, 0xc429),
5122 WRITE_COEF(0x18, 0x7308),
5123 {}
5124 };
6b0f95c4 5125 static const struct coef_fw coef0293[] = {
54db6c39
TI
5126 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5127 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5128 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5129 {}
5130 };
6b0f95c4 5131 static const struct coef_fw coef0688[] = {
54db6c39
TI
5132 WRITE_COEF(0x11, 0x0041),
5133 WRITE_COEF(0x15, 0x0d40),
5134 WRITE_COEF(0xb7, 0x802b),
5135 {}
5136 };
6b0f95c4 5137 static const struct coef_fw coef0274[] = {
71683c32
KY
5138 WRITE_COEF(0x45, 0x4289),
5139 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5140 UPDATE_COEF(0x6b, 0x0f00, 0),
5141 UPDATE_COEF(0x49, 0x0300, 0x0300),
5142 {}
5143 };
54db6c39 5144
7639a06c 5145 switch (codec->core.vendor_id) {
c2b691ee 5146 case 0x10ec0215:
2ae95577 5147 case 0x10ec0225:
c2b691ee 5148 case 0x10ec0285:
7d727869 5149 case 0x10ec0295:
c2b691ee 5150 case 0x10ec0289:
28f1f9b2 5151 case 0x10ec0299:
5a36767a 5152 alc_process_coef_fw(codec, alc225_pre_hsmode);
2ae95577
DH
5153 alc_process_coef_fw(codec, coef0225);
5154 break;
9a22a8f5 5155 case 0x10ec0255:
54db6c39 5156 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5157 break;
1948fc06 5158 case 0x10ec0230:
717f43d8
KY
5159 case 0x10ec0236:
5160 case 0x10ec0256:
5161 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5162 alc_write_coef_idx(codec, 0x45, 0xc089);
5163 msleep(50);
5164 alc_process_coef_fw(codec, coef0256);
5165 break;
71683c32
KY
5166 case 0x10ec0234:
5167 case 0x10ec0274:
5168 case 0x10ec0294:
5169 alc_process_coef_fw(codec, coef0274);
5170 break;
13fd08a3 5171 case 0x10ec0233:
73bdd597 5172 case 0x10ec0283:
54db6c39 5173 alc_process_coef_fw(codec, coef0233);
73bdd597 5174 break;
f3b70332
KY
5175 case 0x10ec0286:
5176 case 0x10ec0288:
1a5bc8d9 5177 case 0x10ec0298:
f3b70332
KY
5178 alc_process_coef_fw(codec, coef0288);
5179 break;
73bdd597 5180 case 0x10ec0292:
54db6c39 5181 alc_process_coef_fw(codec, coef0292);
73bdd597 5182 break;
a22aa26f 5183 case 0x10ec0293:
54db6c39 5184 alc_process_coef_fw(codec, coef0293);
a22aa26f 5185 break;
73bdd597 5186 case 0x10ec0668:
54db6c39 5187 alc_process_coef_fw(codec, coef0688);
73bdd597 5188 break;
78f4f7c2
KY
5189 case 0x10ec0867:
5190 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5191 break;
73bdd597 5192 }
4e76a883 5193 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
73bdd597
DH
5194}
5195
5196/* Iphone type */
5197static void alc_headset_mode_ctia(struct hda_codec *codec)
5198{
89542936
KY
5199 int val;
5200
6b0f95c4 5201 static const struct coef_fw coef0255[] = {
54db6c39
TI
5202 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5203 WRITE_COEF(0x1b, 0x0c2b),
5204 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5205 {}
5206 };
6b0f95c4 5207 static const struct coef_fw coef0256[] = {
e69e7e03 5208 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
717f43d8 5209 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5210 {}
5211 };
6b0f95c4 5212 static const struct coef_fw coef0233[] = {
54db6c39
TI
5213 WRITE_COEF(0x45, 0xd429),
5214 WRITE_COEF(0x1b, 0x0c2b),
5215 WRITE_COEF(0x32, 0x4ea3),
5216 {}
5217 };
6b0f95c4 5218 static const struct coef_fw coef0288[] = {
f3b70332
KY
5219 UPDATE_COEF(0x50, 0x2000, 0x2000),
5220 UPDATE_COEF(0x56, 0x0006, 0x0006),
5221 UPDATE_COEF(0x66, 0x0008, 0),
5222 UPDATE_COEF(0x67, 0x2000, 0),
5223 {}
5224 };
6b0f95c4 5225 static const struct coef_fw coef0292[] = {
54db6c39
TI
5226 WRITE_COEF(0x6b, 0xd429),
5227 WRITE_COEF(0x76, 0x0008),
5228 WRITE_COEF(0x18, 0x7388),
5229 {}
5230 };
6b0f95c4 5231 static const struct coef_fw coef0293[] = {
54db6c39
TI
5232 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5233 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5234 {}
5235 };
6b0f95c4 5236 static const struct coef_fw coef0688[] = {
54db6c39
TI
5237 WRITE_COEF(0x11, 0x0001),
5238 WRITE_COEF(0x15, 0x0d60),
5239 WRITE_COEF(0xc3, 0x0000),
5240 {}
5241 };
6b0f95c4 5242 static const struct coef_fw coef0225_1[] = {
4cc9b9d6 5243 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5a36767a
KY
5244 UPDATE_COEF(0x63, 3<<14, 2<<14),
5245 {}
5246 };
6b0f95c4 5247 static const struct coef_fw coef0225_2[] = {
5a36767a
KY
5248 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5249 UPDATE_COEF(0x63, 3<<14, 1<<14),
4cc9b9d6
KY
5250 {}
5251 };
54db6c39 5252
7639a06c 5253 switch (codec->core.vendor_id) {
9a22a8f5 5254 case 0x10ec0255:
54db6c39 5255 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5256 break;
1948fc06 5257 case 0x10ec0230:
736f20a7 5258 case 0x10ec0236:
e69e7e03
KY
5259 case 0x10ec0256:
5260 alc_process_coef_fw(codec, coef0256);
5261 break;
71683c32
KY
5262 case 0x10ec0234:
5263 case 0x10ec0274:
5264 case 0x10ec0294:
5265 alc_write_coef_idx(codec, 0x45, 0xd689);
5266 break;
13fd08a3 5267 case 0x10ec0233:
73bdd597 5268 case 0x10ec0283:
54db6c39 5269 alc_process_coef_fw(codec, coef0233);
73bdd597 5270 break;
1a5bc8d9 5271 case 0x10ec0298:
89542936
KY
5272 val = alc_read_coef_idx(codec, 0x50);
5273 if (val & (1 << 12)) {
5274 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5275 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5276 msleep(300);
5277 } else {
5278 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5279 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5280 msleep(300);
5281 }
5282 break;
f3b70332
KY
5283 case 0x10ec0286:
5284 case 0x10ec0288:
5285 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5286 msleep(300);
5287 alc_process_coef_fw(codec, coef0288);
5288 break;
73bdd597 5289 case 0x10ec0292:
54db6c39 5290 alc_process_coef_fw(codec, coef0292);
73bdd597 5291 break;
a22aa26f 5292 case 0x10ec0293:
54db6c39 5293 alc_process_coef_fw(codec, coef0293);
a22aa26f 5294 break;
73bdd597 5295 case 0x10ec0668:
54db6c39 5296 alc_process_coef_fw(codec, coef0688);
73bdd597 5297 break;
c2b691ee 5298 case 0x10ec0215:
4cc9b9d6 5299 case 0x10ec0225:
c2b691ee 5300 case 0x10ec0285:
7d727869 5301 case 0x10ec0295:
c2b691ee 5302 case 0x10ec0289:
28f1f9b2 5303 case 0x10ec0299:
5a36767a
KY
5304 val = alc_read_coef_idx(codec, 0x45);
5305 if (val & (1 << 9))
5306 alc_process_coef_fw(codec, coef0225_2);
5307 else
5308 alc_process_coef_fw(codec, coef0225_1);
4cc9b9d6 5309 break;
78f4f7c2
KY
5310 case 0x10ec0867:
5311 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5312 break;
73bdd597 5313 }
4e76a883 5314 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
73bdd597
DH
5315}
5316
5317/* Nokia type */
5318static void alc_headset_mode_omtp(struct hda_codec *codec)
5319{
6b0f95c4 5320 static const struct coef_fw coef0255[] = {
54db6c39
TI
5321 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5322 WRITE_COEF(0x1b, 0x0c2b),
5323 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5324 {}
5325 };
6b0f95c4 5326 static const struct coef_fw coef0256[] = {
e69e7e03 5327 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
717f43d8 5328 WRITE_COEF(0x1b, 0x0e6b),
e69e7e03
KY
5329 {}
5330 };
6b0f95c4 5331 static const struct coef_fw coef0233[] = {
54db6c39
TI
5332 WRITE_COEF(0x45, 0xe429),
5333 WRITE_COEF(0x1b, 0x0c2b),
5334 WRITE_COEF(0x32, 0x4ea3),
5335 {}
5336 };
6b0f95c4 5337 static const struct coef_fw coef0288[] = {
f3b70332
KY
5338 UPDATE_COEF(0x50, 0x2000, 0x2000),
5339 UPDATE_COEF(0x56, 0x0006, 0x0006),
5340 UPDATE_COEF(0x66, 0x0008, 0),
5341 UPDATE_COEF(0x67, 0x2000, 0),
5342 {}
5343 };
6b0f95c4 5344 static const struct coef_fw coef0292[] = {
54db6c39
TI
5345 WRITE_COEF(0x6b, 0xe429),
5346 WRITE_COEF(0x76, 0x0008),
5347 WRITE_COEF(0x18, 0x7388),
5348 {}
5349 };
6b0f95c4 5350 static const struct coef_fw coef0293[] = {
54db6c39
TI
5351 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5352 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5353 {}
5354 };
6b0f95c4 5355 static const struct coef_fw coef0688[] = {
54db6c39
TI
5356 WRITE_COEF(0x11, 0x0001),
5357 WRITE_COEF(0x15, 0x0d50),
5358 WRITE_COEF(0xc3, 0x0000),
5359 {}
5360 };
6b0f95c4 5361 static const struct coef_fw coef0225[] = {
4cc9b9d6 5362 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5a36767a 5363 UPDATE_COEF(0x63, 3<<14, 2<<14),
4cc9b9d6
KY
5364 {}
5365 };
54db6c39 5366
7639a06c 5367 switch (codec->core.vendor_id) {
9a22a8f5 5368 case 0x10ec0255:
54db6c39 5369 alc_process_coef_fw(codec, coef0255);
9a22a8f5 5370 break;
1948fc06 5371 case 0x10ec0230:
736f20a7 5372 case 0x10ec0236:
e69e7e03
KY
5373 case 0x10ec0256:
5374 alc_process_coef_fw(codec, coef0256);
5375 break;
71683c32
KY
5376 case 0x10ec0234:
5377 case 0x10ec0274:
5378 case 0x10ec0294:
5379 alc_write_coef_idx(codec, 0x45, 0xe689);
5380 break;
13fd08a3 5381 case 0x10ec0233:
73bdd597 5382 case 0x10ec0283:
54db6c39 5383 alc_process_coef_fw(codec, coef0233);
73bdd597 5384 break;
1a5bc8d9
KY
5385 case 0x10ec0298:
5386 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
89542936
KY
5387 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5388 msleep(300);
5389 break;
f3b70332
KY
5390 case 0x10ec0286:
5391 case 0x10ec0288:
5392 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5393 msleep(300);
5394 alc_process_coef_fw(codec, coef0288);
5395 break;
73bdd597 5396 case 0x10ec0292:
54db6c39 5397 alc_process_coef_fw(codec, coef0292);
73bdd597 5398 break;
a22aa26f 5399 case 0x10ec0293:
54db6c39 5400 alc_process_coef_fw(codec, coef0293);
a22aa26f 5401 break;
73bdd597 5402 case 0x10ec0668:
54db6c39 5403 alc_process_coef_fw(codec, coef0688);
73bdd597 5404 break;
c2b691ee 5405 case 0x10ec0215:
4cc9b9d6 5406 case 0x10ec0225:
c2b691ee 5407 case 0x10ec0285:
7d727869 5408 case 0x10ec0295:
c2b691ee 5409 case 0x10ec0289:
28f1f9b2 5410 case 0x10ec0299:
4cc9b9d6
KY
5411 alc_process_coef_fw(codec, coef0225);
5412 break;
73bdd597 5413 }
4e76a883 5414 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
73bdd597
DH
5415}
5416
5417static void alc_determine_headset_type(struct hda_codec *codec)
5418{
5419 int val;
5420 bool is_ctia = false;
5421 struct alc_spec *spec = codec->spec;
6b0f95c4 5422 static const struct coef_fw coef0255[] = {
54db6c39
TI
5423 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5424 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5425 conteol) */
5426 {}
5427 };
6b0f95c4 5428 static const struct coef_fw coef0288[] = {
f3b70332
KY
5429 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5430 {}
5431 };
6b0f95c4 5432 static const struct coef_fw coef0298[] = {
89542936
KY
5433 UPDATE_COEF(0x50, 0x2000, 0x2000),
5434 UPDATE_COEF(0x56, 0x0006, 0x0006),
5435 UPDATE_COEF(0x66, 0x0008, 0),
5436 UPDATE_COEF(0x67, 0x2000, 0),
5437 UPDATE_COEF(0x19, 0x1300, 0x1300),
5438 {}
5439 };
6b0f95c4 5440 static const struct coef_fw coef0293[] = {
54db6c39
TI
5441 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5442 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5443 {}
5444 };
6b0f95c4 5445 static const struct coef_fw coef0688[] = {
54db6c39
TI
5446 WRITE_COEF(0x11, 0x0001),
5447 WRITE_COEF(0xb7, 0x802b),
5448 WRITE_COEF(0x15, 0x0d60),
5449 WRITE_COEF(0xc3, 0x0c00),
5450 {}
5451 };
6b0f95c4 5452 static const struct coef_fw coef0274[] = {
71683c32
KY
5453 UPDATE_COEF(0x4a, 0x0010, 0),
5454 UPDATE_COEF(0x4a, 0x8000, 0),
5455 WRITE_COEF(0x45, 0xd289),
5456 UPDATE_COEF(0x49, 0x0300, 0x0300),
5457 {}
5458 };
73bdd597 5459
92666d45
KY
5460 if (spec->no_internal_mic_pin) {
5461 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5462 return;
5463 }
5464
7639a06c 5465 switch (codec->core.vendor_id) {
9a22a8f5 5466 case 0x10ec0255:
717f43d8
KY
5467 alc_process_coef_fw(codec, coef0255);
5468 msleep(300);
5469 val = alc_read_coef_idx(codec, 0x46);
5470 is_ctia = (val & 0x0070) == 0x0070;
5471 break;
1948fc06 5472 case 0x10ec0230:
717f43d8 5473 case 0x10ec0236:
7081adf3 5474 case 0x10ec0256:
717f43d8
KY
5475 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5476 alc_write_coef_idx(codec, 0x06, 0x6104);
5477 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5478
5479 snd_hda_codec_write(codec, 0x21, 0,
5480 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5481 msleep(80);
5482 snd_hda_codec_write(codec, 0x21, 0,
5483 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5484
54db6c39 5485 alc_process_coef_fw(codec, coef0255);
9a22a8f5
KY
5486 msleep(300);
5487 val = alc_read_coef_idx(codec, 0x46);
5488 is_ctia = (val & 0x0070) == 0x0070;
717f43d8
KY
5489
5490 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5491 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5492
5493 snd_hda_codec_write(codec, 0x21, 0,
5494 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5495 msleep(80);
5496 snd_hda_codec_write(codec, 0x21, 0,
5497 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
9a22a8f5 5498 break;
71683c32
KY
5499 case 0x10ec0234:
5500 case 0x10ec0274:
5501 case 0x10ec0294:
5502 alc_process_coef_fw(codec, coef0274);
febf2256 5503 msleep(850);
71683c32
KY
5504 val = alc_read_coef_idx(codec, 0x46);
5505 is_ctia = (val & 0x00f0) == 0x00f0;
5506 break;
13fd08a3 5507 case 0x10ec0233:
73bdd597
DH
5508 case 0x10ec0283:
5509 alc_write_coef_idx(codec, 0x45, 0xd029);
5510 msleep(300);
5511 val = alc_read_coef_idx(codec, 0x46);
5512 is_ctia = (val & 0x0070) == 0x0070;
5513 break;
1a5bc8d9 5514 case 0x10ec0298:
89542936
KY
5515 snd_hda_codec_write(codec, 0x21, 0,
5516 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5517 msleep(100);
5518 snd_hda_codec_write(codec, 0x21, 0,
5519 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5520 msleep(200);
5521
5522 val = alc_read_coef_idx(codec, 0x50);
5523 if (val & (1 << 12)) {
5524 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5525 alc_process_coef_fw(codec, coef0288);
5526 msleep(350);
5527 val = alc_read_coef_idx(codec, 0x50);
5528 is_ctia = (val & 0x0070) == 0x0070;
5529 } else {
5530 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5531 alc_process_coef_fw(codec, coef0288);
5532 msleep(350);
5533 val = alc_read_coef_idx(codec, 0x50);
5534 is_ctia = (val & 0x0070) == 0x0070;
5535 }
5536 alc_process_coef_fw(codec, coef0298);
5537 snd_hda_codec_write(codec, 0x21, 0,
5538 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5539 msleep(75);
5540 snd_hda_codec_write(codec, 0x21, 0,
5541 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5542 break;
f3b70332
KY
5543 case 0x10ec0286:
5544 case 0x10ec0288:
5545 alc_process_coef_fw(codec, coef0288);
5546 msleep(350);
5547 val = alc_read_coef_idx(codec, 0x50);
5548 is_ctia = (val & 0x0070) == 0x0070;
5549 break;
73bdd597
DH
5550 case 0x10ec0292:
5551 alc_write_coef_idx(codec, 0x6b, 0xd429);
5552 msleep(300);
5553 val = alc_read_coef_idx(codec, 0x6c);
5554 is_ctia = (val & 0x001c) == 0x001c;
5555 break;
a22aa26f 5556 case 0x10ec0293:
54db6c39 5557 alc_process_coef_fw(codec, coef0293);
a22aa26f
KY
5558 msleep(300);
5559 val = alc_read_coef_idx(codec, 0x46);
5560 is_ctia = (val & 0x0070) == 0x0070;
5561 break;
73bdd597 5562 case 0x10ec0668:
54db6c39 5563 alc_process_coef_fw(codec, coef0688);
73bdd597
DH
5564 msleep(300);
5565 val = alc_read_coef_idx(codec, 0xbe);
5566 is_ctia = (val & 0x1c02) == 0x1c02;
5567 break;
c2b691ee 5568 case 0x10ec0215:
4cc9b9d6 5569 case 0x10ec0225:
c2b691ee 5570 case 0x10ec0285:
7d727869 5571 case 0x10ec0295:
c2b691ee 5572 case 0x10ec0289:
28f1f9b2 5573 case 0x10ec0299:
da911b1f
KY
5574 snd_hda_codec_write(codec, 0x21, 0,
5575 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5576 msleep(80);
5577 snd_hda_codec_write(codec, 0x21, 0,
5578 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5579
5a36767a
KY
5580 alc_process_coef_fw(codec, alc225_pre_hsmode);
5581 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5582 val = alc_read_coef_idx(codec, 0x45);
5583 if (val & (1 << 9)) {
5584 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5585 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5586 msleep(800);
5587 val = alc_read_coef_idx(codec, 0x46);
5588 is_ctia = (val & 0x00f0) == 0x00f0;
5589 } else {
5590 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5591 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5592 msleep(800);
5593 val = alc_read_coef_idx(codec, 0x46);
5594 is_ctia = (val & 0x00f0) == 0x00f0;
5595 }
5596 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5597 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5598 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
da911b1f
KY
5599
5600 snd_hda_codec_write(codec, 0x21, 0,
5601 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5602 msleep(80);
5603 snd_hda_codec_write(codec, 0x21, 0,
5604 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4cc9b9d6 5605 break;
78f4f7c2
KY
5606 case 0x10ec0867:
5607 is_ctia = true;
5608 break;
73bdd597
DH
5609 }
5610
4e76a883 5611 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
73bdd597
DH
5612 is_ctia ? "yes" : "no");
5613 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5614}
5615
5616static void alc_update_headset_mode(struct hda_codec *codec)
5617{
5618 struct alc_spec *spec = codec->spec;
5619
5620 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
35a39f98 5621 hda_nid_t hp_pin = alc_get_hp_pin(spec);
73bdd597
DH
5622
5623 int new_headset_mode;
5624
5625 if (!snd_hda_jack_detect(codec, hp_pin))
5626 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5627 else if (mux_pin == spec->headset_mic_pin)
5628 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5629 else if (mux_pin == spec->headphone_mic_pin)
5630 new_headset_mode = ALC_HEADSET_MODE_MIC;
5631 else
5632 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5633
5959a6bc
DH
5634 if (new_headset_mode == spec->current_headset_mode) {
5635 snd_hda_gen_update_outputs(codec);
73bdd597 5636 return;
5959a6bc 5637 }
73bdd597
DH
5638
5639 switch (new_headset_mode) {
5640 case ALC_HEADSET_MODE_UNPLUGGED:
5641 alc_headset_mode_unplugged(codec);
aeac1a0d
KY
5642 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5643 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
73bdd597
DH
5644 spec->gen.hp_jack_present = false;
5645 break;
5646 case ALC_HEADSET_MODE_HEADSET:
5647 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5648 alc_determine_headset_type(codec);
5649 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5650 alc_headset_mode_ctia(codec);
5651 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5652 alc_headset_mode_omtp(codec);
5653 spec->gen.hp_jack_present = true;
5654 break;
5655 case ALC_HEADSET_MODE_MIC:
5656 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5657 spec->gen.hp_jack_present = false;
5658 break;
5659 case ALC_HEADSET_MODE_HEADPHONE:
5660 alc_headset_mode_default(codec);
5661 spec->gen.hp_jack_present = true;
5662 break;
5663 }
5664 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5665 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5666 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
1f8b46cd 5667 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
73bdd597
DH
5668 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5669 PIN_VREFHIZ);
5670 }
5671 spec->current_headset_mode = new_headset_mode;
5672
5673 snd_hda_gen_update_outputs(codec);
5674}
5675
5676static void alc_update_headset_mode_hook(struct hda_codec *codec,
7fe30711
TI
5677 struct snd_kcontrol *kcontrol,
5678 struct snd_ctl_elem_value *ucontrol)
73bdd597
DH
5679{
5680 alc_update_headset_mode(codec);
5681}
5682
1a4f69d5
TI
5683static void alc_update_headset_jack_cb(struct hda_codec *codec,
5684 struct hda_jack_callback *jack)
73bdd597 5685{
73bdd597 5686 snd_hda_gen_hp_automute(codec, jack);
e54f30be 5687 alc_update_headset_mode(codec);
73bdd597
DH
5688}
5689
5690static void alc_probe_headset_mode(struct hda_codec *codec)
5691{
5692 int i;
5693 struct alc_spec *spec = codec->spec;
5694 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5695
5696 /* Find mic pins */
5697 for (i = 0; i < cfg->num_inputs; i++) {
5698 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5699 spec->headset_mic_pin = cfg->inputs[i].pin;
5700 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5701 spec->headphone_mic_pin = cfg->inputs[i].pin;
5702 }
5703
0bed2aa3 5704 WARN_ON(spec->gen.cap_sync_hook);
73bdd597
DH
5705 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5706 spec->gen.automute_hook = alc_update_headset_mode;
5707 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5708}
5709
5710static void alc_fixup_headset_mode(struct hda_codec *codec,
5711 const struct hda_fixup *fix, int action)
5712{
5713 struct alc_spec *spec = codec->spec;
5714
5715 switch (action) {
5716 case HDA_FIXUP_ACT_PRE_PROBE:
5717 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5718 break;
5719 case HDA_FIXUP_ACT_PROBE:
5720 alc_probe_headset_mode(codec);
5721 break;
5722 case HDA_FIXUP_ACT_INIT:
aeac1a0d
KY
5723 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5724 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5725 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5726 }
73bdd597
DH
5727 alc_update_headset_mode(codec);
5728 break;
5729 }
5730}
5731
5732static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5733 const struct hda_fixup *fix, int action)
5734{
5735 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5736 struct alc_spec *spec = codec->spec;
5737 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5738 }
5739 else
5740 alc_fixup_headset_mode(codec, fix, action);
5741}
5742
31278997
KY
5743static void alc255_set_default_jack_type(struct hda_codec *codec)
5744{
5745 /* Set to iphone type */
6b0f95c4 5746 static const struct coef_fw alc255fw[] = {
54db6c39
TI
5747 WRITE_COEF(0x1b, 0x880b),
5748 WRITE_COEF(0x45, 0xd089),
5749 WRITE_COEF(0x1b, 0x080b),
5750 WRITE_COEF(0x46, 0x0004),
5751 WRITE_COEF(0x1b, 0x0c0b),
5752 {}
5753 };
6b0f95c4 5754 static const struct coef_fw alc256fw[] = {
e69e7e03
KY
5755 WRITE_COEF(0x1b, 0x884b),
5756 WRITE_COEF(0x45, 0xd089),
5757 WRITE_COEF(0x1b, 0x084b),
5758 WRITE_COEF(0x46, 0x0004),
5759 WRITE_COEF(0x1b, 0x0c4b),
5760 {}
5761 };
5762 switch (codec->core.vendor_id) {
5763 case 0x10ec0255:
5764 alc_process_coef_fw(codec, alc255fw);
5765 break;
1948fc06 5766 case 0x10ec0230:
736f20a7 5767 case 0x10ec0236:
e69e7e03
KY
5768 case 0x10ec0256:
5769 alc_process_coef_fw(codec, alc256fw);
5770 break;
5771 }
31278997
KY
5772 msleep(30);
5773}
5774
9a22a8f5
KY
5775static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5776 const struct hda_fixup *fix, int action)
5777{
5778 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
31278997 5779 alc255_set_default_jack_type(codec);
9a22a8f5
KY
5780 }
5781 alc_fixup_headset_mode(codec, fix, action);
5782}
5783
31278997
KY
5784static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5785 const struct hda_fixup *fix, int action)
5786{
5787 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5788 struct alc_spec *spec = codec->spec;
5789 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5790 alc255_set_default_jack_type(codec);
5791 }
5792 else
5793 alc_fixup_headset_mode(codec, fix, action);
5794}
5795
e1e62b98
KY
5796static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5797 struct hda_jack_callback *jack)
5798{
5799 struct alc_spec *spec = codec->spec;
e1e62b98
KY
5800
5801 alc_update_headset_jack_cb(codec, jack);
5802 /* Headset Mic enable or disable, only for Dell Dino */
d44a6864 5803 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
e1e62b98
KY
5804}
5805
5806static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5807 const struct hda_fixup *fix, int action)
5808{
5809 alc_fixup_headset_mode(codec, fix, action);
5810 if (action == HDA_FIXUP_ACT_PROBE) {
5811 struct alc_spec *spec = codec->spec;
d44a6864
TI
5812 /* toggled via hp_automute_hook */
5813 spec->gpio_mask |= 0x40;
5814 spec->gpio_dir |= 0x40;
e1e62b98
KY
5815 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5816 }
5817}
5818
493a52a9
HW
5819static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5820 const struct hda_fixup *fix, int action)
5821{
5822 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5823 struct alc_spec *spec = codec->spec;
5824 spec->gen.auto_mute_via_amp = 1;
5825 }
5826}
5827
9b745ab8
TI
5828static void alc_fixup_no_shutup(struct hda_codec *codec,
5829 const struct hda_fixup *fix, int action)
5830{
efe55732 5831 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9b745ab8 5832 struct alc_spec *spec = codec->spec;
c0ca5ece 5833 spec->no_shutup_pins = 1;
9b745ab8
TI
5834 }
5835}
5836
5e6db669
GM
5837static void alc_fixup_disable_aamix(struct hda_codec *codec,
5838 const struct hda_fixup *fix, int action)
5839{
5840 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5841 struct alc_spec *spec = codec->spec;
5842 /* Disable AA-loopback as it causes white noise */
5843 spec->gen.mixer_nid = 0;
5844 }
5845}
5846
7f57d803
TI
5847/* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5848static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5849 const struct hda_fixup *fix, int action)
5850{
5851 static const struct hda_pintbl pincfgs[] = {
5852 { 0x16, 0x21211010 }, /* dock headphone */
5853 { 0x19, 0x21a11010 }, /* dock mic */
5854 { }
5855 };
5856 struct alc_spec *spec = codec->spec;
5857
5858 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5859 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5860 codec->power_save_node = 0; /* avoid click noises */
5861 snd_hda_apply_pincfgs(codec, pincfgs);
5862 }
5863}
5864
61fcf8ec
KY
5865static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5866 const struct hda_fixup *fix, int action)
5867{
5868 static const struct hda_pintbl pincfgs[] = {
5869 { 0x17, 0x21211010 }, /* dock headphone */
5870 { 0x19, 0x21a11010 }, /* dock mic */
5871 { }
5872 };
5873 struct alc_spec *spec = codec->spec;
5874
5875 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5876 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
71db96dd
TI
5877 snd_hda_apply_pincfgs(codec, pincfgs);
5878 } else if (action == HDA_FIXUP_ACT_INIT) {
61fcf8ec
KY
5879 /* Enable DOCK device */
5880 snd_hda_codec_write(codec, 0x17, 0,
5881 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5882 /* Enable DOCK device */
5883 snd_hda_codec_write(codec, 0x19, 0,
5884 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
61fcf8ec
KY
5885 }
5886}
5887
399c01aa
TI
5888static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5889 const struct hda_fixup *fix, int action)
5890{
5891 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5892 * the speaker output becomes too low by some reason on Thinkpads with
5893 * ALC298 codec
5894 */
5895 static const hda_nid_t preferred_pairs[] = {
5896 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5897 0
5898 };
5899 struct alc_spec *spec = codec->spec;
5900
5901 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5902 spec->gen.preferred_dacs = preferred_pairs;
5903}
5904
8eedd3a7
TI
5905static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5906 const struct hda_fixup *fix, int action)
5907{
5908 static const hda_nid_t preferred_pairs[] = {
5909 0x17, 0x02, 0x21, 0x03, 0
5910 };
5911 struct alc_spec *spec = codec->spec;
5912
5913 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5914 spec->gen.preferred_dacs = preferred_pairs;
5915}
5916
9476d369 5917static void alc_shutup_dell_xps13(struct hda_codec *codec)
033b0a7c
GM
5918{
5919 struct alc_spec *spec = codec->spec;
35a39f98 5920 int hp_pin = alc_get_hp_pin(spec);
033b0a7c 5921
9476d369
GM
5922 /* Prevent pop noises when headphones are plugged in */
5923 snd_hda_codec_write(codec, hp_pin, 0,
5924 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5925 msleep(20);
033b0a7c
GM
5926}
5927
5928static void alc_fixup_dell_xps13(struct hda_codec *codec,
5929 const struct hda_fixup *fix, int action)
5930{
3e1b0c4a
TI
5931 struct alc_spec *spec = codec->spec;
5932 struct hda_input_mux *imux = &spec->gen.input_mux;
5933 int i;
f38663ab 5934
3e1b0c4a
TI
5935 switch (action) {
5936 case HDA_FIXUP_ACT_PRE_PROBE:
5937 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5938 * it causes a click noise at start up
5939 */
5940 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
efe55732 5941 spec->shutup = alc_shutup_dell_xps13;
3e1b0c4a
TI
5942 break;
5943 case HDA_FIXUP_ACT_PROBE:
f38663ab
GM
5944 /* Make the internal mic the default input source. */
5945 for (i = 0; i < imux->num_items; i++) {
5946 if (spec->gen.imux_pins[i] == 0x12) {
5947 spec->gen.cur_mux[0] = i;
5948 break;
5949 }
5950 }
3e1b0c4a 5951 break;
033b0a7c
GM
5952 }
5953}
5954
1f8b46cd
DH
5955static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5956 const struct hda_fixup *fix, int action)
5957{
5958 struct alc_spec *spec = codec->spec;
5959
5960 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5961 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5962 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
b40eda64
DH
5963
5964 /* Disable boost for mic-in permanently. (This code is only called
5965 from quirks that guarantee that the headphone is at NID 0x1b.) */
5966 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5967 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
1f8b46cd
DH
5968 } else
5969 alc_fixup_headset_mode(codec, fix, action);
5970}
5971
73bdd597
DH
5972static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5973 const struct hda_fixup *fix, int action)
5974{
5975 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
73bdd597 5976 alc_write_coef_idx(codec, 0xc4, 0x8000);
98b24883 5977 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
73bdd597
DH
5978 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5979 }
5980 alc_fixup_headset_mode(codec, fix, action);
5981}
5982
bde7bc60
CCC
5983/* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5984static int find_ext_mic_pin(struct hda_codec *codec)
5985{
5986 struct alc_spec *spec = codec->spec;
5987 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5988 hda_nid_t nid;
5989 unsigned int defcfg;
5990 int i;
5991
5992 for (i = 0; i < cfg->num_inputs; i++) {
5993 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5994 continue;
5995 nid = cfg->inputs[i].pin;
5996 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5997 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5998 continue;
5999 return nid;
6000 }
6001
6002 return 0;
6003}
6004
08a978db 6005static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
1727a771 6006 const struct hda_fixup *fix,
08a978db
DR
6007 int action)
6008{
6009 struct alc_spec *spec = codec->spec;
6010
0db75790 6011 if (action == HDA_FIXUP_ACT_PROBE) {
bde7bc60 6012 int mic_pin = find_ext_mic_pin(codec);
35a39f98 6013 int hp_pin = alc_get_hp_pin(spec);
bde7bc60
CCC
6014
6015 if (snd_BUG_ON(!mic_pin || !hp_pin))
0db75790 6016 return;
bde7bc60 6017 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
0db75790 6018 }
08a978db 6019}
693b613d 6020
3e0d611b
DH
6021static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6022 const struct hda_fixup *fix,
6023 int action)
6024{
6025 struct alc_spec *spec = codec->spec;
6026 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6027 int i;
6028
6029 /* The mic boosts on level 2 and 3 are too noisy
6030 on the internal mic input.
6031 Therefore limit the boost to 0 or 1. */
6032
6033 if (action != HDA_FIXUP_ACT_PROBE)
6034 return;
6035
6036 for (i = 0; i < cfg->num_inputs; i++) {
6037 hda_nid_t nid = cfg->inputs[i].pin;
6038 unsigned int defcfg;
6039 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6040 continue;
6041 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6042 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6043 continue;
6044
6045 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6046 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6047 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6048 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6049 (0 << AC_AMPCAP_MUTE_SHIFT));
6050 }
6051}
6052
cd217a63 6053static void alc283_hp_automute_hook(struct hda_codec *codec,
1a4f69d5 6054 struct hda_jack_callback *jack)
cd217a63
KY
6055{
6056 struct alc_spec *spec = codec->spec;
6057 int vref;
6058
6059 msleep(200);
6060 snd_hda_gen_hp_automute(codec, jack);
6061
6062 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6063
6064 msleep(600);
6065 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6066 vref);
6067}
6068
cd217a63
KY
6069static void alc283_fixup_chromebook(struct hda_codec *codec,
6070 const struct hda_fixup *fix, int action)
6071{
6072 struct alc_spec *spec = codec->spec;
cd217a63
KY
6073
6074 switch (action) {
6075 case HDA_FIXUP_ACT_PRE_PROBE:
0202e99c 6076 snd_hda_override_wcaps(codec, 0x03, 0);
d2e92709
TI
6077 /* Disable AA-loopback as it causes white noise */
6078 spec->gen.mixer_nid = 0;
38070219 6079 break;
0202e99c 6080 case HDA_FIXUP_ACT_INIT:
de9481cb
KY
6081 /* MIC2-VREF control */
6082 /* Set to manual mode */
98b24883 6083 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
0202e99c 6084 /* Enable Line1 input control by verb */
98b24883 6085 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
0202e99c
KY
6086 break;
6087 }
6088}
6089
6090static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6091 const struct hda_fixup *fix, int action)
6092{
6093 struct alc_spec *spec = codec->spec;
0202e99c
KY
6094
6095 switch (action) {
6096 case HDA_FIXUP_ACT_PRE_PROBE:
cd217a63 6097 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
38070219
KY
6098 break;
6099 case HDA_FIXUP_ACT_INIT:
cd217a63
KY
6100 /* MIC2-VREF control */
6101 /* Set to manual mode */
98b24883 6102 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
cd217a63
KY
6103 break;
6104 }
6105}
6106
7bba2157
TI
6107/* mute tablet speaker pin (0x14) via dock plugging in addition */
6108static void asus_tx300_automute(struct hda_codec *codec)
6109{
6110 struct alc_spec *spec = codec->spec;
6111 snd_hda_gen_update_outputs(codec);
6112 if (snd_hda_jack_detect(codec, 0x1b))
6113 spec->gen.mute_bits |= (1ULL << 0x14);
6114}
6115
6116static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6117 const struct hda_fixup *fix, int action)
6118{
6119 struct alc_spec *spec = codec->spec;
7bba2157
TI
6120 static const struct hda_pintbl dock_pins[] = {
6121 { 0x1b, 0x21114000 }, /* dock speaker pin */
6122 {}
6123 };
7bba2157
TI
6124
6125 switch (action) {
6126 case HDA_FIXUP_ACT_PRE_PROBE:
1c76aa5f 6127 spec->init_amp = ALC_INIT_DEFAULT;
ae065f1c
TI
6128 /* TX300 needs to set up GPIO2 for the speaker amp */
6129 alc_setup_gpio(codec, 0x04);
7bba2157
TI
6130 snd_hda_apply_pincfgs(codec, dock_pins);
6131 spec->gen.auto_mute_via_amp = 1;
6132 spec->gen.automute_hook = asus_tx300_automute;
6133 snd_hda_jack_detect_enable_callback(codec, 0x1b,
7bba2157
TI
6134 snd_hda_gen_hp_automute);
6135 break;
5579cd6f
TI
6136 case HDA_FIXUP_ACT_PROBE:
6137 spec->init_amp = ALC_INIT_DEFAULT;
6138 break;
7bba2157
TI
6139 case HDA_FIXUP_ACT_BUILD:
6140 /* this is a bit tricky; give more sane names for the main
6141 * (tablet) speaker and the dock speaker, respectively
6142 */
56798e6b
TI
6143 rename_ctl(codec, "Speaker Playback Switch",
6144 "Dock Speaker Playback Switch");
6145 rename_ctl(codec, "Bass Speaker Playback Switch",
6146 "Speaker Playback Switch");
7bba2157
TI
6147 break;
6148 }
6149}
6150
338cae56
DH
6151static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6152 const struct hda_fixup *fix, int action)
6153{
0f4881dc
DH
6154 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6155 /* DAC node 0x03 is giving mono output. We therefore want to
6156 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6157 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
caf3c043
MM
6158 static const hda_nid_t conn1[] = { 0x0c };
6159 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6160 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
0f4881dc 6161 }
338cae56
DH
6162}
6163
dd9aa335
HW
6164static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6165 const struct hda_fixup *fix, int action)
6166{
6167 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6168 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6169 we can't adjust the speaker's volume since this node does not has
6170 Amp-out capability. we change the speaker's route to:
6171 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6172 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6173 speaker's volume now. */
6174
caf3c043
MM
6175 static const hda_nid_t conn1[] = { 0x0c };
6176 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
dd9aa335
HW
6177 }
6178}
6179
e312a869
TI
6180/* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6181static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6182 const struct hda_fixup *fix, int action)
6183{
6184 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6185 static const hda_nid_t conn[] = { 0x02, 0x03 };
6186 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
e312a869
TI
6187 }
6188}
6189
d2cd795c
JK
6190/* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6191static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6192 const struct hda_fixup *fix, int action)
6193{
6194 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
caf3c043
MM
6195 static const hda_nid_t conn[] = { 0x02 };
6196 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
d2cd795c
JK
6197 }
6198}
6199
98973f2f
KP
6200/* Hook to update amp GPIO4 for automute */
6201static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6202 struct hda_jack_callback *jack)
6203{
6204 struct alc_spec *spec = codec->spec;
6205
6206 snd_hda_gen_hp_automute(codec, jack);
6207 /* mute_led_polarity is set to 0, so we pass inverted value here */
dbd13179
KHF
6208 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6209 !spec->gen.hp_jack_present);
98973f2f
KP
6210}
6211
6212/* Manage GPIOs for HP EliteBook Folio 9480m.
6213 *
6214 * GPIO4 is the headphone amplifier power control
6215 * GPIO3 is the audio output mute indicator LED
6216 */
6217
6218static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6219 const struct hda_fixup *fix,
6220 int action)
6221{
6222 struct alc_spec *spec = codec->spec;
98973f2f 6223
01e4a275 6224 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
98973f2f 6225 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
01e4a275
TI
6226 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6227 spec->gpio_mask |= 0x10;
6228 spec->gpio_dir |= 0x10;
98973f2f 6229 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
98973f2f
KP
6230 }
6231}
6232
ae065f1c
TI
6233static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6234 const struct hda_fixup *fix,
6235 int action)
6236{
6237 struct alc_spec *spec = codec->spec;
6238
6239 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6240 spec->gpio_mask |= 0x04;
6241 spec->gpio_dir |= 0x04;
6242 /* set data bit low */
6243 }
6244}
6245
6a6660d0
TI
6246/* Quirk for Thinkpad X1 7th and 8th Gen
6247 * The following fixed routing needed
6248 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6249 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6250 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6251 */
6252static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6253 const struct hda_fixup *fix, int action)
6254{
6255 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6256 static const hda_nid_t preferred_pairs[] = {
6257 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6258 };
6259 struct alc_spec *spec = codec->spec;
6260
6261 switch (action) {
6262 case HDA_FIXUP_ACT_PRE_PROBE:
6263 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6264 spec->gen.preferred_dacs = preferred_pairs;
6265 break;
6266 case HDA_FIXUP_ACT_BUILD:
6267 /* The generic parser creates somewhat unintuitive volume ctls
6268 * with the fixed routing above, and the shared DAC2 may be
6269 * confusing for PA.
6270 * Rename those to unique names so that PA doesn't touch them
6271 * and use only Master volume.
6272 */
6273 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6274 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6275 break;
6276 }
6277}
6278
ca169cc2
KY
6279static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6280 const struct hda_fixup *fix,
6281 int action)
6282{
6283 alc_fixup_dual_codecs(codec, fix, action);
6284 switch (action) {
6285 case HDA_FIXUP_ACT_PRE_PROBE:
6286 /* override card longname to provide a unique UCM profile */
6287 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6288 break;
6289 case HDA_FIXUP_ACT_BUILD:
6290 /* rename Capture controls depending on the codec */
6291 rename_ctl(codec, "Capture Volume",
6292 codec->addr == 0 ?
6293 "Rear-Panel Capture Volume" :
6294 "Front-Panel Capture Volume");
6295 rename_ctl(codec, "Capture Switch",
6296 codec->addr == 0 ?
6297 "Rear-Panel Capture Switch" :
6298 "Front-Panel Capture Switch");
6299 break;
6300 }
6301}
6302
52e4e368
KHF
6303static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6304 const struct hda_fixup *fix, int action)
6305{
6306 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6307 return;
6308
6309 codec->power_save_node = 1;
6310}
6311
92266651
KY
6312/* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6313static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6314 const struct hda_fixup *fix, int action)
6315{
6316 struct alc_spec *spec = codec->spec;
caf3c043 6317 static const hda_nid_t preferred_pairs[] = {
92266651
KY
6318 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6319 0
6320 };
6321
6322 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6323 return;
6324
6325 spec->gen.preferred_dacs = preferred_pairs;
0700d3d1
KY
6326 spec->gen.auto_mute_via_amp = 1;
6327 codec->power_save_node = 0;
92266651
KY
6328}
6329
c84bfedc
TI
6330/* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6331static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6332 const struct hda_fixup *fix, int action)
6333{
6334 static const hda_nid_t preferred_pairs[] = {
6335 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6336 };
6337 struct alc_spec *spec = codec->spec;
6338
6339 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6340 spec->gen.preferred_dacs = preferred_pairs;
6341 spec->gen.obey_preferred_dacs = 1;
6342 }
6343}
6344
c4cfcf6f
HW
6345/* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6346static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6347 const struct hda_fixup *fix, int action)
6348{
6349 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6350 return;
6351
6352 snd_hda_override_wcaps(codec, 0x03, 0);
6353}
6354
8a8de09c
KY
6355static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6356{
6357 switch (codec->core.vendor_id) {
6358 case 0x10ec0274:
6359 case 0x10ec0294:
6360 case 0x10ec0225:
6361 case 0x10ec0295:
6362 case 0x10ec0299:
6363 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6364 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6365 break;
1948fc06 6366 case 0x10ec0230:
8a8de09c
KY
6367 case 0x10ec0235:
6368 case 0x10ec0236:
6369 case 0x10ec0255:
6370 case 0x10ec0256:
6371 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6372 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6373 break;
6374 }
6375}
6376
8983eb60
KY
6377static void alc295_fixup_chromebook(struct hda_codec *codec,
6378 const struct hda_fixup *fix, int action)
6379{
d3ba58bb
KY
6380 struct alc_spec *spec = codec->spec;
6381
8983eb60 6382 switch (action) {
d3ba58bb
KY
6383 case HDA_FIXUP_ACT_PRE_PROBE:
6384 spec->ultra_low_power = true;
6385 break;
8983eb60 6386 case HDA_FIXUP_ACT_INIT:
8a8de09c 6387 alc_combo_jack_hp_jd_restart(codec);
8983eb60
KY
6388 break;
6389 }
6390}
6391
d1dd4211
KY
6392static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6393 const struct hda_fixup *fix, int action)
6394{
6395 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6396 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6397}
6398
c3cdf189
LJ
6399
6400static void alc294_gx502_toggle_output(struct hda_codec *codec,
6401 struct hda_jack_callback *cb)
6402{
6403 /* The Windows driver sets the codec up in a very different way where
6404 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6405 */
6406 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6407 alc_write_coef_idx(codec, 0x10, 0x8a20);
6408 else
6409 alc_write_coef_idx(codec, 0x10, 0x0a20);
6410}
6411
6412static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6413 const struct hda_fixup *fix, int action)
6414{
6415 /* Pin 0x21: headphones/headset mic */
6416 if (!is_jack_detectable(codec, 0x21))
6417 return;
6418
6419 switch (action) {
6420 case HDA_FIXUP_ACT_PRE_PROBE:
6421 snd_hda_jack_detect_enable_callback(codec, 0x21,
6422 alc294_gx502_toggle_output);
6423 break;
6424 case HDA_FIXUP_ACT_INIT:
6425 /* Make sure to start in a correct state, i.e. if
6426 * headphones have been plugged in before powering up the system
6427 */
6428 alc294_gx502_toggle_output(codec, NULL);
6429 break;
6430 }
6431}
6432
c1b55029
DC
6433static void alc294_gu502_toggle_output(struct hda_codec *codec,
6434 struct hda_jack_callback *cb)
6435{
6436 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6437 * responsible from changes between speakers and headphones
6438 */
6439 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6440 alc_write_coef_idx(codec, 0x10, 0x8420);
6441 else
6442 alc_write_coef_idx(codec, 0x10, 0x0a20);
6443}
6444
6445static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6446 const struct hda_fixup *fix, int action)
6447{
6448 if (!is_jack_detectable(codec, 0x21))
6449 return;
6450
6451 switch (action) {
6452 case HDA_FIXUP_ACT_PRE_PROBE:
6453 snd_hda_jack_detect_enable_callback(codec, 0x21,
6454 alc294_gu502_toggle_output);
6455 break;
6456 case HDA_FIXUP_ACT_INIT:
6457 alc294_gu502_toggle_output(codec, NULL);
6458 break;
6459 }
6460}
6461
56496253
KY
6462static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6463 const struct hda_fixup *fix, int action)
6464{
6465 if (action != HDA_FIXUP_ACT_INIT)
6466 return;
6467
6468 msleep(100);
6469 alc_write_coef_idx(codec, 0x65, 0x0);
6470}
6471
8a8de09c
KY
6472static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6473 const struct hda_fixup *fix, int action)
6474{
6475 switch (action) {
6476 case HDA_FIXUP_ACT_INIT:
6477 alc_combo_jack_hp_jd_restart(codec);
6478 break;
6479 }
6480}
6481
92666d45
KY
6482static void alc_fixup_no_int_mic(struct hda_codec *codec,
6483 const struct hda_fixup *fix, int action)
6484{
6485 struct alc_spec *spec = codec->spec;
6486
6487 switch (action) {
6488 case HDA_FIXUP_ACT_PRE_PROBE:
6489 /* Mic RING SLEEVE swap for combo jack */
6490 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6491 spec->no_internal_mic_pin = true;
6492 break;
6493 case HDA_FIXUP_ACT_INIT:
6494 alc_combo_jack_hp_jd_restart(codec);
6495 break;
6496 }
6497}
6498
d94befbb
DB
6499/* GPIO1 = amplifier on/off
6500 * GPIO3 = mic mute LED
6501 */
6502static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6503 const struct hda_fixup *fix, int action)
6504{
6505 static const hda_nid_t conn[] = { 0x02 };
6506
6507 struct alc_spec *spec = codec->spec;
6508 static const struct hda_pintbl pincfgs[] = {
6509 { 0x14, 0x90170110 }, /* front/high speakers */
6510 { 0x17, 0x90170130 }, /* back/bass speakers */
6511 { }
6512 };
6513
6514 //enable micmute led
6515 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6516
6517 switch (action) {
6518 case HDA_FIXUP_ACT_PRE_PROBE:
6519 spec->micmute_led_polarity = 1;
6520 /* needed for amp of back speakers */
6521 spec->gpio_mask |= 0x01;
6522 spec->gpio_dir |= 0x01;
6523 snd_hda_apply_pincfgs(codec, pincfgs);
6524 /* share DAC to have unified volume control */
6525 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6526 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6527 break;
6528 case HDA_FIXUP_ACT_INIT:
6529 /* need to toggle GPIO to enable the amp of back speakers */
6530 alc_update_gpio_data(codec, 0x01, true);
6531 msleep(100);
6532 alc_update_gpio_data(codec, 0x01, false);
6533 break;
6534 }
6535}
6536
434591b2
ED
6537static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6538 const struct hda_fixup *fix, int action)
6539{
6540 static const hda_nid_t conn[] = { 0x02 };
6541 static const struct hda_pintbl pincfgs[] = {
6542 { 0x14, 0x90170110 }, /* rear speaker */
6543 { }
6544 };
6545
6546 switch (action) {
6547 case HDA_FIXUP_ACT_PRE_PROBE:
6548 snd_hda_apply_pincfgs(codec, pincfgs);
6549 /* force front speaker to DAC1 */
6550 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6551 break;
6552 }
6553}
6554
b317b032
TI
6555/* for hda_fixup_thinkpad_acpi() */
6556#include "thinkpad_helper.c"
b67ae3f1 6557
d5a6cabf
TI
6558static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6559 const struct hda_fixup *fix, int action)
6560{
6561 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6562 hda_fixup_thinkpad_acpi(codec, fix, action);
6563}
6564
ad7cc2d4
CB
6565/* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6566static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6567 const struct hda_fixup *fix,
6568 int action)
6569{
6570 struct alc_spec *spec = codec->spec;
6571
6572 switch (action) {
6573 case HDA_FIXUP_ACT_PRE_PROBE:
6574 spec->gen.suppress_auto_mute = 1;
6575 break;
6576 }
6577}
6578
bbf8ff6b
TB
6579/* for alc295_fixup_hp_top_speakers */
6580#include "hp_x360_helper.c"
6581
26928ca1
TI
6582/* for alc285_fixup_ideapad_s740_coef() */
6583#include "ideapad_s740_helper.c"
6584
b9145ede
WS
6585static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6586 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6587 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6588 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6589 {}
6590};
6591
6592static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6593 const struct hda_fixup *fix,
6594 int action)
dd6dd6e3
WS
6595{
6596 /*
b9145ede
WS
6597 * A certain other OS sets these coeffs to different values. On at least
6598 * one TongFang barebone these settings might survive even a cold
6599 * reboot. So to restore a clean slate the values are explicitly reset
6600 * to default here. Without this, the external microphone is always in a
6601 * plugged-in state, while the internal microphone is always in an
6602 * unplugged state, breaking the ability to use the internal microphone.
6603 */
6604 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
dd6dd6e3
WS
6605}
6606
e1abacd3
WS
6607static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6608 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6609 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6610 WRITE_COEF(0x49, 0x0149),
6611 {}
6612};
6613
6614static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6615 const struct hda_fixup *fix,
6616 int action)
6617{
6618 /*
6619 * The audio jack input and output is not detected on the ASRock NUC Box
6620 * 1100 series when cold booting without this fix. Warm rebooting from a
6621 * certain other OS makes the audio functional, as COEF settings are
6622 * preserved in this case. This fix sets these altered COEF values as
6623 * the default.
6624 */
6625 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6626}
6627
f2ca7e35
WS
6628static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6629 const struct hda_fixup *fix,
6630 int action)
6631{
6632 /*
6633 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6634 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6635 * needs an additional quirk for sound working after suspend and resume.
6636 */
6637 if (codec->core.vendor_id == 0x10ec0256) {
6638 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6639 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6640 } else {
6641 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6642 }
6643}
6644
1d045db9 6645enum {
f73bbf63 6646 ALC269_FIXUP_GPIO2,
1d045db9
TI
6647 ALC269_FIXUP_SONY_VAIO,
6648 ALC275_FIXUP_SONY_VAIO_GPIO2,
6649 ALC269_FIXUP_DELL_M101Z,
6650 ALC269_FIXUP_SKU_IGNORE,
6651 ALC269_FIXUP_ASUS_G73JW,
6652 ALC269_FIXUP_LENOVO_EAPD,
6653 ALC275_FIXUP_SONY_HWEQ,
e9bd7d5c 6654 ALC275_FIXUP_SONY_DISABLE_AAMIX,
1d045db9 6655 ALC271_FIXUP_DMIC,
017f2a10 6656 ALC269_FIXUP_PCM_44K,
adabb3ec 6657 ALC269_FIXUP_STEREO_DMIC,
7c478f03 6658 ALC269_FIXUP_HEADSET_MIC,
24519911
TI
6659 ALC269_FIXUP_QUANTA_MUTE,
6660 ALC269_FIXUP_LIFEBOOK,
2041d564 6661 ALC269_FIXUP_LIFEBOOK_EXTMIC,
cc7016ab 6662 ALC269_FIXUP_LIFEBOOK_HP_PIN,
4df3fd17 6663 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
fdcc968a 6664 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
a4297b5d
TI
6665 ALC269_FIXUP_AMIC,
6666 ALC269_FIXUP_DMIC,
6667 ALC269VB_FIXUP_AMIC,
6668 ALC269VB_FIXUP_DMIC,
08fb0d0e 6669 ALC269_FIXUP_HP_MUTE_LED,
d06ac143 6670 ALC269_FIXUP_HP_MUTE_LED_MIC1,
08fb0d0e 6671 ALC269_FIXUP_HP_MUTE_LED_MIC2,
7f783bd5 6672 ALC269_FIXUP_HP_MUTE_LED_MIC3,
9f5c6faf 6673 ALC269_FIXUP_HP_GPIO_LED,
9c5dc3bf
KY
6674 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6675 ALC269_FIXUP_HP_LINE1_MIC1_LED,
693b613d 6676 ALC269_FIXUP_INV_DMIC,
108cc108 6677 ALC269_FIXUP_LENOVO_DOCK,
b590b38c 6678 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
9b745ab8 6679 ALC269_FIXUP_NO_SHUTUP,
88cfcf86 6680 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
108cc108 6681 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
73bdd597
DH
6682 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6683 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
338cae56 6684 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
fcc6c877 6685 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
73bdd597
DH
6686 ALC269_FIXUP_HEADSET_MODE,
6687 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
7819717b 6688 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
d240d1dc
DH
6689 ALC269_FIXUP_ASUS_X101_FUNC,
6690 ALC269_FIXUP_ASUS_X101_VERB,
6691 ALC269_FIXUP_ASUS_X101,
08a978db
DR
6692 ALC271_FIXUP_AMIC_MIC2,
6693 ALC271_FIXUP_HP_GATE_MIC_JACK,
b1e8972e 6694 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
42397004 6695 ALC269_FIXUP_ACER_AC700,
3e0d611b 6696 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
2cede303 6697 ALC269VB_FIXUP_ASUS_ZENBOOK,
23870831 6698 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
8e35cd4a 6699 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
02b504d9 6700 ALC269VB_FIXUP_ORDISSIMO_EVE2,
cd217a63 6701 ALC283_FIXUP_CHROME_BOOK,
0202e99c 6702 ALC283_FIXUP_SENSE_COMBO_JACK,
7bba2157 6703 ALC282_FIXUP_ASUS_TX300,
1bb3e062 6704 ALC283_FIXUP_INT_MIC,
338cae56 6705 ALC290_FIXUP_MONO_SPEAKERS,
0f4881dc
DH
6706 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6707 ALC290_FIXUP_SUBWOOFER,
6708 ALC290_FIXUP_SUBWOOFER_HSJACK,
b67ae3f1 6709 ALC269_FIXUP_THINKPAD_ACPI,
56f27013 6710 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5824ce8d 6711 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
615966ad 6712 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9a22a8f5 6713 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
31278997 6714 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9a22a8f5 6715 ALC255_FIXUP_HEADSET_MODE,
31278997 6716 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
a22aa26f 6717 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
1c37c223 6718 ALC292_FIXUP_TPT440_DOCK,
9a811230 6719 ALC292_FIXUP_TPT440,
abaa2274 6720 ALC283_FIXUP_HEADSET_MIC,
b3802783 6721 ALC255_FIXUP_MIC_MUTE_LED,
1a22e775 6722 ALC282_FIXUP_ASPIRE_V5_PINS,
c8426b27 6723 ALC269VB_FIXUP_ASPIRE_E1_COEF,
7a5255f1 6724 ALC280_FIXUP_HP_GPIO4,
eaa8e5ef 6725 ALC286_FIXUP_HP_GPIO_LED,
33f4acd3 6726 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
b4b33f9d 6727 ALC280_FIXUP_HP_DOCK_PINS,
04d5466a 6728 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
98973f2f 6729 ALC280_FIXUP_HP_9480M,
c3bb2b52 6730 ALC245_FIXUP_HP_X360_AMP,
d94befbb 6731 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
e1e62b98
KY
6732 ALC288_FIXUP_DELL_HEADSET_MODE,
6733 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
831bfdf9
HW
6734 ALC288_FIXUP_DELL_XPS_13,
6735 ALC288_FIXUP_DISABLE_AAMIX,
5fab5829 6736 ALC292_FIXUP_DELL_E7X_AAMIX,
8b99aba7
TI
6737 ALC292_FIXUP_DELL_E7X,
6738 ALC292_FIXUP_DISABLE_AAMIX,
c04017ea 6739 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
54324221 6740 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
977e6276 6741 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
2f726aec 6742 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6ed1131f 6743 ALC275_FIXUP_DELL_XPS,
23adc192 6744 ALC293_FIXUP_LENOVO_SPK_NOISE,
3694cb29 6745 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
3b43b71f 6746 ALC255_FIXUP_DELL_SPK_NOISE,
d1dd4211 6747 ALC225_FIXUP_DISABLE_MIC_VREF,
2ae95577 6748 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
e312a869 6749 ALC295_FIXUP_DISABLE_DAC3,
d2cd795c 6750 ALC285_FIXUP_SPEAKER2_TO_DAC1,
f883982d 6751 ALC280_FIXUP_HP_HEADSET_MIC,
e549d190 6752 ALC221_FIXUP_HP_FRONT_MIC,
c636b95e 6753 ALC292_FIXUP_TPT460,
dd9aa335 6754 ALC298_FIXUP_SPK_VOLUME,
f86de9b1 6755 ALC298_FIXUP_LENOVO_SPK_VOLUME,
fd06c77e 6756 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
823ff161 6757 ALC269_FIXUP_ATIV_BOOK_8,
9eb5d0e6 6758 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
c1732ede
CC
6759 ALC256_FIXUP_ASUS_HEADSET_MODE,
6760 ALC256_FIXUP_ASUS_MIC,
eeed4cd1 6761 ALC256_FIXUP_ASUS_AIO_GPIO2,
216d7aeb
CC
6762 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6763 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
ca169cc2 6764 ALC233_FIXUP_LENOVO_MULTI_CODECS,
ea5c7eba 6765 ALC233_FIXUP_ACER_HEADSET_MIC,
f33f79f3 6766 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5f364135 6767 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
52e4e368 6768 ALC225_FIXUP_S3_POP_NOISE,
b84e8436 6769 ALC700_FIXUP_INTEL_REFERENCE,
92266651
KY
6770 ALC274_FIXUP_DELL_BIND_DACS,
6771 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
399c01aa 6772 ALC298_FIXUP_TPT470_DOCK_FIX,
61fcf8ec 6773 ALC298_FIXUP_TPT470_DOCK,
ae104a21 6774 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
f0ba9d69 6775 ALC255_FIXUP_DELL_HEADSET_MIC,
0fbf21c3 6776 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
a2ef03fe 6777 ALC298_FIXUP_HUAWEI_MBX_STEREO,
bbf8ff6b 6778 ALC295_FIXUP_HP_X360,
8a328ac1 6779 ALC221_FIXUP_HP_HEADSET_MIC,
c4cfcf6f 6780 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
e8ed64b0 6781 ALC295_FIXUP_HP_AUTO_MUTE,
33aaebd4 6782 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
d8ae458e 6783 ALC294_FIXUP_ASUS_MIC,
4e051106
JHP
6784 ALC294_FIXUP_ASUS_HEADSET_MIC,
6785 ALC294_FIXUP_ASUS_SPK,
89e3a568 6786 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
c8c6ee61 6787 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
cbc05fd6 6788 ALC255_FIXUP_ACER_HEADSET_MIC,
10f5b1b8 6789 ALC295_FIXUP_CHROME_BOOK,
8983eb60 6790 ALC225_FIXUP_HEADSET_JACK,
136824ef
KY
6791 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6792 ALC225_FIXUP_WYSE_AUTO_MUTE,
6793 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
667a8f73 6794 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
8c8967a7 6795 ALC256_FIXUP_ASUS_HEADSET_MIC,
e1037354 6796 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
e2a829b3 6797 ALC299_FIXUP_PREDATOR_SPK,
bd9c10bc 6798 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
e79c2269
KY
6799 ALC289_FIXUP_DELL_SPK2,
6800 ALC289_FIXUP_DUAL_SPK,
48e01504
CC
6801 ALC294_FIXUP_SPK2_TO_DAC1,
6802 ALC294_FIXUP_ASUS_DUAL_SPK,
6a6660d0 6803 ALC285_FIXUP_THINKPAD_X1_GEN7,
76f7dec0 6804 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8b33a134 6805 ALC294_FIXUP_ASUS_HPE,
1b94e59d 6806 ALC294_FIXUP_ASUS_COEF_1B,
c3cdf189
LJ
6807 ALC294_FIXUP_ASUS_GX502_HP,
6808 ALC294_FIXUP_ASUS_GX502_PINS,
6809 ALC294_FIXUP_ASUS_GX502_VERBS,
c1b55029
DC
6810 ALC294_FIXUP_ASUS_GU502_HP,
6811 ALC294_FIXUP_ASUS_GU502_PINS,
6812 ALC294_FIXUP_ASUS_GU502_VERBS,
f5a88b0a 6813 ALC285_FIXUP_HP_GPIO_LED,
431e76c3 6814 ALC285_FIXUP_HP_MUTE_LED,
e7d66cf7 6815 ALC236_FIXUP_HP_GPIO_LED,
24164f43 6816 ALC236_FIXUP_HP_MUTE_LED,
75b62ab6 6817 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
14425f1f 6818 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
9e43342b 6819 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8eae7e9b 6820 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6e15d126 6821 ALC269VC_FIXUP_ACER_HEADSET_MIC,
781c90c0 6822 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
293a92c1 6823 ALC289_FIXUP_ASUS_GA401,
4b43d05a 6824 ALC289_FIXUP_ASUS_GA502,
f50a121d 6825 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
56496253 6826 ALC285_FIXUP_HP_GPIO_AMP_INIT,
f1ec5be1
HC
6827 ALC269_FIXUP_CZC_B20,
6828 ALC269_FIXUP_CZC_TMI,
6829 ALC269_FIXUP_CZC_L101,
6830 ALC269_FIXUP_LEMOTE_A1802,
6831 ALC269_FIXUP_LEMOTE_A190X,
e2d2fded 6832 ALC256_FIXUP_INTEL_NUC8_RUGGED,
d1ee66c5
PC
6833 ALC233_FIXUP_INTEL_NUC8_DMIC,
6834 ALC233_FIXUP_INTEL_NUC8_BOOST,
73e7161e 6835 ALC256_FIXUP_INTEL_NUC10,
fc19d559 6836 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
13468bfa 6837 ALC274_FIXUP_HP_MIC,
8a8de09c 6838 ALC274_FIXUP_HP_HEADSET_MIC,
622464c8 6839 ALC274_FIXUP_HP_ENVY_GPIO,
ef9ce66f 6840 ALC256_FIXUP_ASUS_HPE,
446b8185 6841 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
a0ccbc53 6842 ALC287_FIXUP_HP_GPIO_LED,
9e885770 6843 ALC256_FIXUP_HP_HEADSET_MIC,
c47b3112 6844 ALC245_FIXUP_HP_GPIO_LED,
92666d45 6845 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
34cdf405 6846 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
495dc763 6847 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
d0e18561 6848 ALC256_FIXUP_ACER_HEADSET_MIC,
26928ca1 6849 ALC285_FIXUP_IDEAPAD_S740_COEF,
bd15b155 6850 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
8eedd3a7 6851 ALC295_FIXUP_ASUS_DACS,
5d84b531 6852 ALC295_FIXUP_HP_OMEN,
f2be77fe 6853 ALC285_FIXUP_HP_SPECTRE_X360,
9ebaef05 6854 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
29c8f40b 6855 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
57c9e21a 6856 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
8903376d 6857 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
ad7cc2d4
CB
6858 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6859 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6860 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
dd6dd6e3 6861 ALC287_FIXUP_13S_GEN2_SPEAKERS,
b9145ede 6862 ALC256_FIXUP_SET_COEF_DEFAULTS,
4803b99a 6863 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
e1abacd3 6864 ALC233_FIXUP_NO_AUDIO_JACK,
f2ca7e35 6865 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
e7e2503a
BF
6866 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
6867 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
f1d4e28b
KY
6868};
6869
1727a771 6870static const struct hda_fixup alc269_fixups[] = {
f73bbf63
KHF
6871 [ALC269_FIXUP_GPIO2] = {
6872 .type = HDA_FIXUP_FUNC,
6873 .v.func = alc_fixup_gpio2,
6874 },
1d045db9 6875 [ALC269_FIXUP_SONY_VAIO] = {
fd108215
TI
6876 .type = HDA_FIXUP_PINCTLS,
6877 .v.pins = (const struct hda_pintbl[]) {
6878 {0x19, PIN_VREFGRD},
1d045db9
TI
6879 {}
6880 }
f1d4e28b 6881 },
1d045db9 6882 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
ae065f1c
TI
6883 .type = HDA_FIXUP_FUNC,
6884 .v.func = alc275_fixup_gpio4_off,
1d045db9
TI
6885 .chained = true,
6886 .chain_id = ALC269_FIXUP_SONY_VAIO
6887 },
6888 [ALC269_FIXUP_DELL_M101Z] = {
1727a771 6889 .type = HDA_FIXUP_VERBS,
1d045db9
TI
6890 .v.verbs = (const struct hda_verb[]) {
6891 /* Enables internal speaker */
6892 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6893 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6894 {}
6895 }
6896 },
6897 [ALC269_FIXUP_SKU_IGNORE] = {
1727a771 6898 .type = HDA_FIXUP_FUNC,
23d30f28 6899 .v.func = alc_fixup_sku_ignore,
1d045db9
TI
6900 },
6901 [ALC269_FIXUP_ASUS_G73JW] = {
1727a771
TI
6902 .type = HDA_FIXUP_PINS,
6903 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
6904 { 0x17, 0x99130111 }, /* subwoofer */
6905 { }
6906 }
6907 },
6908 [ALC269_FIXUP_LENOVO_EAPD] = {
1727a771 6909 .type = HDA_FIXUP_VERBS,
1d045db9
TI
6910 .v.verbs = (const struct hda_verb[]) {
6911 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6912 {}
6913 }
6914 },
6915 [ALC275_FIXUP_SONY_HWEQ] = {
1727a771 6916 .type = HDA_FIXUP_FUNC,
1d045db9
TI
6917 .v.func = alc269_fixup_hweq,
6918 .chained = true,
6919 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6920 },
e9bd7d5c
TI
6921 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6922 .type = HDA_FIXUP_FUNC,
6923 .v.func = alc_fixup_disable_aamix,
6924 .chained = true,
6925 .chain_id = ALC269_FIXUP_SONY_VAIO
6926 },
1d045db9 6927 [ALC271_FIXUP_DMIC] = {
1727a771 6928 .type = HDA_FIXUP_FUNC,
1d045db9 6929 .v.func = alc271_fixup_dmic,
f1d4e28b 6930 },
017f2a10 6931 [ALC269_FIXUP_PCM_44K] = {
1727a771 6932 .type = HDA_FIXUP_FUNC,
017f2a10 6933 .v.func = alc269_fixup_pcm_44k,
012e7eb1
DH
6934 .chained = true,
6935 .chain_id = ALC269_FIXUP_QUANTA_MUTE
017f2a10 6936 },
adabb3ec 6937 [ALC269_FIXUP_STEREO_DMIC] = {
1727a771 6938 .type = HDA_FIXUP_FUNC,
adabb3ec
TI
6939 .v.func = alc269_fixup_stereo_dmic,
6940 },
7c478f03
DH
6941 [ALC269_FIXUP_HEADSET_MIC] = {
6942 .type = HDA_FIXUP_FUNC,
6943 .v.func = alc269_fixup_headset_mic,
6944 },
24519911 6945 [ALC269_FIXUP_QUANTA_MUTE] = {
1727a771 6946 .type = HDA_FIXUP_FUNC,
24519911
TI
6947 .v.func = alc269_fixup_quanta_mute,
6948 },
6949 [ALC269_FIXUP_LIFEBOOK] = {
1727a771
TI
6950 .type = HDA_FIXUP_PINS,
6951 .v.pins = (const struct hda_pintbl[]) {
24519911
TI
6952 { 0x1a, 0x2101103f }, /* dock line-out */
6953 { 0x1b, 0x23a11040 }, /* dock mic-in */
6954 { }
6955 },
6956 .chained = true,
6957 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6958 },
2041d564
DH
6959 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6960 .type = HDA_FIXUP_PINS,
6961 .v.pins = (const struct hda_pintbl[]) {
6962 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6963 { }
6964 },
6965 },
cc7016ab
TI
6966 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6967 .type = HDA_FIXUP_PINS,
6968 .v.pins = (const struct hda_pintbl[]) {
6969 { 0x21, 0x0221102f }, /* HP out */
6970 { }
6971 },
6972 },
4df3fd17
TI
6973 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6974 .type = HDA_FIXUP_FUNC,
6975 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6976 },
fdcc968a
JMG
6977 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6978 .type = HDA_FIXUP_FUNC,
6979 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6980 },
a4297b5d 6981 [ALC269_FIXUP_AMIC] = {
1727a771
TI
6982 .type = HDA_FIXUP_PINS,
6983 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
6984 { 0x14, 0x99130110 }, /* speaker */
6985 { 0x15, 0x0121401f }, /* HP out */
6986 { 0x18, 0x01a19c20 }, /* mic */
6987 { 0x19, 0x99a3092f }, /* int-mic */
6988 { }
6989 },
6990 },
6991 [ALC269_FIXUP_DMIC] = {
1727a771
TI
6992 .type = HDA_FIXUP_PINS,
6993 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
6994 { 0x12, 0x99a3092f }, /* int-mic */
6995 { 0x14, 0x99130110 }, /* speaker */
6996 { 0x15, 0x0121401f }, /* HP out */
6997 { 0x18, 0x01a19c20 }, /* mic */
6998 { }
6999 },
7000 },
7001 [ALC269VB_FIXUP_AMIC] = {
1727a771
TI
7002 .type = HDA_FIXUP_PINS,
7003 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7004 { 0x14, 0x99130110 }, /* speaker */
7005 { 0x18, 0x01a19c20 }, /* mic */
7006 { 0x19, 0x99a3092f }, /* int-mic */
7007 { 0x21, 0x0121401f }, /* HP out */
7008 { }
7009 },
7010 },
2267ea97 7011 [ALC269VB_FIXUP_DMIC] = {
1727a771
TI
7012 .type = HDA_FIXUP_PINS,
7013 .v.pins = (const struct hda_pintbl[]) {
a4297b5d
TI
7014 { 0x12, 0x99a3092f }, /* int-mic */
7015 { 0x14, 0x99130110 }, /* speaker */
7016 { 0x18, 0x01a19c20 }, /* mic */
7017 { 0x21, 0x0121401f }, /* HP out */
7018 { }
7019 },
7020 },
08fb0d0e 7021 [ALC269_FIXUP_HP_MUTE_LED] = {
1727a771 7022 .type = HDA_FIXUP_FUNC,
08fb0d0e 7023 .v.func = alc269_fixup_hp_mute_led,
6d3cd5d4 7024 },
d06ac143
DH
7025 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7026 .type = HDA_FIXUP_FUNC,
7027 .v.func = alc269_fixup_hp_mute_led_mic1,
7028 },
08fb0d0e 7029 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
1727a771 7030 .type = HDA_FIXUP_FUNC,
08fb0d0e 7031 .v.func = alc269_fixup_hp_mute_led_mic2,
420b0feb 7032 },
7f783bd5
TB
7033 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7034 .type = HDA_FIXUP_FUNC,
7035 .v.func = alc269_fixup_hp_mute_led_mic3,
e8ed64b0
GKK
7036 .chained = true,
7037 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7f783bd5 7038 },
9f5c6faf
TI
7039 [ALC269_FIXUP_HP_GPIO_LED] = {
7040 .type = HDA_FIXUP_FUNC,
7041 .v.func = alc269_fixup_hp_gpio_led,
7042 },
9c5dc3bf
KY
7043 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7044 .type = HDA_FIXUP_FUNC,
7045 .v.func = alc269_fixup_hp_gpio_mic1_led,
7046 },
7047 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7048 .type = HDA_FIXUP_FUNC,
7049 .v.func = alc269_fixup_hp_line1_mic1_led,
7050 },
693b613d 7051 [ALC269_FIXUP_INV_DMIC] = {
1727a771 7052 .type = HDA_FIXUP_FUNC,
9d36a7dc 7053 .v.func = alc_fixup_inv_dmic,
693b613d 7054 },
9b745ab8
TI
7055 [ALC269_FIXUP_NO_SHUTUP] = {
7056 .type = HDA_FIXUP_FUNC,
7057 .v.func = alc_fixup_no_shutup,
7058 },
108cc108 7059 [ALC269_FIXUP_LENOVO_DOCK] = {
1727a771
TI
7060 .type = HDA_FIXUP_PINS,
7061 .v.pins = (const struct hda_pintbl[]) {
108cc108
DH
7062 { 0x19, 0x23a11040 }, /* dock mic */
7063 { 0x1b, 0x2121103f }, /* dock headphone */
7064 { }
7065 },
7066 .chained = true,
7067 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7068 },
b590b38c
TI
7069 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7070 .type = HDA_FIXUP_FUNC,
7071 .v.func = alc269_fixup_limit_int_mic_boost,
7072 .chained = true,
7073 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7074 },
108cc108 7075 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
1727a771 7076 .type = HDA_FIXUP_FUNC,
108cc108 7077 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
52129000
DH
7078 .chained = true,
7079 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
108cc108 7080 },
73bdd597
DH
7081 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7082 .type = HDA_FIXUP_PINS,
7083 .v.pins = (const struct hda_pintbl[]) {
7084 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7085 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7086 { }
7087 },
7088 .chained = true,
7089 .chain_id = ALC269_FIXUP_HEADSET_MODE
7090 },
7091 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7092 .type = HDA_FIXUP_PINS,
7093 .v.pins = (const struct hda_pintbl[]) {
7094 { 0x16, 0x21014020 }, /* dock line out */
7095 { 0x19, 0x21a19030 }, /* dock mic */
7096 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7097 { }
7098 },
7099 .chained = true,
7100 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7101 },
338cae56
DH
7102 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7103 .type = HDA_FIXUP_PINS,
7104 .v.pins = (const struct hda_pintbl[]) {
7105 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7106 { }
7107 },
7108 .chained = true,
7109 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7110 },
fcc6c877
KY
7111 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7112 .type = HDA_FIXUP_PINS,
7113 .v.pins = (const struct hda_pintbl[]) {
7114 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7115 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7116 { }
7117 },
7118 .chained = true,
7119 .chain_id = ALC269_FIXUP_HEADSET_MODE
7120 },
73bdd597
DH
7121 [ALC269_FIXUP_HEADSET_MODE] = {
7122 .type = HDA_FIXUP_FUNC,
7123 .v.func = alc_fixup_headset_mode,
6676f308 7124 .chained = true,
b3802783 7125 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
73bdd597
DH
7126 },
7127 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7128 .type = HDA_FIXUP_FUNC,
7129 .v.func = alc_fixup_headset_mode_no_hp_mic,
7130 },
7819717b
TI
7131 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7132 .type = HDA_FIXUP_PINS,
7133 .v.pins = (const struct hda_pintbl[]) {
7134 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7135 { }
7136 },
7137 .chained = true,
7138 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7139 },
88cfcf86
DH
7140 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7141 .type = HDA_FIXUP_PINS,
7142 .v.pins = (const struct hda_pintbl[]) {
7143 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7144 { }
7145 },
fbc78ad6
DH
7146 .chained = true,
7147 .chain_id = ALC269_FIXUP_HEADSET_MIC
88cfcf86 7148 },
0fbf21c3 7149 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
8ac51bbc
AB
7150 .type = HDA_FIXUP_PINS,
7151 .v.pins = (const struct hda_pintbl[]) {
7152 {0x12, 0x90a60130},
7153 {0x13, 0x40000000},
7154 {0x14, 0x90170110},
7155 {0x18, 0x411111f0},
7156 {0x19, 0x04a11040},
7157 {0x1a, 0x411111f0},
7158 {0x1b, 0x90170112},
7159 {0x1d, 0x40759a05},
7160 {0x1e, 0x411111f0},
7161 {0x21, 0x04211020},
7162 { }
7163 },
e2744fd7
AB
7164 .chained = true,
7165 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
8ac51bbc 7166 },
a2ef03fe
TE
7167 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7168 .type = HDA_FIXUP_FUNC,
7169 .v.func = alc298_fixup_huawei_mbx_stereo,
7170 .chained = true,
7171 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7172 },
d240d1dc
DH
7173 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7174 .type = HDA_FIXUP_FUNC,
7175 .v.func = alc269_fixup_x101_headset_mic,
7176 },
7177 [ALC269_FIXUP_ASUS_X101_VERB] = {
7178 .type = HDA_FIXUP_VERBS,
7179 .v.verbs = (const struct hda_verb[]) {
7180 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7181 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7182 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7183 { }
7184 },
7185 .chained = true,
7186 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7187 },
7188 [ALC269_FIXUP_ASUS_X101] = {
7189 .type = HDA_FIXUP_PINS,
7190 .v.pins = (const struct hda_pintbl[]) {
7191 { 0x18, 0x04a1182c }, /* Headset mic */
7192 { }
7193 },
7194 .chained = true,
7195 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7196 },
08a978db 7197 [ALC271_FIXUP_AMIC_MIC2] = {
1727a771
TI
7198 .type = HDA_FIXUP_PINS,
7199 .v.pins = (const struct hda_pintbl[]) {
08a978db
DR
7200 { 0x14, 0x99130110 }, /* speaker */
7201 { 0x19, 0x01a19c20 }, /* mic */
7202 { 0x1b, 0x99a7012f }, /* int-mic */
7203 { 0x21, 0x0121401f }, /* HP out */
7204 { }
7205 },
7206 },
7207 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
1727a771 7208 .type = HDA_FIXUP_FUNC,
08a978db
DR
7209 .v.func = alc271_hp_gate_mic_jack,
7210 .chained = true,
7211 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7212 },
b1e8972e
OR
7213 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7214 .type = HDA_FIXUP_FUNC,
7215 .v.func = alc269_fixup_limit_int_mic_boost,
7216 .chained = true,
7217 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7218 },
42397004
DR
7219 [ALC269_FIXUP_ACER_AC700] = {
7220 .type = HDA_FIXUP_PINS,
7221 .v.pins = (const struct hda_pintbl[]) {
7222 { 0x12, 0x99a3092f }, /* int-mic */
7223 { 0x14, 0x99130110 }, /* speaker */
7224 { 0x18, 0x03a11c20 }, /* mic */
7225 { 0x1e, 0x0346101e }, /* SPDIF1 */
7226 { 0x21, 0x0321101f }, /* HP out */
7227 { }
7228 },
7229 .chained = true,
7230 .chain_id = ALC271_FIXUP_DMIC,
7231 },
3e0d611b
DH
7232 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7233 .type = HDA_FIXUP_FUNC,
7234 .v.func = alc269_fixup_limit_int_mic_boost,
2793769f
DH
7235 .chained = true,
7236 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
3e0d611b 7237 },
2cede303
OR
7238 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7239 .type = HDA_FIXUP_FUNC,
7240 .v.func = alc269_fixup_limit_int_mic_boost,
7241 .chained = true,
7242 .chain_id = ALC269VB_FIXUP_DMIC,
7243 },
23870831
TI
7244 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7245 .type = HDA_FIXUP_VERBS,
7246 .v.verbs = (const struct hda_verb[]) {
7247 /* class-D output amp +5dB */
7248 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7249 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7250 {}
7251 },
7252 .chained = true,
7253 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7254 },
8e35cd4a
DH
7255 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7256 .type = HDA_FIXUP_FUNC,
7257 .v.func = alc269_fixup_limit_int_mic_boost,
7258 .chained = true,
7259 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7260 },
02b504d9
AA
7261 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7262 .type = HDA_FIXUP_PINS,
7263 .v.pins = (const struct hda_pintbl[]) {
7264 { 0x12, 0x99a3092f }, /* int-mic */
7265 { 0x18, 0x03a11d20 }, /* mic */
7266 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7267 { }
7268 },
7269 },
cd217a63
KY
7270 [ALC283_FIXUP_CHROME_BOOK] = {
7271 .type = HDA_FIXUP_FUNC,
7272 .v.func = alc283_fixup_chromebook,
7273 },
0202e99c
KY
7274 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7275 .type = HDA_FIXUP_FUNC,
7276 .v.func = alc283_fixup_sense_combo_jack,
7277 .chained = true,
7278 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7279 },
7bba2157
TI
7280 [ALC282_FIXUP_ASUS_TX300] = {
7281 .type = HDA_FIXUP_FUNC,
7282 .v.func = alc282_fixup_asus_tx300,
7283 },
1bb3e062
KY
7284 [ALC283_FIXUP_INT_MIC] = {
7285 .type = HDA_FIXUP_VERBS,
7286 .v.verbs = (const struct hda_verb[]) {
7287 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7288 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7289 { }
7290 },
7291 .chained = true,
7292 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7293 },
0f4881dc
DH
7294 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7295 .type = HDA_FIXUP_PINS,
7296 .v.pins = (const struct hda_pintbl[]) {
7297 { 0x17, 0x90170112 }, /* subwoofer */
7298 { }
7299 },
7300 .chained = true,
7301 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7302 },
7303 [ALC290_FIXUP_SUBWOOFER] = {
7304 .type = HDA_FIXUP_PINS,
7305 .v.pins = (const struct hda_pintbl[]) {
7306 { 0x17, 0x90170112 }, /* subwoofer */
7307 { }
7308 },
7309 .chained = true,
7310 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7311 },
338cae56
DH
7312 [ALC290_FIXUP_MONO_SPEAKERS] = {
7313 .type = HDA_FIXUP_FUNC,
7314 .v.func = alc290_fixup_mono_speakers,
0f4881dc
DH
7315 },
7316 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7317 .type = HDA_FIXUP_FUNC,
7318 .v.func = alc290_fixup_mono_speakers,
338cae56
DH
7319 .chained = true,
7320 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7321 },
b67ae3f1
DH
7322 [ALC269_FIXUP_THINKPAD_ACPI] = {
7323 .type = HDA_FIXUP_FUNC,
d5a6cabf 7324 .v.func = alc_fixup_thinkpad_acpi,
09da111a
TI
7325 .chained = true,
7326 .chain_id = ALC269_FIXUP_SKU_IGNORE,
b67ae3f1 7327 },
56f27013
DH
7328 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7329 .type = HDA_FIXUP_FUNC,
7330 .v.func = alc_fixup_inv_dmic,
7331 .chained = true,
7332 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7333 },
5824ce8d 7334 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
17d30460
HW
7335 .type = HDA_FIXUP_PINS,
7336 .v.pins = (const struct hda_pintbl[]) {
7337 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7338 { }
5824ce8d
CC
7339 },
7340 .chained = true,
17d30460 7341 .chain_id = ALC255_FIXUP_HEADSET_MODE
5824ce8d 7342 },
615966ad
CC
7343 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7344 .type = HDA_FIXUP_PINS,
7345 .v.pins = (const struct hda_pintbl[]) {
7346 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7347 { }
7348 },
7349 .chained = true,
7350 .chain_id = ALC255_FIXUP_HEADSET_MODE
7351 },
9a22a8f5
KY
7352 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7353 .type = HDA_FIXUP_PINS,
7354 .v.pins = (const struct hda_pintbl[]) {
7355 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7356 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7357 { }
7358 },
7359 .chained = true,
7360 .chain_id = ALC255_FIXUP_HEADSET_MODE
7361 },
31278997
KY
7362 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7363 .type = HDA_FIXUP_PINS,
7364 .v.pins = (const struct hda_pintbl[]) {
7365 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7366 { }
7367 },
7368 .chained = true,
7369 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7370 },
9a22a8f5
KY
7371 [ALC255_FIXUP_HEADSET_MODE] = {
7372 .type = HDA_FIXUP_FUNC,
7373 .v.func = alc_fixup_headset_mode_alc255,
4a83d42a 7374 .chained = true,
b3802783 7375 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
9a22a8f5 7376 },
31278997
KY
7377 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7378 .type = HDA_FIXUP_FUNC,
7379 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7380 },
a22aa26f
KY
7381 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7382 .type = HDA_FIXUP_PINS,
7383 .v.pins = (const struct hda_pintbl[]) {
7384 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7385 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7386 { }
7387 },
7388 .chained = true,
7389 .chain_id = ALC269_FIXUP_HEADSET_MODE
7390 },
1c37c223 7391 [ALC292_FIXUP_TPT440_DOCK] = {
ec56af67 7392 .type = HDA_FIXUP_FUNC,
7f57d803 7393 .v.func = alc_fixup_tpt440_dock,
1c37c223
TI
7394 .chained = true,
7395 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7396 },
9a811230
TI
7397 [ALC292_FIXUP_TPT440] = {
7398 .type = HDA_FIXUP_FUNC,
157f0b7f 7399 .v.func = alc_fixup_disable_aamix,
9a811230
TI
7400 .chained = true,
7401 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7402 },
abaa2274 7403 [ALC283_FIXUP_HEADSET_MIC] = {
9dc12862
DD
7404 .type = HDA_FIXUP_PINS,
7405 .v.pins = (const struct hda_pintbl[]) {
7406 { 0x19, 0x04a110f0 },
7407 { },
7408 },
7409 },
b3802783 7410 [ALC255_FIXUP_MIC_MUTE_LED] = {
00ef9940 7411 .type = HDA_FIXUP_FUNC,
8a503555 7412 .v.func = alc_fixup_micmute_led,
00ef9940 7413 },
1a22e775
TI
7414 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7415 .type = HDA_FIXUP_PINS,
7416 .v.pins = (const struct hda_pintbl[]) {
7417 { 0x12, 0x90a60130 },
7418 { 0x14, 0x90170110 },
7419 { 0x17, 0x40000008 },
7420 { 0x18, 0x411111f0 },
0420694d 7421 { 0x19, 0x01a1913c },
1a22e775
TI
7422 { 0x1a, 0x411111f0 },
7423 { 0x1b, 0x411111f0 },
7424 { 0x1d, 0x40f89b2d },
7425 { 0x1e, 0x411111f0 },
7426 { 0x21, 0x0321101f },
7427 { },
7428 },
7429 },
c8426b27
TI
7430 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7431 .type = HDA_FIXUP_FUNC,
7432 .v.func = alc269vb_fixup_aspire_e1_coef,
7433 },
7a5255f1
DH
7434 [ALC280_FIXUP_HP_GPIO4] = {
7435 .type = HDA_FIXUP_FUNC,
7436 .v.func = alc280_fixup_hp_gpio4,
7437 },
eaa8e5ef
KY
7438 [ALC286_FIXUP_HP_GPIO_LED] = {
7439 .type = HDA_FIXUP_FUNC,
7440 .v.func = alc286_fixup_hp_gpio_led,
7441 },
33f4acd3
DH
7442 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7443 .type = HDA_FIXUP_FUNC,
7444 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7445 },
b4b33f9d
TC
7446 [ALC280_FIXUP_HP_DOCK_PINS] = {
7447 .type = HDA_FIXUP_PINS,
7448 .v.pins = (const struct hda_pintbl[]) {
7449 { 0x1b, 0x21011020 }, /* line-out */
7450 { 0x1a, 0x01a1903c }, /* headset mic */
7451 { 0x18, 0x2181103f }, /* line-in */
7452 { },
7453 },
7454 .chained = true,
7455 .chain_id = ALC280_FIXUP_HP_GPIO4
7456 },
04d5466a
JK
7457 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7458 .type = HDA_FIXUP_PINS,
7459 .v.pins = (const struct hda_pintbl[]) {
7460 { 0x1b, 0x21011020 }, /* line-out */
7461 { 0x18, 0x2181103f }, /* line-in */
7462 { },
7463 },
7464 .chained = true,
7465 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7466 },
98973f2f
KP
7467 [ALC280_FIXUP_HP_9480M] = {
7468 .type = HDA_FIXUP_FUNC,
7469 .v.func = alc280_fixup_hp_9480m,
7470 },
c3bb2b52
TI
7471 [ALC245_FIXUP_HP_X360_AMP] = {
7472 .type = HDA_FIXUP_FUNC,
7473 .v.func = alc245_fixup_hp_x360_amp,
c47b3112
JC
7474 .chained = true,
7475 .chain_id = ALC245_FIXUP_HP_GPIO_LED
c3bb2b52 7476 },
e1e62b98
KY
7477 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7478 .type = HDA_FIXUP_FUNC,
7479 .v.func = alc_fixup_headset_mode_dell_alc288,
7480 .chained = true,
b3802783 7481 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
e1e62b98
KY
7482 },
7483 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7484 .type = HDA_FIXUP_PINS,
7485 .v.pins = (const struct hda_pintbl[]) {
7486 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7487 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7488 { }
7489 },
7490 .chained = true,
7491 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7492 },
831bfdf9
HW
7493 [ALC288_FIXUP_DISABLE_AAMIX] = {
7494 .type = HDA_FIXUP_FUNC,
7495 .v.func = alc_fixup_disable_aamix,
7496 .chained = true,
d44a6864 7497 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
831bfdf9
HW
7498 },
7499 [ALC288_FIXUP_DELL_XPS_13] = {
7500 .type = HDA_FIXUP_FUNC,
7501 .v.func = alc_fixup_dell_xps13,
7502 .chained = true,
7503 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7504 },
8b99aba7
TI
7505 [ALC292_FIXUP_DISABLE_AAMIX] = {
7506 .type = HDA_FIXUP_FUNC,
7507 .v.func = alc_fixup_disable_aamix,
831bfdf9
HW
7508 .chained = true,
7509 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
8b99aba7 7510 },
c04017ea
DH
7511 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7512 .type = HDA_FIXUP_FUNC,
7513 .v.func = alc_fixup_disable_aamix,
7514 .chained = true,
7515 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7516 },
5fab5829 7517 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
8b99aba7
TI
7518 .type = HDA_FIXUP_FUNC,
7519 .v.func = alc_fixup_dell_xps13,
7520 .chained = true,
7521 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7522 },
5fab5829
TI
7523 [ALC292_FIXUP_DELL_E7X] = {
7524 .type = HDA_FIXUP_FUNC,
8a503555 7525 .v.func = alc_fixup_micmute_led,
5fab5829
TI
7526 /* micmute fixup must be applied at last */
7527 .chained_before = true,
7528 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7529 },
54324221
JM
7530 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7531 .type = HDA_FIXUP_PINS,
7532 .v.pins = (const struct hda_pintbl[]) {
7533 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7534 { }
7535 },
7536 .chained_before = true,
7537 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7538 },
977e6276
KY
7539 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7540 .type = HDA_FIXUP_PINS,
7541 .v.pins = (const struct hda_pintbl[]) {
7542 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7543 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7544 { }
7545 },
7546 .chained = true,
7547 .chain_id = ALC269_FIXUP_HEADSET_MODE
7548 },
2f726aec
HW
7549 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7550 .type = HDA_FIXUP_PINS,
7551 .v.pins = (const struct hda_pintbl[]) {
7552 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7553 { }
7554 },
7555 .chained = true,
7556 .chain_id = ALC269_FIXUP_HEADSET_MODE
7557 },
6ed1131f
KY
7558 [ALC275_FIXUP_DELL_XPS] = {
7559 .type = HDA_FIXUP_VERBS,
7560 .v.verbs = (const struct hda_verb[]) {
7561 /* Enables internal speaker */
7562 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7563 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7564 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7565 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7566 {}
7567 }
7568 },
23adc192
HW
7569 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7570 .type = HDA_FIXUP_FUNC,
7571 .v.func = alc_fixup_disable_aamix,
7572 .chained = true,
7573 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7574 },
3694cb29
K
7575 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7576 .type = HDA_FIXUP_FUNC,
7577 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7578 },
d1ee66c5
PC
7579 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7580 .type = HDA_FIXUP_FUNC,
7581 .v.func = alc_fixup_inv_dmic,
7582 .chained = true,
7583 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7584 },
7585 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7586 .type = HDA_FIXUP_FUNC,
7587 .v.func = alc269_fixup_limit_int_mic_boost
7588 },
3b43b71f
KHF
7589 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7590 .type = HDA_FIXUP_FUNC,
7591 .v.func = alc_fixup_disable_aamix,
7592 .chained = true,
7593 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7594 },
d1dd4211
KY
7595 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7596 .type = HDA_FIXUP_FUNC,
7597 .v.func = alc_fixup_disable_mic_vref,
7598 .chained = true,
7599 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7600 },
2ae95577
DH
7601 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7602 .type = HDA_FIXUP_VERBS,
7603 .v.verbs = (const struct hda_verb[]) {
7604 /* Disable pass-through path for FRONT 14h */
7605 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7606 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7607 {}
7608 },
7609 .chained = true,
d1dd4211 7610 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
2ae95577 7611 },
f883982d
TI
7612 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7613 .type = HDA_FIXUP_FUNC,
7614 .v.func = alc_fixup_disable_aamix,
7615 .chained = true,
7616 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7617 },
e549d190
HW
7618 [ALC221_FIXUP_HP_FRONT_MIC] = {
7619 .type = HDA_FIXUP_PINS,
7620 .v.pins = (const struct hda_pintbl[]) {
7621 { 0x19, 0x02a19020 }, /* Front Mic */
7622 { }
7623 },
7624 },
c636b95e
SE
7625 [ALC292_FIXUP_TPT460] = {
7626 .type = HDA_FIXUP_FUNC,
7627 .v.func = alc_fixup_tpt440_dock,
7628 .chained = true,
7629 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7630 },
dd9aa335
HW
7631 [ALC298_FIXUP_SPK_VOLUME] = {
7632 .type = HDA_FIXUP_FUNC,
7633 .v.func = alc298_fixup_speaker_volume,
59ec4b57 7634 .chained = true,
2f726aec 7635 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
dd9aa335 7636 },
f86de9b1
KY
7637 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7638 .type = HDA_FIXUP_FUNC,
7639 .v.func = alc298_fixup_speaker_volume,
7640 },
e312a869
TI
7641 [ALC295_FIXUP_DISABLE_DAC3] = {
7642 .type = HDA_FIXUP_FUNC,
7643 .v.func = alc295_fixup_disable_dac3,
7644 },
d2cd795c
JK
7645 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7646 .type = HDA_FIXUP_FUNC,
7647 .v.func = alc285_fixup_speaker2_to_dac1,
c37c0ab0
HW
7648 .chained = true,
7649 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
d2cd795c 7650 },
fd06c77e
KHF
7651 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7652 .type = HDA_FIXUP_PINS,
7653 .v.pins = (const struct hda_pintbl[]) {
7654 { 0x1b, 0x90170151 },
7655 { }
7656 },
7657 .chained = true,
7658 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7659 },
823ff161
GM
7660 [ALC269_FIXUP_ATIV_BOOK_8] = {
7661 .type = HDA_FIXUP_FUNC,
7662 .v.func = alc_fixup_auto_mute_via_amp,
7663 .chained = true,
7664 .chain_id = ALC269_FIXUP_NO_SHUTUP
7665 },
9eb5d0e6
KY
7666 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7667 .type = HDA_FIXUP_PINS,
7668 .v.pins = (const struct hda_pintbl[]) {
7669 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7670 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7671 { }
7672 },
7673 .chained = true,
7674 .chain_id = ALC269_FIXUP_HEADSET_MODE
7675 },
c1732ede
CC
7676 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7677 .type = HDA_FIXUP_FUNC,
7678 .v.func = alc_fixup_headset_mode,
7679 },
7680 [ALC256_FIXUP_ASUS_MIC] = {
7681 .type = HDA_FIXUP_PINS,
7682 .v.pins = (const struct hda_pintbl[]) {
7683 { 0x13, 0x90a60160 }, /* use as internal mic */
7684 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7685 { }
7686 },
7687 .chained = true,
7688 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7689 },
eeed4cd1 7690 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
ae065f1c
TI
7691 .type = HDA_FIXUP_FUNC,
7692 /* Set up GPIO2 for the speaker amp */
7693 .v.func = alc_fixup_gpio4,
eeed4cd1 7694 },
216d7aeb
CC
7695 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7696 .type = HDA_FIXUP_PINS,
7697 .v.pins = (const struct hda_pintbl[]) {
7698 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7699 { }
7700 },
7701 .chained = true,
7702 .chain_id = ALC269_FIXUP_HEADSET_MIC
7703 },
7704 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7705 .type = HDA_FIXUP_VERBS,
7706 .v.verbs = (const struct hda_verb[]) {
7707 /* Enables internal speaker */
7708 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7709 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7710 {}
7711 },
7712 .chained = true,
7713 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7714 },
ca169cc2
KY
7715 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7716 .type = HDA_FIXUP_FUNC,
7717 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
f73bbf63
KHF
7718 .chained = true,
7719 .chain_id = ALC269_FIXUP_GPIO2
ca169cc2 7720 },
ea5c7eba
JHP
7721 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7722 .type = HDA_FIXUP_VERBS,
7723 .v.verbs = (const struct hda_verb[]) {
7724 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7725 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7726 { }
7727 },
7728 .chained = true,
7729 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7730 },
f33f79f3
HW
7731 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7732 .type = HDA_FIXUP_PINS,
7733 .v.pins = (const struct hda_pintbl[]) {
7734 /* Change the mic location from front to right, otherwise there are
7735 two front mics with the same name, pulseaudio can't handle them.
7736 This is just a temporary workaround, after applying this fixup,
7737 there will be one "Front Mic" and one "Mic" in this machine.
7738 */
7739 { 0x1a, 0x04a19040 },
7740 { }
7741 },
7742 },
5f364135
KY
7743 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7744 .type = HDA_FIXUP_PINS,
7745 .v.pins = (const struct hda_pintbl[]) {
7746 { 0x16, 0x0101102f }, /* Rear Headset HP */
7747 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7748 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7749 { 0x1b, 0x02011020 },
7750 { }
7751 },
7752 .chained = true,
52e4e368
KHF
7753 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7754 },
7755 [ALC225_FIXUP_S3_POP_NOISE] = {
7756 .type = HDA_FIXUP_FUNC,
7757 .v.func = alc225_fixup_s3_pop_noise,
7758 .chained = true,
5f364135
KY
7759 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7760 },
b84e8436
PH
7761 [ALC700_FIXUP_INTEL_REFERENCE] = {
7762 .type = HDA_FIXUP_VERBS,
7763 .v.verbs = (const struct hda_verb[]) {
7764 /* Enables internal speaker */
7765 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7766 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7767 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7768 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7769 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7770 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7771 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7772 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7773 {}
7774 }
7775 },
92266651
KY
7776 [ALC274_FIXUP_DELL_BIND_DACS] = {
7777 .type = HDA_FIXUP_FUNC,
7778 .v.func = alc274_fixup_bind_dacs,
7779 .chained = true,
7780 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7781 },
7782 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7783 .type = HDA_FIXUP_PINS,
7784 .v.pins = (const struct hda_pintbl[]) {
7785 { 0x1b, 0x0401102f },
7786 { }
7787 },
7788 .chained = true,
7789 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7790 },
399c01aa 7791 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
61fcf8ec
KY
7792 .type = HDA_FIXUP_FUNC,
7793 .v.func = alc_fixup_tpt470_dock,
7794 .chained = true,
7795 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7796 },
399c01aa
TI
7797 [ALC298_FIXUP_TPT470_DOCK] = {
7798 .type = HDA_FIXUP_FUNC,
7799 .v.func = alc_fixup_tpt470_dacs,
7800 .chained = true,
7801 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7802 },
ae104a21
KY
7803 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7804 .type = HDA_FIXUP_PINS,
7805 .v.pins = (const struct hda_pintbl[]) {
7806 { 0x14, 0x0201101f },
7807 { }
7808 },
7809 .chained = true,
7810 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7811 },
f0ba9d69
KY
7812 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7813 .type = HDA_FIXUP_PINS,
7814 .v.pins = (const struct hda_pintbl[]) {
7815 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7816 { }
7817 },
3ce0d5aa
HW
7818 .chained = true,
7819 .chain_id = ALC269_FIXUP_HEADSET_MIC
f0ba9d69 7820 },
bbf8ff6b
TB
7821 [ALC295_FIXUP_HP_X360] = {
7822 .type = HDA_FIXUP_FUNC,
7823 .v.func = alc295_fixup_hp_top_speakers,
7824 .chained = true,
7825 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8a328ac1
KY
7826 },
7827 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7828 .type = HDA_FIXUP_PINS,
7829 .v.pins = (const struct hda_pintbl[]) {
7830 { 0x19, 0x0181313f},
7831 { }
7832 },
7833 .chained = true,
7834 .chain_id = ALC269_FIXUP_HEADSET_MIC
7835 },
c4cfcf6f
HW
7836 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7837 .type = HDA_FIXUP_FUNC,
7838 .v.func = alc285_fixup_invalidate_dacs,
6ba189c5
HW
7839 .chained = true,
7840 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
c4cfcf6f 7841 },
e8ed64b0
GKK
7842 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7843 .type = HDA_FIXUP_FUNC,
7844 .v.func = alc_fixup_auto_mute_via_amp,
7845 },
33aaebd4
CC
7846 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7847 .type = HDA_FIXUP_PINS,
7848 .v.pins = (const struct hda_pintbl[]) {
7849 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7850 { }
7851 },
7852 .chained = true,
7853 .chain_id = ALC269_FIXUP_HEADSET_MIC
7854 },
d8ae458e
CC
7855 [ALC294_FIXUP_ASUS_MIC] = {
7856 .type = HDA_FIXUP_PINS,
7857 .v.pins = (const struct hda_pintbl[]) {
7858 { 0x13, 0x90a60160 }, /* use as internal mic */
7859 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7860 { }
7861 },
7862 .chained = true,
ef9ddb9d 7863 .chain_id = ALC269_FIXUP_HEADSET_MIC
d8ae458e 7864 },
4e051106
JHP
7865 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7866 .type = HDA_FIXUP_PINS,
7867 .v.pins = (const struct hda_pintbl[]) {
82b01149 7868 { 0x19, 0x01a1103c }, /* use as headset mic */
4e051106
JHP
7869 { }
7870 },
7871 .chained = true,
ef9ddb9d 7872 .chain_id = ALC269_FIXUP_HEADSET_MIC
4e051106
JHP
7873 },
7874 [ALC294_FIXUP_ASUS_SPK] = {
7875 .type = HDA_FIXUP_VERBS,
7876 .v.verbs = (const struct hda_verb[]) {
7877 /* Set EAPD high */
7878 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7879 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
473fbe13
KY
7880 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7881 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
4e051106
JHP
7882 { }
7883 },
7884 .chained = true,
7885 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7886 },
c8a9afa6 7887 [ALC295_FIXUP_CHROME_BOOK] = {
e854747d 7888 .type = HDA_FIXUP_FUNC,
c8a9afa6 7889 .v.func = alc295_fixup_chromebook,
8983eb60
KY
7890 .chained = true,
7891 .chain_id = ALC225_FIXUP_HEADSET_JACK
7892 },
7893 [ALC225_FIXUP_HEADSET_JACK] = {
7894 .type = HDA_FIXUP_FUNC,
7895 .v.func = alc_fixup_headset_jack,
e854747d 7896 },
89e3a568
JS
7897 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7898 .type = HDA_FIXUP_PINS,
7899 .v.pins = (const struct hda_pintbl[]) {
7900 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7901 { }
7902 },
7903 .chained = true,
7904 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7905 },
c8c6ee61
HW
7906 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7907 .type = HDA_FIXUP_VERBS,
7908 .v.verbs = (const struct hda_verb[]) {
7909 /* Disable PCBEEP-IN passthrough */
7910 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7911 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7912 { }
7913 },
7914 .chained = true,
7915 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7916 },
cbc05fd6
JHP
7917 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7918 .type = HDA_FIXUP_PINS,
7919 .v.pins = (const struct hda_pintbl[]) {
7920 { 0x19, 0x03a11130 },
7921 { 0x1a, 0x90a60140 }, /* use as internal mic */
7922 { }
7923 },
7924 .chained = true,
7925 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7926 },
136824ef
KY
7927 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7928 .type = HDA_FIXUP_PINS,
7929 .v.pins = (const struct hda_pintbl[]) {
7930 { 0x16, 0x01011020 }, /* Rear Line out */
7931 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7932 { }
7933 },
7934 .chained = true,
7935 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7936 },
7937 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7938 .type = HDA_FIXUP_FUNC,
7939 .v.func = alc_fixup_auto_mute_via_amp,
7940 .chained = true,
7941 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7942 },
7943 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7944 .type = HDA_FIXUP_FUNC,
7945 .v.func = alc_fixup_disable_mic_vref,
7946 .chained = true,
7947 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7948 },
667a8f73
JHP
7949 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7950 .type = HDA_FIXUP_VERBS,
7951 .v.verbs = (const struct hda_verb[]) {
7952 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7953 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7954 { }
7955 },
7956 .chained = true,
7957 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7958 },
8c8967a7
DD
7959 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7960 .type = HDA_FIXUP_PINS,
7961 .v.pins = (const struct hda_pintbl[]) {
7962 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7963 { }
7964 },
7965 .chained = true,
7966 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7967 },
e1037354
JHP
7968 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7969 .type = HDA_FIXUP_PINS,
7970 .v.pins = (const struct hda_pintbl[]) {
7971 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7972 { }
7973 },
7974 .chained = true,
7975 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7976 },
e2a829b3
BR
7977 [ALC299_FIXUP_PREDATOR_SPK] = {
7978 .type = HDA_FIXUP_PINS,
7979 .v.pins = (const struct hda_pintbl[]) {
7980 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7981 { }
7982 }
7983 },
bd9c10bc 7984 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
60083f9e
JHP
7985 .type = HDA_FIXUP_PINS,
7986 .v.pins = (const struct hda_pintbl[]) {
bd9c10bc
JMG
7987 { 0x19, 0x04a11040 },
7988 { 0x21, 0x04211020 },
60083f9e
JHP
7989 { }
7990 },
7991 .chained = true,
bd9c10bc 7992 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
60083f9e 7993 },
e79c2269 7994 [ALC289_FIXUP_DELL_SPK2] = {
bd9c10bc
JMG
7995 .type = HDA_FIXUP_PINS,
7996 .v.pins = (const struct hda_pintbl[]) {
e79c2269 7997 { 0x17, 0x90170130 }, /* bass spk */
bd9c10bc
JMG
7998 { }
7999 },
8000 .chained = true,
e79c2269 8001 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
bd9c10bc 8002 },
e79c2269
KY
8003 [ALC289_FIXUP_DUAL_SPK] = {
8004 .type = HDA_FIXUP_FUNC,
8005 .v.func = alc285_fixup_speaker2_to_dac1,
8006 .chained = true,
8007 .chain_id = ALC289_FIXUP_DELL_SPK2
8008 },
48e01504
CC
8009 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8010 .type = HDA_FIXUP_FUNC,
8011 .v.func = alc285_fixup_speaker2_to_dac1,
8012 .chained = true,
8013 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8014 },
8015 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
436e2550
JHP
8016 .type = HDA_FIXUP_FUNC,
8017 /* The GPIO must be pulled to initialize the AMP */
8018 .v.func = alc_fixup_gpio4,
8019 .chained = true,
48e01504 8020 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
436e2550 8021 },
6a6660d0
TI
8022 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8023 .type = HDA_FIXUP_FUNC,
8024 .v.func = alc285_fixup_thinkpad_x1_gen7,
8025 .chained = true,
8026 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8027 },
76f7dec0
KY
8028 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8029 .type = HDA_FIXUP_FUNC,
8030 .v.func = alc_fixup_headset_jack,
8031 .chained = true,
6a6660d0 8032 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
76f7dec0 8033 },
8b33a134
JHP
8034 [ALC294_FIXUP_ASUS_HPE] = {
8035 .type = HDA_FIXUP_VERBS,
8036 .v.verbs = (const struct hda_verb[]) {
8037 /* Set EAPD high */
8038 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8039 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8040 { }
8041 },
8042 .chained = true,
8043 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8044 },
c3cdf189
LJ
8045 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8046 .type = HDA_FIXUP_PINS,
8047 .v.pins = (const struct hda_pintbl[]) {
8048 { 0x19, 0x03a11050 }, /* front HP mic */
8049 { 0x1a, 0x01a11830 }, /* rear external mic */
8050 { 0x21, 0x03211020 }, /* front HP out */
8051 { }
8052 },
8053 .chained = true,
8054 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8055 },
8056 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8057 .type = HDA_FIXUP_VERBS,
8058 .v.verbs = (const struct hda_verb[]) {
8059 /* set 0x15 to HP-OUT ctrl */
8060 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8061 /* unmute the 0x15 amp */
8062 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8063 { }
8064 },
8065 .chained = true,
8066 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8067 },
8068 [ALC294_FIXUP_ASUS_GX502_HP] = {
8069 .type = HDA_FIXUP_FUNC,
8070 .v.func = alc294_fixup_gx502_hp,
8071 },
c1b55029
DC
8072 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8073 .type = HDA_FIXUP_PINS,
8074 .v.pins = (const struct hda_pintbl[]) {
8075 { 0x19, 0x01a11050 }, /* rear HP mic */
8076 { 0x1a, 0x01a11830 }, /* rear external mic */
8077 { 0x21, 0x012110f0 }, /* rear HP out */
8078 { }
8079 },
8080 .chained = true,
8081 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8082 },
8083 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8084 .type = HDA_FIXUP_VERBS,
8085 .v.verbs = (const struct hda_verb[]) {
8086 /* set 0x15 to HP-OUT ctrl */
8087 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8088 /* unmute the 0x15 amp */
8089 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8090 /* set 0x1b to HP-OUT */
8091 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8092 { }
8093 },
8094 .chained = true,
8095 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8096 },
8097 [ALC294_FIXUP_ASUS_GU502_HP] = {
8098 .type = HDA_FIXUP_FUNC,
8099 .v.func = alc294_fixup_gu502_hp,
8100 },
1b94e59d
TI
8101 [ALC294_FIXUP_ASUS_COEF_1B] = {
8102 .type = HDA_FIXUP_VERBS,
8103 .v.verbs = (const struct hda_verb[]) {
8104 /* Set bit 10 to correct noisy output after reboot from
8105 * Windows 10 (due to pop noise reduction?)
8106 */
8107 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8108 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8109 { }
8110 },
f8fbcdfb
TI
8111 .chained = true,
8112 .chain_id = ALC289_FIXUP_ASUS_GA401,
1b94e59d 8113 },
f5a88b0a
KHF
8114 [ALC285_FIXUP_HP_GPIO_LED] = {
8115 .type = HDA_FIXUP_FUNC,
8116 .v.func = alc285_fixup_hp_gpio_led,
8117 },
431e76c3
KY
8118 [ALC285_FIXUP_HP_MUTE_LED] = {
8119 .type = HDA_FIXUP_FUNC,
8120 .v.func = alc285_fixup_hp_mute_led,
8121 },
e7d66cf7
JS
8122 [ALC236_FIXUP_HP_GPIO_LED] = {
8123 .type = HDA_FIXUP_FUNC,
8124 .v.func = alc236_fixup_hp_gpio_led,
8125 },
24164f43
KY
8126 [ALC236_FIXUP_HP_MUTE_LED] = {
8127 .type = HDA_FIXUP_FUNC,
8128 .v.func = alc236_fixup_hp_mute_led,
8129 },
75b62ab6
JW
8130 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8131 .type = HDA_FIXUP_FUNC,
8132 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8133 },
14425f1f
MP
8134 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8135 .type = HDA_FIXUP_VERBS,
8136 .v.verbs = (const struct hda_verb[]) {
8137 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8138 { }
8139 },
8140 },
9e43342b
CC
8141 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8142 .type = HDA_FIXUP_PINS,
8143 .v.pins = (const struct hda_pintbl[]) {
8144 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8145 { }
8146 },
8147 .chained = true,
8148 .chain_id = ALC269_FIXUP_HEADSET_MODE
8149 },
8eae7e9b
JHP
8150 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8151 .type = HDA_FIXUP_PINS,
8152 .v.pins = (const struct hda_pintbl[]) {
8153 { 0x14, 0x90100120 }, /* use as internal speaker */
8154 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8155 { 0x1a, 0x01011020 }, /* use as line out */
8156 { },
8157 },
8158 .chained = true,
8159 .chain_id = ALC269_FIXUP_HEADSET_MIC
8160 },
6e15d126
JHP
8161 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8162 .type = HDA_FIXUP_PINS,
8163 .v.pins = (const struct hda_pintbl[]) {
8164 { 0x18, 0x02a11030 }, /* use as headset mic */
8165 { }
8166 },
8167 .chained = true,
8168 .chain_id = ALC269_FIXUP_HEADSET_MIC
8169 },
781c90c0
JHP
8170 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8171 .type = HDA_FIXUP_PINS,
8172 .v.pins = (const struct hda_pintbl[]) {
8173 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8174 { }
8175 },
8176 .chained = true,
8177 .chain_id = ALC269_FIXUP_HEADSET_MIC
8178 },
293a92c1 8179 [ALC289_FIXUP_ASUS_GA401] = {
c84bfedc
TI
8180 .type = HDA_FIXUP_FUNC,
8181 .v.func = alc289_fixup_asus_ga401,
8182 .chained = true,
8183 .chain_id = ALC289_FIXUP_ASUS_GA502,
ff53664d 8184 },
4b43d05a
AS
8185 [ALC289_FIXUP_ASUS_GA502] = {
8186 .type = HDA_FIXUP_PINS,
8187 .v.pins = (const struct hda_pintbl[]) {
8188 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8189 { }
8190 },
8191 },
f50a121d
JHP
8192 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8193 .type = HDA_FIXUP_PINS,
8194 .v.pins = (const struct hda_pintbl[]) {
8195 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8196 { }
8197 },
8198 .chained = true,
8199 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8200 },
56496253
KY
8201 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8202 .type = HDA_FIXUP_FUNC,
8203 .v.func = alc285_fixup_hp_gpio_amp_init,
8204 .chained = true,
8205 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8206 },
f1ec5be1
HC
8207 [ALC269_FIXUP_CZC_B20] = {
8208 .type = HDA_FIXUP_PINS,
8209 .v.pins = (const struct hda_pintbl[]) {
8210 { 0x12, 0x411111f0 },
8211 { 0x14, 0x90170110 }, /* speaker */
8212 { 0x15, 0x032f1020 }, /* HP out */
8213 { 0x17, 0x411111f0 },
8214 { 0x18, 0x03ab1040 }, /* mic */
8215 { 0x19, 0xb7a7013f },
8216 { 0x1a, 0x0181305f },
8217 { 0x1b, 0x411111f0 },
8218 { 0x1d, 0x411111f0 },
8219 { 0x1e, 0x411111f0 },
8220 { }
8221 },
8222 .chain_id = ALC269_FIXUP_DMIC,
8223 },
8224 [ALC269_FIXUP_CZC_TMI] = {
8225 .type = HDA_FIXUP_PINS,
8226 .v.pins = (const struct hda_pintbl[]) {
8227 { 0x12, 0x4000c000 },
8228 { 0x14, 0x90170110 }, /* speaker */
8229 { 0x15, 0x0421401f }, /* HP out */
8230 { 0x17, 0x411111f0 },
8231 { 0x18, 0x04a19020 }, /* mic */
8232 { 0x19, 0x411111f0 },
8233 { 0x1a, 0x411111f0 },
8234 { 0x1b, 0x411111f0 },
8235 { 0x1d, 0x40448505 },
8236 { 0x1e, 0x411111f0 },
8237 { 0x20, 0x8000ffff },
8238 { }
8239 },
8240 .chain_id = ALC269_FIXUP_DMIC,
8241 },
8242 [ALC269_FIXUP_CZC_L101] = {
8243 .type = HDA_FIXUP_PINS,
8244 .v.pins = (const struct hda_pintbl[]) {
8245 { 0x12, 0x40000000 },
8246 { 0x14, 0x01014010 }, /* speaker */
8247 { 0x15, 0x411111f0 }, /* HP out */
8248 { 0x16, 0x411111f0 },
8249 { 0x18, 0x01a19020 }, /* mic */
8250 { 0x19, 0x02a19021 },
8251 { 0x1a, 0x0181302f },
8252 { 0x1b, 0x0221401f },
8253 { 0x1c, 0x411111f0 },
8254 { 0x1d, 0x4044c601 },
8255 { 0x1e, 0x411111f0 },
8256 { }
8257 },
8258 .chain_id = ALC269_FIXUP_DMIC,
8259 },
8260 [ALC269_FIXUP_LEMOTE_A1802] = {
8261 .type = HDA_FIXUP_PINS,
8262 .v.pins = (const struct hda_pintbl[]) {
8263 { 0x12, 0x40000000 },
8264 { 0x14, 0x90170110 }, /* speaker */
8265 { 0x17, 0x411111f0 },
8266 { 0x18, 0x03a19040 }, /* mic1 */
8267 { 0x19, 0x90a70130 }, /* mic2 */
8268 { 0x1a, 0x411111f0 },
8269 { 0x1b, 0x411111f0 },
8270 { 0x1d, 0x40489d2d },
8271 { 0x1e, 0x411111f0 },
8272 { 0x20, 0x0003ffff },
8273 { 0x21, 0x03214020 },
8274 { }
8275 },
8276 .chain_id = ALC269_FIXUP_DMIC,
8277 },
8278 [ALC269_FIXUP_LEMOTE_A190X] = {
8279 .type = HDA_FIXUP_PINS,
8280 .v.pins = (const struct hda_pintbl[]) {
8281 { 0x14, 0x99130110 }, /* speaker */
8282 { 0x15, 0x0121401f }, /* HP out */
8283 { 0x18, 0x01a19c20 }, /* rear mic */
8284 { 0x19, 0x99a3092f }, /* front mic */
8285 { 0x1b, 0x0201401f }, /* front lineout */
8286 { }
8287 },
8288 .chain_id = ALC269_FIXUP_DMIC,
8289 },
e2d2fded
KHF
8290 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8291 .type = HDA_FIXUP_PINS,
8292 .v.pins = (const struct hda_pintbl[]) {
8293 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8294 { }
8295 },
8296 .chained = true,
8297 .chain_id = ALC269_FIXUP_HEADSET_MODE
8298 },
73e7161e
WS
8299 [ALC256_FIXUP_INTEL_NUC10] = {
8300 .type = HDA_FIXUP_PINS,
8301 .v.pins = (const struct hda_pintbl[]) {
8302 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8303 { }
8304 },
8305 .chained = true,
8306 .chain_id = ALC269_FIXUP_HEADSET_MODE
8307 },
fc19d559
HW
8308 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8309 .type = HDA_FIXUP_VERBS,
8310 .v.verbs = (const struct hda_verb[]) {
8311 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8312 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8313 { }
8314 },
8315 .chained = true,
c84bfedc 8316 .chain_id = ALC289_FIXUP_ASUS_GA502
fc19d559 8317 },
13468bfa
HW
8318 [ALC274_FIXUP_HP_MIC] = {
8319 .type = HDA_FIXUP_VERBS,
8320 .v.verbs = (const struct hda_verb[]) {
8321 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8322 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8323 { }
8324 },
8325 },
8a8de09c
KY
8326 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8327 .type = HDA_FIXUP_FUNC,
8328 .v.func = alc274_fixup_hp_headset_mic,
8329 .chained = true,
8330 .chain_id = ALC274_FIXUP_HP_MIC
8331 },
622464c8
TI
8332 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8333 .type = HDA_FIXUP_FUNC,
8334 .v.func = alc274_fixup_hp_envy_gpio,
8335 },
ef9ce66f
KY
8336 [ALC256_FIXUP_ASUS_HPE] = {
8337 .type = HDA_FIXUP_VERBS,
8338 .v.verbs = (const struct hda_verb[]) {
8339 /* Set EAPD high */
8340 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8341 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8342 { }
8343 },
8344 .chained = true,
8345 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8346 },
446b8185
KY
8347 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8348 .type = HDA_FIXUP_FUNC,
8349 .v.func = alc_fixup_headset_jack,
8350 .chained = true,
8351 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8352 },
a0ccbc53
KY
8353 [ALC287_FIXUP_HP_GPIO_LED] = {
8354 .type = HDA_FIXUP_FUNC,
8355 .v.func = alc287_fixup_hp_gpio_led,
8356 },
9e885770
KY
8357 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8358 .type = HDA_FIXUP_FUNC,
8359 .v.func = alc274_fixup_hp_headset_mic,
8360 },
92666d45
KY
8361 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8362 .type = HDA_FIXUP_FUNC,
8363 .v.func = alc_fixup_no_int_mic,
8364 .chained = true,
8365 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8366 },
34cdf405
CC
8367 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8368 .type = HDA_FIXUP_PINS,
8369 .v.pins = (const struct hda_pintbl[]) {
8370 { 0x1b, 0x411111f0 },
8371 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8372 { },
8373 },
8374 .chained = true,
8375 .chain_id = ALC269_FIXUP_HEADSET_MODE
8376 },
495dc763
CC
8377 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8378 .type = HDA_FIXUP_FUNC,
8379 .v.func = alc269_fixup_limit_int_mic_boost,
8380 .chained = true,
8381 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8382 },
d0e18561
CC
8383 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8384 .type = HDA_FIXUP_PINS,
8385 .v.pins = (const struct hda_pintbl[]) {
8386 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8387 { 0x1a, 0x90a1092f }, /* use as internal mic */
8388 { }
8389 },
8390 .chained = true,
8391 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8392 },
26928ca1
TI
8393 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8394 .type = HDA_FIXUP_FUNC,
8395 .v.func = alc285_fixup_ideapad_s740_coef,
8396 .chained = true,
8397 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8398 },
bd15b155
KHF
8399 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8400 .type = HDA_FIXUP_FUNC,
8401 .v.func = alc269_fixup_limit_int_mic_boost,
8402 .chained = true,
8403 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8404 },
8eedd3a7
TI
8405 [ALC295_FIXUP_ASUS_DACS] = {
8406 .type = HDA_FIXUP_FUNC,
8407 .v.func = alc295_fixup_asus_dacs,
8408 },
5d84b531
TI
8409 [ALC295_FIXUP_HP_OMEN] = {
8410 .type = HDA_FIXUP_PINS,
8411 .v.pins = (const struct hda_pintbl[]) {
8412 { 0x12, 0xb7a60130 },
8413 { 0x13, 0x40000000 },
8414 { 0x14, 0x411111f0 },
8415 { 0x16, 0x411111f0 },
8416 { 0x17, 0x90170110 },
8417 { 0x18, 0x411111f0 },
8418 { 0x19, 0x02a11030 },
8419 { 0x1a, 0x411111f0 },
8420 { 0x1b, 0x04a19030 },
8421 { 0x1d, 0x40600001 },
8422 { 0x1e, 0x411111f0 },
8423 { 0x21, 0x03211020 },
8424 {}
8425 },
8426 .chained = true,
8427 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8428 },
f2be77fe 8429 [ALC285_FIXUP_HP_SPECTRE_X360] = {
434591b2
ED
8430 .type = HDA_FIXUP_FUNC,
8431 .v.func = alc285_fixup_hp_spectre_x360,
f2be77fe 8432 },
d94befbb
DB
8433 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8434 .type = HDA_FIXUP_FUNC,
8435 .v.func = alc285_fixup_hp_spectre_x360_eb1
8436 },
9ebaef05
HW
8437 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8438 .type = HDA_FIXUP_FUNC,
8439 .v.func = alc285_fixup_ideapad_s740_coef,
8440 .chained = true,
8441 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8442 },
29c8f40b
PU
8443 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8444 .type = HDA_FIXUP_FUNC,
8445 .v.func = alc_fixup_no_shutup,
8446 .chained = true,
8447 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8448 },
57c9e21a
HW
8449 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8450 .type = HDA_FIXUP_PINS,
8451 .v.pins = (const struct hda_pintbl[]) {
8452 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8453 { }
8454 },
8455 .chained = true,
8456 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8457 },
8903376d
KHF
8458 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8459 .type = HDA_FIXUP_FUNC,
8460 .v.func = alc269_fixup_limit_int_mic_boost,
8461 .chained = true,
8462 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8463 },
e7e2503a
BF
8464 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8465 .type = HDA_FIXUP_FUNC,
8466 .v.func = alc285_fixup_ideapad_s740_coef,
8467 .chained = true,
8468 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8469 },
8470 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8471 .type = HDA_FIXUP_FUNC,
8472 .v.func = alc287_fixup_legion_15imhg05_speakers,
8473 .chained = true,
8474 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8475 },
ad7cc2d4
CB
8476 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8477 .type = HDA_FIXUP_VERBS,
8478 //.v.verbs = legion_15imhg05_coefs,
8479 .v.verbs = (const struct hda_verb[]) {
8480 // set left speaker Legion 7i.
8481 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8482 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8483
8484 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8485 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8486 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8487 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8488 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8489
8490 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8491 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8492 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8493 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8494 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8495
8496 // set right speaker Legion 7i.
8497 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8498 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8499
8500 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8501 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8502 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8503 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8504 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8505
8506 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8507 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8508 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8509 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8510 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8511 {}
8512 },
8513 .chained = true,
8514 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8515 },
8516 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8517 .type = HDA_FIXUP_FUNC,
8518 .v.func = alc287_fixup_legion_15imhg05_speakers,
8519 .chained = true,
8520 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8521 },
8522 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8523 .type = HDA_FIXUP_VERBS,
8524 .v.verbs = (const struct hda_verb[]) {
8525 // set left speaker Yoga 7i.
8526 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8527 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8528
8529 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8530 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8531 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8532 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8533 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8534
8535 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8536 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8537 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8538 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8539 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8540
8541 // set right speaker Yoga 7i.
8542 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8543 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8544
8545 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8546 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8547 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8548 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8549 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8550
8551 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8552 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8553 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8554 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8555 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8556 {}
8557 },
8558 .chained = true,
8559 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8560 },
8561 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8562 .type = HDA_FIXUP_VERBS,
8563 .v.verbs = (const struct hda_verb[]) {
8564 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8565 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
023a062f 8566 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
ad7cc2d4
CB
8567 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8568 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8569 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8570 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8571 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8572 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8573 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8574 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8575 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8576 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8577 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8578 {}
8579 },
8580 .chained = true,
8581 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8582 },
b9145ede 8583 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
dd6dd6e3 8584 .type = HDA_FIXUP_FUNC,
b9145ede 8585 .v.func = alc256_fixup_set_coef_defaults,
dd6dd6e3 8586 },
c47b3112
JC
8587 [ALC245_FIXUP_HP_GPIO_LED] = {
8588 .type = HDA_FIXUP_FUNC,
8589 .v.func = alc245_fixup_hp_gpio_led,
8590 },
4803b99a
JS
8591 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8592 .type = HDA_FIXUP_PINS,
8593 .v.pins = (const struct hda_pintbl[]) {
8594 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8595 { }
8596 },
8597 .chained = true,
8598 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8599 },
e1abacd3
WS
8600 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8601 .type = HDA_FIXUP_FUNC,
8602 .v.func = alc233_fixup_no_audio_jack,
8603 },
f2ca7e35
WS
8604 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8605 .type = HDA_FIXUP_FUNC,
8606 .v.func = alc256_fixup_mic_no_presence_and_resume,
8607 .chained = true,
8608 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8609 },
f1d4e28b
KY
8610};
8611
1d045db9 8612static const struct snd_pci_quirk alc269_fixup_tbl[] = {
a6b92b66 8613 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
693b613d
DH
8614 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8615 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
aaedfb47 8616 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7819717b 8617 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
aaedfb47
DH
8618 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8619 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
02322ac9 8620 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
b1e8972e 8621 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
1a22e775 8622 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
433f894e 8623 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
c8426b27 8624 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
13be30f1 8625 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
705b65f1 8626 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6e15d126 8627 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
b9c2fa52 8628 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
495dc763 8629 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
c7531e31
CC
8630 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8631 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
13be30f1
CC
8632 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8633 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
e2a829b3 8634 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8eae7e9b 8635 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
781c90c0 8636 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
d0e18561 8637 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
667a8f73
JHP
8638 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8639 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8640 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
d0e18561 8641 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
35171fbf 8642 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
2733cceb 8643 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
ea5c7eba 8644 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
cbc05fd6 8645 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
204a71b0 8646 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
0d4867a1 8647 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
f50a121d 8648 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
57c9e21a 8649 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
aaedfb47 8650 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
6ed1131f 8651 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
86f799b8 8652 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
cf52103a 8653 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8b99aba7
TI
8654 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8655 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
0f4881dc 8656 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
73bdd597
DH
8657 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8658 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8659 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
0f4881dc
DH
8660 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8661 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
98070576 8662 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
4275554d 8663 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
0f4881dc 8664 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
a22aa26f
KY
8665 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8666 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
831bfdf9 8667 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
afecb146 8668 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
3a05d12f 8669 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8b72415d 8670 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
b734304f
KY
8671 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8672 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
c04017ea
DH
8673 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8674 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8675 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8676 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8677 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
fd06c77e 8678 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
3b43b71f 8679 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
c0ca5ece 8680 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
709ae62e 8681 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
dd9aa335 8682 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
493de342 8683 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
aa143ad3 8684 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
5f364135 8685 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
40e2c4e5
KY
8686 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8687 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
f0ba9d69
KY
8688 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8689 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
ae104a21 8690 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
136824ef 8691 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
da484d00 8692 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
c2a7c55a 8693 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
e79c2269 8694 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
aa143ad3 8695 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
78def224
KY
8696 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8697 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
92666d45
KY
8698 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8699 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
c1e89523 8700 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
da946920 8701 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
eb676622 8702 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
2b987fe8
CC
8703 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8704 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
a22aa26f
KY
8705 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8706 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
08fb0d0e 8707 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
9f5c6faf 8708 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8e35cd4a 8709 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7976eb49 8710 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 8711 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8a02b164 8712 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8713 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8714 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8715 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8716 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf
KY
8717 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8718 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8719 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8720 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf 8721 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
9c5dc3bf
KY
8722 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8723 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8724 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8725 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8726 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9c5dc3bf 8727 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
04d5466a 8728 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
45461e3b 8729 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
c60666bd 8730 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
8731 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8732 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8733 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8734 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8735 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8736 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8737 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8738 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9c5dc3bf 8739 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 8740 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 8741 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
45461e3b 8742 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9c5dc3bf 8743 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
c60666bd 8744 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8745 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8746 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8747 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8748 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8749 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8750 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8751 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8752 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd 8753 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
c60666bd
KY
8754 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8755 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
45461e3b
TI
8756 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8757 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8758 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8759 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8a02b164
KY
8760 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8761 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8762 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8763 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
167897f4
JK
8764 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8765 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
1c9d9dfd
KY
8766 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8767 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
563785ed 8768 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
e549d190 8769 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
bbf8ff6b 8770 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
aeedad25 8771 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
167897f4
JK
8772 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8773 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
56e40eb6 8774 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
901be145 8775 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
190d0381 8776 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
5d84b531 8777 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
d33cd42d 8778 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
f2be77fe 8779 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
a94c91b4 8780 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
0ac05b25 8781 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
b2c22910 8782 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
622464c8 8783 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
15d295b5 8784 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
61d3e874 8785 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
a598098c 8786 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
afbac2a3 8787 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
b2c22910 8788 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
75b62ab6 8789 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
de1c4c2b 8790 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
56496253 8791 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
08befca4 8792 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
431e76c3 8793 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
24164f43 8794 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
91bc1568
JS
8795 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8796 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8797 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8798 ALC285_FIXUP_HP_GPIO_AMP_INIT),
ba28051e 8799 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
48422958 8800 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
e7d66cf7 8801 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
2b70b264 8802 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
fb3acdb2 8803 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
417eadfd 8804 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
a0ccbc53
KY
8805 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8806 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
93ab3eaf 8807 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
c3bb2b52 8808 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
d07149ab 8809 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
dfc2e8ae 8810 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
d94befbb
DB
8811 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8812 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
53b861be 8813 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
c3d2c882 8814 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
dfb06401 8815 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
ca688339 8816 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8903376d
KHF
8817 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8818 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
50dbfae9 8819 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
e650c1a9 8820 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
bbe183e0 8821 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
600dd2a7 8822 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
0e68c4b1 8823 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
bd15b155 8824 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
42334fbc 8825 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
92c07d71
AC
8826 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
8827 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
8828 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
8829 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
0aa32e54 8830 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
1e30191c 8831 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
c1732ede 8832 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7bba2157 8833 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3e0d611b 8834 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9cf6533e 8835 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
c1732ede 8836 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
4eab0ea1 8837 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3e0d611b 8838 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4eab0ea1 8839 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
3cd0ed63 8840 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
5cfca596 8841 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1
TI
8842 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8843 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
c1732ede 8844 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
3cd0ed63 8845 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
c1732ede 8846 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
2cede303 8847 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
23870831 8848 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
3e0d611b 8849 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8eedd3a7 8850 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
48e01504 8851 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
739d0959 8852 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
3cd0ed63 8853 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8c8967a7 8854 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
4963d66b 8855 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
158ae2f5 8856 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
d3a9b1ce 8857 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
5de3b943 8858 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8b33a134 8859 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7900e817 8860 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
017f2a10 8861 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
28e8af8a 8862 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
1b94e59d 8863 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
693b613d 8864 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
615966ad 8865 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
4eab0ea1 8866 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
c1732ede 8867 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
ef9ce66f 8868 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
4b43d05a 8869 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
c1b55029 8870 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
76fae618 8871 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
293a92c1 8872 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
10b212cb 8873 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
ff2ca018 8874 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
eeed4cd1 8875 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
adabb3ec
TI
8876 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8877 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8878 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8879 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
d240d1dc 8880 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1d045db9
TI
8881 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8882 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8883 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
e9bd7d5c 8884 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
cab561f8
TI
8885 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8886 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
24519911 8887 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
4df3fd17 8888 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
cc7016ab 8889 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
fdcc968a 8890 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
c656f747 8891 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
2041d564 8892 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
b84e8436 8893 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
c656f747 8894 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
6fa38ef1 8895 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
ce2e79b2
PH
8896 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8897 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
0fca97a2 8898 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
a33cc48d 8899 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
14425f1f
MP
8900 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8901 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
f70fff83 8902 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8bcea6cb 8903 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
823ff161 8904 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
568e4e82 8905 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
c656f747 8906 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
abaa2274
AA
8907 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8908 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8cd65271 8909 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6ca653e3 8910 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
b5acfe15 8911 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b 8912 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8913 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8914 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8915 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8916 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8917 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8918 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8919 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8920 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8921 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8922 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
4803b99a
JS
8923 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8924 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8925 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8926 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8927 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8928 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8929 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
4803b99a
JS
8930 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8931 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 8932 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 8933 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 8934 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
8935 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8936 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8937 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8938 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8939 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8940 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8941 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
8942 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8943 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8944 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8945 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8946 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8947 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8948 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8949 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8950 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
8951 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8952 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8953 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8954 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8955 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
b5acfe15 8956 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
e69e27b0 8957 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
92914940 8958 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15 8959 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
f2ca7e35 8960 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
b5acfe15
PH
8961 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8962 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8963 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8964 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2 8965 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
b5acfe15
PH
8966 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8967 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
745f260b
WS
8968 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8969 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
1d5cfca2
PH
8970 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8971 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8972 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8973 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8974 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8975 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
ca169cc2 8976 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
29c8f40b 8977 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
1d045db9
TI
8978 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8979 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8980 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8981 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8982 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
f552ff54 8983 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
b590b38c 8984 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
c8415a48 8985 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
4407be6b 8986 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
108cc108 8987 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
aaedfb47 8988 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9a811230 8989 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
1c37c223 8990 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
a12137e7 8991 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
59a51a6b 8992 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6d16941a 8993 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7c21539c 8994 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
a4a9e082 8995 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
b6903c0e 8996 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
d05ea7da 8997 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
c0278669 8998 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
61fcf8ec
KY
8999 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9000 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
dab38e43 9001 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
c636b95e 9002 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9003 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9004 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9005 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
e4c07b3b 9006 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9007 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9008 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9009 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
85981dfd 9010 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9774dc21 9011 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
ca707b3f 9012 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
446b8185
KY
9013 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9014 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
3694cb29 9015 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6ef2f68f 9016 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
f33f79f3 9017 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
bef33e19 9018 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
e41fc8c5 9019 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
65811834 9020 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8da5bbfc 9021 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
2a36c16e 9022 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8a6c55d0
AM
9023 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9024 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
e4efa826 9025 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
c6e388f4 9026 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
f86de9b1 9027 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
c6e388f4 9028 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
e7e2503a 9029 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
c6e388f4 9030 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
b67ef1ff 9031 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
592b887e 9032 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9ebaef05 9033 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
c6e388f4 9034 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
ad7cc2d4
CB
9035 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9036 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
56f27013 9037 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
fedb2245 9038 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
56df90b6 9039 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
f552ff54 9040 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
a4a9e082 9041 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
1bb3e062 9042 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
c497d9f9 9043 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
cd5302c0 9044 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
f2aa1110 9045 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
80b311d3 9046 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
09ea9976 9047 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
037e1197 9048 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
23adc192 9049 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
0f087ee3 9050 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9cd25743 9051 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
0f087ee3 9052 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
61fcf8ec
KY
9053 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9054 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9055 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
cd5302c0 9056 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
61fcf8ec
KY
9057 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9058 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
1d045db9 9059 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
e1abacd3 9060 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
0fbf21c3 9061 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
f1ec5be1
HC
9062 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9063 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9064 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
02b504d9 9065 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
c656f747
TI
9066 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9067 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
b9145ede 9068 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
fc19d559 9069 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
b95bc12e 9070 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
695d1ec3 9071 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
e1c86210 9072 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
d1ee66c5 9073 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
e2d2fded 9074 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
73e7161e 9075 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
a4297b5d 9076
a7f3eedc 9077#if 0
a4297b5d
TI
9078 /* Below is a quirk table taken from the old code.
9079 * Basically the device should work as is without the fixup table.
9080 * If BIOS doesn't give a proper info, enable the corresponding
9081 * fixup entry.
7d7eb9ea 9082 */
a4297b5d
TI
9083 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9084 ALC269_FIXUP_AMIC),
9085 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
a4297b5d
TI
9086 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9087 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9088 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9089 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9090 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9091 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9092 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9093 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9094 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9095 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9096 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9097 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9098 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9099 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9100 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9101 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9102 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9103 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9104 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9105 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9106 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9107 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9108 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9109 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9110 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9111 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9112 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9113 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9114 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9115 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9116 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9117 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9118 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9119 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9120 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9121 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9122 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9123 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9124#endif
9125 {}
9126};
9127
214eef76
DH
9128static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9129 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9130 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9131 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9132 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
0fbf21c3 9133 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
214eef76
DH
9134 {}
9135};
9136
1727a771 9137static const struct hda_model_fixup alc269_fixup_models[] = {
a4297b5d
TI
9138 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9139 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6e72aa5f
TI
9140 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9141 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9142 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7c478f03 9143 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
b016951e
TI
9144 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9145 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
108cc108 9146 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
b590b38c 9147 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9f5c6faf 9148 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
04d5466a 9149 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
e32aa85a
DH
9150 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9151 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
a26d96c7
TI
9152 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9153 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
be8ef16a 9154 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
0202e99c 9155 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
1c37c223 9156 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9a811230 9157 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
c636b95e 9158 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
399c01aa 9159 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
a26d96c7 9160 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
ba90d6a6 9161 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
28d1d6d2 9162 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
a26d96c7
TI
9163 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9164 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9165 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9166 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9167 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9168 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9169 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9170 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9171 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9172 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9173 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9174 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9175 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9176 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9177 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9178 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9179 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9180 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9181 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9182 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9183 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9184 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9185 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9186 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9187 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9188 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9189 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9190 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9191 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9192 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9193 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9194 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9195 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9196 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9197 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9198 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9199 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9200 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9201 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9202 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
b3802783 9203 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
a26d96c7 9204 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
c8426b27 9205 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
a26d96c7
TI
9206 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9207 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9208 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9209 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9210 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9211 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9212 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9213 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9214 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9215 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9216 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9217 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9218 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9219 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
a26d96c7
TI
9220 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9221 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9222 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
82aa0d7e 9223 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
a26d96c7 9224 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
d2cd795c 9225 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
a26d96c7
TI
9226 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9227 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9228 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9229 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9230 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9231 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9232 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9233 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9234 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9235 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9236 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9237 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9238 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9239 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9240 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9241 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9242 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8983eb60
KY
9243 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9244 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
e2a829b3 9245 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
a2ef03fe 9246 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
bd9c10bc 9247 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
23dc9586 9248 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
fc19d559 9249 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
13468bfa 9250 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
c3bb2b52 9251 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
5d84b531 9252 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
f2be77fe 9253 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
d94befbb 9254 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9ebaef05 9255 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
29c8f40b 9256 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
57c9e21a 9257 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
657da58e 9258 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
1d045db9 9259 {}
6dda9f4a 9260};
cfc5a845 9261#define ALC225_STANDARD_PINS \
cfc5a845 9262 {0x21, 0x04211020}
6dda9f4a 9263
e8191a8e
HW
9264#define ALC256_STANDARD_PINS \
9265 {0x12, 0x90a60140}, \
9266 {0x14, 0x90170110}, \
e8191a8e
HW
9267 {0x21, 0x02211020}
9268
fea185e2 9269#define ALC282_STANDARD_PINS \
11580297 9270 {0x14, 0x90170110}
e1e62b98 9271
fea185e2 9272#define ALC290_STANDARD_PINS \
11580297 9273 {0x12, 0x99a30130}
fea185e2
DH
9274
9275#define ALC292_STANDARD_PINS \
9276 {0x14, 0x90170110}, \
11580297 9277 {0x15, 0x0221401f}
977e6276 9278
3f640970
HW
9279#define ALC295_STANDARD_PINS \
9280 {0x12, 0xb7a60130}, \
9281 {0x14, 0x90170110}, \
3f640970
HW
9282 {0x21, 0x04211020}
9283
703867e2
WS
9284#define ALC298_STANDARD_PINS \
9285 {0x12, 0x90a60130}, \
9286 {0x21, 0x03211020}
9287
e1918938 9288static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8a328ac1
KY
9289 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9290 {0x14, 0x01014020},
9291 {0x17, 0x90170110},
9292 {0x18, 0x02a11030},
9293 {0x19, 0x0181303F},
9294 {0x21, 0x0221102f}),
5824ce8d
CC
9295 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9296 {0x12, 0x90a601c0},
9297 {0x14, 0x90171120},
9298 {0x21, 0x02211030}),
615966ad
CC
9299 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9300 {0x14, 0x90170110},
9301 {0x1b, 0x90a70130},
9302 {0x21, 0x03211020}),
9303 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9304 {0x1a, 0x90a70130},
9305 {0x1b, 0x90170110},
9306 {0x21, 0x03211020}),
2ae95577 9307 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 9308 ALC225_STANDARD_PINS,
8a132099 9309 {0x12, 0xb7a60130},
cfc5a845 9310 {0x14, 0x901701a0}),
2ae95577 9311 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
cfc5a845 9312 ALC225_STANDARD_PINS,
8a132099 9313 {0x12, 0xb7a60130},
cfc5a845 9314 {0x14, 0x901701b0}),
8a132099
HW
9315 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9316 ALC225_STANDARD_PINS,
9317 {0x12, 0xb7a60150},
9318 {0x14, 0x901701a0}),
9319 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9320 ALC225_STANDARD_PINS,
9321 {0x12, 0xb7a60150},
9322 {0x14, 0x901701b0}),
9323 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9324 ALC225_STANDARD_PINS,
9325 {0x12, 0xb7a60130},
9326 {0x1b, 0x90170110}),
0ce48e17
KHF
9327 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9328 {0x1b, 0x01111010},
9329 {0x1e, 0x01451130},
9330 {0x21, 0x02211020}),
986376b6
HW
9331 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9332 {0x12, 0x90a60140},
9333 {0x14, 0x90170110},
9334 {0x19, 0x02a11030},
9335 {0x21, 0x02211020}),
e41fc8c5
HW
9336 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9337 {0x14, 0x90170110},
9338 {0x19, 0x02a11030},
9339 {0x1a, 0x02a11040},
9340 {0x1b, 0x01014020},
9341 {0x21, 0x0221101f}),
d06fb562
HW
9342 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9343 {0x14, 0x90170110},
9344 {0x19, 0x02a11030},
9345 {0x1a, 0x02a11040},
9346 {0x1b, 0x01011020},
9347 {0x21, 0x0221101f}),
c6b17f10
HW
9348 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9349 {0x14, 0x90170110},
9350 {0x19, 0x02a11020},
9351 {0x1a, 0x02a11030},
9352 {0x21, 0x0221101f}),
92666d45
KY
9353 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9354 {0x21, 0x02211010}),
9e885770
KY
9355 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9356 {0x14, 0x90170110},
9357 {0x19, 0x02a11020},
9358 {0x21, 0x02211030}),
c77900e6 9359 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
c77900e6 9360 {0x14, 0x90170110},
c77900e6 9361 {0x21, 0x02211020}),
86c72d1c
HW
9362 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9363 {0x14, 0x90170130},
9364 {0x21, 0x02211040}),
76c2132e
DH
9365 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9366 {0x12, 0x90a60140},
9367 {0x14, 0x90170110},
76c2132e
DH
9368 {0x21, 0x02211020}),
9369 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9370 {0x12, 0x90a60160},
9371 {0x14, 0x90170120},
76c2132e 9372 {0x21, 0x02211030}),
392c9da2
HW
9373 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9374 {0x14, 0x90170110},
9375 {0x1b, 0x02011020},
9376 {0x21, 0x0221101f}),
6aecd871
HW
9377 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9378 {0x14, 0x90170110},
9379 {0x1b, 0x01011020},
9380 {0x21, 0x0221101f}),
cba59972 9381 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
cba59972 9382 {0x14, 0x90170130},
cba59972 9383 {0x1b, 0x01014020},
cba59972 9384 {0x21, 0x0221103f}),
6aecd871
HW
9385 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9386 {0x14, 0x90170130},
9387 {0x1b, 0x01011020},
9388 {0x21, 0x0221103f}),
59ec4b57
HW
9389 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9390 {0x14, 0x90170130},
9391 {0x1b, 0x02011020},
9392 {0x21, 0x0221103f}),
e9c28e16 9393 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 9394 {0x14, 0x90170150},
e9c28e16 9395 {0x1b, 0x02011020},
e9c28e16
WS
9396 {0x21, 0x0221105f}),
9397 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
e9c28e16 9398 {0x14, 0x90170110},
e9c28e16 9399 {0x1b, 0x01014020},
e9c28e16 9400 {0x21, 0x0221101f}),
76c2132e
DH
9401 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9402 {0x12, 0x90a60160},
9403 {0x14, 0x90170120},
9404 {0x17, 0x90170140},
76c2132e
DH
9405 {0x21, 0x0321102f}),
9406 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9407 {0x12, 0x90a60160},
9408 {0x14, 0x90170130},
76c2132e
DH
9409 {0x21, 0x02211040}),
9410 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9411 {0x12, 0x90a60160},
9412 {0x14, 0x90170140},
76c2132e
DH
9413 {0x21, 0x02211050}),
9414 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9415 {0x12, 0x90a60170},
9416 {0x14, 0x90170120},
76c2132e
DH
9417 {0x21, 0x02211030}),
9418 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9419 {0x12, 0x90a60170},
9420 {0x14, 0x90170130},
76c2132e 9421 {0x21, 0x02211040}),
0a1f90a9
HW
9422 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9423 {0x12, 0x90a60170},
9424 {0x14, 0x90171130},
9425 {0x21, 0x02211040}),
70658b99 9426 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
70658b99
HW
9427 {0x12, 0x90a60170},
9428 {0x14, 0x90170140},
70658b99 9429 {0x21, 0x02211050}),
9b5a4e39 9430 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9b5a4e39
DH
9431 {0x12, 0x90a60180},
9432 {0x14, 0x90170130},
9b5a4e39 9433 {0x21, 0x02211040}),
f90d83b3
AK
9434 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9435 {0x12, 0x90a60180},
9436 {0x14, 0x90170120},
9437 {0x21, 0x02211030}),
989dbe4a
HW
9438 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9439 {0x1b, 0x01011020},
9440 {0x21, 0x02211010}),
c1732ede
CC
9441 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9442 {0x14, 0x90170110},
9443 {0x1b, 0x90a70130},
9444 {0x21, 0x04211020}),
9445 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9446 {0x14, 0x90170110},
9447 {0x1b, 0x90a70130},
9448 {0x21, 0x03211020}),
a806ef1c
CC
9449 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9450 {0x12, 0x90a60130},
9451 {0x14, 0x90170110},
9452 {0x21, 0x03211020}),
6ac371aa
JHP
9453 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9454 {0x12, 0x90a60130},
9455 {0x14, 0x90170110},
9456 {0x21, 0x04211020}),
e1037354
JHP
9457 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9458 {0x1a, 0x90a70130},
9459 {0x1b, 0x90170110},
9460 {0x21, 0x03211020}),
9e885770
KY
9461 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9462 {0x14, 0x90170110},
9463 {0x19, 0x02a11020},
9464 {0x21, 0x0221101f}),
8a8de09c
KY
9465 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9466 {0x17, 0x90170110},
9467 {0x19, 0x03a11030},
9468 {0x21, 0x03211020}),
cf51eb9d
DH
9469 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9470 {0x12, 0x90a60130},
cf51eb9d
DH
9471 {0x14, 0x90170110},
9472 {0x15, 0x0421101f},
11580297 9473 {0x1a, 0x04a11020}),
0279661b
HW
9474 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9475 {0x12, 0x90a60140},
0279661b
HW
9476 {0x14, 0x90170110},
9477 {0x15, 0x0421101f},
0279661b 9478 {0x18, 0x02811030},
0279661b 9479 {0x1a, 0x04a1103f},
11580297 9480 {0x1b, 0x02011020}),
42304474 9481 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9482 ALC282_STANDARD_PINS,
42304474 9483 {0x12, 0x99a30130},
42304474 9484 {0x19, 0x03a11020},
42304474 9485 {0x21, 0x0321101f}),
2c609999 9486 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9487 ALC282_STANDARD_PINS,
2c609999 9488 {0x12, 0x99a30130},
2c609999 9489 {0x19, 0x03a11020},
2c609999
HW
9490 {0x21, 0x03211040}),
9491 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9492 ALC282_STANDARD_PINS,
2c609999 9493 {0x12, 0x99a30130},
2c609999 9494 {0x19, 0x03a11030},
2c609999
HW
9495 {0x21, 0x03211020}),
9496 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9497 ALC282_STANDARD_PINS,
2c609999 9498 {0x12, 0x99a30130},
2c609999 9499 {0x19, 0x04a11020},
2c609999 9500 {0x21, 0x0421101f}),
200afc09 9501 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
aec856d0 9502 ALC282_STANDARD_PINS,
200afc09 9503 {0x12, 0x90a60140},
200afc09 9504 {0x19, 0x04a11030},
200afc09 9505 {0x21, 0x04211020}),
34cdf405
CC
9506 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9507 ALC282_STANDARD_PINS,
9508 {0x12, 0x90a609c0},
9509 {0x18, 0x03a11830},
9510 {0x19, 0x04a19831},
9511 {0x1a, 0x0481303f},
9512 {0x1b, 0x04211020},
9513 {0x21, 0x0321101f}),
9514 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9515 ALC282_STANDARD_PINS,
9516 {0x12, 0x90a60940},
9517 {0x18, 0x03a11830},
9518 {0x19, 0x04a19831},
9519 {0x1a, 0x0481303f},
9520 {0x1b, 0x04211020},
9521 {0x21, 0x0321101f}),
76c2132e 9522 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9523 ALC282_STANDARD_PINS,
76c2132e 9524 {0x12, 0x90a60130},
76c2132e
DH
9525 {0x21, 0x0321101f}),
9526 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9527 {0x12, 0x90a60160},
9528 {0x14, 0x90170120},
76c2132e 9529 {0x21, 0x02211030}),
bc262179 9530 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9531 ALC282_STANDARD_PINS,
bc262179 9532 {0x12, 0x90a60130},
bc262179 9533 {0x19, 0x03a11020},
bc262179 9534 {0x21, 0x0321101f}),
c8c6ee61 9535 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
266fd994
SL
9536 {0x12, 0x90a60130},
9537 {0x14, 0x90170110},
9538 {0x19, 0x04a11040},
9539 {0x21, 0x04211020}),
9540 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9541 {0x14, 0x90170110},
9542 {0x19, 0x04a11040},
9543 {0x1d, 0x40600001},
9544 {0x21, 0x04211020}),
9545 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
c4cfcf6f
HW
9546 {0x14, 0x90170110},
9547 {0x19, 0x04a11040},
9548 {0x21, 0x04211020}),
c72b9bfe
HW
9549 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9550 {0x14, 0x90170110},
9551 {0x17, 0x90170111},
9552 {0x19, 0x03a11030},
9553 {0x21, 0x03211020}),
33aaebd4
CC
9554 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9555 {0x12, 0x90a60130},
9556 {0x17, 0x90170110},
9557 {0x21, 0x02211020}),
d44a6864 9558 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
e1e62b98 9559 {0x12, 0x90a60120},
e1e62b98 9560 {0x14, 0x90170110},
e1e62b98 9561 {0x21, 0x0321101f}),
e4442bcf 9562 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9563 ALC290_STANDARD_PINS,
e4442bcf 9564 {0x15, 0x04211040},
e4442bcf 9565 {0x18, 0x90170112},
11580297 9566 {0x1a, 0x04a11020}),
e4442bcf 9567 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9568 ALC290_STANDARD_PINS,
e4442bcf 9569 {0x15, 0x04211040},
e4442bcf 9570 {0x18, 0x90170110},
11580297 9571 {0x1a, 0x04a11020}),
e4442bcf 9572 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9573 ALC290_STANDARD_PINS,
e4442bcf 9574 {0x15, 0x0421101f},
11580297 9575 {0x1a, 0x04a11020}),
e4442bcf 9576 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9577 ALC290_STANDARD_PINS,
e4442bcf 9578 {0x15, 0x04211020},
11580297 9579 {0x1a, 0x04a11040}),
e4442bcf 9580 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9581 ALC290_STANDARD_PINS,
e4442bcf
HW
9582 {0x14, 0x90170110},
9583 {0x15, 0x04211020},
11580297 9584 {0x1a, 0x04a11040}),
e4442bcf 9585 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9586 ALC290_STANDARD_PINS,
e4442bcf
HW
9587 {0x14, 0x90170110},
9588 {0x15, 0x04211020},
11580297 9589 {0x1a, 0x04a11020}),
e4442bcf 9590 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
aec856d0 9591 ALC290_STANDARD_PINS,
e4442bcf
HW
9592 {0x14, 0x90170110},
9593 {0x15, 0x0421101f},
11580297 9594 {0x1a, 0x04a11020}),
e8818fa8 9595 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 9596 ALC292_STANDARD_PINS,
e8818fa8 9597 {0x12, 0x90a60140},
e8818fa8 9598 {0x16, 0x01014020},
11580297 9599 {0x19, 0x01a19030}),
e8818fa8 9600 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
aec856d0 9601 ALC292_STANDARD_PINS,
e8818fa8 9602 {0x12, 0x90a60140},
e8818fa8
HW
9603 {0x16, 0x01014020},
9604 {0x18, 0x02a19031},
11580297 9605 {0x19, 0x01a1903e}),
76c2132e 9606 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
aec856d0 9607 ALC292_STANDARD_PINS,
11580297 9608 {0x12, 0x90a60140}),
76c2132e 9609 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9610 ALC292_STANDARD_PINS,
76c2132e 9611 {0x13, 0x90a60140},
76c2132e 9612 {0x16, 0x21014020},
11580297 9613 {0x19, 0x21a19030}),
e03fdbde 9614 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
aec856d0 9615 ALC292_STANDARD_PINS,
11580297 9616 {0x13, 0x90a60140}),
eeacd80f
JHP
9617 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9618 {0x17, 0x90170110},
9619 {0x21, 0x04211020}),
d8ae458e
CC
9620 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9621 {0x14, 0x90170110},
9622 {0x1b, 0x90a70130},
9623 {0x21, 0x04211020}),
8bb37a2a
JHP
9624 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9625 {0x12, 0x90a60130},
9626 {0x17, 0x90170110},
9627 {0x21, 0x03211020}),
0bea4cc8
JHP
9628 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9629 {0x12, 0x90a60130},
9630 {0x17, 0x90170110},
9631 {0x21, 0x04211020}),
3887c26c
TI
9632 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9633 {0x12, 0x90a60130},
9634 {0x17, 0x90170110},
9635 {0x21, 0x03211020}),
9e43342b 9636 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
ad97d667
JHP
9637 {0x12, 0x90a60120},
9638 {0x17, 0x90170110},
9639 {0x21, 0x04211030}),
9640 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9e43342b
CC
9641 {0x12, 0x90a60130},
9642 {0x17, 0x90170110},
9643 {0x21, 0x03211020}),
9644 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9645 {0x12, 0x90a60130},
9646 {0x17, 0x90170110},
9647 {0x21, 0x03211020}),
fbc57129 9648 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
0a29c57b
KY
9649 {0x14, 0x90170110},
9650 {0x21, 0x04211020}),
fbc57129
KY
9651 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9652 {0x14, 0x90170110},
9653 {0x21, 0x04211030}),
3f640970 9654 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
f771d5bb
HW
9655 ALC295_STANDARD_PINS,
9656 {0x17, 0x21014020},
9657 {0x18, 0x21a19030}),
9658 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9659 ALC295_STANDARD_PINS,
9660 {0x17, 0x21014040},
9661 {0x18, 0x21a19050}),
3f307834
HW
9662 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9663 ALC295_STANDARD_PINS),
9f502ff5
TI
9664 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9665 ALC298_STANDARD_PINS,
9666 {0x17, 0x90170110}),
977e6276 9667 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
703867e2
WS
9668 ALC298_STANDARD_PINS,
9669 {0x17, 0x90170140}),
9670 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9671 ALC298_STANDARD_PINS,
9f502ff5 9672 {0x17, 0x90170150}),
9f1bc2c4
KHF
9673 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9674 {0x12, 0xb7a60140},
9675 {0x13, 0xb7a60150},
9676 {0x17, 0x90170110},
9677 {0x1a, 0x03011020},
9678 {0x21, 0x03211030}),
54324221
JM
9679 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9680 {0x12, 0xb7a60140},
9681 {0x17, 0x90170110},
9682 {0x1a, 0x03a11030},
9683 {0x21, 0x03211020}),
fcc6c877
KY
9684 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9685 ALC225_STANDARD_PINS,
9686 {0x12, 0xb7a60130},
fcc6c877 9687 {0x17, 0x90170110}),
573fcbfd
HW
9688 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9689 {0x14, 0x01014010},
9690 {0x17, 0x90170120},
9691 {0x18, 0x02a11030},
9692 {0x19, 0x02a1103f},
9693 {0x21, 0x0221101f}),
e1918938
HW
9694 {}
9695};
6dda9f4a 9696
7c0a6939
HW
9697/* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9698 * more machines, don't need to match all valid pins, just need to match
9699 * all the pins defined in the tbl. Just because of this reason, it is possible
9700 * that a single machine matches multiple tbls, so there is one limitation:
9701 * at most one tbl is allowed to define for the same vendor and same codec
9702 */
9703static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9704 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9705 {0x19, 0x40000000},
9706 {0x1b, 0x40000000}),
aed8c7f4
HW
9707 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9708 {0x19, 0x40000000},
9709 {0x1a, 0x40000000}),
d64ebdbf
HW
9710 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9711 {0x19, 0x40000000},
9712 {0x1a, 0x40000000}),
5815bdfd
HW
9713 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9714 {0x19, 0x40000000},
9715 {0x1a, 0x40000000}),
7c0a6939
HW
9716 {}
9717};
9718
546bb678 9719static void alc269_fill_coef(struct hda_codec *codec)
1d045db9 9720{
526af6eb 9721 struct alc_spec *spec = codec->spec;
1d045db9 9722 int val;
ebb83eeb 9723
526af6eb 9724 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
546bb678 9725 return;
526af6eb 9726
1bb7e43e 9727 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
1d045db9
TI
9728 alc_write_coef_idx(codec, 0xf, 0x960b);
9729 alc_write_coef_idx(codec, 0xe, 0x8817);
9730 }
ebb83eeb 9731
1bb7e43e 9732 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
1d045db9
TI
9733 alc_write_coef_idx(codec, 0xf, 0x960b);
9734 alc_write_coef_idx(codec, 0xe, 0x8814);
9735 }
ebb83eeb 9736
1bb7e43e 9737 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
1d045db9 9738 /* Power up output pin */
98b24883 9739 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
1d045db9 9740 }
ebb83eeb 9741
1bb7e43e 9742 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
1d045db9 9743 val = alc_read_coef_idx(codec, 0xd);
f3ee07d8 9744 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
1d045db9
TI
9745 /* Capless ramp up clock control */
9746 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9747 }
9748 val = alc_read_coef_idx(codec, 0x17);
f3ee07d8 9749 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
1d045db9
TI
9750 /* Class D power on reset */
9751 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9752 }
9753 }
ebb83eeb 9754
98b24883
TI
9755 /* HP */
9756 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
1d045db9 9757}
a7f2371f 9758
1d045db9
TI
9759/*
9760 */
1d045db9
TI
9761static int patch_alc269(struct hda_codec *codec)
9762{
9763 struct alc_spec *spec;
3de95173 9764 int err;
f1d4e28b 9765
3de95173 9766 err = alc_alloc_spec(codec, 0x0b);
e16fb6d1 9767 if (err < 0)
3de95173
TI
9768 return err;
9769
9770 spec = codec->spec;
08c189f2 9771 spec->gen.shared_mic_vref_pin = 0x18;
317d9313 9772 codec->power_save_node = 0;
e16fb6d1 9773
225068ab
TI
9774#ifdef CONFIG_PM
9775 codec->patch_ops.suspend = alc269_suspend;
9776 codec->patch_ops.resume = alc269_resume;
9777#endif
c2d6af53
KY
9778 spec->shutup = alc_default_shutup;
9779 spec->init_hook = alc_default_init;
225068ab 9780
7639a06c 9781 switch (codec->core.vendor_id) {
065380f0 9782 case 0x10ec0269:
1d045db9 9783 spec->codec_variant = ALC269_TYPE_ALC269VA;
1bb7e43e
TI
9784 switch (alc_get_coef0(codec) & 0x00f0) {
9785 case 0x0010:
5100cd07
TI
9786 if (codec->bus->pci &&
9787 codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 9788 spec->cdefine.platform_type == 1)
20ca0c35 9789 err = alc_codec_rename(codec, "ALC271X");
1d045db9 9790 spec->codec_variant = ALC269_TYPE_ALC269VB;
1bb7e43e
TI
9791 break;
9792 case 0x0020:
5100cd07
TI
9793 if (codec->bus->pci &&
9794 codec->bus->pci->subsystem_vendor == 0x17aa &&
e16fb6d1 9795 codec->bus->pci->subsystem_device == 0x21f3)
20ca0c35 9796 err = alc_codec_rename(codec, "ALC3202");
1d045db9 9797 spec->codec_variant = ALC269_TYPE_ALC269VC;
1bb7e43e 9798 break;
adcc70b2
KY
9799 case 0x0030:
9800 spec->codec_variant = ALC269_TYPE_ALC269VD;
9801 break;
1bb7e43e 9802 default:
1d045db9 9803 alc_fix_pll_init(codec, 0x20, 0x04, 15);
1bb7e43e 9804 }
e16fb6d1
TI
9805 if (err < 0)
9806 goto error;
c2d6af53 9807 spec->shutup = alc269_shutup;
546bb678 9808 spec->init_hook = alc269_fill_coef;
1d045db9 9809 alc269_fill_coef(codec);
065380f0
KY
9810 break;
9811
9812 case 0x10ec0280:
9813 case 0x10ec0290:
9814 spec->codec_variant = ALC269_TYPE_ALC280;
9815 break;
9816 case 0x10ec0282:
065380f0 9817 spec->codec_variant = ALC269_TYPE_ALC282;
7b5c7a02
KY
9818 spec->shutup = alc282_shutup;
9819 spec->init_hook = alc282_init;
065380f0 9820 break;
2af02be7
KY
9821 case 0x10ec0233:
9822 case 0x10ec0283:
9823 spec->codec_variant = ALC269_TYPE_ALC283;
9824 spec->shutup = alc283_shutup;
9825 spec->init_hook = alc283_init;
9826 break;
065380f0
KY
9827 case 0x10ec0284:
9828 case 0x10ec0292:
9829 spec->codec_variant = ALC269_TYPE_ALC284;
9830 break;
161ebf29 9831 case 0x10ec0293:
4731d5de 9832 spec->codec_variant = ALC269_TYPE_ALC293;
161ebf29 9833 break;
7fc7d047 9834 case 0x10ec0286:
7c665932 9835 case 0x10ec0288:
7fc7d047
KY
9836 spec->codec_variant = ALC269_TYPE_ALC286;
9837 break;
506b62c3
KY
9838 case 0x10ec0298:
9839 spec->codec_variant = ALC269_TYPE_ALC298;
9840 break;
ea04a1db 9841 case 0x10ec0235:
1d04c9de
KY
9842 case 0x10ec0255:
9843 spec->codec_variant = ALC269_TYPE_ALC255;
ab3b8e51
KY
9844 spec->shutup = alc256_shutup;
9845 spec->init_hook = alc256_init;
1d04c9de 9846 break;
1948fc06 9847 case 0x10ec0230:
736f20a7 9848 case 0x10ec0236:
4344aec8
KY
9849 case 0x10ec0256:
9850 spec->codec_variant = ALC269_TYPE_ALC256;
4a219ef8
KY
9851 spec->shutup = alc256_shutup;
9852 spec->init_hook = alc256_init;
7d1b6e29 9853 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
4344aec8 9854 break;
f429e7e4
KY
9855 case 0x10ec0257:
9856 spec->codec_variant = ALC269_TYPE_ALC257;
88d42b2b
KY
9857 spec->shutup = alc256_shutup;
9858 spec->init_hook = alc256_init;
f429e7e4
KY
9859 spec->gen.mixer_nid = 0;
9860 break;
0a6f0600 9861 case 0x10ec0215:
7fbdcd83 9862 case 0x10ec0245:
0a6f0600
KY
9863 case 0x10ec0285:
9864 case 0x10ec0289:
9865 spec->codec_variant = ALC269_TYPE_ALC215;
1b6832be
KY
9866 spec->shutup = alc225_shutup;
9867 spec->init_hook = alc225_init;
0a6f0600
KY
9868 spec->gen.mixer_nid = 0;
9869 break;
4231430d 9870 case 0x10ec0225:
7d727869 9871 case 0x10ec0295:
28f1f9b2 9872 case 0x10ec0299:
4231430d 9873 spec->codec_variant = ALC269_TYPE_ALC225;
da911b1f
KY
9874 spec->shutup = alc225_shutup;
9875 spec->init_hook = alc225_init;
c1350bff 9876 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
4231430d 9877 break;
99cee034
KY
9878 case 0x10ec0287:
9879 spec->codec_variant = ALC269_TYPE_ALC287;
9880 spec->shutup = alc225_shutup;
9881 spec->init_hook = alc225_init;
9882 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
9883 break;
dcd4f0db
KY
9884 case 0x10ec0234:
9885 case 0x10ec0274:
9886 case 0x10ec0294:
9887 spec->codec_variant = ALC269_TYPE_ALC294;
532a7784 9888 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
71683c32 9889 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
693abe11 9890 spec->init_hook = alc294_init;
dcd4f0db 9891 break;
1078bef0
KY
9892 case 0x10ec0300:
9893 spec->codec_variant = ALC269_TYPE_ALC300;
9894 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
dcd4f0db 9895 break;
f0778871
KY
9896 case 0x10ec0623:
9897 spec->codec_variant = ALC269_TYPE_ALC623;
9898 break;
6fbae35a
KY
9899 case 0x10ec0700:
9900 case 0x10ec0701:
9901 case 0x10ec0703:
83629532 9902 case 0x10ec0711:
6fbae35a
KY
9903 spec->codec_variant = ALC269_TYPE_ALC700;
9904 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
2d7fe618 9905 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
693abe11 9906 spec->init_hook = alc294_init;
6fbae35a
KY
9907 break;
9908
1d045db9 9909 }
6dda9f4a 9910
ad60d502 9911 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
97a26570 9912 spec->has_alc5505_dsp = 1;
ad60d502
KY
9913 spec->init_hook = alc5505_dsp_init;
9914 }
9915
c9af753f
TI
9916 alc_pre_init(codec);
9917
efe55732
TI
9918 snd_hda_pick_fixup(codec, alc269_fixup_models,
9919 alc269_fixup_tbl, alc269_fixups);
13d9c6b9
TI
9920 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
9921 * the quirk breaks the latter (bko#214101).
9922 * Clear the wrong entry.
9923 */
9924 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
9925 codec->core.vendor_id == 0x10ec0294) {
9926 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
9927 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
9928 }
9929
0fc1e447 9930 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
7c0a6939 9931 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
efe55732
TI
9932 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
9933 alc269_fixups);
9934 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9935
9936 alc_auto_parse_customize_define(codec);
9937
9938 if (has_cdefine_beep(codec))
9939 spec->gen.beep_nid = 0x01;
9940
a4297b5d
TI
9941 /* automatic parse from the BIOS config */
9942 err = alc269_parse_auto_config(codec);
e16fb6d1
TI
9943 if (err < 0)
9944 goto error;
6dda9f4a 9945
fea80fae
TI
9946 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
9947 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9948 if (err < 0)
9949 goto error;
9950 }
f1d4e28b 9951
1727a771 9952 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 9953
1d045db9 9954 return 0;
e16fb6d1
TI
9955
9956 error:
9957 alc_free(codec);
9958 return err;
1d045db9 9959}
f1d4e28b 9960
1d045db9
TI
9961/*
9962 * ALC861
9963 */
622e84cd 9964
1d045db9 9965static int alc861_parse_auto_config(struct hda_codec *codec)
6dda9f4a 9966{
1d045db9 9967 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
3e6179b8
TI
9968 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9969 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
604401a9
TI
9970}
9971
1d045db9
TI
9972/* Pin config fixes */
9973enum {
e652f4c8
TI
9974 ALC861_FIXUP_FSC_AMILO_PI1505,
9975 ALC861_FIXUP_AMP_VREF_0F,
9976 ALC861_FIXUP_NO_JACK_DETECT,
9977 ALC861_FIXUP_ASUS_A6RP,
6ddf0fd1 9978 ALC660_FIXUP_ASUS_W7J,
1d045db9 9979};
7085ec12 9980
31150f23
TI
9981/* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9982static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
1727a771 9983 const struct hda_fixup *fix, int action)
31150f23
TI
9984{
9985 struct alc_spec *spec = codec->spec;
9986 unsigned int val;
9987
1727a771 9988 if (action != HDA_FIXUP_ACT_INIT)
31150f23 9989 return;
d3f02d60 9990 val = snd_hda_codec_get_pin_target(codec, 0x0f);
31150f23
TI
9991 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9992 val |= AC_PINCTL_IN_EN;
9993 val |= AC_PINCTL_VREF_50;
cdd03ced 9994 snd_hda_set_pin_ctl(codec, 0x0f, val);
08c189f2 9995 spec->gen.keep_vref_in_automute = 1;
31150f23
TI
9996}
9997
e652f4c8
TI
9998/* suppress the jack-detection */
9999static void alc_fixup_no_jack_detect(struct hda_codec *codec,
1727a771 10000 const struct hda_fixup *fix, int action)
e652f4c8 10001{
1727a771 10002 if (action == HDA_FIXUP_ACT_PRE_PROBE)
e652f4c8 10003 codec->no_jack_detect = 1;
7d7eb9ea 10004}
e652f4c8 10005
1727a771 10006static const struct hda_fixup alc861_fixups[] = {
e652f4c8 10007 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
1727a771
TI
10008 .type = HDA_FIXUP_PINS,
10009 .v.pins = (const struct hda_pintbl[]) {
1d045db9
TI
10010 { 0x0b, 0x0221101f }, /* HP */
10011 { 0x0f, 0x90170310 }, /* speaker */
10012 { }
10013 }
10014 },
e652f4c8 10015 [ALC861_FIXUP_AMP_VREF_0F] = {
1727a771 10016 .type = HDA_FIXUP_FUNC,
31150f23 10017 .v.func = alc861_fixup_asus_amp_vref_0f,
3b25eb69 10018 },
e652f4c8 10019 [ALC861_FIXUP_NO_JACK_DETECT] = {
1727a771 10020 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10021 .v.func = alc_fixup_no_jack_detect,
10022 },
10023 [ALC861_FIXUP_ASUS_A6RP] = {
1727a771 10024 .type = HDA_FIXUP_FUNC,
e652f4c8
TI
10025 .v.func = alc861_fixup_asus_amp_vref_0f,
10026 .chained = true,
10027 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
6ddf0fd1
TI
10028 },
10029 [ALC660_FIXUP_ASUS_W7J] = {
10030 .type = HDA_FIXUP_VERBS,
10031 .v.verbs = (const struct hda_verb[]) {
10032 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10033 * for enabling outputs
10034 */
10035 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10036 { }
10037 },
e652f4c8 10038 }
1d045db9 10039};
7085ec12 10040
1d045db9 10041static const struct snd_pci_quirk alc861_fixup_tbl[] = {
6ddf0fd1 10042 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
e7ca237b 10043 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
e652f4c8
TI
10044 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10045 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10046 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
defce244 10047 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
e652f4c8 10048 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
1d045db9
TI
10049 {}
10050};
3af9ee6b 10051
1d045db9
TI
10052/*
10053 */
1d045db9 10054static int patch_alc861(struct hda_codec *codec)
7085ec12 10055{
1d045db9 10056 struct alc_spec *spec;
1d045db9 10057 int err;
7085ec12 10058
3de95173
TI
10059 err = alc_alloc_spec(codec, 0x15);
10060 if (err < 0)
10061 return err;
1d045db9 10062
3de95173 10063 spec = codec->spec;
2722b535
TI
10064 if (has_cdefine_beep(codec))
10065 spec->gen.beep_nid = 0x23;
1d045db9 10066
225068ab
TI
10067#ifdef CONFIG_PM
10068 spec->power_hook = alc_power_eapd;
10069#endif
10070
c9af753f
TI
10071 alc_pre_init(codec);
10072
1727a771
TI
10073 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10074 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3af9ee6b 10075
cb4e4824
TI
10076 /* automatic parse from the BIOS config */
10077 err = alc861_parse_auto_config(codec);
e16fb6d1
TI
10078 if (err < 0)
10079 goto error;
3af9ee6b 10080
fea80fae
TI
10081 if (!spec->gen.no_analog) {
10082 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10083 if (err < 0)
10084 goto error;
10085 }
7085ec12 10086
1727a771 10087 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10088
1d045db9 10089 return 0;
e16fb6d1
TI
10090
10091 error:
10092 alc_free(codec);
10093 return err;
7085ec12
TI
10094}
10095
1d045db9
TI
10096/*
10097 * ALC861-VD support
10098 *
10099 * Based on ALC882
10100 *
10101 * In addition, an independent DAC
10102 */
1d045db9 10103static int alc861vd_parse_auto_config(struct hda_codec *codec)
bc9f98a9 10104{
1d045db9 10105 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10106 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10107 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
ce764ab2
TI
10108}
10109
1d045db9 10110enum {
8fdcb6fe
TI
10111 ALC660VD_FIX_ASUS_GPIO1,
10112 ALC861VD_FIX_DALLAS,
1d045db9 10113};
ce764ab2 10114
8fdcb6fe
TI
10115/* exclude VREF80 */
10116static void alc861vd_fixup_dallas(struct hda_codec *codec,
1727a771 10117 const struct hda_fixup *fix, int action)
8fdcb6fe 10118{
1727a771 10119 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
b78562b1
TI
10120 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10121 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8fdcb6fe
TI
10122 }
10123}
10124
df73d83f
TI
10125/* reset GPIO1 */
10126static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10127 const struct hda_fixup *fix, int action)
10128{
10129 struct alc_spec *spec = codec->spec;
10130
10131 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10132 spec->gpio_mask |= 0x02;
10133 alc_fixup_gpio(codec, action, 0x01);
10134}
10135
1727a771 10136static const struct hda_fixup alc861vd_fixups[] = {
1d045db9 10137 [ALC660VD_FIX_ASUS_GPIO1] = {
df73d83f
TI
10138 .type = HDA_FIXUP_FUNC,
10139 .v.func = alc660vd_fixup_asus_gpio1,
1d045db9 10140 },
8fdcb6fe 10141 [ALC861VD_FIX_DALLAS] = {
1727a771 10142 .type = HDA_FIXUP_FUNC,
8fdcb6fe
TI
10143 .v.func = alc861vd_fixup_dallas,
10144 },
1d045db9 10145};
ce764ab2 10146
1d045db9 10147static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8fdcb6fe 10148 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
1d045db9 10149 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8fdcb6fe 10150 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
1d045db9
TI
10151 {}
10152};
ce764ab2 10153
1d045db9
TI
10154/*
10155 */
1d045db9 10156static int patch_alc861vd(struct hda_codec *codec)
ce764ab2 10157{
1d045db9 10158 struct alc_spec *spec;
cb4e4824 10159 int err;
ce764ab2 10160
3de95173
TI
10161 err = alc_alloc_spec(codec, 0x0b);
10162 if (err < 0)
10163 return err;
1d045db9 10164
3de95173 10165 spec = codec->spec;
2722b535
TI
10166 if (has_cdefine_beep(codec))
10167 spec->gen.beep_nid = 0x23;
1d045db9 10168
225068ab
TI
10169 spec->shutup = alc_eapd_shutup;
10170
c9af753f
TI
10171 alc_pre_init(codec);
10172
1727a771
TI
10173 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10174 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1d045db9 10175
cb4e4824
TI
10176 /* automatic parse from the BIOS config */
10177 err = alc861vd_parse_auto_config(codec);
e16fb6d1
TI
10178 if (err < 0)
10179 goto error;
ce764ab2 10180
fea80fae
TI
10181 if (!spec->gen.no_analog) {
10182 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10183 if (err < 0)
10184 goto error;
10185 }
1d045db9 10186
1727a771 10187 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 10188
ce764ab2 10189 return 0;
e16fb6d1
TI
10190
10191 error:
10192 alc_free(codec);
10193 return err;
ce764ab2
TI
10194}
10195
1d045db9
TI
10196/*
10197 * ALC662 support
10198 *
10199 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10200 * configuration. Each pin widget can choose any input DACs and a mixer.
10201 * Each ADC is connected from a mixer of all inputs. This makes possible
10202 * 6-channel independent captures.
10203 *
10204 * In addition, an independent DAC for the multi-playback (not used in this
10205 * driver yet).
10206 */
1d045db9
TI
10207
10208/*
10209 * BIOS auto configuration
10210 */
10211
bc9f98a9
KY
10212static int alc662_parse_auto_config(struct hda_codec *codec)
10213{
4c6d72d1 10214 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
3e6179b8
TI
10215 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10216 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10217 const hda_nid_t *ssids;
ee979a14 10218
7639a06c
TI
10219 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10220 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10221 codec->core.vendor_id == 0x10ec0671)
3e6179b8 10222 ssids = alc663_ssids;
6227cdce 10223 else
3e6179b8
TI
10224 ssids = alc662_ssids;
10225 return alc_parse_auto_config(codec, alc662_ignore, ssids);
bc9f98a9
KY
10226}
10227
6be7948f 10228static void alc272_fixup_mario(struct hda_codec *codec,
1727a771 10229 const struct hda_fixup *fix, int action)
6fc398cb 10230{
9bb1f06f 10231 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6fc398cb 10232 return;
6be7948f
TB
10233 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10234 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10235 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10236 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10237 (0 << AC_AMPCAP_MUTE_SHIFT)))
4e76a883 10238 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
6be7948f
TB
10239}
10240
8e383953
TI
10241static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10242 { .channels = 2,
10243 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10244 { .channels = 4,
10245 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10246 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10247 { }
10248};
10249
10250/* override the 2.1 chmap */
eb9ca3ab 10251static void alc_fixup_bass_chmap(struct hda_codec *codec,
8e383953
TI
10252 const struct hda_fixup *fix, int action)
10253{
10254 if (action == HDA_FIXUP_ACT_BUILD) {
10255 struct alc_spec *spec = codec->spec;
bbbc7e85 10256 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8e383953
TI
10257 }
10258}
10259
bf68665d
TI
10260/* avoid D3 for keeping GPIO up */
10261static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10262 hda_nid_t nid,
10263 unsigned int power_state)
10264{
10265 struct alc_spec *spec = codec->spec;
d261eec8 10266 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
bf68665d
TI
10267 return AC_PWRST_D0;
10268 return power_state;
10269}
10270
3e887f37
TI
10271static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10272 const struct hda_fixup *fix, int action)
10273{
10274 struct alc_spec *spec = codec->spec;
3e887f37 10275
01e4a275 10276 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
3e887f37 10277 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
0f32fd19 10278 spec->mute_led_polarity = 1;
bf68665d 10279 codec->power_filter = gpio_led_power_filter;
3e887f37
TI
10280 }
10281}
10282
c6790c8e
KY
10283static void alc662_usi_automute_hook(struct hda_codec *codec,
10284 struct hda_jack_callback *jack)
10285{
10286 struct alc_spec *spec = codec->spec;
10287 int vref;
10288 msleep(200);
10289 snd_hda_gen_hp_automute(codec, jack);
10290
10291 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10292 msleep(100);
10293 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10294 vref);
10295}
10296
10297static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10298 const struct hda_fixup *fix, int action)
10299{
10300 struct alc_spec *spec = codec->spec;
10301 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10302 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10303 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10304 }
10305}
10306
00066e97
SB
10307static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10308 struct hda_jack_callback *cb)
10309{
10310 /* surround speakers at 0x1b already get muted automatically when
10311 * headphones are plugged in, but we have to mute/unmute the remaining
10312 * channels manually:
10313 * 0x15 - front left/front right
10314 * 0x18 - front center/ LFE
10315 */
10316 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10317 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10318 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10319 } else {
10320 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10321 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10322 }
10323}
10324
10325static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10326 const struct hda_fixup *fix, int action)
10327{
10328 /* Pin 0x1b: shared headphones jack and surround speakers */
10329 if (!is_jack_detectable(codec, 0x1b))
10330 return;
10331
10332 switch (action) {
10333 case HDA_FIXUP_ACT_PRE_PROBE:
10334 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10335 alc662_aspire_ethos_mute_speakers);
336820c4
TI
10336 /* subwoofer needs an extra GPIO setting to become audible */
10337 alc_setup_gpio(codec, 0x02);
00066e97
SB
10338 break;
10339 case HDA_FIXUP_ACT_INIT:
10340 /* Make sure to start in a correct state, i.e. if
10341 * headphones have been plugged in before powering up the system
10342 */
10343 alc662_aspire_ethos_mute_speakers(codec, NULL);
10344 break;
10345 }
10346}
10347
5af29028
KY
10348static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10349 const struct hda_fixup *fix, int action)
10350{
10351 struct alc_spec *spec = codec->spec;
10352
10353 static const struct hda_pintbl pincfgs[] = {
10354 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10355 { 0x1b, 0x0181304f },
10356 { }
10357 };
10358
10359 switch (action) {
10360 case HDA_FIXUP_ACT_PRE_PROBE:
10361 spec->gen.mixer_nid = 0;
10362 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10363 snd_hda_apply_pincfgs(codec, pincfgs);
10364 break;
10365 case HDA_FIXUP_ACT_INIT:
10366 alc_write_coef_idx(codec, 0x19, 0xa054);
10367 break;
10368 }
10369}
10370
09ad269c
KY
10371static void alc897_hp_automute_hook(struct hda_codec *codec,
10372 struct hda_jack_callback *jack)
10373{
10374 struct alc_spec *spec = codec->spec;
10375 int vref;
10376
10377 snd_hda_gen_hp_automute(codec, jack);
10378 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10379 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10380 vref);
10381}
10382
10383static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10384 const struct hda_fixup *fix, int action)
10385{
10386 struct alc_spec *spec = codec->spec;
10387 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10388 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10389 }
10390}
10391
6b0f95c4 10392static const struct coef_fw alc668_coefs[] = {
f3f9185f
KY
10393 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10394 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10395 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10396 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10397 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10398 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10399 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10400 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10401 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10402 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10403 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10404 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10405 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10406 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10407 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10408 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10409 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10410 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10411 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10412 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10413 {}
10414};
10415
10416static void alc668_restore_default_value(struct hda_codec *codec)
10417{
10418 alc_process_coef_fw(codec, alc668_coefs);
10419}
10420
6cb3b707 10421enum {
2df03514 10422 ALC662_FIXUP_ASPIRE,
3e887f37 10423 ALC662_FIXUP_LED_GPIO1,
6cb3b707 10424 ALC662_FIXUP_IDEAPAD,
6be7948f 10425 ALC272_FIXUP_MARIO,
f1ec5be1 10426 ALC662_FIXUP_CZC_ET26,
d2ebd479 10427 ALC662_FIXUP_CZC_P10T,
94024cd1 10428 ALC662_FIXUP_SKU_IGNORE,
e59ea3ed 10429 ALC662_FIXUP_HP_RP5800,
53c334ad
TI
10430 ALC662_FIXUP_ASUS_MODE1,
10431 ALC662_FIXUP_ASUS_MODE2,
10432 ALC662_FIXUP_ASUS_MODE3,
10433 ALC662_FIXUP_ASUS_MODE4,
10434 ALC662_FIXUP_ASUS_MODE5,
10435 ALC662_FIXUP_ASUS_MODE6,
10436 ALC662_FIXUP_ASUS_MODE7,
10437 ALC662_FIXUP_ASUS_MODE8,
1565cc35 10438 ALC662_FIXUP_NO_JACK_DETECT,
edfe3bfc 10439 ALC662_FIXUP_ZOTAC_Z68,
125821ae 10440 ALC662_FIXUP_INV_DMIC,
1f8b46cd 10441 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
73bdd597 10442 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 10443 ALC662_FIXUP_HEADSET_MODE,
73bdd597 10444 ALC668_FIXUP_HEADSET_MODE,
8e54b4ac 10445 ALC662_FIXUP_BASS_MODE4_CHMAP,
61a75f13 10446 ALC662_FIXUP_BASS_16,
a30c9aaa 10447 ALC662_FIXUP_BASS_1A,
8e54b4ac 10448 ALC662_FIXUP_BASS_CHMAP,
493a52a9 10449 ALC668_FIXUP_AUTO_MUTE,
5e6db669 10450 ALC668_FIXUP_DELL_DISABLE_AAMIX,
033b0a7c 10451 ALC668_FIXUP_DELL_XPS13,
9d4dc584 10452 ALC662_FIXUP_ASUS_Nx50,
fc7438b1 10453 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 10454 ALC668_FIXUP_ASUS_Nx51,
5b7c5e1f 10455 ALC668_FIXUP_MIC_COEF,
11ba6111 10456 ALC668_FIXUP_ASUS_G751,
78f4f7c2
KY
10457 ALC891_FIXUP_HEADSET_MODE,
10458 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9b51fe3e 10459 ALC662_FIXUP_ACER_VERITON,
1a3f0991 10460 ALC892_FIXUP_ASROCK_MOBO,
c6790c8e
KY
10461 ALC662_FIXUP_USI_FUNC,
10462 ALC662_FIXUP_USI_HEADSET_MODE,
ca169cc2 10463 ALC662_FIXUP_LENOVO_MULTI_CODECS,
00066e97 10464 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
00066e97 10465 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
5af29028 10466 ALC671_FIXUP_HP_HEADSET_MIC2,
d858c706 10467 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
a124458a 10468 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
a3fd1a98
HW
10469 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10470 ALC668_FIXUP_HEADSET_MIC,
10471 ALC668_FIXUP_MIC_DET_COEF,
09ad269c
KY
10472 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10473 ALC897_FIXUP_HEADSET_MIC_PIN,
6cb3b707
DH
10474};
10475
1727a771 10476static const struct hda_fixup alc662_fixups[] = {
2df03514 10477 [ALC662_FIXUP_ASPIRE] = {
1727a771
TI
10478 .type = HDA_FIXUP_PINS,
10479 .v.pins = (const struct hda_pintbl[]) {
2df03514
DC
10480 { 0x15, 0x99130112 }, /* subwoofer */
10481 { }
10482 }
10483 },
3e887f37
TI
10484 [ALC662_FIXUP_LED_GPIO1] = {
10485 .type = HDA_FIXUP_FUNC,
10486 .v.func = alc662_fixup_led_gpio1,
10487 },
6cb3b707 10488 [ALC662_FIXUP_IDEAPAD] = {
1727a771
TI
10489 .type = HDA_FIXUP_PINS,
10490 .v.pins = (const struct hda_pintbl[]) {
6cb3b707
DH
10491 { 0x17, 0x99130112 }, /* subwoofer */
10492 { }
3e887f37
TI
10493 },
10494 .chained = true,
10495 .chain_id = ALC662_FIXUP_LED_GPIO1,
6cb3b707 10496 },
6be7948f 10497 [ALC272_FIXUP_MARIO] = {
1727a771 10498 .type = HDA_FIXUP_FUNC,
b5bfbc67 10499 .v.func = alc272_fixup_mario,
d2ebd479 10500 },
f1ec5be1
HC
10501 [ALC662_FIXUP_CZC_ET26] = {
10502 .type = HDA_FIXUP_PINS,
10503 .v.pins = (const struct hda_pintbl[]) {
10504 {0x12, 0x403cc000},
10505 {0x14, 0x90170110}, /* speaker */
10506 {0x15, 0x411111f0},
10507 {0x16, 0x411111f0},
10508 {0x18, 0x01a19030}, /* mic */
10509 {0x19, 0x90a7013f}, /* int-mic */
10510 {0x1a, 0x01014020},
10511 {0x1b, 0x0121401f},
10512 {0x1c, 0x411111f0},
10513 {0x1d, 0x411111f0},
10514 {0x1e, 0x40478e35},
10515 {}
10516 },
10517 .chained = true,
10518 .chain_id = ALC662_FIXUP_SKU_IGNORE
10519 },
d2ebd479 10520 [ALC662_FIXUP_CZC_P10T] = {
1727a771 10521 .type = HDA_FIXUP_VERBS,
d2ebd479
AA
10522 .v.verbs = (const struct hda_verb[]) {
10523 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10524 {}
10525 }
10526 },
94024cd1 10527 [ALC662_FIXUP_SKU_IGNORE] = {
1727a771 10528 .type = HDA_FIXUP_FUNC,
23d30f28 10529 .v.func = alc_fixup_sku_ignore,
c6b35874 10530 },
e59ea3ed 10531 [ALC662_FIXUP_HP_RP5800] = {
1727a771
TI
10532 .type = HDA_FIXUP_PINS,
10533 .v.pins = (const struct hda_pintbl[]) {
e59ea3ed
TI
10534 { 0x14, 0x0221201f }, /* HP out */
10535 { }
10536 },
10537 .chained = true,
10538 .chain_id = ALC662_FIXUP_SKU_IGNORE
10539 },
53c334ad 10540 [ALC662_FIXUP_ASUS_MODE1] = {
1727a771
TI
10541 .type = HDA_FIXUP_PINS,
10542 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10543 { 0x14, 0x99130110 }, /* speaker */
10544 { 0x18, 0x01a19c20 }, /* mic */
10545 { 0x19, 0x99a3092f }, /* int-mic */
10546 { 0x21, 0x0121401f }, /* HP out */
10547 { }
10548 },
10549 .chained = true,
10550 .chain_id = ALC662_FIXUP_SKU_IGNORE
10551 },
10552 [ALC662_FIXUP_ASUS_MODE2] = {
1727a771
TI
10553 .type = HDA_FIXUP_PINS,
10554 .v.pins = (const struct hda_pintbl[]) {
2996bdba
TI
10555 { 0x14, 0x99130110 }, /* speaker */
10556 { 0x18, 0x01a19820 }, /* mic */
10557 { 0x19, 0x99a3092f }, /* int-mic */
10558 { 0x1b, 0x0121401f }, /* HP out */
10559 { }
10560 },
53c334ad
TI
10561 .chained = true,
10562 .chain_id = ALC662_FIXUP_SKU_IGNORE
10563 },
10564 [ALC662_FIXUP_ASUS_MODE3] = {
1727a771
TI
10565 .type = HDA_FIXUP_PINS,
10566 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10567 { 0x14, 0x99130110 }, /* speaker */
10568 { 0x15, 0x0121441f }, /* HP */
10569 { 0x18, 0x01a19840 }, /* mic */
10570 { 0x19, 0x99a3094f }, /* int-mic */
10571 { 0x21, 0x01211420 }, /* HP2 */
10572 { }
10573 },
10574 .chained = true,
10575 .chain_id = ALC662_FIXUP_SKU_IGNORE
10576 },
10577 [ALC662_FIXUP_ASUS_MODE4] = {
1727a771
TI
10578 .type = HDA_FIXUP_PINS,
10579 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10580 { 0x14, 0x99130110 }, /* speaker */
10581 { 0x16, 0x99130111 }, /* speaker */
10582 { 0x18, 0x01a19840 }, /* mic */
10583 { 0x19, 0x99a3094f }, /* int-mic */
10584 { 0x21, 0x0121441f }, /* HP */
10585 { }
10586 },
10587 .chained = true,
10588 .chain_id = ALC662_FIXUP_SKU_IGNORE
10589 },
10590 [ALC662_FIXUP_ASUS_MODE5] = {
1727a771
TI
10591 .type = HDA_FIXUP_PINS,
10592 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10593 { 0x14, 0x99130110 }, /* speaker */
10594 { 0x15, 0x0121441f }, /* HP */
10595 { 0x16, 0x99130111 }, /* speaker */
10596 { 0x18, 0x01a19840 }, /* mic */
10597 { 0x19, 0x99a3094f }, /* int-mic */
10598 { }
10599 },
10600 .chained = true,
10601 .chain_id = ALC662_FIXUP_SKU_IGNORE
10602 },
10603 [ALC662_FIXUP_ASUS_MODE6] = {
1727a771
TI
10604 .type = HDA_FIXUP_PINS,
10605 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10606 { 0x14, 0x99130110 }, /* speaker */
10607 { 0x15, 0x01211420 }, /* HP2 */
10608 { 0x18, 0x01a19840 }, /* mic */
10609 { 0x19, 0x99a3094f }, /* int-mic */
10610 { 0x1b, 0x0121441f }, /* HP */
10611 { }
10612 },
10613 .chained = true,
10614 .chain_id = ALC662_FIXUP_SKU_IGNORE
10615 },
10616 [ALC662_FIXUP_ASUS_MODE7] = {
1727a771
TI
10617 .type = HDA_FIXUP_PINS,
10618 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10619 { 0x14, 0x99130110 }, /* speaker */
10620 { 0x17, 0x99130111 }, /* speaker */
10621 { 0x18, 0x01a19840 }, /* mic */
10622 { 0x19, 0x99a3094f }, /* int-mic */
10623 { 0x1b, 0x01214020 }, /* HP */
10624 { 0x21, 0x0121401f }, /* HP */
10625 { }
10626 },
10627 .chained = true,
10628 .chain_id = ALC662_FIXUP_SKU_IGNORE
10629 },
10630 [ALC662_FIXUP_ASUS_MODE8] = {
1727a771
TI
10631 .type = HDA_FIXUP_PINS,
10632 .v.pins = (const struct hda_pintbl[]) {
53c334ad
TI
10633 { 0x14, 0x99130110 }, /* speaker */
10634 { 0x12, 0x99a30970 }, /* int-mic */
10635 { 0x15, 0x01214020 }, /* HP */
10636 { 0x17, 0x99130111 }, /* speaker */
10637 { 0x18, 0x01a19840 }, /* mic */
10638 { 0x21, 0x0121401f }, /* HP */
10639 { }
10640 },
10641 .chained = true,
10642 .chain_id = ALC662_FIXUP_SKU_IGNORE
2996bdba 10643 },
1565cc35 10644 [ALC662_FIXUP_NO_JACK_DETECT] = {
1727a771 10645 .type = HDA_FIXUP_FUNC,
1565cc35
TI
10646 .v.func = alc_fixup_no_jack_detect,
10647 },
edfe3bfc 10648 [ALC662_FIXUP_ZOTAC_Z68] = {
1727a771
TI
10649 .type = HDA_FIXUP_PINS,
10650 .v.pins = (const struct hda_pintbl[]) {
edfe3bfc
DH
10651 { 0x1b, 0x02214020 }, /* Front HP */
10652 { }
10653 }
10654 },
125821ae 10655 [ALC662_FIXUP_INV_DMIC] = {
1727a771 10656 .type = HDA_FIXUP_FUNC,
9d36a7dc 10657 .v.func = alc_fixup_inv_dmic,
125821ae 10658 },
033b0a7c
GM
10659 [ALC668_FIXUP_DELL_XPS13] = {
10660 .type = HDA_FIXUP_FUNC,
10661 .v.func = alc_fixup_dell_xps13,
10662 .chained = true,
10663 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10664 },
5e6db669
GM
10665 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10666 .type = HDA_FIXUP_FUNC,
10667 .v.func = alc_fixup_disable_aamix,
10668 .chained = true,
10669 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10670 },
493a52a9
HW
10671 [ALC668_FIXUP_AUTO_MUTE] = {
10672 .type = HDA_FIXUP_FUNC,
10673 .v.func = alc_fixup_auto_mute_via_amp,
10674 .chained = true,
10675 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10676 },
1f8b46cd
DH
10677 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10678 .type = HDA_FIXUP_PINS,
10679 .v.pins = (const struct hda_pintbl[]) {
10680 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10681 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10682 { }
10683 },
10684 .chained = true,
10685 .chain_id = ALC662_FIXUP_HEADSET_MODE
10686 },
10687 [ALC662_FIXUP_HEADSET_MODE] = {
10688 .type = HDA_FIXUP_FUNC,
10689 .v.func = alc_fixup_headset_mode_alc662,
10690 },
73bdd597
DH
10691 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10692 .type = HDA_FIXUP_PINS,
10693 .v.pins = (const struct hda_pintbl[]) {
10694 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10695 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10696 { }
10697 },
10698 .chained = true,
10699 .chain_id = ALC668_FIXUP_HEADSET_MODE
10700 },
10701 [ALC668_FIXUP_HEADSET_MODE] = {
10702 .type = HDA_FIXUP_FUNC,
10703 .v.func = alc_fixup_headset_mode_alc668,
10704 },
8e54b4ac 10705 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8e383953 10706 .type = HDA_FIXUP_FUNC,
eb9ca3ab 10707 .v.func = alc_fixup_bass_chmap,
8e383953
TI
10708 .chained = true,
10709 .chain_id = ALC662_FIXUP_ASUS_MODE4
10710 },
61a75f13
DH
10711 [ALC662_FIXUP_BASS_16] = {
10712 .type = HDA_FIXUP_PINS,
10713 .v.pins = (const struct hda_pintbl[]) {
10714 {0x16, 0x80106111}, /* bass speaker */
10715 {}
10716 },
10717 .chained = true,
10718 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10719 },
a30c9aaa
TI
10720 [ALC662_FIXUP_BASS_1A] = {
10721 .type = HDA_FIXUP_PINS,
10722 .v.pins = (const struct hda_pintbl[]) {
10723 {0x1a, 0x80106111}, /* bass speaker */
10724 {}
10725 },
8e54b4ac
DH
10726 .chained = true,
10727 .chain_id = ALC662_FIXUP_BASS_CHMAP,
a30c9aaa 10728 },
8e54b4ac 10729 [ALC662_FIXUP_BASS_CHMAP] = {
a30c9aaa 10730 .type = HDA_FIXUP_FUNC,
eb9ca3ab 10731 .v.func = alc_fixup_bass_chmap,
a30c9aaa 10732 },
9d4dc584
BM
10733 [ALC662_FIXUP_ASUS_Nx50] = {
10734 .type = HDA_FIXUP_FUNC,
10735 .v.func = alc_fixup_auto_mute_via_amp,
10736 .chained = true,
10737 .chain_id = ALC662_FIXUP_BASS_1A
10738 },
fc7438b1
MP
10739 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10740 .type = HDA_FIXUP_FUNC,
10741 .v.func = alc_fixup_headset_mode_alc668,
10742 .chain_id = ALC662_FIXUP_BASS_CHMAP
10743 },
3231e205
YP
10744 [ALC668_FIXUP_ASUS_Nx51] = {
10745 .type = HDA_FIXUP_PINS,
10746 .v.pins = (const struct hda_pintbl[]) {
fc7438b1
MP
10747 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10748 { 0x1a, 0x90170151 }, /* bass speaker */
10749 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
3231e205
YP
10750 {}
10751 },
10752 .chained = true,
fc7438b1 10753 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
3231e205 10754 },
5b7c5e1f 10755 [ALC668_FIXUP_MIC_COEF] = {
11ba6111
TI
10756 .type = HDA_FIXUP_VERBS,
10757 .v.verbs = (const struct hda_verb[]) {
10758 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10759 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10760 {}
10761 },
10762 },
5b7c5e1f
TI
10763 [ALC668_FIXUP_ASUS_G751] = {
10764 .type = HDA_FIXUP_PINS,
10765 .v.pins = (const struct hda_pintbl[]) {
10766 { 0x16, 0x0421101f }, /* HP */
10767 {}
10768 },
10769 .chained = true,
10770 .chain_id = ALC668_FIXUP_MIC_COEF
10771 },
78f4f7c2
KY
10772 [ALC891_FIXUP_HEADSET_MODE] = {
10773 .type = HDA_FIXUP_FUNC,
10774 .v.func = alc_fixup_headset_mode,
10775 },
10776 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10777 .type = HDA_FIXUP_PINS,
10778 .v.pins = (const struct hda_pintbl[]) {
10779 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10780 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10781 { }
10782 },
10783 .chained = true,
10784 .chain_id = ALC891_FIXUP_HEADSET_MODE
10785 },
9b51fe3e
SB
10786 [ALC662_FIXUP_ACER_VERITON] = {
10787 .type = HDA_FIXUP_PINS,
10788 .v.pins = (const struct hda_pintbl[]) {
10789 { 0x15, 0x50170120 }, /* no internal speaker */
10790 { }
10791 }
10792 },
1a3f0991
TI
10793 [ALC892_FIXUP_ASROCK_MOBO] = {
10794 .type = HDA_FIXUP_PINS,
10795 .v.pins = (const struct hda_pintbl[]) {
10796 { 0x15, 0x40f000f0 }, /* disabled */
10797 { 0x16, 0x40f000f0 }, /* disabled */
1a3f0991
TI
10798 { }
10799 }
10800 },
c6790c8e
KY
10801 [ALC662_FIXUP_USI_FUNC] = {
10802 .type = HDA_FIXUP_FUNC,
10803 .v.func = alc662_fixup_usi_headset_mic,
10804 },
10805 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10806 .type = HDA_FIXUP_PINS,
10807 .v.pins = (const struct hda_pintbl[]) {
10808 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10809 { 0x18, 0x01a1903d },
10810 { }
10811 },
10812 .chained = true,
10813 .chain_id = ALC662_FIXUP_USI_FUNC
10814 },
ca169cc2
KY
10815 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10816 .type = HDA_FIXUP_FUNC,
10817 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10818 },
00066e97
SB
10819 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10820 .type = HDA_FIXUP_FUNC,
10821 .v.func = alc662_fixup_aspire_ethos_hp,
10822 },
00066e97
SB
10823 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10824 .type = HDA_FIXUP_PINS,
10825 .v.pins = (const struct hda_pintbl[]) {
10826 { 0x15, 0x92130110 }, /* front speakers */
10827 { 0x18, 0x99130111 }, /* center/subwoofer */
10828 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10829 { }
10830 },
10831 .chained = true,
336820c4 10832 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
00066e97 10833 },
5af29028
KY
10834 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10835 .type = HDA_FIXUP_FUNC,
10836 .v.func = alc671_fixup_hp_headset_mic2,
10837 },
d858c706
JHP
10838 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10839 .type = HDA_FIXUP_PINS,
10840 .v.pins = (const struct hda_pintbl[]) {
10841 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10842 { }
10843 },
10844 .chained = true,
10845 .chain_id = ALC662_FIXUP_USI_FUNC
10846 },
a124458a
JHP
10847 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10848 .type = HDA_FIXUP_PINS,
10849 .v.pins = (const struct hda_pintbl[]) {
10850 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10851 { 0x1b, 0x0221144f },
10852 { }
10853 },
10854 .chained = true,
10855 .chain_id = ALC662_FIXUP_USI_FUNC
10856 },
a3fd1a98
HW
10857 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
10858 .type = HDA_FIXUP_PINS,
10859 .v.pins = (const struct hda_pintbl[]) {
10860 { 0x1b, 0x04a1112c },
10861 { }
10862 },
10863 .chained = true,
10864 .chain_id = ALC668_FIXUP_HEADSET_MIC
10865 },
10866 [ALC668_FIXUP_HEADSET_MIC] = {
10867 .type = HDA_FIXUP_FUNC,
10868 .v.func = alc269_fixup_headset_mic,
10869 .chained = true,
10870 .chain_id = ALC668_FIXUP_MIC_DET_COEF
10871 },
10872 [ALC668_FIXUP_MIC_DET_COEF] = {
10873 .type = HDA_FIXUP_VERBS,
10874 .v.verbs = (const struct hda_verb[]) {
10875 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
10876 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
10877 {}
10878 },
10879 },
09ad269c
KY
10880 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
10881 .type = HDA_FIXUP_FUNC,
10882 .v.func = alc897_fixup_lenovo_headset_mic,
10883 },
10884 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
10885 .type = HDA_FIXUP_PINS,
10886 .v.pins = (const struct hda_pintbl[]) {
10887 { 0x1a, 0x03a11050 },
10888 { }
10889 },
10890 .chained = true,
10891 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
10892 },
6cb3b707
DH
10893};
10894
a9111321 10895static const struct snd_pci_quirk alc662_fixup_tbl[] = {
53c334ad 10896 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
d3d3835c 10897 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
02f6ff90 10898 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
a6c47a85 10899 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
94024cd1 10900 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
125821ae 10901 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
1801928e 10902 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
2df03514 10903 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9edeb110 10904 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
a124458a 10905 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
d858c706 10906 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
73bdd597
DH
10907 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10908 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
c5d019c3 10909 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
033b0a7c 10910 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
467e1436 10911 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
09d2014f 10912 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
ad8ff99e 10913 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8dc9abb9
KY
10914 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10915 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
6a98e34b 10916 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
e59ea3ed 10917 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
148ebf54 10918 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
85580b4a 10919 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
2da2dc9e 10920 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
83a9efb5 10921 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9d4dc584 10922 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11ba6111 10923 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9edeb110 10924 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8e54b4ac 10925 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
61a75f13 10926 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
3231e205
YP
10927 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
10928 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
a3fd1a98 10929 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
c7efff92 10930 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
61a75f13 10931 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8e54b4ac 10932 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
1565cc35 10933 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
53c334ad 10934 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
a0e90acc 10935 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
c6790c8e 10936 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
ca169cc2 10937 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
09ad269c
KY
10938 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
10939 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
10940 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
10941 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
d4118588 10942 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
6cb3b707 10943 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
1a3f0991 10944 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
edfe3bfc 10945 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9b51fe3e 10946 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
f1ec5be1 10947 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
d2ebd479 10948 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
53c334ad
TI
10949
10950#if 0
10951 /* Below is a quirk table taken from the old code.
10952 * Basically the device should work as is without the fixup table.
10953 * If BIOS doesn't give a proper info, enable the corresponding
10954 * fixup entry.
7d7eb9ea 10955 */
53c334ad
TI
10956 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
10957 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
10958 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
10959 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
10960 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10961 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10962 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10963 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
10964 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
10965 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10966 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
10967 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
10968 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
10969 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
10970 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
10971 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10972 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
10973 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
10974 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10975 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10976 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10977 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10978 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
10979 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
10980 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
10981 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10982 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
10983 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10984 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10985 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
10986 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10987 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10988 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
10989 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
10990 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
10991 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
10992 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
10993 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
10994 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
10995 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10996 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
10997 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
10998 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10999 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11000 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11001 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11002 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11003 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11004 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11005 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11006#endif
6cb3b707
DH
11007 {}
11008};
11009
1727a771 11010static const struct hda_model_fixup alc662_fixup_models[] = {
aa3841b5
TI
11011 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11012 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
6be7948f 11013 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
aa3841b5 11014 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
53c334ad
TI
11015 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11016 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11017 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11018 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11019 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11020 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11021 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11022 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
aa3841b5 11023 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
6e72aa5f 11024 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
aa3841b5 11025 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
e32aa85a 11026 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
aa3841b5
TI
11027 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11028 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11029 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11030 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11031 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11032 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11033 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11034 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
40c51675 11035 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
aa3841b5
TI
11036 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11037 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11038 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11039 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11040 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
ba90d6a6 11041 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
00066e97 11042 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
6be7948f
TB
11043 {}
11044};
6cb3b707 11045
532895c5 11046static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
78f4f7c2
KY
11047 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11048 {0x17, 0x02211010},
11049 {0x18, 0x01a19030},
11050 {0x1a, 0x01813040},
11051 {0x21, 0x01014020}),
4b4e0e32
HW
11052 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11053 {0x16, 0x01813030},
11054 {0x17, 0x02211010},
11055 {0x18, 0x01a19040},
11056 {0x21, 0x01014020}),
1f8b46cd 11057 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
1f8b46cd 11058 {0x14, 0x01014010},
1f8b46cd 11059 {0x18, 0x01a19020},
1f8b46cd 11060 {0x1a, 0x0181302f},
11580297 11061 {0x1b, 0x0221401f}),
76c2132e
DH
11062 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11063 {0x12, 0x99a30130},
11064 {0x14, 0x90170110},
11065 {0x15, 0x0321101f},
11580297 11066 {0x16, 0x03011020}),
76c2132e
DH
11067 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11068 {0x12, 0x99a30140},
11069 {0x14, 0x90170110},
11070 {0x15, 0x0321101f},
11580297 11071 {0x16, 0x03011020}),
76c2132e
DH
11072 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11073 {0x12, 0x99a30150},
11074 {0x14, 0x90170110},
11075 {0x15, 0x0321101f},
11580297 11076 {0x16, 0x03011020}),
76c2132e 11077 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
76c2132e
DH
11078 {0x14, 0x90170110},
11079 {0x15, 0x0321101f},
11580297 11080 {0x16, 0x03011020}),
76c2132e
DH
11081 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11082 {0x12, 0x90a60130},
11083 {0x14, 0x90170110},
11580297 11084 {0x15, 0x0321101f}),
5af29028
KY
11085 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11086 {0x14, 0x01014010},
11087 {0x17, 0x90170150},
f2adbae0 11088 {0x19, 0x02a11060},
5af29028
KY
11089 {0x1b, 0x01813030},
11090 {0x21, 0x02211020}),
11091 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11092 {0x14, 0x01014010},
11093 {0x18, 0x01a19040},
11094 {0x1b, 0x01813030},
11095 {0x21, 0x02211020}),
11096 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11097 {0x14, 0x01014020},
11098 {0x17, 0x90170110},
11099 {0x18, 0x01a19050},
11100 {0x1b, 0x01813040},
11101 {0x21, 0x02211030}),
532895c5
HW
11102 {}
11103};
11104
1d045db9
TI
11105/*
11106 */
bc9f98a9
KY
11107static int patch_alc662(struct hda_codec *codec)
11108{
11109 struct alc_spec *spec;
3de95173 11110 int err;
bc9f98a9 11111
3de95173
TI
11112 err = alc_alloc_spec(codec, 0x0b);
11113 if (err < 0)
11114 return err;
bc9f98a9 11115
3de95173 11116 spec = codec->spec;
1f0f4b80 11117
225068ab
TI
11118 spec->shutup = alc_eapd_shutup;
11119
53c334ad
TI
11120 /* handle multiple HPs as is */
11121 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11122
2c3bf9ab
TI
11123 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11124
7639a06c 11125 switch (codec->core.vendor_id) {
f3f9185f
KY
11126 case 0x10ec0668:
11127 spec->init_hook = alc668_restore_default_value;
11128 break;
f3f9185f 11129 }
8663ff75 11130
c9af753f
TI
11131 alc_pre_init(codec);
11132
1727a771 11133 snd_hda_pick_fixup(codec, alc662_fixup_models,
8e5a0509 11134 alc662_fixup_tbl, alc662_fixups);
0fc1e447 11135 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
1727a771 11136 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8e5a0509
TI
11137
11138 alc_auto_parse_customize_define(codec);
11139
7504b6cd
TI
11140 if (has_cdefine_beep(codec))
11141 spec->gen.beep_nid = 0x01;
11142
1bb7e43e 11143 if ((alc_get_coef0(codec) & (1 << 14)) &&
5100cd07 11144 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
e16fb6d1 11145 spec->cdefine.platform_type == 1) {
6134b1a2
WY
11146 err = alc_codec_rename(codec, "ALC272X");
11147 if (err < 0)
e16fb6d1 11148 goto error;
20ca0c35 11149 }
274693f3 11150
b9c5106c
TI
11151 /* automatic parse from the BIOS config */
11152 err = alc662_parse_auto_config(codec);
e16fb6d1
TI
11153 if (err < 0)
11154 goto error;
bc9f98a9 11155
7504b6cd 11156 if (!spec->gen.no_analog && spec->gen.beep_nid) {
7639a06c 11157 switch (codec->core.vendor_id) {
da00c244 11158 case 0x10ec0662:
fea80fae 11159 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
da00c244
KY
11160 break;
11161 case 0x10ec0272:
11162 case 0x10ec0663:
11163 case 0x10ec0665:
9ad54547 11164 case 0x10ec0668:
fea80fae 11165 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
da00c244
KY
11166 break;
11167 case 0x10ec0273:
fea80fae 11168 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
da00c244
KY
11169 break;
11170 }
fea80fae
TI
11171 if (err < 0)
11172 goto error;
cec27c89 11173 }
2134ea4f 11174
1727a771 11175 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
589876e2 11176
bc9f98a9 11177 return 0;
801f49d3 11178
e16fb6d1
TI
11179 error:
11180 alc_free(codec);
11181 return err;
b478b998
KY
11182}
11183
d1eb57f4
KY
11184/*
11185 * ALC680 support
11186 */
d1eb57f4 11187
d1eb57f4
KY
11188static int alc680_parse_auto_config(struct hda_codec *codec)
11189{
3e6179b8 11190 return alc_parse_auto_config(codec, NULL, NULL);
d1eb57f4
KY
11191}
11192
d1eb57f4 11193/*
d1eb57f4 11194 */
d1eb57f4
KY
11195static int patch_alc680(struct hda_codec *codec)
11196{
d1eb57f4
KY
11197 int err;
11198
1f0f4b80 11199 /* ALC680 has no aa-loopback mixer */
3de95173
TI
11200 err = alc_alloc_spec(codec, 0);
11201 if (err < 0)
11202 return err;
1f0f4b80 11203
1ebec5f2
TI
11204 /* automatic parse from the BIOS config */
11205 err = alc680_parse_auto_config(codec);
11206 if (err < 0) {
11207 alc_free(codec);
11208 return err;
d1eb57f4
KY
11209 }
11210
d1eb57f4
KY
11211 return 0;
11212}
11213
1da177e4
LT
11214/*
11215 * patch entries
11216 */
b9a94a9c 11217static const struct hda_device_id snd_hda_id_realtek[] = {
0a6f0600 11218 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
b9a94a9c 11219 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
2a36c16e 11220 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
4231430d 11221 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
1948fc06 11222 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
b9a94a9c
TI
11223 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11224 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
dcd4f0db 11225 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
b9a94a9c 11226 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
736f20a7 11227 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
7fbdcd83 11228 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
b9a94a9c
TI
11229 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11230 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
f429e7e4 11231 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
b9a94a9c
TI
11232 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11233 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11234 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11235 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11236 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11237 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11238 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
dcd4f0db 11239 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
b9a94a9c
TI
11240 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11241 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11242 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11243 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11244 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11245 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
0a6f0600 11246 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
b9a94a9c 11247 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
630e3612 11248 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
b9a94a9c 11249 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
0a6f0600 11250 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
b9a94a9c
TI
11251 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11252 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11253 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
dcd4f0db 11254 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
7d727869 11255 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
b9a94a9c 11256 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
28f1f9b2 11257 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
1078bef0 11258 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
f0778871 11259 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
b9a94a9c
TI
11260 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11261 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11262 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11263 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11264 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11265 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11266 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11267 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11268 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11269 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11270 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11271 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11272 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11273 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
6fbae35a
KY
11274 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11275 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11276 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
83629532 11277 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
78f4f7c2 11278 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
b9a94a9c
TI
11279 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11280 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11281 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11282 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11283 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11284 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11285 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11286 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11287 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11288 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11289 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
e5782a5d 11290 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
b9a94a9c
TI
11291 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11292 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
6d9ffcff 11293 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
65553b12 11294 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
a535ad57 11295 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
1da177e4
LT
11296 {} /* terminator */
11297};
b9a94a9c 11298MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
1289e9e8
TI
11299
11300MODULE_LICENSE("GPL");
11301MODULE_DESCRIPTION("Realtek HD-audio codec");
11302
d8a766a1 11303static struct hda_codec_driver realtek_driver = {
b9a94a9c 11304 .id = snd_hda_id_realtek,
1289e9e8
TI
11305};
11306
d8a766a1 11307module_hda_codec_driver(realtek_driver);