2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for Realtek ALC codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@just42.net>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <linux/dmi.h>
31 #include <linux/module.h>
32 #include <linux/input.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include "hda_codec.h"
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
39 #include "hda_generic.h"
41 /* keep halting ALC5505 DSP, for power saving */
42 #define HALT_REALTEK_ALC5505
44 /* extra amp-initialization sequence types */
52 ALC_HEADSET_MODE_UNKNOWN,
53 ALC_HEADSET_MODE_UNPLUGGED,
54 ALC_HEADSET_MODE_HEADSET,
56 ALC_HEADSET_MODE_HEADPHONE,
60 ALC_HEADSET_TYPE_UNKNOWN,
61 ALC_HEADSET_TYPE_CTIA,
62 ALC_HEADSET_TYPE_OMTP,
66 ALC_KEY_MICMUTE_INDEX,
69 struct alc_customize_define {
71 unsigned char port_connectivity;
72 unsigned char check_sum;
73 unsigned char customization;
74 unsigned char external_amp;
75 unsigned int enable_pcbeep:1;
76 unsigned int platform_type:1;
78 unsigned int override:1;
79 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
83 struct hda_gen_spec gen; /* must be at head */
85 /* codec parameterization */
86 struct alc_customize_define cdefine;
87 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
90 unsigned int gpio_mask;
91 unsigned int gpio_dir;
92 unsigned int gpio_data;
93 bool gpio_write_delay; /* add a delay before writing gpio_data */
95 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
96 int mute_led_polarity;
97 int micmute_led_polarity;
98 hda_nid_t mute_led_nid;
99 hda_nid_t cap_mute_led_nid;
101 unsigned int gpio_mute_led_mask;
102 unsigned int gpio_mic_led_mask;
104 hda_nid_t headset_mic_pin;
105 hda_nid_t headphone_mic_pin;
106 int current_headset_mode;
107 int current_headset_type;
110 void (*init_hook)(struct hda_codec *codec);
112 void (*power_hook)(struct hda_codec *codec);
114 void (*shutup)(struct hda_codec *codec);
115 void (*reboot_notify)(struct hda_codec *codec);
118 int codec_variant; /* flag for other variants */
119 unsigned int has_alc5505_dsp:1;
120 unsigned int no_depop_delay:1;
121 unsigned int done_hp_init:1;
122 unsigned int no_shutup_pins:1;
126 unsigned int pll_coef_idx, pll_coef_bit;
128 struct input_dev *kb_dev;
129 u8 alc_mute_keycode_map[1];
133 * COEF access helper functions
136 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
137 unsigned int coef_idx)
141 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
142 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
146 #define alc_read_coef_idx(codec, coef_idx) \
147 alc_read_coefex_idx(codec, 0x20, coef_idx)
149 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
150 unsigned int coef_idx, unsigned int coef_val)
152 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
153 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
156 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
157 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
159 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
160 unsigned int coef_idx, unsigned int mask,
161 unsigned int bits_set)
163 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
166 alc_write_coefex_idx(codec, nid, coef_idx,
167 (val & ~mask) | bits_set);
170 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
171 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
173 /* a special bypass for COEF 0; read the cached value at the second time */
174 static unsigned int alc_get_coef0(struct hda_codec *codec)
176 struct alc_spec *spec = codec->spec;
179 spec->coef0 = alc_read_coef_idx(codec, 0);
183 /* coef writes/updates batch */
191 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
192 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
193 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
194 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
195 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
197 static void alc_process_coef_fw(struct hda_codec *codec,
198 const struct coef_fw *fw)
200 for (; fw->nid; fw++) {
201 if (fw->mask == (unsigned short)-1)
202 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
204 alc_update_coefex_idx(codec, fw->nid, fw->idx,
210 * GPIO setup tables, used in initialization
213 /* Enable GPIO mask and set output */
214 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
216 struct alc_spec *spec = codec->spec;
218 spec->gpio_mask |= mask;
219 spec->gpio_dir |= mask;
220 spec->gpio_data |= mask;
223 static void alc_write_gpio_data(struct hda_codec *codec)
225 struct alc_spec *spec = codec->spec;
227 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
231 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
234 struct alc_spec *spec = codec->spec;
235 unsigned int oldval = spec->gpio_data;
238 spec->gpio_data |= mask;
240 spec->gpio_data &= ~mask;
241 if (oldval != spec->gpio_data)
242 alc_write_gpio_data(codec);
245 static void alc_write_gpio(struct hda_codec *codec)
247 struct alc_spec *spec = codec->spec;
249 if (!spec->gpio_mask)
252 snd_hda_codec_write(codec, codec->core.afg, 0,
253 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
254 snd_hda_codec_write(codec, codec->core.afg, 0,
255 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
256 if (spec->gpio_write_delay)
258 alc_write_gpio_data(codec);
261 static void alc_fixup_gpio(struct hda_codec *codec, int action,
264 if (action == HDA_FIXUP_ACT_PRE_PROBE)
265 alc_setup_gpio(codec, mask);
268 static void alc_fixup_gpio1(struct hda_codec *codec,
269 const struct hda_fixup *fix, int action)
271 alc_fixup_gpio(codec, action, 0x01);
274 static void alc_fixup_gpio2(struct hda_codec *codec,
275 const struct hda_fixup *fix, int action)
277 alc_fixup_gpio(codec, action, 0x02);
280 static void alc_fixup_gpio3(struct hda_codec *codec,
281 const struct hda_fixup *fix, int action)
283 alc_fixup_gpio(codec, action, 0x03);
286 static void alc_fixup_gpio4(struct hda_codec *codec,
287 const struct hda_fixup *fix, int action)
289 alc_fixup_gpio(codec, action, 0x04);
293 * Fix hardware PLL issue
294 * On some codecs, the analog PLL gating control must be off while
295 * the default value is 1.
297 static void alc_fix_pll(struct hda_codec *codec)
299 struct alc_spec *spec = codec->spec;
302 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
303 1 << spec->pll_coef_bit, 0);
306 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
307 unsigned int coef_idx, unsigned int coef_bit)
309 struct alc_spec *spec = codec->spec;
311 spec->pll_coef_idx = coef_idx;
312 spec->pll_coef_bit = coef_bit;
316 /* update the master volume per volume-knob's unsol event */
317 static void alc_update_knob_master(struct hda_codec *codec,
318 struct hda_jack_callback *jack)
321 struct snd_kcontrol *kctl;
322 struct snd_ctl_elem_value *uctl;
324 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
327 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
330 val = snd_hda_codec_read(codec, jack->nid, 0,
331 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
332 val &= HDA_AMP_VOLMASK;
333 uctl->value.integer.value[0] = val;
334 uctl->value.integer.value[1] = val;
335 kctl->put(kctl, uctl);
339 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
341 /* For some reason, the res given from ALC880 is broken.
342 Here we adjust it properly. */
343 snd_hda_jack_unsol_event(codec, res >> 2);
346 /* Change EAPD to verb control */
347 static void alc_fill_eapd_coef(struct hda_codec *codec)
351 coef = alc_get_coef0(codec);
353 switch (codec->core.vendor_id) {
355 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
359 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
362 if ((coef & 0x00f0) == 0x0010)
363 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
364 if ((coef & 0x00f0) == 0x0020)
365 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
366 if ((coef & 0x00f0) == 0x0030)
367 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
373 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
378 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
396 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
399 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
402 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
403 alc_write_coef_idx(codec, 0x8, 0x4ab7);
406 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
415 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
418 if ((coef & 0x00f0) == 0x0030)
419 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
428 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
432 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
435 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
438 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
441 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
442 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
446 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
453 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
458 /* additional initialization for ALC888 variants */
459 static void alc888_coef_init(struct hda_codec *codec)
461 switch (alc_get_coef0(codec) & 0x00f0) {
466 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
471 /* turn on/off EAPD control (only if available) */
472 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
474 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
476 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
477 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
481 /* turn on/off EAPD controls of the codec */
482 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
484 /* We currently only handle front, HP */
485 static hda_nid_t pins[] = {
486 0x0f, 0x10, 0x14, 0x15, 0x17, 0
489 for (p = pins; *p; p++)
490 set_eapd(codec, *p, on);
493 static int find_ext_mic_pin(struct hda_codec *codec);
495 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
497 const struct hda_pincfg *pin;
498 int mic_pin = find_ext_mic_pin(codec);
501 /* don't shut up pins when unloading the driver; otherwise it breaks
502 * the default pin setup at the next load of the driver
504 if (codec->bus->shutdown)
507 snd_array_for_each(&codec->init_pins, i, pin) {
508 /* use read here for syncing after issuing each verb */
509 if (pin->nid != mic_pin)
510 snd_hda_codec_read(codec, pin->nid, 0,
511 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
514 codec->pins_shutup = 1;
517 static void alc_shutup_pins(struct hda_codec *codec)
519 struct alc_spec *spec = codec->spec;
521 switch (codec->core.vendor_id) {
528 alc_headset_mic_no_shutup(codec);
531 if (!spec->no_shutup_pins)
532 snd_hda_shutup_pins(codec);
537 /* generic shutup callback;
538 * just turning off EAPD and a little pause for avoiding pop-noise
540 static void alc_eapd_shutup(struct hda_codec *codec)
542 struct alc_spec *spec = codec->spec;
544 alc_auto_setup_eapd(codec, false);
545 if (!spec->no_depop_delay)
547 alc_shutup_pins(codec);
550 /* generic EAPD initialization */
551 static void alc_auto_init_amp(struct hda_codec *codec, int type)
553 alc_fill_eapd_coef(codec);
554 alc_auto_setup_eapd(codec, true);
555 alc_write_gpio(codec);
557 case ALC_INIT_DEFAULT:
558 switch (codec->core.vendor_id) {
560 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
566 alc_update_coef_idx(codec, 7, 0, 0x2030);
569 alc888_coef_init(codec);
576 /* get a primary headphone pin if available */
577 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
579 if (spec->gen.autocfg.hp_pins[0])
580 return spec->gen.autocfg.hp_pins[0];
581 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
582 return spec->gen.autocfg.line_out_pins[0];
587 * Realtek SSID verification
590 /* Could be any non-zero and even value. When used as fixup, tells
591 * the driver to ignore any present sku defines.
593 #define ALC_FIXUP_SKU_IGNORE (2)
595 static void alc_fixup_sku_ignore(struct hda_codec *codec,
596 const struct hda_fixup *fix, int action)
598 struct alc_spec *spec = codec->spec;
599 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
600 spec->cdefine.fixup = 1;
601 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
605 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
606 const struct hda_fixup *fix, int action)
608 struct alc_spec *spec = codec->spec;
610 if (action == HDA_FIXUP_ACT_PROBE) {
611 spec->no_depop_delay = 1;
612 codec->depop_delay = 0;
616 static int alc_auto_parse_customize_define(struct hda_codec *codec)
618 unsigned int ass, tmp, i;
620 struct alc_spec *spec = codec->spec;
622 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
624 if (spec->cdefine.fixup) {
625 ass = spec->cdefine.sku_cfg;
626 if (ass == ALC_FIXUP_SKU_IGNORE)
631 if (!codec->bus->pci)
633 ass = codec->core.subsystem_id & 0xffff;
634 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
638 if (codec->core.vendor_id == 0x10ec0260)
640 ass = snd_hda_codec_get_pincfg(codec, nid);
643 codec_info(codec, "%s: SKU not ready 0x%08x\n",
644 codec->core.chip_name, ass);
650 for (i = 1; i < 16; i++) {
654 if (((ass >> 16) & 0xf) != tmp)
657 spec->cdefine.port_connectivity = ass >> 30;
658 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
659 spec->cdefine.check_sum = (ass >> 16) & 0xf;
660 spec->cdefine.customization = ass >> 8;
662 spec->cdefine.sku_cfg = ass;
663 spec->cdefine.external_amp = (ass & 0x38) >> 3;
664 spec->cdefine.platform_type = (ass & 0x4) >> 2;
665 spec->cdefine.swap = (ass & 0x2) >> 1;
666 spec->cdefine.override = ass & 0x1;
668 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
669 nid, spec->cdefine.sku_cfg);
670 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
671 spec->cdefine.port_connectivity);
672 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
673 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
674 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
675 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
676 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
677 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
678 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
683 /* return the position of NID in the list, or -1 if not found */
684 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
687 for (i = 0; i < nums; i++)
692 /* return true if the given NID is found in the list */
693 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
695 return find_idx_in_nid_list(nid, list, nums) >= 0;
698 /* check subsystem ID and set up device-specific initialization;
699 * return 1 if initialized, 0 if invalid SSID
701 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
702 * 31 ~ 16 : Manufacture ID
704 * 7 ~ 0 : Assembly ID
705 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
707 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
709 unsigned int ass, tmp, i;
711 struct alc_spec *spec = codec->spec;
713 if (spec->cdefine.fixup) {
714 ass = spec->cdefine.sku_cfg;
715 if (ass == ALC_FIXUP_SKU_IGNORE)
720 ass = codec->core.subsystem_id & 0xffff;
721 if (codec->bus->pci &&
722 ass != codec->bus->pci->subsystem_device && (ass & 1))
725 /* invalid SSID, check the special NID pin defcfg instead */
727 * 31~30 : port connectivity
730 * 19~16 : Check sum (15:1)
735 if (codec->core.vendor_id == 0x10ec0260)
737 ass = snd_hda_codec_get_pincfg(codec, nid);
739 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
743 if ((ass >> 30) != 1) /* no physical connection */
748 for (i = 1; i < 16; i++) {
752 if (((ass >> 16) & 0xf) != tmp)
755 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
756 ass & 0xffff, codec->core.vendor_id);
760 * 2 : 0 --> Desktop, 1 --> Laptop
761 * 3~5 : External Amplifier control
764 tmp = (ass & 0x38) >> 3; /* external Amp control */
765 if (spec->init_amp == ALC_INIT_UNDEFINED) {
768 alc_setup_gpio(codec, 0x01);
771 alc_setup_gpio(codec, 0x02);
774 alc_setup_gpio(codec, 0x03);
778 spec->init_amp = ALC_INIT_DEFAULT;
783 /* is laptop or Desktop and enable the function "Mute internal speaker
784 * when the external headphone out jack is plugged"
789 * 10~8 : Jack location
790 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
792 * 15 : 1 --> enable the function "Mute internal speaker
793 * when the external headphone out jack is plugged"
795 if (!alc_get_hp_pin(spec)) {
797 tmp = (ass >> 11) & 0x3; /* HP to chassis */
799 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
800 spec->gen.autocfg.line_outs))
802 spec->gen.autocfg.hp_pins[0] = nid;
807 /* Check the validity of ALC subsystem-id
808 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
809 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
811 if (!alc_subsystem_id(codec, ports)) {
812 struct alc_spec *spec = codec->spec;
813 if (spec->init_amp == ALC_INIT_UNDEFINED) {
815 "realtek: Enable default setup for auto mode as fallback\n");
816 spec->init_amp = ALC_INIT_DEFAULT;
824 static void alc_fixup_inv_dmic(struct hda_codec *codec,
825 const struct hda_fixup *fix, int action)
827 struct alc_spec *spec = codec->spec;
829 spec->gen.inv_dmic_split = 1;
833 static int alc_build_controls(struct hda_codec *codec)
837 err = snd_hda_gen_build_controls(codec);
841 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
850 static int alc_init(struct hda_codec *codec)
852 struct alc_spec *spec = codec->spec;
855 spec->init_hook(codec);
857 spec->gen.skip_verbs = 1; /* applied in below */
858 snd_hda_gen_init(codec);
860 alc_auto_init_amp(codec, spec->init_amp);
861 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
863 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
868 static inline void alc_shutup(struct hda_codec *codec)
870 struct alc_spec *spec = codec->spec;
872 if (!snd_hda_get_bool_hint(codec, "shutup"))
873 return; /* disabled explicitly by hints */
875 if (spec && spec->shutup)
878 alc_shutup_pins(codec);
881 static void alc_reboot_notify(struct hda_codec *codec)
883 struct alc_spec *spec = codec->spec;
885 if (spec && spec->reboot_notify)
886 spec->reboot_notify(codec);
891 #define alc_free snd_hda_gen_free
894 static void alc_power_eapd(struct hda_codec *codec)
896 alc_auto_setup_eapd(codec, false);
899 static int alc_suspend(struct hda_codec *codec)
901 struct alc_spec *spec = codec->spec;
903 if (spec && spec->power_hook)
904 spec->power_hook(codec);
910 static int alc_resume(struct hda_codec *codec)
912 struct alc_spec *spec = codec->spec;
914 if (!spec->no_depop_delay)
915 msleep(150); /* to avoid pop noise */
916 codec->patch_ops.init(codec);
917 regcache_sync(codec->core.regmap);
918 hda_call_check_power_status(codec, 0x01);
925 static const struct hda_codec_ops alc_patch_ops = {
926 .build_controls = alc_build_controls,
927 .build_pcms = snd_hda_gen_build_pcms,
930 .unsol_event = snd_hda_jack_unsol_event,
932 .resume = alc_resume,
933 .suspend = alc_suspend,
934 .check_power_status = snd_hda_gen_check_power_status,
936 .reboot_notify = alc_reboot_notify,
940 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
943 * Rename codecs appropriately from COEF value or subvendor id
945 struct alc_codec_rename_table {
946 unsigned int vendor_id;
947 unsigned short coef_mask;
948 unsigned short coef_bits;
952 struct alc_codec_rename_pci_table {
953 unsigned int codec_vendor_id;
954 unsigned short pci_subvendor;
955 unsigned short pci_subdevice;
959 static struct alc_codec_rename_table rename_tbl[] = {
960 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
961 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
962 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
963 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
964 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
965 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
966 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
967 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
968 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
969 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
970 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
971 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
972 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
973 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
974 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
975 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
976 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
980 static struct alc_codec_rename_pci_table rename_pci_tbl[] = {
981 { 0x10ec0280, 0x1028, 0, "ALC3220" },
982 { 0x10ec0282, 0x1028, 0, "ALC3221" },
983 { 0x10ec0283, 0x1028, 0, "ALC3223" },
984 { 0x10ec0288, 0x1028, 0, "ALC3263" },
985 { 0x10ec0292, 0x1028, 0, "ALC3226" },
986 { 0x10ec0293, 0x1028, 0, "ALC3235" },
987 { 0x10ec0255, 0x1028, 0, "ALC3234" },
988 { 0x10ec0668, 0x1028, 0, "ALC3661" },
989 { 0x10ec0275, 0x1028, 0, "ALC3260" },
990 { 0x10ec0899, 0x1028, 0, "ALC3861" },
991 { 0x10ec0298, 0x1028, 0, "ALC3266" },
992 { 0x10ec0236, 0x1028, 0, "ALC3204" },
993 { 0x10ec0256, 0x1028, 0, "ALC3246" },
994 { 0x10ec0225, 0x1028, 0, "ALC3253" },
995 { 0x10ec0295, 0x1028, 0, "ALC3254" },
996 { 0x10ec0299, 0x1028, 0, "ALC3271" },
997 { 0x10ec0670, 0x1025, 0, "ALC669X" },
998 { 0x10ec0676, 0x1025, 0, "ALC679X" },
999 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1000 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1001 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1002 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1003 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1004 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1005 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1006 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1007 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1008 { } /* terminator */
1011 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1013 const struct alc_codec_rename_table *p;
1014 const struct alc_codec_rename_pci_table *q;
1016 for (p = rename_tbl; p->vendor_id; p++) {
1017 if (p->vendor_id != codec->core.vendor_id)
1019 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1020 return alc_codec_rename(codec, p->name);
1023 if (!codec->bus->pci)
1025 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1026 if (q->codec_vendor_id != codec->core.vendor_id)
1028 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1030 if (!q->pci_subdevice ||
1031 q->pci_subdevice == codec->bus->pci->subsystem_device)
1032 return alc_codec_rename(codec, q->name);
1040 * Digital-beep handlers
1042 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1044 /* additional beep mixers; private_value will be overwritten */
1045 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1046 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1047 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1050 /* set up and create beep controls */
1051 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1054 struct snd_kcontrol_new *knew;
1055 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1058 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1059 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1060 &alc_beep_mixer[i]);
1063 knew->private_value = beep_amp;
1068 static const struct snd_pci_quirk beep_white_list[] = {
1069 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1070 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1071 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1072 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1073 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1074 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1075 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1076 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1077 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1078 /* blacklist -- no beep available */
1079 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1080 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1084 static inline int has_cdefine_beep(struct hda_codec *codec)
1086 struct alc_spec *spec = codec->spec;
1087 const struct snd_pci_quirk *q;
1088 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
1091 return spec->cdefine.enable_pcbeep;
1094 #define set_beep_amp(spec, nid, idx, dir) 0
1095 #define has_cdefine_beep(codec) 0
1098 /* parse the BIOS configuration and set up the alc_spec */
1099 /* return 1 if successful, 0 if the proper config is not found,
1100 * or a negative error code
1102 static int alc_parse_auto_config(struct hda_codec *codec,
1103 const hda_nid_t *ignore_nids,
1104 const hda_nid_t *ssid_nids)
1106 struct alc_spec *spec = codec->spec;
1107 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1110 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1116 alc_ssid_check(codec, ssid_nids);
1118 err = snd_hda_gen_parse_auto_config(codec, cfg);
1125 /* common preparation job for alc_spec */
1126 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1128 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1134 snd_hda_gen_spec_init(&spec->gen);
1135 spec->gen.mixer_nid = mixer_nid;
1136 spec->gen.own_eapd_ctl = 1;
1137 codec->single_adc_amp = 1;
1138 /* FIXME: do we need this for all Realtek codec models? */
1139 codec->spdif_status_reset = 1;
1140 codec->patch_ops = alc_patch_ops;
1142 err = alc_codec_rename_from_preset(codec);
1150 static int alc880_parse_auto_config(struct hda_codec *codec)
1152 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1153 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1154 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1163 ALC880_FIXUP_MEDION_RIM,
1165 ALC880_FIXUP_LG_LW25,
1167 ALC880_FIXUP_EAPD_COEF,
1168 ALC880_FIXUP_TCL_S700,
1169 ALC880_FIXUP_VOL_KNOB,
1170 ALC880_FIXUP_FUJITSU,
1172 ALC880_FIXUP_UNIWILL,
1173 ALC880_FIXUP_UNIWILL_DIG,
1175 ALC880_FIXUP_ASUS_W5A,
1176 ALC880_FIXUP_3ST_BASE,
1178 ALC880_FIXUP_3ST_DIG,
1179 ALC880_FIXUP_5ST_BASE,
1181 ALC880_FIXUP_5ST_DIG,
1182 ALC880_FIXUP_6ST_BASE,
1184 ALC880_FIXUP_6ST_DIG,
1185 ALC880_FIXUP_6ST_AUTOMUTE,
1188 /* enable the volume-knob widget support on NID 0x21 */
1189 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1190 const struct hda_fixup *fix, int action)
1192 if (action == HDA_FIXUP_ACT_PROBE)
1193 snd_hda_jack_detect_enable_callback(codec, 0x21,
1194 alc_update_knob_master);
1197 static const struct hda_fixup alc880_fixups[] = {
1198 [ALC880_FIXUP_GPIO1] = {
1199 .type = HDA_FIXUP_FUNC,
1200 .v.func = alc_fixup_gpio1,
1202 [ALC880_FIXUP_GPIO2] = {
1203 .type = HDA_FIXUP_FUNC,
1204 .v.func = alc_fixup_gpio2,
1206 [ALC880_FIXUP_MEDION_RIM] = {
1207 .type = HDA_FIXUP_VERBS,
1208 .v.verbs = (const struct hda_verb[]) {
1209 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1210 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1214 .chain_id = ALC880_FIXUP_GPIO2,
1216 [ALC880_FIXUP_LG] = {
1217 .type = HDA_FIXUP_PINS,
1218 .v.pins = (const struct hda_pintbl[]) {
1219 /* disable bogus unused pins */
1220 { 0x16, 0x411111f0 },
1221 { 0x18, 0x411111f0 },
1222 { 0x1a, 0x411111f0 },
1226 [ALC880_FIXUP_LG_LW25] = {
1227 .type = HDA_FIXUP_PINS,
1228 .v.pins = (const struct hda_pintbl[]) {
1229 { 0x1a, 0x0181344f }, /* line-in */
1230 { 0x1b, 0x0321403f }, /* headphone */
1234 [ALC880_FIXUP_W810] = {
1235 .type = HDA_FIXUP_PINS,
1236 .v.pins = (const struct hda_pintbl[]) {
1237 /* disable bogus unused pins */
1238 { 0x17, 0x411111f0 },
1242 .chain_id = ALC880_FIXUP_GPIO2,
1244 [ALC880_FIXUP_EAPD_COEF] = {
1245 .type = HDA_FIXUP_VERBS,
1246 .v.verbs = (const struct hda_verb[]) {
1247 /* change to EAPD mode */
1248 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1249 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1253 [ALC880_FIXUP_TCL_S700] = {
1254 .type = HDA_FIXUP_VERBS,
1255 .v.verbs = (const struct hda_verb[]) {
1256 /* change to EAPD mode */
1257 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1258 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1262 .chain_id = ALC880_FIXUP_GPIO2,
1264 [ALC880_FIXUP_VOL_KNOB] = {
1265 .type = HDA_FIXUP_FUNC,
1266 .v.func = alc880_fixup_vol_knob,
1268 [ALC880_FIXUP_FUJITSU] = {
1269 /* override all pins as BIOS on old Amilo is broken */
1270 .type = HDA_FIXUP_PINS,
1271 .v.pins = (const struct hda_pintbl[]) {
1272 { 0x14, 0x0121401f }, /* HP */
1273 { 0x15, 0x99030120 }, /* speaker */
1274 { 0x16, 0x99030130 }, /* bass speaker */
1275 { 0x17, 0x411111f0 }, /* N/A */
1276 { 0x18, 0x411111f0 }, /* N/A */
1277 { 0x19, 0x01a19950 }, /* mic-in */
1278 { 0x1a, 0x411111f0 }, /* N/A */
1279 { 0x1b, 0x411111f0 }, /* N/A */
1280 { 0x1c, 0x411111f0 }, /* N/A */
1281 { 0x1d, 0x411111f0 }, /* N/A */
1282 { 0x1e, 0x01454140 }, /* SPDIF out */
1286 .chain_id = ALC880_FIXUP_VOL_KNOB,
1288 [ALC880_FIXUP_F1734] = {
1289 /* almost compatible with FUJITSU, but no bass and SPDIF */
1290 .type = HDA_FIXUP_PINS,
1291 .v.pins = (const struct hda_pintbl[]) {
1292 { 0x14, 0x0121401f }, /* HP */
1293 { 0x15, 0x99030120 }, /* speaker */
1294 { 0x16, 0x411111f0 }, /* N/A */
1295 { 0x17, 0x411111f0 }, /* N/A */
1296 { 0x18, 0x411111f0 }, /* N/A */
1297 { 0x19, 0x01a19950 }, /* mic-in */
1298 { 0x1a, 0x411111f0 }, /* N/A */
1299 { 0x1b, 0x411111f0 }, /* N/A */
1300 { 0x1c, 0x411111f0 }, /* N/A */
1301 { 0x1d, 0x411111f0 }, /* N/A */
1302 { 0x1e, 0x411111f0 }, /* N/A */
1306 .chain_id = ALC880_FIXUP_VOL_KNOB,
1308 [ALC880_FIXUP_UNIWILL] = {
1309 /* need to fix HP and speaker pins to be parsed correctly */
1310 .type = HDA_FIXUP_PINS,
1311 .v.pins = (const struct hda_pintbl[]) {
1312 { 0x14, 0x0121411f }, /* HP */
1313 { 0x15, 0x99030120 }, /* speaker */
1314 { 0x16, 0x99030130 }, /* bass speaker */
1318 [ALC880_FIXUP_UNIWILL_DIG] = {
1319 .type = HDA_FIXUP_PINS,
1320 .v.pins = (const struct hda_pintbl[]) {
1321 /* disable bogus unused pins */
1322 { 0x17, 0x411111f0 },
1323 { 0x19, 0x411111f0 },
1324 { 0x1b, 0x411111f0 },
1325 { 0x1f, 0x411111f0 },
1329 [ALC880_FIXUP_Z71V] = {
1330 .type = HDA_FIXUP_PINS,
1331 .v.pins = (const struct hda_pintbl[]) {
1332 /* set up the whole pins as BIOS is utterly broken */
1333 { 0x14, 0x99030120 }, /* speaker */
1334 { 0x15, 0x0121411f }, /* HP */
1335 { 0x16, 0x411111f0 }, /* N/A */
1336 { 0x17, 0x411111f0 }, /* N/A */
1337 { 0x18, 0x01a19950 }, /* mic-in */
1338 { 0x19, 0x411111f0 }, /* N/A */
1339 { 0x1a, 0x01813031 }, /* line-in */
1340 { 0x1b, 0x411111f0 }, /* N/A */
1341 { 0x1c, 0x411111f0 }, /* N/A */
1342 { 0x1d, 0x411111f0 }, /* N/A */
1343 { 0x1e, 0x0144111e }, /* SPDIF */
1347 [ALC880_FIXUP_ASUS_W5A] = {
1348 .type = HDA_FIXUP_PINS,
1349 .v.pins = (const struct hda_pintbl[]) {
1350 /* set up the whole pins as BIOS is utterly broken */
1351 { 0x14, 0x0121411f }, /* HP */
1352 { 0x15, 0x411111f0 }, /* N/A */
1353 { 0x16, 0x411111f0 }, /* N/A */
1354 { 0x17, 0x411111f0 }, /* N/A */
1355 { 0x18, 0x90a60160 }, /* mic */
1356 { 0x19, 0x411111f0 }, /* N/A */
1357 { 0x1a, 0x411111f0 }, /* N/A */
1358 { 0x1b, 0x411111f0 }, /* N/A */
1359 { 0x1c, 0x411111f0 }, /* N/A */
1360 { 0x1d, 0x411111f0 }, /* N/A */
1361 { 0x1e, 0xb743111e }, /* SPDIF out */
1365 .chain_id = ALC880_FIXUP_GPIO1,
1367 [ALC880_FIXUP_3ST_BASE] = {
1368 .type = HDA_FIXUP_PINS,
1369 .v.pins = (const struct hda_pintbl[]) {
1370 { 0x14, 0x01014010 }, /* line-out */
1371 { 0x15, 0x411111f0 }, /* N/A */
1372 { 0x16, 0x411111f0 }, /* N/A */
1373 { 0x17, 0x411111f0 }, /* N/A */
1374 { 0x18, 0x01a19c30 }, /* mic-in */
1375 { 0x19, 0x0121411f }, /* HP */
1376 { 0x1a, 0x01813031 }, /* line-in */
1377 { 0x1b, 0x02a19c40 }, /* front-mic */
1378 { 0x1c, 0x411111f0 }, /* N/A */
1379 { 0x1d, 0x411111f0 }, /* N/A */
1380 /* 0x1e is filled in below */
1381 { 0x1f, 0x411111f0 }, /* N/A */
1385 [ALC880_FIXUP_3ST] = {
1386 .type = HDA_FIXUP_PINS,
1387 .v.pins = (const struct hda_pintbl[]) {
1388 { 0x1e, 0x411111f0 }, /* N/A */
1392 .chain_id = ALC880_FIXUP_3ST_BASE,
1394 [ALC880_FIXUP_3ST_DIG] = {
1395 .type = HDA_FIXUP_PINS,
1396 .v.pins = (const struct hda_pintbl[]) {
1397 { 0x1e, 0x0144111e }, /* SPDIF */
1401 .chain_id = ALC880_FIXUP_3ST_BASE,
1403 [ALC880_FIXUP_5ST_BASE] = {
1404 .type = HDA_FIXUP_PINS,
1405 .v.pins = (const struct hda_pintbl[]) {
1406 { 0x14, 0x01014010 }, /* front */
1407 { 0x15, 0x411111f0 }, /* N/A */
1408 { 0x16, 0x01011411 }, /* CLFE */
1409 { 0x17, 0x01016412 }, /* surr */
1410 { 0x18, 0x01a19c30 }, /* mic-in */
1411 { 0x19, 0x0121411f }, /* HP */
1412 { 0x1a, 0x01813031 }, /* line-in */
1413 { 0x1b, 0x02a19c40 }, /* front-mic */
1414 { 0x1c, 0x411111f0 }, /* N/A */
1415 { 0x1d, 0x411111f0 }, /* N/A */
1416 /* 0x1e is filled in below */
1417 { 0x1f, 0x411111f0 }, /* N/A */
1421 [ALC880_FIXUP_5ST] = {
1422 .type = HDA_FIXUP_PINS,
1423 .v.pins = (const struct hda_pintbl[]) {
1424 { 0x1e, 0x411111f0 }, /* N/A */
1428 .chain_id = ALC880_FIXUP_5ST_BASE,
1430 [ALC880_FIXUP_5ST_DIG] = {
1431 .type = HDA_FIXUP_PINS,
1432 .v.pins = (const struct hda_pintbl[]) {
1433 { 0x1e, 0x0144111e }, /* SPDIF */
1437 .chain_id = ALC880_FIXUP_5ST_BASE,
1439 [ALC880_FIXUP_6ST_BASE] = {
1440 .type = HDA_FIXUP_PINS,
1441 .v.pins = (const struct hda_pintbl[]) {
1442 { 0x14, 0x01014010 }, /* front */
1443 { 0x15, 0x01016412 }, /* surr */
1444 { 0x16, 0x01011411 }, /* CLFE */
1445 { 0x17, 0x01012414 }, /* side */
1446 { 0x18, 0x01a19c30 }, /* mic-in */
1447 { 0x19, 0x02a19c40 }, /* front-mic */
1448 { 0x1a, 0x01813031 }, /* line-in */
1449 { 0x1b, 0x0121411f }, /* HP */
1450 { 0x1c, 0x411111f0 }, /* N/A */
1451 { 0x1d, 0x411111f0 }, /* N/A */
1452 /* 0x1e is filled in below */
1453 { 0x1f, 0x411111f0 }, /* N/A */
1457 [ALC880_FIXUP_6ST] = {
1458 .type = HDA_FIXUP_PINS,
1459 .v.pins = (const struct hda_pintbl[]) {
1460 { 0x1e, 0x411111f0 }, /* N/A */
1464 .chain_id = ALC880_FIXUP_6ST_BASE,
1466 [ALC880_FIXUP_6ST_DIG] = {
1467 .type = HDA_FIXUP_PINS,
1468 .v.pins = (const struct hda_pintbl[]) {
1469 { 0x1e, 0x0144111e }, /* SPDIF */
1473 .chain_id = ALC880_FIXUP_6ST_BASE,
1475 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1476 .type = HDA_FIXUP_PINS,
1477 .v.pins = (const struct hda_pintbl[]) {
1478 { 0x1b, 0x0121401f }, /* HP with jack detect */
1481 .chained_before = true,
1482 .chain_id = ALC880_FIXUP_6ST_BASE,
1486 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1487 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1488 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1489 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1490 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1491 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1492 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1493 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1494 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1495 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1496 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1497 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1498 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1499 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1500 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1501 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1502 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1503 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1504 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1505 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1506 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1507 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1508 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1509 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1511 /* Below is the copied entries from alc880_quirks.c.
1512 * It's not quite sure whether BIOS sets the correct pin-config table
1513 * on these machines, thus they are kept to be compatible with
1514 * the old static quirks. Once when it's confirmed to work without
1515 * these overrides, it'd be better to remove.
1517 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1518 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1519 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1520 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1521 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1522 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1523 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1524 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1525 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1526 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1527 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1528 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1529 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1530 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1531 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1532 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1533 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1534 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1535 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1536 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1537 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1538 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1539 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1540 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1541 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1542 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1543 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1544 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1545 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1546 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1547 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1548 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1549 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1551 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1552 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1553 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1557 static const struct hda_model_fixup alc880_fixup_models[] = {
1558 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1559 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1560 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1561 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1562 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1563 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1564 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1570 * OK, here we have finally the patch for ALC880
1572 static int patch_alc880(struct hda_codec *codec)
1574 struct alc_spec *spec;
1577 err = alc_alloc_spec(codec, 0x0b);
1582 spec->gen.need_dac_fix = 1;
1583 spec->gen.beep_nid = 0x01;
1585 codec->patch_ops.unsol_event = alc880_unsol_event;
1587 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1589 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1591 /* automatic parse from the BIOS config */
1592 err = alc880_parse_auto_config(codec);
1596 if (!spec->gen.no_analog) {
1597 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1602 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1615 static int alc260_parse_auto_config(struct hda_codec *codec)
1617 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1618 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1619 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1626 ALC260_FIXUP_HP_DC5750,
1627 ALC260_FIXUP_HP_PIN_0F,
1630 ALC260_FIXUP_GPIO1_TOGGLE,
1631 ALC260_FIXUP_REPLACER,
1632 ALC260_FIXUP_HP_B1900,
1634 ALC260_FIXUP_FSC_S7020,
1635 ALC260_FIXUP_FSC_S7020_JWSE,
1636 ALC260_FIXUP_VAIO_PINS,
1639 static void alc260_gpio1_automute(struct hda_codec *codec)
1641 struct alc_spec *spec = codec->spec;
1643 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1646 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1647 const struct hda_fixup *fix, int action)
1649 struct alc_spec *spec = codec->spec;
1650 if (action == HDA_FIXUP_ACT_PROBE) {
1651 /* although the machine has only one output pin, we need to
1652 * toggle GPIO1 according to the jack state
1654 spec->gen.automute_hook = alc260_gpio1_automute;
1655 spec->gen.detect_hp = 1;
1656 spec->gen.automute_speaker = 1;
1657 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1658 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1659 snd_hda_gen_hp_automute);
1660 alc_setup_gpio(codec, 0x01);
1664 static void alc260_fixup_kn1(struct hda_codec *codec,
1665 const struct hda_fixup *fix, int action)
1667 struct alc_spec *spec = codec->spec;
1668 static const struct hda_pintbl pincfgs[] = {
1669 { 0x0f, 0x02214000 }, /* HP/speaker */
1670 { 0x12, 0x90a60160 }, /* int mic */
1671 { 0x13, 0x02a19000 }, /* ext mic */
1672 { 0x18, 0x01446000 }, /* SPDIF out */
1673 /* disable bogus I/O pins */
1674 { 0x10, 0x411111f0 },
1675 { 0x11, 0x411111f0 },
1676 { 0x14, 0x411111f0 },
1677 { 0x15, 0x411111f0 },
1678 { 0x16, 0x411111f0 },
1679 { 0x17, 0x411111f0 },
1680 { 0x19, 0x411111f0 },
1685 case HDA_FIXUP_ACT_PRE_PROBE:
1686 snd_hda_apply_pincfgs(codec, pincfgs);
1687 spec->init_amp = ALC_INIT_NONE;
1692 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1693 const struct hda_fixup *fix, int action)
1695 struct alc_spec *spec = codec->spec;
1696 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1697 spec->init_amp = ALC_INIT_NONE;
1700 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1701 const struct hda_fixup *fix, int action)
1703 struct alc_spec *spec = codec->spec;
1704 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1705 spec->gen.add_jack_modes = 1;
1706 spec->gen.hp_mic = 1;
1710 static const struct hda_fixup alc260_fixups[] = {
1711 [ALC260_FIXUP_HP_DC5750] = {
1712 .type = HDA_FIXUP_PINS,
1713 .v.pins = (const struct hda_pintbl[]) {
1714 { 0x11, 0x90130110 }, /* speaker */
1718 [ALC260_FIXUP_HP_PIN_0F] = {
1719 .type = HDA_FIXUP_PINS,
1720 .v.pins = (const struct hda_pintbl[]) {
1721 { 0x0f, 0x01214000 }, /* HP */
1725 [ALC260_FIXUP_COEF] = {
1726 .type = HDA_FIXUP_VERBS,
1727 .v.verbs = (const struct hda_verb[]) {
1728 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1729 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1733 [ALC260_FIXUP_GPIO1] = {
1734 .type = HDA_FIXUP_FUNC,
1735 .v.func = alc_fixup_gpio1,
1737 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1738 .type = HDA_FIXUP_FUNC,
1739 .v.func = alc260_fixup_gpio1_toggle,
1741 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1743 [ALC260_FIXUP_REPLACER] = {
1744 .type = HDA_FIXUP_VERBS,
1745 .v.verbs = (const struct hda_verb[]) {
1746 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1747 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1751 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1753 [ALC260_FIXUP_HP_B1900] = {
1754 .type = HDA_FIXUP_FUNC,
1755 .v.func = alc260_fixup_gpio1_toggle,
1757 .chain_id = ALC260_FIXUP_COEF,
1759 [ALC260_FIXUP_KN1] = {
1760 .type = HDA_FIXUP_FUNC,
1761 .v.func = alc260_fixup_kn1,
1763 [ALC260_FIXUP_FSC_S7020] = {
1764 .type = HDA_FIXUP_FUNC,
1765 .v.func = alc260_fixup_fsc_s7020,
1767 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1768 .type = HDA_FIXUP_FUNC,
1769 .v.func = alc260_fixup_fsc_s7020_jwse,
1771 .chain_id = ALC260_FIXUP_FSC_S7020,
1773 [ALC260_FIXUP_VAIO_PINS] = {
1774 .type = HDA_FIXUP_PINS,
1775 .v.pins = (const struct hda_pintbl[]) {
1776 /* Pin configs are missing completely on some VAIOs */
1777 { 0x0f, 0x01211020 },
1778 { 0x10, 0x0001003f },
1779 { 0x11, 0x411111f0 },
1780 { 0x12, 0x01a15930 },
1781 { 0x13, 0x411111f0 },
1782 { 0x14, 0x411111f0 },
1783 { 0x15, 0x411111f0 },
1784 { 0x16, 0x411111f0 },
1785 { 0x17, 0x411111f0 },
1786 { 0x18, 0x411111f0 },
1787 { 0x19, 0x411111f0 },
1793 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1794 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1795 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1796 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1797 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1798 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1799 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1800 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1801 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1802 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1803 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1804 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1805 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1809 static const struct hda_model_fixup alc260_fixup_models[] = {
1810 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1811 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1812 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1813 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1819 static int patch_alc260(struct hda_codec *codec)
1821 struct alc_spec *spec;
1824 err = alc_alloc_spec(codec, 0x07);
1829 /* as quite a few machines require HP amp for speaker outputs,
1830 * it's easier to enable it unconditionally; even if it's unneeded,
1831 * it's almost harmless.
1833 spec->gen.prefer_hp_amp = 1;
1834 spec->gen.beep_nid = 0x01;
1836 spec->shutup = alc_eapd_shutup;
1838 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1840 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1842 /* automatic parse from the BIOS config */
1843 err = alc260_parse_auto_config(codec);
1847 if (!spec->gen.no_analog) {
1848 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1853 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1864 * ALC882/883/885/888/889 support
1866 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1867 * configuration. Each pin widget can choose any input DACs and a mixer.
1868 * Each ADC is connected from a mixer of all inputs. This makes possible
1869 * 6-channel independent captures.
1871 * In addition, an independent DAC for the multi-playback (not used in this
1879 ALC882_FIXUP_ABIT_AW9D_MAX,
1880 ALC882_FIXUP_LENOVO_Y530,
1881 ALC882_FIXUP_PB_M5210,
1882 ALC882_FIXUP_ACER_ASPIRE_7736,
1883 ALC882_FIXUP_ASUS_W90V,
1885 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1886 ALC889_FIXUP_VAIO_TT,
1887 ALC888_FIXUP_EEE1601,
1891 ALC883_FIXUP_ACER_EAPD,
1896 ALC882_FIXUP_ASUS_W2JC,
1897 ALC882_FIXUP_ACER_ASPIRE_4930G,
1898 ALC882_FIXUP_ACER_ASPIRE_8930G,
1899 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1900 ALC885_FIXUP_MACPRO_GPIO,
1901 ALC889_FIXUP_DAC_ROUTE,
1902 ALC889_FIXUP_MBP_VREF,
1903 ALC889_FIXUP_IMAC91_VREF,
1904 ALC889_FIXUP_MBA11_VREF,
1905 ALC889_FIXUP_MBA21_VREF,
1906 ALC889_FIXUP_MP11_VREF,
1907 ALC889_FIXUP_MP41_VREF,
1908 ALC882_FIXUP_INV_DMIC,
1909 ALC882_FIXUP_NO_PRIMARY_HP,
1910 ALC887_FIXUP_ASUS_BASS,
1911 ALC887_FIXUP_BASS_CHMAP,
1912 ALC1220_FIXUP_GB_DUAL_CODECS,
1913 ALC1220_FIXUP_GB_X570,
1914 ALC1220_FIXUP_CLEVO_P950,
1915 ALC1220_FIXUP_CLEVO_PB51ED,
1916 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1917 ALC887_FIXUP_ASUS_AUDIO,
1918 ALC887_FIXUP_ASUS_HMIC,
1921 static void alc889_fixup_coef(struct hda_codec *codec,
1922 const struct hda_fixup *fix, int action)
1924 if (action != HDA_FIXUP_ACT_INIT)
1926 alc_update_coef_idx(codec, 7, 0, 0x2030);
1929 /* set up GPIO at initialization */
1930 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1931 const struct hda_fixup *fix, int action)
1933 struct alc_spec *spec = codec->spec;
1935 spec->gpio_write_delay = true;
1936 alc_fixup_gpio3(codec, fix, action);
1939 /* Fix the connection of some pins for ALC889:
1940 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1941 * work correctly (bko#42740)
1943 static void alc889_fixup_dac_route(struct hda_codec *codec,
1944 const struct hda_fixup *fix, int action)
1946 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1947 /* fake the connections during parsing the tree */
1948 hda_nid_t conn1[2] = { 0x0c, 0x0d };
1949 hda_nid_t conn2[2] = { 0x0e, 0x0f };
1950 snd_hda_override_conn_list(codec, 0x14, 2, conn1);
1951 snd_hda_override_conn_list(codec, 0x15, 2, conn1);
1952 snd_hda_override_conn_list(codec, 0x18, 2, conn2);
1953 snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
1954 } else if (action == HDA_FIXUP_ACT_PROBE) {
1955 /* restore the connections */
1956 hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1957 snd_hda_override_conn_list(codec, 0x14, 5, conn);
1958 snd_hda_override_conn_list(codec, 0x15, 5, conn);
1959 snd_hda_override_conn_list(codec, 0x18, 5, conn);
1960 snd_hda_override_conn_list(codec, 0x1a, 5, conn);
1964 /* Set VREF on HP pin */
1965 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1966 const struct hda_fixup *fix, int action)
1968 struct alc_spec *spec = codec->spec;
1969 static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 };
1972 if (action != HDA_FIXUP_ACT_INIT)
1974 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1975 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1976 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1978 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1979 val |= AC_PINCTL_VREF_80;
1980 snd_hda_set_pin_ctl(codec, nids[i], val);
1981 spec->gen.keep_vref_in_automute = 1;
1986 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1987 const hda_nid_t *nids, int num_nids)
1989 struct alc_spec *spec = codec->spec;
1992 for (i = 0; i < num_nids; i++) {
1994 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1995 val |= AC_PINCTL_VREF_50;
1996 snd_hda_set_pin_ctl(codec, nids[i], val);
1998 spec->gen.keep_vref_in_automute = 1;
2001 /* Set VREF on speaker pins on imac91 */
2002 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2003 const struct hda_fixup *fix, int action)
2005 static hda_nid_t nids[2] = { 0x18, 0x1a };
2007 if (action == HDA_FIXUP_ACT_INIT)
2008 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2011 /* Set VREF on speaker pins on mba11 */
2012 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2013 const struct hda_fixup *fix, int action)
2015 static hda_nid_t nids[1] = { 0x18 };
2017 if (action == HDA_FIXUP_ACT_INIT)
2018 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2021 /* Set VREF on speaker pins on mba21 */
2022 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2023 const struct hda_fixup *fix, int action)
2025 static hda_nid_t nids[2] = { 0x18, 0x19 };
2027 if (action == HDA_FIXUP_ACT_INIT)
2028 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2031 /* Don't take HP output as primary
2032 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2033 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2035 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2036 const struct hda_fixup *fix, int action)
2038 struct alc_spec *spec = codec->spec;
2039 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2040 spec->gen.no_primary_hp = 1;
2041 spec->gen.no_multi_io = 1;
2045 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2046 const struct hda_fixup *fix, int action);
2048 /* For dual-codec configuration, we need to disable some features to avoid
2049 * conflicts of kctls and PCM streams
2051 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2052 const struct hda_fixup *fix, int action)
2054 struct alc_spec *spec = codec->spec;
2056 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2058 /* disable vmaster */
2059 spec->gen.suppress_vmaster = 1;
2060 /* auto-mute and auto-mic switch don't work with multiple codecs */
2061 spec->gen.suppress_auto_mute = 1;
2062 spec->gen.suppress_auto_mic = 1;
2063 /* disable aamix as well */
2064 spec->gen.mixer_nid = 0;
2065 /* add location prefix to avoid conflicts */
2066 codec->force_pin_prefix = 1;
2069 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2070 const char *newname)
2072 struct snd_kcontrol *kctl;
2074 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2076 strcpy(kctl->id.name, newname);
2079 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2080 const struct hda_fixup *fix,
2083 alc_fixup_dual_codecs(codec, fix, action);
2085 case HDA_FIXUP_ACT_PRE_PROBE:
2086 /* override card longname to provide a unique UCM profile */
2087 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2089 case HDA_FIXUP_ACT_BUILD:
2090 /* rename Capture controls depending on the codec */
2091 rename_ctl(codec, "Capture Volume",
2093 "Rear-Panel Capture Volume" :
2094 "Front-Panel Capture Volume");
2095 rename_ctl(codec, "Capture Switch",
2097 "Rear-Panel Capture Switch" :
2098 "Front-Panel Capture Switch");
2103 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2104 const struct hda_fixup *fix,
2107 static const hda_nid_t conn1[] = { 0x0c };
2108 static const struct coef_fw gb_x570_coefs[] = {
2109 WRITE_COEF(0x07, 0x03c0),
2110 WRITE_COEF(0x1a, 0x01c1),
2111 WRITE_COEF(0x1b, 0x0202),
2112 WRITE_COEF(0x43, 0x3005),
2117 case HDA_FIXUP_ACT_PRE_PROBE:
2118 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2119 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2121 case HDA_FIXUP_ACT_INIT:
2122 alc_process_coef_fw(codec, gb_x570_coefs);
2127 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2128 const struct hda_fixup *fix,
2131 hda_nid_t conn1[1] = { 0x0c };
2133 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2136 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2137 /* We therefore want to make sure 0x14 (front headphone) and
2138 * 0x1b (speakers) use the stereo DAC 0x02
2140 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
2141 snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
2144 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2145 const struct hda_fixup *fix, int action);
2147 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2148 const struct hda_fixup *fix,
2151 alc1220_fixup_clevo_p950(codec, fix, action);
2152 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2155 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2156 struct hda_jack_callback *jack)
2158 struct alc_spec *spec = codec->spec;
2161 snd_hda_gen_hp_automute(codec, jack);
2163 if (spec->gen.hp_jack_present)
2164 vref = AC_PINCTL_VREF_80;
2166 vref = AC_PINCTL_VREF_HIZ;
2167 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2170 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2171 const struct hda_fixup *fix, int action)
2173 struct alc_spec *spec = codec->spec;
2174 if (action != HDA_FIXUP_ACT_PROBE)
2176 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2177 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2180 static const struct hda_fixup alc882_fixups[] = {
2181 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2182 .type = HDA_FIXUP_PINS,
2183 .v.pins = (const struct hda_pintbl[]) {
2184 { 0x15, 0x01080104 }, /* side */
2185 { 0x16, 0x01011012 }, /* rear */
2186 { 0x17, 0x01016011 }, /* clfe */
2190 [ALC882_FIXUP_LENOVO_Y530] = {
2191 .type = HDA_FIXUP_PINS,
2192 .v.pins = (const struct hda_pintbl[]) {
2193 { 0x15, 0x99130112 }, /* rear int speakers */
2194 { 0x16, 0x99130111 }, /* subwoofer */
2198 [ALC882_FIXUP_PB_M5210] = {
2199 .type = HDA_FIXUP_PINCTLS,
2200 .v.pins = (const struct hda_pintbl[]) {
2201 { 0x19, PIN_VREF50 },
2205 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2206 .type = HDA_FIXUP_FUNC,
2207 .v.func = alc_fixup_sku_ignore,
2209 [ALC882_FIXUP_ASUS_W90V] = {
2210 .type = HDA_FIXUP_PINS,
2211 .v.pins = (const struct hda_pintbl[]) {
2212 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2216 [ALC889_FIXUP_CD] = {
2217 .type = HDA_FIXUP_PINS,
2218 .v.pins = (const struct hda_pintbl[]) {
2219 { 0x1c, 0x993301f0 }, /* CD */
2223 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2224 .type = HDA_FIXUP_PINS,
2225 .v.pins = (const struct hda_pintbl[]) {
2226 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2230 .chain_id = ALC889_FIXUP_CD,
2232 [ALC889_FIXUP_VAIO_TT] = {
2233 .type = HDA_FIXUP_PINS,
2234 .v.pins = (const struct hda_pintbl[]) {
2235 { 0x17, 0x90170111 }, /* hidden surround speaker */
2239 [ALC888_FIXUP_EEE1601] = {
2240 .type = HDA_FIXUP_VERBS,
2241 .v.verbs = (const struct hda_verb[]) {
2242 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2243 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2247 [ALC886_FIXUP_EAPD] = {
2248 .type = HDA_FIXUP_VERBS,
2249 .v.verbs = (const struct hda_verb[]) {
2250 /* change to EAPD mode */
2251 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2252 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2256 [ALC882_FIXUP_EAPD] = {
2257 .type = HDA_FIXUP_VERBS,
2258 .v.verbs = (const struct hda_verb[]) {
2259 /* change to EAPD mode */
2260 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2261 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2265 [ALC883_FIXUP_EAPD] = {
2266 .type = HDA_FIXUP_VERBS,
2267 .v.verbs = (const struct hda_verb[]) {
2268 /* change to EAPD mode */
2269 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2270 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2274 [ALC883_FIXUP_ACER_EAPD] = {
2275 .type = HDA_FIXUP_VERBS,
2276 .v.verbs = (const struct hda_verb[]) {
2277 /* eanable EAPD on Acer laptops */
2278 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2279 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2283 [ALC882_FIXUP_GPIO1] = {
2284 .type = HDA_FIXUP_FUNC,
2285 .v.func = alc_fixup_gpio1,
2287 [ALC882_FIXUP_GPIO2] = {
2288 .type = HDA_FIXUP_FUNC,
2289 .v.func = alc_fixup_gpio2,
2291 [ALC882_FIXUP_GPIO3] = {
2292 .type = HDA_FIXUP_FUNC,
2293 .v.func = alc_fixup_gpio3,
2295 [ALC882_FIXUP_ASUS_W2JC] = {
2296 .type = HDA_FIXUP_FUNC,
2297 .v.func = alc_fixup_gpio1,
2299 .chain_id = ALC882_FIXUP_EAPD,
2301 [ALC889_FIXUP_COEF] = {
2302 .type = HDA_FIXUP_FUNC,
2303 .v.func = alc889_fixup_coef,
2305 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2306 .type = HDA_FIXUP_PINS,
2307 .v.pins = (const struct hda_pintbl[]) {
2308 { 0x16, 0x99130111 }, /* CLFE speaker */
2309 { 0x17, 0x99130112 }, /* surround speaker */
2313 .chain_id = ALC882_FIXUP_GPIO1,
2315 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2316 .type = HDA_FIXUP_PINS,
2317 .v.pins = (const struct hda_pintbl[]) {
2318 { 0x16, 0x99130111 }, /* CLFE speaker */
2319 { 0x1b, 0x99130112 }, /* surround speaker */
2323 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2325 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2326 /* additional init verbs for Acer Aspire 8930G */
2327 .type = HDA_FIXUP_VERBS,
2328 .v.verbs = (const struct hda_verb[]) {
2329 /* Enable all DACs */
2330 /* DAC DISABLE/MUTE 1? */
2331 /* setting bits 1-5 disables DAC nids 0x02-0x06
2332 * apparently. Init=0x38 */
2333 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2334 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2335 /* DAC DISABLE/MUTE 2? */
2336 /* some bit here disables the other DACs.
2338 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2339 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2341 * This laptop has a stereo digital microphone.
2342 * The mics are only 1cm apart which makes the stereo
2343 * useless. However, either the mic or the ALC889
2344 * makes the signal become a difference/sum signal
2345 * instead of standard stereo, which is annoying.
2346 * So instead we flip this bit which makes the
2347 * codec replicate the sum signal to both channels,
2348 * turning it into a normal mono mic.
2350 /* DMIC_CONTROL? Init value = 0x0001 */
2351 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2352 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2353 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2354 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2358 .chain_id = ALC882_FIXUP_GPIO1,
2360 [ALC885_FIXUP_MACPRO_GPIO] = {
2361 .type = HDA_FIXUP_FUNC,
2362 .v.func = alc885_fixup_macpro_gpio,
2364 [ALC889_FIXUP_DAC_ROUTE] = {
2365 .type = HDA_FIXUP_FUNC,
2366 .v.func = alc889_fixup_dac_route,
2368 [ALC889_FIXUP_MBP_VREF] = {
2369 .type = HDA_FIXUP_FUNC,
2370 .v.func = alc889_fixup_mbp_vref,
2372 .chain_id = ALC882_FIXUP_GPIO1,
2374 [ALC889_FIXUP_IMAC91_VREF] = {
2375 .type = HDA_FIXUP_FUNC,
2376 .v.func = alc889_fixup_imac91_vref,
2378 .chain_id = ALC882_FIXUP_GPIO1,
2380 [ALC889_FIXUP_MBA11_VREF] = {
2381 .type = HDA_FIXUP_FUNC,
2382 .v.func = alc889_fixup_mba11_vref,
2384 .chain_id = ALC889_FIXUP_MBP_VREF,
2386 [ALC889_FIXUP_MBA21_VREF] = {
2387 .type = HDA_FIXUP_FUNC,
2388 .v.func = alc889_fixup_mba21_vref,
2390 .chain_id = ALC889_FIXUP_MBP_VREF,
2392 [ALC889_FIXUP_MP11_VREF] = {
2393 .type = HDA_FIXUP_FUNC,
2394 .v.func = alc889_fixup_mba11_vref,
2396 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2398 [ALC889_FIXUP_MP41_VREF] = {
2399 .type = HDA_FIXUP_FUNC,
2400 .v.func = alc889_fixup_mbp_vref,
2402 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2404 [ALC882_FIXUP_INV_DMIC] = {
2405 .type = HDA_FIXUP_FUNC,
2406 .v.func = alc_fixup_inv_dmic,
2408 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2409 .type = HDA_FIXUP_FUNC,
2410 .v.func = alc882_fixup_no_primary_hp,
2412 [ALC887_FIXUP_ASUS_BASS] = {
2413 .type = HDA_FIXUP_PINS,
2414 .v.pins = (const struct hda_pintbl[]) {
2415 {0x16, 0x99130130}, /* bass speaker */
2419 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2421 [ALC887_FIXUP_BASS_CHMAP] = {
2422 .type = HDA_FIXUP_FUNC,
2423 .v.func = alc_fixup_bass_chmap,
2425 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2426 .type = HDA_FIXUP_FUNC,
2427 .v.func = alc1220_fixup_gb_dual_codecs,
2429 [ALC1220_FIXUP_GB_X570] = {
2430 .type = HDA_FIXUP_FUNC,
2431 .v.func = alc1220_fixup_gb_x570,
2433 [ALC1220_FIXUP_CLEVO_P950] = {
2434 .type = HDA_FIXUP_FUNC,
2435 .v.func = alc1220_fixup_clevo_p950,
2437 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2438 .type = HDA_FIXUP_FUNC,
2439 .v.func = alc1220_fixup_clevo_pb51ed,
2441 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2442 .type = HDA_FIXUP_PINS,
2443 .v.pins = (const struct hda_pintbl[]) {
2444 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2448 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2450 [ALC887_FIXUP_ASUS_AUDIO] = {
2451 .type = HDA_FIXUP_PINS,
2452 .v.pins = (const struct hda_pintbl[]) {
2453 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2454 { 0x19, 0x22219420 },
2458 [ALC887_FIXUP_ASUS_HMIC] = {
2459 .type = HDA_FIXUP_FUNC,
2460 .v.func = alc887_fixup_asus_jack,
2462 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2466 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2467 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2468 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2469 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2470 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2471 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2472 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2473 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2474 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2475 ALC882_FIXUP_ACER_ASPIRE_4930G),
2476 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2477 ALC882_FIXUP_ACER_ASPIRE_4930G),
2478 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2479 ALC882_FIXUP_ACER_ASPIRE_8930G),
2480 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2481 ALC882_FIXUP_ACER_ASPIRE_8930G),
2482 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2483 ALC882_FIXUP_ACER_ASPIRE_4930G),
2484 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2485 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2486 ALC882_FIXUP_ACER_ASPIRE_4930G),
2487 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2488 ALC882_FIXUP_ACER_ASPIRE_4930G),
2489 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2490 ALC882_FIXUP_ACER_ASPIRE_4930G),
2491 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2492 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2493 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2494 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2495 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2496 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2497 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2498 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2499 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2500 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2501 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2502 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2503 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2504 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2505 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2507 /* All Apple entries are in codec SSIDs */
2508 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2509 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2510 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2511 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2512 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2513 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2514 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2515 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2516 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2517 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2518 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2519 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2520 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2521 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2522 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2523 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2524 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2525 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2526 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2527 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2528 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2529 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2531 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2532 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2533 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2534 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2535 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2536 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2537 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2538 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2539 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2540 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2541 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2542 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2543 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2544 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2545 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2546 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2547 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2548 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2549 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2550 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2551 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2552 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2553 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2554 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2555 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2556 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2557 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2558 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2559 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2560 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2561 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2562 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2563 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2564 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2565 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2566 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2567 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2568 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2569 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2570 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2571 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2572 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2573 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2574 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2575 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2576 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2577 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2578 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2582 static const struct hda_model_fixup alc882_fixup_models[] = {
2583 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2584 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2585 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2586 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2587 {.id = ALC889_FIXUP_CD, .name = "cd"},
2588 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2589 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2590 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2591 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2592 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2593 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2594 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2595 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2596 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2597 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2598 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2599 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2600 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2601 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2602 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2603 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2604 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2605 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2606 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2607 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2608 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2609 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2610 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2611 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2612 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2613 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2614 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2619 * BIOS auto configuration
2621 /* almost identical with ALC880 parser... */
2622 static int alc882_parse_auto_config(struct hda_codec *codec)
2624 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2625 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2626 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2631 static int patch_alc882(struct hda_codec *codec)
2633 struct alc_spec *spec;
2636 err = alc_alloc_spec(codec, 0x0b);
2642 switch (codec->core.vendor_id) {
2650 /* ALC883 and variants */
2651 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2655 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2657 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2659 alc_auto_parse_customize_define(codec);
2661 if (has_cdefine_beep(codec))
2662 spec->gen.beep_nid = 0x01;
2664 /* automatic parse from the BIOS config */
2665 err = alc882_parse_auto_config(codec);
2669 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2670 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2675 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2688 static int alc262_parse_auto_config(struct hda_codec *codec)
2690 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2691 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2692 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2699 ALC262_FIXUP_FSC_H270,
2700 ALC262_FIXUP_FSC_S7110,
2701 ALC262_FIXUP_HP_Z200,
2703 ALC262_FIXUP_LENOVO_3000,
2705 ALC262_FIXUP_BENQ_T31,
2706 ALC262_FIXUP_INV_DMIC,
2707 ALC262_FIXUP_INTEL_BAYLEYBAY,
2710 static const struct hda_fixup alc262_fixups[] = {
2711 [ALC262_FIXUP_FSC_H270] = {
2712 .type = HDA_FIXUP_PINS,
2713 .v.pins = (const struct hda_pintbl[]) {
2714 { 0x14, 0x99130110 }, /* speaker */
2715 { 0x15, 0x0221142f }, /* front HP */
2716 { 0x1b, 0x0121141f }, /* rear HP */
2720 [ALC262_FIXUP_FSC_S7110] = {
2721 .type = HDA_FIXUP_PINS,
2722 .v.pins = (const struct hda_pintbl[]) {
2723 { 0x15, 0x90170110 }, /* speaker */
2727 .chain_id = ALC262_FIXUP_BENQ,
2729 [ALC262_FIXUP_HP_Z200] = {
2730 .type = HDA_FIXUP_PINS,
2731 .v.pins = (const struct hda_pintbl[]) {
2732 { 0x16, 0x99130120 }, /* internal speaker */
2736 [ALC262_FIXUP_TYAN] = {
2737 .type = HDA_FIXUP_PINS,
2738 .v.pins = (const struct hda_pintbl[]) {
2739 { 0x14, 0x1993e1f0 }, /* int AUX */
2743 [ALC262_FIXUP_LENOVO_3000] = {
2744 .type = HDA_FIXUP_PINCTLS,
2745 .v.pins = (const struct hda_pintbl[]) {
2746 { 0x19, PIN_VREF50 },
2750 .chain_id = ALC262_FIXUP_BENQ,
2752 [ALC262_FIXUP_BENQ] = {
2753 .type = HDA_FIXUP_VERBS,
2754 .v.verbs = (const struct hda_verb[]) {
2755 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2756 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2760 [ALC262_FIXUP_BENQ_T31] = {
2761 .type = HDA_FIXUP_VERBS,
2762 .v.verbs = (const struct hda_verb[]) {
2763 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2764 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2768 [ALC262_FIXUP_INV_DMIC] = {
2769 .type = HDA_FIXUP_FUNC,
2770 .v.func = alc_fixup_inv_dmic,
2772 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2773 .type = HDA_FIXUP_FUNC,
2774 .v.func = alc_fixup_no_depop_delay,
2778 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2779 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2780 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2781 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2782 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2783 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2784 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2785 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2786 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2787 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2788 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2792 static const struct hda_model_fixup alc262_fixup_models[] = {
2793 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2794 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2795 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2796 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2797 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2798 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2799 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2800 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2801 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2807 static int patch_alc262(struct hda_codec *codec)
2809 struct alc_spec *spec;
2812 err = alc_alloc_spec(codec, 0x0b);
2817 spec->gen.shared_mic_vref_pin = 0x18;
2819 spec->shutup = alc_eapd_shutup;
2822 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2825 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2827 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2829 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2831 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2833 alc_auto_parse_customize_define(codec);
2835 if (has_cdefine_beep(codec))
2836 spec->gen.beep_nid = 0x01;
2838 /* automatic parse from the BIOS config */
2839 err = alc262_parse_auto_config(codec);
2843 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2844 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2849 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2861 /* bind Beep switches of both NID 0x0f and 0x10 */
2862 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2863 struct snd_ctl_elem_value *ucontrol)
2865 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2869 mutex_lock(&codec->control_mutex);
2870 pval = kcontrol->private_value;
2871 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2872 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2874 kcontrol->private_value = (pval & ~0xff) | 0x10;
2875 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2877 kcontrol->private_value = pval;
2878 mutex_unlock(&codec->control_mutex);
2882 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2883 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2885 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2886 .name = "Beep Playback Switch",
2887 .subdevice = HDA_SUBDEV_AMP_FLAG,
2888 .info = snd_hda_mixer_amp_switch_info,
2889 .get = snd_hda_mixer_amp_switch_get,
2890 .put = alc268_beep_switch_put,
2891 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2895 /* set PCBEEP vol = 0, mute connections */
2896 static const struct hda_verb alc268_beep_init_verbs[] = {
2897 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2898 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2899 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2904 ALC268_FIXUP_INV_DMIC,
2905 ALC268_FIXUP_HP_EAPD,
2909 static const struct hda_fixup alc268_fixups[] = {
2910 [ALC268_FIXUP_INV_DMIC] = {
2911 .type = HDA_FIXUP_FUNC,
2912 .v.func = alc_fixup_inv_dmic,
2914 [ALC268_FIXUP_HP_EAPD] = {
2915 .type = HDA_FIXUP_VERBS,
2916 .v.verbs = (const struct hda_verb[]) {
2917 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2921 [ALC268_FIXUP_SPDIF] = {
2922 .type = HDA_FIXUP_PINS,
2923 .v.pins = (const struct hda_pintbl[]) {
2924 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2930 static const struct hda_model_fixup alc268_fixup_models[] = {
2931 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2932 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2933 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2937 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2938 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2939 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2940 /* below is codec SSID since multiple Toshiba laptops have the
2941 * same PCI SSID 1179:ff00
2943 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2948 * BIOS auto configuration
2950 static int alc268_parse_auto_config(struct hda_codec *codec)
2952 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2953 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2958 static int patch_alc268(struct hda_codec *codec)
2960 struct alc_spec *spec;
2963 /* ALC268 has no aa-loopback mixer */
2964 err = alc_alloc_spec(codec, 0);
2969 spec->gen.beep_nid = 0x01;
2971 spec->shutup = alc_eapd_shutup;
2973 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2974 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2976 /* automatic parse from the BIOS config */
2977 err = alc268_parse_auto_config(codec);
2981 if (err > 0 && !spec->gen.no_analog &&
2982 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2983 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2984 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2985 &alc268_beep_mixer[i])) {
2990 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2991 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2992 /* override the amp caps for beep generator */
2993 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
2994 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
2995 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
2996 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2997 (0 << AC_AMPCAP_MUTE_SHIFT));
3000 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3013 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3014 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3017 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3018 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3021 /* different alc269-variants */
3023 ALC269_TYPE_ALC269VA,
3024 ALC269_TYPE_ALC269VB,
3025 ALC269_TYPE_ALC269VC,
3026 ALC269_TYPE_ALC269VD,
3046 * BIOS auto configuration
3048 static int alc269_parse_auto_config(struct hda_codec *codec)
3050 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3051 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3052 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3053 struct alc_spec *spec = codec->spec;
3054 const hda_nid_t *ssids;
3056 switch (spec->codec_variant) {
3057 case ALC269_TYPE_ALC269VA:
3058 case ALC269_TYPE_ALC269VC:
3059 case ALC269_TYPE_ALC280:
3060 case ALC269_TYPE_ALC284:
3061 case ALC269_TYPE_ALC293:
3062 ssids = alc269va_ssids;
3064 case ALC269_TYPE_ALC269VB:
3065 case ALC269_TYPE_ALC269VD:
3066 case ALC269_TYPE_ALC282:
3067 case ALC269_TYPE_ALC283:
3068 case ALC269_TYPE_ALC286:
3069 case ALC269_TYPE_ALC298:
3070 case ALC269_TYPE_ALC255:
3071 case ALC269_TYPE_ALC256:
3072 case ALC269_TYPE_ALC257:
3073 case ALC269_TYPE_ALC215:
3074 case ALC269_TYPE_ALC225:
3075 case ALC269_TYPE_ALC294:
3076 case ALC269_TYPE_ALC300:
3077 case ALC269_TYPE_ALC623:
3078 case ALC269_TYPE_ALC700:
3079 ssids = alc269_ssids;
3082 ssids = alc269_ssids;
3086 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3089 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3091 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3094 static void alc269_shutup(struct hda_codec *codec)
3096 struct alc_spec *spec = codec->spec;
3098 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3099 alc269vb_toggle_power_output(codec, 0);
3100 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3101 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3104 alc_shutup_pins(codec);
3107 static struct coef_fw alc282_coefs[] = {
3108 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3109 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3110 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3111 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3112 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3113 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3114 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3115 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3116 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3117 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3118 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3119 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3120 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3121 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3122 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3123 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3124 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3125 WRITE_COEF(0x63, 0x2902), /* PLL */
3126 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3127 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3128 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3129 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3130 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3131 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3132 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3133 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3134 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3135 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3136 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3140 static void alc282_restore_default_value(struct hda_codec *codec)
3142 alc_process_coef_fw(codec, alc282_coefs);
3145 static void alc282_init(struct hda_codec *codec)
3147 struct alc_spec *spec = codec->spec;
3148 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3152 alc282_restore_default_value(codec);
3156 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3157 coef78 = alc_read_coef_idx(codec, 0x78);
3159 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3160 /* Headphone capless set to high power mode */
3161 alc_write_coef_idx(codec, 0x78, 0x9004);
3166 snd_hda_codec_write(codec, hp_pin, 0,
3167 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3172 snd_hda_codec_write(codec, hp_pin, 0,
3173 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3178 /* Headphone capless set to normal mode */
3179 alc_write_coef_idx(codec, 0x78, coef78);
3182 static void alc282_shutup(struct hda_codec *codec)
3184 struct alc_spec *spec = codec->spec;
3185 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3190 alc269_shutup(codec);
3194 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3195 coef78 = alc_read_coef_idx(codec, 0x78);
3196 alc_write_coef_idx(codec, 0x78, 0x9004);
3201 snd_hda_codec_write(codec, hp_pin, 0,
3202 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3207 if (!spec->no_shutup_pins)
3208 snd_hda_codec_write(codec, hp_pin, 0,
3209 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3214 alc_auto_setup_eapd(codec, false);
3215 alc_shutup_pins(codec);
3216 alc_write_coef_idx(codec, 0x78, coef78);
3219 static struct coef_fw alc283_coefs[] = {
3220 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3221 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3222 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3223 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3224 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3225 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3226 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3227 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3228 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3229 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3230 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3231 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3232 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3233 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3234 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3235 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3236 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3237 WRITE_COEF(0x2e, 0x2902), /* PLL */
3238 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3239 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3240 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3241 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3242 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3243 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3244 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3245 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3246 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3247 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3248 WRITE_COEF(0x49, 0x0), /* test mode */
3249 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3250 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3251 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3252 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3256 static void alc283_restore_default_value(struct hda_codec *codec)
3258 alc_process_coef_fw(codec, alc283_coefs);
3261 static void alc283_init(struct hda_codec *codec)
3263 struct alc_spec *spec = codec->spec;
3264 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3267 alc283_restore_default_value(codec);
3273 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3275 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3276 /* Headphone capless set to high power mode */
3277 alc_write_coef_idx(codec, 0x43, 0x9004);
3279 snd_hda_codec_write(codec, hp_pin, 0,
3280 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3285 snd_hda_codec_write(codec, hp_pin, 0,
3286 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3290 /* Index 0x46 Combo jack auto switch control 2 */
3291 /* 3k pull low control for Headset jack. */
3292 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3293 /* Headphone capless set to normal mode */
3294 alc_write_coef_idx(codec, 0x43, 0x9614);
3297 static void alc283_shutup(struct hda_codec *codec)
3299 struct alc_spec *spec = codec->spec;
3300 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3304 alc269_shutup(codec);
3308 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3310 alc_write_coef_idx(codec, 0x43, 0x9004);
3312 /*depop hp during suspend*/
3313 alc_write_coef_idx(codec, 0x06, 0x2100);
3315 snd_hda_codec_write(codec, hp_pin, 0,
3316 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3321 if (!spec->no_shutup_pins)
3322 snd_hda_codec_write(codec, hp_pin, 0,
3323 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3325 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3329 alc_auto_setup_eapd(codec, false);
3330 alc_shutup_pins(codec);
3331 alc_write_coef_idx(codec, 0x43, 0x9614);
3334 static void alc256_init(struct hda_codec *codec)
3336 struct alc_spec *spec = codec->spec;
3337 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3345 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3350 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3352 snd_hda_codec_write(codec, hp_pin, 0,
3353 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3358 snd_hda_codec_write(codec, hp_pin, 0,
3359 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3364 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3365 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3366 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3367 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3369 * Expose headphone mic (or possibly Line In on some machines) instead
3370 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3371 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3374 alc_write_coef_idx(codec, 0x36, 0x5757);
3377 static void alc256_shutup(struct hda_codec *codec)
3379 struct alc_spec *spec = codec->spec;
3380 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3384 alc269_shutup(codec);
3388 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3393 snd_hda_codec_write(codec, hp_pin, 0,
3394 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3399 /* 3k pull low control for Headset jack. */
3400 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3401 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3402 * when booting with headset plugged. So skip setting it for the codec alc257
3404 if (codec->core.vendor_id != 0x10ec0236 &&
3405 codec->core.vendor_id != 0x10ec0257)
3406 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3408 if (!spec->no_shutup_pins)
3409 snd_hda_codec_write(codec, hp_pin, 0,
3410 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3415 alc_auto_setup_eapd(codec, false);
3416 alc_shutup_pins(codec);
3419 static void alc225_init(struct hda_codec *codec)
3421 struct alc_spec *spec = codec->spec;
3422 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3423 bool hp1_pin_sense, hp2_pin_sense;
3430 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3431 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3433 if (hp1_pin_sense || hp2_pin_sense)
3436 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3439 snd_hda_codec_write(codec, hp_pin, 0,
3440 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3442 snd_hda_codec_write(codec, 0x16, 0,
3443 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3445 if (hp1_pin_sense || hp2_pin_sense)
3449 snd_hda_codec_write(codec, hp_pin, 0,
3450 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3452 snd_hda_codec_write(codec, 0x16, 0,
3453 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3455 if (hp1_pin_sense || hp2_pin_sense)
3458 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3459 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3462 static void alc225_shutup(struct hda_codec *codec)
3464 struct alc_spec *spec = codec->spec;
3465 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3466 bool hp1_pin_sense, hp2_pin_sense;
3469 alc269_shutup(codec);
3473 /* 3k pull low control for Headset jack. */
3474 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3476 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3477 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3479 if (hp1_pin_sense || hp2_pin_sense)
3483 snd_hda_codec_write(codec, hp_pin, 0,
3484 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3486 snd_hda_codec_write(codec, 0x16, 0,
3487 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3489 if (hp1_pin_sense || hp2_pin_sense)
3493 snd_hda_codec_write(codec, hp_pin, 0,
3494 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3496 snd_hda_codec_write(codec, 0x16, 0,
3497 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3499 if (hp1_pin_sense || hp2_pin_sense)
3502 alc_auto_setup_eapd(codec, false);
3503 alc_shutup_pins(codec);
3506 static void alc_default_init(struct hda_codec *codec)
3508 struct alc_spec *spec = codec->spec;
3509 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3517 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3522 snd_hda_codec_write(codec, hp_pin, 0,
3523 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3528 snd_hda_codec_write(codec, hp_pin, 0,
3529 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3535 static void alc_default_shutup(struct hda_codec *codec)
3537 struct alc_spec *spec = codec->spec;
3538 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3542 alc269_shutup(codec);
3546 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3551 snd_hda_codec_write(codec, hp_pin, 0,
3552 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3557 if (!spec->no_shutup_pins)
3558 snd_hda_codec_write(codec, hp_pin, 0,
3559 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3564 alc_auto_setup_eapd(codec, false);
3565 alc_shutup_pins(codec);
3568 static void alc294_hp_init(struct hda_codec *codec)
3570 struct alc_spec *spec = codec->spec;
3571 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3577 snd_hda_codec_write(codec, hp_pin, 0,
3578 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3582 if (!spec->no_shutup_pins)
3583 snd_hda_codec_write(codec, hp_pin, 0,
3584 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3586 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3587 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3589 /* Wait for depop procedure finish */
3590 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3591 for (i = 0; i < 20 && val & 0x0080; i++) {
3593 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3595 /* Set HP depop to auto mode */
3596 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3600 static void alc294_init(struct hda_codec *codec)
3602 struct alc_spec *spec = codec->spec;
3604 /* required only at boot or S4 resume time */
3605 if (!spec->done_hp_init ||
3606 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3607 alc294_hp_init(codec);
3608 spec->done_hp_init = true;
3610 alc_default_init(codec);
3613 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3616 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3617 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3618 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3621 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3625 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3626 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3628 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3633 static void alc5505_dsp_halt(struct hda_codec *codec)
3637 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3638 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3639 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3640 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3641 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3642 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3643 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3644 val = alc5505_coef_get(codec, 0x6220);
3645 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3648 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3650 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3651 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3652 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3653 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3654 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3655 alc5505_coef_set(codec, 0x880c, 0x00000004);
3658 static void alc5505_dsp_init(struct hda_codec *codec)
3662 alc5505_dsp_halt(codec);
3663 alc5505_dsp_back_from_halt(codec);
3664 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3665 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3666 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3667 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3668 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3669 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3670 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3671 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3672 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3673 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3674 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3675 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3676 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3678 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3680 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3682 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3684 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3685 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3686 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3687 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3688 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3689 alc5505_coef_set(codec, 0x880c, 0x00000003);
3690 alc5505_coef_set(codec, 0x880c, 0x00000010);
3692 #ifdef HALT_REALTEK_ALC5505
3693 alc5505_dsp_halt(codec);
3697 #ifdef HALT_REALTEK_ALC5505
3698 #define alc5505_dsp_suspend(codec) /* NOP */
3699 #define alc5505_dsp_resume(codec) /* NOP */
3701 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3702 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3706 static int alc269_suspend(struct hda_codec *codec)
3708 struct alc_spec *spec = codec->spec;
3710 if (spec->has_alc5505_dsp)
3711 alc5505_dsp_suspend(codec);
3712 return alc_suspend(codec);
3715 static int alc269_resume(struct hda_codec *codec)
3717 struct alc_spec *spec = codec->spec;
3719 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3720 alc269vb_toggle_power_output(codec, 0);
3721 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3722 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3726 codec->patch_ops.init(codec);
3728 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3729 alc269vb_toggle_power_output(codec, 1);
3730 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3731 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3735 regcache_sync(codec->core.regmap);
3736 hda_call_check_power_status(codec, 0x01);
3738 /* on some machine, the BIOS will clear the codec gpio data when enter
3739 * suspend, and won't restore the data after resume, so we restore it
3742 if (spec->gpio_data)
3743 alc_write_gpio_data(codec);
3745 if (spec->has_alc5505_dsp)
3746 alc5505_dsp_resume(codec);
3750 #endif /* CONFIG_PM */
3752 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3753 const struct hda_fixup *fix, int action)
3755 struct alc_spec *spec = codec->spec;
3757 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3758 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3761 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3762 const struct hda_fixup *fix,
3765 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3766 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3768 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3769 snd_hda_codec_set_pincfg(codec, 0x19,
3770 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3771 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3774 static void alc269_fixup_hweq(struct hda_codec *codec,
3775 const struct hda_fixup *fix, int action)
3777 if (action == HDA_FIXUP_ACT_INIT)
3778 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3781 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3782 const struct hda_fixup *fix, int action)
3784 struct alc_spec *spec = codec->spec;
3786 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3787 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3790 static void alc271_fixup_dmic(struct hda_codec *codec,
3791 const struct hda_fixup *fix, int action)
3793 static const struct hda_verb verbs[] = {
3794 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3795 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3800 if (strcmp(codec->core.chip_name, "ALC271X") &&
3801 strcmp(codec->core.chip_name, "ALC269VB"))
3803 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3804 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3805 snd_hda_sequence_write(codec, verbs);
3808 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3809 const struct hda_fixup *fix, int action)
3811 struct alc_spec *spec = codec->spec;
3813 if (action != HDA_FIXUP_ACT_PROBE)
3816 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3817 * fix the sample rate of analog I/O to 44.1kHz
3819 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3820 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3823 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3824 const struct hda_fixup *fix, int action)
3826 /* The digital-mic unit sends PDM (differential signal) instead of
3827 * the standard PCM, thus you can't record a valid mono stream as is.
3828 * Below is a workaround specific to ALC269 to control the dmic
3829 * signal source as mono.
3831 if (action == HDA_FIXUP_ACT_INIT)
3832 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3835 static void alc269_quanta_automute(struct hda_codec *codec)
3837 snd_hda_gen_update_outputs(codec);
3839 alc_write_coef_idx(codec, 0x0c, 0x680);
3840 alc_write_coef_idx(codec, 0x0c, 0x480);
3843 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3844 const struct hda_fixup *fix, int action)
3846 struct alc_spec *spec = codec->spec;
3847 if (action != HDA_FIXUP_ACT_PROBE)
3849 spec->gen.automute_hook = alc269_quanta_automute;
3852 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3853 struct hda_jack_callback *jack)
3855 struct alc_spec *spec = codec->spec;
3858 snd_hda_gen_hp_automute(codec, jack);
3860 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3862 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3865 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3869 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
3870 const struct hda_fixup *fix, int action)
3872 struct alc_spec *spec = codec->spec;
3873 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3874 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3875 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
3880 /* update mute-LED according to the speaker mute state via mic VREF pin */
3881 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
3883 struct hda_codec *codec = private_data;
3884 struct alc_spec *spec = codec->spec;
3885 unsigned int pinval;
3887 if (spec->mute_led_polarity)
3889 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3890 pinval &= ~AC_PINCTL_VREFEN;
3891 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3892 if (spec->mute_led_nid) {
3893 /* temporarily power up/down for setting VREF */
3894 snd_hda_power_up_pm(codec);
3895 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3896 snd_hda_power_down_pm(codec);
3900 /* Make sure the led works even in runtime suspend */
3901 static unsigned int led_power_filter(struct hda_codec *codec,
3903 unsigned int power_state)
3905 struct alc_spec *spec = codec->spec;
3907 if (power_state != AC_PWRST_D3 || nid == 0 ||
3908 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
3911 /* Set pin ctl again, it might have just been set to 0 */
3912 snd_hda_set_pin_ctl(codec, nid,
3913 snd_hda_codec_get_pin_target(codec, nid));
3915 return snd_hda_gen_path_power_filter(codec, nid, power_state);
3918 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
3919 const struct hda_fixup *fix, int action)
3921 struct alc_spec *spec = codec->spec;
3922 const struct dmi_device *dev = NULL;
3924 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3927 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
3929 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
3931 if (pin < 0x0a || pin >= 0x10)
3933 spec->mute_led_polarity = pol;
3934 spec->mute_led_nid = pin - 0x0a + 0x18;
3935 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3936 spec->gen.vmaster_mute_enum = 1;
3937 codec->power_filter = led_power_filter;
3939 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
3940 spec->mute_led_polarity);
3945 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
3946 const struct hda_fixup *fix,
3947 int action, hda_nid_t pin)
3949 struct alc_spec *spec = codec->spec;
3951 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3952 spec->mute_led_polarity = 0;
3953 spec->mute_led_nid = pin;
3954 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3955 spec->gen.vmaster_mute_enum = 1;
3956 codec->power_filter = led_power_filter;
3960 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
3961 const struct hda_fixup *fix, int action)
3963 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
3966 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
3967 const struct hda_fixup *fix, int action)
3969 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
3972 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
3973 const struct hda_fixup *fix, int action)
3975 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
3978 /* update LED status via GPIO */
3979 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
3980 int polarity, bool enabled)
3984 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
3987 /* turn on/off mute LED via GPIO per vmaster hook */
3988 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
3990 struct hda_codec *codec = private_data;
3991 struct alc_spec *spec = codec->spec;
3993 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
3994 spec->mute_led_polarity, enabled);
3997 /* turn on/off mic-mute LED via GPIO per capture hook */
3998 static void alc_gpio_micmute_update(struct hda_codec *codec)
4000 struct alc_spec *spec = codec->spec;
4002 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4003 spec->micmute_led_polarity,
4004 spec->gen.micmute_led.led_value);
4007 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4008 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4010 unsigned int mute_mask,
4011 unsigned int micmute_mask)
4013 struct alc_spec *spec = codec->spec;
4015 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4017 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4020 spec->gpio_mute_led_mask = mute_mask;
4021 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
4024 spec->gpio_mic_led_mask = micmute_mask;
4025 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
4029 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4030 const struct hda_fixup *fix, int action)
4032 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4035 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4036 const struct hda_fixup *fix, int action)
4038 struct alc_spec *spec = codec->spec;
4040 spec->micmute_led_polarity = 1;
4042 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4045 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4046 const struct hda_fixup *fix, int action)
4048 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4051 /* turn on/off mic-mute LED per capture hook */
4052 static void alc_cap_micmute_update(struct hda_codec *codec)
4054 struct alc_spec *spec = codec->spec;
4055 unsigned int pinval;
4057 if (!spec->cap_mute_led_nid)
4059 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
4060 pinval &= ~AC_PINCTL_VREFEN;
4061 if (spec->gen.micmute_led.led_value)
4062 pinval |= AC_PINCTL_VREF_80;
4064 pinval |= AC_PINCTL_VREF_HIZ;
4065 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
4068 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4069 const struct hda_fixup *fix, int action)
4071 struct alc_spec *spec = codec->spec;
4073 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4074 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4075 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4076 * enable headphone amp
4078 spec->gpio_mask |= 0x10;
4079 spec->gpio_dir |= 0x10;
4080 spec->cap_mute_led_nid = 0x18;
4081 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4082 codec->power_filter = led_power_filter;
4086 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4087 const struct hda_fixup *fix, int action)
4089 struct alc_spec *spec = codec->spec;
4091 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4092 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4093 spec->cap_mute_led_nid = 0x18;
4094 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4095 codec->power_filter = led_power_filter;
4099 #if IS_REACHABLE(CONFIG_INPUT)
4100 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4101 struct hda_jack_callback *event)
4103 struct alc_spec *spec = codec->spec;
4105 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4106 send both key on and key off event for every interrupt. */
4107 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4108 input_sync(spec->kb_dev);
4109 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4110 input_sync(spec->kb_dev);
4113 static int alc_register_micmute_input_device(struct hda_codec *codec)
4115 struct alc_spec *spec = codec->spec;
4118 spec->kb_dev = input_allocate_device();
4119 if (!spec->kb_dev) {
4120 codec_err(codec, "Out of memory (input_allocate_device)\n");
4124 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4126 spec->kb_dev->name = "Microphone Mute Button";
4127 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4128 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4129 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4130 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4131 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4132 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4134 if (input_register_device(spec->kb_dev)) {
4135 codec_err(codec, "input_register_device failed\n");
4136 input_free_device(spec->kb_dev);
4137 spec->kb_dev = NULL;
4144 /* GPIO1 = set according to SKU external amp
4145 * GPIO2 = mic mute hotkey
4147 * GPIO4 = mic mute LED
4149 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4150 const struct hda_fixup *fix, int action)
4152 struct alc_spec *spec = codec->spec;
4154 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4155 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4156 spec->init_amp = ALC_INIT_DEFAULT;
4157 if (alc_register_micmute_input_device(codec) != 0)
4160 spec->gpio_mask |= 0x06;
4161 spec->gpio_dir |= 0x02;
4162 spec->gpio_data |= 0x02;
4163 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4164 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4165 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4166 gpio2_mic_hotkey_event);
4174 case HDA_FIXUP_ACT_FREE:
4175 input_unregister_device(spec->kb_dev);
4176 spec->kb_dev = NULL;
4180 /* Line2 = mic mute hotkey
4181 * GPIO2 = mic mute LED
4183 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4184 const struct hda_fixup *fix, int action)
4186 struct alc_spec *spec = codec->spec;
4188 spec->micmute_led_polarity = 1;
4189 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4190 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4191 spec->init_amp = ALC_INIT_DEFAULT;
4192 if (alc_register_micmute_input_device(codec) != 0)
4195 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4196 gpio2_mic_hotkey_event);
4204 case HDA_FIXUP_ACT_FREE:
4205 input_unregister_device(spec->kb_dev);
4206 spec->kb_dev = NULL;
4210 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4211 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4214 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4215 const struct hda_fixup *fix, int action)
4217 struct alc_spec *spec = codec->spec;
4219 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4220 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4221 spec->cap_mute_led_nid = 0x18;
4222 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4226 static struct coef_fw alc225_pre_hsmode[] = {
4227 UPDATE_COEF(0x4a, 1<<8, 0),
4228 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4229 UPDATE_COEF(0x63, 3<<14, 3<<14),
4230 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4231 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4232 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4233 UPDATE_COEF(0x4a, 3<<10, 0),
4237 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4239 static struct coef_fw coef0255[] = {
4240 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4241 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4242 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4243 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4244 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4247 static struct coef_fw coef0256[] = {
4248 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4249 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4250 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4251 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4252 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4255 static struct coef_fw coef0233[] = {
4256 WRITE_COEF(0x1b, 0x0c0b),
4257 WRITE_COEF(0x45, 0xc429),
4258 UPDATE_COEF(0x35, 0x4000, 0),
4259 WRITE_COEF(0x06, 0x2104),
4260 WRITE_COEF(0x1a, 0x0001),
4261 WRITE_COEF(0x26, 0x0004),
4262 WRITE_COEF(0x32, 0x42a3),
4265 static struct coef_fw coef0288[] = {
4266 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4267 UPDATE_COEF(0x50, 0x2000, 0x2000),
4268 UPDATE_COEF(0x56, 0x0006, 0x0006),
4269 UPDATE_COEF(0x66, 0x0008, 0),
4270 UPDATE_COEF(0x67, 0x2000, 0),
4273 static struct coef_fw coef0298[] = {
4274 UPDATE_COEF(0x19, 0x1300, 0x0300),
4277 static struct coef_fw coef0292[] = {
4278 WRITE_COEF(0x76, 0x000e),
4279 WRITE_COEF(0x6c, 0x2400),
4280 WRITE_COEF(0x18, 0x7308),
4281 WRITE_COEF(0x6b, 0xc429),
4284 static struct coef_fw coef0293[] = {
4285 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4286 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4287 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4288 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4289 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4290 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4293 static struct coef_fw coef0668[] = {
4294 WRITE_COEF(0x15, 0x0d40),
4295 WRITE_COEF(0xb7, 0x802b),
4298 static struct coef_fw coef0225[] = {
4299 UPDATE_COEF(0x63, 3<<14, 0),
4302 static struct coef_fw coef0274[] = {
4303 UPDATE_COEF(0x4a, 0x0100, 0),
4304 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4305 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4306 UPDATE_COEF(0x4a, 0x0010, 0),
4307 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4308 WRITE_COEF(0x45, 0x5289),
4309 UPDATE_COEF(0x4a, 0x0c00, 0),
4313 switch (codec->core.vendor_id) {
4315 alc_process_coef_fw(codec, coef0255);
4319 alc_process_coef_fw(codec, coef0256);
4324 alc_process_coef_fw(codec, coef0274);
4328 alc_process_coef_fw(codec, coef0233);
4332 alc_process_coef_fw(codec, coef0288);
4335 alc_process_coef_fw(codec, coef0298);
4336 alc_process_coef_fw(codec, coef0288);
4339 alc_process_coef_fw(codec, coef0292);
4342 alc_process_coef_fw(codec, coef0293);
4345 alc_process_coef_fw(codec, coef0668);
4353 alc_process_coef_fw(codec, alc225_pre_hsmode);
4354 alc_process_coef_fw(codec, coef0225);
4357 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4360 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4364 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4367 static struct coef_fw coef0255[] = {
4368 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4369 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4372 static struct coef_fw coef0256[] = {
4373 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4374 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4375 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4378 static struct coef_fw coef0233[] = {
4379 UPDATE_COEF(0x35, 0, 1<<14),
4380 WRITE_COEF(0x06, 0x2100),
4381 WRITE_COEF(0x1a, 0x0021),
4382 WRITE_COEF(0x26, 0x008c),
4385 static struct coef_fw coef0288[] = {
4386 UPDATE_COEF(0x4f, 0x00c0, 0),
4387 UPDATE_COEF(0x50, 0x2000, 0),
4388 UPDATE_COEF(0x56, 0x0006, 0),
4389 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4390 UPDATE_COEF(0x66, 0x0008, 0x0008),
4391 UPDATE_COEF(0x67, 0x2000, 0x2000),
4394 static struct coef_fw coef0292[] = {
4395 WRITE_COEF(0x19, 0xa208),
4396 WRITE_COEF(0x2e, 0xacf0),
4399 static struct coef_fw coef0293[] = {
4400 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4401 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4402 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4405 static struct coef_fw coef0688[] = {
4406 WRITE_COEF(0xb7, 0x802b),
4407 WRITE_COEF(0xb5, 0x1040),
4408 UPDATE_COEF(0xc3, 0, 1<<12),
4411 static struct coef_fw coef0225[] = {
4412 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4413 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4414 UPDATE_COEF(0x63, 3<<14, 0),
4417 static struct coef_fw coef0274[] = {
4418 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4419 UPDATE_COEF(0x4a, 0x0010, 0),
4420 UPDATE_COEF(0x6b, 0xf000, 0),
4424 switch (codec->core.vendor_id) {
4426 alc_write_coef_idx(codec, 0x45, 0xc489);
4427 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4428 alc_process_coef_fw(codec, coef0255);
4429 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4433 alc_write_coef_idx(codec, 0x45, 0xc489);
4434 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4435 alc_process_coef_fw(codec, coef0256);
4436 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4441 alc_write_coef_idx(codec, 0x45, 0x4689);
4442 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4443 alc_process_coef_fw(codec, coef0274);
4444 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4448 alc_write_coef_idx(codec, 0x45, 0xc429);
4449 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4450 alc_process_coef_fw(codec, coef0233);
4451 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4456 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4457 alc_process_coef_fw(codec, coef0288);
4458 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4461 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4462 alc_process_coef_fw(codec, coef0292);
4465 /* Set to TRS mode */
4466 alc_write_coef_idx(codec, 0x45, 0xc429);
4467 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4468 alc_process_coef_fw(codec, coef0293);
4469 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4472 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4476 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4477 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4480 alc_write_coef_idx(codec, 0x11, 0x0001);
4481 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4482 alc_process_coef_fw(codec, coef0688);
4483 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4491 alc_process_coef_fw(codec, alc225_pre_hsmode);
4492 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4493 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4494 alc_process_coef_fw(codec, coef0225);
4495 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4498 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4501 static void alc_headset_mode_default(struct hda_codec *codec)
4503 static struct coef_fw coef0225[] = {
4504 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4505 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4506 UPDATE_COEF(0x49, 3<<8, 0<<8),
4507 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4508 UPDATE_COEF(0x63, 3<<14, 0),
4509 UPDATE_COEF(0x67, 0xf000, 0x3000),
4512 static struct coef_fw coef0255[] = {
4513 WRITE_COEF(0x45, 0xc089),
4514 WRITE_COEF(0x45, 0xc489),
4515 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4516 WRITE_COEF(0x49, 0x0049),
4519 static struct coef_fw coef0256[] = {
4520 WRITE_COEF(0x45, 0xc489),
4521 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4522 WRITE_COEF(0x49, 0x0049),
4523 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4524 WRITE_COEF(0x06, 0x6100),
4527 static struct coef_fw coef0233[] = {
4528 WRITE_COEF(0x06, 0x2100),
4529 WRITE_COEF(0x32, 0x4ea3),
4532 static struct coef_fw coef0288[] = {
4533 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4534 UPDATE_COEF(0x50, 0x2000, 0x2000),
4535 UPDATE_COEF(0x56, 0x0006, 0x0006),
4536 UPDATE_COEF(0x66, 0x0008, 0),
4537 UPDATE_COEF(0x67, 0x2000, 0),
4540 static struct coef_fw coef0292[] = {
4541 WRITE_COEF(0x76, 0x000e),
4542 WRITE_COEF(0x6c, 0x2400),
4543 WRITE_COEF(0x6b, 0xc429),
4544 WRITE_COEF(0x18, 0x7308),
4547 static struct coef_fw coef0293[] = {
4548 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4549 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4550 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4553 static struct coef_fw coef0688[] = {
4554 WRITE_COEF(0x11, 0x0041),
4555 WRITE_COEF(0x15, 0x0d40),
4556 WRITE_COEF(0xb7, 0x802b),
4559 static struct coef_fw coef0274[] = {
4560 WRITE_COEF(0x45, 0x4289),
4561 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4562 UPDATE_COEF(0x6b, 0x0f00, 0),
4563 UPDATE_COEF(0x49, 0x0300, 0x0300),
4567 switch (codec->core.vendor_id) {
4574 alc_process_coef_fw(codec, alc225_pre_hsmode);
4575 alc_process_coef_fw(codec, coef0225);
4578 alc_process_coef_fw(codec, coef0255);
4582 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4583 alc_write_coef_idx(codec, 0x45, 0xc089);
4585 alc_process_coef_fw(codec, coef0256);
4590 alc_process_coef_fw(codec, coef0274);
4594 alc_process_coef_fw(codec, coef0233);
4599 alc_process_coef_fw(codec, coef0288);
4602 alc_process_coef_fw(codec, coef0292);
4605 alc_process_coef_fw(codec, coef0293);
4608 alc_process_coef_fw(codec, coef0688);
4611 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4614 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4618 static void alc_headset_mode_ctia(struct hda_codec *codec)
4622 static struct coef_fw coef0255[] = {
4623 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4624 WRITE_COEF(0x1b, 0x0c2b),
4625 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4628 static struct coef_fw coef0256[] = {
4629 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4630 WRITE_COEF(0x1b, 0x0e6b),
4633 static struct coef_fw coef0233[] = {
4634 WRITE_COEF(0x45, 0xd429),
4635 WRITE_COEF(0x1b, 0x0c2b),
4636 WRITE_COEF(0x32, 0x4ea3),
4639 static struct coef_fw coef0288[] = {
4640 UPDATE_COEF(0x50, 0x2000, 0x2000),
4641 UPDATE_COEF(0x56, 0x0006, 0x0006),
4642 UPDATE_COEF(0x66, 0x0008, 0),
4643 UPDATE_COEF(0x67, 0x2000, 0),
4646 static struct coef_fw coef0292[] = {
4647 WRITE_COEF(0x6b, 0xd429),
4648 WRITE_COEF(0x76, 0x0008),
4649 WRITE_COEF(0x18, 0x7388),
4652 static struct coef_fw coef0293[] = {
4653 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4654 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4657 static struct coef_fw coef0688[] = {
4658 WRITE_COEF(0x11, 0x0001),
4659 WRITE_COEF(0x15, 0x0d60),
4660 WRITE_COEF(0xc3, 0x0000),
4663 static struct coef_fw coef0225_1[] = {
4664 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4665 UPDATE_COEF(0x63, 3<<14, 2<<14),
4668 static struct coef_fw coef0225_2[] = {
4669 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4670 UPDATE_COEF(0x63, 3<<14, 1<<14),
4674 switch (codec->core.vendor_id) {
4676 alc_process_coef_fw(codec, coef0255);
4680 alc_process_coef_fw(codec, coef0256);
4685 alc_write_coef_idx(codec, 0x45, 0xd689);
4689 alc_process_coef_fw(codec, coef0233);
4692 val = alc_read_coef_idx(codec, 0x50);
4693 if (val & (1 << 12)) {
4694 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4695 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4698 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4699 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4705 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4707 alc_process_coef_fw(codec, coef0288);
4710 alc_process_coef_fw(codec, coef0292);
4713 alc_process_coef_fw(codec, coef0293);
4716 alc_process_coef_fw(codec, coef0688);
4724 val = alc_read_coef_idx(codec, 0x45);
4726 alc_process_coef_fw(codec, coef0225_2);
4728 alc_process_coef_fw(codec, coef0225_1);
4731 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4734 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
4738 static void alc_headset_mode_omtp(struct hda_codec *codec)
4740 static struct coef_fw coef0255[] = {
4741 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4742 WRITE_COEF(0x1b, 0x0c2b),
4743 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4746 static struct coef_fw coef0256[] = {
4747 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4748 WRITE_COEF(0x1b, 0x0e6b),
4751 static struct coef_fw coef0233[] = {
4752 WRITE_COEF(0x45, 0xe429),
4753 WRITE_COEF(0x1b, 0x0c2b),
4754 WRITE_COEF(0x32, 0x4ea3),
4757 static struct coef_fw coef0288[] = {
4758 UPDATE_COEF(0x50, 0x2000, 0x2000),
4759 UPDATE_COEF(0x56, 0x0006, 0x0006),
4760 UPDATE_COEF(0x66, 0x0008, 0),
4761 UPDATE_COEF(0x67, 0x2000, 0),
4764 static struct coef_fw coef0292[] = {
4765 WRITE_COEF(0x6b, 0xe429),
4766 WRITE_COEF(0x76, 0x0008),
4767 WRITE_COEF(0x18, 0x7388),
4770 static struct coef_fw coef0293[] = {
4771 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4772 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4775 static struct coef_fw coef0688[] = {
4776 WRITE_COEF(0x11, 0x0001),
4777 WRITE_COEF(0x15, 0x0d50),
4778 WRITE_COEF(0xc3, 0x0000),
4781 static struct coef_fw coef0225[] = {
4782 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4783 UPDATE_COEF(0x63, 3<<14, 2<<14),
4787 switch (codec->core.vendor_id) {
4789 alc_process_coef_fw(codec, coef0255);
4793 alc_process_coef_fw(codec, coef0256);
4798 alc_write_coef_idx(codec, 0x45, 0xe689);
4802 alc_process_coef_fw(codec, coef0233);
4805 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4806 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4811 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4813 alc_process_coef_fw(codec, coef0288);
4816 alc_process_coef_fw(codec, coef0292);
4819 alc_process_coef_fw(codec, coef0293);
4822 alc_process_coef_fw(codec, coef0688);
4830 alc_process_coef_fw(codec, coef0225);
4833 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
4836 static void alc_determine_headset_type(struct hda_codec *codec)
4839 bool is_ctia = false;
4840 struct alc_spec *spec = codec->spec;
4841 static struct coef_fw coef0255[] = {
4842 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4843 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4847 static struct coef_fw coef0288[] = {
4848 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4851 static struct coef_fw coef0298[] = {
4852 UPDATE_COEF(0x50, 0x2000, 0x2000),
4853 UPDATE_COEF(0x56, 0x0006, 0x0006),
4854 UPDATE_COEF(0x66, 0x0008, 0),
4855 UPDATE_COEF(0x67, 0x2000, 0),
4856 UPDATE_COEF(0x19, 0x1300, 0x1300),
4859 static struct coef_fw coef0293[] = {
4860 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4861 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4864 static struct coef_fw coef0688[] = {
4865 WRITE_COEF(0x11, 0x0001),
4866 WRITE_COEF(0xb7, 0x802b),
4867 WRITE_COEF(0x15, 0x0d60),
4868 WRITE_COEF(0xc3, 0x0c00),
4871 static struct coef_fw coef0274[] = {
4872 UPDATE_COEF(0x4a, 0x0010, 0),
4873 UPDATE_COEF(0x4a, 0x8000, 0),
4874 WRITE_COEF(0x45, 0xd289),
4875 UPDATE_COEF(0x49, 0x0300, 0x0300),
4879 switch (codec->core.vendor_id) {
4881 alc_process_coef_fw(codec, coef0255);
4883 val = alc_read_coef_idx(codec, 0x46);
4884 is_ctia = (val & 0x0070) == 0x0070;
4888 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4889 alc_write_coef_idx(codec, 0x06, 0x6104);
4890 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
4892 snd_hda_codec_write(codec, 0x21, 0,
4893 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4895 snd_hda_codec_write(codec, 0x21, 0,
4896 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4898 alc_process_coef_fw(codec, coef0255);
4900 val = alc_read_coef_idx(codec, 0x46);
4901 is_ctia = (val & 0x0070) == 0x0070;
4903 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
4904 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4906 snd_hda_codec_write(codec, 0x21, 0,
4907 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
4909 snd_hda_codec_write(codec, 0x21, 0,
4910 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4915 alc_process_coef_fw(codec, coef0274);
4917 val = alc_read_coef_idx(codec, 0x46);
4918 is_ctia = (val & 0x00f0) == 0x00f0;
4922 alc_write_coef_idx(codec, 0x45, 0xd029);
4924 val = alc_read_coef_idx(codec, 0x46);
4925 is_ctia = (val & 0x0070) == 0x0070;
4928 snd_hda_codec_write(codec, 0x21, 0,
4929 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4931 snd_hda_codec_write(codec, 0x21, 0,
4932 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4935 val = alc_read_coef_idx(codec, 0x50);
4936 if (val & (1 << 12)) {
4937 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4938 alc_process_coef_fw(codec, coef0288);
4940 val = alc_read_coef_idx(codec, 0x50);
4941 is_ctia = (val & 0x0070) == 0x0070;
4943 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4944 alc_process_coef_fw(codec, coef0288);
4946 val = alc_read_coef_idx(codec, 0x50);
4947 is_ctia = (val & 0x0070) == 0x0070;
4949 alc_process_coef_fw(codec, coef0298);
4950 snd_hda_codec_write(codec, 0x21, 0,
4951 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
4953 snd_hda_codec_write(codec, 0x21, 0,
4954 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4958 alc_process_coef_fw(codec, coef0288);
4960 val = alc_read_coef_idx(codec, 0x50);
4961 is_ctia = (val & 0x0070) == 0x0070;
4964 alc_write_coef_idx(codec, 0x6b, 0xd429);
4966 val = alc_read_coef_idx(codec, 0x6c);
4967 is_ctia = (val & 0x001c) == 0x001c;
4970 alc_process_coef_fw(codec, coef0293);
4972 val = alc_read_coef_idx(codec, 0x46);
4973 is_ctia = (val & 0x0070) == 0x0070;
4976 alc_process_coef_fw(codec, coef0688);
4978 val = alc_read_coef_idx(codec, 0xbe);
4979 is_ctia = (val & 0x1c02) == 0x1c02;
4987 snd_hda_codec_write(codec, 0x21, 0,
4988 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4990 snd_hda_codec_write(codec, 0x21, 0,
4991 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4993 alc_process_coef_fw(codec, alc225_pre_hsmode);
4994 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
4995 val = alc_read_coef_idx(codec, 0x45);
4996 if (val & (1 << 9)) {
4997 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
4998 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5000 val = alc_read_coef_idx(codec, 0x46);
5001 is_ctia = (val & 0x00f0) == 0x00f0;
5003 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5004 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5006 val = alc_read_coef_idx(codec, 0x46);
5007 is_ctia = (val & 0x00f0) == 0x00f0;
5009 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5010 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5011 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5013 snd_hda_codec_write(codec, 0x21, 0,
5014 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5016 snd_hda_codec_write(codec, 0x21, 0,
5017 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5024 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5025 is_ctia ? "yes" : "no");
5026 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5029 static void alc_update_headset_mode(struct hda_codec *codec)
5031 struct alc_spec *spec = codec->spec;
5033 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5034 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5036 int new_headset_mode;
5038 if (!snd_hda_jack_detect(codec, hp_pin))
5039 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5040 else if (mux_pin == spec->headset_mic_pin)
5041 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5042 else if (mux_pin == spec->headphone_mic_pin)
5043 new_headset_mode = ALC_HEADSET_MODE_MIC;
5045 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5047 if (new_headset_mode == spec->current_headset_mode) {
5048 snd_hda_gen_update_outputs(codec);
5052 switch (new_headset_mode) {
5053 case ALC_HEADSET_MODE_UNPLUGGED:
5054 alc_headset_mode_unplugged(codec);
5055 spec->gen.hp_jack_present = false;
5057 case ALC_HEADSET_MODE_HEADSET:
5058 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5059 alc_determine_headset_type(codec);
5060 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5061 alc_headset_mode_ctia(codec);
5062 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5063 alc_headset_mode_omtp(codec);
5064 spec->gen.hp_jack_present = true;
5066 case ALC_HEADSET_MODE_MIC:
5067 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5068 spec->gen.hp_jack_present = false;
5070 case ALC_HEADSET_MODE_HEADPHONE:
5071 alc_headset_mode_default(codec);
5072 spec->gen.hp_jack_present = true;
5075 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5076 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5077 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5078 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5079 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5082 spec->current_headset_mode = new_headset_mode;
5084 snd_hda_gen_update_outputs(codec);
5087 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5088 struct snd_kcontrol *kcontrol,
5089 struct snd_ctl_elem_value *ucontrol)
5091 alc_update_headset_mode(codec);
5094 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5095 struct hda_jack_callback *jack)
5097 struct alc_spec *spec = codec->spec;
5098 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5099 snd_hda_gen_hp_automute(codec, jack);
5100 alc_update_headset_mode(codec);
5103 static void alc_probe_headset_mode(struct hda_codec *codec)
5106 struct alc_spec *spec = codec->spec;
5107 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5110 for (i = 0; i < cfg->num_inputs; i++) {
5111 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5112 spec->headset_mic_pin = cfg->inputs[i].pin;
5113 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5114 spec->headphone_mic_pin = cfg->inputs[i].pin;
5117 WARN_ON(spec->gen.cap_sync_hook);
5118 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5119 spec->gen.automute_hook = alc_update_headset_mode;
5120 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5123 static void alc_fixup_headset_mode(struct hda_codec *codec,
5124 const struct hda_fixup *fix, int action)
5126 struct alc_spec *spec = codec->spec;
5129 case HDA_FIXUP_ACT_PRE_PROBE:
5130 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5132 case HDA_FIXUP_ACT_PROBE:
5133 alc_probe_headset_mode(codec);
5135 case HDA_FIXUP_ACT_INIT:
5136 spec->current_headset_mode = 0;
5137 alc_update_headset_mode(codec);
5142 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5143 const struct hda_fixup *fix, int action)
5145 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5146 struct alc_spec *spec = codec->spec;
5147 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5150 alc_fixup_headset_mode(codec, fix, action);
5153 static void alc255_set_default_jack_type(struct hda_codec *codec)
5155 /* Set to iphone type */
5156 static struct coef_fw alc255fw[] = {
5157 WRITE_COEF(0x1b, 0x880b),
5158 WRITE_COEF(0x45, 0xd089),
5159 WRITE_COEF(0x1b, 0x080b),
5160 WRITE_COEF(0x46, 0x0004),
5161 WRITE_COEF(0x1b, 0x0c0b),
5164 static struct coef_fw alc256fw[] = {
5165 WRITE_COEF(0x1b, 0x884b),
5166 WRITE_COEF(0x45, 0xd089),
5167 WRITE_COEF(0x1b, 0x084b),
5168 WRITE_COEF(0x46, 0x0004),
5169 WRITE_COEF(0x1b, 0x0c4b),
5172 switch (codec->core.vendor_id) {
5174 alc_process_coef_fw(codec, alc255fw);
5178 alc_process_coef_fw(codec, alc256fw);
5184 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5185 const struct hda_fixup *fix, int action)
5187 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5188 alc255_set_default_jack_type(codec);
5190 alc_fixup_headset_mode(codec, fix, action);
5193 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5194 const struct hda_fixup *fix, int action)
5196 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5197 struct alc_spec *spec = codec->spec;
5198 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5199 alc255_set_default_jack_type(codec);
5202 alc_fixup_headset_mode(codec, fix, action);
5205 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5206 struct hda_jack_callback *jack)
5208 struct alc_spec *spec = codec->spec;
5210 alc_update_headset_jack_cb(codec, jack);
5211 /* Headset Mic enable or disable, only for Dell Dino */
5212 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5215 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5216 const struct hda_fixup *fix, int action)
5218 alc_fixup_headset_mode(codec, fix, action);
5219 if (action == HDA_FIXUP_ACT_PROBE) {
5220 struct alc_spec *spec = codec->spec;
5221 /* toggled via hp_automute_hook */
5222 spec->gpio_mask |= 0x40;
5223 spec->gpio_dir |= 0x40;
5224 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5228 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5229 const struct hda_fixup *fix, int action)
5231 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5232 struct alc_spec *spec = codec->spec;
5233 spec->gen.auto_mute_via_amp = 1;
5237 static void alc_fixup_no_shutup(struct hda_codec *codec,
5238 const struct hda_fixup *fix, int action)
5240 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5241 struct alc_spec *spec = codec->spec;
5242 spec->no_shutup_pins = 1;
5246 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5247 const struct hda_fixup *fix, int action)
5249 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5250 struct alc_spec *spec = codec->spec;
5251 /* Disable AA-loopback as it causes white noise */
5252 spec->gen.mixer_nid = 0;
5256 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5257 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5258 const struct hda_fixup *fix, int action)
5260 static const struct hda_pintbl pincfgs[] = {
5261 { 0x16, 0x21211010 }, /* dock headphone */
5262 { 0x19, 0x21a11010 }, /* dock mic */
5265 struct alc_spec *spec = codec->spec;
5267 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5268 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5269 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5270 codec->power_save_node = 0; /* avoid click noises */
5271 snd_hda_apply_pincfgs(codec, pincfgs);
5275 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5276 const struct hda_fixup *fix, int action)
5278 static const struct hda_pintbl pincfgs[] = {
5279 { 0x17, 0x21211010 }, /* dock headphone */
5280 { 0x19, 0x21a11010 }, /* dock mic */
5283 struct alc_spec *spec = codec->spec;
5285 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5286 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5287 snd_hda_apply_pincfgs(codec, pincfgs);
5288 } else if (action == HDA_FIXUP_ACT_INIT) {
5289 /* Enable DOCK device */
5290 snd_hda_codec_write(codec, 0x17, 0,
5291 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5292 /* Enable DOCK device */
5293 snd_hda_codec_write(codec, 0x19, 0,
5294 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5298 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5299 const struct hda_fixup *fix, int action)
5301 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5302 * the speaker output becomes too low by some reason on Thinkpads with
5305 static hda_nid_t preferred_pairs[] = {
5306 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5309 struct alc_spec *spec = codec->spec;
5311 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5312 spec->gen.preferred_dacs = preferred_pairs;
5315 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5317 struct alc_spec *spec = codec->spec;
5318 int hp_pin = alc_get_hp_pin(spec);
5320 /* Prevent pop noises when headphones are plugged in */
5321 snd_hda_codec_write(codec, hp_pin, 0,
5322 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5326 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5327 const struct hda_fixup *fix, int action)
5329 struct alc_spec *spec = codec->spec;
5330 struct hda_input_mux *imux = &spec->gen.input_mux;
5334 case HDA_FIXUP_ACT_PRE_PROBE:
5335 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5336 * it causes a click noise at start up
5338 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5339 spec->shutup = alc_shutup_dell_xps13;
5341 case HDA_FIXUP_ACT_PROBE:
5342 /* Make the internal mic the default input source. */
5343 for (i = 0; i < imux->num_items; i++) {
5344 if (spec->gen.imux_pins[i] == 0x12) {
5345 spec->gen.cur_mux[0] = i;
5353 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5354 const struct hda_fixup *fix, int action)
5356 struct alc_spec *spec = codec->spec;
5358 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5359 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5360 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5362 /* Disable boost for mic-in permanently. (This code is only called
5363 from quirks that guarantee that the headphone is at NID 0x1b.) */
5364 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5365 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5367 alc_fixup_headset_mode(codec, fix, action);
5370 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5371 const struct hda_fixup *fix, int action)
5373 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5374 alc_write_coef_idx(codec, 0xc4, 0x8000);
5375 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5376 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5378 alc_fixup_headset_mode(codec, fix, action);
5381 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5382 static int find_ext_mic_pin(struct hda_codec *codec)
5384 struct alc_spec *spec = codec->spec;
5385 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5387 unsigned int defcfg;
5390 for (i = 0; i < cfg->num_inputs; i++) {
5391 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5393 nid = cfg->inputs[i].pin;
5394 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5395 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5403 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5404 const struct hda_fixup *fix,
5407 struct alc_spec *spec = codec->spec;
5409 if (action == HDA_FIXUP_ACT_PROBE) {
5410 int mic_pin = find_ext_mic_pin(codec);
5411 int hp_pin = alc_get_hp_pin(spec);
5413 if (snd_BUG_ON(!mic_pin || !hp_pin))
5415 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5419 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5420 const struct hda_fixup *fix,
5423 struct alc_spec *spec = codec->spec;
5424 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5427 /* The mic boosts on level 2 and 3 are too noisy
5428 on the internal mic input.
5429 Therefore limit the boost to 0 or 1. */
5431 if (action != HDA_FIXUP_ACT_PROBE)
5434 for (i = 0; i < cfg->num_inputs; i++) {
5435 hda_nid_t nid = cfg->inputs[i].pin;
5436 unsigned int defcfg;
5437 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5439 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5440 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5443 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5444 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5445 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5446 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5447 (0 << AC_AMPCAP_MUTE_SHIFT));
5451 static void alc283_hp_automute_hook(struct hda_codec *codec,
5452 struct hda_jack_callback *jack)
5454 struct alc_spec *spec = codec->spec;
5458 snd_hda_gen_hp_automute(codec, jack);
5460 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5463 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5467 static void alc283_fixup_chromebook(struct hda_codec *codec,
5468 const struct hda_fixup *fix, int action)
5470 struct alc_spec *spec = codec->spec;
5473 case HDA_FIXUP_ACT_PRE_PROBE:
5474 snd_hda_override_wcaps(codec, 0x03, 0);
5475 /* Disable AA-loopback as it causes white noise */
5476 spec->gen.mixer_nid = 0;
5478 case HDA_FIXUP_ACT_INIT:
5479 /* MIC2-VREF control */
5480 /* Set to manual mode */
5481 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5482 /* Enable Line1 input control by verb */
5483 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5488 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5489 const struct hda_fixup *fix, int action)
5491 struct alc_spec *spec = codec->spec;
5494 case HDA_FIXUP_ACT_PRE_PROBE:
5495 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5497 case HDA_FIXUP_ACT_INIT:
5498 /* MIC2-VREF control */
5499 /* Set to manual mode */
5500 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5505 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5506 static void asus_tx300_automute(struct hda_codec *codec)
5508 struct alc_spec *spec = codec->spec;
5509 snd_hda_gen_update_outputs(codec);
5510 if (snd_hda_jack_detect(codec, 0x1b))
5511 spec->gen.mute_bits |= (1ULL << 0x14);
5514 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5515 const struct hda_fixup *fix, int action)
5517 struct alc_spec *spec = codec->spec;
5518 static const struct hda_pintbl dock_pins[] = {
5519 { 0x1b, 0x21114000 }, /* dock speaker pin */
5524 case HDA_FIXUP_ACT_PRE_PROBE:
5525 spec->init_amp = ALC_INIT_DEFAULT;
5526 /* TX300 needs to set up GPIO2 for the speaker amp */
5527 alc_setup_gpio(codec, 0x04);
5528 snd_hda_apply_pincfgs(codec, dock_pins);
5529 spec->gen.auto_mute_via_amp = 1;
5530 spec->gen.automute_hook = asus_tx300_automute;
5531 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5532 snd_hda_gen_hp_automute);
5534 case HDA_FIXUP_ACT_PROBE:
5535 spec->init_amp = ALC_INIT_DEFAULT;
5537 case HDA_FIXUP_ACT_BUILD:
5538 /* this is a bit tricky; give more sane names for the main
5539 * (tablet) speaker and the dock speaker, respectively
5541 rename_ctl(codec, "Speaker Playback Switch",
5542 "Dock Speaker Playback Switch");
5543 rename_ctl(codec, "Bass Speaker Playback Switch",
5544 "Speaker Playback Switch");
5549 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5550 const struct hda_fixup *fix, int action)
5552 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5553 /* DAC node 0x03 is giving mono output. We therefore want to
5554 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5555 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5556 hda_nid_t conn1[2] = { 0x0c };
5557 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
5558 snd_hda_override_conn_list(codec, 0x15, 1, conn1);
5562 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5563 const struct hda_fixup *fix, int action)
5565 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5566 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5567 we can't adjust the speaker's volume since this node does not has
5568 Amp-out capability. we change the speaker's route to:
5569 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5570 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5571 speaker's volume now. */
5573 hda_nid_t conn1[1] = { 0x0c };
5574 snd_hda_override_conn_list(codec, 0x17, 1, conn1);
5578 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5579 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5580 const struct hda_fixup *fix, int action)
5582 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5583 hda_nid_t conn[2] = { 0x02, 0x03 };
5584 snd_hda_override_conn_list(codec, 0x17, 2, conn);
5588 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5589 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
5590 const struct hda_fixup *fix, int action)
5592 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5593 hda_nid_t conn[1] = { 0x02 };
5594 snd_hda_override_conn_list(codec, 0x17, 1, conn);
5598 /* Hook to update amp GPIO4 for automute */
5599 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5600 struct hda_jack_callback *jack)
5602 struct alc_spec *spec = codec->spec;
5604 snd_hda_gen_hp_automute(codec, jack);
5605 /* mute_led_polarity is set to 0, so we pass inverted value here */
5606 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
5607 !spec->gen.hp_jack_present);
5610 /* Manage GPIOs for HP EliteBook Folio 9480m.
5612 * GPIO4 is the headphone amplifier power control
5613 * GPIO3 is the audio output mute indicator LED
5616 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5617 const struct hda_fixup *fix,
5620 struct alc_spec *spec = codec->spec;
5622 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5623 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5624 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5625 spec->gpio_mask |= 0x10;
5626 spec->gpio_dir |= 0x10;
5627 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5631 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5632 const struct hda_fixup *fix,
5635 struct alc_spec *spec = codec->spec;
5637 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5638 spec->gpio_mask |= 0x04;
5639 spec->gpio_dir |= 0x04;
5640 /* set data bit low */
5644 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5645 const struct hda_fixup *fix,
5648 alc_fixup_dual_codecs(codec, fix, action);
5650 case HDA_FIXUP_ACT_PRE_PROBE:
5651 /* override card longname to provide a unique UCM profile */
5652 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5654 case HDA_FIXUP_ACT_BUILD:
5655 /* rename Capture controls depending on the codec */
5656 rename_ctl(codec, "Capture Volume",
5658 "Rear-Panel Capture Volume" :
5659 "Front-Panel Capture Volume");
5660 rename_ctl(codec, "Capture Switch",
5662 "Rear-Panel Capture Switch" :
5663 "Front-Panel Capture Switch");
5668 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
5669 const struct hda_fixup *fix, int action)
5671 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5674 codec->power_save_node = 1;
5677 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5678 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
5679 const struct hda_fixup *fix, int action)
5681 struct alc_spec *spec = codec->spec;
5682 static hda_nid_t preferred_pairs[] = {
5683 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5687 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5690 spec->gen.preferred_dacs = preferred_pairs;
5691 spec->gen.auto_mute_via_amp = 1;
5692 codec->power_save_node = 0;
5695 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5696 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5697 const struct hda_fixup *fix, int action)
5699 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5702 snd_hda_override_wcaps(codec, 0x03, 0);
5705 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
5706 const struct hda_fixup *fix, int action)
5708 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5709 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5712 /* for hda_fixup_thinkpad_acpi() */
5713 #include "thinkpad_helper.c"
5715 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5716 const struct hda_fixup *fix, int action)
5718 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5719 hda_fixup_thinkpad_acpi(codec, fix, action);
5722 /* for dell wmi mic mute led */
5723 #include "dell_wmi_helper.c"
5725 /* for alc295_fixup_hp_top_speakers */
5726 #include "hp_x360_helper.c"
5730 ALC269_FIXUP_SONY_VAIO,
5731 ALC275_FIXUP_SONY_VAIO_GPIO2,
5732 ALC269_FIXUP_DELL_M101Z,
5733 ALC269_FIXUP_SKU_IGNORE,
5734 ALC269_FIXUP_ASUS_G73JW,
5735 ALC269_FIXUP_LENOVO_EAPD,
5736 ALC275_FIXUP_SONY_HWEQ,
5737 ALC275_FIXUP_SONY_DISABLE_AAMIX,
5739 ALC269_FIXUP_PCM_44K,
5740 ALC269_FIXUP_STEREO_DMIC,
5741 ALC269_FIXUP_HEADSET_MIC,
5742 ALC269_FIXUP_QUANTA_MUTE,
5743 ALC269_FIXUP_LIFEBOOK,
5744 ALC269_FIXUP_LIFEBOOK_EXTMIC,
5745 ALC269_FIXUP_LIFEBOOK_HP_PIN,
5746 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5747 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
5750 ALC269VB_FIXUP_AMIC,
5751 ALC269VB_FIXUP_DMIC,
5752 ALC269_FIXUP_HP_MUTE_LED,
5753 ALC269_FIXUP_HP_MUTE_LED_MIC1,
5754 ALC269_FIXUP_HP_MUTE_LED_MIC2,
5755 ALC269_FIXUP_HP_MUTE_LED_MIC3,
5756 ALC269_FIXUP_HP_GPIO_LED,
5757 ALC269_FIXUP_HP_GPIO_MIC1_LED,
5758 ALC269_FIXUP_HP_LINE1_MIC1_LED,
5759 ALC269_FIXUP_INV_DMIC,
5760 ALC269_FIXUP_LENOVO_DOCK,
5761 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
5762 ALC269_FIXUP_NO_SHUTUP,
5763 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
5764 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
5765 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5766 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
5767 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5768 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
5769 ALC269_FIXUP_HEADSET_MODE,
5770 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
5771 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
5772 ALC269_FIXUP_ASUS_X101_FUNC,
5773 ALC269_FIXUP_ASUS_X101_VERB,
5774 ALC269_FIXUP_ASUS_X101,
5775 ALC271_FIXUP_AMIC_MIC2,
5776 ALC271_FIXUP_HP_GATE_MIC_JACK,
5777 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
5778 ALC269_FIXUP_ACER_AC700,
5779 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
5780 ALC269VB_FIXUP_ASUS_ZENBOOK,
5781 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
5782 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
5783 ALC269VB_FIXUP_ORDISSIMO_EVE2,
5784 ALC283_FIXUP_CHROME_BOOK,
5785 ALC283_FIXUP_SENSE_COMBO_JACK,
5786 ALC282_FIXUP_ASUS_TX300,
5787 ALC283_FIXUP_INT_MIC,
5788 ALC290_FIXUP_MONO_SPEAKERS,
5789 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
5790 ALC290_FIXUP_SUBWOOFER,
5791 ALC290_FIXUP_SUBWOOFER_HSJACK,
5792 ALC269_FIXUP_THINKPAD_ACPI,
5793 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5794 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
5795 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
5796 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5797 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
5798 ALC255_FIXUP_HEADSET_MODE,
5799 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
5800 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5801 ALC292_FIXUP_TPT440_DOCK,
5802 ALC292_FIXUP_TPT440,
5803 ALC283_FIXUP_HEADSET_MIC,
5804 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
5805 ALC282_FIXUP_ASPIRE_V5_PINS,
5806 ALC280_FIXUP_HP_GPIO4,
5807 ALC286_FIXUP_HP_GPIO_LED,
5808 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
5809 ALC280_FIXUP_HP_DOCK_PINS,
5810 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
5811 ALC280_FIXUP_HP_9480M,
5812 ALC288_FIXUP_DELL_HEADSET_MODE,
5813 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
5814 ALC288_FIXUP_DELL_XPS_13,
5815 ALC288_FIXUP_DISABLE_AAMIX,
5816 ALC292_FIXUP_DELL_E7X,
5817 ALC292_FIXUP_DISABLE_AAMIX,
5818 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
5819 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
5820 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
5821 ALC275_FIXUP_DELL_XPS,
5822 ALC293_FIXUP_LENOVO_SPK_NOISE,
5823 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
5824 ALC255_FIXUP_DELL_SPK_NOISE,
5825 ALC225_FIXUP_DISABLE_MIC_VREF,
5826 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
5827 ALC295_FIXUP_DISABLE_DAC3,
5828 ALC285_FIXUP_SPEAKER2_TO_DAC1,
5829 ALC280_FIXUP_HP_HEADSET_MIC,
5830 ALC221_FIXUP_HP_FRONT_MIC,
5831 ALC292_FIXUP_TPT460,
5832 ALC298_FIXUP_SPK_VOLUME,
5833 ALC298_FIXUP_LENOVO_SPK_VOLUME,
5834 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
5835 ALC269_FIXUP_ATIV_BOOK_8,
5836 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
5837 ALC256_FIXUP_ASUS_HEADSET_MODE,
5838 ALC256_FIXUP_ASUS_MIC,
5839 ALC256_FIXUP_ASUS_AIO_GPIO2,
5840 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
5841 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
5842 ALC233_FIXUP_LENOVO_MULTI_CODECS,
5843 ALC233_FIXUP_ACER_HEADSET_MIC,
5844 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5845 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
5846 ALC225_FIXUP_S3_POP_NOISE,
5847 ALC700_FIXUP_INTEL_REFERENCE,
5848 ALC274_FIXUP_DELL_BIND_DACS,
5849 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
5850 ALC298_FIXUP_TPT470_DOCK_FIX,
5851 ALC298_FIXUP_TPT470_DOCK,
5852 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
5853 ALC255_FIXUP_DELL_HEADSET_MIC,
5854 ALC256_FIXUP_HUAWEI_MBXP_PINS,
5855 ALC295_FIXUP_HP_X360,
5856 ALC221_FIXUP_HP_HEADSET_MIC,
5857 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
5858 ALC295_FIXUP_HP_AUTO_MUTE,
5859 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
5860 ALC294_FIXUP_ASUS_MIC,
5861 ALC294_FIXUP_ASUS_HEADSET_MIC,
5862 ALC294_FIXUP_ASUS_SPK,
5863 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
5864 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
5865 ALC255_FIXUP_ACER_HEADSET_MIC,
5866 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
5867 ALC225_FIXUP_WYSE_AUTO_MUTE,
5868 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
5869 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
5870 ALC256_FIXUP_ASUS_HEADSET_MIC,
5871 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
5872 ALC299_FIXUP_PREDATOR_SPK,
5873 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
5874 ALC289_FIXUP_DELL_SPK2,
5875 ALC289_FIXUP_DUAL_SPK,
5876 ALC294_FIXUP_SPK2_TO_DAC1,
5877 ALC294_FIXUP_ASUS_DUAL_SPK,
5878 ALC294_FIXUP_ASUS_HPE,
5879 ALC285_FIXUP_HP_GPIO_LED,
5882 static const struct hda_fixup alc269_fixups[] = {
5883 [ALC269_FIXUP_GPIO2] = {
5884 .type = HDA_FIXUP_FUNC,
5885 .v.func = alc_fixup_gpio2,
5887 [ALC269_FIXUP_SONY_VAIO] = {
5888 .type = HDA_FIXUP_PINCTLS,
5889 .v.pins = (const struct hda_pintbl[]) {
5890 {0x19, PIN_VREFGRD},
5894 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
5895 .type = HDA_FIXUP_FUNC,
5896 .v.func = alc275_fixup_gpio4_off,
5898 .chain_id = ALC269_FIXUP_SONY_VAIO
5900 [ALC269_FIXUP_DELL_M101Z] = {
5901 .type = HDA_FIXUP_VERBS,
5902 .v.verbs = (const struct hda_verb[]) {
5903 /* Enables internal speaker */
5904 {0x20, AC_VERB_SET_COEF_INDEX, 13},
5905 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
5909 [ALC269_FIXUP_SKU_IGNORE] = {
5910 .type = HDA_FIXUP_FUNC,
5911 .v.func = alc_fixup_sku_ignore,
5913 [ALC269_FIXUP_ASUS_G73JW] = {
5914 .type = HDA_FIXUP_PINS,
5915 .v.pins = (const struct hda_pintbl[]) {
5916 { 0x17, 0x99130111 }, /* subwoofer */
5920 [ALC269_FIXUP_LENOVO_EAPD] = {
5921 .type = HDA_FIXUP_VERBS,
5922 .v.verbs = (const struct hda_verb[]) {
5923 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
5927 [ALC275_FIXUP_SONY_HWEQ] = {
5928 .type = HDA_FIXUP_FUNC,
5929 .v.func = alc269_fixup_hweq,
5931 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
5933 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
5934 .type = HDA_FIXUP_FUNC,
5935 .v.func = alc_fixup_disable_aamix,
5937 .chain_id = ALC269_FIXUP_SONY_VAIO
5939 [ALC271_FIXUP_DMIC] = {
5940 .type = HDA_FIXUP_FUNC,
5941 .v.func = alc271_fixup_dmic,
5943 [ALC269_FIXUP_PCM_44K] = {
5944 .type = HDA_FIXUP_FUNC,
5945 .v.func = alc269_fixup_pcm_44k,
5947 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5949 [ALC269_FIXUP_STEREO_DMIC] = {
5950 .type = HDA_FIXUP_FUNC,
5951 .v.func = alc269_fixup_stereo_dmic,
5953 [ALC269_FIXUP_HEADSET_MIC] = {
5954 .type = HDA_FIXUP_FUNC,
5955 .v.func = alc269_fixup_headset_mic,
5957 [ALC269_FIXUP_QUANTA_MUTE] = {
5958 .type = HDA_FIXUP_FUNC,
5959 .v.func = alc269_fixup_quanta_mute,
5961 [ALC269_FIXUP_LIFEBOOK] = {
5962 .type = HDA_FIXUP_PINS,
5963 .v.pins = (const struct hda_pintbl[]) {
5964 { 0x1a, 0x2101103f }, /* dock line-out */
5965 { 0x1b, 0x23a11040 }, /* dock mic-in */
5969 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5971 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
5972 .type = HDA_FIXUP_PINS,
5973 .v.pins = (const struct hda_pintbl[]) {
5974 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5978 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
5979 .type = HDA_FIXUP_PINS,
5980 .v.pins = (const struct hda_pintbl[]) {
5981 { 0x21, 0x0221102f }, /* HP out */
5985 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
5986 .type = HDA_FIXUP_FUNC,
5987 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5989 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
5990 .type = HDA_FIXUP_FUNC,
5991 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
5993 [ALC269_FIXUP_AMIC] = {
5994 .type = HDA_FIXUP_PINS,
5995 .v.pins = (const struct hda_pintbl[]) {
5996 { 0x14, 0x99130110 }, /* speaker */
5997 { 0x15, 0x0121401f }, /* HP out */
5998 { 0x18, 0x01a19c20 }, /* mic */
5999 { 0x19, 0x99a3092f }, /* int-mic */
6003 [ALC269_FIXUP_DMIC] = {
6004 .type = HDA_FIXUP_PINS,
6005 .v.pins = (const struct hda_pintbl[]) {
6006 { 0x12, 0x99a3092f }, /* int-mic */
6007 { 0x14, 0x99130110 }, /* speaker */
6008 { 0x15, 0x0121401f }, /* HP out */
6009 { 0x18, 0x01a19c20 }, /* mic */
6013 [ALC269VB_FIXUP_AMIC] = {
6014 .type = HDA_FIXUP_PINS,
6015 .v.pins = (const struct hda_pintbl[]) {
6016 { 0x14, 0x99130110 }, /* speaker */
6017 { 0x18, 0x01a19c20 }, /* mic */
6018 { 0x19, 0x99a3092f }, /* int-mic */
6019 { 0x21, 0x0121401f }, /* HP out */
6023 [ALC269VB_FIXUP_DMIC] = {
6024 .type = HDA_FIXUP_PINS,
6025 .v.pins = (const struct hda_pintbl[]) {
6026 { 0x12, 0x99a3092f }, /* int-mic */
6027 { 0x14, 0x99130110 }, /* speaker */
6028 { 0x18, 0x01a19c20 }, /* mic */
6029 { 0x21, 0x0121401f }, /* HP out */
6033 [ALC269_FIXUP_HP_MUTE_LED] = {
6034 .type = HDA_FIXUP_FUNC,
6035 .v.func = alc269_fixup_hp_mute_led,
6037 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6038 .type = HDA_FIXUP_FUNC,
6039 .v.func = alc269_fixup_hp_mute_led_mic1,
6041 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6042 .type = HDA_FIXUP_FUNC,
6043 .v.func = alc269_fixup_hp_mute_led_mic2,
6045 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6046 .type = HDA_FIXUP_FUNC,
6047 .v.func = alc269_fixup_hp_mute_led_mic3,
6049 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6051 [ALC269_FIXUP_HP_GPIO_LED] = {
6052 .type = HDA_FIXUP_FUNC,
6053 .v.func = alc269_fixup_hp_gpio_led,
6055 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6056 .type = HDA_FIXUP_FUNC,
6057 .v.func = alc269_fixup_hp_gpio_mic1_led,
6059 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6060 .type = HDA_FIXUP_FUNC,
6061 .v.func = alc269_fixup_hp_line1_mic1_led,
6063 [ALC269_FIXUP_INV_DMIC] = {
6064 .type = HDA_FIXUP_FUNC,
6065 .v.func = alc_fixup_inv_dmic,
6067 [ALC269_FIXUP_NO_SHUTUP] = {
6068 .type = HDA_FIXUP_FUNC,
6069 .v.func = alc_fixup_no_shutup,
6071 [ALC269_FIXUP_LENOVO_DOCK] = {
6072 .type = HDA_FIXUP_PINS,
6073 .v.pins = (const struct hda_pintbl[]) {
6074 { 0x19, 0x23a11040 }, /* dock mic */
6075 { 0x1b, 0x2121103f }, /* dock headphone */
6079 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6081 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6082 .type = HDA_FIXUP_FUNC,
6083 .v.func = alc269_fixup_limit_int_mic_boost,
6085 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6087 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6088 .type = HDA_FIXUP_FUNC,
6089 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6091 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6093 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6094 .type = HDA_FIXUP_PINS,
6095 .v.pins = (const struct hda_pintbl[]) {
6096 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6097 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6101 .chain_id = ALC269_FIXUP_HEADSET_MODE
6103 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6104 .type = HDA_FIXUP_PINS,
6105 .v.pins = (const struct hda_pintbl[]) {
6106 { 0x16, 0x21014020 }, /* dock line out */
6107 { 0x19, 0x21a19030 }, /* dock mic */
6108 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6112 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6114 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6115 .type = HDA_FIXUP_PINS,
6116 .v.pins = (const struct hda_pintbl[]) {
6117 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6121 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6123 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6124 .type = HDA_FIXUP_PINS,
6125 .v.pins = (const struct hda_pintbl[]) {
6126 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6127 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6131 .chain_id = ALC269_FIXUP_HEADSET_MODE
6133 [ALC269_FIXUP_HEADSET_MODE] = {
6134 .type = HDA_FIXUP_FUNC,
6135 .v.func = alc_fixup_headset_mode,
6137 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6139 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6140 .type = HDA_FIXUP_FUNC,
6141 .v.func = alc_fixup_headset_mode_no_hp_mic,
6143 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6144 .type = HDA_FIXUP_PINS,
6145 .v.pins = (const struct hda_pintbl[]) {
6146 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6150 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6152 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6153 .type = HDA_FIXUP_PINS,
6154 .v.pins = (const struct hda_pintbl[]) {
6155 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6159 .chain_id = ALC269_FIXUP_HEADSET_MIC
6161 [ALC256_FIXUP_HUAWEI_MBXP_PINS] = {
6162 .type = HDA_FIXUP_PINS,
6163 .v.pins = (const struct hda_pintbl[]) {
6177 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6178 .type = HDA_FIXUP_FUNC,
6179 .v.func = alc269_fixup_x101_headset_mic,
6181 [ALC269_FIXUP_ASUS_X101_VERB] = {
6182 .type = HDA_FIXUP_VERBS,
6183 .v.verbs = (const struct hda_verb[]) {
6184 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6185 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6186 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6190 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6192 [ALC269_FIXUP_ASUS_X101] = {
6193 .type = HDA_FIXUP_PINS,
6194 .v.pins = (const struct hda_pintbl[]) {
6195 { 0x18, 0x04a1182c }, /* Headset mic */
6199 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6201 [ALC271_FIXUP_AMIC_MIC2] = {
6202 .type = HDA_FIXUP_PINS,
6203 .v.pins = (const struct hda_pintbl[]) {
6204 { 0x14, 0x99130110 }, /* speaker */
6205 { 0x19, 0x01a19c20 }, /* mic */
6206 { 0x1b, 0x99a7012f }, /* int-mic */
6207 { 0x21, 0x0121401f }, /* HP out */
6211 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6212 .type = HDA_FIXUP_FUNC,
6213 .v.func = alc271_hp_gate_mic_jack,
6215 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6217 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6218 .type = HDA_FIXUP_FUNC,
6219 .v.func = alc269_fixup_limit_int_mic_boost,
6221 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6223 [ALC269_FIXUP_ACER_AC700] = {
6224 .type = HDA_FIXUP_PINS,
6225 .v.pins = (const struct hda_pintbl[]) {
6226 { 0x12, 0x99a3092f }, /* int-mic */
6227 { 0x14, 0x99130110 }, /* speaker */
6228 { 0x18, 0x03a11c20 }, /* mic */
6229 { 0x1e, 0x0346101e }, /* SPDIF1 */
6230 { 0x21, 0x0321101f }, /* HP out */
6234 .chain_id = ALC271_FIXUP_DMIC,
6236 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6237 .type = HDA_FIXUP_FUNC,
6238 .v.func = alc269_fixup_limit_int_mic_boost,
6240 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6242 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6243 .type = HDA_FIXUP_FUNC,
6244 .v.func = alc269_fixup_limit_int_mic_boost,
6246 .chain_id = ALC269VB_FIXUP_DMIC,
6248 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6249 .type = HDA_FIXUP_VERBS,
6250 .v.verbs = (const struct hda_verb[]) {
6251 /* class-D output amp +5dB */
6252 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6253 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6257 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6259 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6260 .type = HDA_FIXUP_FUNC,
6261 .v.func = alc269_fixup_limit_int_mic_boost,
6263 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6265 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6266 .type = HDA_FIXUP_PINS,
6267 .v.pins = (const struct hda_pintbl[]) {
6268 { 0x12, 0x99a3092f }, /* int-mic */
6269 { 0x18, 0x03a11d20 }, /* mic */
6270 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6274 [ALC283_FIXUP_CHROME_BOOK] = {
6275 .type = HDA_FIXUP_FUNC,
6276 .v.func = alc283_fixup_chromebook,
6278 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6279 .type = HDA_FIXUP_FUNC,
6280 .v.func = alc283_fixup_sense_combo_jack,
6282 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6284 [ALC282_FIXUP_ASUS_TX300] = {
6285 .type = HDA_FIXUP_FUNC,
6286 .v.func = alc282_fixup_asus_tx300,
6288 [ALC283_FIXUP_INT_MIC] = {
6289 .type = HDA_FIXUP_VERBS,
6290 .v.verbs = (const struct hda_verb[]) {
6291 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6292 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6296 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6298 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6299 .type = HDA_FIXUP_PINS,
6300 .v.pins = (const struct hda_pintbl[]) {
6301 { 0x17, 0x90170112 }, /* subwoofer */
6305 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6307 [ALC290_FIXUP_SUBWOOFER] = {
6308 .type = HDA_FIXUP_PINS,
6309 .v.pins = (const struct hda_pintbl[]) {
6310 { 0x17, 0x90170112 }, /* subwoofer */
6314 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6316 [ALC290_FIXUP_MONO_SPEAKERS] = {
6317 .type = HDA_FIXUP_FUNC,
6318 .v.func = alc290_fixup_mono_speakers,
6320 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6321 .type = HDA_FIXUP_FUNC,
6322 .v.func = alc290_fixup_mono_speakers,
6324 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6326 [ALC269_FIXUP_THINKPAD_ACPI] = {
6327 .type = HDA_FIXUP_FUNC,
6328 .v.func = alc_fixup_thinkpad_acpi,
6330 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6332 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6333 .type = HDA_FIXUP_FUNC,
6334 .v.func = alc_fixup_inv_dmic,
6336 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6338 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6339 .type = HDA_FIXUP_PINS,
6340 .v.pins = (const struct hda_pintbl[]) {
6341 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6345 .chain_id = ALC255_FIXUP_HEADSET_MODE
6347 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6348 .type = HDA_FIXUP_PINS,
6349 .v.pins = (const struct hda_pintbl[]) {
6350 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6354 .chain_id = ALC255_FIXUP_HEADSET_MODE
6356 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6357 .type = HDA_FIXUP_PINS,
6358 .v.pins = (const struct hda_pintbl[]) {
6359 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6360 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6364 .chain_id = ALC255_FIXUP_HEADSET_MODE
6366 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6367 .type = HDA_FIXUP_PINS,
6368 .v.pins = (const struct hda_pintbl[]) {
6369 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6373 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6375 [ALC255_FIXUP_HEADSET_MODE] = {
6376 .type = HDA_FIXUP_FUNC,
6377 .v.func = alc_fixup_headset_mode_alc255,
6379 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6381 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6382 .type = HDA_FIXUP_FUNC,
6383 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6385 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6386 .type = HDA_FIXUP_PINS,
6387 .v.pins = (const struct hda_pintbl[]) {
6388 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6389 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6393 .chain_id = ALC269_FIXUP_HEADSET_MODE
6395 [ALC292_FIXUP_TPT440_DOCK] = {
6396 .type = HDA_FIXUP_FUNC,
6397 .v.func = alc_fixup_tpt440_dock,
6399 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6401 [ALC292_FIXUP_TPT440] = {
6402 .type = HDA_FIXUP_FUNC,
6403 .v.func = alc_fixup_disable_aamix,
6405 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6407 [ALC283_FIXUP_HEADSET_MIC] = {
6408 .type = HDA_FIXUP_PINS,
6409 .v.pins = (const struct hda_pintbl[]) {
6410 { 0x19, 0x04a110f0 },
6414 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = {
6415 .type = HDA_FIXUP_FUNC,
6416 .v.func = alc_fixup_dell_wmi,
6418 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6419 .type = HDA_FIXUP_PINS,
6420 .v.pins = (const struct hda_pintbl[]) {
6421 { 0x12, 0x90a60130 },
6422 { 0x14, 0x90170110 },
6423 { 0x17, 0x40000008 },
6424 { 0x18, 0x411111f0 },
6425 { 0x19, 0x01a1913c },
6426 { 0x1a, 0x411111f0 },
6427 { 0x1b, 0x411111f0 },
6428 { 0x1d, 0x40f89b2d },
6429 { 0x1e, 0x411111f0 },
6430 { 0x21, 0x0321101f },
6434 [ALC280_FIXUP_HP_GPIO4] = {
6435 .type = HDA_FIXUP_FUNC,
6436 .v.func = alc280_fixup_hp_gpio4,
6438 [ALC286_FIXUP_HP_GPIO_LED] = {
6439 .type = HDA_FIXUP_FUNC,
6440 .v.func = alc286_fixup_hp_gpio_led,
6442 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6443 .type = HDA_FIXUP_FUNC,
6444 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6446 [ALC280_FIXUP_HP_DOCK_PINS] = {
6447 .type = HDA_FIXUP_PINS,
6448 .v.pins = (const struct hda_pintbl[]) {
6449 { 0x1b, 0x21011020 }, /* line-out */
6450 { 0x1a, 0x01a1903c }, /* headset mic */
6451 { 0x18, 0x2181103f }, /* line-in */
6455 .chain_id = ALC280_FIXUP_HP_GPIO4
6457 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6458 .type = HDA_FIXUP_PINS,
6459 .v.pins = (const struct hda_pintbl[]) {
6460 { 0x1b, 0x21011020 }, /* line-out */
6461 { 0x18, 0x2181103f }, /* line-in */
6465 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6467 [ALC280_FIXUP_HP_9480M] = {
6468 .type = HDA_FIXUP_FUNC,
6469 .v.func = alc280_fixup_hp_9480m,
6471 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6472 .type = HDA_FIXUP_FUNC,
6473 .v.func = alc_fixup_headset_mode_dell_alc288,
6475 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6477 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6478 .type = HDA_FIXUP_PINS,
6479 .v.pins = (const struct hda_pintbl[]) {
6480 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6481 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6485 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6487 [ALC288_FIXUP_DISABLE_AAMIX] = {
6488 .type = HDA_FIXUP_FUNC,
6489 .v.func = alc_fixup_disable_aamix,
6491 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6493 [ALC288_FIXUP_DELL_XPS_13] = {
6494 .type = HDA_FIXUP_FUNC,
6495 .v.func = alc_fixup_dell_xps13,
6497 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6499 [ALC292_FIXUP_DISABLE_AAMIX] = {
6500 .type = HDA_FIXUP_FUNC,
6501 .v.func = alc_fixup_disable_aamix,
6503 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6505 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
6506 .type = HDA_FIXUP_FUNC,
6507 .v.func = alc_fixup_disable_aamix,
6509 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6511 [ALC292_FIXUP_DELL_E7X] = {
6512 .type = HDA_FIXUP_FUNC,
6513 .v.func = alc_fixup_dell_xps13,
6515 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
6517 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6518 .type = HDA_FIXUP_PINS,
6519 .v.pins = (const struct hda_pintbl[]) {
6520 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6521 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6525 .chain_id = ALC269_FIXUP_HEADSET_MODE
6527 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
6528 .type = HDA_FIXUP_PINS,
6529 .v.pins = (const struct hda_pintbl[]) {
6530 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6534 .chain_id = ALC269_FIXUP_HEADSET_MODE
6536 [ALC275_FIXUP_DELL_XPS] = {
6537 .type = HDA_FIXUP_VERBS,
6538 .v.verbs = (const struct hda_verb[]) {
6539 /* Enables internal speaker */
6540 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
6541 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
6542 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
6543 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
6547 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
6548 .type = HDA_FIXUP_FUNC,
6549 .v.func = alc_fixup_disable_aamix,
6551 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6553 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
6554 .type = HDA_FIXUP_FUNC,
6555 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
6557 [ALC255_FIXUP_DELL_SPK_NOISE] = {
6558 .type = HDA_FIXUP_FUNC,
6559 .v.func = alc_fixup_disable_aamix,
6561 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6563 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
6564 .type = HDA_FIXUP_FUNC,
6565 .v.func = alc_fixup_disable_mic_vref,
6567 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6569 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6570 .type = HDA_FIXUP_VERBS,
6571 .v.verbs = (const struct hda_verb[]) {
6572 /* Disable pass-through path for FRONT 14h */
6573 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6574 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6578 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
6580 [ALC280_FIXUP_HP_HEADSET_MIC] = {
6581 .type = HDA_FIXUP_FUNC,
6582 .v.func = alc_fixup_disable_aamix,
6584 .chain_id = ALC269_FIXUP_HEADSET_MIC,
6586 [ALC221_FIXUP_HP_FRONT_MIC] = {
6587 .type = HDA_FIXUP_PINS,
6588 .v.pins = (const struct hda_pintbl[]) {
6589 { 0x19, 0x02a19020 }, /* Front Mic */
6593 [ALC292_FIXUP_TPT460] = {
6594 .type = HDA_FIXUP_FUNC,
6595 .v.func = alc_fixup_tpt440_dock,
6597 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
6599 [ALC298_FIXUP_SPK_VOLUME] = {
6600 .type = HDA_FIXUP_FUNC,
6601 .v.func = alc298_fixup_speaker_volume,
6603 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6605 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
6606 .type = HDA_FIXUP_FUNC,
6607 .v.func = alc298_fixup_speaker_volume,
6609 [ALC295_FIXUP_DISABLE_DAC3] = {
6610 .type = HDA_FIXUP_FUNC,
6611 .v.func = alc295_fixup_disable_dac3,
6613 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
6614 .type = HDA_FIXUP_FUNC,
6615 .v.func = alc285_fixup_speaker2_to_dac1,
6617 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6619 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
6620 .type = HDA_FIXUP_PINS,
6621 .v.pins = (const struct hda_pintbl[]) {
6622 { 0x1b, 0x90170151 },
6626 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6628 [ALC269_FIXUP_ATIV_BOOK_8] = {
6629 .type = HDA_FIXUP_FUNC,
6630 .v.func = alc_fixup_auto_mute_via_amp,
6632 .chain_id = ALC269_FIXUP_NO_SHUTUP
6634 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
6635 .type = HDA_FIXUP_PINS,
6636 .v.pins = (const struct hda_pintbl[]) {
6637 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6638 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6642 .chain_id = ALC269_FIXUP_HEADSET_MODE
6644 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
6645 .type = HDA_FIXUP_FUNC,
6646 .v.func = alc_fixup_headset_mode,
6648 [ALC256_FIXUP_ASUS_MIC] = {
6649 .type = HDA_FIXUP_PINS,
6650 .v.pins = (const struct hda_pintbl[]) {
6651 { 0x13, 0x90a60160 }, /* use as internal mic */
6652 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6656 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6658 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
6659 .type = HDA_FIXUP_FUNC,
6660 /* Set up GPIO2 for the speaker amp */
6661 .v.func = alc_fixup_gpio4,
6663 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6664 .type = HDA_FIXUP_PINS,
6665 .v.pins = (const struct hda_pintbl[]) {
6666 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6670 .chain_id = ALC269_FIXUP_HEADSET_MIC
6672 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
6673 .type = HDA_FIXUP_VERBS,
6674 .v.verbs = (const struct hda_verb[]) {
6675 /* Enables internal speaker */
6676 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
6677 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
6681 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6683 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
6684 .type = HDA_FIXUP_FUNC,
6685 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
6687 .chain_id = ALC269_FIXUP_GPIO2
6689 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
6690 .type = HDA_FIXUP_VERBS,
6691 .v.verbs = (const struct hda_verb[]) {
6692 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
6693 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
6697 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6699 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
6700 .type = HDA_FIXUP_PINS,
6701 .v.pins = (const struct hda_pintbl[]) {
6702 /* Change the mic location from front to right, otherwise there are
6703 two front mics with the same name, pulseaudio can't handle them.
6704 This is just a temporary workaround, after applying this fixup,
6705 there will be one "Front Mic" and one "Mic" in this machine.
6707 { 0x1a, 0x04a19040 },
6711 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
6712 .type = HDA_FIXUP_PINS,
6713 .v.pins = (const struct hda_pintbl[]) {
6714 { 0x16, 0x0101102f }, /* Rear Headset HP */
6715 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6716 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6717 { 0x1b, 0x02011020 },
6721 .chain_id = ALC225_FIXUP_S3_POP_NOISE
6723 [ALC225_FIXUP_S3_POP_NOISE] = {
6724 .type = HDA_FIXUP_FUNC,
6725 .v.func = alc225_fixup_s3_pop_noise,
6727 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6729 [ALC700_FIXUP_INTEL_REFERENCE] = {
6730 .type = HDA_FIXUP_VERBS,
6731 .v.verbs = (const struct hda_verb[]) {
6732 /* Enables internal speaker */
6733 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
6734 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
6735 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
6736 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
6737 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
6738 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
6739 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
6740 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
6744 [ALC274_FIXUP_DELL_BIND_DACS] = {
6745 .type = HDA_FIXUP_FUNC,
6746 .v.func = alc274_fixup_bind_dacs,
6748 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6750 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
6751 .type = HDA_FIXUP_PINS,
6752 .v.pins = (const struct hda_pintbl[]) {
6753 { 0x1b, 0x0401102f },
6757 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
6759 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
6760 .type = HDA_FIXUP_FUNC,
6761 .v.func = alc_fixup_tpt470_dock,
6763 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6765 [ALC298_FIXUP_TPT470_DOCK] = {
6766 .type = HDA_FIXUP_FUNC,
6767 .v.func = alc_fixup_tpt470_dacs,
6769 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
6771 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
6772 .type = HDA_FIXUP_PINS,
6773 .v.pins = (const struct hda_pintbl[]) {
6774 { 0x14, 0x0201101f },
6778 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6780 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
6781 .type = HDA_FIXUP_PINS,
6782 .v.pins = (const struct hda_pintbl[]) {
6783 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6787 .chain_id = ALC269_FIXUP_HEADSET_MIC
6789 [ALC295_FIXUP_HP_X360] = {
6790 .type = HDA_FIXUP_FUNC,
6791 .v.func = alc295_fixup_hp_top_speakers,
6793 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
6795 [ALC221_FIXUP_HP_HEADSET_MIC] = {
6796 .type = HDA_FIXUP_PINS,
6797 .v.pins = (const struct hda_pintbl[]) {
6798 { 0x19, 0x0181313f},
6802 .chain_id = ALC269_FIXUP_HEADSET_MIC
6804 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
6805 .type = HDA_FIXUP_FUNC,
6806 .v.func = alc285_fixup_invalidate_dacs,
6808 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6810 [ALC295_FIXUP_HP_AUTO_MUTE] = {
6811 .type = HDA_FIXUP_FUNC,
6812 .v.func = alc_fixup_auto_mute_via_amp,
6814 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
6815 .type = HDA_FIXUP_PINS,
6816 .v.pins = (const struct hda_pintbl[]) {
6817 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6821 .chain_id = ALC269_FIXUP_HEADSET_MIC
6823 [ALC294_FIXUP_ASUS_MIC] = {
6824 .type = HDA_FIXUP_PINS,
6825 .v.pins = (const struct hda_pintbl[]) {
6826 { 0x13, 0x90a60160 }, /* use as internal mic */
6827 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6831 .chain_id = ALC269_FIXUP_HEADSET_MIC
6833 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
6834 .type = HDA_FIXUP_PINS,
6835 .v.pins = (const struct hda_pintbl[]) {
6836 { 0x19, 0x01a1103c }, /* use as headset mic */
6840 .chain_id = ALC269_FIXUP_HEADSET_MIC
6842 [ALC294_FIXUP_ASUS_SPK] = {
6843 .type = HDA_FIXUP_VERBS,
6844 .v.verbs = (const struct hda_verb[]) {
6846 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
6847 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
6848 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
6849 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
6853 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
6855 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
6856 .type = HDA_FIXUP_PINS,
6857 .v.pins = (const struct hda_pintbl[]) {
6858 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6862 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6864 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
6865 .type = HDA_FIXUP_VERBS,
6866 .v.verbs = (const struct hda_verb[]) {
6867 /* Disable PCBEEP-IN passthrough */
6868 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6869 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6873 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6875 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
6876 .type = HDA_FIXUP_PINS,
6877 .v.pins = (const struct hda_pintbl[]) {
6878 { 0x19, 0x03a11130 },
6879 { 0x1a, 0x90a60140 }, /* use as internal mic */
6883 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6885 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
6886 .type = HDA_FIXUP_PINS,
6887 .v.pins = (const struct hda_pintbl[]) {
6888 { 0x16, 0x01011020 }, /* Rear Line out */
6889 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6893 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
6895 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
6896 .type = HDA_FIXUP_FUNC,
6897 .v.func = alc_fixup_auto_mute_via_amp,
6899 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6901 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
6902 .type = HDA_FIXUP_FUNC,
6903 .v.func = alc_fixup_disable_mic_vref,
6905 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6907 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
6908 .type = HDA_FIXUP_VERBS,
6909 .v.verbs = (const struct hda_verb[]) {
6910 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
6911 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
6915 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
6917 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
6918 .type = HDA_FIXUP_PINS,
6919 .v.pins = (const struct hda_pintbl[]) {
6920 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
6924 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6926 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6927 .type = HDA_FIXUP_PINS,
6928 .v.pins = (const struct hda_pintbl[]) {
6929 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6933 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6935 [ALC299_FIXUP_PREDATOR_SPK] = {
6936 .type = HDA_FIXUP_PINS,
6937 .v.pins = (const struct hda_pintbl[]) {
6938 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
6942 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
6943 .type = HDA_FIXUP_PINS,
6944 .v.pins = (const struct hda_pintbl[]) {
6945 { 0x19, 0x04a11040 },
6946 { 0x21, 0x04211020 },
6950 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6952 [ALC289_FIXUP_DELL_SPK2] = {
6953 .type = HDA_FIXUP_PINS,
6954 .v.pins = (const struct hda_pintbl[]) {
6955 { 0x17, 0x90170130 }, /* bass spk */
6959 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
6961 [ALC289_FIXUP_DUAL_SPK] = {
6962 .type = HDA_FIXUP_FUNC,
6963 .v.func = alc285_fixup_speaker2_to_dac1,
6965 .chain_id = ALC289_FIXUP_DELL_SPK2
6967 [ALC294_FIXUP_SPK2_TO_DAC1] = {
6968 .type = HDA_FIXUP_FUNC,
6969 .v.func = alc285_fixup_speaker2_to_dac1,
6971 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
6973 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
6974 .type = HDA_FIXUP_FUNC,
6975 /* The GPIO must be pulled to initialize the AMP */
6976 .v.func = alc_fixup_gpio4,
6978 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
6980 [ALC294_FIXUP_ASUS_HPE] = {
6981 .type = HDA_FIXUP_VERBS,
6982 .v.verbs = (const struct hda_verb[]) {
6984 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
6985 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
6989 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
6991 [ALC285_FIXUP_HP_GPIO_LED] = {
6992 .type = HDA_FIXUP_FUNC,
6993 .v.func = alc285_fixup_hp_gpio_led,
6997 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6998 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
6999 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
7000 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
7001 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7002 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7003 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7004 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
7005 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
7006 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7007 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7008 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
7009 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
7010 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
7011 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7012 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7013 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
7014 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7015 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7016 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7017 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7018 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
7019 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
7020 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
7021 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
7022 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
7023 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
7024 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
7025 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
7026 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
7027 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7028 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7029 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7030 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7031 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7032 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
7033 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
7034 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
7035 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7036 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7037 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
7038 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7039 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
7040 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7041 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7042 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7043 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7044 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7045 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7046 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7047 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7048 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7049 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
7050 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
7051 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
7052 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
7053 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7054 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
7055 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
7056 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7057 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7058 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7059 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7060 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
7061 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
7062 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
7063 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7064 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7065 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7066 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7067 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7068 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7069 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7070 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
7071 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
7072 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7073 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7074 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7075 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7076 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7077 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
7078 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7079 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7080 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7081 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7082 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7083 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7084 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7085 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7086 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7087 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7088 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7089 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7090 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7091 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
7092 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
7093 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7094 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7095 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7096 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7097 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7098 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7099 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7100 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7101 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
7102 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7103 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7104 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7105 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7106 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7107 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7108 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7109 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7110 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7111 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7112 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7113 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7114 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7115 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7116 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7117 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7118 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7119 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7120 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
7121 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7122 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7123 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7124 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7125 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7126 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7127 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7128 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7129 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7130 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
7131 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
7132 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7133 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7134 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7135 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7136 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7137 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7138 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7139 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
7140 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7141 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
7142 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7143 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
7144 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7145 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7146 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7147 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7148 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
7149 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7150 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7151 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
7152 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
7153 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
7154 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
7155 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
7156 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
7157 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
7158 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
7159 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7160 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
7161 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
7162 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
7163 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7164 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7165 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7166 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
7167 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
7168 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
7169 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
7170 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7171 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7172 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
7173 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
7174 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7175 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7176 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
7177 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7178 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7179 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
7180 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
7181 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7182 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7183 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
7184 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
7185 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
7186 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
7187 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
7188 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
7189 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
7190 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
7191 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
7192 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
7193 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7194 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7195 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7196 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7197 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7198 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7199 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7200 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7201 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7202 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7203 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7204 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7205 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7206 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7207 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7208 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7209 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7210 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7211 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7212 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7213 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7214 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7215 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7216 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7217 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7218 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7219 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7220 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7221 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7222 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7223 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7224 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7225 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7226 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7227 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7228 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7229 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7230 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7231 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7232 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7233 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5|7][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
7234 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7235 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7236 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7237 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7238 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7239 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7240 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7241 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7242 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7243 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7244 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7245 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL5XNU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7246 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7247 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7248 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7249 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7250 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7251 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7252 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
7253 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7254 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
7255 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
7256 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
7257 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
7258 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
7259 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
7260 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
7261 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
7262 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
7263 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
7264 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
7265 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
7266 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
7267 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
7268 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
7269 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7270 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
7271 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7272 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
7273 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
7274 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
7275 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7276 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7277 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
7278 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
7279 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
7280 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7281 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7282 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
7283 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7284 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7285 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7286 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7287 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
7288 SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
7289 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7290 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7291 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7292 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7293 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7294 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7295 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7296 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7297 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7298 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7299 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
7300 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7301 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
7302 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7303 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
7304 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7305 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
7306 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
7307 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7308 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
7309 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
7310 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
7311 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
7312 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
7313 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
7314 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
7315 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
7316 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7317 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7318 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7319 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7320 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7321 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7322 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
7323 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS),
7324 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
7325 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
7326 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
7329 /* Below is a quirk table taken from the old code.
7330 * Basically the device should work as is without the fixup table.
7331 * If BIOS doesn't give a proper info, enable the corresponding
7334 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7336 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
7337 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
7338 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
7339 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
7340 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
7341 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
7342 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
7343 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
7344 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
7345 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
7346 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
7347 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
7348 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
7349 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
7350 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
7351 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
7352 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
7353 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
7354 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
7355 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
7356 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
7357 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
7358 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
7359 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
7360 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
7361 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
7362 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
7363 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
7364 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
7365 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
7366 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
7367 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
7368 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
7369 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
7370 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
7371 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
7372 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
7373 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
7374 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
7379 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
7380 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
7381 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
7382 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
7383 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
7387 static const struct hda_model_fixup alc269_fixup_models[] = {
7388 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
7389 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
7390 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
7391 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
7392 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7393 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
7394 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
7395 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
7396 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
7397 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
7398 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7399 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
7400 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
7401 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
7402 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
7403 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
7404 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
7405 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
7406 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
7407 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
7408 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
7409 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
7410 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
7411 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
7412 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
7413 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
7414 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
7415 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
7416 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
7417 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
7418 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
7419 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
7420 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
7421 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
7422 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
7423 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
7424 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
7425 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
7426 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
7427 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
7428 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
7429 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
7430 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
7431 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
7432 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
7433 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
7434 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
7435 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
7436 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
7437 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
7438 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
7439 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
7440 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
7441 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
7442 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
7443 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
7444 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
7445 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
7446 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
7447 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
7448 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
7449 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
7450 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
7451 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
7452 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
7453 {.id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, .name = "alc255-dell-mute"},
7454 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
7455 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
7456 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7457 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
7458 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
7459 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
7460 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
7461 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
7462 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
7463 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
7464 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
7465 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
7466 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
7467 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
7468 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
7469 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
7470 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
7471 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
7472 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
7473 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
7474 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
7475 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
7476 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
7477 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
7478 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
7479 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
7480 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
7481 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
7482 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
7483 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
7484 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
7485 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
7486 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
7487 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
7488 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
7489 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
7490 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
7491 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
7492 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
7493 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
7496 #define ALC225_STANDARD_PINS \
7499 #define ALC256_STANDARD_PINS \
7500 {0x12, 0x90a60140}, \
7501 {0x14, 0x90170110}, \
7504 #define ALC282_STANDARD_PINS \
7507 #define ALC290_STANDARD_PINS \
7510 #define ALC292_STANDARD_PINS \
7511 {0x14, 0x90170110}, \
7514 #define ALC295_STANDARD_PINS \
7515 {0x12, 0xb7a60130}, \
7516 {0x14, 0x90170110}, \
7519 #define ALC298_STANDARD_PINS \
7520 {0x12, 0x90a60130}, \
7523 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
7524 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
7529 {0x21, 0x0221102f}),
7530 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7533 {0x21, 0x02211030}),
7534 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7537 {0x21, 0x03211020}),
7538 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7541 {0x21, 0x03211020}),
7542 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7543 ALC225_STANDARD_PINS,
7545 {0x14, 0x901701a0}),
7546 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7547 ALC225_STANDARD_PINS,
7549 {0x14, 0x901701b0}),
7550 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7551 ALC225_STANDARD_PINS,
7553 {0x14, 0x901701a0}),
7554 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7555 ALC225_STANDARD_PINS,
7557 {0x14, 0x901701b0}),
7558 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7559 ALC225_STANDARD_PINS,
7561 {0x1b, 0x90170110}),
7562 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7565 {0x21, 0x02211020}),
7566 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7570 {0x21, 0x02211020}),
7571 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7576 {0x21, 0x0221101f}),
7577 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7582 {0x21, 0x0221101f}),
7583 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7587 {0x21, 0x0221101f}),
7588 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7591 {0x21, 0x02211020}),
7592 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7595 {0x21, 0x02211020}),
7596 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7597 {0x21, 0x02211020}),
7598 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7601 {0x21, 0x02211020}),
7602 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7604 {0x21, 0x02211020}),
7605 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7607 {0x21, 0x02211040}),
7608 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7611 {0x21, 0x02211020}),
7612 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7615 {0x21, 0x02211030}),
7616 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7619 {0x21, 0x0221101f}),
7620 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7623 {0x21, 0x0221101f}),
7624 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7627 {0x21, 0x0221103f}),
7628 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7631 {0x21, 0x0221103f}),
7632 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7635 {0x21, 0x0221103f}),
7636 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7639 {0x21, 0x0221105f}),
7640 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7643 {0x21, 0x0221101f}),
7644 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7648 {0x21, 0x0321102f}),
7649 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7652 {0x21, 0x02211040}),
7653 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7656 {0x21, 0x02211050}),
7657 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7660 {0x21, 0x02211030}),
7661 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7664 {0x21, 0x02211040}),
7665 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7668 {0x21, 0x02211040}),
7669 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7672 {0x21, 0x02211050}),
7673 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7676 {0x21, 0x02211040}),
7677 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7680 {0x21, 0x02211030}),
7681 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7683 {0x21, 0x02211010}),
7684 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7688 {0x21, 0x0221101f}),
7689 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7692 {0x21, 0x02211030}),
7693 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7696 {0x21, 0x02211030}),
7697 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7700 {0x21, 0x02211030}),
7701 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7704 {0x21, 0x02211020}),
7705 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7709 {0x21, 0x0221101f}),
7710 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7711 ALC256_STANDARD_PINS),
7712 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7715 {0x21, 0x0221101f}),
7716 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7719 {0x21, 0x04211020}),
7720 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7723 {0x21, 0x03211020}),
7724 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7727 {0x21, 0x03211020}),
7728 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7731 {0x21, 0x04211020}),
7732 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7735 {0x21, 0x03211020}),
7736 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7740 {0x21, 0x04211020}),
7741 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
7745 {0x1a, 0x04a11020}),
7746 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
7752 {0x1b, 0x02011020}),
7753 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7754 ALC282_STANDARD_PINS,
7757 {0x21, 0x0321101f}),
7758 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7759 ALC282_STANDARD_PINS,
7762 {0x21, 0x03211040}),
7763 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7764 ALC282_STANDARD_PINS,
7767 {0x21, 0x03211020}),
7768 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7769 ALC282_STANDARD_PINS,
7772 {0x21, 0x0421101f}),
7773 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
7774 ALC282_STANDARD_PINS,
7777 {0x21, 0x04211020}),
7778 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7779 ALC282_STANDARD_PINS,
7781 {0x21, 0x0321101f}),
7782 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7785 {0x21, 0x02211030}),
7786 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7787 ALC282_STANDARD_PINS,
7790 {0x21, 0x0321101f}),
7791 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7795 {0x21, 0x04211020}),
7796 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7799 {0x21, 0x02211020}),
7800 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7803 {0x21, 0x0321101f}),
7804 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7807 {0x21, 0x04211020}),
7808 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7809 ALC290_STANDARD_PINS,
7812 {0x1a, 0x04a11020}),
7813 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7814 ALC290_STANDARD_PINS,
7817 {0x1a, 0x04a11020}),
7818 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7819 ALC290_STANDARD_PINS,
7821 {0x1a, 0x04a11020}),
7822 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7823 ALC290_STANDARD_PINS,
7825 {0x1a, 0x04a11040}),
7826 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7827 ALC290_STANDARD_PINS,
7830 {0x1a, 0x04a11040}),
7831 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7832 ALC290_STANDARD_PINS,
7835 {0x1a, 0x04a11020}),
7836 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7837 ALC290_STANDARD_PINS,
7840 {0x1a, 0x04a11020}),
7841 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7842 ALC292_STANDARD_PINS,
7845 {0x19, 0x01a19030}),
7846 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7847 ALC292_STANDARD_PINS,
7851 {0x19, 0x01a1903e}),
7852 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7853 ALC292_STANDARD_PINS,
7854 {0x12, 0x90a60140}),
7855 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7856 ALC292_STANDARD_PINS,
7859 {0x19, 0x21a19030}),
7860 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7861 ALC292_STANDARD_PINS,
7862 {0x13, 0x90a60140}),
7863 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
7865 {0x21, 0x04211020}),
7866 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
7869 {0x21, 0x04211020}),
7870 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7873 {0x21, 0x03211020}),
7874 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7877 {0x21, 0x04211020}),
7878 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7881 {0x21, 0x03211020}),
7882 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7884 {0x21, 0x04211020}),
7885 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7887 {0x21, 0x04211030}),
7888 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7889 ALC295_STANDARD_PINS,
7891 {0x18, 0x21a19030}),
7892 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7893 ALC295_STANDARD_PINS,
7895 {0x18, 0x21a19050}),
7896 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7897 ALC295_STANDARD_PINS),
7898 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7899 ALC298_STANDARD_PINS,
7900 {0x17, 0x90170110}),
7901 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7902 ALC298_STANDARD_PINS,
7903 {0x17, 0x90170140}),
7904 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7905 ALC298_STANDARD_PINS,
7906 {0x17, 0x90170150}),
7907 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
7912 {0x21, 0x03211030}),
7913 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7914 ALC225_STANDARD_PINS,
7916 {0x17, 0x90170110}),
7917 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
7922 {0x21, 0x0221101f}),
7926 static void alc269_fill_coef(struct hda_codec *codec)
7928 struct alc_spec *spec = codec->spec;
7931 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
7934 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
7935 alc_write_coef_idx(codec, 0xf, 0x960b);
7936 alc_write_coef_idx(codec, 0xe, 0x8817);
7939 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
7940 alc_write_coef_idx(codec, 0xf, 0x960b);
7941 alc_write_coef_idx(codec, 0xe, 0x8814);
7944 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
7945 /* Power up output pin */
7946 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
7949 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
7950 val = alc_read_coef_idx(codec, 0xd);
7951 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
7952 /* Capless ramp up clock control */
7953 alc_write_coef_idx(codec, 0xd, val | (1<<10));
7955 val = alc_read_coef_idx(codec, 0x17);
7956 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
7957 /* Class D power on reset */
7958 alc_write_coef_idx(codec, 0x17, val | (1<<7));
7963 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
7968 static int patch_alc269(struct hda_codec *codec)
7970 struct alc_spec *spec;
7973 err = alc_alloc_spec(codec, 0x0b);
7978 spec->gen.shared_mic_vref_pin = 0x18;
7979 codec->power_save_node = 0;
7982 codec->patch_ops.suspend = alc269_suspend;
7983 codec->patch_ops.resume = alc269_resume;
7985 spec->shutup = alc_default_shutup;
7986 spec->init_hook = alc_default_init;
7988 switch (codec->core.vendor_id) {
7990 spec->codec_variant = ALC269_TYPE_ALC269VA;
7991 switch (alc_get_coef0(codec) & 0x00f0) {
7993 if (codec->bus->pci &&
7994 codec->bus->pci->subsystem_vendor == 0x1025 &&
7995 spec->cdefine.platform_type == 1)
7996 err = alc_codec_rename(codec, "ALC271X");
7997 spec->codec_variant = ALC269_TYPE_ALC269VB;
8000 if (codec->bus->pci &&
8001 codec->bus->pci->subsystem_vendor == 0x17aa &&
8002 codec->bus->pci->subsystem_device == 0x21f3)
8003 err = alc_codec_rename(codec, "ALC3202");
8004 spec->codec_variant = ALC269_TYPE_ALC269VC;
8007 spec->codec_variant = ALC269_TYPE_ALC269VD;
8010 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8014 spec->shutup = alc269_shutup;
8015 spec->init_hook = alc269_fill_coef;
8016 alc269_fill_coef(codec);
8021 spec->codec_variant = ALC269_TYPE_ALC280;
8024 spec->codec_variant = ALC269_TYPE_ALC282;
8025 spec->shutup = alc282_shutup;
8026 spec->init_hook = alc282_init;
8030 spec->codec_variant = ALC269_TYPE_ALC283;
8031 spec->shutup = alc283_shutup;
8032 spec->init_hook = alc283_init;
8036 spec->codec_variant = ALC269_TYPE_ALC284;
8039 spec->codec_variant = ALC269_TYPE_ALC293;
8043 spec->codec_variant = ALC269_TYPE_ALC286;
8046 spec->codec_variant = ALC269_TYPE_ALC298;
8050 spec->codec_variant = ALC269_TYPE_ALC255;
8051 spec->shutup = alc256_shutup;
8052 spec->init_hook = alc256_init;
8056 spec->codec_variant = ALC269_TYPE_ALC256;
8057 spec->shutup = alc256_shutup;
8058 spec->init_hook = alc256_init;
8059 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
8062 spec->codec_variant = ALC269_TYPE_ALC257;
8063 spec->shutup = alc256_shutup;
8064 spec->init_hook = alc256_init;
8065 spec->gen.mixer_nid = 0;
8072 spec->codec_variant = ALC269_TYPE_ALC215;
8073 spec->shutup = alc225_shutup;
8074 spec->init_hook = alc225_init;
8075 spec->gen.mixer_nid = 0;
8080 spec->codec_variant = ALC269_TYPE_ALC225;
8081 spec->shutup = alc225_shutup;
8082 spec->init_hook = alc225_init;
8083 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
8088 spec->codec_variant = ALC269_TYPE_ALC294;
8089 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
8090 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
8091 spec->init_hook = alc294_init;
8094 spec->codec_variant = ALC269_TYPE_ALC300;
8095 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
8098 spec->codec_variant = ALC269_TYPE_ALC623;
8104 spec->codec_variant = ALC269_TYPE_ALC700;
8105 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
8106 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
8107 spec->init_hook = alc294_init;
8112 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
8113 spec->has_alc5505_dsp = 1;
8114 spec->init_hook = alc5505_dsp_init;
8117 snd_hda_pick_fixup(codec, alc269_fixup_models,
8118 alc269_fixup_tbl, alc269_fixups);
8119 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
8120 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
8122 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8124 alc_auto_parse_customize_define(codec);
8126 if (has_cdefine_beep(codec))
8127 spec->gen.beep_nid = 0x01;
8129 /* automatic parse from the BIOS config */
8130 err = alc269_parse_auto_config(codec);
8134 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
8135 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
8140 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8153 static int alc861_parse_auto_config(struct hda_codec *codec)
8155 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
8156 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
8157 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
8160 /* Pin config fixes */
8162 ALC861_FIXUP_FSC_AMILO_PI1505,
8163 ALC861_FIXUP_AMP_VREF_0F,
8164 ALC861_FIXUP_NO_JACK_DETECT,
8165 ALC861_FIXUP_ASUS_A6RP,
8166 ALC660_FIXUP_ASUS_W7J,
8169 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
8170 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
8171 const struct hda_fixup *fix, int action)
8173 struct alc_spec *spec = codec->spec;
8176 if (action != HDA_FIXUP_ACT_INIT)
8178 val = snd_hda_codec_get_pin_target(codec, 0x0f);
8179 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
8180 val |= AC_PINCTL_IN_EN;
8181 val |= AC_PINCTL_VREF_50;
8182 snd_hda_set_pin_ctl(codec, 0x0f, val);
8183 spec->gen.keep_vref_in_automute = 1;
8186 /* suppress the jack-detection */
8187 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
8188 const struct hda_fixup *fix, int action)
8190 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8191 codec->no_jack_detect = 1;
8194 static const struct hda_fixup alc861_fixups[] = {
8195 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
8196 .type = HDA_FIXUP_PINS,
8197 .v.pins = (const struct hda_pintbl[]) {
8198 { 0x0b, 0x0221101f }, /* HP */
8199 { 0x0f, 0x90170310 }, /* speaker */
8203 [ALC861_FIXUP_AMP_VREF_0F] = {
8204 .type = HDA_FIXUP_FUNC,
8205 .v.func = alc861_fixup_asus_amp_vref_0f,
8207 [ALC861_FIXUP_NO_JACK_DETECT] = {
8208 .type = HDA_FIXUP_FUNC,
8209 .v.func = alc_fixup_no_jack_detect,
8211 [ALC861_FIXUP_ASUS_A6RP] = {
8212 .type = HDA_FIXUP_FUNC,
8213 .v.func = alc861_fixup_asus_amp_vref_0f,
8215 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
8217 [ALC660_FIXUP_ASUS_W7J] = {
8218 .type = HDA_FIXUP_VERBS,
8219 .v.verbs = (const struct hda_verb[]) {
8220 /* ASUS W7J needs a magic pin setup on unused NID 0x10
8221 * for enabling outputs
8223 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
8229 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
8230 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
8231 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
8232 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
8233 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
8234 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
8235 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
8236 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
8242 static int patch_alc861(struct hda_codec *codec)
8244 struct alc_spec *spec;
8247 err = alc_alloc_spec(codec, 0x15);
8252 spec->gen.beep_nid = 0x23;
8255 spec->power_hook = alc_power_eapd;
8258 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
8259 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8261 /* automatic parse from the BIOS config */
8262 err = alc861_parse_auto_config(codec);
8266 if (!spec->gen.no_analog) {
8267 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
8272 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8286 * In addition, an independent DAC
8288 static int alc861vd_parse_auto_config(struct hda_codec *codec)
8290 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
8291 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8292 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
8296 ALC660VD_FIX_ASUS_GPIO1,
8297 ALC861VD_FIX_DALLAS,
8300 /* exclude VREF80 */
8301 static void alc861vd_fixup_dallas(struct hda_codec *codec,
8302 const struct hda_fixup *fix, int action)
8304 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8305 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
8306 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8311 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
8312 const struct hda_fixup *fix, int action)
8314 struct alc_spec *spec = codec->spec;
8316 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8317 spec->gpio_mask |= 0x02;
8318 alc_fixup_gpio(codec, action, 0x01);
8321 static const struct hda_fixup alc861vd_fixups[] = {
8322 [ALC660VD_FIX_ASUS_GPIO1] = {
8323 .type = HDA_FIXUP_FUNC,
8324 .v.func = alc660vd_fixup_asus_gpio1,
8326 [ALC861VD_FIX_DALLAS] = {
8327 .type = HDA_FIXUP_FUNC,
8328 .v.func = alc861vd_fixup_dallas,
8332 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8333 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
8334 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8335 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
8341 static int patch_alc861vd(struct hda_codec *codec)
8343 struct alc_spec *spec;
8346 err = alc_alloc_spec(codec, 0x0b);
8351 spec->gen.beep_nid = 0x23;
8353 spec->shutup = alc_eapd_shutup;
8355 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
8356 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8358 /* automatic parse from the BIOS config */
8359 err = alc861vd_parse_auto_config(codec);
8363 if (!spec->gen.no_analog) {
8364 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
8369 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8381 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8382 * configuration. Each pin widget can choose any input DACs and a mixer.
8383 * Each ADC is connected from a mixer of all inputs. This makes possible
8384 * 6-channel independent captures.
8386 * In addition, an independent DAC for the multi-playback (not used in this
8391 * BIOS auto configuration
8394 static int alc662_parse_auto_config(struct hda_codec *codec)
8396 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
8397 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
8398 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8399 const hda_nid_t *ssids;
8401 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
8402 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
8403 codec->core.vendor_id == 0x10ec0671)
8404 ssids = alc663_ssids;
8406 ssids = alc662_ssids;
8407 return alc_parse_auto_config(codec, alc662_ignore, ssids);
8410 static void alc272_fixup_mario(struct hda_codec *codec,
8411 const struct hda_fixup *fix, int action)
8413 if (action != HDA_FIXUP_ACT_PRE_PROBE)
8415 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
8416 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
8417 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
8418 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
8419 (0 << AC_AMPCAP_MUTE_SHIFT)))
8420 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
8423 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
8425 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
8427 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
8428 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
8432 /* override the 2.1 chmap */
8433 static void alc_fixup_bass_chmap(struct hda_codec *codec,
8434 const struct hda_fixup *fix, int action)
8436 if (action == HDA_FIXUP_ACT_BUILD) {
8437 struct alc_spec *spec = codec->spec;
8438 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8442 /* avoid D3 for keeping GPIO up */
8443 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
8445 unsigned int power_state)
8447 struct alc_spec *spec = codec->spec;
8448 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
8453 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
8454 const struct hda_fixup *fix, int action)
8456 struct alc_spec *spec = codec->spec;
8458 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
8459 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8460 spec->mute_led_polarity = 1;
8461 codec->power_filter = gpio_led_power_filter;
8465 static void alc662_usi_automute_hook(struct hda_codec *codec,
8466 struct hda_jack_callback *jack)
8468 struct alc_spec *spec = codec->spec;
8471 snd_hda_gen_hp_automute(codec, jack);
8473 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
8475 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
8479 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
8480 const struct hda_fixup *fix, int action)
8482 struct alc_spec *spec = codec->spec;
8483 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8484 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8485 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
8489 static struct coef_fw alc668_coefs[] = {
8490 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
8491 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
8492 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
8493 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
8494 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
8495 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
8496 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
8497 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
8498 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
8499 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
8500 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
8501 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8502 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8503 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8504 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8505 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8506 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8507 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8508 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8509 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8513 static void alc668_restore_default_value(struct hda_codec *codec)
8515 alc_process_coef_fw(codec, alc668_coefs);
8519 ALC662_FIXUP_ASPIRE,
8520 ALC662_FIXUP_LED_GPIO1,
8521 ALC662_FIXUP_IDEAPAD,
8523 ALC662_FIXUP_CZC_P10T,
8524 ALC662_FIXUP_SKU_IGNORE,
8525 ALC662_FIXUP_HP_RP5800,
8526 ALC662_FIXUP_ASUS_MODE1,
8527 ALC662_FIXUP_ASUS_MODE2,
8528 ALC662_FIXUP_ASUS_MODE3,
8529 ALC662_FIXUP_ASUS_MODE4,
8530 ALC662_FIXUP_ASUS_MODE5,
8531 ALC662_FIXUP_ASUS_MODE6,
8532 ALC662_FIXUP_ASUS_MODE7,
8533 ALC662_FIXUP_ASUS_MODE8,
8534 ALC662_FIXUP_NO_JACK_DETECT,
8535 ALC662_FIXUP_ZOTAC_Z68,
8536 ALC662_FIXUP_INV_DMIC,
8537 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8538 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
8539 ALC662_FIXUP_HEADSET_MODE,
8540 ALC668_FIXUP_HEADSET_MODE,
8541 ALC662_FIXUP_BASS_MODE4_CHMAP,
8542 ALC662_FIXUP_BASS_16,
8543 ALC662_FIXUP_BASS_1A,
8544 ALC662_FIXUP_BASS_CHMAP,
8545 ALC668_FIXUP_AUTO_MUTE,
8546 ALC668_FIXUP_DELL_DISABLE_AAMIX,
8547 ALC668_FIXUP_DELL_XPS13,
8548 ALC662_FIXUP_ASUS_Nx50,
8549 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8550 ALC668_FIXUP_ASUS_Nx51,
8551 ALC668_FIXUP_MIC_COEF,
8552 ALC668_FIXUP_ASUS_G751,
8553 ALC891_FIXUP_HEADSET_MODE,
8554 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8555 ALC662_FIXUP_ACER_VERITON,
8556 ALC892_FIXUP_ASROCK_MOBO,
8557 ALC662_FIXUP_USI_FUNC,
8558 ALC662_FIXUP_USI_HEADSET_MODE,
8559 ALC662_FIXUP_LENOVO_MULTI_CODECS,
8562 static const struct hda_fixup alc662_fixups[] = {
8563 [ALC662_FIXUP_ASPIRE] = {
8564 .type = HDA_FIXUP_PINS,
8565 .v.pins = (const struct hda_pintbl[]) {
8566 { 0x15, 0x99130112 }, /* subwoofer */
8570 [ALC662_FIXUP_LED_GPIO1] = {
8571 .type = HDA_FIXUP_FUNC,
8572 .v.func = alc662_fixup_led_gpio1,
8574 [ALC662_FIXUP_IDEAPAD] = {
8575 .type = HDA_FIXUP_PINS,
8576 .v.pins = (const struct hda_pintbl[]) {
8577 { 0x17, 0x99130112 }, /* subwoofer */
8581 .chain_id = ALC662_FIXUP_LED_GPIO1,
8583 [ALC272_FIXUP_MARIO] = {
8584 .type = HDA_FIXUP_FUNC,
8585 .v.func = alc272_fixup_mario,
8587 [ALC662_FIXUP_CZC_P10T] = {
8588 .type = HDA_FIXUP_VERBS,
8589 .v.verbs = (const struct hda_verb[]) {
8590 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
8594 [ALC662_FIXUP_SKU_IGNORE] = {
8595 .type = HDA_FIXUP_FUNC,
8596 .v.func = alc_fixup_sku_ignore,
8598 [ALC662_FIXUP_HP_RP5800] = {
8599 .type = HDA_FIXUP_PINS,
8600 .v.pins = (const struct hda_pintbl[]) {
8601 { 0x14, 0x0221201f }, /* HP out */
8605 .chain_id = ALC662_FIXUP_SKU_IGNORE
8607 [ALC662_FIXUP_ASUS_MODE1] = {
8608 .type = HDA_FIXUP_PINS,
8609 .v.pins = (const struct hda_pintbl[]) {
8610 { 0x14, 0x99130110 }, /* speaker */
8611 { 0x18, 0x01a19c20 }, /* mic */
8612 { 0x19, 0x99a3092f }, /* int-mic */
8613 { 0x21, 0x0121401f }, /* HP out */
8617 .chain_id = ALC662_FIXUP_SKU_IGNORE
8619 [ALC662_FIXUP_ASUS_MODE2] = {
8620 .type = HDA_FIXUP_PINS,
8621 .v.pins = (const struct hda_pintbl[]) {
8622 { 0x14, 0x99130110 }, /* speaker */
8623 { 0x18, 0x01a19820 }, /* mic */
8624 { 0x19, 0x99a3092f }, /* int-mic */
8625 { 0x1b, 0x0121401f }, /* HP out */
8629 .chain_id = ALC662_FIXUP_SKU_IGNORE
8631 [ALC662_FIXUP_ASUS_MODE3] = {
8632 .type = HDA_FIXUP_PINS,
8633 .v.pins = (const struct hda_pintbl[]) {
8634 { 0x14, 0x99130110 }, /* speaker */
8635 { 0x15, 0x0121441f }, /* HP */
8636 { 0x18, 0x01a19840 }, /* mic */
8637 { 0x19, 0x99a3094f }, /* int-mic */
8638 { 0x21, 0x01211420 }, /* HP2 */
8642 .chain_id = ALC662_FIXUP_SKU_IGNORE
8644 [ALC662_FIXUP_ASUS_MODE4] = {
8645 .type = HDA_FIXUP_PINS,
8646 .v.pins = (const struct hda_pintbl[]) {
8647 { 0x14, 0x99130110 }, /* speaker */
8648 { 0x16, 0x99130111 }, /* speaker */
8649 { 0x18, 0x01a19840 }, /* mic */
8650 { 0x19, 0x99a3094f }, /* int-mic */
8651 { 0x21, 0x0121441f }, /* HP */
8655 .chain_id = ALC662_FIXUP_SKU_IGNORE
8657 [ALC662_FIXUP_ASUS_MODE5] = {
8658 .type = HDA_FIXUP_PINS,
8659 .v.pins = (const struct hda_pintbl[]) {
8660 { 0x14, 0x99130110 }, /* speaker */
8661 { 0x15, 0x0121441f }, /* HP */
8662 { 0x16, 0x99130111 }, /* speaker */
8663 { 0x18, 0x01a19840 }, /* mic */
8664 { 0x19, 0x99a3094f }, /* int-mic */
8668 .chain_id = ALC662_FIXUP_SKU_IGNORE
8670 [ALC662_FIXUP_ASUS_MODE6] = {
8671 .type = HDA_FIXUP_PINS,
8672 .v.pins = (const struct hda_pintbl[]) {
8673 { 0x14, 0x99130110 }, /* speaker */
8674 { 0x15, 0x01211420 }, /* HP2 */
8675 { 0x18, 0x01a19840 }, /* mic */
8676 { 0x19, 0x99a3094f }, /* int-mic */
8677 { 0x1b, 0x0121441f }, /* HP */
8681 .chain_id = ALC662_FIXUP_SKU_IGNORE
8683 [ALC662_FIXUP_ASUS_MODE7] = {
8684 .type = HDA_FIXUP_PINS,
8685 .v.pins = (const struct hda_pintbl[]) {
8686 { 0x14, 0x99130110 }, /* speaker */
8687 { 0x17, 0x99130111 }, /* speaker */
8688 { 0x18, 0x01a19840 }, /* mic */
8689 { 0x19, 0x99a3094f }, /* int-mic */
8690 { 0x1b, 0x01214020 }, /* HP */
8691 { 0x21, 0x0121401f }, /* HP */
8695 .chain_id = ALC662_FIXUP_SKU_IGNORE
8697 [ALC662_FIXUP_ASUS_MODE8] = {
8698 .type = HDA_FIXUP_PINS,
8699 .v.pins = (const struct hda_pintbl[]) {
8700 { 0x14, 0x99130110 }, /* speaker */
8701 { 0x12, 0x99a30970 }, /* int-mic */
8702 { 0x15, 0x01214020 }, /* HP */
8703 { 0x17, 0x99130111 }, /* speaker */
8704 { 0x18, 0x01a19840 }, /* mic */
8705 { 0x21, 0x0121401f }, /* HP */
8709 .chain_id = ALC662_FIXUP_SKU_IGNORE
8711 [ALC662_FIXUP_NO_JACK_DETECT] = {
8712 .type = HDA_FIXUP_FUNC,
8713 .v.func = alc_fixup_no_jack_detect,
8715 [ALC662_FIXUP_ZOTAC_Z68] = {
8716 .type = HDA_FIXUP_PINS,
8717 .v.pins = (const struct hda_pintbl[]) {
8718 { 0x1b, 0x02214020 }, /* Front HP */
8722 [ALC662_FIXUP_INV_DMIC] = {
8723 .type = HDA_FIXUP_FUNC,
8724 .v.func = alc_fixup_inv_dmic,
8726 [ALC668_FIXUP_DELL_XPS13] = {
8727 .type = HDA_FIXUP_FUNC,
8728 .v.func = alc_fixup_dell_xps13,
8730 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
8732 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
8733 .type = HDA_FIXUP_FUNC,
8734 .v.func = alc_fixup_disable_aamix,
8736 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8738 [ALC668_FIXUP_AUTO_MUTE] = {
8739 .type = HDA_FIXUP_FUNC,
8740 .v.func = alc_fixup_auto_mute_via_amp,
8742 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8744 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
8745 .type = HDA_FIXUP_PINS,
8746 .v.pins = (const struct hda_pintbl[]) {
8747 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8748 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8752 .chain_id = ALC662_FIXUP_HEADSET_MODE
8754 [ALC662_FIXUP_HEADSET_MODE] = {
8755 .type = HDA_FIXUP_FUNC,
8756 .v.func = alc_fixup_headset_mode_alc662,
8758 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
8759 .type = HDA_FIXUP_PINS,
8760 .v.pins = (const struct hda_pintbl[]) {
8761 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8762 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8766 .chain_id = ALC668_FIXUP_HEADSET_MODE
8768 [ALC668_FIXUP_HEADSET_MODE] = {
8769 .type = HDA_FIXUP_FUNC,
8770 .v.func = alc_fixup_headset_mode_alc668,
8772 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8773 .type = HDA_FIXUP_FUNC,
8774 .v.func = alc_fixup_bass_chmap,
8776 .chain_id = ALC662_FIXUP_ASUS_MODE4
8778 [ALC662_FIXUP_BASS_16] = {
8779 .type = HDA_FIXUP_PINS,
8780 .v.pins = (const struct hda_pintbl[]) {
8781 {0x16, 0x80106111}, /* bass speaker */
8785 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8787 [ALC662_FIXUP_BASS_1A] = {
8788 .type = HDA_FIXUP_PINS,
8789 .v.pins = (const struct hda_pintbl[]) {
8790 {0x1a, 0x80106111}, /* bass speaker */
8794 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8796 [ALC662_FIXUP_BASS_CHMAP] = {
8797 .type = HDA_FIXUP_FUNC,
8798 .v.func = alc_fixup_bass_chmap,
8800 [ALC662_FIXUP_ASUS_Nx50] = {
8801 .type = HDA_FIXUP_FUNC,
8802 .v.func = alc_fixup_auto_mute_via_amp,
8804 .chain_id = ALC662_FIXUP_BASS_1A
8806 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
8807 .type = HDA_FIXUP_FUNC,
8808 .v.func = alc_fixup_headset_mode_alc668,
8809 .chain_id = ALC662_FIXUP_BASS_CHMAP
8811 [ALC668_FIXUP_ASUS_Nx51] = {
8812 .type = HDA_FIXUP_PINS,
8813 .v.pins = (const struct hda_pintbl[]) {
8814 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8815 { 0x1a, 0x90170151 }, /* bass speaker */
8816 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8820 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8822 [ALC668_FIXUP_MIC_COEF] = {
8823 .type = HDA_FIXUP_VERBS,
8824 .v.verbs = (const struct hda_verb[]) {
8825 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
8826 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
8830 [ALC668_FIXUP_ASUS_G751] = {
8831 .type = HDA_FIXUP_PINS,
8832 .v.pins = (const struct hda_pintbl[]) {
8833 { 0x16, 0x0421101f }, /* HP */
8837 .chain_id = ALC668_FIXUP_MIC_COEF
8839 [ALC891_FIXUP_HEADSET_MODE] = {
8840 .type = HDA_FIXUP_FUNC,
8841 .v.func = alc_fixup_headset_mode,
8843 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
8844 .type = HDA_FIXUP_PINS,
8845 .v.pins = (const struct hda_pintbl[]) {
8846 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8847 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8851 .chain_id = ALC891_FIXUP_HEADSET_MODE
8853 [ALC662_FIXUP_ACER_VERITON] = {
8854 .type = HDA_FIXUP_PINS,
8855 .v.pins = (const struct hda_pintbl[]) {
8856 { 0x15, 0x50170120 }, /* no internal speaker */
8860 [ALC892_FIXUP_ASROCK_MOBO] = {
8861 .type = HDA_FIXUP_PINS,
8862 .v.pins = (const struct hda_pintbl[]) {
8863 { 0x15, 0x40f000f0 }, /* disabled */
8864 { 0x16, 0x40f000f0 }, /* disabled */
8868 [ALC662_FIXUP_USI_FUNC] = {
8869 .type = HDA_FIXUP_FUNC,
8870 .v.func = alc662_fixup_usi_headset_mic,
8872 [ALC662_FIXUP_USI_HEADSET_MODE] = {
8873 .type = HDA_FIXUP_PINS,
8874 .v.pins = (const struct hda_pintbl[]) {
8875 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8876 { 0x18, 0x01a1903d },
8880 .chain_id = ALC662_FIXUP_USI_FUNC
8882 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
8883 .type = HDA_FIXUP_FUNC,
8884 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8888 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
8889 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
8890 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
8891 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
8892 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
8893 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
8894 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
8895 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
8896 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
8897 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8898 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8899 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
8900 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
8901 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
8902 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8903 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8904 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8905 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8906 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8907 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
8908 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
8909 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
8910 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8911 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
8912 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
8913 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
8914 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
8915 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
8916 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
8917 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
8918 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8919 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
8920 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
8921 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
8922 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
8923 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
8924 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
8925 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
8926 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
8927 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
8928 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
8929 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
8930 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
8933 /* Below is a quirk table taken from the old code.
8934 * Basically the device should work as is without the fixup table.
8935 * If BIOS doesn't give a proper info, enable the corresponding
8938 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
8939 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
8940 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
8941 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
8942 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8943 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8944 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8945 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
8946 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
8947 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8948 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
8949 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
8950 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
8951 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
8952 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
8953 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8954 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
8955 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
8956 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8957 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8958 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8959 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8960 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
8961 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
8962 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
8963 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8964 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
8965 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8966 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8967 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
8968 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8969 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8970 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
8971 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
8972 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
8973 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
8974 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
8975 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
8976 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
8977 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8978 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
8979 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
8980 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8981 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
8982 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
8983 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
8984 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
8985 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
8986 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8987 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
8992 static const struct hda_model_fixup alc662_fixup_models[] = {
8993 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
8994 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
8995 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
8996 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
8997 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
8998 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
8999 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
9000 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
9001 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
9002 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
9003 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
9004 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
9005 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
9006 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
9007 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
9008 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9009 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
9010 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
9011 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
9012 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
9013 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
9014 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
9015 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
9016 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
9017 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
9018 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
9019 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
9020 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
9021 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
9022 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9026 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
9027 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9031 {0x21, 0x01014020}),
9032 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9036 {0x21, 0x01014020}),
9037 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9041 {0x1b, 0x0221401f}),
9042 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9046 {0x16, 0x03011020}),
9047 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9051 {0x16, 0x03011020}),
9052 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9056 {0x16, 0x03011020}),
9057 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9060 {0x16, 0x03011020}),
9061 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
9064 {0x15, 0x0321101f}),
9070 static int patch_alc662(struct hda_codec *codec)
9072 struct alc_spec *spec;
9075 err = alc_alloc_spec(codec, 0x0b);
9081 spec->shutup = alc_eapd_shutup;
9083 /* handle multiple HPs as is */
9084 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
9086 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9088 switch (codec->core.vendor_id) {
9090 spec->init_hook = alc668_restore_default_value;
9094 snd_hda_pick_fixup(codec, alc662_fixup_models,
9095 alc662_fixup_tbl, alc662_fixups);
9096 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
9097 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9099 alc_auto_parse_customize_define(codec);
9101 if (has_cdefine_beep(codec))
9102 spec->gen.beep_nid = 0x01;
9104 if ((alc_get_coef0(codec) & (1 << 14)) &&
9105 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
9106 spec->cdefine.platform_type == 1) {
9107 err = alc_codec_rename(codec, "ALC272X");
9112 /* automatic parse from the BIOS config */
9113 err = alc662_parse_auto_config(codec);
9117 if (!spec->gen.no_analog && spec->gen.beep_nid) {
9118 switch (codec->core.vendor_id) {
9120 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9126 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
9129 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
9136 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9149 static int alc680_parse_auto_config(struct hda_codec *codec)
9151 return alc_parse_auto_config(codec, NULL, NULL);
9156 static int patch_alc680(struct hda_codec *codec)
9160 /* ALC680 has no aa-loopback mixer */
9161 err = alc_alloc_spec(codec, 0);
9165 /* automatic parse from the BIOS config */
9166 err = alc680_parse_auto_config(codec);
9178 static const struct hda_device_id snd_hda_id_realtek[] = {
9179 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
9180 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
9181 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
9182 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
9183 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
9184 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
9185 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
9186 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
9187 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
9188 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
9189 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
9190 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
9191 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
9192 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
9193 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
9194 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
9195 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
9196 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
9197 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
9198 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
9199 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
9200 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
9201 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
9202 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
9203 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
9204 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
9205 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
9206 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
9207 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
9208 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
9209 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
9210 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
9211 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
9212 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
9213 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
9214 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
9215 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
9216 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
9217 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
9218 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
9219 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
9220 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
9221 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
9222 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
9223 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
9224 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
9225 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
9226 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
9227 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
9228 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
9229 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
9230 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
9231 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
9232 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
9233 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
9234 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
9235 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
9236 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
9237 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
9238 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
9239 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
9240 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
9241 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
9242 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
9243 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
9244 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
9245 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
9246 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
9247 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
9248 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
9249 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
9250 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
9251 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
9252 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
9253 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
9254 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
9255 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
9258 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
9260 MODULE_LICENSE("GPL");
9261 MODULE_DESCRIPTION("Realtek HD-audio codec");
9263 static struct hda_codec_driver realtek_driver = {
9264 .id = snd_hda_id_realtek,
9267 module_hda_codec_driver(realtek_driver);