1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
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;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine;
82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
88 bool gpio_write_delay; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity;
92 int micmute_led_polarity;
93 hda_nid_t mute_led_nid;
94 hda_nid_t cap_mute_led_nid;
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
101 hda_nid_t headset_mic_pin;
102 hda_nid_t headphone_mic_pin;
103 int current_headset_mode;
104 int current_headset_type;
107 void (*init_hook)(struct hda_codec *codec);
109 void (*power_hook)(struct hda_codec *codec);
111 void (*shutup)(struct hda_codec *codec);
114 int codec_variant; /* flag for other variants */
115 unsigned int has_alc5505_dsp:1;
116 unsigned int no_depop_delay:1;
117 unsigned int done_hp_init:1;
118 unsigned int no_shutup_pins:1;
119 unsigned int ultra_low_power:1;
120 unsigned int has_hs_key:1;
121 unsigned int no_internal_mic_pin:1;
125 unsigned int pll_coef_idx, pll_coef_bit;
127 struct input_dev *kb_dev;
128 u8 alc_mute_keycode_map[1];
132 * COEF access helper functions
135 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
136 unsigned int coef_idx)
140 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
141 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
145 #define alc_read_coef_idx(codec, coef_idx) \
146 alc_read_coefex_idx(codec, 0x20, coef_idx)
148 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
149 unsigned int coef_idx, unsigned int coef_val)
151 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
152 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
155 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
156 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
158 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
159 unsigned int coef_idx, unsigned int mask,
160 unsigned int bits_set)
162 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
165 alc_write_coefex_idx(codec, nid, coef_idx,
166 (val & ~mask) | bits_set);
169 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
170 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
172 /* a special bypass for COEF 0; read the cached value at the second time */
173 static unsigned int alc_get_coef0(struct hda_codec *codec)
175 struct alc_spec *spec = codec->spec;
178 spec->coef0 = alc_read_coef_idx(codec, 0);
182 /* coef writes/updates batch */
190 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
191 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
192 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
193 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
194 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
196 static void alc_process_coef_fw(struct hda_codec *codec,
197 const struct coef_fw *fw)
199 for (; fw->nid; fw++) {
200 if (fw->mask == (unsigned short)-1)
201 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
203 alc_update_coefex_idx(codec, fw->nid, fw->idx,
209 * GPIO setup tables, used in initialization
212 /* Enable GPIO mask and set output */
213 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
215 struct alc_spec *spec = codec->spec;
217 spec->gpio_mask |= mask;
218 spec->gpio_dir |= mask;
219 spec->gpio_data |= mask;
222 static void alc_write_gpio_data(struct hda_codec *codec)
224 struct alc_spec *spec = codec->spec;
226 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
230 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
233 struct alc_spec *spec = codec->spec;
234 unsigned int oldval = spec->gpio_data;
237 spec->gpio_data |= mask;
239 spec->gpio_data &= ~mask;
240 if (oldval != spec->gpio_data)
241 alc_write_gpio_data(codec);
244 static void alc_write_gpio(struct hda_codec *codec)
246 struct alc_spec *spec = codec->spec;
248 if (!spec->gpio_mask)
251 snd_hda_codec_write(codec, codec->core.afg, 0,
252 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
253 snd_hda_codec_write(codec, codec->core.afg, 0,
254 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
255 if (spec->gpio_write_delay)
257 alc_write_gpio_data(codec);
260 static void alc_fixup_gpio(struct hda_codec *codec, int action,
263 if (action == HDA_FIXUP_ACT_PRE_PROBE)
264 alc_setup_gpio(codec, mask);
267 static void alc_fixup_gpio1(struct hda_codec *codec,
268 const struct hda_fixup *fix, int action)
270 alc_fixup_gpio(codec, action, 0x01);
273 static void alc_fixup_gpio2(struct hda_codec *codec,
274 const struct hda_fixup *fix, int action)
276 alc_fixup_gpio(codec, action, 0x02);
279 static void alc_fixup_gpio3(struct hda_codec *codec,
280 const struct hda_fixup *fix, int action)
282 alc_fixup_gpio(codec, action, 0x03);
285 static void alc_fixup_gpio4(struct hda_codec *codec,
286 const struct hda_fixup *fix, int action)
288 alc_fixup_gpio(codec, action, 0x04);
291 static void alc_fixup_micmute_led(struct hda_codec *codec,
292 const struct hda_fixup *fix, int action)
294 if (action == HDA_FIXUP_ACT_PRE_PROBE)
295 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
299 * Fix hardware PLL issue
300 * On some codecs, the analog PLL gating control must be off while
301 * the default value is 1.
303 static void alc_fix_pll(struct hda_codec *codec)
305 struct alc_spec *spec = codec->spec;
308 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
309 1 << spec->pll_coef_bit, 0);
312 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
313 unsigned int coef_idx, unsigned int coef_bit)
315 struct alc_spec *spec = codec->spec;
317 spec->pll_coef_idx = coef_idx;
318 spec->pll_coef_bit = coef_bit;
322 /* update the master volume per volume-knob's unsol event */
323 static void alc_update_knob_master(struct hda_codec *codec,
324 struct hda_jack_callback *jack)
327 struct snd_kcontrol *kctl;
328 struct snd_ctl_elem_value *uctl;
330 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
333 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
336 val = snd_hda_codec_read(codec, jack->nid, 0,
337 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
338 val &= HDA_AMP_VOLMASK;
339 uctl->value.integer.value[0] = val;
340 uctl->value.integer.value[1] = val;
341 kctl->put(kctl, uctl);
345 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
347 /* For some reason, the res given from ALC880 is broken.
348 Here we adjust it properly. */
349 snd_hda_jack_unsol_event(codec, res >> 2);
352 /* Change EAPD to verb control */
353 static void alc_fill_eapd_coef(struct hda_codec *codec)
357 coef = alc_get_coef0(codec);
359 switch (codec->core.vendor_id) {
361 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
365 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
368 if ((coef & 0x00f0) == 0x0010)
369 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
370 if ((coef & 0x00f0) == 0x0020)
371 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
372 if ((coef & 0x00f0) == 0x0030)
373 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
379 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
384 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
403 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
406 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
409 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
410 alc_write_coef_idx(codec, 0x8, 0x4ab7);
413 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
422 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
425 if ((coef & 0x00f0) == 0x0030)
426 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
435 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
439 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
442 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
445 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
448 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
449 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
453 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
460 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
465 /* additional initialization for ALC888 variants */
466 static void alc888_coef_init(struct hda_codec *codec)
468 switch (alc_get_coef0(codec) & 0x00f0) {
473 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
478 /* turn on/off EAPD control (only if available) */
479 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
481 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
483 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
484 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
488 /* turn on/off EAPD controls of the codec */
489 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
491 /* We currently only handle front, HP */
492 static const hda_nid_t pins[] = {
493 0x0f, 0x10, 0x14, 0x15, 0x17, 0
496 for (p = pins; *p; p++)
497 set_eapd(codec, *p, on);
500 static int find_ext_mic_pin(struct hda_codec *codec);
502 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
504 const struct hda_pincfg *pin;
505 int mic_pin = find_ext_mic_pin(codec);
508 /* don't shut up pins when unloading the driver; otherwise it breaks
509 * the default pin setup at the next load of the driver
511 if (codec->bus->shutdown)
514 snd_array_for_each(&codec->init_pins, i, pin) {
515 /* use read here for syncing after issuing each verb */
516 if (pin->nid != mic_pin)
517 snd_hda_codec_read(codec, pin->nid, 0,
518 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
521 codec->pins_shutup = 1;
524 static void alc_shutup_pins(struct hda_codec *codec)
526 struct alc_spec *spec = codec->spec;
528 switch (codec->core.vendor_id) {
533 alc_headset_mic_no_shutup(codec);
536 if (!spec->no_shutup_pins)
537 snd_hda_shutup_pins(codec);
542 /* generic shutup callback;
543 * just turning off EAPD and a little pause for avoiding pop-noise
545 static void alc_eapd_shutup(struct hda_codec *codec)
547 struct alc_spec *spec = codec->spec;
549 alc_auto_setup_eapd(codec, false);
550 if (!spec->no_depop_delay)
552 alc_shutup_pins(codec);
555 /* generic EAPD initialization */
556 static void alc_auto_init_amp(struct hda_codec *codec, int type)
558 alc_auto_setup_eapd(codec, true);
559 alc_write_gpio(codec);
561 case ALC_INIT_DEFAULT:
562 switch (codec->core.vendor_id) {
564 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
570 alc_update_coef_idx(codec, 7, 0, 0x2030);
573 alc888_coef_init(codec);
580 /* get a primary headphone pin if available */
581 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
583 if (spec->gen.autocfg.hp_pins[0])
584 return spec->gen.autocfg.hp_pins[0];
585 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
586 return spec->gen.autocfg.line_out_pins[0];
591 * Realtek SSID verification
594 /* Could be any non-zero and even value. When used as fixup, tells
595 * the driver to ignore any present sku defines.
597 #define ALC_FIXUP_SKU_IGNORE (2)
599 static void alc_fixup_sku_ignore(struct hda_codec *codec,
600 const struct hda_fixup *fix, int action)
602 struct alc_spec *spec = codec->spec;
603 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
604 spec->cdefine.fixup = 1;
605 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
609 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
610 const struct hda_fixup *fix, int action)
612 struct alc_spec *spec = codec->spec;
614 if (action == HDA_FIXUP_ACT_PROBE) {
615 spec->no_depop_delay = 1;
616 codec->depop_delay = 0;
620 static int alc_auto_parse_customize_define(struct hda_codec *codec)
622 unsigned int ass, tmp, i;
624 struct alc_spec *spec = codec->spec;
626 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
628 if (spec->cdefine.fixup) {
629 ass = spec->cdefine.sku_cfg;
630 if (ass == ALC_FIXUP_SKU_IGNORE)
635 if (!codec->bus->pci)
637 ass = codec->core.subsystem_id & 0xffff;
638 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
642 if (codec->core.vendor_id == 0x10ec0260)
644 ass = snd_hda_codec_get_pincfg(codec, nid);
647 codec_info(codec, "%s: SKU not ready 0x%08x\n",
648 codec->core.chip_name, ass);
654 for (i = 1; i < 16; i++) {
658 if (((ass >> 16) & 0xf) != tmp)
661 spec->cdefine.port_connectivity = ass >> 30;
662 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
663 spec->cdefine.check_sum = (ass >> 16) & 0xf;
664 spec->cdefine.customization = ass >> 8;
666 spec->cdefine.sku_cfg = ass;
667 spec->cdefine.external_amp = (ass & 0x38) >> 3;
668 spec->cdefine.platform_type = (ass & 0x4) >> 2;
669 spec->cdefine.swap = (ass & 0x2) >> 1;
670 spec->cdefine.override = ass & 0x1;
672 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
673 nid, spec->cdefine.sku_cfg);
674 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
675 spec->cdefine.port_connectivity);
676 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
677 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
678 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
679 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
680 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
681 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
682 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
687 /* return the position of NID in the list, or -1 if not found */
688 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
691 for (i = 0; i < nums; i++)
696 /* return true if the given NID is found in the list */
697 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
699 return find_idx_in_nid_list(nid, list, nums) >= 0;
702 /* check subsystem ID and set up device-specific initialization;
703 * return 1 if initialized, 0 if invalid SSID
705 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
706 * 31 ~ 16 : Manufacture ID
708 * 7 ~ 0 : Assembly ID
709 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
711 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
713 unsigned int ass, tmp, i;
715 struct alc_spec *spec = codec->spec;
717 if (spec->cdefine.fixup) {
718 ass = spec->cdefine.sku_cfg;
719 if (ass == ALC_FIXUP_SKU_IGNORE)
724 ass = codec->core.subsystem_id & 0xffff;
725 if (codec->bus->pci &&
726 ass != codec->bus->pci->subsystem_device && (ass & 1))
729 /* invalid SSID, check the special NID pin defcfg instead */
731 * 31~30 : port connectivity
734 * 19~16 : Check sum (15:1)
739 if (codec->core.vendor_id == 0x10ec0260)
741 ass = snd_hda_codec_get_pincfg(codec, nid);
743 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
747 if ((ass >> 30) != 1) /* no physical connection */
752 for (i = 1; i < 16; i++) {
756 if (((ass >> 16) & 0xf) != tmp)
759 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
760 ass & 0xffff, codec->core.vendor_id);
764 * 2 : 0 --> Desktop, 1 --> Laptop
765 * 3~5 : External Amplifier control
768 tmp = (ass & 0x38) >> 3; /* external Amp control */
769 if (spec->init_amp == ALC_INIT_UNDEFINED) {
772 alc_setup_gpio(codec, 0x01);
775 alc_setup_gpio(codec, 0x02);
778 alc_setup_gpio(codec, 0x03);
782 spec->init_amp = ALC_INIT_DEFAULT;
787 /* is laptop or Desktop and enable the function "Mute internal speaker
788 * when the external headphone out jack is plugged"
793 * 10~8 : Jack location
794 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
796 * 15 : 1 --> enable the function "Mute internal speaker
797 * when the external headphone out jack is plugged"
799 if (!alc_get_hp_pin(spec)) {
801 tmp = (ass >> 11) & 0x3; /* HP to chassis */
803 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
804 spec->gen.autocfg.line_outs))
806 spec->gen.autocfg.hp_pins[0] = nid;
811 /* Check the validity of ALC subsystem-id
812 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
813 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
815 if (!alc_subsystem_id(codec, ports)) {
816 struct alc_spec *spec = codec->spec;
817 if (spec->init_amp == ALC_INIT_UNDEFINED) {
819 "realtek: Enable default setup for auto mode as fallback\n");
820 spec->init_amp = ALC_INIT_DEFAULT;
828 static void alc_fixup_inv_dmic(struct hda_codec *codec,
829 const struct hda_fixup *fix, int action)
831 struct alc_spec *spec = codec->spec;
833 spec->gen.inv_dmic_split = 1;
837 static int alc_build_controls(struct hda_codec *codec)
841 err = snd_hda_gen_build_controls(codec);
845 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
854 static void alc_pre_init(struct hda_codec *codec)
856 alc_fill_eapd_coef(codec);
859 #define is_s3_resume(codec) \
860 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
861 #define is_s4_resume(codec) \
862 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
864 static int alc_init(struct hda_codec *codec)
866 struct alc_spec *spec = codec->spec;
868 /* hibernation resume needs the full chip initialization */
869 if (is_s4_resume(codec))
873 spec->init_hook(codec);
875 spec->gen.skip_verbs = 1; /* applied in below */
876 snd_hda_gen_init(codec);
878 alc_auto_init_amp(codec, spec->init_amp);
879 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
881 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
886 static inline void alc_shutup(struct hda_codec *codec)
888 struct alc_spec *spec = codec->spec;
890 if (!snd_hda_get_bool_hint(codec, "shutup"))
891 return; /* disabled explicitly by hints */
893 if (spec && spec->shutup)
896 alc_shutup_pins(codec);
899 #define alc_free snd_hda_gen_free
902 static void alc_power_eapd(struct hda_codec *codec)
904 alc_auto_setup_eapd(codec, false);
907 static int alc_suspend(struct hda_codec *codec)
909 struct alc_spec *spec = codec->spec;
911 if (spec && spec->power_hook)
912 spec->power_hook(codec);
918 static int alc_resume(struct hda_codec *codec)
920 struct alc_spec *spec = codec->spec;
922 if (!spec->no_depop_delay)
923 msleep(150); /* to avoid pop noise */
924 codec->patch_ops.init(codec);
925 snd_hda_regmap_sync(codec);
926 hda_call_check_power_status(codec, 0x01);
933 static const struct hda_codec_ops alc_patch_ops = {
934 .build_controls = alc_build_controls,
935 .build_pcms = snd_hda_gen_build_pcms,
938 .unsol_event = snd_hda_jack_unsol_event,
940 .resume = alc_resume,
941 .suspend = alc_suspend,
942 .check_power_status = snd_hda_gen_check_power_status,
947 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
950 * Rename codecs appropriately from COEF value or subvendor id
952 struct alc_codec_rename_table {
953 unsigned int vendor_id;
954 unsigned short coef_mask;
955 unsigned short coef_bits;
959 struct alc_codec_rename_pci_table {
960 unsigned int codec_vendor_id;
961 unsigned short pci_subvendor;
962 unsigned short pci_subdevice;
966 static const struct alc_codec_rename_table rename_tbl[] = {
967 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
968 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
969 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
970 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
971 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
972 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
973 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
974 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
975 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
976 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
977 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
978 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
979 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
980 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
981 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
982 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
983 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
987 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
988 { 0x10ec0280, 0x1028, 0, "ALC3220" },
989 { 0x10ec0282, 0x1028, 0, "ALC3221" },
990 { 0x10ec0283, 0x1028, 0, "ALC3223" },
991 { 0x10ec0288, 0x1028, 0, "ALC3263" },
992 { 0x10ec0292, 0x1028, 0, "ALC3226" },
993 { 0x10ec0293, 0x1028, 0, "ALC3235" },
994 { 0x10ec0255, 0x1028, 0, "ALC3234" },
995 { 0x10ec0668, 0x1028, 0, "ALC3661" },
996 { 0x10ec0275, 0x1028, 0, "ALC3260" },
997 { 0x10ec0899, 0x1028, 0, "ALC3861" },
998 { 0x10ec0298, 0x1028, 0, "ALC3266" },
999 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1000 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1001 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1002 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1003 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1004 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1005 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1006 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1007 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1008 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1009 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1010 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1011 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1012 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1013 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1014 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1015 { } /* terminator */
1018 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1020 const struct alc_codec_rename_table *p;
1021 const struct alc_codec_rename_pci_table *q;
1023 for (p = rename_tbl; p->vendor_id; p++) {
1024 if (p->vendor_id != codec->core.vendor_id)
1026 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1027 return alc_codec_rename(codec, p->name);
1030 if (!codec->bus->pci)
1032 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1033 if (q->codec_vendor_id != codec->core.vendor_id)
1035 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1037 if (!q->pci_subdevice ||
1038 q->pci_subdevice == codec->bus->pci->subsystem_device)
1039 return alc_codec_rename(codec, q->name);
1047 * Digital-beep handlers
1049 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1051 /* additional beep mixers; private_value will be overwritten */
1052 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1053 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1054 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1057 /* set up and create beep controls */
1058 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1061 struct snd_kcontrol_new *knew;
1062 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1065 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1066 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1067 &alc_beep_mixer[i]);
1070 knew->private_value = beep_amp;
1075 static const struct snd_pci_quirk beep_allow_list[] = {
1076 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1077 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1078 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1079 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1080 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1081 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1082 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1083 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1084 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1085 /* denylist -- no beep available */
1086 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1087 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1091 static inline int has_cdefine_beep(struct hda_codec *codec)
1093 struct alc_spec *spec = codec->spec;
1094 const struct snd_pci_quirk *q;
1095 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1098 return spec->cdefine.enable_pcbeep;
1101 #define set_beep_amp(spec, nid, idx, dir) 0
1102 #define has_cdefine_beep(codec) 0
1105 /* parse the BIOS configuration and set up the alc_spec */
1106 /* return 1 if successful, 0 if the proper config is not found,
1107 * or a negative error code
1109 static int alc_parse_auto_config(struct hda_codec *codec,
1110 const hda_nid_t *ignore_nids,
1111 const hda_nid_t *ssid_nids)
1113 struct alc_spec *spec = codec->spec;
1114 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1117 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1123 alc_ssid_check(codec, ssid_nids);
1125 err = snd_hda_gen_parse_auto_config(codec, cfg);
1132 /* common preparation job for alc_spec */
1133 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1135 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1141 snd_hda_gen_spec_init(&spec->gen);
1142 spec->gen.mixer_nid = mixer_nid;
1143 spec->gen.own_eapd_ctl = 1;
1144 codec->single_adc_amp = 1;
1145 /* FIXME: do we need this for all Realtek codec models? */
1146 codec->spdif_status_reset = 1;
1147 codec->forced_resume = 1;
1148 codec->patch_ops = alc_patch_ops;
1150 err = alc_codec_rename_from_preset(codec);
1158 static int alc880_parse_auto_config(struct hda_codec *codec)
1160 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1161 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1162 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1171 ALC880_FIXUP_MEDION_RIM,
1173 ALC880_FIXUP_LG_LW25,
1175 ALC880_FIXUP_EAPD_COEF,
1176 ALC880_FIXUP_TCL_S700,
1177 ALC880_FIXUP_VOL_KNOB,
1178 ALC880_FIXUP_FUJITSU,
1180 ALC880_FIXUP_UNIWILL,
1181 ALC880_FIXUP_UNIWILL_DIG,
1183 ALC880_FIXUP_ASUS_W5A,
1184 ALC880_FIXUP_3ST_BASE,
1186 ALC880_FIXUP_3ST_DIG,
1187 ALC880_FIXUP_5ST_BASE,
1189 ALC880_FIXUP_5ST_DIG,
1190 ALC880_FIXUP_6ST_BASE,
1192 ALC880_FIXUP_6ST_DIG,
1193 ALC880_FIXUP_6ST_AUTOMUTE,
1196 /* enable the volume-knob widget support on NID 0x21 */
1197 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1198 const struct hda_fixup *fix, int action)
1200 if (action == HDA_FIXUP_ACT_PROBE)
1201 snd_hda_jack_detect_enable_callback(codec, 0x21,
1202 alc_update_knob_master);
1205 static const struct hda_fixup alc880_fixups[] = {
1206 [ALC880_FIXUP_GPIO1] = {
1207 .type = HDA_FIXUP_FUNC,
1208 .v.func = alc_fixup_gpio1,
1210 [ALC880_FIXUP_GPIO2] = {
1211 .type = HDA_FIXUP_FUNC,
1212 .v.func = alc_fixup_gpio2,
1214 [ALC880_FIXUP_MEDION_RIM] = {
1215 .type = HDA_FIXUP_VERBS,
1216 .v.verbs = (const struct hda_verb[]) {
1217 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1218 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1222 .chain_id = ALC880_FIXUP_GPIO2,
1224 [ALC880_FIXUP_LG] = {
1225 .type = HDA_FIXUP_PINS,
1226 .v.pins = (const struct hda_pintbl[]) {
1227 /* disable bogus unused pins */
1228 { 0x16, 0x411111f0 },
1229 { 0x18, 0x411111f0 },
1230 { 0x1a, 0x411111f0 },
1234 [ALC880_FIXUP_LG_LW25] = {
1235 .type = HDA_FIXUP_PINS,
1236 .v.pins = (const struct hda_pintbl[]) {
1237 { 0x1a, 0x0181344f }, /* line-in */
1238 { 0x1b, 0x0321403f }, /* headphone */
1242 [ALC880_FIXUP_W810] = {
1243 .type = HDA_FIXUP_PINS,
1244 .v.pins = (const struct hda_pintbl[]) {
1245 /* disable bogus unused pins */
1246 { 0x17, 0x411111f0 },
1250 .chain_id = ALC880_FIXUP_GPIO2,
1252 [ALC880_FIXUP_EAPD_COEF] = {
1253 .type = HDA_FIXUP_VERBS,
1254 .v.verbs = (const struct hda_verb[]) {
1255 /* change to EAPD mode */
1256 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1257 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1261 [ALC880_FIXUP_TCL_S700] = {
1262 .type = HDA_FIXUP_VERBS,
1263 .v.verbs = (const struct hda_verb[]) {
1264 /* change to EAPD mode */
1265 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1266 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1270 .chain_id = ALC880_FIXUP_GPIO2,
1272 [ALC880_FIXUP_VOL_KNOB] = {
1273 .type = HDA_FIXUP_FUNC,
1274 .v.func = alc880_fixup_vol_knob,
1276 [ALC880_FIXUP_FUJITSU] = {
1277 /* override all pins as BIOS on old Amilo is broken */
1278 .type = HDA_FIXUP_PINS,
1279 .v.pins = (const struct hda_pintbl[]) {
1280 { 0x14, 0x0121401f }, /* HP */
1281 { 0x15, 0x99030120 }, /* speaker */
1282 { 0x16, 0x99030130 }, /* bass speaker */
1283 { 0x17, 0x411111f0 }, /* N/A */
1284 { 0x18, 0x411111f0 }, /* N/A */
1285 { 0x19, 0x01a19950 }, /* mic-in */
1286 { 0x1a, 0x411111f0 }, /* N/A */
1287 { 0x1b, 0x411111f0 }, /* N/A */
1288 { 0x1c, 0x411111f0 }, /* N/A */
1289 { 0x1d, 0x411111f0 }, /* N/A */
1290 { 0x1e, 0x01454140 }, /* SPDIF out */
1294 .chain_id = ALC880_FIXUP_VOL_KNOB,
1296 [ALC880_FIXUP_F1734] = {
1297 /* almost compatible with FUJITSU, but no bass and SPDIF */
1298 .type = HDA_FIXUP_PINS,
1299 .v.pins = (const struct hda_pintbl[]) {
1300 { 0x14, 0x0121401f }, /* HP */
1301 { 0x15, 0x99030120 }, /* speaker */
1302 { 0x16, 0x411111f0 }, /* N/A */
1303 { 0x17, 0x411111f0 }, /* N/A */
1304 { 0x18, 0x411111f0 }, /* N/A */
1305 { 0x19, 0x01a19950 }, /* mic-in */
1306 { 0x1a, 0x411111f0 }, /* N/A */
1307 { 0x1b, 0x411111f0 }, /* N/A */
1308 { 0x1c, 0x411111f0 }, /* N/A */
1309 { 0x1d, 0x411111f0 }, /* N/A */
1310 { 0x1e, 0x411111f0 }, /* N/A */
1314 .chain_id = ALC880_FIXUP_VOL_KNOB,
1316 [ALC880_FIXUP_UNIWILL] = {
1317 /* need to fix HP and speaker pins to be parsed correctly */
1318 .type = HDA_FIXUP_PINS,
1319 .v.pins = (const struct hda_pintbl[]) {
1320 { 0x14, 0x0121411f }, /* HP */
1321 { 0x15, 0x99030120 }, /* speaker */
1322 { 0x16, 0x99030130 }, /* bass speaker */
1326 [ALC880_FIXUP_UNIWILL_DIG] = {
1327 .type = HDA_FIXUP_PINS,
1328 .v.pins = (const struct hda_pintbl[]) {
1329 /* disable bogus unused pins */
1330 { 0x17, 0x411111f0 },
1331 { 0x19, 0x411111f0 },
1332 { 0x1b, 0x411111f0 },
1333 { 0x1f, 0x411111f0 },
1337 [ALC880_FIXUP_Z71V] = {
1338 .type = HDA_FIXUP_PINS,
1339 .v.pins = (const struct hda_pintbl[]) {
1340 /* set up the whole pins as BIOS is utterly broken */
1341 { 0x14, 0x99030120 }, /* speaker */
1342 { 0x15, 0x0121411f }, /* HP */
1343 { 0x16, 0x411111f0 }, /* N/A */
1344 { 0x17, 0x411111f0 }, /* N/A */
1345 { 0x18, 0x01a19950 }, /* mic-in */
1346 { 0x19, 0x411111f0 }, /* N/A */
1347 { 0x1a, 0x01813031 }, /* line-in */
1348 { 0x1b, 0x411111f0 }, /* N/A */
1349 { 0x1c, 0x411111f0 }, /* N/A */
1350 { 0x1d, 0x411111f0 }, /* N/A */
1351 { 0x1e, 0x0144111e }, /* SPDIF */
1355 [ALC880_FIXUP_ASUS_W5A] = {
1356 .type = HDA_FIXUP_PINS,
1357 .v.pins = (const struct hda_pintbl[]) {
1358 /* set up the whole pins as BIOS is utterly broken */
1359 { 0x14, 0x0121411f }, /* HP */
1360 { 0x15, 0x411111f0 }, /* N/A */
1361 { 0x16, 0x411111f0 }, /* N/A */
1362 { 0x17, 0x411111f0 }, /* N/A */
1363 { 0x18, 0x90a60160 }, /* mic */
1364 { 0x19, 0x411111f0 }, /* N/A */
1365 { 0x1a, 0x411111f0 }, /* N/A */
1366 { 0x1b, 0x411111f0 }, /* N/A */
1367 { 0x1c, 0x411111f0 }, /* N/A */
1368 { 0x1d, 0x411111f0 }, /* N/A */
1369 { 0x1e, 0xb743111e }, /* SPDIF out */
1373 .chain_id = ALC880_FIXUP_GPIO1,
1375 [ALC880_FIXUP_3ST_BASE] = {
1376 .type = HDA_FIXUP_PINS,
1377 .v.pins = (const struct hda_pintbl[]) {
1378 { 0x14, 0x01014010 }, /* line-out */
1379 { 0x15, 0x411111f0 }, /* N/A */
1380 { 0x16, 0x411111f0 }, /* N/A */
1381 { 0x17, 0x411111f0 }, /* N/A */
1382 { 0x18, 0x01a19c30 }, /* mic-in */
1383 { 0x19, 0x0121411f }, /* HP */
1384 { 0x1a, 0x01813031 }, /* line-in */
1385 { 0x1b, 0x02a19c40 }, /* front-mic */
1386 { 0x1c, 0x411111f0 }, /* N/A */
1387 { 0x1d, 0x411111f0 }, /* N/A */
1388 /* 0x1e is filled in below */
1389 { 0x1f, 0x411111f0 }, /* N/A */
1393 [ALC880_FIXUP_3ST] = {
1394 .type = HDA_FIXUP_PINS,
1395 .v.pins = (const struct hda_pintbl[]) {
1396 { 0x1e, 0x411111f0 }, /* N/A */
1400 .chain_id = ALC880_FIXUP_3ST_BASE,
1402 [ALC880_FIXUP_3ST_DIG] = {
1403 .type = HDA_FIXUP_PINS,
1404 .v.pins = (const struct hda_pintbl[]) {
1405 { 0x1e, 0x0144111e }, /* SPDIF */
1409 .chain_id = ALC880_FIXUP_3ST_BASE,
1411 [ALC880_FIXUP_5ST_BASE] = {
1412 .type = HDA_FIXUP_PINS,
1413 .v.pins = (const struct hda_pintbl[]) {
1414 { 0x14, 0x01014010 }, /* front */
1415 { 0x15, 0x411111f0 }, /* N/A */
1416 { 0x16, 0x01011411 }, /* CLFE */
1417 { 0x17, 0x01016412 }, /* surr */
1418 { 0x18, 0x01a19c30 }, /* mic-in */
1419 { 0x19, 0x0121411f }, /* HP */
1420 { 0x1a, 0x01813031 }, /* line-in */
1421 { 0x1b, 0x02a19c40 }, /* front-mic */
1422 { 0x1c, 0x411111f0 }, /* N/A */
1423 { 0x1d, 0x411111f0 }, /* N/A */
1424 /* 0x1e is filled in below */
1425 { 0x1f, 0x411111f0 }, /* N/A */
1429 [ALC880_FIXUP_5ST] = {
1430 .type = HDA_FIXUP_PINS,
1431 .v.pins = (const struct hda_pintbl[]) {
1432 { 0x1e, 0x411111f0 }, /* N/A */
1436 .chain_id = ALC880_FIXUP_5ST_BASE,
1438 [ALC880_FIXUP_5ST_DIG] = {
1439 .type = HDA_FIXUP_PINS,
1440 .v.pins = (const struct hda_pintbl[]) {
1441 { 0x1e, 0x0144111e }, /* SPDIF */
1445 .chain_id = ALC880_FIXUP_5ST_BASE,
1447 [ALC880_FIXUP_6ST_BASE] = {
1448 .type = HDA_FIXUP_PINS,
1449 .v.pins = (const struct hda_pintbl[]) {
1450 { 0x14, 0x01014010 }, /* front */
1451 { 0x15, 0x01016412 }, /* surr */
1452 { 0x16, 0x01011411 }, /* CLFE */
1453 { 0x17, 0x01012414 }, /* side */
1454 { 0x18, 0x01a19c30 }, /* mic-in */
1455 { 0x19, 0x02a19c40 }, /* front-mic */
1456 { 0x1a, 0x01813031 }, /* line-in */
1457 { 0x1b, 0x0121411f }, /* HP */
1458 { 0x1c, 0x411111f0 }, /* N/A */
1459 { 0x1d, 0x411111f0 }, /* N/A */
1460 /* 0x1e is filled in below */
1461 { 0x1f, 0x411111f0 }, /* N/A */
1465 [ALC880_FIXUP_6ST] = {
1466 .type = HDA_FIXUP_PINS,
1467 .v.pins = (const struct hda_pintbl[]) {
1468 { 0x1e, 0x411111f0 }, /* N/A */
1472 .chain_id = ALC880_FIXUP_6ST_BASE,
1474 [ALC880_FIXUP_6ST_DIG] = {
1475 .type = HDA_FIXUP_PINS,
1476 .v.pins = (const struct hda_pintbl[]) {
1477 { 0x1e, 0x0144111e }, /* SPDIF */
1481 .chain_id = ALC880_FIXUP_6ST_BASE,
1483 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1484 .type = HDA_FIXUP_PINS,
1485 .v.pins = (const struct hda_pintbl[]) {
1486 { 0x1b, 0x0121401f }, /* HP with jack detect */
1489 .chained_before = true,
1490 .chain_id = ALC880_FIXUP_6ST_BASE,
1494 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1495 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1496 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1497 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1498 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1499 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1500 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1501 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1502 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1503 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1504 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1505 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1506 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1507 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1508 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1509 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1510 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1511 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1512 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1513 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1514 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1515 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1516 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1517 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1519 /* Below is the copied entries from alc880_quirks.c.
1520 * It's not quite sure whether BIOS sets the correct pin-config table
1521 * on these machines, thus they are kept to be compatible with
1522 * the old static quirks. Once when it's confirmed to work without
1523 * these overrides, it'd be better to remove.
1525 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1526 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1527 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1528 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1529 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1530 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1531 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1532 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1533 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1534 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1535 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1536 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1537 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1538 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1539 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1540 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1541 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1542 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1543 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1544 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1545 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1546 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1547 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1548 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1549 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1550 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1551 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1552 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1553 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1554 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1555 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1556 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1557 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1559 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1560 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1561 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1565 static const struct hda_model_fixup alc880_fixup_models[] = {
1566 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1567 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1568 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1569 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1570 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1571 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1572 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1578 * OK, here we have finally the patch for ALC880
1580 static int patch_alc880(struct hda_codec *codec)
1582 struct alc_spec *spec;
1585 err = alc_alloc_spec(codec, 0x0b);
1590 spec->gen.need_dac_fix = 1;
1591 spec->gen.beep_nid = 0x01;
1593 codec->patch_ops.unsol_event = alc880_unsol_event;
1595 alc_pre_init(codec);
1597 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1599 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1601 /* automatic parse from the BIOS config */
1602 err = alc880_parse_auto_config(codec);
1606 if (!spec->gen.no_analog) {
1607 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1612 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1625 static int alc260_parse_auto_config(struct hda_codec *codec)
1627 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1628 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1629 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1636 ALC260_FIXUP_HP_DC5750,
1637 ALC260_FIXUP_HP_PIN_0F,
1640 ALC260_FIXUP_GPIO1_TOGGLE,
1641 ALC260_FIXUP_REPLACER,
1642 ALC260_FIXUP_HP_B1900,
1644 ALC260_FIXUP_FSC_S7020,
1645 ALC260_FIXUP_FSC_S7020_JWSE,
1646 ALC260_FIXUP_VAIO_PINS,
1649 static void alc260_gpio1_automute(struct hda_codec *codec)
1651 struct alc_spec *spec = codec->spec;
1653 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1656 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1657 const struct hda_fixup *fix, int action)
1659 struct alc_spec *spec = codec->spec;
1660 if (action == HDA_FIXUP_ACT_PROBE) {
1661 /* although the machine has only one output pin, we need to
1662 * toggle GPIO1 according to the jack state
1664 spec->gen.automute_hook = alc260_gpio1_automute;
1665 spec->gen.detect_hp = 1;
1666 spec->gen.automute_speaker = 1;
1667 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1668 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1669 snd_hda_gen_hp_automute);
1670 alc_setup_gpio(codec, 0x01);
1674 static void alc260_fixup_kn1(struct hda_codec *codec,
1675 const struct hda_fixup *fix, int action)
1677 struct alc_spec *spec = codec->spec;
1678 static const struct hda_pintbl pincfgs[] = {
1679 { 0x0f, 0x02214000 }, /* HP/speaker */
1680 { 0x12, 0x90a60160 }, /* int mic */
1681 { 0x13, 0x02a19000 }, /* ext mic */
1682 { 0x18, 0x01446000 }, /* SPDIF out */
1683 /* disable bogus I/O pins */
1684 { 0x10, 0x411111f0 },
1685 { 0x11, 0x411111f0 },
1686 { 0x14, 0x411111f0 },
1687 { 0x15, 0x411111f0 },
1688 { 0x16, 0x411111f0 },
1689 { 0x17, 0x411111f0 },
1690 { 0x19, 0x411111f0 },
1695 case HDA_FIXUP_ACT_PRE_PROBE:
1696 snd_hda_apply_pincfgs(codec, pincfgs);
1697 spec->init_amp = ALC_INIT_NONE;
1702 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1703 const struct hda_fixup *fix, int action)
1705 struct alc_spec *spec = codec->spec;
1706 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1707 spec->init_amp = ALC_INIT_NONE;
1710 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1711 const struct hda_fixup *fix, int action)
1713 struct alc_spec *spec = codec->spec;
1714 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1715 spec->gen.add_jack_modes = 1;
1716 spec->gen.hp_mic = 1;
1720 static const struct hda_fixup alc260_fixups[] = {
1721 [ALC260_FIXUP_HP_DC5750] = {
1722 .type = HDA_FIXUP_PINS,
1723 .v.pins = (const struct hda_pintbl[]) {
1724 { 0x11, 0x90130110 }, /* speaker */
1728 [ALC260_FIXUP_HP_PIN_0F] = {
1729 .type = HDA_FIXUP_PINS,
1730 .v.pins = (const struct hda_pintbl[]) {
1731 { 0x0f, 0x01214000 }, /* HP */
1735 [ALC260_FIXUP_COEF] = {
1736 .type = HDA_FIXUP_VERBS,
1737 .v.verbs = (const struct hda_verb[]) {
1738 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1739 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1743 [ALC260_FIXUP_GPIO1] = {
1744 .type = HDA_FIXUP_FUNC,
1745 .v.func = alc_fixup_gpio1,
1747 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1748 .type = HDA_FIXUP_FUNC,
1749 .v.func = alc260_fixup_gpio1_toggle,
1751 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1753 [ALC260_FIXUP_REPLACER] = {
1754 .type = HDA_FIXUP_VERBS,
1755 .v.verbs = (const struct hda_verb[]) {
1756 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1757 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1761 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1763 [ALC260_FIXUP_HP_B1900] = {
1764 .type = HDA_FIXUP_FUNC,
1765 .v.func = alc260_fixup_gpio1_toggle,
1767 .chain_id = ALC260_FIXUP_COEF,
1769 [ALC260_FIXUP_KN1] = {
1770 .type = HDA_FIXUP_FUNC,
1771 .v.func = alc260_fixup_kn1,
1773 [ALC260_FIXUP_FSC_S7020] = {
1774 .type = HDA_FIXUP_FUNC,
1775 .v.func = alc260_fixup_fsc_s7020,
1777 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1778 .type = HDA_FIXUP_FUNC,
1779 .v.func = alc260_fixup_fsc_s7020_jwse,
1781 .chain_id = ALC260_FIXUP_FSC_S7020,
1783 [ALC260_FIXUP_VAIO_PINS] = {
1784 .type = HDA_FIXUP_PINS,
1785 .v.pins = (const struct hda_pintbl[]) {
1786 /* Pin configs are missing completely on some VAIOs */
1787 { 0x0f, 0x01211020 },
1788 { 0x10, 0x0001003f },
1789 { 0x11, 0x411111f0 },
1790 { 0x12, 0x01a15930 },
1791 { 0x13, 0x411111f0 },
1792 { 0x14, 0x411111f0 },
1793 { 0x15, 0x411111f0 },
1794 { 0x16, 0x411111f0 },
1795 { 0x17, 0x411111f0 },
1796 { 0x18, 0x411111f0 },
1797 { 0x19, 0x411111f0 },
1803 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1804 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1805 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1806 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1807 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1808 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1809 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1810 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1811 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1812 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1813 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1814 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1815 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1819 static const struct hda_model_fixup alc260_fixup_models[] = {
1820 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1821 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1822 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1823 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1829 static int patch_alc260(struct hda_codec *codec)
1831 struct alc_spec *spec;
1834 err = alc_alloc_spec(codec, 0x07);
1839 /* as quite a few machines require HP amp for speaker outputs,
1840 * it's easier to enable it unconditionally; even if it's unneeded,
1841 * it's almost harmless.
1843 spec->gen.prefer_hp_amp = 1;
1844 spec->gen.beep_nid = 0x01;
1846 spec->shutup = alc_eapd_shutup;
1848 alc_pre_init(codec);
1850 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1852 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1854 /* automatic parse from the BIOS config */
1855 err = alc260_parse_auto_config(codec);
1859 if (!spec->gen.no_analog) {
1860 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1865 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1876 * ALC882/883/885/888/889 support
1878 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1879 * configuration. Each pin widget can choose any input DACs and a mixer.
1880 * Each ADC is connected from a mixer of all inputs. This makes possible
1881 * 6-channel independent captures.
1883 * In addition, an independent DAC for the multi-playback (not used in this
1891 ALC882_FIXUP_ABIT_AW9D_MAX,
1892 ALC882_FIXUP_LENOVO_Y530,
1893 ALC882_FIXUP_PB_M5210,
1894 ALC882_FIXUP_ACER_ASPIRE_7736,
1895 ALC882_FIXUP_ASUS_W90V,
1897 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1898 ALC889_FIXUP_VAIO_TT,
1899 ALC888_FIXUP_EEE1601,
1903 ALC883_FIXUP_ACER_EAPD,
1908 ALC882_FIXUP_ASUS_W2JC,
1909 ALC882_FIXUP_ACER_ASPIRE_4930G,
1910 ALC882_FIXUP_ACER_ASPIRE_8930G,
1911 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1912 ALC885_FIXUP_MACPRO_GPIO,
1913 ALC889_FIXUP_DAC_ROUTE,
1914 ALC889_FIXUP_MBP_VREF,
1915 ALC889_FIXUP_IMAC91_VREF,
1916 ALC889_FIXUP_MBA11_VREF,
1917 ALC889_FIXUP_MBA21_VREF,
1918 ALC889_FIXUP_MP11_VREF,
1919 ALC889_FIXUP_MP41_VREF,
1920 ALC882_FIXUP_INV_DMIC,
1921 ALC882_FIXUP_NO_PRIMARY_HP,
1922 ALC887_FIXUP_ASUS_BASS,
1923 ALC887_FIXUP_BASS_CHMAP,
1924 ALC1220_FIXUP_GB_DUAL_CODECS,
1925 ALC1220_FIXUP_CLEVO_P950,
1926 ALC1220_FIXUP_CLEVO_PB51ED,
1927 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1928 ALC887_FIXUP_ASUS_AUDIO,
1929 ALC887_FIXUP_ASUS_HMIC,
1932 static void alc889_fixup_coef(struct hda_codec *codec,
1933 const struct hda_fixup *fix, int action)
1935 if (action != HDA_FIXUP_ACT_INIT)
1937 alc_update_coef_idx(codec, 7, 0, 0x2030);
1940 /* set up GPIO at initialization */
1941 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1942 const struct hda_fixup *fix, int action)
1944 struct alc_spec *spec = codec->spec;
1946 spec->gpio_write_delay = true;
1947 alc_fixup_gpio3(codec, fix, action);
1950 /* Fix the connection of some pins for ALC889:
1951 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1952 * work correctly (bko#42740)
1954 static void alc889_fixup_dac_route(struct hda_codec *codec,
1955 const struct hda_fixup *fix, int action)
1957 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1958 /* fake the connections during parsing the tree */
1959 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1960 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1961 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1962 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1963 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1964 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1965 } else if (action == HDA_FIXUP_ACT_PROBE) {
1966 /* restore the connections */
1967 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1968 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1969 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1970 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1971 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1975 /* Set VREF on HP pin */
1976 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1977 const struct hda_fixup *fix, int action)
1979 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1980 struct alc_spec *spec = codec->spec;
1983 if (action != HDA_FIXUP_ACT_INIT)
1985 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1986 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1987 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1989 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1990 val |= AC_PINCTL_VREF_80;
1991 snd_hda_set_pin_ctl(codec, nids[i], val);
1992 spec->gen.keep_vref_in_automute = 1;
1997 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1998 const hda_nid_t *nids, int num_nids)
2000 struct alc_spec *spec = codec->spec;
2003 for (i = 0; i < num_nids; i++) {
2005 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2006 val |= AC_PINCTL_VREF_50;
2007 snd_hda_set_pin_ctl(codec, nids[i], val);
2009 spec->gen.keep_vref_in_automute = 1;
2012 /* Set VREF on speaker pins on imac91 */
2013 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2014 const struct hda_fixup *fix, int action)
2016 static const hda_nid_t nids[] = { 0x18, 0x1a };
2018 if (action == HDA_FIXUP_ACT_INIT)
2019 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2022 /* Set VREF on speaker pins on mba11 */
2023 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2024 const struct hda_fixup *fix, int action)
2026 static const hda_nid_t nids[] = { 0x18 };
2028 if (action == HDA_FIXUP_ACT_INIT)
2029 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2032 /* Set VREF on speaker pins on mba21 */
2033 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2034 const struct hda_fixup *fix, int action)
2036 static const hda_nid_t nids[] = { 0x18, 0x19 };
2038 if (action == HDA_FIXUP_ACT_INIT)
2039 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2042 /* Don't take HP output as primary
2043 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2044 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2046 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2047 const struct hda_fixup *fix, int action)
2049 struct alc_spec *spec = codec->spec;
2050 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2051 spec->gen.no_primary_hp = 1;
2052 spec->gen.no_multi_io = 1;
2056 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2057 const struct hda_fixup *fix, int action);
2059 /* For dual-codec configuration, we need to disable some features to avoid
2060 * conflicts of kctls and PCM streams
2062 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2063 const struct hda_fixup *fix, int action)
2065 struct alc_spec *spec = codec->spec;
2067 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2069 /* disable vmaster */
2070 spec->gen.suppress_vmaster = 1;
2071 /* auto-mute and auto-mic switch don't work with multiple codecs */
2072 spec->gen.suppress_auto_mute = 1;
2073 spec->gen.suppress_auto_mic = 1;
2074 /* disable aamix as well */
2075 spec->gen.mixer_nid = 0;
2076 /* add location prefix to avoid conflicts */
2077 codec->force_pin_prefix = 1;
2080 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2081 const char *newname)
2083 struct snd_kcontrol *kctl;
2085 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2087 strcpy(kctl->id.name, newname);
2090 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2091 const struct hda_fixup *fix,
2094 alc_fixup_dual_codecs(codec, fix, action);
2096 case HDA_FIXUP_ACT_PRE_PROBE:
2097 /* override card longname to provide a unique UCM profile */
2098 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2100 case HDA_FIXUP_ACT_BUILD:
2101 /* rename Capture controls depending on the codec */
2102 rename_ctl(codec, "Capture Volume",
2104 "Rear-Panel Capture Volume" :
2105 "Front-Panel Capture Volume");
2106 rename_ctl(codec, "Capture Switch",
2108 "Rear-Panel Capture Switch" :
2109 "Front-Panel Capture Switch");
2114 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2115 const struct hda_fixup *fix,
2118 static const hda_nid_t conn1[] = { 0x0c };
2120 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2123 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2124 /* We therefore want to make sure 0x14 (front headphone) and
2125 * 0x1b (speakers) use the stereo DAC 0x02
2127 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2128 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2131 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2132 const struct hda_fixup *fix, int action);
2134 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2135 const struct hda_fixup *fix,
2138 alc1220_fixup_clevo_p950(codec, fix, action);
2139 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2142 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2143 struct hda_jack_callback *jack)
2145 struct alc_spec *spec = codec->spec;
2148 snd_hda_gen_hp_automute(codec, jack);
2150 if (spec->gen.hp_jack_present)
2151 vref = AC_PINCTL_VREF_80;
2153 vref = AC_PINCTL_VREF_HIZ;
2154 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2157 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2158 const struct hda_fixup *fix, int action)
2160 struct alc_spec *spec = codec->spec;
2161 if (action != HDA_FIXUP_ACT_PROBE)
2163 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2164 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2167 static const struct hda_fixup alc882_fixups[] = {
2168 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2169 .type = HDA_FIXUP_PINS,
2170 .v.pins = (const struct hda_pintbl[]) {
2171 { 0x15, 0x01080104 }, /* side */
2172 { 0x16, 0x01011012 }, /* rear */
2173 { 0x17, 0x01016011 }, /* clfe */
2177 [ALC882_FIXUP_LENOVO_Y530] = {
2178 .type = HDA_FIXUP_PINS,
2179 .v.pins = (const struct hda_pintbl[]) {
2180 { 0x15, 0x99130112 }, /* rear int speakers */
2181 { 0x16, 0x99130111 }, /* subwoofer */
2185 [ALC882_FIXUP_PB_M5210] = {
2186 .type = HDA_FIXUP_PINCTLS,
2187 .v.pins = (const struct hda_pintbl[]) {
2188 { 0x19, PIN_VREF50 },
2192 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2193 .type = HDA_FIXUP_FUNC,
2194 .v.func = alc_fixup_sku_ignore,
2196 [ALC882_FIXUP_ASUS_W90V] = {
2197 .type = HDA_FIXUP_PINS,
2198 .v.pins = (const struct hda_pintbl[]) {
2199 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2203 [ALC889_FIXUP_CD] = {
2204 .type = HDA_FIXUP_PINS,
2205 .v.pins = (const struct hda_pintbl[]) {
2206 { 0x1c, 0x993301f0 }, /* CD */
2210 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2211 .type = HDA_FIXUP_PINS,
2212 .v.pins = (const struct hda_pintbl[]) {
2213 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2217 .chain_id = ALC889_FIXUP_CD,
2219 [ALC889_FIXUP_VAIO_TT] = {
2220 .type = HDA_FIXUP_PINS,
2221 .v.pins = (const struct hda_pintbl[]) {
2222 { 0x17, 0x90170111 }, /* hidden surround speaker */
2226 [ALC888_FIXUP_EEE1601] = {
2227 .type = HDA_FIXUP_VERBS,
2228 .v.verbs = (const struct hda_verb[]) {
2229 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2230 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2234 [ALC886_FIXUP_EAPD] = {
2235 .type = HDA_FIXUP_VERBS,
2236 .v.verbs = (const struct hda_verb[]) {
2237 /* change to EAPD mode */
2238 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2239 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2243 [ALC882_FIXUP_EAPD] = {
2244 .type = HDA_FIXUP_VERBS,
2245 .v.verbs = (const struct hda_verb[]) {
2246 /* change to EAPD mode */
2247 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2248 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2252 [ALC883_FIXUP_EAPD] = {
2253 .type = HDA_FIXUP_VERBS,
2254 .v.verbs = (const struct hda_verb[]) {
2255 /* change to EAPD mode */
2256 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2257 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2261 [ALC883_FIXUP_ACER_EAPD] = {
2262 .type = HDA_FIXUP_VERBS,
2263 .v.verbs = (const struct hda_verb[]) {
2264 /* eanable EAPD on Acer laptops */
2265 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2266 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2270 [ALC882_FIXUP_GPIO1] = {
2271 .type = HDA_FIXUP_FUNC,
2272 .v.func = alc_fixup_gpio1,
2274 [ALC882_FIXUP_GPIO2] = {
2275 .type = HDA_FIXUP_FUNC,
2276 .v.func = alc_fixup_gpio2,
2278 [ALC882_FIXUP_GPIO3] = {
2279 .type = HDA_FIXUP_FUNC,
2280 .v.func = alc_fixup_gpio3,
2282 [ALC882_FIXUP_ASUS_W2JC] = {
2283 .type = HDA_FIXUP_FUNC,
2284 .v.func = alc_fixup_gpio1,
2286 .chain_id = ALC882_FIXUP_EAPD,
2288 [ALC889_FIXUP_COEF] = {
2289 .type = HDA_FIXUP_FUNC,
2290 .v.func = alc889_fixup_coef,
2292 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2293 .type = HDA_FIXUP_PINS,
2294 .v.pins = (const struct hda_pintbl[]) {
2295 { 0x16, 0x99130111 }, /* CLFE speaker */
2296 { 0x17, 0x99130112 }, /* surround speaker */
2300 .chain_id = ALC882_FIXUP_GPIO1,
2302 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2303 .type = HDA_FIXUP_PINS,
2304 .v.pins = (const struct hda_pintbl[]) {
2305 { 0x16, 0x99130111 }, /* CLFE speaker */
2306 { 0x1b, 0x99130112 }, /* surround speaker */
2310 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2312 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2313 /* additional init verbs for Acer Aspire 8930G */
2314 .type = HDA_FIXUP_VERBS,
2315 .v.verbs = (const struct hda_verb[]) {
2316 /* Enable all DACs */
2317 /* DAC DISABLE/MUTE 1? */
2318 /* setting bits 1-5 disables DAC nids 0x02-0x06
2319 * apparently. Init=0x38 */
2320 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2321 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2322 /* DAC DISABLE/MUTE 2? */
2323 /* some bit here disables the other DACs.
2325 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2326 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2328 * This laptop has a stereo digital microphone.
2329 * The mics are only 1cm apart which makes the stereo
2330 * useless. However, either the mic or the ALC889
2331 * makes the signal become a difference/sum signal
2332 * instead of standard stereo, which is annoying.
2333 * So instead we flip this bit which makes the
2334 * codec replicate the sum signal to both channels,
2335 * turning it into a normal mono mic.
2337 /* DMIC_CONTROL? Init value = 0x0001 */
2338 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2339 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2340 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2341 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2345 .chain_id = ALC882_FIXUP_GPIO1,
2347 [ALC885_FIXUP_MACPRO_GPIO] = {
2348 .type = HDA_FIXUP_FUNC,
2349 .v.func = alc885_fixup_macpro_gpio,
2351 [ALC889_FIXUP_DAC_ROUTE] = {
2352 .type = HDA_FIXUP_FUNC,
2353 .v.func = alc889_fixup_dac_route,
2355 [ALC889_FIXUP_MBP_VREF] = {
2356 .type = HDA_FIXUP_FUNC,
2357 .v.func = alc889_fixup_mbp_vref,
2359 .chain_id = ALC882_FIXUP_GPIO1,
2361 [ALC889_FIXUP_IMAC91_VREF] = {
2362 .type = HDA_FIXUP_FUNC,
2363 .v.func = alc889_fixup_imac91_vref,
2365 .chain_id = ALC882_FIXUP_GPIO1,
2367 [ALC889_FIXUP_MBA11_VREF] = {
2368 .type = HDA_FIXUP_FUNC,
2369 .v.func = alc889_fixup_mba11_vref,
2371 .chain_id = ALC889_FIXUP_MBP_VREF,
2373 [ALC889_FIXUP_MBA21_VREF] = {
2374 .type = HDA_FIXUP_FUNC,
2375 .v.func = alc889_fixup_mba21_vref,
2377 .chain_id = ALC889_FIXUP_MBP_VREF,
2379 [ALC889_FIXUP_MP11_VREF] = {
2380 .type = HDA_FIXUP_FUNC,
2381 .v.func = alc889_fixup_mba11_vref,
2383 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2385 [ALC889_FIXUP_MP41_VREF] = {
2386 .type = HDA_FIXUP_FUNC,
2387 .v.func = alc889_fixup_mbp_vref,
2389 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2391 [ALC882_FIXUP_INV_DMIC] = {
2392 .type = HDA_FIXUP_FUNC,
2393 .v.func = alc_fixup_inv_dmic,
2395 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2396 .type = HDA_FIXUP_FUNC,
2397 .v.func = alc882_fixup_no_primary_hp,
2399 [ALC887_FIXUP_ASUS_BASS] = {
2400 .type = HDA_FIXUP_PINS,
2401 .v.pins = (const struct hda_pintbl[]) {
2402 {0x16, 0x99130130}, /* bass speaker */
2406 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2408 [ALC887_FIXUP_BASS_CHMAP] = {
2409 .type = HDA_FIXUP_FUNC,
2410 .v.func = alc_fixup_bass_chmap,
2412 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2413 .type = HDA_FIXUP_FUNC,
2414 .v.func = alc1220_fixup_gb_dual_codecs,
2416 [ALC1220_FIXUP_CLEVO_P950] = {
2417 .type = HDA_FIXUP_FUNC,
2418 .v.func = alc1220_fixup_clevo_p950,
2420 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2421 .type = HDA_FIXUP_FUNC,
2422 .v.func = alc1220_fixup_clevo_pb51ed,
2424 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2425 .type = HDA_FIXUP_PINS,
2426 .v.pins = (const struct hda_pintbl[]) {
2427 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2431 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2433 [ALC887_FIXUP_ASUS_AUDIO] = {
2434 .type = HDA_FIXUP_PINS,
2435 .v.pins = (const struct hda_pintbl[]) {
2436 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2437 { 0x19, 0x22219420 },
2441 [ALC887_FIXUP_ASUS_HMIC] = {
2442 .type = HDA_FIXUP_FUNC,
2443 .v.func = alc887_fixup_asus_jack,
2445 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2449 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2450 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2451 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2452 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2453 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2454 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2455 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2456 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2457 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2458 ALC882_FIXUP_ACER_ASPIRE_4930G),
2459 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2460 ALC882_FIXUP_ACER_ASPIRE_4930G),
2461 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2462 ALC882_FIXUP_ACER_ASPIRE_8930G),
2463 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2464 ALC882_FIXUP_ACER_ASPIRE_8930G),
2465 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2466 ALC882_FIXUP_ACER_ASPIRE_4930G),
2467 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2468 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2469 ALC882_FIXUP_ACER_ASPIRE_4930G),
2470 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2471 ALC882_FIXUP_ACER_ASPIRE_4930G),
2472 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2473 ALC882_FIXUP_ACER_ASPIRE_4930G),
2474 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2475 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2476 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2477 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2478 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2479 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2480 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2481 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2482 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2483 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2484 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2485 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2486 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2487 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2488 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2490 /* All Apple entries are in codec SSIDs */
2491 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2492 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2493 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2494 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2495 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2496 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2497 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2498 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2499 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2500 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2501 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2502 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2503 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2504 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2505 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2506 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2507 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2508 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2509 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2510 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2511 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2512 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2514 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2515 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2516 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2517 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2518 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
2519 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
2520 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2521 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2522 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2523 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2524 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2525 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2526 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2527 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2528 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2529 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2530 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2531 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2532 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2533 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2534 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2535 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2536 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2537 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2538 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2539 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2540 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2541 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2542 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2543 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2544 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2545 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2546 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2547 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2548 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2549 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2550 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2551 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2552 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2553 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2554 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2555 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2556 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2560 static const struct hda_model_fixup alc882_fixup_models[] = {
2561 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2562 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2563 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2564 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2565 {.id = ALC889_FIXUP_CD, .name = "cd"},
2566 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2567 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2568 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2569 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2570 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2571 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2572 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2573 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2574 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2575 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2576 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2577 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2578 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2579 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2580 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2581 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2582 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2583 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2584 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2585 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2586 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2587 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2588 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2589 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2590 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2591 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2595 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2596 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2604 {0x1e, 0x01456130}),
2605 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2613 {0x1e, 0x01451130}),
2618 * BIOS auto configuration
2620 /* almost identical with ALC880 parser... */
2621 static int alc882_parse_auto_config(struct hda_codec *codec)
2623 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2624 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2625 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2630 static int patch_alc882(struct hda_codec *codec)
2632 struct alc_spec *spec;
2635 err = alc_alloc_spec(codec, 0x0b);
2641 switch (codec->core.vendor_id) {
2649 /* ALC883 and variants */
2650 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2654 alc_pre_init(codec);
2656 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2658 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2659 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2661 alc_auto_parse_customize_define(codec);
2663 if (has_cdefine_beep(codec))
2664 spec->gen.beep_nid = 0x01;
2666 /* automatic parse from the BIOS config */
2667 err = alc882_parse_auto_config(codec);
2671 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2672 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2677 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2690 static int alc262_parse_auto_config(struct hda_codec *codec)
2692 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2693 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2694 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2701 ALC262_FIXUP_FSC_H270,
2702 ALC262_FIXUP_FSC_S7110,
2703 ALC262_FIXUP_HP_Z200,
2705 ALC262_FIXUP_LENOVO_3000,
2707 ALC262_FIXUP_BENQ_T31,
2708 ALC262_FIXUP_INV_DMIC,
2709 ALC262_FIXUP_INTEL_BAYLEYBAY,
2712 static const struct hda_fixup alc262_fixups[] = {
2713 [ALC262_FIXUP_FSC_H270] = {
2714 .type = HDA_FIXUP_PINS,
2715 .v.pins = (const struct hda_pintbl[]) {
2716 { 0x14, 0x99130110 }, /* speaker */
2717 { 0x15, 0x0221142f }, /* front HP */
2718 { 0x1b, 0x0121141f }, /* rear HP */
2722 [ALC262_FIXUP_FSC_S7110] = {
2723 .type = HDA_FIXUP_PINS,
2724 .v.pins = (const struct hda_pintbl[]) {
2725 { 0x15, 0x90170110 }, /* speaker */
2729 .chain_id = ALC262_FIXUP_BENQ,
2731 [ALC262_FIXUP_HP_Z200] = {
2732 .type = HDA_FIXUP_PINS,
2733 .v.pins = (const struct hda_pintbl[]) {
2734 { 0x16, 0x99130120 }, /* internal speaker */
2738 [ALC262_FIXUP_TYAN] = {
2739 .type = HDA_FIXUP_PINS,
2740 .v.pins = (const struct hda_pintbl[]) {
2741 { 0x14, 0x1993e1f0 }, /* int AUX */
2745 [ALC262_FIXUP_LENOVO_3000] = {
2746 .type = HDA_FIXUP_PINCTLS,
2747 .v.pins = (const struct hda_pintbl[]) {
2748 { 0x19, PIN_VREF50 },
2752 .chain_id = ALC262_FIXUP_BENQ,
2754 [ALC262_FIXUP_BENQ] = {
2755 .type = HDA_FIXUP_VERBS,
2756 .v.verbs = (const struct hda_verb[]) {
2757 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2758 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2762 [ALC262_FIXUP_BENQ_T31] = {
2763 .type = HDA_FIXUP_VERBS,
2764 .v.verbs = (const struct hda_verb[]) {
2765 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2766 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2770 [ALC262_FIXUP_INV_DMIC] = {
2771 .type = HDA_FIXUP_FUNC,
2772 .v.func = alc_fixup_inv_dmic,
2774 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2775 .type = HDA_FIXUP_FUNC,
2776 .v.func = alc_fixup_no_depop_delay,
2780 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2781 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2782 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2783 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2784 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2785 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2786 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2787 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2788 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2789 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2790 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2794 static const struct hda_model_fixup alc262_fixup_models[] = {
2795 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2796 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2797 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2798 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2799 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2800 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2801 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2802 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2803 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2809 static int patch_alc262(struct hda_codec *codec)
2811 struct alc_spec *spec;
2814 err = alc_alloc_spec(codec, 0x0b);
2819 spec->gen.shared_mic_vref_pin = 0x18;
2821 spec->shutup = alc_eapd_shutup;
2824 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2827 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2829 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2831 alc_pre_init(codec);
2833 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2835 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2837 alc_auto_parse_customize_define(codec);
2839 if (has_cdefine_beep(codec))
2840 spec->gen.beep_nid = 0x01;
2842 /* automatic parse from the BIOS config */
2843 err = alc262_parse_auto_config(codec);
2847 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2848 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2853 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2865 /* bind Beep switches of both NID 0x0f and 0x10 */
2866 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2867 struct snd_ctl_elem_value *ucontrol)
2869 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2873 mutex_lock(&codec->control_mutex);
2874 pval = kcontrol->private_value;
2875 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2876 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2878 kcontrol->private_value = (pval & ~0xff) | 0x10;
2879 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2881 kcontrol->private_value = pval;
2882 mutex_unlock(&codec->control_mutex);
2886 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2887 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2889 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2890 .name = "Beep Playback Switch",
2891 .subdevice = HDA_SUBDEV_AMP_FLAG,
2892 .info = snd_hda_mixer_amp_switch_info,
2893 .get = snd_hda_mixer_amp_switch_get,
2894 .put = alc268_beep_switch_put,
2895 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2899 /* set PCBEEP vol = 0, mute connections */
2900 static const struct hda_verb alc268_beep_init_verbs[] = {
2901 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2902 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2903 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2908 ALC268_FIXUP_INV_DMIC,
2909 ALC268_FIXUP_HP_EAPD,
2913 static const struct hda_fixup alc268_fixups[] = {
2914 [ALC268_FIXUP_INV_DMIC] = {
2915 .type = HDA_FIXUP_FUNC,
2916 .v.func = alc_fixup_inv_dmic,
2918 [ALC268_FIXUP_HP_EAPD] = {
2919 .type = HDA_FIXUP_VERBS,
2920 .v.verbs = (const struct hda_verb[]) {
2921 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2925 [ALC268_FIXUP_SPDIF] = {
2926 .type = HDA_FIXUP_PINS,
2927 .v.pins = (const struct hda_pintbl[]) {
2928 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2934 static const struct hda_model_fixup alc268_fixup_models[] = {
2935 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2936 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2937 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2941 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2942 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2943 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2944 /* below is codec SSID since multiple Toshiba laptops have the
2945 * same PCI SSID 1179:ff00
2947 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2952 * BIOS auto configuration
2954 static int alc268_parse_auto_config(struct hda_codec *codec)
2956 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2957 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2962 static int patch_alc268(struct hda_codec *codec)
2964 struct alc_spec *spec;
2967 /* ALC268 has no aa-loopback mixer */
2968 err = alc_alloc_spec(codec, 0);
2973 if (has_cdefine_beep(codec))
2974 spec->gen.beep_nid = 0x01;
2976 spec->shutup = alc_eapd_shutup;
2978 alc_pre_init(codec);
2980 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2981 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2983 /* automatic parse from the BIOS config */
2984 err = alc268_parse_auto_config(codec);
2988 if (err > 0 && !spec->gen.no_analog &&
2989 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2990 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2991 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2992 &alc268_beep_mixer[i])) {
2997 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2998 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2999 /* override the amp caps for beep generator */
3000 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3001 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3002 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3003 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3004 (0 << AC_AMPCAP_MUTE_SHIFT));
3007 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3020 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3021 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3024 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3025 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3028 /* different alc269-variants */
3030 ALC269_TYPE_ALC269VA,
3031 ALC269_TYPE_ALC269VB,
3032 ALC269_TYPE_ALC269VC,
3033 ALC269_TYPE_ALC269VD,
3054 * BIOS auto configuration
3056 static int alc269_parse_auto_config(struct hda_codec *codec)
3058 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3059 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3060 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3061 struct alc_spec *spec = codec->spec;
3062 const hda_nid_t *ssids;
3064 switch (spec->codec_variant) {
3065 case ALC269_TYPE_ALC269VA:
3066 case ALC269_TYPE_ALC269VC:
3067 case ALC269_TYPE_ALC280:
3068 case ALC269_TYPE_ALC284:
3069 case ALC269_TYPE_ALC293:
3070 ssids = alc269va_ssids;
3072 case ALC269_TYPE_ALC269VB:
3073 case ALC269_TYPE_ALC269VD:
3074 case ALC269_TYPE_ALC282:
3075 case ALC269_TYPE_ALC283:
3076 case ALC269_TYPE_ALC286:
3077 case ALC269_TYPE_ALC298:
3078 case ALC269_TYPE_ALC255:
3079 case ALC269_TYPE_ALC256:
3080 case ALC269_TYPE_ALC257:
3081 case ALC269_TYPE_ALC215:
3082 case ALC269_TYPE_ALC225:
3083 case ALC269_TYPE_ALC287:
3084 case ALC269_TYPE_ALC294:
3085 case ALC269_TYPE_ALC300:
3086 case ALC269_TYPE_ALC623:
3087 case ALC269_TYPE_ALC700:
3088 ssids = alc269_ssids;
3091 ssids = alc269_ssids;
3095 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3098 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3099 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3100 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3101 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3102 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3106 static void alc_headset_btn_callback(struct hda_codec *codec,
3107 struct hda_jack_callback *jack)
3111 if (jack->unsol_res & (7 << 13))
3112 report |= SND_JACK_BTN_0;
3114 if (jack->unsol_res & (1 << 16 | 3 << 8))
3115 report |= SND_JACK_BTN_1;
3118 if (jack->unsol_res & (7 << 23))
3119 report |= SND_JACK_BTN_2;
3121 /* Volume down key */
3122 if (jack->unsol_res & (7 << 10))
3123 report |= SND_JACK_BTN_3;
3125 snd_hda_jack_set_button_state(codec, jack->nid, report);
3128 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3130 struct alc_spec *spec = codec->spec;
3132 if (!spec->has_hs_key)
3135 switch (codec->core.vendor_id) {
3143 alc_write_coef_idx(codec, 0x48, 0x0);
3144 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3145 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3150 alc_write_coef_idx(codec, 0x48, 0x0);
3151 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3156 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3158 struct alc_spec *spec = codec->spec;
3160 if (!spec->has_hs_key)
3163 switch (codec->core.vendor_id) {
3171 alc_write_coef_idx(codec, 0x48, 0xd011);
3172 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3173 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3178 alc_write_coef_idx(codec, 0x48, 0xd011);
3179 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3184 static void alc_fixup_headset_jack(struct hda_codec *codec,
3185 const struct hda_fixup *fix, int action)
3187 struct alc_spec *spec = codec->spec;
3191 case HDA_FIXUP_ACT_PRE_PROBE:
3192 spec->has_hs_key = 1;
3193 snd_hda_jack_detect_enable_callback(codec, 0x55,
3194 alc_headset_btn_callback);
3196 case HDA_FIXUP_ACT_BUILD:
3197 hp_pin = alc_get_hp_pin(spec);
3198 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3199 alc_headset_btn_keymap,
3201 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3202 false, SND_JACK_HEADSET,
3203 alc_headset_btn_keymap);
3205 alc_enable_headset_jack_key(codec);
3210 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3212 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3215 static void alc269_shutup(struct hda_codec *codec)
3217 struct alc_spec *spec = codec->spec;
3219 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3220 alc269vb_toggle_power_output(codec, 0);
3221 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3222 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3225 alc_shutup_pins(codec);
3228 static const struct coef_fw alc282_coefs[] = {
3229 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3230 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3231 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3232 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3233 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3234 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3235 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3236 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3237 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3238 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3239 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3240 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3241 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3242 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3243 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3244 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3245 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3246 WRITE_COEF(0x63, 0x2902), /* PLL */
3247 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3248 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3249 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3250 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3251 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3252 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3253 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3254 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3255 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3256 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3257 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3261 static void alc282_restore_default_value(struct hda_codec *codec)
3263 alc_process_coef_fw(codec, alc282_coefs);
3266 static void alc282_init(struct hda_codec *codec)
3268 struct alc_spec *spec = codec->spec;
3269 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3273 alc282_restore_default_value(codec);
3277 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3278 coef78 = alc_read_coef_idx(codec, 0x78);
3280 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3281 /* Headphone capless set to high power mode */
3282 alc_write_coef_idx(codec, 0x78, 0x9004);
3287 snd_hda_codec_write(codec, hp_pin, 0,
3288 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3293 snd_hda_codec_write(codec, hp_pin, 0,
3294 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3299 /* Headphone capless set to normal mode */
3300 alc_write_coef_idx(codec, 0x78, coef78);
3303 static void alc282_shutup(struct hda_codec *codec)
3305 struct alc_spec *spec = codec->spec;
3306 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3311 alc269_shutup(codec);
3315 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3316 coef78 = alc_read_coef_idx(codec, 0x78);
3317 alc_write_coef_idx(codec, 0x78, 0x9004);
3322 snd_hda_codec_write(codec, hp_pin, 0,
3323 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3328 if (!spec->no_shutup_pins)
3329 snd_hda_codec_write(codec, hp_pin, 0,
3330 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3335 alc_auto_setup_eapd(codec, false);
3336 alc_shutup_pins(codec);
3337 alc_write_coef_idx(codec, 0x78, coef78);
3340 static const struct coef_fw alc283_coefs[] = {
3341 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3342 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3343 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3344 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3345 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3346 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3347 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3348 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3349 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3350 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3351 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3352 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3353 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3354 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3355 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3356 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3357 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3358 WRITE_COEF(0x2e, 0x2902), /* PLL */
3359 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3360 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3361 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3362 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3363 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3364 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3365 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3366 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3367 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3368 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3369 WRITE_COEF(0x49, 0x0), /* test mode */
3370 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3371 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3372 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3373 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3377 static void alc283_restore_default_value(struct hda_codec *codec)
3379 alc_process_coef_fw(codec, alc283_coefs);
3382 static void alc283_init(struct hda_codec *codec)
3384 struct alc_spec *spec = codec->spec;
3385 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3388 alc283_restore_default_value(codec);
3394 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3396 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3397 /* Headphone capless set to high power mode */
3398 alc_write_coef_idx(codec, 0x43, 0x9004);
3400 snd_hda_codec_write(codec, hp_pin, 0,
3401 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3406 snd_hda_codec_write(codec, hp_pin, 0,
3407 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3411 /* Index 0x46 Combo jack auto switch control 2 */
3412 /* 3k pull low control for Headset jack. */
3413 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3414 /* Headphone capless set to normal mode */
3415 alc_write_coef_idx(codec, 0x43, 0x9614);
3418 static void alc283_shutup(struct hda_codec *codec)
3420 struct alc_spec *spec = codec->spec;
3421 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3425 alc269_shutup(codec);
3429 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3431 alc_write_coef_idx(codec, 0x43, 0x9004);
3433 /*depop hp during suspend*/
3434 alc_write_coef_idx(codec, 0x06, 0x2100);
3436 snd_hda_codec_write(codec, hp_pin, 0,
3437 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3442 if (!spec->no_shutup_pins)
3443 snd_hda_codec_write(codec, hp_pin, 0,
3444 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3446 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3450 alc_auto_setup_eapd(codec, false);
3451 alc_shutup_pins(codec);
3452 alc_write_coef_idx(codec, 0x43, 0x9614);
3455 static void alc256_init(struct hda_codec *codec)
3457 struct alc_spec *spec = codec->spec;
3458 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3466 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3471 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3472 if (spec->ultra_low_power) {
3473 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3474 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3475 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3476 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3477 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3481 snd_hda_codec_write(codec, hp_pin, 0,
3482 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3484 if (hp_pin_sense || spec->ultra_low_power)
3487 snd_hda_codec_write(codec, hp_pin, 0,
3488 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3490 if (hp_pin_sense || spec->ultra_low_power)
3493 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3494 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3495 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3496 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3498 * Expose headphone mic (or possibly Line In on some machines) instead
3499 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3500 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3503 alc_write_coef_idx(codec, 0x36, 0x5757);
3506 static void alc256_shutup(struct hda_codec *codec)
3508 struct alc_spec *spec = codec->spec;
3509 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3515 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3520 snd_hda_codec_write(codec, hp_pin, 0,
3521 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3523 if (hp_pin_sense || spec->ultra_low_power)
3526 /* 3k pull low control for Headset jack. */
3527 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3528 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3529 * when booting with headset plugged. So skip setting it for the codec alc257
3531 if (codec->core.vendor_id != 0x10ec0257)
3532 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3534 if (!spec->no_shutup_pins)
3535 snd_hda_codec_write(codec, hp_pin, 0,
3536 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3538 if (hp_pin_sense || spec->ultra_low_power)
3541 alc_auto_setup_eapd(codec, false);
3542 alc_shutup_pins(codec);
3543 if (spec->ultra_low_power) {
3545 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3546 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3547 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3548 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3549 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3554 static void alc285_hp_init(struct hda_codec *codec)
3556 struct alc_spec *spec = codec->spec;
3557 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3559 int coef38, coef0d, coef36;
3561 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3562 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3563 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3564 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3565 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3566 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3568 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3571 snd_hda_codec_write(codec, hp_pin, 0,
3572 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3575 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3576 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3579 snd_hda_codec_write(codec, hp_pin, 0,
3580 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3582 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3583 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3584 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3585 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3587 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3588 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3589 for (i = 0; i < 20 && val & 0x8000; i++) {
3591 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3592 } /* Wait for depop procedure finish */
3594 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3595 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3596 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3597 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3600 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3603 static void alc225_init(struct hda_codec *codec)
3605 struct alc_spec *spec = codec->spec;
3606 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3607 bool hp1_pin_sense, hp2_pin_sense;
3609 if (spec->codec_variant != ALC269_TYPE_ALC287)
3610 /* required only at boot or S3 and S4 resume time */
3611 if (!spec->done_hp_init ||
3612 is_s3_resume(codec) ||
3613 is_s4_resume(codec)) {
3614 alc285_hp_init(codec);
3615 spec->done_hp_init = true;
3622 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3623 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3625 if (hp1_pin_sense || hp2_pin_sense)
3628 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3629 if (spec->ultra_low_power) {
3630 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3631 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3632 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3636 if (hp1_pin_sense || spec->ultra_low_power)
3637 snd_hda_codec_write(codec, hp_pin, 0,
3638 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3640 snd_hda_codec_write(codec, 0x16, 0,
3641 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3643 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3646 if (hp1_pin_sense || spec->ultra_low_power)
3647 snd_hda_codec_write(codec, hp_pin, 0,
3648 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3650 snd_hda_codec_write(codec, 0x16, 0,
3651 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3653 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3656 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3657 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3660 static void alc225_shutup(struct hda_codec *codec)
3662 struct alc_spec *spec = codec->spec;
3663 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3664 bool hp1_pin_sense, hp2_pin_sense;
3669 alc_disable_headset_jack_key(codec);
3670 /* 3k pull low control for Headset jack. */
3671 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3673 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3674 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3676 if (hp1_pin_sense || hp2_pin_sense)
3679 if (hp1_pin_sense || spec->ultra_low_power)
3680 snd_hda_codec_write(codec, hp_pin, 0,
3681 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3683 snd_hda_codec_write(codec, 0x16, 0,
3684 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3686 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3689 if (hp1_pin_sense || spec->ultra_low_power)
3690 snd_hda_codec_write(codec, hp_pin, 0,
3691 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3693 snd_hda_codec_write(codec, 0x16, 0,
3694 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3696 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3699 alc_auto_setup_eapd(codec, false);
3700 alc_shutup_pins(codec);
3701 if (spec->ultra_low_power) {
3703 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3704 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3705 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3706 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3710 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3711 alc_enable_headset_jack_key(codec);
3714 static void alc_default_init(struct hda_codec *codec)
3716 struct alc_spec *spec = codec->spec;
3717 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3725 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3730 snd_hda_codec_write(codec, hp_pin, 0,
3731 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3736 snd_hda_codec_write(codec, hp_pin, 0,
3737 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3743 static void alc_default_shutup(struct hda_codec *codec)
3745 struct alc_spec *spec = codec->spec;
3746 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3750 alc269_shutup(codec);
3754 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3759 snd_hda_codec_write(codec, hp_pin, 0,
3760 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3765 if (!spec->no_shutup_pins)
3766 snd_hda_codec_write(codec, hp_pin, 0,
3767 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3772 alc_auto_setup_eapd(codec, false);
3773 alc_shutup_pins(codec);
3776 static void alc294_hp_init(struct hda_codec *codec)
3778 struct alc_spec *spec = codec->spec;
3779 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3785 snd_hda_codec_write(codec, hp_pin, 0,
3786 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3790 if (!spec->no_shutup_pins)
3791 snd_hda_codec_write(codec, hp_pin, 0,
3792 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3794 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3795 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3797 /* Wait for depop procedure finish */
3798 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3799 for (i = 0; i < 20 && val & 0x0080; i++) {
3801 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3803 /* Set HP depop to auto mode */
3804 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3808 static void alc294_init(struct hda_codec *codec)
3810 struct alc_spec *spec = codec->spec;
3812 /* required only at boot or S4 resume time */
3813 if (!spec->done_hp_init ||
3814 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3815 alc294_hp_init(codec);
3816 spec->done_hp_init = true;
3818 alc_default_init(codec);
3821 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3824 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3825 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3826 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3829 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3833 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3834 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3836 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3841 static void alc5505_dsp_halt(struct hda_codec *codec)
3845 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3846 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3847 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3848 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3849 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3850 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3851 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3852 val = alc5505_coef_get(codec, 0x6220);
3853 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3856 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3858 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3859 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3860 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3861 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3862 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3863 alc5505_coef_set(codec, 0x880c, 0x00000004);
3866 static void alc5505_dsp_init(struct hda_codec *codec)
3870 alc5505_dsp_halt(codec);
3871 alc5505_dsp_back_from_halt(codec);
3872 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3873 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3874 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3875 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3876 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3877 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3878 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3879 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3880 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3881 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3882 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3883 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3884 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3886 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3888 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3890 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3892 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3893 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3894 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3895 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3896 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3897 alc5505_coef_set(codec, 0x880c, 0x00000003);
3898 alc5505_coef_set(codec, 0x880c, 0x00000010);
3900 #ifdef HALT_REALTEK_ALC5505
3901 alc5505_dsp_halt(codec);
3905 #ifdef HALT_REALTEK_ALC5505
3906 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3907 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3909 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3910 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3914 static int alc269_suspend(struct hda_codec *codec)
3916 struct alc_spec *spec = codec->spec;
3918 if (spec->has_alc5505_dsp)
3919 alc5505_dsp_suspend(codec);
3920 return alc_suspend(codec);
3923 static int alc269_resume(struct hda_codec *codec)
3925 struct alc_spec *spec = codec->spec;
3927 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3928 alc269vb_toggle_power_output(codec, 0);
3929 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3930 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3934 codec->patch_ops.init(codec);
3936 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3937 alc269vb_toggle_power_output(codec, 1);
3938 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3939 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3943 snd_hda_regmap_sync(codec);
3944 hda_call_check_power_status(codec, 0x01);
3946 /* on some machine, the BIOS will clear the codec gpio data when enter
3947 * suspend, and won't restore the data after resume, so we restore it
3950 if (spec->gpio_data)
3951 alc_write_gpio_data(codec);
3953 if (spec->has_alc5505_dsp)
3954 alc5505_dsp_resume(codec);
3958 #endif /* CONFIG_PM */
3960 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3961 const struct hda_fixup *fix, int action)
3963 struct alc_spec *spec = codec->spec;
3965 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3966 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3969 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3970 const struct hda_fixup *fix,
3973 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3974 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3976 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3977 snd_hda_codec_set_pincfg(codec, 0x19,
3978 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3979 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3982 static void alc269_fixup_hweq(struct hda_codec *codec,
3983 const struct hda_fixup *fix, int action)
3985 if (action == HDA_FIXUP_ACT_INIT)
3986 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3989 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3990 const struct hda_fixup *fix, int action)
3992 struct alc_spec *spec = codec->spec;
3994 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3995 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3998 static void alc271_fixup_dmic(struct hda_codec *codec,
3999 const struct hda_fixup *fix, int action)
4001 static const struct hda_verb verbs[] = {
4002 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4003 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4008 if (strcmp(codec->core.chip_name, "ALC271X") &&
4009 strcmp(codec->core.chip_name, "ALC269VB"))
4011 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4012 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4013 snd_hda_sequence_write(codec, verbs);
4016 /* Fix the speaker amp after resume, etc */
4017 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4018 const struct hda_fixup *fix,
4021 if (action == HDA_FIXUP_ACT_INIT)
4022 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4025 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4026 const struct hda_fixup *fix, int action)
4028 struct alc_spec *spec = codec->spec;
4030 if (action != HDA_FIXUP_ACT_PROBE)
4033 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4034 * fix the sample rate of analog I/O to 44.1kHz
4036 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4037 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4040 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4041 const struct hda_fixup *fix, int action)
4043 /* The digital-mic unit sends PDM (differential signal) instead of
4044 * the standard PCM, thus you can't record a valid mono stream as is.
4045 * Below is a workaround specific to ALC269 to control the dmic
4046 * signal source as mono.
4048 if (action == HDA_FIXUP_ACT_INIT)
4049 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4052 static void alc269_quanta_automute(struct hda_codec *codec)
4054 snd_hda_gen_update_outputs(codec);
4056 alc_write_coef_idx(codec, 0x0c, 0x680);
4057 alc_write_coef_idx(codec, 0x0c, 0x480);
4060 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4061 const struct hda_fixup *fix, int action)
4063 struct alc_spec *spec = codec->spec;
4064 if (action != HDA_FIXUP_ACT_PROBE)
4066 spec->gen.automute_hook = alc269_quanta_automute;
4069 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4070 struct hda_jack_callback *jack)
4072 struct alc_spec *spec = codec->spec;
4075 snd_hda_gen_hp_automute(codec, jack);
4077 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4079 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4082 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4087 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4089 struct hda_alc298_mbxinit {
4090 unsigned char value_0x23;
4091 unsigned char value_0x25;
4094 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4095 const struct hda_alc298_mbxinit *initval,
4098 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4099 alc_write_coef_idx(codec, 0x26, 0xb000);
4102 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4104 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4105 alc_write_coef_idx(codec, 0x26, 0xf000);
4106 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4108 if (initval->value_0x23 != 0x1e)
4109 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4111 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4112 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4115 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4116 const struct hda_fixup *fix,
4119 /* Initialization magic */
4120 static const struct hda_alc298_mbxinit dac_init[] = {
4121 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4122 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4123 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4124 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4125 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4126 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4128 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4129 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4130 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4133 const struct hda_alc298_mbxinit *seq;
4135 if (action != HDA_FIXUP_ACT_INIT)
4139 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4140 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4141 alc_write_coef_idx(codec, 0x26, 0xf000);
4142 alc_write_coef_idx(codec, 0x22, 0x31);
4143 alc_write_coef_idx(codec, 0x23, 0x0b);
4144 alc_write_coef_idx(codec, 0x25, 0x00);
4145 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4146 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4148 for (seq = dac_init; seq->value_0x23; seq++)
4149 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4152 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4153 const struct hda_fixup *fix, int action)
4155 struct alc_spec *spec = codec->spec;
4156 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4157 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4158 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4162 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4163 bool polarity, bool on)
4165 unsigned int pinval;
4171 pinval = snd_hda_codec_get_pin_target(codec, pin);
4172 pinval &= ~AC_PINCTL_VREFEN;
4173 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4174 /* temporarily power up/down for setting VREF */
4175 snd_hda_power_up_pm(codec);
4176 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4177 snd_hda_power_down_pm(codec);
4180 /* update mute-LED according to the speaker mute state via mic VREF pin */
4181 static int vref_mute_led_set(struct led_classdev *led_cdev,
4182 enum led_brightness brightness)
4184 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4185 struct alc_spec *spec = codec->spec;
4187 alc_update_vref_led(codec, spec->mute_led_nid,
4188 spec->mute_led_polarity, brightness);
4192 /* Make sure the led works even in runtime suspend */
4193 static unsigned int led_power_filter(struct hda_codec *codec,
4195 unsigned int power_state)
4197 struct alc_spec *spec = codec->spec;
4199 if (power_state != AC_PWRST_D3 || nid == 0 ||
4200 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4203 /* Set pin ctl again, it might have just been set to 0 */
4204 snd_hda_set_pin_ctl(codec, nid,
4205 snd_hda_codec_get_pin_target(codec, nid));
4207 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4210 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4211 const struct hda_fixup *fix, int action)
4213 struct alc_spec *spec = codec->spec;
4214 const struct dmi_device *dev = NULL;
4216 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4219 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4221 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4223 if (pin < 0x0a || pin >= 0x10)
4225 spec->mute_led_polarity = pol;
4226 spec->mute_led_nid = pin - 0x0a + 0x18;
4227 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4228 codec->power_filter = led_power_filter;
4230 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4231 spec->mute_led_polarity);
4236 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4237 const struct hda_fixup *fix,
4238 int action, hda_nid_t pin)
4240 struct alc_spec *spec = codec->spec;
4242 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4243 spec->mute_led_polarity = 0;
4244 spec->mute_led_nid = pin;
4245 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4246 codec->power_filter = led_power_filter;
4250 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4251 const struct hda_fixup *fix, int action)
4253 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4256 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4257 const struct hda_fixup *fix, int action)
4259 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4262 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4263 const struct hda_fixup *fix, int action)
4265 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4268 /* update LED status via GPIO */
4269 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4270 int polarity, bool enabled)
4274 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4277 /* turn on/off mute LED via GPIO per vmaster hook */
4278 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4279 enum led_brightness brightness)
4281 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4282 struct alc_spec *spec = codec->spec;
4284 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4285 spec->mute_led_polarity, !brightness);
4289 /* turn on/off mic-mute LED via GPIO per capture hook */
4290 static int micmute_led_set(struct led_classdev *led_cdev,
4291 enum led_brightness brightness)
4293 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4294 struct alc_spec *spec = codec->spec;
4296 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4297 spec->micmute_led_polarity, !brightness);
4301 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4302 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4304 unsigned int mute_mask,
4305 unsigned int micmute_mask)
4307 struct alc_spec *spec = codec->spec;
4309 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4311 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4314 spec->gpio_mute_led_mask = mute_mask;
4315 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4318 spec->gpio_mic_led_mask = micmute_mask;
4319 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4323 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4324 const struct hda_fixup *fix, int action)
4326 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4329 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4330 const struct hda_fixup *fix, int action)
4332 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4335 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4336 const struct hda_fixup *fix, int action)
4338 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4341 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4342 const struct hda_fixup *fix, int action)
4344 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4347 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4348 const struct hda_fixup *fix, int action)
4350 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4353 /* turn on/off mic-mute LED per capture hook via VREF change */
4354 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4355 enum led_brightness brightness)
4357 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4358 struct alc_spec *spec = codec->spec;
4360 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4361 spec->micmute_led_polarity, brightness);
4365 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4366 const struct hda_fixup *fix, int action)
4368 struct alc_spec *spec = codec->spec;
4370 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4371 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4372 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4373 * enable headphone amp
4375 spec->gpio_mask |= 0x10;
4376 spec->gpio_dir |= 0x10;
4377 spec->cap_mute_led_nid = 0x18;
4378 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4379 codec->power_filter = led_power_filter;
4383 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4384 const struct hda_fixup *fix, int action)
4386 struct alc_spec *spec = codec->spec;
4388 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4389 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4390 spec->cap_mute_led_nid = 0x18;
4391 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4392 codec->power_filter = led_power_filter;
4396 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4397 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4399 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4400 const struct hda_fixup *fix, int action)
4402 struct alc_spec *spec = codec->spec;
4405 case HDA_FIXUP_ACT_PRE_PROBE:
4406 spec->gpio_mask |= 0x01;
4407 spec->gpio_dir |= 0x01;
4409 case HDA_FIXUP_ACT_INIT:
4410 /* need to toggle GPIO to enable the amp */
4411 alc_update_gpio_data(codec, 0x01, true);
4413 alc_update_gpio_data(codec, 0x01, false);
4418 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4419 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4420 struct hda_codec *codec,
4421 struct snd_pcm_substream *substream,
4425 case HDA_GEN_PCM_ACT_PREPARE:
4426 alc_update_gpio_data(codec, 0x04, true);
4428 case HDA_GEN_PCM_ACT_CLEANUP:
4429 alc_update_gpio_data(codec, 0x04, false);
4434 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4435 const struct hda_fixup *fix,
4438 struct alc_spec *spec = codec->spec;
4440 if (action == HDA_FIXUP_ACT_PROBE) {
4441 spec->gpio_mask |= 0x04;
4442 spec->gpio_dir |= 0x04;
4443 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4447 static void alc_update_coef_led(struct hda_codec *codec,
4448 struct alc_coef_led *led,
4449 bool polarity, bool on)
4453 /* temporarily power up/down for setting COEF bit */
4454 alc_update_coef_idx(codec, led->idx, led->mask,
4455 on ? led->on : led->off);
4458 /* update mute-LED according to the speaker mute state via COEF bit */
4459 static int coef_mute_led_set(struct led_classdev *led_cdev,
4460 enum led_brightness brightness)
4462 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4463 struct alc_spec *spec = codec->spec;
4465 alc_update_coef_led(codec, &spec->mute_led_coef,
4466 spec->mute_led_polarity, brightness);
4470 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4471 const struct hda_fixup *fix,
4474 struct alc_spec *spec = codec->spec;
4476 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4477 spec->mute_led_polarity = 0;
4478 spec->mute_led_coef.idx = 0x0b;
4479 spec->mute_led_coef.mask = 1 << 3;
4480 spec->mute_led_coef.on = 1 << 3;
4481 spec->mute_led_coef.off = 0;
4482 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4486 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4487 const struct hda_fixup *fix,
4490 struct alc_spec *spec = codec->spec;
4492 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4493 spec->mute_led_polarity = 0;
4494 spec->mute_led_coef.idx = 0x34;
4495 spec->mute_led_coef.mask = 1 << 5;
4496 spec->mute_led_coef.on = 0;
4497 spec->mute_led_coef.off = 1 << 5;
4498 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4502 /* turn on/off mic-mute LED per capture hook by coef bit */
4503 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4504 enum led_brightness brightness)
4506 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4507 struct alc_spec *spec = codec->spec;
4509 alc_update_coef_led(codec, &spec->mic_led_coef,
4510 spec->micmute_led_polarity, brightness);
4514 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4515 const struct hda_fixup *fix, int action)
4517 struct alc_spec *spec = codec->spec;
4519 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4520 spec->mic_led_coef.idx = 0x19;
4521 spec->mic_led_coef.mask = 1 << 13;
4522 spec->mic_led_coef.on = 1 << 13;
4523 spec->mic_led_coef.off = 0;
4524 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4528 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4529 const struct hda_fixup *fix, int action)
4531 struct alc_spec *spec = codec->spec;
4533 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4534 spec->mic_led_coef.idx = 0x35;
4535 spec->mic_led_coef.mask = 3 << 2;
4536 spec->mic_led_coef.on = 2 << 2;
4537 spec->mic_led_coef.off = 1 << 2;
4538 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4542 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4543 const struct hda_fixup *fix, int action)
4545 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4546 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4549 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4550 const struct hda_fixup *fix, int action)
4552 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4553 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4556 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4557 const struct hda_fixup *fix, int action)
4559 struct alc_spec *spec = codec->spec;
4561 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4562 spec->cap_mute_led_nid = 0x1a;
4563 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4564 codec->power_filter = led_power_filter;
4568 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4569 const struct hda_fixup *fix, int action)
4571 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4572 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4575 #if IS_REACHABLE(CONFIG_INPUT)
4576 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4577 struct hda_jack_callback *event)
4579 struct alc_spec *spec = codec->spec;
4581 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4582 send both key on and key off event for every interrupt. */
4583 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4584 input_sync(spec->kb_dev);
4585 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4586 input_sync(spec->kb_dev);
4589 static int alc_register_micmute_input_device(struct hda_codec *codec)
4591 struct alc_spec *spec = codec->spec;
4594 spec->kb_dev = input_allocate_device();
4595 if (!spec->kb_dev) {
4596 codec_err(codec, "Out of memory (input_allocate_device)\n");
4600 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4602 spec->kb_dev->name = "Microphone Mute Button";
4603 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4604 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4605 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4606 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4607 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4608 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4610 if (input_register_device(spec->kb_dev)) {
4611 codec_err(codec, "input_register_device failed\n");
4612 input_free_device(spec->kb_dev);
4613 spec->kb_dev = NULL;
4620 /* GPIO1 = set according to SKU external amp
4621 * GPIO2 = mic mute hotkey
4623 * GPIO4 = mic mute LED
4625 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4626 const struct hda_fixup *fix, int action)
4628 struct alc_spec *spec = codec->spec;
4630 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4631 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4632 spec->init_amp = ALC_INIT_DEFAULT;
4633 if (alc_register_micmute_input_device(codec) != 0)
4636 spec->gpio_mask |= 0x06;
4637 spec->gpio_dir |= 0x02;
4638 spec->gpio_data |= 0x02;
4639 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4640 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4641 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4642 gpio2_mic_hotkey_event);
4650 case HDA_FIXUP_ACT_FREE:
4651 input_unregister_device(spec->kb_dev);
4652 spec->kb_dev = NULL;
4656 /* Line2 = mic mute hotkey
4657 * GPIO2 = mic mute LED
4659 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4660 const struct hda_fixup *fix, int action)
4662 struct alc_spec *spec = codec->spec;
4664 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4665 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4666 spec->init_amp = ALC_INIT_DEFAULT;
4667 if (alc_register_micmute_input_device(codec) != 0)
4670 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4671 gpio2_mic_hotkey_event);
4679 case HDA_FIXUP_ACT_FREE:
4680 input_unregister_device(spec->kb_dev);
4681 spec->kb_dev = NULL;
4685 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4686 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4689 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4690 const struct hda_fixup *fix, int action)
4692 struct alc_spec *spec = codec->spec;
4694 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4695 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4696 spec->cap_mute_led_nid = 0x18;
4697 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4701 static const struct coef_fw alc225_pre_hsmode[] = {
4702 UPDATE_COEF(0x4a, 1<<8, 0),
4703 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4704 UPDATE_COEF(0x63, 3<<14, 3<<14),
4705 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4706 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4707 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4708 UPDATE_COEF(0x4a, 3<<10, 0),
4712 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4714 struct alc_spec *spec = codec->spec;
4715 static const struct coef_fw coef0255[] = {
4716 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4717 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4718 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4719 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4720 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4723 static const struct coef_fw coef0256[] = {
4724 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4725 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4726 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4727 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4728 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4731 static const struct coef_fw coef0233[] = {
4732 WRITE_COEF(0x1b, 0x0c0b),
4733 WRITE_COEF(0x45, 0xc429),
4734 UPDATE_COEF(0x35, 0x4000, 0),
4735 WRITE_COEF(0x06, 0x2104),
4736 WRITE_COEF(0x1a, 0x0001),
4737 WRITE_COEF(0x26, 0x0004),
4738 WRITE_COEF(0x32, 0x42a3),
4741 static const struct coef_fw coef0288[] = {
4742 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4743 UPDATE_COEF(0x50, 0x2000, 0x2000),
4744 UPDATE_COEF(0x56, 0x0006, 0x0006),
4745 UPDATE_COEF(0x66, 0x0008, 0),
4746 UPDATE_COEF(0x67, 0x2000, 0),
4749 static const struct coef_fw coef0298[] = {
4750 UPDATE_COEF(0x19, 0x1300, 0x0300),
4753 static const struct coef_fw coef0292[] = {
4754 WRITE_COEF(0x76, 0x000e),
4755 WRITE_COEF(0x6c, 0x2400),
4756 WRITE_COEF(0x18, 0x7308),
4757 WRITE_COEF(0x6b, 0xc429),
4760 static const struct coef_fw coef0293[] = {
4761 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4762 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4763 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4764 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4765 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4766 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4769 static const struct coef_fw coef0668[] = {
4770 WRITE_COEF(0x15, 0x0d40),
4771 WRITE_COEF(0xb7, 0x802b),
4774 static const struct coef_fw coef0225[] = {
4775 UPDATE_COEF(0x63, 3<<14, 0),
4778 static const struct coef_fw coef0274[] = {
4779 UPDATE_COEF(0x4a, 0x0100, 0),
4780 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4781 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4782 UPDATE_COEF(0x4a, 0x0010, 0),
4783 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4784 WRITE_COEF(0x45, 0x5289),
4785 UPDATE_COEF(0x4a, 0x0c00, 0),
4789 if (spec->no_internal_mic_pin) {
4790 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4794 switch (codec->core.vendor_id) {
4796 alc_process_coef_fw(codec, coef0255);
4801 alc_process_coef_fw(codec, coef0256);
4806 alc_process_coef_fw(codec, coef0274);
4810 alc_process_coef_fw(codec, coef0233);
4814 alc_process_coef_fw(codec, coef0288);
4817 alc_process_coef_fw(codec, coef0298);
4818 alc_process_coef_fw(codec, coef0288);
4821 alc_process_coef_fw(codec, coef0292);
4824 alc_process_coef_fw(codec, coef0293);
4827 alc_process_coef_fw(codec, coef0668);
4835 alc_process_coef_fw(codec, alc225_pre_hsmode);
4836 alc_process_coef_fw(codec, coef0225);
4839 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4842 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4846 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4849 static const struct coef_fw coef0255[] = {
4850 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4851 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4854 static const struct coef_fw coef0256[] = {
4855 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4856 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4857 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4860 static const struct coef_fw coef0233[] = {
4861 UPDATE_COEF(0x35, 0, 1<<14),
4862 WRITE_COEF(0x06, 0x2100),
4863 WRITE_COEF(0x1a, 0x0021),
4864 WRITE_COEF(0x26, 0x008c),
4867 static const struct coef_fw coef0288[] = {
4868 UPDATE_COEF(0x4f, 0x00c0, 0),
4869 UPDATE_COEF(0x50, 0x2000, 0),
4870 UPDATE_COEF(0x56, 0x0006, 0),
4871 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4872 UPDATE_COEF(0x66, 0x0008, 0x0008),
4873 UPDATE_COEF(0x67, 0x2000, 0x2000),
4876 static const struct coef_fw coef0292[] = {
4877 WRITE_COEF(0x19, 0xa208),
4878 WRITE_COEF(0x2e, 0xacf0),
4881 static const struct coef_fw coef0293[] = {
4882 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4883 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4884 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4887 static const struct coef_fw coef0688[] = {
4888 WRITE_COEF(0xb7, 0x802b),
4889 WRITE_COEF(0xb5, 0x1040),
4890 UPDATE_COEF(0xc3, 0, 1<<12),
4893 static const struct coef_fw coef0225[] = {
4894 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4895 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4896 UPDATE_COEF(0x63, 3<<14, 0),
4899 static const struct coef_fw coef0274[] = {
4900 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4901 UPDATE_COEF(0x4a, 0x0010, 0),
4902 UPDATE_COEF(0x6b, 0xf000, 0),
4906 switch (codec->core.vendor_id) {
4908 alc_write_coef_idx(codec, 0x45, 0xc489);
4909 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4910 alc_process_coef_fw(codec, coef0255);
4911 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4916 alc_write_coef_idx(codec, 0x45, 0xc489);
4917 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4918 alc_process_coef_fw(codec, coef0256);
4919 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4924 alc_write_coef_idx(codec, 0x45, 0x4689);
4925 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4926 alc_process_coef_fw(codec, coef0274);
4927 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4931 alc_write_coef_idx(codec, 0x45, 0xc429);
4932 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4933 alc_process_coef_fw(codec, coef0233);
4934 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4939 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4940 alc_process_coef_fw(codec, coef0288);
4941 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4944 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4945 alc_process_coef_fw(codec, coef0292);
4948 /* Set to TRS mode */
4949 alc_write_coef_idx(codec, 0x45, 0xc429);
4950 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4951 alc_process_coef_fw(codec, coef0293);
4952 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4955 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4959 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4960 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4963 alc_write_coef_idx(codec, 0x11, 0x0001);
4964 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4965 alc_process_coef_fw(codec, coef0688);
4966 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4974 alc_process_coef_fw(codec, alc225_pre_hsmode);
4975 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4976 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4977 alc_process_coef_fw(codec, coef0225);
4978 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4981 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4984 static void alc_headset_mode_default(struct hda_codec *codec)
4986 static const struct coef_fw coef0225[] = {
4987 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4988 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4989 UPDATE_COEF(0x49, 3<<8, 0<<8),
4990 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4991 UPDATE_COEF(0x63, 3<<14, 0),
4992 UPDATE_COEF(0x67, 0xf000, 0x3000),
4995 static const struct coef_fw coef0255[] = {
4996 WRITE_COEF(0x45, 0xc089),
4997 WRITE_COEF(0x45, 0xc489),
4998 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4999 WRITE_COEF(0x49, 0x0049),
5002 static const struct coef_fw coef0256[] = {
5003 WRITE_COEF(0x45, 0xc489),
5004 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5005 WRITE_COEF(0x49, 0x0049),
5006 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5007 WRITE_COEF(0x06, 0x6100),
5010 static const struct coef_fw coef0233[] = {
5011 WRITE_COEF(0x06, 0x2100),
5012 WRITE_COEF(0x32, 0x4ea3),
5015 static const struct coef_fw coef0288[] = {
5016 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5017 UPDATE_COEF(0x50, 0x2000, 0x2000),
5018 UPDATE_COEF(0x56, 0x0006, 0x0006),
5019 UPDATE_COEF(0x66, 0x0008, 0),
5020 UPDATE_COEF(0x67, 0x2000, 0),
5023 static const struct coef_fw coef0292[] = {
5024 WRITE_COEF(0x76, 0x000e),
5025 WRITE_COEF(0x6c, 0x2400),
5026 WRITE_COEF(0x6b, 0xc429),
5027 WRITE_COEF(0x18, 0x7308),
5030 static const struct coef_fw coef0293[] = {
5031 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5032 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5033 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5036 static const struct coef_fw coef0688[] = {
5037 WRITE_COEF(0x11, 0x0041),
5038 WRITE_COEF(0x15, 0x0d40),
5039 WRITE_COEF(0xb7, 0x802b),
5042 static const struct coef_fw coef0274[] = {
5043 WRITE_COEF(0x45, 0x4289),
5044 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5045 UPDATE_COEF(0x6b, 0x0f00, 0),
5046 UPDATE_COEF(0x49, 0x0300, 0x0300),
5050 switch (codec->core.vendor_id) {
5057 alc_process_coef_fw(codec, alc225_pre_hsmode);
5058 alc_process_coef_fw(codec, coef0225);
5061 alc_process_coef_fw(codec, coef0255);
5066 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5067 alc_write_coef_idx(codec, 0x45, 0xc089);
5069 alc_process_coef_fw(codec, coef0256);
5074 alc_process_coef_fw(codec, coef0274);
5078 alc_process_coef_fw(codec, coef0233);
5083 alc_process_coef_fw(codec, coef0288);
5086 alc_process_coef_fw(codec, coef0292);
5089 alc_process_coef_fw(codec, coef0293);
5092 alc_process_coef_fw(codec, coef0688);
5095 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5098 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5102 static void alc_headset_mode_ctia(struct hda_codec *codec)
5106 static const struct coef_fw coef0255[] = {
5107 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5108 WRITE_COEF(0x1b, 0x0c2b),
5109 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5112 static const struct coef_fw coef0256[] = {
5113 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5114 WRITE_COEF(0x1b, 0x0e6b),
5117 static const struct coef_fw coef0233[] = {
5118 WRITE_COEF(0x45, 0xd429),
5119 WRITE_COEF(0x1b, 0x0c2b),
5120 WRITE_COEF(0x32, 0x4ea3),
5123 static const struct coef_fw coef0288[] = {
5124 UPDATE_COEF(0x50, 0x2000, 0x2000),
5125 UPDATE_COEF(0x56, 0x0006, 0x0006),
5126 UPDATE_COEF(0x66, 0x0008, 0),
5127 UPDATE_COEF(0x67, 0x2000, 0),
5130 static const struct coef_fw coef0292[] = {
5131 WRITE_COEF(0x6b, 0xd429),
5132 WRITE_COEF(0x76, 0x0008),
5133 WRITE_COEF(0x18, 0x7388),
5136 static const struct coef_fw coef0293[] = {
5137 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5138 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5141 static const struct coef_fw coef0688[] = {
5142 WRITE_COEF(0x11, 0x0001),
5143 WRITE_COEF(0x15, 0x0d60),
5144 WRITE_COEF(0xc3, 0x0000),
5147 static const struct coef_fw coef0225_1[] = {
5148 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5149 UPDATE_COEF(0x63, 3<<14, 2<<14),
5152 static const struct coef_fw coef0225_2[] = {
5153 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5154 UPDATE_COEF(0x63, 3<<14, 1<<14),
5158 switch (codec->core.vendor_id) {
5160 alc_process_coef_fw(codec, coef0255);
5165 alc_process_coef_fw(codec, coef0256);
5170 alc_write_coef_idx(codec, 0x45, 0xd689);
5174 alc_process_coef_fw(codec, coef0233);
5177 val = alc_read_coef_idx(codec, 0x50);
5178 if (val & (1 << 12)) {
5179 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5180 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5183 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5184 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5190 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5192 alc_process_coef_fw(codec, coef0288);
5195 alc_process_coef_fw(codec, coef0292);
5198 alc_process_coef_fw(codec, coef0293);
5201 alc_process_coef_fw(codec, coef0688);
5209 val = alc_read_coef_idx(codec, 0x45);
5211 alc_process_coef_fw(codec, coef0225_2);
5213 alc_process_coef_fw(codec, coef0225_1);
5216 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5219 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5223 static void alc_headset_mode_omtp(struct hda_codec *codec)
5225 static const struct coef_fw coef0255[] = {
5226 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5227 WRITE_COEF(0x1b, 0x0c2b),
5228 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5231 static const struct coef_fw coef0256[] = {
5232 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5233 WRITE_COEF(0x1b, 0x0e6b),
5236 static const struct coef_fw coef0233[] = {
5237 WRITE_COEF(0x45, 0xe429),
5238 WRITE_COEF(0x1b, 0x0c2b),
5239 WRITE_COEF(0x32, 0x4ea3),
5242 static const struct coef_fw coef0288[] = {
5243 UPDATE_COEF(0x50, 0x2000, 0x2000),
5244 UPDATE_COEF(0x56, 0x0006, 0x0006),
5245 UPDATE_COEF(0x66, 0x0008, 0),
5246 UPDATE_COEF(0x67, 0x2000, 0),
5249 static const struct coef_fw coef0292[] = {
5250 WRITE_COEF(0x6b, 0xe429),
5251 WRITE_COEF(0x76, 0x0008),
5252 WRITE_COEF(0x18, 0x7388),
5255 static const struct coef_fw coef0293[] = {
5256 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5257 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5260 static const struct coef_fw coef0688[] = {
5261 WRITE_COEF(0x11, 0x0001),
5262 WRITE_COEF(0x15, 0x0d50),
5263 WRITE_COEF(0xc3, 0x0000),
5266 static const struct coef_fw coef0225[] = {
5267 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5268 UPDATE_COEF(0x63, 3<<14, 2<<14),
5272 switch (codec->core.vendor_id) {
5274 alc_process_coef_fw(codec, coef0255);
5279 alc_process_coef_fw(codec, coef0256);
5284 alc_write_coef_idx(codec, 0x45, 0xe689);
5288 alc_process_coef_fw(codec, coef0233);
5291 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5292 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5297 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5299 alc_process_coef_fw(codec, coef0288);
5302 alc_process_coef_fw(codec, coef0292);
5305 alc_process_coef_fw(codec, coef0293);
5308 alc_process_coef_fw(codec, coef0688);
5316 alc_process_coef_fw(codec, coef0225);
5319 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5322 static void alc_determine_headset_type(struct hda_codec *codec)
5325 bool is_ctia = false;
5326 struct alc_spec *spec = codec->spec;
5327 static const struct coef_fw coef0255[] = {
5328 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5329 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5333 static const struct coef_fw coef0288[] = {
5334 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5337 static const struct coef_fw coef0298[] = {
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 UPDATE_COEF(0x19, 0x1300, 0x1300),
5345 static const struct coef_fw coef0293[] = {
5346 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5347 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5350 static const struct coef_fw coef0688[] = {
5351 WRITE_COEF(0x11, 0x0001),
5352 WRITE_COEF(0xb7, 0x802b),
5353 WRITE_COEF(0x15, 0x0d60),
5354 WRITE_COEF(0xc3, 0x0c00),
5357 static const struct coef_fw coef0274[] = {
5358 UPDATE_COEF(0x4a, 0x0010, 0),
5359 UPDATE_COEF(0x4a, 0x8000, 0),
5360 WRITE_COEF(0x45, 0xd289),
5361 UPDATE_COEF(0x49, 0x0300, 0x0300),
5365 if (spec->no_internal_mic_pin) {
5366 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5370 switch (codec->core.vendor_id) {
5372 alc_process_coef_fw(codec, coef0255);
5374 val = alc_read_coef_idx(codec, 0x46);
5375 is_ctia = (val & 0x0070) == 0x0070;
5380 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5381 alc_write_coef_idx(codec, 0x06, 0x6104);
5382 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5384 snd_hda_codec_write(codec, 0x21, 0,
5385 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5387 snd_hda_codec_write(codec, 0x21, 0,
5388 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5390 alc_process_coef_fw(codec, coef0255);
5392 val = alc_read_coef_idx(codec, 0x46);
5393 is_ctia = (val & 0x0070) == 0x0070;
5395 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5396 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5398 snd_hda_codec_write(codec, 0x21, 0,
5399 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5401 snd_hda_codec_write(codec, 0x21, 0,
5402 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5407 alc_process_coef_fw(codec, coef0274);
5409 val = alc_read_coef_idx(codec, 0x46);
5410 is_ctia = (val & 0x00f0) == 0x00f0;
5414 alc_write_coef_idx(codec, 0x45, 0xd029);
5416 val = alc_read_coef_idx(codec, 0x46);
5417 is_ctia = (val & 0x0070) == 0x0070;
5420 snd_hda_codec_write(codec, 0x21, 0,
5421 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5423 snd_hda_codec_write(codec, 0x21, 0,
5424 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5427 val = alc_read_coef_idx(codec, 0x50);
5428 if (val & (1 << 12)) {
5429 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5430 alc_process_coef_fw(codec, coef0288);
5432 val = alc_read_coef_idx(codec, 0x50);
5433 is_ctia = (val & 0x0070) == 0x0070;
5435 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5436 alc_process_coef_fw(codec, coef0288);
5438 val = alc_read_coef_idx(codec, 0x50);
5439 is_ctia = (val & 0x0070) == 0x0070;
5441 alc_process_coef_fw(codec, coef0298);
5442 snd_hda_codec_write(codec, 0x21, 0,
5443 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5445 snd_hda_codec_write(codec, 0x21, 0,
5446 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5450 alc_process_coef_fw(codec, coef0288);
5452 val = alc_read_coef_idx(codec, 0x50);
5453 is_ctia = (val & 0x0070) == 0x0070;
5456 alc_write_coef_idx(codec, 0x6b, 0xd429);
5458 val = alc_read_coef_idx(codec, 0x6c);
5459 is_ctia = (val & 0x001c) == 0x001c;
5462 alc_process_coef_fw(codec, coef0293);
5464 val = alc_read_coef_idx(codec, 0x46);
5465 is_ctia = (val & 0x0070) == 0x0070;
5468 alc_process_coef_fw(codec, coef0688);
5470 val = alc_read_coef_idx(codec, 0xbe);
5471 is_ctia = (val & 0x1c02) == 0x1c02;
5479 snd_hda_codec_write(codec, 0x21, 0,
5480 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5482 snd_hda_codec_write(codec, 0x21, 0,
5483 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5485 alc_process_coef_fw(codec, alc225_pre_hsmode);
5486 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5487 val = alc_read_coef_idx(codec, 0x45);
5488 if (val & (1 << 9)) {
5489 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5490 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5492 val = alc_read_coef_idx(codec, 0x46);
5493 is_ctia = (val & 0x00f0) == 0x00f0;
5495 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5496 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5498 val = alc_read_coef_idx(codec, 0x46);
5499 is_ctia = (val & 0x00f0) == 0x00f0;
5501 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5502 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5503 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5505 snd_hda_codec_write(codec, 0x21, 0,
5506 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5508 snd_hda_codec_write(codec, 0x21, 0,
5509 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5516 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5517 is_ctia ? "yes" : "no");
5518 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5521 static void alc_update_headset_mode(struct hda_codec *codec)
5523 struct alc_spec *spec = codec->spec;
5525 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5526 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5528 int new_headset_mode;
5530 if (!snd_hda_jack_detect(codec, hp_pin))
5531 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5532 else if (mux_pin == spec->headset_mic_pin)
5533 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5534 else if (mux_pin == spec->headphone_mic_pin)
5535 new_headset_mode = ALC_HEADSET_MODE_MIC;
5537 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5539 if (new_headset_mode == spec->current_headset_mode) {
5540 snd_hda_gen_update_outputs(codec);
5544 switch (new_headset_mode) {
5545 case ALC_HEADSET_MODE_UNPLUGGED:
5546 alc_headset_mode_unplugged(codec);
5547 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5548 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5549 spec->gen.hp_jack_present = false;
5551 case ALC_HEADSET_MODE_HEADSET:
5552 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5553 alc_determine_headset_type(codec);
5554 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5555 alc_headset_mode_ctia(codec);
5556 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5557 alc_headset_mode_omtp(codec);
5558 spec->gen.hp_jack_present = true;
5560 case ALC_HEADSET_MODE_MIC:
5561 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5562 spec->gen.hp_jack_present = false;
5564 case ALC_HEADSET_MODE_HEADPHONE:
5565 alc_headset_mode_default(codec);
5566 spec->gen.hp_jack_present = true;
5569 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5570 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5571 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5572 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5573 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5576 spec->current_headset_mode = new_headset_mode;
5578 snd_hda_gen_update_outputs(codec);
5581 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5582 struct snd_kcontrol *kcontrol,
5583 struct snd_ctl_elem_value *ucontrol)
5585 alc_update_headset_mode(codec);
5588 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5589 struct hda_jack_callback *jack)
5591 snd_hda_gen_hp_automute(codec, jack);
5592 alc_update_headset_mode(codec);
5595 static void alc_probe_headset_mode(struct hda_codec *codec)
5598 struct alc_spec *spec = codec->spec;
5599 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5602 for (i = 0; i < cfg->num_inputs; i++) {
5603 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5604 spec->headset_mic_pin = cfg->inputs[i].pin;
5605 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5606 spec->headphone_mic_pin = cfg->inputs[i].pin;
5609 WARN_ON(spec->gen.cap_sync_hook);
5610 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5611 spec->gen.automute_hook = alc_update_headset_mode;
5612 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5615 static void alc_fixup_headset_mode(struct hda_codec *codec,
5616 const struct hda_fixup *fix, int action)
5618 struct alc_spec *spec = codec->spec;
5621 case HDA_FIXUP_ACT_PRE_PROBE:
5622 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5624 case HDA_FIXUP_ACT_PROBE:
5625 alc_probe_headset_mode(codec);
5627 case HDA_FIXUP_ACT_INIT:
5628 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5629 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5630 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5632 alc_update_headset_mode(codec);
5637 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5638 const struct hda_fixup *fix, int action)
5640 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5641 struct alc_spec *spec = codec->spec;
5642 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5645 alc_fixup_headset_mode(codec, fix, action);
5648 static void alc255_set_default_jack_type(struct hda_codec *codec)
5650 /* Set to iphone type */
5651 static const struct coef_fw alc255fw[] = {
5652 WRITE_COEF(0x1b, 0x880b),
5653 WRITE_COEF(0x45, 0xd089),
5654 WRITE_COEF(0x1b, 0x080b),
5655 WRITE_COEF(0x46, 0x0004),
5656 WRITE_COEF(0x1b, 0x0c0b),
5659 static const struct coef_fw alc256fw[] = {
5660 WRITE_COEF(0x1b, 0x884b),
5661 WRITE_COEF(0x45, 0xd089),
5662 WRITE_COEF(0x1b, 0x084b),
5663 WRITE_COEF(0x46, 0x0004),
5664 WRITE_COEF(0x1b, 0x0c4b),
5667 switch (codec->core.vendor_id) {
5669 alc_process_coef_fw(codec, alc255fw);
5674 alc_process_coef_fw(codec, alc256fw);
5680 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5681 const struct hda_fixup *fix, int action)
5683 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5684 alc255_set_default_jack_type(codec);
5686 alc_fixup_headset_mode(codec, fix, action);
5689 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5690 const struct hda_fixup *fix, int action)
5692 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5693 struct alc_spec *spec = codec->spec;
5694 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5695 alc255_set_default_jack_type(codec);
5698 alc_fixup_headset_mode(codec, fix, action);
5701 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5702 struct hda_jack_callback *jack)
5704 struct alc_spec *spec = codec->spec;
5706 alc_update_headset_jack_cb(codec, jack);
5707 /* Headset Mic enable or disable, only for Dell Dino */
5708 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5711 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5712 const struct hda_fixup *fix, int action)
5714 alc_fixup_headset_mode(codec, fix, action);
5715 if (action == HDA_FIXUP_ACT_PROBE) {
5716 struct alc_spec *spec = codec->spec;
5717 /* toggled via hp_automute_hook */
5718 spec->gpio_mask |= 0x40;
5719 spec->gpio_dir |= 0x40;
5720 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5724 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5725 const struct hda_fixup *fix, int action)
5727 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5728 struct alc_spec *spec = codec->spec;
5729 spec->gen.auto_mute_via_amp = 1;
5733 static void alc_fixup_no_shutup(struct hda_codec *codec,
5734 const struct hda_fixup *fix, int action)
5736 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5737 struct alc_spec *spec = codec->spec;
5738 spec->no_shutup_pins = 1;
5742 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5743 const struct hda_fixup *fix, int action)
5745 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5746 struct alc_spec *spec = codec->spec;
5747 /* Disable AA-loopback as it causes white noise */
5748 spec->gen.mixer_nid = 0;
5752 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5753 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5754 const struct hda_fixup *fix, int action)
5756 static const struct hda_pintbl pincfgs[] = {
5757 { 0x16, 0x21211010 }, /* dock headphone */
5758 { 0x19, 0x21a11010 }, /* dock mic */
5761 struct alc_spec *spec = codec->spec;
5763 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5764 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5765 codec->power_save_node = 0; /* avoid click noises */
5766 snd_hda_apply_pincfgs(codec, pincfgs);
5770 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5771 const struct hda_fixup *fix, int action)
5773 static const struct hda_pintbl pincfgs[] = {
5774 { 0x17, 0x21211010 }, /* dock headphone */
5775 { 0x19, 0x21a11010 }, /* dock mic */
5778 struct alc_spec *spec = codec->spec;
5780 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5781 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5782 snd_hda_apply_pincfgs(codec, pincfgs);
5783 } else if (action == HDA_FIXUP_ACT_INIT) {
5784 /* Enable DOCK device */
5785 snd_hda_codec_write(codec, 0x17, 0,
5786 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5787 /* Enable DOCK device */
5788 snd_hda_codec_write(codec, 0x19, 0,
5789 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5793 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5794 const struct hda_fixup *fix, int action)
5796 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5797 * the speaker output becomes too low by some reason on Thinkpads with
5800 static const hda_nid_t preferred_pairs[] = {
5801 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5804 struct alc_spec *spec = codec->spec;
5806 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5807 spec->gen.preferred_dacs = preferred_pairs;
5810 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5811 const struct hda_fixup *fix, int action)
5813 static const hda_nid_t preferred_pairs[] = {
5814 0x17, 0x02, 0x21, 0x03, 0
5816 struct alc_spec *spec = codec->spec;
5818 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5819 spec->gen.preferred_dacs = preferred_pairs;
5822 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5824 struct alc_spec *spec = codec->spec;
5825 int hp_pin = alc_get_hp_pin(spec);
5827 /* Prevent pop noises when headphones are plugged in */
5828 snd_hda_codec_write(codec, hp_pin, 0,
5829 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5833 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5834 const struct hda_fixup *fix, int action)
5836 struct alc_spec *spec = codec->spec;
5837 struct hda_input_mux *imux = &spec->gen.input_mux;
5841 case HDA_FIXUP_ACT_PRE_PROBE:
5842 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5843 * it causes a click noise at start up
5845 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5846 spec->shutup = alc_shutup_dell_xps13;
5848 case HDA_FIXUP_ACT_PROBE:
5849 /* Make the internal mic the default input source. */
5850 for (i = 0; i < imux->num_items; i++) {
5851 if (spec->gen.imux_pins[i] == 0x12) {
5852 spec->gen.cur_mux[0] = i;
5860 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5861 const struct hda_fixup *fix, int action)
5863 struct alc_spec *spec = codec->spec;
5865 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5866 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5867 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5869 /* Disable boost for mic-in permanently. (This code is only called
5870 from quirks that guarantee that the headphone is at NID 0x1b.) */
5871 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5872 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5874 alc_fixup_headset_mode(codec, fix, action);
5877 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5878 const struct hda_fixup *fix, int action)
5880 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5881 alc_write_coef_idx(codec, 0xc4, 0x8000);
5882 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5883 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5885 alc_fixup_headset_mode(codec, fix, action);
5888 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5889 static int find_ext_mic_pin(struct hda_codec *codec)
5891 struct alc_spec *spec = codec->spec;
5892 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5894 unsigned int defcfg;
5897 for (i = 0; i < cfg->num_inputs; i++) {
5898 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5900 nid = cfg->inputs[i].pin;
5901 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5902 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5910 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5911 const struct hda_fixup *fix,
5914 struct alc_spec *spec = codec->spec;
5916 if (action == HDA_FIXUP_ACT_PROBE) {
5917 int mic_pin = find_ext_mic_pin(codec);
5918 int hp_pin = alc_get_hp_pin(spec);
5920 if (snd_BUG_ON(!mic_pin || !hp_pin))
5922 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5926 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5927 const struct hda_fixup *fix,
5930 struct alc_spec *spec = codec->spec;
5931 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5934 /* The mic boosts on level 2 and 3 are too noisy
5935 on the internal mic input.
5936 Therefore limit the boost to 0 or 1. */
5938 if (action != HDA_FIXUP_ACT_PROBE)
5941 for (i = 0; i < cfg->num_inputs; i++) {
5942 hda_nid_t nid = cfg->inputs[i].pin;
5943 unsigned int defcfg;
5944 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5946 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5947 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5950 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5951 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5952 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5953 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5954 (0 << AC_AMPCAP_MUTE_SHIFT));
5958 static void alc283_hp_automute_hook(struct hda_codec *codec,
5959 struct hda_jack_callback *jack)
5961 struct alc_spec *spec = codec->spec;
5965 snd_hda_gen_hp_automute(codec, jack);
5967 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5970 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5974 static void alc283_fixup_chromebook(struct hda_codec *codec,
5975 const struct hda_fixup *fix, int action)
5977 struct alc_spec *spec = codec->spec;
5980 case HDA_FIXUP_ACT_PRE_PROBE:
5981 snd_hda_override_wcaps(codec, 0x03, 0);
5982 /* Disable AA-loopback as it causes white noise */
5983 spec->gen.mixer_nid = 0;
5985 case HDA_FIXUP_ACT_INIT:
5986 /* MIC2-VREF control */
5987 /* Set to manual mode */
5988 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5989 /* Enable Line1 input control by verb */
5990 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5995 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5996 const struct hda_fixup *fix, int action)
5998 struct alc_spec *spec = codec->spec;
6001 case HDA_FIXUP_ACT_PRE_PROBE:
6002 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6004 case HDA_FIXUP_ACT_INIT:
6005 /* MIC2-VREF control */
6006 /* Set to manual mode */
6007 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6012 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6013 static void asus_tx300_automute(struct hda_codec *codec)
6015 struct alc_spec *spec = codec->spec;
6016 snd_hda_gen_update_outputs(codec);
6017 if (snd_hda_jack_detect(codec, 0x1b))
6018 spec->gen.mute_bits |= (1ULL << 0x14);
6021 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6022 const struct hda_fixup *fix, int action)
6024 struct alc_spec *spec = codec->spec;
6025 static const struct hda_pintbl dock_pins[] = {
6026 { 0x1b, 0x21114000 }, /* dock speaker pin */
6031 case HDA_FIXUP_ACT_PRE_PROBE:
6032 spec->init_amp = ALC_INIT_DEFAULT;
6033 /* TX300 needs to set up GPIO2 for the speaker amp */
6034 alc_setup_gpio(codec, 0x04);
6035 snd_hda_apply_pincfgs(codec, dock_pins);
6036 spec->gen.auto_mute_via_amp = 1;
6037 spec->gen.automute_hook = asus_tx300_automute;
6038 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6039 snd_hda_gen_hp_automute);
6041 case HDA_FIXUP_ACT_PROBE:
6042 spec->init_amp = ALC_INIT_DEFAULT;
6044 case HDA_FIXUP_ACT_BUILD:
6045 /* this is a bit tricky; give more sane names for the main
6046 * (tablet) speaker and the dock speaker, respectively
6048 rename_ctl(codec, "Speaker Playback Switch",
6049 "Dock Speaker Playback Switch");
6050 rename_ctl(codec, "Bass Speaker Playback Switch",
6051 "Speaker Playback Switch");
6056 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6057 const struct hda_fixup *fix, int action)
6059 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6060 /* DAC node 0x03 is giving mono output. We therefore want to
6061 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6062 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6063 static const hda_nid_t conn1[] = { 0x0c };
6064 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6065 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6069 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6070 const struct hda_fixup *fix, int action)
6072 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6073 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6074 we can't adjust the speaker's volume since this node does not has
6075 Amp-out capability. we change the speaker's route to:
6076 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6077 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6078 speaker's volume now. */
6080 static const hda_nid_t conn1[] = { 0x0c };
6081 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6085 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6086 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6087 const struct hda_fixup *fix, int action)
6089 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6090 static const hda_nid_t conn[] = { 0x02, 0x03 };
6091 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6095 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6096 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6097 const struct hda_fixup *fix, int action)
6099 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6100 static const hda_nid_t conn[] = { 0x02 };
6101 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6105 /* Hook to update amp GPIO4 for automute */
6106 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6107 struct hda_jack_callback *jack)
6109 struct alc_spec *spec = codec->spec;
6111 snd_hda_gen_hp_automute(codec, jack);
6112 /* mute_led_polarity is set to 0, so we pass inverted value here */
6113 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6114 !spec->gen.hp_jack_present);
6117 /* Manage GPIOs for HP EliteBook Folio 9480m.
6119 * GPIO4 is the headphone amplifier power control
6120 * GPIO3 is the audio output mute indicator LED
6123 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6124 const struct hda_fixup *fix,
6127 struct alc_spec *spec = codec->spec;
6129 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6130 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6131 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6132 spec->gpio_mask |= 0x10;
6133 spec->gpio_dir |= 0x10;
6134 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6138 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6139 const struct hda_fixup *fix,
6142 struct alc_spec *spec = codec->spec;
6144 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6145 spec->gpio_mask |= 0x04;
6146 spec->gpio_dir |= 0x04;
6147 /* set data bit low */
6151 /* Quirk for Thinkpad X1 7th and 8th Gen
6152 * The following fixed routing needed
6153 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6154 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6155 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6157 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6158 const struct hda_fixup *fix, int action)
6160 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6161 static const hda_nid_t preferred_pairs[] = {
6162 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6164 struct alc_spec *spec = codec->spec;
6167 case HDA_FIXUP_ACT_PRE_PROBE:
6168 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6169 spec->gen.preferred_dacs = preferred_pairs;
6171 case HDA_FIXUP_ACT_BUILD:
6172 /* The generic parser creates somewhat unintuitive volume ctls
6173 * with the fixed routing above, and the shared DAC2 may be
6175 * Rename those to unique names so that PA doesn't touch them
6176 * and use only Master volume.
6178 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6179 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6184 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6185 const struct hda_fixup *fix,
6188 alc_fixup_dual_codecs(codec, fix, action);
6190 case HDA_FIXUP_ACT_PRE_PROBE:
6191 /* override card longname to provide a unique UCM profile */
6192 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6194 case HDA_FIXUP_ACT_BUILD:
6195 /* rename Capture controls depending on the codec */
6196 rename_ctl(codec, "Capture Volume",
6198 "Rear-Panel Capture Volume" :
6199 "Front-Panel Capture Volume");
6200 rename_ctl(codec, "Capture Switch",
6202 "Rear-Panel Capture Switch" :
6203 "Front-Panel Capture Switch");
6208 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6209 const struct hda_fixup *fix, int action)
6211 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6214 codec->power_save_node = 1;
6217 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6218 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6219 const struct hda_fixup *fix, int action)
6221 struct alc_spec *spec = codec->spec;
6222 static const hda_nid_t preferred_pairs[] = {
6223 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6227 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6230 spec->gen.preferred_dacs = preferred_pairs;
6231 spec->gen.auto_mute_via_amp = 1;
6232 codec->power_save_node = 0;
6235 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6236 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6237 const struct hda_fixup *fix, int action)
6239 static const hda_nid_t preferred_pairs[] = {
6240 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6242 struct alc_spec *spec = codec->spec;
6244 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6245 spec->gen.preferred_dacs = preferred_pairs;
6246 spec->gen.obey_preferred_dacs = 1;
6250 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6251 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6252 const struct hda_fixup *fix, int action)
6254 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6257 snd_hda_override_wcaps(codec, 0x03, 0);
6260 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6262 switch (codec->core.vendor_id) {
6268 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6269 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6276 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6277 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6282 static void alc295_fixup_chromebook(struct hda_codec *codec,
6283 const struct hda_fixup *fix, int action)
6285 struct alc_spec *spec = codec->spec;
6288 case HDA_FIXUP_ACT_PRE_PROBE:
6289 spec->ultra_low_power = true;
6291 case HDA_FIXUP_ACT_INIT:
6292 alc_combo_jack_hp_jd_restart(codec);
6297 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6298 const struct hda_fixup *fix, int action)
6300 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6301 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6305 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6306 struct hda_jack_callback *cb)
6308 /* The Windows driver sets the codec up in a very different way where
6309 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6311 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6312 alc_write_coef_idx(codec, 0x10, 0x8a20);
6314 alc_write_coef_idx(codec, 0x10, 0x0a20);
6317 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6318 const struct hda_fixup *fix, int action)
6320 /* Pin 0x21: headphones/headset mic */
6321 if (!is_jack_detectable(codec, 0x21))
6325 case HDA_FIXUP_ACT_PRE_PROBE:
6326 snd_hda_jack_detect_enable_callback(codec, 0x21,
6327 alc294_gx502_toggle_output);
6329 case HDA_FIXUP_ACT_INIT:
6330 /* Make sure to start in a correct state, i.e. if
6331 * headphones have been plugged in before powering up the system
6333 alc294_gx502_toggle_output(codec, NULL);
6338 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6339 struct hda_jack_callback *cb)
6341 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6342 * responsible from changes between speakers and headphones
6344 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6345 alc_write_coef_idx(codec, 0x10, 0x8420);
6347 alc_write_coef_idx(codec, 0x10, 0x0a20);
6350 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6351 const struct hda_fixup *fix, int action)
6353 if (!is_jack_detectable(codec, 0x21))
6357 case HDA_FIXUP_ACT_PRE_PROBE:
6358 snd_hda_jack_detect_enable_callback(codec, 0x21,
6359 alc294_gu502_toggle_output);
6361 case HDA_FIXUP_ACT_INIT:
6362 alc294_gu502_toggle_output(codec, NULL);
6367 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6368 const struct hda_fixup *fix, int action)
6370 if (action != HDA_FIXUP_ACT_INIT)
6374 alc_write_coef_idx(codec, 0x65, 0x0);
6377 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6378 const struct hda_fixup *fix, int action)
6381 case HDA_FIXUP_ACT_INIT:
6382 alc_combo_jack_hp_jd_restart(codec);
6387 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6388 const struct hda_fixup *fix, int action)
6390 struct alc_spec *spec = codec->spec;
6393 case HDA_FIXUP_ACT_PRE_PROBE:
6394 /* Mic RING SLEEVE swap for combo jack */
6395 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6396 spec->no_internal_mic_pin = true;
6398 case HDA_FIXUP_ACT_INIT:
6399 alc_combo_jack_hp_jd_restart(codec);
6404 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6405 const struct hda_fixup *fix, int action)
6407 static const hda_nid_t conn[] = { 0x02 };
6408 static const struct hda_pintbl pincfgs[] = {
6409 { 0x14, 0x90170110 }, /* rear speaker */
6414 case HDA_FIXUP_ACT_PRE_PROBE:
6415 snd_hda_apply_pincfgs(codec, pincfgs);
6416 /* force front speaker to DAC1 */
6417 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6422 /* for hda_fixup_thinkpad_acpi() */
6423 #include "thinkpad_helper.c"
6425 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6426 const struct hda_fixup *fix, int action)
6428 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6429 hda_fixup_thinkpad_acpi(codec, fix, action);
6432 /* for alc295_fixup_hp_top_speakers */
6433 #include "hp_x360_helper.c"
6435 /* for alc285_fixup_ideapad_s740_coef() */
6436 #include "ideapad_s740_helper.c"
6440 ALC269_FIXUP_SONY_VAIO,
6441 ALC275_FIXUP_SONY_VAIO_GPIO2,
6442 ALC269_FIXUP_DELL_M101Z,
6443 ALC269_FIXUP_SKU_IGNORE,
6444 ALC269_FIXUP_ASUS_G73JW,
6445 ALC269_FIXUP_LENOVO_EAPD,
6446 ALC275_FIXUP_SONY_HWEQ,
6447 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6449 ALC269_FIXUP_PCM_44K,
6450 ALC269_FIXUP_STEREO_DMIC,
6451 ALC269_FIXUP_HEADSET_MIC,
6452 ALC269_FIXUP_QUANTA_MUTE,
6453 ALC269_FIXUP_LIFEBOOK,
6454 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6455 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6456 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6457 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6460 ALC269VB_FIXUP_AMIC,
6461 ALC269VB_FIXUP_DMIC,
6462 ALC269_FIXUP_HP_MUTE_LED,
6463 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6464 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6465 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6466 ALC269_FIXUP_HP_GPIO_LED,
6467 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6468 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6469 ALC269_FIXUP_INV_DMIC,
6470 ALC269_FIXUP_LENOVO_DOCK,
6471 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6472 ALC269_FIXUP_NO_SHUTUP,
6473 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6474 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6475 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6476 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6477 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6478 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6479 ALC269_FIXUP_HEADSET_MODE,
6480 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6481 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6482 ALC269_FIXUP_ASUS_X101_FUNC,
6483 ALC269_FIXUP_ASUS_X101_VERB,
6484 ALC269_FIXUP_ASUS_X101,
6485 ALC271_FIXUP_AMIC_MIC2,
6486 ALC271_FIXUP_HP_GATE_MIC_JACK,
6487 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6488 ALC269_FIXUP_ACER_AC700,
6489 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6490 ALC269VB_FIXUP_ASUS_ZENBOOK,
6491 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6492 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6493 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6494 ALC283_FIXUP_CHROME_BOOK,
6495 ALC283_FIXUP_SENSE_COMBO_JACK,
6496 ALC282_FIXUP_ASUS_TX300,
6497 ALC283_FIXUP_INT_MIC,
6498 ALC290_FIXUP_MONO_SPEAKERS,
6499 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6500 ALC290_FIXUP_SUBWOOFER,
6501 ALC290_FIXUP_SUBWOOFER_HSJACK,
6502 ALC269_FIXUP_THINKPAD_ACPI,
6503 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6504 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6505 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6506 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6507 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6508 ALC255_FIXUP_HEADSET_MODE,
6509 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6510 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6511 ALC292_FIXUP_TPT440_DOCK,
6512 ALC292_FIXUP_TPT440,
6513 ALC283_FIXUP_HEADSET_MIC,
6514 ALC255_FIXUP_MIC_MUTE_LED,
6515 ALC282_FIXUP_ASPIRE_V5_PINS,
6516 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6517 ALC280_FIXUP_HP_GPIO4,
6518 ALC286_FIXUP_HP_GPIO_LED,
6519 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6520 ALC280_FIXUP_HP_DOCK_PINS,
6521 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6522 ALC280_FIXUP_HP_9480M,
6523 ALC245_FIXUP_HP_X360_AMP,
6524 ALC288_FIXUP_DELL_HEADSET_MODE,
6525 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6526 ALC288_FIXUP_DELL_XPS_13,
6527 ALC288_FIXUP_DISABLE_AAMIX,
6528 ALC292_FIXUP_DELL_E7X_AAMIX,
6529 ALC292_FIXUP_DELL_E7X,
6530 ALC292_FIXUP_DISABLE_AAMIX,
6531 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6532 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6533 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6534 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6535 ALC275_FIXUP_DELL_XPS,
6536 ALC293_FIXUP_LENOVO_SPK_NOISE,
6537 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6538 ALC255_FIXUP_DELL_SPK_NOISE,
6539 ALC225_FIXUP_DISABLE_MIC_VREF,
6540 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6541 ALC295_FIXUP_DISABLE_DAC3,
6542 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6543 ALC280_FIXUP_HP_HEADSET_MIC,
6544 ALC221_FIXUP_HP_FRONT_MIC,
6545 ALC292_FIXUP_TPT460,
6546 ALC298_FIXUP_SPK_VOLUME,
6547 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6548 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6549 ALC269_FIXUP_ATIV_BOOK_8,
6550 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6551 ALC256_FIXUP_ASUS_HEADSET_MODE,
6552 ALC256_FIXUP_ASUS_MIC,
6553 ALC256_FIXUP_ASUS_AIO_GPIO2,
6554 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6555 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6556 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6557 ALC233_FIXUP_ACER_HEADSET_MIC,
6558 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6559 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6560 ALC225_FIXUP_S3_POP_NOISE,
6561 ALC700_FIXUP_INTEL_REFERENCE,
6562 ALC274_FIXUP_DELL_BIND_DACS,
6563 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6564 ALC298_FIXUP_TPT470_DOCK_FIX,
6565 ALC298_FIXUP_TPT470_DOCK,
6566 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6567 ALC255_FIXUP_DELL_HEADSET_MIC,
6568 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6569 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6570 ALC295_FIXUP_HP_X360,
6571 ALC221_FIXUP_HP_HEADSET_MIC,
6572 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6573 ALC295_FIXUP_HP_AUTO_MUTE,
6574 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6575 ALC294_FIXUP_ASUS_MIC,
6576 ALC294_FIXUP_ASUS_HEADSET_MIC,
6577 ALC294_FIXUP_ASUS_SPK,
6578 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6579 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6580 ALC255_FIXUP_ACER_HEADSET_MIC,
6581 ALC295_FIXUP_CHROME_BOOK,
6582 ALC225_FIXUP_HEADSET_JACK,
6583 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6584 ALC225_FIXUP_WYSE_AUTO_MUTE,
6585 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6586 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6587 ALC256_FIXUP_ASUS_HEADSET_MIC,
6588 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6589 ALC299_FIXUP_PREDATOR_SPK,
6590 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6591 ALC289_FIXUP_DELL_SPK2,
6592 ALC289_FIXUP_DUAL_SPK,
6593 ALC294_FIXUP_SPK2_TO_DAC1,
6594 ALC294_FIXUP_ASUS_DUAL_SPK,
6595 ALC285_FIXUP_THINKPAD_X1_GEN7,
6596 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6597 ALC294_FIXUP_ASUS_HPE,
6598 ALC294_FIXUP_ASUS_COEF_1B,
6599 ALC294_FIXUP_ASUS_GX502_HP,
6600 ALC294_FIXUP_ASUS_GX502_PINS,
6601 ALC294_FIXUP_ASUS_GX502_VERBS,
6602 ALC294_FIXUP_ASUS_GU502_HP,
6603 ALC294_FIXUP_ASUS_GU502_PINS,
6604 ALC294_FIXUP_ASUS_GU502_VERBS,
6605 ALC285_FIXUP_HP_GPIO_LED,
6606 ALC285_FIXUP_HP_MUTE_LED,
6607 ALC236_FIXUP_HP_GPIO_LED,
6608 ALC236_FIXUP_HP_MUTE_LED,
6609 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6610 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6611 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6612 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6613 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6614 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6615 ALC289_FIXUP_ASUS_GA401,
6616 ALC289_FIXUP_ASUS_GA502,
6617 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6618 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6619 ALC269_FIXUP_CZC_B20,
6620 ALC269_FIXUP_CZC_TMI,
6621 ALC269_FIXUP_CZC_L101,
6622 ALC269_FIXUP_LEMOTE_A1802,
6623 ALC269_FIXUP_LEMOTE_A190X,
6624 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6625 ALC233_FIXUP_INTEL_NUC8_DMIC,
6626 ALC233_FIXUP_INTEL_NUC8_BOOST,
6627 ALC256_FIXUP_INTEL_NUC10,
6628 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6629 ALC274_FIXUP_HP_MIC,
6630 ALC274_FIXUP_HP_HEADSET_MIC,
6631 ALC274_FIXUP_HP_ENVY_GPIO,
6632 ALC256_FIXUP_ASUS_HPE,
6633 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6634 ALC287_FIXUP_HP_GPIO_LED,
6635 ALC256_FIXUP_HP_HEADSET_MIC,
6636 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6637 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6638 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6639 ALC256_FIXUP_ACER_HEADSET_MIC,
6640 ALC285_FIXUP_IDEAPAD_S740_COEF,
6641 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6642 ALC295_FIXUP_ASUS_DACS,
6643 ALC295_FIXUP_HP_OMEN,
6644 ALC285_FIXUP_HP_SPECTRE_X360,
6645 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6646 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6647 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6648 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6651 static const struct hda_fixup alc269_fixups[] = {
6652 [ALC269_FIXUP_GPIO2] = {
6653 .type = HDA_FIXUP_FUNC,
6654 .v.func = alc_fixup_gpio2,
6656 [ALC269_FIXUP_SONY_VAIO] = {
6657 .type = HDA_FIXUP_PINCTLS,
6658 .v.pins = (const struct hda_pintbl[]) {
6659 {0x19, PIN_VREFGRD},
6663 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6664 .type = HDA_FIXUP_FUNC,
6665 .v.func = alc275_fixup_gpio4_off,
6667 .chain_id = ALC269_FIXUP_SONY_VAIO
6669 [ALC269_FIXUP_DELL_M101Z] = {
6670 .type = HDA_FIXUP_VERBS,
6671 .v.verbs = (const struct hda_verb[]) {
6672 /* Enables internal speaker */
6673 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6674 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6678 [ALC269_FIXUP_SKU_IGNORE] = {
6679 .type = HDA_FIXUP_FUNC,
6680 .v.func = alc_fixup_sku_ignore,
6682 [ALC269_FIXUP_ASUS_G73JW] = {
6683 .type = HDA_FIXUP_PINS,
6684 .v.pins = (const struct hda_pintbl[]) {
6685 { 0x17, 0x99130111 }, /* subwoofer */
6689 [ALC269_FIXUP_LENOVO_EAPD] = {
6690 .type = HDA_FIXUP_VERBS,
6691 .v.verbs = (const struct hda_verb[]) {
6692 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6696 [ALC275_FIXUP_SONY_HWEQ] = {
6697 .type = HDA_FIXUP_FUNC,
6698 .v.func = alc269_fixup_hweq,
6700 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6702 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6703 .type = HDA_FIXUP_FUNC,
6704 .v.func = alc_fixup_disable_aamix,
6706 .chain_id = ALC269_FIXUP_SONY_VAIO
6708 [ALC271_FIXUP_DMIC] = {
6709 .type = HDA_FIXUP_FUNC,
6710 .v.func = alc271_fixup_dmic,
6712 [ALC269_FIXUP_PCM_44K] = {
6713 .type = HDA_FIXUP_FUNC,
6714 .v.func = alc269_fixup_pcm_44k,
6716 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6718 [ALC269_FIXUP_STEREO_DMIC] = {
6719 .type = HDA_FIXUP_FUNC,
6720 .v.func = alc269_fixup_stereo_dmic,
6722 [ALC269_FIXUP_HEADSET_MIC] = {
6723 .type = HDA_FIXUP_FUNC,
6724 .v.func = alc269_fixup_headset_mic,
6726 [ALC269_FIXUP_QUANTA_MUTE] = {
6727 .type = HDA_FIXUP_FUNC,
6728 .v.func = alc269_fixup_quanta_mute,
6730 [ALC269_FIXUP_LIFEBOOK] = {
6731 .type = HDA_FIXUP_PINS,
6732 .v.pins = (const struct hda_pintbl[]) {
6733 { 0x1a, 0x2101103f }, /* dock line-out */
6734 { 0x1b, 0x23a11040 }, /* dock mic-in */
6738 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6740 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6741 .type = HDA_FIXUP_PINS,
6742 .v.pins = (const struct hda_pintbl[]) {
6743 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6747 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6748 .type = HDA_FIXUP_PINS,
6749 .v.pins = (const struct hda_pintbl[]) {
6750 { 0x21, 0x0221102f }, /* HP out */
6754 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6755 .type = HDA_FIXUP_FUNC,
6756 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6758 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6759 .type = HDA_FIXUP_FUNC,
6760 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6762 [ALC269_FIXUP_AMIC] = {
6763 .type = HDA_FIXUP_PINS,
6764 .v.pins = (const struct hda_pintbl[]) {
6765 { 0x14, 0x99130110 }, /* speaker */
6766 { 0x15, 0x0121401f }, /* HP out */
6767 { 0x18, 0x01a19c20 }, /* mic */
6768 { 0x19, 0x99a3092f }, /* int-mic */
6772 [ALC269_FIXUP_DMIC] = {
6773 .type = HDA_FIXUP_PINS,
6774 .v.pins = (const struct hda_pintbl[]) {
6775 { 0x12, 0x99a3092f }, /* int-mic */
6776 { 0x14, 0x99130110 }, /* speaker */
6777 { 0x15, 0x0121401f }, /* HP out */
6778 { 0x18, 0x01a19c20 }, /* mic */
6782 [ALC269VB_FIXUP_AMIC] = {
6783 .type = HDA_FIXUP_PINS,
6784 .v.pins = (const struct hda_pintbl[]) {
6785 { 0x14, 0x99130110 }, /* speaker */
6786 { 0x18, 0x01a19c20 }, /* mic */
6787 { 0x19, 0x99a3092f }, /* int-mic */
6788 { 0x21, 0x0121401f }, /* HP out */
6792 [ALC269VB_FIXUP_DMIC] = {
6793 .type = HDA_FIXUP_PINS,
6794 .v.pins = (const struct hda_pintbl[]) {
6795 { 0x12, 0x99a3092f }, /* int-mic */
6796 { 0x14, 0x99130110 }, /* speaker */
6797 { 0x18, 0x01a19c20 }, /* mic */
6798 { 0x21, 0x0121401f }, /* HP out */
6802 [ALC269_FIXUP_HP_MUTE_LED] = {
6803 .type = HDA_FIXUP_FUNC,
6804 .v.func = alc269_fixup_hp_mute_led,
6806 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6807 .type = HDA_FIXUP_FUNC,
6808 .v.func = alc269_fixup_hp_mute_led_mic1,
6810 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6811 .type = HDA_FIXUP_FUNC,
6812 .v.func = alc269_fixup_hp_mute_led_mic2,
6814 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6815 .type = HDA_FIXUP_FUNC,
6816 .v.func = alc269_fixup_hp_mute_led_mic3,
6818 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6820 [ALC269_FIXUP_HP_GPIO_LED] = {
6821 .type = HDA_FIXUP_FUNC,
6822 .v.func = alc269_fixup_hp_gpio_led,
6824 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6825 .type = HDA_FIXUP_FUNC,
6826 .v.func = alc269_fixup_hp_gpio_mic1_led,
6828 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6829 .type = HDA_FIXUP_FUNC,
6830 .v.func = alc269_fixup_hp_line1_mic1_led,
6832 [ALC269_FIXUP_INV_DMIC] = {
6833 .type = HDA_FIXUP_FUNC,
6834 .v.func = alc_fixup_inv_dmic,
6836 [ALC269_FIXUP_NO_SHUTUP] = {
6837 .type = HDA_FIXUP_FUNC,
6838 .v.func = alc_fixup_no_shutup,
6840 [ALC269_FIXUP_LENOVO_DOCK] = {
6841 .type = HDA_FIXUP_PINS,
6842 .v.pins = (const struct hda_pintbl[]) {
6843 { 0x19, 0x23a11040 }, /* dock mic */
6844 { 0x1b, 0x2121103f }, /* dock headphone */
6848 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6850 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6851 .type = HDA_FIXUP_FUNC,
6852 .v.func = alc269_fixup_limit_int_mic_boost,
6854 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6856 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6857 .type = HDA_FIXUP_FUNC,
6858 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6860 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6862 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6863 .type = HDA_FIXUP_PINS,
6864 .v.pins = (const struct hda_pintbl[]) {
6865 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6866 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6870 .chain_id = ALC269_FIXUP_HEADSET_MODE
6872 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6873 .type = HDA_FIXUP_PINS,
6874 .v.pins = (const struct hda_pintbl[]) {
6875 { 0x16, 0x21014020 }, /* dock line out */
6876 { 0x19, 0x21a19030 }, /* dock mic */
6877 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6881 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6883 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6884 .type = HDA_FIXUP_PINS,
6885 .v.pins = (const struct hda_pintbl[]) {
6886 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6890 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6892 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6893 .type = HDA_FIXUP_PINS,
6894 .v.pins = (const struct hda_pintbl[]) {
6895 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6896 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6900 .chain_id = ALC269_FIXUP_HEADSET_MODE
6902 [ALC269_FIXUP_HEADSET_MODE] = {
6903 .type = HDA_FIXUP_FUNC,
6904 .v.func = alc_fixup_headset_mode,
6906 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6908 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6909 .type = HDA_FIXUP_FUNC,
6910 .v.func = alc_fixup_headset_mode_no_hp_mic,
6912 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6913 .type = HDA_FIXUP_PINS,
6914 .v.pins = (const struct hda_pintbl[]) {
6915 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6919 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6921 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6922 .type = HDA_FIXUP_PINS,
6923 .v.pins = (const struct hda_pintbl[]) {
6924 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6928 .chain_id = ALC269_FIXUP_HEADSET_MIC
6930 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
6931 .type = HDA_FIXUP_PINS,
6932 .v.pins = (const struct hda_pintbl[]) {
6946 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6948 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
6949 .type = HDA_FIXUP_FUNC,
6950 .v.func = alc298_fixup_huawei_mbx_stereo,
6952 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6954 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6955 .type = HDA_FIXUP_FUNC,
6956 .v.func = alc269_fixup_x101_headset_mic,
6958 [ALC269_FIXUP_ASUS_X101_VERB] = {
6959 .type = HDA_FIXUP_VERBS,
6960 .v.verbs = (const struct hda_verb[]) {
6961 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6962 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6963 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6967 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6969 [ALC269_FIXUP_ASUS_X101] = {
6970 .type = HDA_FIXUP_PINS,
6971 .v.pins = (const struct hda_pintbl[]) {
6972 { 0x18, 0x04a1182c }, /* Headset mic */
6976 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6978 [ALC271_FIXUP_AMIC_MIC2] = {
6979 .type = HDA_FIXUP_PINS,
6980 .v.pins = (const struct hda_pintbl[]) {
6981 { 0x14, 0x99130110 }, /* speaker */
6982 { 0x19, 0x01a19c20 }, /* mic */
6983 { 0x1b, 0x99a7012f }, /* int-mic */
6984 { 0x21, 0x0121401f }, /* HP out */
6988 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6989 .type = HDA_FIXUP_FUNC,
6990 .v.func = alc271_hp_gate_mic_jack,
6992 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6994 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6995 .type = HDA_FIXUP_FUNC,
6996 .v.func = alc269_fixup_limit_int_mic_boost,
6998 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7000 [ALC269_FIXUP_ACER_AC700] = {
7001 .type = HDA_FIXUP_PINS,
7002 .v.pins = (const struct hda_pintbl[]) {
7003 { 0x12, 0x99a3092f }, /* int-mic */
7004 { 0x14, 0x99130110 }, /* speaker */
7005 { 0x18, 0x03a11c20 }, /* mic */
7006 { 0x1e, 0x0346101e }, /* SPDIF1 */
7007 { 0x21, 0x0321101f }, /* HP out */
7011 .chain_id = ALC271_FIXUP_DMIC,
7013 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7014 .type = HDA_FIXUP_FUNC,
7015 .v.func = alc269_fixup_limit_int_mic_boost,
7017 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7019 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7020 .type = HDA_FIXUP_FUNC,
7021 .v.func = alc269_fixup_limit_int_mic_boost,
7023 .chain_id = ALC269VB_FIXUP_DMIC,
7025 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7026 .type = HDA_FIXUP_VERBS,
7027 .v.verbs = (const struct hda_verb[]) {
7028 /* class-D output amp +5dB */
7029 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7030 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7034 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7036 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7037 .type = HDA_FIXUP_FUNC,
7038 .v.func = alc269_fixup_limit_int_mic_boost,
7040 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7042 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7043 .type = HDA_FIXUP_PINS,
7044 .v.pins = (const struct hda_pintbl[]) {
7045 { 0x12, 0x99a3092f }, /* int-mic */
7046 { 0x18, 0x03a11d20 }, /* mic */
7047 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7051 [ALC283_FIXUP_CHROME_BOOK] = {
7052 .type = HDA_FIXUP_FUNC,
7053 .v.func = alc283_fixup_chromebook,
7055 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7056 .type = HDA_FIXUP_FUNC,
7057 .v.func = alc283_fixup_sense_combo_jack,
7059 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7061 [ALC282_FIXUP_ASUS_TX300] = {
7062 .type = HDA_FIXUP_FUNC,
7063 .v.func = alc282_fixup_asus_tx300,
7065 [ALC283_FIXUP_INT_MIC] = {
7066 .type = HDA_FIXUP_VERBS,
7067 .v.verbs = (const struct hda_verb[]) {
7068 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7069 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7073 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7075 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7076 .type = HDA_FIXUP_PINS,
7077 .v.pins = (const struct hda_pintbl[]) {
7078 { 0x17, 0x90170112 }, /* subwoofer */
7082 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7084 [ALC290_FIXUP_SUBWOOFER] = {
7085 .type = HDA_FIXUP_PINS,
7086 .v.pins = (const struct hda_pintbl[]) {
7087 { 0x17, 0x90170112 }, /* subwoofer */
7091 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7093 [ALC290_FIXUP_MONO_SPEAKERS] = {
7094 .type = HDA_FIXUP_FUNC,
7095 .v.func = alc290_fixup_mono_speakers,
7097 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7098 .type = HDA_FIXUP_FUNC,
7099 .v.func = alc290_fixup_mono_speakers,
7101 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7103 [ALC269_FIXUP_THINKPAD_ACPI] = {
7104 .type = HDA_FIXUP_FUNC,
7105 .v.func = alc_fixup_thinkpad_acpi,
7107 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7109 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7110 .type = HDA_FIXUP_FUNC,
7111 .v.func = alc_fixup_inv_dmic,
7113 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7115 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7116 .type = HDA_FIXUP_PINS,
7117 .v.pins = (const struct hda_pintbl[]) {
7118 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7122 .chain_id = ALC255_FIXUP_HEADSET_MODE
7124 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7125 .type = HDA_FIXUP_PINS,
7126 .v.pins = (const struct hda_pintbl[]) {
7127 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7131 .chain_id = ALC255_FIXUP_HEADSET_MODE
7133 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7134 .type = HDA_FIXUP_PINS,
7135 .v.pins = (const struct hda_pintbl[]) {
7136 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7137 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7141 .chain_id = ALC255_FIXUP_HEADSET_MODE
7143 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7144 .type = HDA_FIXUP_PINS,
7145 .v.pins = (const struct hda_pintbl[]) {
7146 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7150 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7152 [ALC255_FIXUP_HEADSET_MODE] = {
7153 .type = HDA_FIXUP_FUNC,
7154 .v.func = alc_fixup_headset_mode_alc255,
7156 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7158 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7159 .type = HDA_FIXUP_FUNC,
7160 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7162 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7163 .type = HDA_FIXUP_PINS,
7164 .v.pins = (const struct hda_pintbl[]) {
7165 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7166 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7170 .chain_id = ALC269_FIXUP_HEADSET_MODE
7172 [ALC292_FIXUP_TPT440_DOCK] = {
7173 .type = HDA_FIXUP_FUNC,
7174 .v.func = alc_fixup_tpt440_dock,
7176 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7178 [ALC292_FIXUP_TPT440] = {
7179 .type = HDA_FIXUP_FUNC,
7180 .v.func = alc_fixup_disable_aamix,
7182 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7184 [ALC283_FIXUP_HEADSET_MIC] = {
7185 .type = HDA_FIXUP_PINS,
7186 .v.pins = (const struct hda_pintbl[]) {
7187 { 0x19, 0x04a110f0 },
7191 [ALC255_FIXUP_MIC_MUTE_LED] = {
7192 .type = HDA_FIXUP_FUNC,
7193 .v.func = alc_fixup_micmute_led,
7195 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7196 .type = HDA_FIXUP_PINS,
7197 .v.pins = (const struct hda_pintbl[]) {
7198 { 0x12, 0x90a60130 },
7199 { 0x14, 0x90170110 },
7200 { 0x17, 0x40000008 },
7201 { 0x18, 0x411111f0 },
7202 { 0x19, 0x01a1913c },
7203 { 0x1a, 0x411111f0 },
7204 { 0x1b, 0x411111f0 },
7205 { 0x1d, 0x40f89b2d },
7206 { 0x1e, 0x411111f0 },
7207 { 0x21, 0x0321101f },
7211 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7212 .type = HDA_FIXUP_FUNC,
7213 .v.func = alc269vb_fixup_aspire_e1_coef,
7215 [ALC280_FIXUP_HP_GPIO4] = {
7216 .type = HDA_FIXUP_FUNC,
7217 .v.func = alc280_fixup_hp_gpio4,
7219 [ALC286_FIXUP_HP_GPIO_LED] = {
7220 .type = HDA_FIXUP_FUNC,
7221 .v.func = alc286_fixup_hp_gpio_led,
7223 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7224 .type = HDA_FIXUP_FUNC,
7225 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7227 [ALC280_FIXUP_HP_DOCK_PINS] = {
7228 .type = HDA_FIXUP_PINS,
7229 .v.pins = (const struct hda_pintbl[]) {
7230 { 0x1b, 0x21011020 }, /* line-out */
7231 { 0x1a, 0x01a1903c }, /* headset mic */
7232 { 0x18, 0x2181103f }, /* line-in */
7236 .chain_id = ALC280_FIXUP_HP_GPIO4
7238 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7239 .type = HDA_FIXUP_PINS,
7240 .v.pins = (const struct hda_pintbl[]) {
7241 { 0x1b, 0x21011020 }, /* line-out */
7242 { 0x18, 0x2181103f }, /* line-in */
7246 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7248 [ALC280_FIXUP_HP_9480M] = {
7249 .type = HDA_FIXUP_FUNC,
7250 .v.func = alc280_fixup_hp_9480m,
7252 [ALC245_FIXUP_HP_X360_AMP] = {
7253 .type = HDA_FIXUP_FUNC,
7254 .v.func = alc245_fixup_hp_x360_amp,
7256 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7257 .type = HDA_FIXUP_FUNC,
7258 .v.func = alc_fixup_headset_mode_dell_alc288,
7260 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7262 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7263 .type = HDA_FIXUP_PINS,
7264 .v.pins = (const struct hda_pintbl[]) {
7265 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7266 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7270 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7272 [ALC288_FIXUP_DISABLE_AAMIX] = {
7273 .type = HDA_FIXUP_FUNC,
7274 .v.func = alc_fixup_disable_aamix,
7276 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7278 [ALC288_FIXUP_DELL_XPS_13] = {
7279 .type = HDA_FIXUP_FUNC,
7280 .v.func = alc_fixup_dell_xps13,
7282 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7284 [ALC292_FIXUP_DISABLE_AAMIX] = {
7285 .type = HDA_FIXUP_FUNC,
7286 .v.func = alc_fixup_disable_aamix,
7288 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7290 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7291 .type = HDA_FIXUP_FUNC,
7292 .v.func = alc_fixup_disable_aamix,
7294 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7296 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7297 .type = HDA_FIXUP_FUNC,
7298 .v.func = alc_fixup_dell_xps13,
7300 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7302 [ALC292_FIXUP_DELL_E7X] = {
7303 .type = HDA_FIXUP_FUNC,
7304 .v.func = alc_fixup_micmute_led,
7305 /* micmute fixup must be applied at last */
7306 .chained_before = true,
7307 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7309 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7310 .type = HDA_FIXUP_PINS,
7311 .v.pins = (const struct hda_pintbl[]) {
7312 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7315 .chained_before = true,
7316 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7318 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7319 .type = HDA_FIXUP_PINS,
7320 .v.pins = (const struct hda_pintbl[]) {
7321 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7322 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7326 .chain_id = ALC269_FIXUP_HEADSET_MODE
7328 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7329 .type = HDA_FIXUP_PINS,
7330 .v.pins = (const struct hda_pintbl[]) {
7331 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7335 .chain_id = ALC269_FIXUP_HEADSET_MODE
7337 [ALC275_FIXUP_DELL_XPS] = {
7338 .type = HDA_FIXUP_VERBS,
7339 .v.verbs = (const struct hda_verb[]) {
7340 /* Enables internal speaker */
7341 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7342 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7343 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7344 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7348 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7349 .type = HDA_FIXUP_FUNC,
7350 .v.func = alc_fixup_disable_aamix,
7352 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7354 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7355 .type = HDA_FIXUP_FUNC,
7356 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7358 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7359 .type = HDA_FIXUP_FUNC,
7360 .v.func = alc_fixup_inv_dmic,
7362 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7364 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7365 .type = HDA_FIXUP_FUNC,
7366 .v.func = alc269_fixup_limit_int_mic_boost
7368 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7369 .type = HDA_FIXUP_FUNC,
7370 .v.func = alc_fixup_disable_aamix,
7372 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7374 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7375 .type = HDA_FIXUP_FUNC,
7376 .v.func = alc_fixup_disable_mic_vref,
7378 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7380 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7381 .type = HDA_FIXUP_VERBS,
7382 .v.verbs = (const struct hda_verb[]) {
7383 /* Disable pass-through path for FRONT 14h */
7384 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7385 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7389 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7391 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7392 .type = HDA_FIXUP_FUNC,
7393 .v.func = alc_fixup_disable_aamix,
7395 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7397 [ALC221_FIXUP_HP_FRONT_MIC] = {
7398 .type = HDA_FIXUP_PINS,
7399 .v.pins = (const struct hda_pintbl[]) {
7400 { 0x19, 0x02a19020 }, /* Front Mic */
7404 [ALC292_FIXUP_TPT460] = {
7405 .type = HDA_FIXUP_FUNC,
7406 .v.func = alc_fixup_tpt440_dock,
7408 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7410 [ALC298_FIXUP_SPK_VOLUME] = {
7411 .type = HDA_FIXUP_FUNC,
7412 .v.func = alc298_fixup_speaker_volume,
7414 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7416 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7417 .type = HDA_FIXUP_FUNC,
7418 .v.func = alc298_fixup_speaker_volume,
7420 [ALC295_FIXUP_DISABLE_DAC3] = {
7421 .type = HDA_FIXUP_FUNC,
7422 .v.func = alc295_fixup_disable_dac3,
7424 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7425 .type = HDA_FIXUP_FUNC,
7426 .v.func = alc285_fixup_speaker2_to_dac1,
7428 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7430 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7431 .type = HDA_FIXUP_PINS,
7432 .v.pins = (const struct hda_pintbl[]) {
7433 { 0x1b, 0x90170151 },
7437 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7439 [ALC269_FIXUP_ATIV_BOOK_8] = {
7440 .type = HDA_FIXUP_FUNC,
7441 .v.func = alc_fixup_auto_mute_via_amp,
7443 .chain_id = ALC269_FIXUP_NO_SHUTUP
7445 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7446 .type = HDA_FIXUP_PINS,
7447 .v.pins = (const struct hda_pintbl[]) {
7448 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7449 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7453 .chain_id = ALC269_FIXUP_HEADSET_MODE
7455 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7456 .type = HDA_FIXUP_FUNC,
7457 .v.func = alc_fixup_headset_mode,
7459 [ALC256_FIXUP_ASUS_MIC] = {
7460 .type = HDA_FIXUP_PINS,
7461 .v.pins = (const struct hda_pintbl[]) {
7462 { 0x13, 0x90a60160 }, /* use as internal mic */
7463 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7467 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7469 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7470 .type = HDA_FIXUP_FUNC,
7471 /* Set up GPIO2 for the speaker amp */
7472 .v.func = alc_fixup_gpio4,
7474 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7475 .type = HDA_FIXUP_PINS,
7476 .v.pins = (const struct hda_pintbl[]) {
7477 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7481 .chain_id = ALC269_FIXUP_HEADSET_MIC
7483 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7484 .type = HDA_FIXUP_VERBS,
7485 .v.verbs = (const struct hda_verb[]) {
7486 /* Enables internal speaker */
7487 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7488 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7492 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7494 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7495 .type = HDA_FIXUP_FUNC,
7496 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7498 .chain_id = ALC269_FIXUP_GPIO2
7500 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7501 .type = HDA_FIXUP_VERBS,
7502 .v.verbs = (const struct hda_verb[]) {
7503 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7504 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7508 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7510 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7511 .type = HDA_FIXUP_PINS,
7512 .v.pins = (const struct hda_pintbl[]) {
7513 /* Change the mic location from front to right, otherwise there are
7514 two front mics with the same name, pulseaudio can't handle them.
7515 This is just a temporary workaround, after applying this fixup,
7516 there will be one "Front Mic" and one "Mic" in this machine.
7518 { 0x1a, 0x04a19040 },
7522 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7523 .type = HDA_FIXUP_PINS,
7524 .v.pins = (const struct hda_pintbl[]) {
7525 { 0x16, 0x0101102f }, /* Rear Headset HP */
7526 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7527 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7528 { 0x1b, 0x02011020 },
7532 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7534 [ALC225_FIXUP_S3_POP_NOISE] = {
7535 .type = HDA_FIXUP_FUNC,
7536 .v.func = alc225_fixup_s3_pop_noise,
7538 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7540 [ALC700_FIXUP_INTEL_REFERENCE] = {
7541 .type = HDA_FIXUP_VERBS,
7542 .v.verbs = (const struct hda_verb[]) {
7543 /* Enables internal speaker */
7544 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7545 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7546 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7547 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7548 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7549 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7550 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7551 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7555 [ALC274_FIXUP_DELL_BIND_DACS] = {
7556 .type = HDA_FIXUP_FUNC,
7557 .v.func = alc274_fixup_bind_dacs,
7559 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7561 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7562 .type = HDA_FIXUP_PINS,
7563 .v.pins = (const struct hda_pintbl[]) {
7564 { 0x1b, 0x0401102f },
7568 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7570 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7571 .type = HDA_FIXUP_FUNC,
7572 .v.func = alc_fixup_tpt470_dock,
7574 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7576 [ALC298_FIXUP_TPT470_DOCK] = {
7577 .type = HDA_FIXUP_FUNC,
7578 .v.func = alc_fixup_tpt470_dacs,
7580 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7582 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7583 .type = HDA_FIXUP_PINS,
7584 .v.pins = (const struct hda_pintbl[]) {
7585 { 0x14, 0x0201101f },
7589 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7591 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7592 .type = HDA_FIXUP_PINS,
7593 .v.pins = (const struct hda_pintbl[]) {
7594 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7598 .chain_id = ALC269_FIXUP_HEADSET_MIC
7600 [ALC295_FIXUP_HP_X360] = {
7601 .type = HDA_FIXUP_FUNC,
7602 .v.func = alc295_fixup_hp_top_speakers,
7604 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7606 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7607 .type = HDA_FIXUP_PINS,
7608 .v.pins = (const struct hda_pintbl[]) {
7609 { 0x19, 0x0181313f},
7613 .chain_id = ALC269_FIXUP_HEADSET_MIC
7615 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7616 .type = HDA_FIXUP_FUNC,
7617 .v.func = alc285_fixup_invalidate_dacs,
7619 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7621 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7622 .type = HDA_FIXUP_FUNC,
7623 .v.func = alc_fixup_auto_mute_via_amp,
7625 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7626 .type = HDA_FIXUP_PINS,
7627 .v.pins = (const struct hda_pintbl[]) {
7628 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7632 .chain_id = ALC269_FIXUP_HEADSET_MIC
7634 [ALC294_FIXUP_ASUS_MIC] = {
7635 .type = HDA_FIXUP_PINS,
7636 .v.pins = (const struct hda_pintbl[]) {
7637 { 0x13, 0x90a60160 }, /* use as internal mic */
7638 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7642 .chain_id = ALC269_FIXUP_HEADSET_MIC
7644 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7645 .type = HDA_FIXUP_PINS,
7646 .v.pins = (const struct hda_pintbl[]) {
7647 { 0x19, 0x01a1103c }, /* use as headset mic */
7651 .chain_id = ALC269_FIXUP_HEADSET_MIC
7653 [ALC294_FIXUP_ASUS_SPK] = {
7654 .type = HDA_FIXUP_VERBS,
7655 .v.verbs = (const struct hda_verb[]) {
7657 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7658 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7659 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7660 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7664 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7666 [ALC295_FIXUP_CHROME_BOOK] = {
7667 .type = HDA_FIXUP_FUNC,
7668 .v.func = alc295_fixup_chromebook,
7670 .chain_id = ALC225_FIXUP_HEADSET_JACK
7672 [ALC225_FIXUP_HEADSET_JACK] = {
7673 .type = HDA_FIXUP_FUNC,
7674 .v.func = alc_fixup_headset_jack,
7676 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7677 .type = HDA_FIXUP_PINS,
7678 .v.pins = (const struct hda_pintbl[]) {
7679 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7683 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7685 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7686 .type = HDA_FIXUP_VERBS,
7687 .v.verbs = (const struct hda_verb[]) {
7688 /* Disable PCBEEP-IN passthrough */
7689 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7690 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7694 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7696 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7697 .type = HDA_FIXUP_PINS,
7698 .v.pins = (const struct hda_pintbl[]) {
7699 { 0x19, 0x03a11130 },
7700 { 0x1a, 0x90a60140 }, /* use as internal mic */
7704 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7706 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7707 .type = HDA_FIXUP_PINS,
7708 .v.pins = (const struct hda_pintbl[]) {
7709 { 0x16, 0x01011020 }, /* Rear Line out */
7710 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7714 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7716 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7717 .type = HDA_FIXUP_FUNC,
7718 .v.func = alc_fixup_auto_mute_via_amp,
7720 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7722 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7723 .type = HDA_FIXUP_FUNC,
7724 .v.func = alc_fixup_disable_mic_vref,
7726 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7728 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7729 .type = HDA_FIXUP_VERBS,
7730 .v.verbs = (const struct hda_verb[]) {
7731 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7732 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7736 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7738 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7739 .type = HDA_FIXUP_PINS,
7740 .v.pins = (const struct hda_pintbl[]) {
7741 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7745 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7747 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7748 .type = HDA_FIXUP_PINS,
7749 .v.pins = (const struct hda_pintbl[]) {
7750 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7754 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7756 [ALC299_FIXUP_PREDATOR_SPK] = {
7757 .type = HDA_FIXUP_PINS,
7758 .v.pins = (const struct hda_pintbl[]) {
7759 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7763 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7764 .type = HDA_FIXUP_PINS,
7765 .v.pins = (const struct hda_pintbl[]) {
7766 { 0x19, 0x04a11040 },
7767 { 0x21, 0x04211020 },
7771 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7773 [ALC289_FIXUP_DELL_SPK2] = {
7774 .type = HDA_FIXUP_PINS,
7775 .v.pins = (const struct hda_pintbl[]) {
7776 { 0x17, 0x90170130 }, /* bass spk */
7780 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7782 [ALC289_FIXUP_DUAL_SPK] = {
7783 .type = HDA_FIXUP_FUNC,
7784 .v.func = alc285_fixup_speaker2_to_dac1,
7786 .chain_id = ALC289_FIXUP_DELL_SPK2
7788 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7789 .type = HDA_FIXUP_FUNC,
7790 .v.func = alc285_fixup_speaker2_to_dac1,
7792 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7794 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7795 .type = HDA_FIXUP_FUNC,
7796 /* The GPIO must be pulled to initialize the AMP */
7797 .v.func = alc_fixup_gpio4,
7799 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7801 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
7802 .type = HDA_FIXUP_FUNC,
7803 .v.func = alc285_fixup_thinkpad_x1_gen7,
7805 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7807 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7808 .type = HDA_FIXUP_FUNC,
7809 .v.func = alc_fixup_headset_jack,
7811 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
7813 [ALC294_FIXUP_ASUS_HPE] = {
7814 .type = HDA_FIXUP_VERBS,
7815 .v.verbs = (const struct hda_verb[]) {
7817 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7818 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7822 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7824 [ALC294_FIXUP_ASUS_GX502_PINS] = {
7825 .type = HDA_FIXUP_PINS,
7826 .v.pins = (const struct hda_pintbl[]) {
7827 { 0x19, 0x03a11050 }, /* front HP mic */
7828 { 0x1a, 0x01a11830 }, /* rear external mic */
7829 { 0x21, 0x03211020 }, /* front HP out */
7833 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
7835 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
7836 .type = HDA_FIXUP_VERBS,
7837 .v.verbs = (const struct hda_verb[]) {
7838 /* set 0x15 to HP-OUT ctrl */
7839 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7840 /* unmute the 0x15 amp */
7841 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7845 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
7847 [ALC294_FIXUP_ASUS_GX502_HP] = {
7848 .type = HDA_FIXUP_FUNC,
7849 .v.func = alc294_fixup_gx502_hp,
7851 [ALC294_FIXUP_ASUS_GU502_PINS] = {
7852 .type = HDA_FIXUP_PINS,
7853 .v.pins = (const struct hda_pintbl[]) {
7854 { 0x19, 0x01a11050 }, /* rear HP mic */
7855 { 0x1a, 0x01a11830 }, /* rear external mic */
7856 { 0x21, 0x012110f0 }, /* rear HP out */
7860 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
7862 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
7863 .type = HDA_FIXUP_VERBS,
7864 .v.verbs = (const struct hda_verb[]) {
7865 /* set 0x15 to HP-OUT ctrl */
7866 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7867 /* unmute the 0x15 amp */
7868 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7869 /* set 0x1b to HP-OUT */
7870 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
7874 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
7876 [ALC294_FIXUP_ASUS_GU502_HP] = {
7877 .type = HDA_FIXUP_FUNC,
7878 .v.func = alc294_fixup_gu502_hp,
7880 [ALC294_FIXUP_ASUS_COEF_1B] = {
7881 .type = HDA_FIXUP_VERBS,
7882 .v.verbs = (const struct hda_verb[]) {
7883 /* Set bit 10 to correct noisy output after reboot from
7884 * Windows 10 (due to pop noise reduction?)
7886 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
7887 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
7891 .chain_id = ALC289_FIXUP_ASUS_GA401,
7893 [ALC285_FIXUP_HP_GPIO_LED] = {
7894 .type = HDA_FIXUP_FUNC,
7895 .v.func = alc285_fixup_hp_gpio_led,
7897 [ALC285_FIXUP_HP_MUTE_LED] = {
7898 .type = HDA_FIXUP_FUNC,
7899 .v.func = alc285_fixup_hp_mute_led,
7901 [ALC236_FIXUP_HP_GPIO_LED] = {
7902 .type = HDA_FIXUP_FUNC,
7903 .v.func = alc236_fixup_hp_gpio_led,
7905 [ALC236_FIXUP_HP_MUTE_LED] = {
7906 .type = HDA_FIXUP_FUNC,
7907 .v.func = alc236_fixup_hp_mute_led,
7909 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
7910 .type = HDA_FIXUP_FUNC,
7911 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
7913 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
7914 .type = HDA_FIXUP_VERBS,
7915 .v.verbs = (const struct hda_verb[]) {
7916 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
7920 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7921 .type = HDA_FIXUP_PINS,
7922 .v.pins = (const struct hda_pintbl[]) {
7923 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7927 .chain_id = ALC269_FIXUP_HEADSET_MODE
7929 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
7930 .type = HDA_FIXUP_PINS,
7931 .v.pins = (const struct hda_pintbl[]) {
7932 { 0x14, 0x90100120 }, /* use as internal speaker */
7933 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7934 { 0x1a, 0x01011020 }, /* use as line out */
7938 .chain_id = ALC269_FIXUP_HEADSET_MIC
7940 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
7941 .type = HDA_FIXUP_PINS,
7942 .v.pins = (const struct hda_pintbl[]) {
7943 { 0x18, 0x02a11030 }, /* use as headset mic */
7947 .chain_id = ALC269_FIXUP_HEADSET_MIC
7949 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
7950 .type = HDA_FIXUP_PINS,
7951 .v.pins = (const struct hda_pintbl[]) {
7952 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7956 .chain_id = ALC269_FIXUP_HEADSET_MIC
7958 [ALC289_FIXUP_ASUS_GA401] = {
7959 .type = HDA_FIXUP_FUNC,
7960 .v.func = alc289_fixup_asus_ga401,
7962 .chain_id = ALC289_FIXUP_ASUS_GA502,
7964 [ALC289_FIXUP_ASUS_GA502] = {
7965 .type = HDA_FIXUP_PINS,
7966 .v.pins = (const struct hda_pintbl[]) {
7967 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7971 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
7972 .type = HDA_FIXUP_PINS,
7973 .v.pins = (const struct hda_pintbl[]) {
7974 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
7978 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7980 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
7981 .type = HDA_FIXUP_FUNC,
7982 .v.func = alc285_fixup_hp_gpio_amp_init,
7984 .chain_id = ALC285_FIXUP_HP_GPIO_LED
7986 [ALC269_FIXUP_CZC_B20] = {
7987 .type = HDA_FIXUP_PINS,
7988 .v.pins = (const struct hda_pintbl[]) {
7989 { 0x12, 0x411111f0 },
7990 { 0x14, 0x90170110 }, /* speaker */
7991 { 0x15, 0x032f1020 }, /* HP out */
7992 { 0x17, 0x411111f0 },
7993 { 0x18, 0x03ab1040 }, /* mic */
7994 { 0x19, 0xb7a7013f },
7995 { 0x1a, 0x0181305f },
7996 { 0x1b, 0x411111f0 },
7997 { 0x1d, 0x411111f0 },
7998 { 0x1e, 0x411111f0 },
8001 .chain_id = ALC269_FIXUP_DMIC,
8003 [ALC269_FIXUP_CZC_TMI] = {
8004 .type = HDA_FIXUP_PINS,
8005 .v.pins = (const struct hda_pintbl[]) {
8006 { 0x12, 0x4000c000 },
8007 { 0x14, 0x90170110 }, /* speaker */
8008 { 0x15, 0x0421401f }, /* HP out */
8009 { 0x17, 0x411111f0 },
8010 { 0x18, 0x04a19020 }, /* mic */
8011 { 0x19, 0x411111f0 },
8012 { 0x1a, 0x411111f0 },
8013 { 0x1b, 0x411111f0 },
8014 { 0x1d, 0x40448505 },
8015 { 0x1e, 0x411111f0 },
8016 { 0x20, 0x8000ffff },
8019 .chain_id = ALC269_FIXUP_DMIC,
8021 [ALC269_FIXUP_CZC_L101] = {
8022 .type = HDA_FIXUP_PINS,
8023 .v.pins = (const struct hda_pintbl[]) {
8024 { 0x12, 0x40000000 },
8025 { 0x14, 0x01014010 }, /* speaker */
8026 { 0x15, 0x411111f0 }, /* HP out */
8027 { 0x16, 0x411111f0 },
8028 { 0x18, 0x01a19020 }, /* mic */
8029 { 0x19, 0x02a19021 },
8030 { 0x1a, 0x0181302f },
8031 { 0x1b, 0x0221401f },
8032 { 0x1c, 0x411111f0 },
8033 { 0x1d, 0x4044c601 },
8034 { 0x1e, 0x411111f0 },
8037 .chain_id = ALC269_FIXUP_DMIC,
8039 [ALC269_FIXUP_LEMOTE_A1802] = {
8040 .type = HDA_FIXUP_PINS,
8041 .v.pins = (const struct hda_pintbl[]) {
8042 { 0x12, 0x40000000 },
8043 { 0x14, 0x90170110 }, /* speaker */
8044 { 0x17, 0x411111f0 },
8045 { 0x18, 0x03a19040 }, /* mic1 */
8046 { 0x19, 0x90a70130 }, /* mic2 */
8047 { 0x1a, 0x411111f0 },
8048 { 0x1b, 0x411111f0 },
8049 { 0x1d, 0x40489d2d },
8050 { 0x1e, 0x411111f0 },
8051 { 0x20, 0x0003ffff },
8052 { 0x21, 0x03214020 },
8055 .chain_id = ALC269_FIXUP_DMIC,
8057 [ALC269_FIXUP_LEMOTE_A190X] = {
8058 .type = HDA_FIXUP_PINS,
8059 .v.pins = (const struct hda_pintbl[]) {
8060 { 0x14, 0x99130110 }, /* speaker */
8061 { 0x15, 0x0121401f }, /* HP out */
8062 { 0x18, 0x01a19c20 }, /* rear mic */
8063 { 0x19, 0x99a3092f }, /* front mic */
8064 { 0x1b, 0x0201401f }, /* front lineout */
8067 .chain_id = ALC269_FIXUP_DMIC,
8069 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8070 .type = HDA_FIXUP_PINS,
8071 .v.pins = (const struct hda_pintbl[]) {
8072 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8076 .chain_id = ALC269_FIXUP_HEADSET_MODE
8078 [ALC256_FIXUP_INTEL_NUC10] = {
8079 .type = HDA_FIXUP_PINS,
8080 .v.pins = (const struct hda_pintbl[]) {
8081 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8085 .chain_id = ALC269_FIXUP_HEADSET_MODE
8087 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8088 .type = HDA_FIXUP_VERBS,
8089 .v.verbs = (const struct hda_verb[]) {
8090 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8091 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8095 .chain_id = ALC289_FIXUP_ASUS_GA502
8097 [ALC274_FIXUP_HP_MIC] = {
8098 .type = HDA_FIXUP_VERBS,
8099 .v.verbs = (const struct hda_verb[]) {
8100 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8101 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8105 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8106 .type = HDA_FIXUP_FUNC,
8107 .v.func = alc274_fixup_hp_headset_mic,
8109 .chain_id = ALC274_FIXUP_HP_MIC
8111 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8112 .type = HDA_FIXUP_FUNC,
8113 .v.func = alc274_fixup_hp_envy_gpio,
8115 [ALC256_FIXUP_ASUS_HPE] = {
8116 .type = HDA_FIXUP_VERBS,
8117 .v.verbs = (const struct hda_verb[]) {
8119 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8120 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8124 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8126 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8127 .type = HDA_FIXUP_FUNC,
8128 .v.func = alc_fixup_headset_jack,
8130 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8132 [ALC287_FIXUP_HP_GPIO_LED] = {
8133 .type = HDA_FIXUP_FUNC,
8134 .v.func = alc287_fixup_hp_gpio_led,
8136 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8137 .type = HDA_FIXUP_FUNC,
8138 .v.func = alc274_fixup_hp_headset_mic,
8140 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8141 .type = HDA_FIXUP_FUNC,
8142 .v.func = alc_fixup_no_int_mic,
8144 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8146 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8147 .type = HDA_FIXUP_PINS,
8148 .v.pins = (const struct hda_pintbl[]) {
8149 { 0x1b, 0x411111f0 },
8150 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8154 .chain_id = ALC269_FIXUP_HEADSET_MODE
8156 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8157 .type = HDA_FIXUP_FUNC,
8158 .v.func = alc269_fixup_limit_int_mic_boost,
8160 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8162 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8163 .type = HDA_FIXUP_PINS,
8164 .v.pins = (const struct hda_pintbl[]) {
8165 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8166 { 0x1a, 0x90a1092f }, /* use as internal mic */
8170 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8172 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8173 .type = HDA_FIXUP_FUNC,
8174 .v.func = alc285_fixup_ideapad_s740_coef,
8176 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8178 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8179 .type = HDA_FIXUP_FUNC,
8180 .v.func = alc269_fixup_limit_int_mic_boost,
8182 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8184 [ALC295_FIXUP_ASUS_DACS] = {
8185 .type = HDA_FIXUP_FUNC,
8186 .v.func = alc295_fixup_asus_dacs,
8188 [ALC295_FIXUP_HP_OMEN] = {
8189 .type = HDA_FIXUP_PINS,
8190 .v.pins = (const struct hda_pintbl[]) {
8191 { 0x12, 0xb7a60130 },
8192 { 0x13, 0x40000000 },
8193 { 0x14, 0x411111f0 },
8194 { 0x16, 0x411111f0 },
8195 { 0x17, 0x90170110 },
8196 { 0x18, 0x411111f0 },
8197 { 0x19, 0x02a11030 },
8198 { 0x1a, 0x411111f0 },
8199 { 0x1b, 0x04a19030 },
8200 { 0x1d, 0x40600001 },
8201 { 0x1e, 0x411111f0 },
8202 { 0x21, 0x03211020 },
8206 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8208 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8209 .type = HDA_FIXUP_FUNC,
8210 .v.func = alc285_fixup_hp_spectre_x360,
8212 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8213 .type = HDA_FIXUP_FUNC,
8214 .v.func = alc285_fixup_ideapad_s740_coef,
8216 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8218 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8219 .type = HDA_FIXUP_FUNC,
8220 .v.func = alc_fixup_no_shutup,
8222 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8224 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8225 .type = HDA_FIXUP_PINS,
8226 .v.pins = (const struct hda_pintbl[]) {
8227 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8231 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8233 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8234 .type = HDA_FIXUP_FUNC,
8235 .v.func = alc269_fixup_limit_int_mic_boost,
8237 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8241 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8242 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8243 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8244 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8245 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8246 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8247 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8248 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8249 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8250 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8251 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8252 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8253 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8254 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8255 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8256 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8257 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8258 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8259 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8260 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8261 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8262 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8263 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8264 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8265 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8266 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8267 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8268 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8269 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8270 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8271 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8272 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8273 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8274 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8275 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8276 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8277 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8278 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8279 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8280 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8281 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8282 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8283 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8284 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8285 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8286 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8287 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8288 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8289 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8290 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8291 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8292 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8293 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8294 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8295 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8296 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8297 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8298 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8299 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8300 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8301 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8302 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8303 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8304 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8305 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8306 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8307 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8308 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8309 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8310 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8311 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8312 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8313 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8314 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8315 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8316 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8317 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8318 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8319 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8320 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8321 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8322 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8323 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8324 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8325 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8326 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8327 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8328 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8329 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8330 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8331 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8332 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8333 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8334 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8335 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8336 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8337 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8338 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8339 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8340 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8341 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8342 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8343 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8344 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8345 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8346 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8347 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8348 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8349 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8350 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8351 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8352 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8353 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8354 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8355 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8356 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8357 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8358 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8359 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8360 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8361 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8362 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8363 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8364 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8365 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8366 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8367 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8368 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8369 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8370 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8371 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8372 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8373 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8374 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8375 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8376 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8377 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8378 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8379 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8380 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8381 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8382 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8383 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8384 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8385 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8386 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8387 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8388 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8389 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8390 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8391 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8392 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8393 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8394 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8395 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8396 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8397 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8398 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8399 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8400 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8401 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8402 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8403 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8404 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8405 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8406 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8407 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
8408 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8409 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8410 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
8411 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
8412 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8413 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8414 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
8415 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
8416 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8417 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8418 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8419 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8420 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8421 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
8422 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8423 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8424 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8425 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8426 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8427 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
8428 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8429 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8430 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8431 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8432 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8433 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8434 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8435 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8436 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8437 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8438 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8439 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8440 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8441 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
8442 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
8443 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8444 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
8445 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8446 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
8447 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8448 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
8449 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8450 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8451 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8452 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8453 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8454 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
8455 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8456 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8457 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
8458 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
8459 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
8460 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
8461 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
8462 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8463 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
8464 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
8465 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
8466 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8467 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
8468 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
8469 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
8470 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8471 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
8472 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
8473 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
8474 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
8475 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
8476 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
8477 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8478 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8479 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
8480 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
8481 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
8482 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
8483 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
8484 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8485 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
8486 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8487 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8488 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8489 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8490 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
8491 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8492 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8493 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8494 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
8495 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8496 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8497 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
8498 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
8499 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8500 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
8501 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8502 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
8503 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
8504 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8505 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8506 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8507 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8508 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
8509 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
8510 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8511 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8512 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8513 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8514 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
8515 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8516 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8517 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8518 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8519 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
8520 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
8521 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8522 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8523 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8524 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8525 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8526 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8527 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8528 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8529 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8530 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8531 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8532 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8533 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8534 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8535 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8536 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8537 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8538 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8539 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8540 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8541 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8542 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8543 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8544 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8545 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8546 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8547 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8548 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8549 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8550 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8551 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8552 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8553 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8554 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8555 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8556 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8557 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8558 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8559 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8560 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8561 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
8562 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8563 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8564 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8565 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8566 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8567 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8568 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8569 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8570 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8571 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8572 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8573 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8574 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8575 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8576 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8577 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8578 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8579 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8580 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
8581 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
8582 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8583 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8584 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8585 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8586 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
8587 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
8588 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
8589 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
8590 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
8591 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
8592 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
8593 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
8594 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
8595 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
8596 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
8597 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
8598 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
8599 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8600 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
8601 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
8602 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
8603 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8604 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8605 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
8606 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
8607 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
8608 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8609 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8610 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
8611 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8612 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8613 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8614 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8615 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8616 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8617 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8618 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8619 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8620 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8621 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8622 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8623 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8624 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8625 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8626 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8627 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8628 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8629 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
8630 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
8631 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
8632 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
8633 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8634 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
8635 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8636 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
8637 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8638 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
8639 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
8640 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8641 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
8642 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
8643 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
8644 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
8645 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
8646 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
8647 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
8648 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
8649 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8650 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8651 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8652 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8653 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8654 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8655 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
8656 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
8657 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
8658 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
8659 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
8660 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
8661 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
8662 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
8663 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8664 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
8665 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
8666 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8667 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
8668 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
8669 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
8672 /* Below is a quirk table taken from the old code.
8673 * Basically the device should work as is without the fixup table.
8674 * If BIOS doesn't give a proper info, enable the corresponding
8677 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
8679 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
8680 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
8681 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
8682 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
8683 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
8684 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
8685 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
8686 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
8687 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
8688 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
8689 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
8690 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
8691 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
8692 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
8693 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
8694 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
8695 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
8696 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
8697 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
8698 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
8699 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
8700 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
8701 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
8702 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
8703 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
8704 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
8705 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
8706 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
8707 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
8708 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
8709 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
8710 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
8711 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
8712 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
8713 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
8714 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
8715 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
8716 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
8717 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
8722 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
8723 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
8724 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
8725 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
8726 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
8727 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
8731 static const struct hda_model_fixup alc269_fixup_models[] = {
8732 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
8733 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
8734 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
8735 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
8736 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
8737 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
8738 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
8739 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
8740 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
8741 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
8742 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8743 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
8744 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
8745 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
8746 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
8747 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
8748 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
8749 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
8750 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
8751 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
8752 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
8753 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
8754 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
8755 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
8756 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
8757 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
8758 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
8759 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
8760 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
8761 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
8762 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
8763 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
8764 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
8765 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
8766 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
8767 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
8768 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
8769 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
8770 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
8771 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
8772 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
8773 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
8774 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
8775 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
8776 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
8777 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
8778 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
8779 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
8780 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
8781 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
8782 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
8783 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
8784 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
8785 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
8786 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
8787 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
8788 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
8789 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
8790 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
8791 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
8792 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
8793 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
8794 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
8795 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
8796 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
8797 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
8798 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
8799 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
8800 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
8801 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8802 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
8803 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
8804 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
8805 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
8806 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
8807 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
8808 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
8809 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
8810 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
8811 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
8812 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
8813 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
8814 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
8815 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
8816 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
8817 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
8818 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
8819 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
8820 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
8821 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
8822 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
8823 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
8824 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
8825 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
8826 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
8827 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
8828 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
8829 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
8830 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
8831 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
8832 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
8833 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
8834 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
8835 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
8836 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8837 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
8838 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
8839 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
8840 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
8841 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
8842 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
8843 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
8844 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
8845 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
8846 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
8847 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
8848 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
8849 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
8850 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
8853 #define ALC225_STANDARD_PINS \
8856 #define ALC256_STANDARD_PINS \
8857 {0x12, 0x90a60140}, \
8858 {0x14, 0x90170110}, \
8861 #define ALC282_STANDARD_PINS \
8864 #define ALC290_STANDARD_PINS \
8867 #define ALC292_STANDARD_PINS \
8868 {0x14, 0x90170110}, \
8871 #define ALC295_STANDARD_PINS \
8872 {0x12, 0xb7a60130}, \
8873 {0x14, 0x90170110}, \
8876 #define ALC298_STANDARD_PINS \
8877 {0x12, 0x90a60130}, \
8880 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8881 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
8886 {0x21, 0x0221102f}),
8887 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8890 {0x21, 0x02211030}),
8891 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8894 {0x21, 0x03211020}),
8895 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8898 {0x21, 0x03211020}),
8899 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8900 ALC225_STANDARD_PINS,
8902 {0x14, 0x901701a0}),
8903 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8904 ALC225_STANDARD_PINS,
8906 {0x14, 0x901701b0}),
8907 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8908 ALC225_STANDARD_PINS,
8910 {0x14, 0x901701a0}),
8911 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8912 ALC225_STANDARD_PINS,
8914 {0x14, 0x901701b0}),
8915 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8916 ALC225_STANDARD_PINS,
8918 {0x1b, 0x90170110}),
8919 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8922 {0x21, 0x02211020}),
8923 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
8927 {0x21, 0x02211020}),
8928 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8933 {0x21, 0x0221101f}),
8934 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8939 {0x21, 0x0221101f}),
8940 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8944 {0x21, 0x0221101f}),
8945 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
8946 {0x21, 0x02211010}),
8947 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
8950 {0x21, 0x02211030}),
8951 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
8953 {0x21, 0x02211020}),
8954 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8956 {0x21, 0x02211040}),
8957 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8960 {0x21, 0x02211020}),
8961 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8964 {0x21, 0x02211030}),
8965 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8968 {0x21, 0x0221101f}),
8969 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8972 {0x21, 0x0221101f}),
8973 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8976 {0x21, 0x0221103f}),
8977 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8980 {0x21, 0x0221103f}),
8981 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8984 {0x21, 0x0221103f}),
8985 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8988 {0x21, 0x0221105f}),
8989 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8992 {0x21, 0x0221101f}),
8993 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8997 {0x21, 0x0321102f}),
8998 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9001 {0x21, 0x02211040}),
9002 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9005 {0x21, 0x02211050}),
9006 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9009 {0x21, 0x02211030}),
9010 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9013 {0x21, 0x02211040}),
9014 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9017 {0x21, 0x02211040}),
9018 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9021 {0x21, 0x02211050}),
9022 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9025 {0x21, 0x02211040}),
9026 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9029 {0x21, 0x02211030}),
9030 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9032 {0x21, 0x02211010}),
9033 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9036 {0x21, 0x04211020}),
9037 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9040 {0x21, 0x03211020}),
9041 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9044 {0x21, 0x03211020}),
9045 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9048 {0x21, 0x04211020}),
9049 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9052 {0x21, 0x03211020}),
9053 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9056 {0x21, 0x0221101f}),
9057 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9060 {0x21, 0x03211020}),
9061 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9065 {0x1a, 0x04a11020}),
9066 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9072 {0x1b, 0x02011020}),
9073 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9074 ALC282_STANDARD_PINS,
9077 {0x21, 0x0321101f}),
9078 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9079 ALC282_STANDARD_PINS,
9082 {0x21, 0x03211040}),
9083 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9084 ALC282_STANDARD_PINS,
9087 {0x21, 0x03211020}),
9088 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9089 ALC282_STANDARD_PINS,
9092 {0x21, 0x0421101f}),
9093 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9094 ALC282_STANDARD_PINS,
9097 {0x21, 0x04211020}),
9098 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9099 ALC282_STANDARD_PINS,
9105 {0x21, 0x0321101f}),
9106 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9107 ALC282_STANDARD_PINS,
9113 {0x21, 0x0321101f}),
9114 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9115 ALC282_STANDARD_PINS,
9117 {0x21, 0x0321101f}),
9118 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9121 {0x21, 0x02211030}),
9122 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9123 ALC282_STANDARD_PINS,
9126 {0x21, 0x0321101f}),
9127 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9131 {0x21, 0x04211020}),
9132 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9136 {0x21, 0x04211020}),
9137 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9140 {0x21, 0x04211020}),
9141 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9145 {0x21, 0x03211020}),
9146 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9149 {0x21, 0x02211020}),
9150 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9153 {0x21, 0x0321101f}),
9154 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9155 ALC290_STANDARD_PINS,
9158 {0x1a, 0x04a11020}),
9159 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9160 ALC290_STANDARD_PINS,
9163 {0x1a, 0x04a11020}),
9164 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9165 ALC290_STANDARD_PINS,
9167 {0x1a, 0x04a11020}),
9168 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9169 ALC290_STANDARD_PINS,
9171 {0x1a, 0x04a11040}),
9172 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9173 ALC290_STANDARD_PINS,
9176 {0x1a, 0x04a11040}),
9177 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9178 ALC290_STANDARD_PINS,
9181 {0x1a, 0x04a11020}),
9182 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9183 ALC290_STANDARD_PINS,
9186 {0x1a, 0x04a11020}),
9187 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9188 ALC292_STANDARD_PINS,
9191 {0x19, 0x01a19030}),
9192 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9193 ALC292_STANDARD_PINS,
9197 {0x19, 0x01a1903e}),
9198 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9199 ALC292_STANDARD_PINS,
9200 {0x12, 0x90a60140}),
9201 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9202 ALC292_STANDARD_PINS,
9205 {0x19, 0x21a19030}),
9206 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9207 ALC292_STANDARD_PINS,
9208 {0x13, 0x90a60140}),
9209 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9211 {0x21, 0x04211020}),
9212 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9215 {0x21, 0x04211020}),
9216 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9219 {0x21, 0x03211020}),
9220 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9223 {0x21, 0x04211020}),
9224 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9227 {0x21, 0x03211020}),
9228 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9231 {0x21, 0x04211030}),
9232 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9235 {0x21, 0x03211020}),
9236 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9239 {0x21, 0x03211020}),
9240 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9242 {0x21, 0x04211020}),
9243 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9245 {0x21, 0x04211030}),
9246 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9247 ALC295_STANDARD_PINS,
9249 {0x18, 0x21a19030}),
9250 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9251 ALC295_STANDARD_PINS,
9253 {0x18, 0x21a19050}),
9254 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9255 ALC295_STANDARD_PINS),
9256 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9257 ALC298_STANDARD_PINS,
9258 {0x17, 0x90170110}),
9259 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9260 ALC298_STANDARD_PINS,
9261 {0x17, 0x90170140}),
9262 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9263 ALC298_STANDARD_PINS,
9264 {0x17, 0x90170150}),
9265 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9270 {0x21, 0x03211030}),
9271 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9275 {0x21, 0x03211020}),
9276 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9277 ALC225_STANDARD_PINS,
9279 {0x17, 0x90170110}),
9280 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9285 {0x21, 0x0221101f}),
9289 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9290 * more machines, don't need to match all valid pins, just need to match
9291 * all the pins defined in the tbl. Just because of this reason, it is possible
9292 * that a single machine matches multiple tbls, so there is one limitation:
9293 * at most one tbl is allowed to define for the same vendor and same codec
9295 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9296 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9298 {0x1b, 0x40000000}),
9299 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9301 {0x1a, 0x40000000}),
9302 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9304 {0x1a, 0x40000000}),
9305 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9307 {0x1a, 0x40000000}),
9311 static void alc269_fill_coef(struct hda_codec *codec)
9313 struct alc_spec *spec = codec->spec;
9316 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9319 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9320 alc_write_coef_idx(codec, 0xf, 0x960b);
9321 alc_write_coef_idx(codec, 0xe, 0x8817);
9324 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9325 alc_write_coef_idx(codec, 0xf, 0x960b);
9326 alc_write_coef_idx(codec, 0xe, 0x8814);
9329 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9330 /* Power up output pin */
9331 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9334 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9335 val = alc_read_coef_idx(codec, 0xd);
9336 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9337 /* Capless ramp up clock control */
9338 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9340 val = alc_read_coef_idx(codec, 0x17);
9341 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9342 /* Class D power on reset */
9343 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9348 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
9353 static int patch_alc269(struct hda_codec *codec)
9355 struct alc_spec *spec;
9358 err = alc_alloc_spec(codec, 0x0b);
9363 spec->gen.shared_mic_vref_pin = 0x18;
9364 codec->power_save_node = 0;
9367 codec->patch_ops.suspend = alc269_suspend;
9368 codec->patch_ops.resume = alc269_resume;
9370 spec->shutup = alc_default_shutup;
9371 spec->init_hook = alc_default_init;
9373 switch (codec->core.vendor_id) {
9375 spec->codec_variant = ALC269_TYPE_ALC269VA;
9376 switch (alc_get_coef0(codec) & 0x00f0) {
9378 if (codec->bus->pci &&
9379 codec->bus->pci->subsystem_vendor == 0x1025 &&
9380 spec->cdefine.platform_type == 1)
9381 err = alc_codec_rename(codec, "ALC271X");
9382 spec->codec_variant = ALC269_TYPE_ALC269VB;
9385 if (codec->bus->pci &&
9386 codec->bus->pci->subsystem_vendor == 0x17aa &&
9387 codec->bus->pci->subsystem_device == 0x21f3)
9388 err = alc_codec_rename(codec, "ALC3202");
9389 spec->codec_variant = ALC269_TYPE_ALC269VC;
9392 spec->codec_variant = ALC269_TYPE_ALC269VD;
9395 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9399 spec->shutup = alc269_shutup;
9400 spec->init_hook = alc269_fill_coef;
9401 alc269_fill_coef(codec);
9406 spec->codec_variant = ALC269_TYPE_ALC280;
9409 spec->codec_variant = ALC269_TYPE_ALC282;
9410 spec->shutup = alc282_shutup;
9411 spec->init_hook = alc282_init;
9415 spec->codec_variant = ALC269_TYPE_ALC283;
9416 spec->shutup = alc283_shutup;
9417 spec->init_hook = alc283_init;
9421 spec->codec_variant = ALC269_TYPE_ALC284;
9424 spec->codec_variant = ALC269_TYPE_ALC293;
9428 spec->codec_variant = ALC269_TYPE_ALC286;
9431 spec->codec_variant = ALC269_TYPE_ALC298;
9435 spec->codec_variant = ALC269_TYPE_ALC255;
9436 spec->shutup = alc256_shutup;
9437 spec->init_hook = alc256_init;
9442 spec->codec_variant = ALC269_TYPE_ALC256;
9443 spec->shutup = alc256_shutup;
9444 spec->init_hook = alc256_init;
9445 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
9448 spec->codec_variant = ALC269_TYPE_ALC257;
9449 spec->shutup = alc256_shutup;
9450 spec->init_hook = alc256_init;
9451 spec->gen.mixer_nid = 0;
9457 spec->codec_variant = ALC269_TYPE_ALC215;
9458 spec->shutup = alc225_shutup;
9459 spec->init_hook = alc225_init;
9460 spec->gen.mixer_nid = 0;
9465 spec->codec_variant = ALC269_TYPE_ALC225;
9466 spec->shutup = alc225_shutup;
9467 spec->init_hook = alc225_init;
9468 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
9471 spec->codec_variant = ALC269_TYPE_ALC287;
9472 spec->shutup = alc225_shutup;
9473 spec->init_hook = alc225_init;
9474 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
9479 spec->codec_variant = ALC269_TYPE_ALC294;
9480 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
9481 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
9482 spec->init_hook = alc294_init;
9485 spec->codec_variant = ALC269_TYPE_ALC300;
9486 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
9489 spec->codec_variant = ALC269_TYPE_ALC623;
9495 spec->codec_variant = ALC269_TYPE_ALC700;
9496 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
9497 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
9498 spec->init_hook = alc294_init;
9503 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
9504 spec->has_alc5505_dsp = 1;
9505 spec->init_hook = alc5505_dsp_init;
9508 alc_pre_init(codec);
9510 snd_hda_pick_fixup(codec, alc269_fixup_models,
9511 alc269_fixup_tbl, alc269_fixups);
9512 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
9513 * the quirk breaks the latter (bko#214101).
9514 * Clear the wrong entry.
9516 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
9517 codec->core.vendor_id == 0x10ec0294) {
9518 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
9519 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
9522 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
9523 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
9524 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
9526 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9528 alc_auto_parse_customize_define(codec);
9530 if (has_cdefine_beep(codec))
9531 spec->gen.beep_nid = 0x01;
9533 /* automatic parse from the BIOS config */
9534 err = alc269_parse_auto_config(codec);
9538 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
9539 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9544 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9557 static int alc861_parse_auto_config(struct hda_codec *codec)
9559 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
9560 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9561 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
9564 /* Pin config fixes */
9566 ALC861_FIXUP_FSC_AMILO_PI1505,
9567 ALC861_FIXUP_AMP_VREF_0F,
9568 ALC861_FIXUP_NO_JACK_DETECT,
9569 ALC861_FIXUP_ASUS_A6RP,
9570 ALC660_FIXUP_ASUS_W7J,
9573 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9574 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
9575 const struct hda_fixup *fix, int action)
9577 struct alc_spec *spec = codec->spec;
9580 if (action != HDA_FIXUP_ACT_INIT)
9582 val = snd_hda_codec_get_pin_target(codec, 0x0f);
9583 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9584 val |= AC_PINCTL_IN_EN;
9585 val |= AC_PINCTL_VREF_50;
9586 snd_hda_set_pin_ctl(codec, 0x0f, val);
9587 spec->gen.keep_vref_in_automute = 1;
9590 /* suppress the jack-detection */
9591 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
9592 const struct hda_fixup *fix, int action)
9594 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9595 codec->no_jack_detect = 1;
9598 static const struct hda_fixup alc861_fixups[] = {
9599 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
9600 .type = HDA_FIXUP_PINS,
9601 .v.pins = (const struct hda_pintbl[]) {
9602 { 0x0b, 0x0221101f }, /* HP */
9603 { 0x0f, 0x90170310 }, /* speaker */
9607 [ALC861_FIXUP_AMP_VREF_0F] = {
9608 .type = HDA_FIXUP_FUNC,
9609 .v.func = alc861_fixup_asus_amp_vref_0f,
9611 [ALC861_FIXUP_NO_JACK_DETECT] = {
9612 .type = HDA_FIXUP_FUNC,
9613 .v.func = alc_fixup_no_jack_detect,
9615 [ALC861_FIXUP_ASUS_A6RP] = {
9616 .type = HDA_FIXUP_FUNC,
9617 .v.func = alc861_fixup_asus_amp_vref_0f,
9619 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
9621 [ALC660_FIXUP_ASUS_W7J] = {
9622 .type = HDA_FIXUP_VERBS,
9623 .v.verbs = (const struct hda_verb[]) {
9624 /* ASUS W7J needs a magic pin setup on unused NID 0x10
9625 * for enabling outputs
9627 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
9633 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
9634 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
9635 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
9636 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
9637 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
9638 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
9639 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
9640 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
9646 static int patch_alc861(struct hda_codec *codec)
9648 struct alc_spec *spec;
9651 err = alc_alloc_spec(codec, 0x15);
9656 if (has_cdefine_beep(codec))
9657 spec->gen.beep_nid = 0x23;
9660 spec->power_hook = alc_power_eapd;
9663 alc_pre_init(codec);
9665 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
9666 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9668 /* automatic parse from the BIOS config */
9669 err = alc861_parse_auto_config(codec);
9673 if (!spec->gen.no_analog) {
9674 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
9679 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9693 * In addition, an independent DAC
9695 static int alc861vd_parse_auto_config(struct hda_codec *codec)
9697 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
9698 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9699 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
9703 ALC660VD_FIX_ASUS_GPIO1,
9704 ALC861VD_FIX_DALLAS,
9707 /* exclude VREF80 */
9708 static void alc861vd_fixup_dallas(struct hda_codec *codec,
9709 const struct hda_fixup *fix, int action)
9711 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9712 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
9713 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
9718 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
9719 const struct hda_fixup *fix, int action)
9721 struct alc_spec *spec = codec->spec;
9723 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9724 spec->gpio_mask |= 0x02;
9725 alc_fixup_gpio(codec, action, 0x01);
9728 static const struct hda_fixup alc861vd_fixups[] = {
9729 [ALC660VD_FIX_ASUS_GPIO1] = {
9730 .type = HDA_FIXUP_FUNC,
9731 .v.func = alc660vd_fixup_asus_gpio1,
9733 [ALC861VD_FIX_DALLAS] = {
9734 .type = HDA_FIXUP_FUNC,
9735 .v.func = alc861vd_fixup_dallas,
9739 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
9740 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
9741 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
9742 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
9748 static int patch_alc861vd(struct hda_codec *codec)
9750 struct alc_spec *spec;
9753 err = alc_alloc_spec(codec, 0x0b);
9758 if (has_cdefine_beep(codec))
9759 spec->gen.beep_nid = 0x23;
9761 spec->shutup = alc_eapd_shutup;
9763 alc_pre_init(codec);
9765 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
9766 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9768 /* automatic parse from the BIOS config */
9769 err = alc861vd_parse_auto_config(codec);
9773 if (!spec->gen.no_analog) {
9774 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9779 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9791 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
9792 * configuration. Each pin widget can choose any input DACs and a mixer.
9793 * Each ADC is connected from a mixer of all inputs. This makes possible
9794 * 6-channel independent captures.
9796 * In addition, an independent DAC for the multi-playback (not used in this
9801 * BIOS auto configuration
9804 static int alc662_parse_auto_config(struct hda_codec *codec)
9806 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
9807 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
9808 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9809 const hda_nid_t *ssids;
9811 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
9812 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
9813 codec->core.vendor_id == 0x10ec0671)
9814 ssids = alc663_ssids;
9816 ssids = alc662_ssids;
9817 return alc_parse_auto_config(codec, alc662_ignore, ssids);
9820 static void alc272_fixup_mario(struct hda_codec *codec,
9821 const struct hda_fixup *fix, int action)
9823 if (action != HDA_FIXUP_ACT_PRE_PROBE)
9825 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
9826 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
9827 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
9828 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
9829 (0 << AC_AMPCAP_MUTE_SHIFT)))
9830 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
9833 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
9835 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
9837 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
9838 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
9842 /* override the 2.1 chmap */
9843 static void alc_fixup_bass_chmap(struct hda_codec *codec,
9844 const struct hda_fixup *fix, int action)
9846 if (action == HDA_FIXUP_ACT_BUILD) {
9847 struct alc_spec *spec = codec->spec;
9848 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
9852 /* avoid D3 for keeping GPIO up */
9853 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
9855 unsigned int power_state)
9857 struct alc_spec *spec = codec->spec;
9858 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
9863 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
9864 const struct hda_fixup *fix, int action)
9866 struct alc_spec *spec = codec->spec;
9868 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
9869 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9870 spec->mute_led_polarity = 1;
9871 codec->power_filter = gpio_led_power_filter;
9875 static void alc662_usi_automute_hook(struct hda_codec *codec,
9876 struct hda_jack_callback *jack)
9878 struct alc_spec *spec = codec->spec;
9881 snd_hda_gen_hp_automute(codec, jack);
9883 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
9885 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
9889 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
9890 const struct hda_fixup *fix, int action)
9892 struct alc_spec *spec = codec->spec;
9893 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9894 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9895 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
9899 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
9900 struct hda_jack_callback *cb)
9902 /* surround speakers at 0x1b already get muted automatically when
9903 * headphones are plugged in, but we have to mute/unmute the remaining
9904 * channels manually:
9905 * 0x15 - front left/front right
9906 * 0x18 - front center/ LFE
9908 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
9909 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
9910 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
9912 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
9913 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
9917 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
9918 const struct hda_fixup *fix, int action)
9920 /* Pin 0x1b: shared headphones jack and surround speakers */
9921 if (!is_jack_detectable(codec, 0x1b))
9925 case HDA_FIXUP_ACT_PRE_PROBE:
9926 snd_hda_jack_detect_enable_callback(codec, 0x1b,
9927 alc662_aspire_ethos_mute_speakers);
9928 /* subwoofer needs an extra GPIO setting to become audible */
9929 alc_setup_gpio(codec, 0x02);
9931 case HDA_FIXUP_ACT_INIT:
9932 /* Make sure to start in a correct state, i.e. if
9933 * headphones have been plugged in before powering up the system
9935 alc662_aspire_ethos_mute_speakers(codec, NULL);
9940 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
9941 const struct hda_fixup *fix, int action)
9943 struct alc_spec *spec = codec->spec;
9945 static const struct hda_pintbl pincfgs[] = {
9946 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
9947 { 0x1b, 0x0181304f },
9952 case HDA_FIXUP_ACT_PRE_PROBE:
9953 spec->gen.mixer_nid = 0;
9954 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9955 snd_hda_apply_pincfgs(codec, pincfgs);
9957 case HDA_FIXUP_ACT_INIT:
9958 alc_write_coef_idx(codec, 0x19, 0xa054);
9963 static const struct coef_fw alc668_coefs[] = {
9964 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
9965 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
9966 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
9967 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
9968 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
9969 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
9970 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
9971 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
9972 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
9973 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
9974 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
9975 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
9976 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
9977 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
9978 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
9979 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
9980 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
9981 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
9982 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
9983 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
9987 static void alc668_restore_default_value(struct hda_codec *codec)
9989 alc_process_coef_fw(codec, alc668_coefs);
9993 ALC662_FIXUP_ASPIRE,
9994 ALC662_FIXUP_LED_GPIO1,
9995 ALC662_FIXUP_IDEAPAD,
9997 ALC662_FIXUP_CZC_ET26,
9998 ALC662_FIXUP_CZC_P10T,
9999 ALC662_FIXUP_SKU_IGNORE,
10000 ALC662_FIXUP_HP_RP5800,
10001 ALC662_FIXUP_ASUS_MODE1,
10002 ALC662_FIXUP_ASUS_MODE2,
10003 ALC662_FIXUP_ASUS_MODE3,
10004 ALC662_FIXUP_ASUS_MODE4,
10005 ALC662_FIXUP_ASUS_MODE5,
10006 ALC662_FIXUP_ASUS_MODE6,
10007 ALC662_FIXUP_ASUS_MODE7,
10008 ALC662_FIXUP_ASUS_MODE8,
10009 ALC662_FIXUP_NO_JACK_DETECT,
10010 ALC662_FIXUP_ZOTAC_Z68,
10011 ALC662_FIXUP_INV_DMIC,
10012 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10013 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10014 ALC662_FIXUP_HEADSET_MODE,
10015 ALC668_FIXUP_HEADSET_MODE,
10016 ALC662_FIXUP_BASS_MODE4_CHMAP,
10017 ALC662_FIXUP_BASS_16,
10018 ALC662_FIXUP_BASS_1A,
10019 ALC662_FIXUP_BASS_CHMAP,
10020 ALC668_FIXUP_AUTO_MUTE,
10021 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10022 ALC668_FIXUP_DELL_XPS13,
10023 ALC662_FIXUP_ASUS_Nx50,
10024 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10025 ALC668_FIXUP_ASUS_Nx51,
10026 ALC668_FIXUP_MIC_COEF,
10027 ALC668_FIXUP_ASUS_G751,
10028 ALC891_FIXUP_HEADSET_MODE,
10029 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10030 ALC662_FIXUP_ACER_VERITON,
10031 ALC892_FIXUP_ASROCK_MOBO,
10032 ALC662_FIXUP_USI_FUNC,
10033 ALC662_FIXUP_USI_HEADSET_MODE,
10034 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10035 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10036 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10037 ALC671_FIXUP_HP_HEADSET_MIC2,
10038 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10039 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10042 static const struct hda_fixup alc662_fixups[] = {
10043 [ALC662_FIXUP_ASPIRE] = {
10044 .type = HDA_FIXUP_PINS,
10045 .v.pins = (const struct hda_pintbl[]) {
10046 { 0x15, 0x99130112 }, /* subwoofer */
10050 [ALC662_FIXUP_LED_GPIO1] = {
10051 .type = HDA_FIXUP_FUNC,
10052 .v.func = alc662_fixup_led_gpio1,
10054 [ALC662_FIXUP_IDEAPAD] = {
10055 .type = HDA_FIXUP_PINS,
10056 .v.pins = (const struct hda_pintbl[]) {
10057 { 0x17, 0x99130112 }, /* subwoofer */
10061 .chain_id = ALC662_FIXUP_LED_GPIO1,
10063 [ALC272_FIXUP_MARIO] = {
10064 .type = HDA_FIXUP_FUNC,
10065 .v.func = alc272_fixup_mario,
10067 [ALC662_FIXUP_CZC_ET26] = {
10068 .type = HDA_FIXUP_PINS,
10069 .v.pins = (const struct hda_pintbl[]) {
10070 {0x12, 0x403cc000},
10071 {0x14, 0x90170110}, /* speaker */
10072 {0x15, 0x411111f0},
10073 {0x16, 0x411111f0},
10074 {0x18, 0x01a19030}, /* mic */
10075 {0x19, 0x90a7013f}, /* int-mic */
10076 {0x1a, 0x01014020},
10077 {0x1b, 0x0121401f},
10078 {0x1c, 0x411111f0},
10079 {0x1d, 0x411111f0},
10080 {0x1e, 0x40478e35},
10084 .chain_id = ALC662_FIXUP_SKU_IGNORE
10086 [ALC662_FIXUP_CZC_P10T] = {
10087 .type = HDA_FIXUP_VERBS,
10088 .v.verbs = (const struct hda_verb[]) {
10089 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10093 [ALC662_FIXUP_SKU_IGNORE] = {
10094 .type = HDA_FIXUP_FUNC,
10095 .v.func = alc_fixup_sku_ignore,
10097 [ALC662_FIXUP_HP_RP5800] = {
10098 .type = HDA_FIXUP_PINS,
10099 .v.pins = (const struct hda_pintbl[]) {
10100 { 0x14, 0x0221201f }, /* HP out */
10104 .chain_id = ALC662_FIXUP_SKU_IGNORE
10106 [ALC662_FIXUP_ASUS_MODE1] = {
10107 .type = HDA_FIXUP_PINS,
10108 .v.pins = (const struct hda_pintbl[]) {
10109 { 0x14, 0x99130110 }, /* speaker */
10110 { 0x18, 0x01a19c20 }, /* mic */
10111 { 0x19, 0x99a3092f }, /* int-mic */
10112 { 0x21, 0x0121401f }, /* HP out */
10116 .chain_id = ALC662_FIXUP_SKU_IGNORE
10118 [ALC662_FIXUP_ASUS_MODE2] = {
10119 .type = HDA_FIXUP_PINS,
10120 .v.pins = (const struct hda_pintbl[]) {
10121 { 0x14, 0x99130110 }, /* speaker */
10122 { 0x18, 0x01a19820 }, /* mic */
10123 { 0x19, 0x99a3092f }, /* int-mic */
10124 { 0x1b, 0x0121401f }, /* HP out */
10128 .chain_id = ALC662_FIXUP_SKU_IGNORE
10130 [ALC662_FIXUP_ASUS_MODE3] = {
10131 .type = HDA_FIXUP_PINS,
10132 .v.pins = (const struct hda_pintbl[]) {
10133 { 0x14, 0x99130110 }, /* speaker */
10134 { 0x15, 0x0121441f }, /* HP */
10135 { 0x18, 0x01a19840 }, /* mic */
10136 { 0x19, 0x99a3094f }, /* int-mic */
10137 { 0x21, 0x01211420 }, /* HP2 */
10141 .chain_id = ALC662_FIXUP_SKU_IGNORE
10143 [ALC662_FIXUP_ASUS_MODE4] = {
10144 .type = HDA_FIXUP_PINS,
10145 .v.pins = (const struct hda_pintbl[]) {
10146 { 0x14, 0x99130110 }, /* speaker */
10147 { 0x16, 0x99130111 }, /* speaker */
10148 { 0x18, 0x01a19840 }, /* mic */
10149 { 0x19, 0x99a3094f }, /* int-mic */
10150 { 0x21, 0x0121441f }, /* HP */
10154 .chain_id = ALC662_FIXUP_SKU_IGNORE
10156 [ALC662_FIXUP_ASUS_MODE5] = {
10157 .type = HDA_FIXUP_PINS,
10158 .v.pins = (const struct hda_pintbl[]) {
10159 { 0x14, 0x99130110 }, /* speaker */
10160 { 0x15, 0x0121441f }, /* HP */
10161 { 0x16, 0x99130111 }, /* speaker */
10162 { 0x18, 0x01a19840 }, /* mic */
10163 { 0x19, 0x99a3094f }, /* int-mic */
10167 .chain_id = ALC662_FIXUP_SKU_IGNORE
10169 [ALC662_FIXUP_ASUS_MODE6] = {
10170 .type = HDA_FIXUP_PINS,
10171 .v.pins = (const struct hda_pintbl[]) {
10172 { 0x14, 0x99130110 }, /* speaker */
10173 { 0x15, 0x01211420 }, /* HP2 */
10174 { 0x18, 0x01a19840 }, /* mic */
10175 { 0x19, 0x99a3094f }, /* int-mic */
10176 { 0x1b, 0x0121441f }, /* HP */
10180 .chain_id = ALC662_FIXUP_SKU_IGNORE
10182 [ALC662_FIXUP_ASUS_MODE7] = {
10183 .type = HDA_FIXUP_PINS,
10184 .v.pins = (const struct hda_pintbl[]) {
10185 { 0x14, 0x99130110 }, /* speaker */
10186 { 0x17, 0x99130111 }, /* speaker */
10187 { 0x18, 0x01a19840 }, /* mic */
10188 { 0x19, 0x99a3094f }, /* int-mic */
10189 { 0x1b, 0x01214020 }, /* HP */
10190 { 0x21, 0x0121401f }, /* HP */
10194 .chain_id = ALC662_FIXUP_SKU_IGNORE
10196 [ALC662_FIXUP_ASUS_MODE8] = {
10197 .type = HDA_FIXUP_PINS,
10198 .v.pins = (const struct hda_pintbl[]) {
10199 { 0x14, 0x99130110 }, /* speaker */
10200 { 0x12, 0x99a30970 }, /* int-mic */
10201 { 0x15, 0x01214020 }, /* HP */
10202 { 0x17, 0x99130111 }, /* speaker */
10203 { 0x18, 0x01a19840 }, /* mic */
10204 { 0x21, 0x0121401f }, /* HP */
10208 .chain_id = ALC662_FIXUP_SKU_IGNORE
10210 [ALC662_FIXUP_NO_JACK_DETECT] = {
10211 .type = HDA_FIXUP_FUNC,
10212 .v.func = alc_fixup_no_jack_detect,
10214 [ALC662_FIXUP_ZOTAC_Z68] = {
10215 .type = HDA_FIXUP_PINS,
10216 .v.pins = (const struct hda_pintbl[]) {
10217 { 0x1b, 0x02214020 }, /* Front HP */
10221 [ALC662_FIXUP_INV_DMIC] = {
10222 .type = HDA_FIXUP_FUNC,
10223 .v.func = alc_fixup_inv_dmic,
10225 [ALC668_FIXUP_DELL_XPS13] = {
10226 .type = HDA_FIXUP_FUNC,
10227 .v.func = alc_fixup_dell_xps13,
10229 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10231 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10232 .type = HDA_FIXUP_FUNC,
10233 .v.func = alc_fixup_disable_aamix,
10235 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10237 [ALC668_FIXUP_AUTO_MUTE] = {
10238 .type = HDA_FIXUP_FUNC,
10239 .v.func = alc_fixup_auto_mute_via_amp,
10241 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10243 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10244 .type = HDA_FIXUP_PINS,
10245 .v.pins = (const struct hda_pintbl[]) {
10246 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10247 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10251 .chain_id = ALC662_FIXUP_HEADSET_MODE
10253 [ALC662_FIXUP_HEADSET_MODE] = {
10254 .type = HDA_FIXUP_FUNC,
10255 .v.func = alc_fixup_headset_mode_alc662,
10257 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10258 .type = HDA_FIXUP_PINS,
10259 .v.pins = (const struct hda_pintbl[]) {
10260 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10261 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10265 .chain_id = ALC668_FIXUP_HEADSET_MODE
10267 [ALC668_FIXUP_HEADSET_MODE] = {
10268 .type = HDA_FIXUP_FUNC,
10269 .v.func = alc_fixup_headset_mode_alc668,
10271 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10272 .type = HDA_FIXUP_FUNC,
10273 .v.func = alc_fixup_bass_chmap,
10275 .chain_id = ALC662_FIXUP_ASUS_MODE4
10277 [ALC662_FIXUP_BASS_16] = {
10278 .type = HDA_FIXUP_PINS,
10279 .v.pins = (const struct hda_pintbl[]) {
10280 {0x16, 0x80106111}, /* bass speaker */
10284 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10286 [ALC662_FIXUP_BASS_1A] = {
10287 .type = HDA_FIXUP_PINS,
10288 .v.pins = (const struct hda_pintbl[]) {
10289 {0x1a, 0x80106111}, /* bass speaker */
10293 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10295 [ALC662_FIXUP_BASS_CHMAP] = {
10296 .type = HDA_FIXUP_FUNC,
10297 .v.func = alc_fixup_bass_chmap,
10299 [ALC662_FIXUP_ASUS_Nx50] = {
10300 .type = HDA_FIXUP_FUNC,
10301 .v.func = alc_fixup_auto_mute_via_amp,
10303 .chain_id = ALC662_FIXUP_BASS_1A
10305 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10306 .type = HDA_FIXUP_FUNC,
10307 .v.func = alc_fixup_headset_mode_alc668,
10308 .chain_id = ALC662_FIXUP_BASS_CHMAP
10310 [ALC668_FIXUP_ASUS_Nx51] = {
10311 .type = HDA_FIXUP_PINS,
10312 .v.pins = (const struct hda_pintbl[]) {
10313 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10314 { 0x1a, 0x90170151 }, /* bass speaker */
10315 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10319 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10321 [ALC668_FIXUP_MIC_COEF] = {
10322 .type = HDA_FIXUP_VERBS,
10323 .v.verbs = (const struct hda_verb[]) {
10324 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10325 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10329 [ALC668_FIXUP_ASUS_G751] = {
10330 .type = HDA_FIXUP_PINS,
10331 .v.pins = (const struct hda_pintbl[]) {
10332 { 0x16, 0x0421101f }, /* HP */
10336 .chain_id = ALC668_FIXUP_MIC_COEF
10338 [ALC891_FIXUP_HEADSET_MODE] = {
10339 .type = HDA_FIXUP_FUNC,
10340 .v.func = alc_fixup_headset_mode,
10342 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10343 .type = HDA_FIXUP_PINS,
10344 .v.pins = (const struct hda_pintbl[]) {
10345 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10346 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10350 .chain_id = ALC891_FIXUP_HEADSET_MODE
10352 [ALC662_FIXUP_ACER_VERITON] = {
10353 .type = HDA_FIXUP_PINS,
10354 .v.pins = (const struct hda_pintbl[]) {
10355 { 0x15, 0x50170120 }, /* no internal speaker */
10359 [ALC892_FIXUP_ASROCK_MOBO] = {
10360 .type = HDA_FIXUP_PINS,
10361 .v.pins = (const struct hda_pintbl[]) {
10362 { 0x15, 0x40f000f0 }, /* disabled */
10363 { 0x16, 0x40f000f0 }, /* disabled */
10367 [ALC662_FIXUP_USI_FUNC] = {
10368 .type = HDA_FIXUP_FUNC,
10369 .v.func = alc662_fixup_usi_headset_mic,
10371 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10372 .type = HDA_FIXUP_PINS,
10373 .v.pins = (const struct hda_pintbl[]) {
10374 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10375 { 0x18, 0x01a1903d },
10379 .chain_id = ALC662_FIXUP_USI_FUNC
10381 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10382 .type = HDA_FIXUP_FUNC,
10383 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10385 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10386 .type = HDA_FIXUP_FUNC,
10387 .v.func = alc662_fixup_aspire_ethos_hp,
10389 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10390 .type = HDA_FIXUP_PINS,
10391 .v.pins = (const struct hda_pintbl[]) {
10392 { 0x15, 0x92130110 }, /* front speakers */
10393 { 0x18, 0x99130111 }, /* center/subwoofer */
10394 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10398 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
10400 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10401 .type = HDA_FIXUP_FUNC,
10402 .v.func = alc671_fixup_hp_headset_mic2,
10404 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10405 .type = HDA_FIXUP_PINS,
10406 .v.pins = (const struct hda_pintbl[]) {
10407 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10411 .chain_id = ALC662_FIXUP_USI_FUNC
10413 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10414 .type = HDA_FIXUP_PINS,
10415 .v.pins = (const struct hda_pintbl[]) {
10416 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10417 { 0x1b, 0x0221144f },
10421 .chain_id = ALC662_FIXUP_USI_FUNC
10425 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
10426 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
10427 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
10428 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
10429 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
10430 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
10431 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
10432 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
10433 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
10434 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
10435 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
10436 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
10437 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10438 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10439 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
10440 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
10441 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
10442 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10443 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10444 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10445 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10446 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10447 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
10448 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
10449 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
10450 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
10451 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
10452 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
10453 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
10454 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10455 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
10456 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
10457 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
10458 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
10459 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
10460 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10461 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
10462 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
10463 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
10464 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
10465 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
10466 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
10467 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
10468 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
10469 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
10470 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
10471 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
10472 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
10475 /* Below is a quirk table taken from the old code.
10476 * Basically the device should work as is without the fixup table.
10477 * If BIOS doesn't give a proper info, enable the corresponding
10480 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
10481 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
10482 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
10483 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
10484 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10485 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10486 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10487 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
10488 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
10489 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10490 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
10491 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
10492 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
10493 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
10494 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
10495 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10496 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
10497 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
10498 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10499 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10500 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10501 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10502 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
10503 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
10504 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
10505 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10506 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
10507 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10508 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10509 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
10510 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10511 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10512 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
10513 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
10514 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
10515 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
10516 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
10517 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
10518 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
10519 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10520 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
10521 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
10522 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10523 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
10524 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
10525 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
10526 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
10527 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
10528 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10529 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
10534 static const struct hda_model_fixup alc662_fixup_models[] = {
10535 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
10536 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
10537 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
10538 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
10539 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
10540 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
10541 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
10542 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
10543 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
10544 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
10545 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
10546 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
10547 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
10548 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
10549 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
10550 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10551 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
10552 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
10553 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
10554 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
10555 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
10556 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
10557 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
10558 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
10559 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
10560 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
10561 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
10562 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
10563 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
10564 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
10565 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10566 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
10570 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
10571 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10572 {0x17, 0x02211010},
10573 {0x18, 0x01a19030},
10574 {0x1a, 0x01813040},
10575 {0x21, 0x01014020}),
10576 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10577 {0x16, 0x01813030},
10578 {0x17, 0x02211010},
10579 {0x18, 0x01a19040},
10580 {0x21, 0x01014020}),
10581 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10582 {0x14, 0x01014010},
10583 {0x18, 0x01a19020},
10584 {0x1a, 0x0181302f},
10585 {0x1b, 0x0221401f}),
10586 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10587 {0x12, 0x99a30130},
10588 {0x14, 0x90170110},
10589 {0x15, 0x0321101f},
10590 {0x16, 0x03011020}),
10591 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10592 {0x12, 0x99a30140},
10593 {0x14, 0x90170110},
10594 {0x15, 0x0321101f},
10595 {0x16, 0x03011020}),
10596 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10597 {0x12, 0x99a30150},
10598 {0x14, 0x90170110},
10599 {0x15, 0x0321101f},
10600 {0x16, 0x03011020}),
10601 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10602 {0x14, 0x90170110},
10603 {0x15, 0x0321101f},
10604 {0x16, 0x03011020}),
10605 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
10606 {0x12, 0x90a60130},
10607 {0x14, 0x90170110},
10608 {0x15, 0x0321101f}),
10609 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10610 {0x14, 0x01014010},
10611 {0x17, 0x90170150},
10612 {0x19, 0x02a11060},
10613 {0x1b, 0x01813030},
10614 {0x21, 0x02211020}),
10615 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10616 {0x14, 0x01014010},
10617 {0x18, 0x01a19040},
10618 {0x1b, 0x01813030},
10619 {0x21, 0x02211020}),
10620 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10621 {0x14, 0x01014020},
10622 {0x17, 0x90170110},
10623 {0x18, 0x01a19050},
10624 {0x1b, 0x01813040},
10625 {0x21, 0x02211030}),
10631 static int patch_alc662(struct hda_codec *codec)
10633 struct alc_spec *spec;
10636 err = alc_alloc_spec(codec, 0x0b);
10640 spec = codec->spec;
10642 spec->shutup = alc_eapd_shutup;
10644 /* handle multiple HPs as is */
10645 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
10647 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10649 switch (codec->core.vendor_id) {
10651 spec->init_hook = alc668_restore_default_value;
10655 alc_pre_init(codec);
10657 snd_hda_pick_fixup(codec, alc662_fixup_models,
10658 alc662_fixup_tbl, alc662_fixups);
10659 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
10660 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10662 alc_auto_parse_customize_define(codec);
10664 if (has_cdefine_beep(codec))
10665 spec->gen.beep_nid = 0x01;
10667 if ((alc_get_coef0(codec) & (1 << 14)) &&
10668 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
10669 spec->cdefine.platform_type == 1) {
10670 err = alc_codec_rename(codec, "ALC272X");
10675 /* automatic parse from the BIOS config */
10676 err = alc662_parse_auto_config(codec);
10680 if (!spec->gen.no_analog && spec->gen.beep_nid) {
10681 switch (codec->core.vendor_id) {
10683 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10689 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
10692 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
10699 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10712 static int alc680_parse_auto_config(struct hda_codec *codec)
10714 return alc_parse_auto_config(codec, NULL, NULL);
10719 static int patch_alc680(struct hda_codec *codec)
10723 /* ALC680 has no aa-loopback mixer */
10724 err = alc_alloc_spec(codec, 0);
10728 /* automatic parse from the BIOS config */
10729 err = alc680_parse_auto_config(codec);
10741 static const struct hda_device_id snd_hda_id_realtek[] = {
10742 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
10743 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
10744 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
10745 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
10746 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
10747 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
10748 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
10749 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
10750 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
10751 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
10752 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
10753 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
10754 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
10755 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
10756 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
10757 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
10758 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
10759 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
10760 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
10761 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
10762 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
10763 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
10764 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
10765 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
10766 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
10767 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
10768 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
10769 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
10770 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
10771 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
10772 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
10773 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
10774 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
10775 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
10776 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
10777 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
10778 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
10779 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
10780 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
10781 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
10782 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
10783 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
10784 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
10785 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
10786 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
10787 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
10788 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
10789 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
10790 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
10791 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
10792 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
10793 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
10794 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
10795 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
10796 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
10797 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
10798 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
10799 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
10800 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
10801 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
10802 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
10803 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
10804 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
10805 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
10806 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
10807 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
10808 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
10809 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
10810 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
10811 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
10812 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
10813 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
10814 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
10815 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
10816 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
10817 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
10818 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
10819 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
10820 {} /* terminator */
10822 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
10824 MODULE_LICENSE("GPL");
10825 MODULE_DESCRIPTION("Realtek HD-audio codec");
10827 static struct hda_codec_driver realtek_driver = {
10828 .id = snd_hda_id_realtek,
10831 module_hda_codec_driver(realtek_driver);