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, 0x04);
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 const 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 const 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,
1919 ALCS1200A_FIXUP_MIC_VREF,
1920 ALC888VD_FIXUP_MIC_100VREF,
1923 static void alc889_fixup_coef(struct hda_codec *codec,
1924 const struct hda_fixup *fix, int action)
1926 if (action != HDA_FIXUP_ACT_INIT)
1928 alc_update_coef_idx(codec, 7, 0, 0x2030);
1931 /* set up GPIO at initialization */
1932 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1933 const struct hda_fixup *fix, int action)
1935 struct alc_spec *spec = codec->spec;
1937 spec->gpio_write_delay = true;
1938 alc_fixup_gpio3(codec, fix, action);
1941 /* Fix the connection of some pins for ALC889:
1942 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1943 * work correctly (bko#42740)
1945 static void alc889_fixup_dac_route(struct hda_codec *codec,
1946 const struct hda_fixup *fix, int action)
1948 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1949 /* fake the connections during parsing the tree */
1950 hda_nid_t conn1[2] = { 0x0c, 0x0d };
1951 hda_nid_t conn2[2] = { 0x0e, 0x0f };
1952 snd_hda_override_conn_list(codec, 0x14, 2, conn1);
1953 snd_hda_override_conn_list(codec, 0x15, 2, conn1);
1954 snd_hda_override_conn_list(codec, 0x18, 2, conn2);
1955 snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
1956 } else if (action == HDA_FIXUP_ACT_PROBE) {
1957 /* restore the connections */
1958 hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1959 snd_hda_override_conn_list(codec, 0x14, 5, conn);
1960 snd_hda_override_conn_list(codec, 0x15, 5, conn);
1961 snd_hda_override_conn_list(codec, 0x18, 5, conn);
1962 snd_hda_override_conn_list(codec, 0x1a, 5, conn);
1966 /* Set VREF on HP pin */
1967 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1968 const struct hda_fixup *fix, int action)
1970 struct alc_spec *spec = codec->spec;
1971 static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 };
1974 if (action != HDA_FIXUP_ACT_INIT)
1976 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1977 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1978 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1980 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1981 val |= AC_PINCTL_VREF_80;
1982 snd_hda_set_pin_ctl(codec, nids[i], val);
1983 spec->gen.keep_vref_in_automute = 1;
1988 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1989 const hda_nid_t *nids, int num_nids)
1991 struct alc_spec *spec = codec->spec;
1994 for (i = 0; i < num_nids; i++) {
1996 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1997 val |= AC_PINCTL_VREF_50;
1998 snd_hda_set_pin_ctl(codec, nids[i], val);
2000 spec->gen.keep_vref_in_automute = 1;
2003 /* Set VREF on speaker pins on imac91 */
2004 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2005 const struct hda_fixup *fix, int action)
2007 static hda_nid_t nids[2] = { 0x18, 0x1a };
2009 if (action == HDA_FIXUP_ACT_INIT)
2010 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2013 /* Set VREF on speaker pins on mba11 */
2014 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2015 const struct hda_fixup *fix, int action)
2017 static hda_nid_t nids[1] = { 0x18 };
2019 if (action == HDA_FIXUP_ACT_INIT)
2020 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2023 /* Set VREF on speaker pins on mba21 */
2024 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2025 const struct hda_fixup *fix, int action)
2027 static hda_nid_t nids[2] = { 0x18, 0x19 };
2029 if (action == HDA_FIXUP_ACT_INIT)
2030 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2033 /* Don't take HP output as primary
2034 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2035 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2037 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2038 const struct hda_fixup *fix, int action)
2040 struct alc_spec *spec = codec->spec;
2041 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2042 spec->gen.no_primary_hp = 1;
2043 spec->gen.no_multi_io = 1;
2047 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2048 const struct hda_fixup *fix, int action);
2050 /* For dual-codec configuration, we need to disable some features to avoid
2051 * conflicts of kctls and PCM streams
2053 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2054 const struct hda_fixup *fix, int action)
2056 struct alc_spec *spec = codec->spec;
2058 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2060 /* disable vmaster */
2061 spec->gen.suppress_vmaster = 1;
2062 /* auto-mute and auto-mic switch don't work with multiple codecs */
2063 spec->gen.suppress_auto_mute = 1;
2064 spec->gen.suppress_auto_mic = 1;
2065 /* disable aamix as well */
2066 spec->gen.mixer_nid = 0;
2067 /* add location prefix to avoid conflicts */
2068 codec->force_pin_prefix = 1;
2071 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2072 const char *newname)
2074 struct snd_kcontrol *kctl;
2076 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2078 strcpy(kctl->id.name, newname);
2081 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2082 const struct hda_fixup *fix,
2085 alc_fixup_dual_codecs(codec, fix, action);
2087 case HDA_FIXUP_ACT_PRE_PROBE:
2088 /* override card longname to provide a unique UCM profile */
2089 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2091 case HDA_FIXUP_ACT_BUILD:
2092 /* rename Capture controls depending on the codec */
2093 rename_ctl(codec, "Capture Volume",
2095 "Rear-Panel Capture Volume" :
2096 "Front-Panel Capture Volume");
2097 rename_ctl(codec, "Capture Switch",
2099 "Rear-Panel Capture Switch" :
2100 "Front-Panel Capture Switch");
2105 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2106 const struct hda_fixup *fix,
2109 static const hda_nid_t conn1[] = { 0x0c };
2110 static const struct coef_fw gb_x570_coefs[] = {
2111 WRITE_COEF(0x07, 0x03c0),
2112 WRITE_COEF(0x1a, 0x01c1),
2113 WRITE_COEF(0x1b, 0x0202),
2114 WRITE_COEF(0x43, 0x3005),
2119 case HDA_FIXUP_ACT_PRE_PROBE:
2120 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2121 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2123 case HDA_FIXUP_ACT_INIT:
2124 alc_process_coef_fw(codec, gb_x570_coefs);
2129 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2130 const struct hda_fixup *fix,
2133 hda_nid_t conn1[1] = { 0x0c };
2135 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2138 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2139 /* We therefore want to make sure 0x14 (front headphone) and
2140 * 0x1b (speakers) use the stereo DAC 0x02
2142 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
2143 snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
2146 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2147 const struct hda_fixup *fix, int action);
2149 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2150 const struct hda_fixup *fix,
2153 alc1220_fixup_clevo_p950(codec, fix, action);
2154 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2157 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2158 struct hda_jack_callback *jack)
2160 struct alc_spec *spec = codec->spec;
2163 snd_hda_gen_hp_automute(codec, jack);
2165 if (spec->gen.hp_jack_present)
2166 vref = AC_PINCTL_VREF_80;
2168 vref = AC_PINCTL_VREF_HIZ;
2169 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2172 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2173 const struct hda_fixup *fix, int action)
2175 struct alc_spec *spec = codec->spec;
2176 if (action != HDA_FIXUP_ACT_PROBE)
2178 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2179 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2182 static const struct hda_fixup alc882_fixups[] = {
2183 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2184 .type = HDA_FIXUP_PINS,
2185 .v.pins = (const struct hda_pintbl[]) {
2186 { 0x15, 0x01080104 }, /* side */
2187 { 0x16, 0x01011012 }, /* rear */
2188 { 0x17, 0x01016011 }, /* clfe */
2192 [ALC882_FIXUP_LENOVO_Y530] = {
2193 .type = HDA_FIXUP_PINS,
2194 .v.pins = (const struct hda_pintbl[]) {
2195 { 0x15, 0x99130112 }, /* rear int speakers */
2196 { 0x16, 0x99130111 }, /* subwoofer */
2200 [ALC882_FIXUP_PB_M5210] = {
2201 .type = HDA_FIXUP_PINCTLS,
2202 .v.pins = (const struct hda_pintbl[]) {
2203 { 0x19, PIN_VREF50 },
2207 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2208 .type = HDA_FIXUP_FUNC,
2209 .v.func = alc_fixup_sku_ignore,
2211 [ALC882_FIXUP_ASUS_W90V] = {
2212 .type = HDA_FIXUP_PINS,
2213 .v.pins = (const struct hda_pintbl[]) {
2214 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2218 [ALC889_FIXUP_CD] = {
2219 .type = HDA_FIXUP_PINS,
2220 .v.pins = (const struct hda_pintbl[]) {
2221 { 0x1c, 0x993301f0 }, /* CD */
2225 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2226 .type = HDA_FIXUP_PINS,
2227 .v.pins = (const struct hda_pintbl[]) {
2228 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2232 .chain_id = ALC889_FIXUP_CD,
2234 [ALC889_FIXUP_VAIO_TT] = {
2235 .type = HDA_FIXUP_PINS,
2236 .v.pins = (const struct hda_pintbl[]) {
2237 { 0x17, 0x90170111 }, /* hidden surround speaker */
2241 [ALC888_FIXUP_EEE1601] = {
2242 .type = HDA_FIXUP_VERBS,
2243 .v.verbs = (const struct hda_verb[]) {
2244 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2245 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2249 [ALC886_FIXUP_EAPD] = {
2250 .type = HDA_FIXUP_VERBS,
2251 .v.verbs = (const struct hda_verb[]) {
2252 /* change to EAPD mode */
2253 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2254 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2258 [ALC882_FIXUP_EAPD] = {
2259 .type = HDA_FIXUP_VERBS,
2260 .v.verbs = (const struct hda_verb[]) {
2261 /* change to EAPD mode */
2262 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2263 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2267 [ALC883_FIXUP_EAPD] = {
2268 .type = HDA_FIXUP_VERBS,
2269 .v.verbs = (const struct hda_verb[]) {
2270 /* change to EAPD mode */
2271 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2272 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2276 [ALC883_FIXUP_ACER_EAPD] = {
2277 .type = HDA_FIXUP_VERBS,
2278 .v.verbs = (const struct hda_verb[]) {
2279 /* eanable EAPD on Acer laptops */
2280 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2281 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2285 [ALC882_FIXUP_GPIO1] = {
2286 .type = HDA_FIXUP_FUNC,
2287 .v.func = alc_fixup_gpio1,
2289 [ALC882_FIXUP_GPIO2] = {
2290 .type = HDA_FIXUP_FUNC,
2291 .v.func = alc_fixup_gpio2,
2293 [ALC882_FIXUP_GPIO3] = {
2294 .type = HDA_FIXUP_FUNC,
2295 .v.func = alc_fixup_gpio3,
2297 [ALC882_FIXUP_ASUS_W2JC] = {
2298 .type = HDA_FIXUP_FUNC,
2299 .v.func = alc_fixup_gpio1,
2301 .chain_id = ALC882_FIXUP_EAPD,
2303 [ALC889_FIXUP_COEF] = {
2304 .type = HDA_FIXUP_FUNC,
2305 .v.func = alc889_fixup_coef,
2307 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2308 .type = HDA_FIXUP_PINS,
2309 .v.pins = (const struct hda_pintbl[]) {
2310 { 0x16, 0x99130111 }, /* CLFE speaker */
2311 { 0x17, 0x99130112 }, /* surround speaker */
2315 .chain_id = ALC882_FIXUP_GPIO1,
2317 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2318 .type = HDA_FIXUP_PINS,
2319 .v.pins = (const struct hda_pintbl[]) {
2320 { 0x16, 0x99130111 }, /* CLFE speaker */
2321 { 0x1b, 0x99130112 }, /* surround speaker */
2325 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2327 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2328 /* additional init verbs for Acer Aspire 8930G */
2329 .type = HDA_FIXUP_VERBS,
2330 .v.verbs = (const struct hda_verb[]) {
2331 /* Enable all DACs */
2332 /* DAC DISABLE/MUTE 1? */
2333 /* setting bits 1-5 disables DAC nids 0x02-0x06
2334 * apparently. Init=0x38 */
2335 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2336 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2337 /* DAC DISABLE/MUTE 2? */
2338 /* some bit here disables the other DACs.
2340 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2341 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2343 * This laptop has a stereo digital microphone.
2344 * The mics are only 1cm apart which makes the stereo
2345 * useless. However, either the mic or the ALC889
2346 * makes the signal become a difference/sum signal
2347 * instead of standard stereo, which is annoying.
2348 * So instead we flip this bit which makes the
2349 * codec replicate the sum signal to both channels,
2350 * turning it into a normal mono mic.
2352 /* DMIC_CONTROL? Init value = 0x0001 */
2353 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2354 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2355 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2356 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2360 .chain_id = ALC882_FIXUP_GPIO1,
2362 [ALC885_FIXUP_MACPRO_GPIO] = {
2363 .type = HDA_FIXUP_FUNC,
2364 .v.func = alc885_fixup_macpro_gpio,
2366 [ALC889_FIXUP_DAC_ROUTE] = {
2367 .type = HDA_FIXUP_FUNC,
2368 .v.func = alc889_fixup_dac_route,
2370 [ALC889_FIXUP_MBP_VREF] = {
2371 .type = HDA_FIXUP_FUNC,
2372 .v.func = alc889_fixup_mbp_vref,
2374 .chain_id = ALC882_FIXUP_GPIO1,
2376 [ALC889_FIXUP_IMAC91_VREF] = {
2377 .type = HDA_FIXUP_FUNC,
2378 .v.func = alc889_fixup_imac91_vref,
2380 .chain_id = ALC882_FIXUP_GPIO1,
2382 [ALC889_FIXUP_MBA11_VREF] = {
2383 .type = HDA_FIXUP_FUNC,
2384 .v.func = alc889_fixup_mba11_vref,
2386 .chain_id = ALC889_FIXUP_MBP_VREF,
2388 [ALC889_FIXUP_MBA21_VREF] = {
2389 .type = HDA_FIXUP_FUNC,
2390 .v.func = alc889_fixup_mba21_vref,
2392 .chain_id = ALC889_FIXUP_MBP_VREF,
2394 [ALC889_FIXUP_MP11_VREF] = {
2395 .type = HDA_FIXUP_FUNC,
2396 .v.func = alc889_fixup_mba11_vref,
2398 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2400 [ALC889_FIXUP_MP41_VREF] = {
2401 .type = HDA_FIXUP_FUNC,
2402 .v.func = alc889_fixup_mbp_vref,
2404 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2406 [ALC882_FIXUP_INV_DMIC] = {
2407 .type = HDA_FIXUP_FUNC,
2408 .v.func = alc_fixup_inv_dmic,
2410 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2411 .type = HDA_FIXUP_FUNC,
2412 .v.func = alc882_fixup_no_primary_hp,
2414 [ALC887_FIXUP_ASUS_BASS] = {
2415 .type = HDA_FIXUP_PINS,
2416 .v.pins = (const struct hda_pintbl[]) {
2417 {0x16, 0x99130130}, /* bass speaker */
2421 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2423 [ALC887_FIXUP_BASS_CHMAP] = {
2424 .type = HDA_FIXUP_FUNC,
2425 .v.func = alc_fixup_bass_chmap,
2427 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2428 .type = HDA_FIXUP_FUNC,
2429 .v.func = alc1220_fixup_gb_dual_codecs,
2431 [ALC1220_FIXUP_GB_X570] = {
2432 .type = HDA_FIXUP_FUNC,
2433 .v.func = alc1220_fixup_gb_x570,
2435 [ALC1220_FIXUP_CLEVO_P950] = {
2436 .type = HDA_FIXUP_FUNC,
2437 .v.func = alc1220_fixup_clevo_p950,
2439 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2440 .type = HDA_FIXUP_FUNC,
2441 .v.func = alc1220_fixup_clevo_pb51ed,
2443 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2444 .type = HDA_FIXUP_PINS,
2445 .v.pins = (const struct hda_pintbl[]) {
2446 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2450 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2452 [ALC887_FIXUP_ASUS_AUDIO] = {
2453 .type = HDA_FIXUP_PINS,
2454 .v.pins = (const struct hda_pintbl[]) {
2455 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2456 { 0x19, 0x22219420 },
2460 [ALC887_FIXUP_ASUS_HMIC] = {
2461 .type = HDA_FIXUP_FUNC,
2462 .v.func = alc887_fixup_asus_jack,
2464 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2466 [ALCS1200A_FIXUP_MIC_VREF] = {
2467 .type = HDA_FIXUP_PINCTLS,
2468 .v.pins = (const struct hda_pintbl[]) {
2469 { 0x18, PIN_VREF50 }, /* rear mic */
2470 { 0x19, PIN_VREF50 }, /* front mic */
2474 [ALC888VD_FIXUP_MIC_100VREF] = {
2475 .type = HDA_FIXUP_PINCTLS,
2476 .v.pins = (const struct hda_pintbl[]) {
2477 { 0x18, PIN_VREF100 }, /* headset mic */
2483 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2484 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2485 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2486 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2487 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2488 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2489 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2490 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2491 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2492 ALC882_FIXUP_ACER_ASPIRE_4930G),
2493 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2494 ALC882_FIXUP_ACER_ASPIRE_4930G),
2495 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2496 ALC882_FIXUP_ACER_ASPIRE_8930G),
2497 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2498 ALC882_FIXUP_ACER_ASPIRE_8930G),
2499 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2500 ALC882_FIXUP_ACER_ASPIRE_4930G),
2501 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2502 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2503 ALC882_FIXUP_ACER_ASPIRE_4930G),
2504 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2505 ALC882_FIXUP_ACER_ASPIRE_4930G),
2506 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2507 ALC882_FIXUP_ACER_ASPIRE_4930G),
2508 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2509 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2510 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2511 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2512 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2513 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2514 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2515 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2516 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2517 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2518 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2519 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2520 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2521 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2522 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2523 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2525 /* All Apple entries are in codec SSIDs */
2526 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2527 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2528 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2529 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2530 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2531 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2532 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2533 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2534 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2535 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2536 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2537 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2538 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2539 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2540 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2541 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2542 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2543 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2544 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2545 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2546 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2547 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2549 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2550 SND_PCI_QUIRK(0x10ec, 0x12d8, "iBase Elo Touch", ALC888VD_FIXUP_MIC_100VREF),
2551 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2552 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2553 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2554 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2555 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2556 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2557 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2558 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2559 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2560 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2561 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2562 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2563 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2564 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2565 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2566 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2567 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2568 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2569 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2570 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2571 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2572 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2573 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2574 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2575 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2576 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2577 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2578 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2579 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2580 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2581 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2582 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2583 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2584 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2585 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2586 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2587 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2588 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2589 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2590 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2591 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2592 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2593 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2594 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2595 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2596 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2597 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2598 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2599 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2603 static const struct hda_model_fixup alc882_fixup_models[] = {
2604 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2605 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2606 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2607 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2608 {.id = ALC889_FIXUP_CD, .name = "cd"},
2609 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2610 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2611 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2612 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2613 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2614 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2615 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2616 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2617 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2618 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2619 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2620 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2621 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2622 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2623 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2624 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2625 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2626 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2627 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2628 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2629 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2630 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2631 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2632 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2633 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2634 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2635 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2640 * BIOS auto configuration
2642 /* almost identical with ALC880 parser... */
2643 static int alc882_parse_auto_config(struct hda_codec *codec)
2645 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2646 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2647 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2652 static int patch_alc882(struct hda_codec *codec)
2654 struct alc_spec *spec;
2657 err = alc_alloc_spec(codec, 0x0b);
2663 switch (codec->core.vendor_id) {
2671 /* ALC883 and variants */
2672 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2676 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2678 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2680 alc_auto_parse_customize_define(codec);
2682 if (has_cdefine_beep(codec))
2683 spec->gen.beep_nid = 0x01;
2685 /* automatic parse from the BIOS config */
2686 err = alc882_parse_auto_config(codec);
2690 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2691 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2696 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2709 static int alc262_parse_auto_config(struct hda_codec *codec)
2711 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2712 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2713 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2720 ALC262_FIXUP_FSC_H270,
2721 ALC262_FIXUP_FSC_S7110,
2722 ALC262_FIXUP_HP_Z200,
2724 ALC262_FIXUP_LENOVO_3000,
2726 ALC262_FIXUP_BENQ_T31,
2727 ALC262_FIXUP_INV_DMIC,
2728 ALC262_FIXUP_INTEL_BAYLEYBAY,
2731 static const struct hda_fixup alc262_fixups[] = {
2732 [ALC262_FIXUP_FSC_H270] = {
2733 .type = HDA_FIXUP_PINS,
2734 .v.pins = (const struct hda_pintbl[]) {
2735 { 0x14, 0x99130110 }, /* speaker */
2736 { 0x15, 0x0221142f }, /* front HP */
2737 { 0x1b, 0x0121141f }, /* rear HP */
2741 [ALC262_FIXUP_FSC_S7110] = {
2742 .type = HDA_FIXUP_PINS,
2743 .v.pins = (const struct hda_pintbl[]) {
2744 { 0x15, 0x90170110 }, /* speaker */
2748 .chain_id = ALC262_FIXUP_BENQ,
2750 [ALC262_FIXUP_HP_Z200] = {
2751 .type = HDA_FIXUP_PINS,
2752 .v.pins = (const struct hda_pintbl[]) {
2753 { 0x16, 0x99130120 }, /* internal speaker */
2757 [ALC262_FIXUP_TYAN] = {
2758 .type = HDA_FIXUP_PINS,
2759 .v.pins = (const struct hda_pintbl[]) {
2760 { 0x14, 0x1993e1f0 }, /* int AUX */
2764 [ALC262_FIXUP_LENOVO_3000] = {
2765 .type = HDA_FIXUP_PINCTLS,
2766 .v.pins = (const struct hda_pintbl[]) {
2767 { 0x19, PIN_VREF50 },
2771 .chain_id = ALC262_FIXUP_BENQ,
2773 [ALC262_FIXUP_BENQ] = {
2774 .type = HDA_FIXUP_VERBS,
2775 .v.verbs = (const struct hda_verb[]) {
2776 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2777 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2781 [ALC262_FIXUP_BENQ_T31] = {
2782 .type = HDA_FIXUP_VERBS,
2783 .v.verbs = (const struct hda_verb[]) {
2784 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2785 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2789 [ALC262_FIXUP_INV_DMIC] = {
2790 .type = HDA_FIXUP_FUNC,
2791 .v.func = alc_fixup_inv_dmic,
2793 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2794 .type = HDA_FIXUP_FUNC,
2795 .v.func = alc_fixup_no_depop_delay,
2799 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2800 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2801 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2802 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2803 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2804 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2805 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2806 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2807 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2808 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2809 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2813 static const struct hda_model_fixup alc262_fixup_models[] = {
2814 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2815 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2816 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2817 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2818 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2819 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2820 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2821 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2822 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2828 static int patch_alc262(struct hda_codec *codec)
2830 struct alc_spec *spec;
2833 err = alc_alloc_spec(codec, 0x0b);
2838 spec->gen.shared_mic_vref_pin = 0x18;
2840 spec->shutup = alc_eapd_shutup;
2843 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2846 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2848 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2850 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2852 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2854 alc_auto_parse_customize_define(codec);
2856 if (has_cdefine_beep(codec))
2857 spec->gen.beep_nid = 0x01;
2859 /* automatic parse from the BIOS config */
2860 err = alc262_parse_auto_config(codec);
2864 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2865 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2870 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2882 /* bind Beep switches of both NID 0x0f and 0x10 */
2883 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2884 struct snd_ctl_elem_value *ucontrol)
2886 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2890 mutex_lock(&codec->control_mutex);
2891 pval = kcontrol->private_value;
2892 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2893 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2895 kcontrol->private_value = (pval & ~0xff) | 0x10;
2896 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2898 kcontrol->private_value = pval;
2899 mutex_unlock(&codec->control_mutex);
2903 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2904 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2906 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2907 .name = "Beep Playback Switch",
2908 .subdevice = HDA_SUBDEV_AMP_FLAG,
2909 .info = snd_hda_mixer_amp_switch_info,
2910 .get = snd_hda_mixer_amp_switch_get,
2911 .put = alc268_beep_switch_put,
2912 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2916 /* set PCBEEP vol = 0, mute connections */
2917 static const struct hda_verb alc268_beep_init_verbs[] = {
2918 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2919 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2920 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2925 ALC268_FIXUP_INV_DMIC,
2926 ALC268_FIXUP_HP_EAPD,
2930 static const struct hda_fixup alc268_fixups[] = {
2931 [ALC268_FIXUP_INV_DMIC] = {
2932 .type = HDA_FIXUP_FUNC,
2933 .v.func = alc_fixup_inv_dmic,
2935 [ALC268_FIXUP_HP_EAPD] = {
2936 .type = HDA_FIXUP_VERBS,
2937 .v.verbs = (const struct hda_verb[]) {
2938 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2942 [ALC268_FIXUP_SPDIF] = {
2943 .type = HDA_FIXUP_PINS,
2944 .v.pins = (const struct hda_pintbl[]) {
2945 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2951 static const struct hda_model_fixup alc268_fixup_models[] = {
2952 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2953 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2954 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2958 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2959 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2960 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2961 /* below is codec SSID since multiple Toshiba laptops have the
2962 * same PCI SSID 1179:ff00
2964 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2969 * BIOS auto configuration
2971 static int alc268_parse_auto_config(struct hda_codec *codec)
2973 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2974 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2979 static int patch_alc268(struct hda_codec *codec)
2981 struct alc_spec *spec;
2984 /* ALC268 has no aa-loopback mixer */
2985 err = alc_alloc_spec(codec, 0);
2990 spec->gen.beep_nid = 0x01;
2992 spec->shutup = alc_eapd_shutup;
2994 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2995 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2997 /* automatic parse from the BIOS config */
2998 err = alc268_parse_auto_config(codec);
3002 if (err > 0 && !spec->gen.no_analog &&
3003 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3004 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3005 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3006 &alc268_beep_mixer[i])) {
3011 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3012 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3013 /* override the amp caps for beep generator */
3014 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3015 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3016 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3017 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3018 (0 << AC_AMPCAP_MUTE_SHIFT));
3021 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3034 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3035 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3038 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3039 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3042 /* different alc269-variants */
3044 ALC269_TYPE_ALC269VA,
3045 ALC269_TYPE_ALC269VB,
3046 ALC269_TYPE_ALC269VC,
3047 ALC269_TYPE_ALC269VD,
3067 * BIOS auto configuration
3069 static int alc269_parse_auto_config(struct hda_codec *codec)
3071 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3072 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3073 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3074 struct alc_spec *spec = codec->spec;
3075 const hda_nid_t *ssids;
3077 switch (spec->codec_variant) {
3078 case ALC269_TYPE_ALC269VA:
3079 case ALC269_TYPE_ALC269VC:
3080 case ALC269_TYPE_ALC280:
3081 case ALC269_TYPE_ALC284:
3082 case ALC269_TYPE_ALC293:
3083 ssids = alc269va_ssids;
3085 case ALC269_TYPE_ALC269VB:
3086 case ALC269_TYPE_ALC269VD:
3087 case ALC269_TYPE_ALC282:
3088 case ALC269_TYPE_ALC283:
3089 case ALC269_TYPE_ALC286:
3090 case ALC269_TYPE_ALC298:
3091 case ALC269_TYPE_ALC255:
3092 case ALC269_TYPE_ALC256:
3093 case ALC269_TYPE_ALC257:
3094 case ALC269_TYPE_ALC215:
3095 case ALC269_TYPE_ALC225:
3096 case ALC269_TYPE_ALC294:
3097 case ALC269_TYPE_ALC300:
3098 case ALC269_TYPE_ALC623:
3099 case ALC269_TYPE_ALC700:
3100 ssids = alc269_ssids;
3103 ssids = alc269_ssids;
3107 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3110 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3112 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3115 static void alc269_shutup(struct hda_codec *codec)
3117 struct alc_spec *spec = codec->spec;
3119 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3120 alc269vb_toggle_power_output(codec, 0);
3121 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3122 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3125 alc_shutup_pins(codec);
3128 static const struct coef_fw alc282_coefs[] = {
3129 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3130 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3131 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3132 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3133 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3134 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3135 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3136 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3137 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3138 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3139 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3140 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3141 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3142 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3143 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3144 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3145 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3146 WRITE_COEF(0x63, 0x2902), /* PLL */
3147 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3148 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3149 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3150 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3151 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3152 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3153 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3154 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3155 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3156 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3157 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3161 static void alc282_restore_default_value(struct hda_codec *codec)
3163 alc_process_coef_fw(codec, alc282_coefs);
3166 static void alc282_init(struct hda_codec *codec)
3168 struct alc_spec *spec = codec->spec;
3169 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3173 alc282_restore_default_value(codec);
3177 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3178 coef78 = alc_read_coef_idx(codec, 0x78);
3180 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3181 /* Headphone capless set to high power mode */
3182 alc_write_coef_idx(codec, 0x78, 0x9004);
3187 snd_hda_codec_write(codec, hp_pin, 0,
3188 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3193 snd_hda_codec_write(codec, hp_pin, 0,
3194 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3199 /* Headphone capless set to normal mode */
3200 alc_write_coef_idx(codec, 0x78, coef78);
3203 static void alc282_shutup(struct hda_codec *codec)
3205 struct alc_spec *spec = codec->spec;
3206 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3211 alc269_shutup(codec);
3215 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3216 coef78 = alc_read_coef_idx(codec, 0x78);
3217 alc_write_coef_idx(codec, 0x78, 0x9004);
3222 snd_hda_codec_write(codec, hp_pin, 0,
3223 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3228 if (!spec->no_shutup_pins)
3229 snd_hda_codec_write(codec, hp_pin, 0,
3230 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3235 alc_auto_setup_eapd(codec, false);
3236 alc_shutup_pins(codec);
3237 alc_write_coef_idx(codec, 0x78, coef78);
3240 static const struct coef_fw alc283_coefs[] = {
3241 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3242 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3243 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3244 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3245 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3246 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3247 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3248 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3249 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3250 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3251 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3252 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3253 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3254 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3255 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3256 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3257 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3258 WRITE_COEF(0x2e, 0x2902), /* PLL */
3259 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3260 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3261 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3262 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3263 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3264 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3265 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3266 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3267 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3268 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3269 WRITE_COEF(0x49, 0x0), /* test mode */
3270 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3271 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3272 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3273 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3277 static void alc283_restore_default_value(struct hda_codec *codec)
3279 alc_process_coef_fw(codec, alc283_coefs);
3282 static void alc283_init(struct hda_codec *codec)
3284 struct alc_spec *spec = codec->spec;
3285 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3288 alc283_restore_default_value(codec);
3294 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3296 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3297 /* Headphone capless set to high power mode */
3298 alc_write_coef_idx(codec, 0x43, 0x9004);
3300 snd_hda_codec_write(codec, hp_pin, 0,
3301 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3306 snd_hda_codec_write(codec, hp_pin, 0,
3307 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3311 /* Index 0x46 Combo jack auto switch control 2 */
3312 /* 3k pull low control for Headset jack. */
3313 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3314 /* Headphone capless set to normal mode */
3315 alc_write_coef_idx(codec, 0x43, 0x9614);
3318 static void alc283_shutup(struct hda_codec *codec)
3320 struct alc_spec *spec = codec->spec;
3321 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3325 alc269_shutup(codec);
3329 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3331 alc_write_coef_idx(codec, 0x43, 0x9004);
3333 /*depop hp during suspend*/
3334 alc_write_coef_idx(codec, 0x06, 0x2100);
3336 snd_hda_codec_write(codec, hp_pin, 0,
3337 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3342 if (!spec->no_shutup_pins)
3343 snd_hda_codec_write(codec, hp_pin, 0,
3344 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3346 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3350 alc_auto_setup_eapd(codec, false);
3351 alc_shutup_pins(codec);
3352 alc_write_coef_idx(codec, 0x43, 0x9614);
3355 static void alc256_init(struct hda_codec *codec)
3357 struct alc_spec *spec = codec->spec;
3358 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3366 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3371 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3373 snd_hda_codec_write(codec, hp_pin, 0,
3374 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3379 snd_hda_codec_write(codec, hp_pin, 0,
3380 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3385 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3386 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3387 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3388 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3390 * Expose headphone mic (or possibly Line In on some machines) instead
3391 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3392 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3395 alc_write_coef_idx(codec, 0x36, 0x5757);
3398 static void alc256_shutup(struct hda_codec *codec)
3400 struct alc_spec *spec = codec->spec;
3401 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3405 alc269_shutup(codec);
3409 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3414 snd_hda_codec_write(codec, hp_pin, 0,
3415 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3420 /* 3k pull low control for Headset jack. */
3421 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3422 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3423 * when booting with headset plugged. So skip setting it for the codec alc257
3425 if (codec->core.vendor_id != 0x10ec0236 &&
3426 codec->core.vendor_id != 0x10ec0257)
3427 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3429 if (!spec->no_shutup_pins)
3430 snd_hda_codec_write(codec, hp_pin, 0,
3431 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3436 alc_auto_setup_eapd(codec, false);
3437 alc_shutup_pins(codec);
3440 static void alc225_init(struct hda_codec *codec)
3442 struct alc_spec *spec = codec->spec;
3443 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3444 bool hp1_pin_sense, hp2_pin_sense;
3451 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3452 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3454 if (hp1_pin_sense || hp2_pin_sense)
3457 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3460 snd_hda_codec_write(codec, hp_pin, 0,
3461 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3463 snd_hda_codec_write(codec, 0x16, 0,
3464 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3466 if (hp1_pin_sense || hp2_pin_sense)
3470 snd_hda_codec_write(codec, hp_pin, 0,
3471 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3473 snd_hda_codec_write(codec, 0x16, 0,
3474 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3476 if (hp1_pin_sense || hp2_pin_sense)
3479 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3480 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3483 static void alc225_shutup(struct hda_codec *codec)
3485 struct alc_spec *spec = codec->spec;
3486 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3487 bool hp1_pin_sense, hp2_pin_sense;
3490 alc269_shutup(codec);
3494 /* 3k pull low control for Headset jack. */
3495 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3497 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3498 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3500 if (hp1_pin_sense || hp2_pin_sense)
3504 snd_hda_codec_write(codec, hp_pin, 0,
3505 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3507 snd_hda_codec_write(codec, 0x16, 0,
3508 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3510 if (hp1_pin_sense || hp2_pin_sense)
3514 snd_hda_codec_write(codec, hp_pin, 0,
3515 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3517 snd_hda_codec_write(codec, 0x16, 0,
3518 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3520 if (hp1_pin_sense || hp2_pin_sense)
3523 alc_auto_setup_eapd(codec, false);
3524 alc_shutup_pins(codec);
3527 static void alc_default_init(struct hda_codec *codec)
3529 struct alc_spec *spec = codec->spec;
3530 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3538 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3543 snd_hda_codec_write(codec, hp_pin, 0,
3544 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3549 snd_hda_codec_write(codec, hp_pin, 0,
3550 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3556 static void alc_default_shutup(struct hda_codec *codec)
3558 struct alc_spec *spec = codec->spec;
3559 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3563 alc269_shutup(codec);
3567 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3572 snd_hda_codec_write(codec, hp_pin, 0,
3573 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3578 if (!spec->no_shutup_pins)
3579 snd_hda_codec_write(codec, hp_pin, 0,
3580 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3585 alc_auto_setup_eapd(codec, false);
3586 alc_shutup_pins(codec);
3589 static void alc294_hp_init(struct hda_codec *codec)
3591 struct alc_spec *spec = codec->spec;
3592 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3598 snd_hda_codec_write(codec, hp_pin, 0,
3599 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3603 if (!spec->no_shutup_pins)
3604 snd_hda_codec_write(codec, hp_pin, 0,
3605 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3607 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3608 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3610 /* Wait for depop procedure finish */
3611 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3612 for (i = 0; i < 20 && val & 0x0080; i++) {
3614 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3616 /* Set HP depop to auto mode */
3617 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3621 static void alc294_init(struct hda_codec *codec)
3623 struct alc_spec *spec = codec->spec;
3625 /* required only at boot or S4 resume time */
3626 if (!spec->done_hp_init ||
3627 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3628 alc294_hp_init(codec);
3629 spec->done_hp_init = true;
3631 alc_default_init(codec);
3634 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3637 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3638 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3639 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3642 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3646 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3647 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3649 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3654 static void alc5505_dsp_halt(struct hda_codec *codec)
3658 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3659 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3660 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3661 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3662 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3663 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3664 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3665 val = alc5505_coef_get(codec, 0x6220);
3666 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3669 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3671 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3672 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3673 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3674 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3675 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3676 alc5505_coef_set(codec, 0x880c, 0x00000004);
3679 static void alc5505_dsp_init(struct hda_codec *codec)
3683 alc5505_dsp_halt(codec);
3684 alc5505_dsp_back_from_halt(codec);
3685 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3686 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3687 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3688 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3689 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3690 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3691 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3692 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3693 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3694 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3695 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3696 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3697 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3699 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3701 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3703 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3705 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3706 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3707 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3708 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3709 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3710 alc5505_coef_set(codec, 0x880c, 0x00000003);
3711 alc5505_coef_set(codec, 0x880c, 0x00000010);
3713 #ifdef HALT_REALTEK_ALC5505
3714 alc5505_dsp_halt(codec);
3718 #ifdef HALT_REALTEK_ALC5505
3719 #define alc5505_dsp_suspend(codec) /* NOP */
3720 #define alc5505_dsp_resume(codec) /* NOP */
3722 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3723 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3727 static int alc269_suspend(struct hda_codec *codec)
3729 struct alc_spec *spec = codec->spec;
3731 if (spec->has_alc5505_dsp)
3732 alc5505_dsp_suspend(codec);
3733 return alc_suspend(codec);
3736 static int alc269_resume(struct hda_codec *codec)
3738 struct alc_spec *spec = codec->spec;
3740 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3741 alc269vb_toggle_power_output(codec, 0);
3742 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3743 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3747 codec->patch_ops.init(codec);
3749 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3750 alc269vb_toggle_power_output(codec, 1);
3751 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3752 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3756 regcache_sync(codec->core.regmap);
3757 hda_call_check_power_status(codec, 0x01);
3759 /* on some machine, the BIOS will clear the codec gpio data when enter
3760 * suspend, and won't restore the data after resume, so we restore it
3763 if (spec->gpio_data)
3764 alc_write_gpio_data(codec);
3766 if (spec->has_alc5505_dsp)
3767 alc5505_dsp_resume(codec);
3771 #endif /* CONFIG_PM */
3773 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3774 const struct hda_fixup *fix, int action)
3776 struct alc_spec *spec = codec->spec;
3778 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3779 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3782 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3783 const struct hda_fixup *fix,
3786 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3787 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3789 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3790 snd_hda_codec_set_pincfg(codec, 0x19,
3791 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3792 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3795 static void alc269_fixup_hweq(struct hda_codec *codec,
3796 const struct hda_fixup *fix, int action)
3798 if (action == HDA_FIXUP_ACT_INIT)
3799 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3802 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3803 const struct hda_fixup *fix, int action)
3805 struct alc_spec *spec = codec->spec;
3807 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3808 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3811 static void alc271_fixup_dmic(struct hda_codec *codec,
3812 const struct hda_fixup *fix, int action)
3814 static const struct hda_verb verbs[] = {
3815 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3816 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3821 if (strcmp(codec->core.chip_name, "ALC271X") &&
3822 strcmp(codec->core.chip_name, "ALC269VB"))
3824 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3825 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3826 snd_hda_sequence_write(codec, verbs);
3829 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3830 const struct hda_fixup *fix, int action)
3832 struct alc_spec *spec = codec->spec;
3834 if (action != HDA_FIXUP_ACT_PROBE)
3837 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3838 * fix the sample rate of analog I/O to 44.1kHz
3840 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3841 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3844 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3845 const struct hda_fixup *fix, int action)
3847 /* The digital-mic unit sends PDM (differential signal) instead of
3848 * the standard PCM, thus you can't record a valid mono stream as is.
3849 * Below is a workaround specific to ALC269 to control the dmic
3850 * signal source as mono.
3852 if (action == HDA_FIXUP_ACT_INIT)
3853 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3856 static void alc269_quanta_automute(struct hda_codec *codec)
3858 snd_hda_gen_update_outputs(codec);
3860 alc_write_coef_idx(codec, 0x0c, 0x680);
3861 alc_write_coef_idx(codec, 0x0c, 0x480);
3864 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3865 const struct hda_fixup *fix, int action)
3867 struct alc_spec *spec = codec->spec;
3868 if (action != HDA_FIXUP_ACT_PROBE)
3870 spec->gen.automute_hook = alc269_quanta_automute;
3873 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3874 struct hda_jack_callback *jack)
3876 struct alc_spec *spec = codec->spec;
3879 snd_hda_gen_hp_automute(codec, jack);
3881 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3883 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3886 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3890 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
3891 const struct hda_fixup *fix, int action)
3893 struct alc_spec *spec = codec->spec;
3894 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3895 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3896 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
3901 /* update mute-LED according to the speaker mute state via mic VREF pin */
3902 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
3904 struct hda_codec *codec = private_data;
3905 struct alc_spec *spec = codec->spec;
3906 unsigned int pinval;
3908 if (spec->mute_led_polarity)
3910 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3911 pinval &= ~AC_PINCTL_VREFEN;
3912 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3913 if (spec->mute_led_nid) {
3914 /* temporarily power up/down for setting VREF */
3915 snd_hda_power_up_pm(codec);
3916 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3917 snd_hda_power_down_pm(codec);
3921 /* Make sure the led works even in runtime suspend */
3922 static unsigned int led_power_filter(struct hda_codec *codec,
3924 unsigned int power_state)
3926 struct alc_spec *spec = codec->spec;
3928 if (power_state != AC_PWRST_D3 || nid == 0 ||
3929 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
3932 /* Set pin ctl again, it might have just been set to 0 */
3933 snd_hda_set_pin_ctl(codec, nid,
3934 snd_hda_codec_get_pin_target(codec, nid));
3936 return snd_hda_gen_path_power_filter(codec, nid, power_state);
3939 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
3940 const struct hda_fixup *fix, int action)
3942 struct alc_spec *spec = codec->spec;
3943 const struct dmi_device *dev = NULL;
3945 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3948 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
3950 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
3952 if (pin < 0x0a || pin >= 0x10)
3954 spec->mute_led_polarity = pol;
3955 spec->mute_led_nid = pin - 0x0a + 0x18;
3956 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3957 spec->gen.vmaster_mute_enum = 1;
3958 codec->power_filter = led_power_filter;
3960 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
3961 spec->mute_led_polarity);
3966 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
3967 const struct hda_fixup *fix,
3968 int action, hda_nid_t pin)
3970 struct alc_spec *spec = codec->spec;
3972 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3973 spec->mute_led_polarity = 0;
3974 spec->mute_led_nid = pin;
3975 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3976 spec->gen.vmaster_mute_enum = 1;
3977 codec->power_filter = led_power_filter;
3981 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
3982 const struct hda_fixup *fix, int action)
3984 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
3987 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
3988 const struct hda_fixup *fix, int action)
3990 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
3993 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
3994 const struct hda_fixup *fix, int action)
3996 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
3999 /* update LED status via GPIO */
4000 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4001 int polarity, bool enabled)
4005 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4008 /* turn on/off mute LED via GPIO per vmaster hook */
4009 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
4011 struct hda_codec *codec = private_data;
4012 struct alc_spec *spec = codec->spec;
4014 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4015 spec->mute_led_polarity, enabled);
4018 /* turn on/off mic-mute LED via GPIO per capture hook */
4019 static void alc_gpio_micmute_update(struct hda_codec *codec)
4021 struct alc_spec *spec = codec->spec;
4023 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4024 spec->micmute_led_polarity,
4025 spec->gen.micmute_led.led_value);
4028 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4029 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4031 unsigned int mute_mask,
4032 unsigned int micmute_mask)
4034 struct alc_spec *spec = codec->spec;
4036 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4038 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4041 spec->gpio_mute_led_mask = mute_mask;
4042 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
4045 spec->gpio_mic_led_mask = micmute_mask;
4046 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
4050 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4051 const struct hda_fixup *fix, int action)
4053 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4056 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4057 const struct hda_fixup *fix, int action)
4059 struct alc_spec *spec = codec->spec;
4061 spec->micmute_led_polarity = 1;
4063 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4066 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4067 const struct hda_fixup *fix, int action)
4069 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4072 /* turn on/off mic-mute LED per capture hook */
4073 static void alc_cap_micmute_update(struct hda_codec *codec)
4075 struct alc_spec *spec = codec->spec;
4076 unsigned int pinval;
4078 if (!spec->cap_mute_led_nid)
4080 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
4081 pinval &= ~AC_PINCTL_VREFEN;
4082 if (spec->gen.micmute_led.led_value)
4083 pinval |= AC_PINCTL_VREF_80;
4085 pinval |= AC_PINCTL_VREF_HIZ;
4086 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
4089 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4090 const struct hda_fixup *fix, int action)
4092 struct alc_spec *spec = codec->spec;
4094 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4095 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4096 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4097 * enable headphone amp
4099 spec->gpio_mask |= 0x10;
4100 spec->gpio_dir |= 0x10;
4101 spec->cap_mute_led_nid = 0x18;
4102 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4103 codec->power_filter = led_power_filter;
4107 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4108 const struct hda_fixup *fix, int action)
4110 struct alc_spec *spec = codec->spec;
4112 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4113 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4114 spec->cap_mute_led_nid = 0x18;
4115 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4116 codec->power_filter = led_power_filter;
4120 #if IS_REACHABLE(CONFIG_INPUT)
4121 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4122 struct hda_jack_callback *event)
4124 struct alc_spec *spec = codec->spec;
4126 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4127 send both key on and key off event for every interrupt. */
4128 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4129 input_sync(spec->kb_dev);
4130 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4131 input_sync(spec->kb_dev);
4134 static int alc_register_micmute_input_device(struct hda_codec *codec)
4136 struct alc_spec *spec = codec->spec;
4139 spec->kb_dev = input_allocate_device();
4140 if (!spec->kb_dev) {
4141 codec_err(codec, "Out of memory (input_allocate_device)\n");
4145 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4147 spec->kb_dev->name = "Microphone Mute Button";
4148 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4149 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4150 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4151 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4152 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4153 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4155 if (input_register_device(spec->kb_dev)) {
4156 codec_err(codec, "input_register_device failed\n");
4157 input_free_device(spec->kb_dev);
4158 spec->kb_dev = NULL;
4165 /* GPIO1 = set according to SKU external amp
4166 * GPIO2 = mic mute hotkey
4168 * GPIO4 = mic mute LED
4170 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4171 const struct hda_fixup *fix, int action)
4173 struct alc_spec *spec = codec->spec;
4175 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4176 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4177 spec->init_amp = ALC_INIT_DEFAULT;
4178 if (alc_register_micmute_input_device(codec) != 0)
4181 spec->gpio_mask |= 0x06;
4182 spec->gpio_dir |= 0x02;
4183 spec->gpio_data |= 0x02;
4184 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4185 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4186 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4187 gpio2_mic_hotkey_event);
4195 case HDA_FIXUP_ACT_FREE:
4196 input_unregister_device(spec->kb_dev);
4197 spec->kb_dev = NULL;
4201 /* Line2 = mic mute hotkey
4202 * GPIO2 = mic mute LED
4204 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4205 const struct hda_fixup *fix, int action)
4207 struct alc_spec *spec = codec->spec;
4209 spec->micmute_led_polarity = 1;
4210 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4211 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4212 spec->init_amp = ALC_INIT_DEFAULT;
4213 if (alc_register_micmute_input_device(codec) != 0)
4216 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4217 gpio2_mic_hotkey_event);
4225 case HDA_FIXUP_ACT_FREE:
4226 input_unregister_device(spec->kb_dev);
4227 spec->kb_dev = NULL;
4231 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4232 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4235 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4236 const struct hda_fixup *fix, int action)
4238 struct alc_spec *spec = codec->spec;
4240 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4241 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4242 spec->cap_mute_led_nid = 0x18;
4243 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4247 static const struct coef_fw alc225_pre_hsmode[] = {
4248 UPDATE_COEF(0x4a, 1<<8, 0),
4249 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4250 UPDATE_COEF(0x63, 3<<14, 3<<14),
4251 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4252 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4253 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4254 UPDATE_COEF(0x4a, 3<<10, 0),
4258 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4260 static const struct coef_fw coef0255[] = {
4261 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4262 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4263 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4264 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4265 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4268 static const struct coef_fw coef0256[] = {
4269 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4270 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4271 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4272 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4273 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4276 static const struct coef_fw coef0233[] = {
4277 WRITE_COEF(0x1b, 0x0c0b),
4278 WRITE_COEF(0x45, 0xc429),
4279 UPDATE_COEF(0x35, 0x4000, 0),
4280 WRITE_COEF(0x06, 0x2104),
4281 WRITE_COEF(0x1a, 0x0001),
4282 WRITE_COEF(0x26, 0x0004),
4283 WRITE_COEF(0x32, 0x42a3),
4286 static const struct coef_fw coef0288[] = {
4287 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4288 UPDATE_COEF(0x50, 0x2000, 0x2000),
4289 UPDATE_COEF(0x56, 0x0006, 0x0006),
4290 UPDATE_COEF(0x66, 0x0008, 0),
4291 UPDATE_COEF(0x67, 0x2000, 0),
4294 static const struct coef_fw coef0298[] = {
4295 UPDATE_COEF(0x19, 0x1300, 0x0300),
4298 static const struct coef_fw coef0292[] = {
4299 WRITE_COEF(0x76, 0x000e),
4300 WRITE_COEF(0x6c, 0x2400),
4301 WRITE_COEF(0x18, 0x7308),
4302 WRITE_COEF(0x6b, 0xc429),
4305 static const struct coef_fw coef0293[] = {
4306 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4307 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4308 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4309 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4310 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4311 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4314 static const struct coef_fw coef0668[] = {
4315 WRITE_COEF(0x15, 0x0d40),
4316 WRITE_COEF(0xb7, 0x802b),
4319 static const struct coef_fw coef0225[] = {
4320 UPDATE_COEF(0x63, 3<<14, 0),
4323 static const struct coef_fw coef0274[] = {
4324 UPDATE_COEF(0x4a, 0x0100, 0),
4325 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4326 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4327 UPDATE_COEF(0x4a, 0x0010, 0),
4328 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4329 WRITE_COEF(0x45, 0x5289),
4330 UPDATE_COEF(0x4a, 0x0c00, 0),
4334 switch (codec->core.vendor_id) {
4336 alc_process_coef_fw(codec, coef0255);
4340 alc_process_coef_fw(codec, coef0256);
4345 alc_process_coef_fw(codec, coef0274);
4349 alc_process_coef_fw(codec, coef0233);
4353 alc_process_coef_fw(codec, coef0288);
4356 alc_process_coef_fw(codec, coef0298);
4357 alc_process_coef_fw(codec, coef0288);
4360 alc_process_coef_fw(codec, coef0292);
4363 alc_process_coef_fw(codec, coef0293);
4366 alc_process_coef_fw(codec, coef0668);
4374 alc_process_coef_fw(codec, alc225_pre_hsmode);
4375 alc_process_coef_fw(codec, coef0225);
4378 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4381 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4385 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4388 static const struct coef_fw coef0255[] = {
4389 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4390 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4393 static const struct coef_fw coef0256[] = {
4394 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4395 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4396 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4399 static const struct coef_fw coef0233[] = {
4400 UPDATE_COEF(0x35, 0, 1<<14),
4401 WRITE_COEF(0x06, 0x2100),
4402 WRITE_COEF(0x1a, 0x0021),
4403 WRITE_COEF(0x26, 0x008c),
4406 static const struct coef_fw coef0288[] = {
4407 UPDATE_COEF(0x4f, 0x00c0, 0),
4408 UPDATE_COEF(0x50, 0x2000, 0),
4409 UPDATE_COEF(0x56, 0x0006, 0),
4410 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4411 UPDATE_COEF(0x66, 0x0008, 0x0008),
4412 UPDATE_COEF(0x67, 0x2000, 0x2000),
4415 static const struct coef_fw coef0292[] = {
4416 WRITE_COEF(0x19, 0xa208),
4417 WRITE_COEF(0x2e, 0xacf0),
4420 static const struct coef_fw coef0293[] = {
4421 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4422 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4423 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4426 static const struct coef_fw coef0688[] = {
4427 WRITE_COEF(0xb7, 0x802b),
4428 WRITE_COEF(0xb5, 0x1040),
4429 UPDATE_COEF(0xc3, 0, 1<<12),
4432 static const struct coef_fw coef0225[] = {
4433 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4434 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4435 UPDATE_COEF(0x63, 3<<14, 0),
4438 static const struct coef_fw coef0274[] = {
4439 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4440 UPDATE_COEF(0x4a, 0x0010, 0),
4441 UPDATE_COEF(0x6b, 0xf000, 0),
4445 switch (codec->core.vendor_id) {
4447 alc_write_coef_idx(codec, 0x45, 0xc489);
4448 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4449 alc_process_coef_fw(codec, coef0255);
4450 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4454 alc_write_coef_idx(codec, 0x45, 0xc489);
4455 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4456 alc_process_coef_fw(codec, coef0256);
4457 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4462 alc_write_coef_idx(codec, 0x45, 0x4689);
4463 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4464 alc_process_coef_fw(codec, coef0274);
4465 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4469 alc_write_coef_idx(codec, 0x45, 0xc429);
4470 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4471 alc_process_coef_fw(codec, coef0233);
4472 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4477 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4478 alc_process_coef_fw(codec, coef0288);
4479 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4482 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4483 alc_process_coef_fw(codec, coef0292);
4486 /* Set to TRS mode */
4487 alc_write_coef_idx(codec, 0x45, 0xc429);
4488 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4489 alc_process_coef_fw(codec, coef0293);
4490 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4493 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4497 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4498 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4501 alc_write_coef_idx(codec, 0x11, 0x0001);
4502 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4503 alc_process_coef_fw(codec, coef0688);
4504 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4512 alc_process_coef_fw(codec, alc225_pre_hsmode);
4513 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4514 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4515 alc_process_coef_fw(codec, coef0225);
4516 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4519 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4522 static void alc_headset_mode_default(struct hda_codec *codec)
4524 static const struct coef_fw coef0225[] = {
4525 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4526 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4527 UPDATE_COEF(0x49, 3<<8, 0<<8),
4528 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4529 UPDATE_COEF(0x63, 3<<14, 0),
4530 UPDATE_COEF(0x67, 0xf000, 0x3000),
4533 static const struct coef_fw coef0255[] = {
4534 WRITE_COEF(0x45, 0xc089),
4535 WRITE_COEF(0x45, 0xc489),
4536 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4537 WRITE_COEF(0x49, 0x0049),
4540 static const struct coef_fw coef0256[] = {
4541 WRITE_COEF(0x45, 0xc489),
4542 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4543 WRITE_COEF(0x49, 0x0049),
4544 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4545 WRITE_COEF(0x06, 0x6100),
4548 static const struct coef_fw coef0233[] = {
4549 WRITE_COEF(0x06, 0x2100),
4550 WRITE_COEF(0x32, 0x4ea3),
4553 static const struct coef_fw coef0288[] = {
4554 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4555 UPDATE_COEF(0x50, 0x2000, 0x2000),
4556 UPDATE_COEF(0x56, 0x0006, 0x0006),
4557 UPDATE_COEF(0x66, 0x0008, 0),
4558 UPDATE_COEF(0x67, 0x2000, 0),
4561 static const struct coef_fw coef0292[] = {
4562 WRITE_COEF(0x76, 0x000e),
4563 WRITE_COEF(0x6c, 0x2400),
4564 WRITE_COEF(0x6b, 0xc429),
4565 WRITE_COEF(0x18, 0x7308),
4568 static const struct coef_fw coef0293[] = {
4569 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4570 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4571 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4574 static const struct coef_fw coef0688[] = {
4575 WRITE_COEF(0x11, 0x0041),
4576 WRITE_COEF(0x15, 0x0d40),
4577 WRITE_COEF(0xb7, 0x802b),
4580 static const struct coef_fw coef0274[] = {
4581 WRITE_COEF(0x45, 0x4289),
4582 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4583 UPDATE_COEF(0x6b, 0x0f00, 0),
4584 UPDATE_COEF(0x49, 0x0300, 0x0300),
4588 switch (codec->core.vendor_id) {
4595 alc_process_coef_fw(codec, alc225_pre_hsmode);
4596 alc_process_coef_fw(codec, coef0225);
4599 alc_process_coef_fw(codec, coef0255);
4603 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4604 alc_write_coef_idx(codec, 0x45, 0xc089);
4606 alc_process_coef_fw(codec, coef0256);
4611 alc_process_coef_fw(codec, coef0274);
4615 alc_process_coef_fw(codec, coef0233);
4620 alc_process_coef_fw(codec, coef0288);
4623 alc_process_coef_fw(codec, coef0292);
4626 alc_process_coef_fw(codec, coef0293);
4629 alc_process_coef_fw(codec, coef0688);
4632 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4635 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4639 static void alc_headset_mode_ctia(struct hda_codec *codec)
4643 static const struct coef_fw coef0255[] = {
4644 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4645 WRITE_COEF(0x1b, 0x0c2b),
4646 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4649 static const struct coef_fw coef0256[] = {
4650 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4651 WRITE_COEF(0x1b, 0x0e6b),
4654 static const struct coef_fw coef0233[] = {
4655 WRITE_COEF(0x45, 0xd429),
4656 WRITE_COEF(0x1b, 0x0c2b),
4657 WRITE_COEF(0x32, 0x4ea3),
4660 static const struct coef_fw coef0288[] = {
4661 UPDATE_COEF(0x50, 0x2000, 0x2000),
4662 UPDATE_COEF(0x56, 0x0006, 0x0006),
4663 UPDATE_COEF(0x66, 0x0008, 0),
4664 UPDATE_COEF(0x67, 0x2000, 0),
4667 static const struct coef_fw coef0292[] = {
4668 WRITE_COEF(0x6b, 0xd429),
4669 WRITE_COEF(0x76, 0x0008),
4670 WRITE_COEF(0x18, 0x7388),
4673 static const struct coef_fw coef0293[] = {
4674 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4675 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4678 static const struct coef_fw coef0688[] = {
4679 WRITE_COEF(0x11, 0x0001),
4680 WRITE_COEF(0x15, 0x0d60),
4681 WRITE_COEF(0xc3, 0x0000),
4684 static const struct coef_fw coef0225_1[] = {
4685 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4686 UPDATE_COEF(0x63, 3<<14, 2<<14),
4689 static const struct coef_fw coef0225_2[] = {
4690 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4691 UPDATE_COEF(0x63, 3<<14, 1<<14),
4695 switch (codec->core.vendor_id) {
4697 alc_process_coef_fw(codec, coef0255);
4701 alc_process_coef_fw(codec, coef0256);
4706 alc_write_coef_idx(codec, 0x45, 0xd689);
4710 alc_process_coef_fw(codec, coef0233);
4713 val = alc_read_coef_idx(codec, 0x50);
4714 if (val & (1 << 12)) {
4715 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4716 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4719 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4720 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4726 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4728 alc_process_coef_fw(codec, coef0288);
4731 alc_process_coef_fw(codec, coef0292);
4734 alc_process_coef_fw(codec, coef0293);
4737 alc_process_coef_fw(codec, coef0688);
4745 val = alc_read_coef_idx(codec, 0x45);
4747 alc_process_coef_fw(codec, coef0225_2);
4749 alc_process_coef_fw(codec, coef0225_1);
4752 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4755 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
4759 static void alc_headset_mode_omtp(struct hda_codec *codec)
4761 static const struct coef_fw coef0255[] = {
4762 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4763 WRITE_COEF(0x1b, 0x0c2b),
4764 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4767 static const struct coef_fw coef0256[] = {
4768 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4769 WRITE_COEF(0x1b, 0x0e6b),
4772 static const struct coef_fw coef0233[] = {
4773 WRITE_COEF(0x45, 0xe429),
4774 WRITE_COEF(0x1b, 0x0c2b),
4775 WRITE_COEF(0x32, 0x4ea3),
4778 static const struct coef_fw coef0288[] = {
4779 UPDATE_COEF(0x50, 0x2000, 0x2000),
4780 UPDATE_COEF(0x56, 0x0006, 0x0006),
4781 UPDATE_COEF(0x66, 0x0008, 0),
4782 UPDATE_COEF(0x67, 0x2000, 0),
4785 static const struct coef_fw coef0292[] = {
4786 WRITE_COEF(0x6b, 0xe429),
4787 WRITE_COEF(0x76, 0x0008),
4788 WRITE_COEF(0x18, 0x7388),
4791 static const struct coef_fw coef0293[] = {
4792 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4793 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4796 static const struct coef_fw coef0688[] = {
4797 WRITE_COEF(0x11, 0x0001),
4798 WRITE_COEF(0x15, 0x0d50),
4799 WRITE_COEF(0xc3, 0x0000),
4802 static const struct coef_fw coef0225[] = {
4803 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4804 UPDATE_COEF(0x63, 3<<14, 2<<14),
4808 switch (codec->core.vendor_id) {
4810 alc_process_coef_fw(codec, coef0255);
4814 alc_process_coef_fw(codec, coef0256);
4819 alc_write_coef_idx(codec, 0x45, 0xe689);
4823 alc_process_coef_fw(codec, coef0233);
4826 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4827 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4832 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4834 alc_process_coef_fw(codec, coef0288);
4837 alc_process_coef_fw(codec, coef0292);
4840 alc_process_coef_fw(codec, coef0293);
4843 alc_process_coef_fw(codec, coef0688);
4851 alc_process_coef_fw(codec, coef0225);
4854 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
4857 static void alc_determine_headset_type(struct hda_codec *codec)
4860 bool is_ctia = false;
4861 struct alc_spec *spec = codec->spec;
4862 static const struct coef_fw coef0255[] = {
4863 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4864 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4868 static const struct coef_fw coef0288[] = {
4869 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4872 static const struct coef_fw coef0298[] = {
4873 UPDATE_COEF(0x50, 0x2000, 0x2000),
4874 UPDATE_COEF(0x56, 0x0006, 0x0006),
4875 UPDATE_COEF(0x66, 0x0008, 0),
4876 UPDATE_COEF(0x67, 0x2000, 0),
4877 UPDATE_COEF(0x19, 0x1300, 0x1300),
4880 static const struct coef_fw coef0293[] = {
4881 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4882 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4885 static const struct coef_fw coef0688[] = {
4886 WRITE_COEF(0x11, 0x0001),
4887 WRITE_COEF(0xb7, 0x802b),
4888 WRITE_COEF(0x15, 0x0d60),
4889 WRITE_COEF(0xc3, 0x0c00),
4892 static const struct coef_fw coef0274[] = {
4893 UPDATE_COEF(0x4a, 0x0010, 0),
4894 UPDATE_COEF(0x4a, 0x8000, 0),
4895 WRITE_COEF(0x45, 0xd289),
4896 UPDATE_COEF(0x49, 0x0300, 0x0300),
4900 switch (codec->core.vendor_id) {
4902 alc_process_coef_fw(codec, coef0255);
4904 val = alc_read_coef_idx(codec, 0x46);
4905 is_ctia = (val & 0x0070) == 0x0070;
4909 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4910 alc_write_coef_idx(codec, 0x06, 0x6104);
4911 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
4913 snd_hda_codec_write(codec, 0x21, 0,
4914 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4916 snd_hda_codec_write(codec, 0x21, 0,
4917 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4919 alc_process_coef_fw(codec, coef0255);
4921 val = alc_read_coef_idx(codec, 0x46);
4922 is_ctia = (val & 0x0070) == 0x0070;
4924 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
4925 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4927 snd_hda_codec_write(codec, 0x21, 0,
4928 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
4930 snd_hda_codec_write(codec, 0x21, 0,
4931 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4936 alc_process_coef_fw(codec, coef0274);
4938 val = alc_read_coef_idx(codec, 0x46);
4939 is_ctia = (val & 0x00f0) == 0x00f0;
4943 alc_write_coef_idx(codec, 0x45, 0xd029);
4945 val = alc_read_coef_idx(codec, 0x46);
4946 is_ctia = (val & 0x0070) == 0x0070;
4949 snd_hda_codec_write(codec, 0x21, 0,
4950 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4952 snd_hda_codec_write(codec, 0x21, 0,
4953 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4956 val = alc_read_coef_idx(codec, 0x50);
4957 if (val & (1 << 12)) {
4958 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4959 alc_process_coef_fw(codec, coef0288);
4961 val = alc_read_coef_idx(codec, 0x50);
4962 is_ctia = (val & 0x0070) == 0x0070;
4964 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4965 alc_process_coef_fw(codec, coef0288);
4967 val = alc_read_coef_idx(codec, 0x50);
4968 is_ctia = (val & 0x0070) == 0x0070;
4970 alc_process_coef_fw(codec, coef0298);
4971 snd_hda_codec_write(codec, 0x21, 0,
4972 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
4974 snd_hda_codec_write(codec, 0x21, 0,
4975 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4979 alc_process_coef_fw(codec, coef0288);
4981 val = alc_read_coef_idx(codec, 0x50);
4982 is_ctia = (val & 0x0070) == 0x0070;
4985 alc_write_coef_idx(codec, 0x6b, 0xd429);
4987 val = alc_read_coef_idx(codec, 0x6c);
4988 is_ctia = (val & 0x001c) == 0x001c;
4991 alc_process_coef_fw(codec, coef0293);
4993 val = alc_read_coef_idx(codec, 0x46);
4994 is_ctia = (val & 0x0070) == 0x0070;
4997 alc_process_coef_fw(codec, coef0688);
4999 val = alc_read_coef_idx(codec, 0xbe);
5000 is_ctia = (val & 0x1c02) == 0x1c02;
5008 snd_hda_codec_write(codec, 0x21, 0,
5009 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5011 snd_hda_codec_write(codec, 0x21, 0,
5012 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5014 alc_process_coef_fw(codec, alc225_pre_hsmode);
5015 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5016 val = alc_read_coef_idx(codec, 0x45);
5017 if (val & (1 << 9)) {
5018 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5019 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5021 val = alc_read_coef_idx(codec, 0x46);
5022 is_ctia = (val & 0x00f0) == 0x00f0;
5024 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5025 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5027 val = alc_read_coef_idx(codec, 0x46);
5028 is_ctia = (val & 0x00f0) == 0x00f0;
5030 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5031 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5032 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5034 snd_hda_codec_write(codec, 0x21, 0,
5035 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5037 snd_hda_codec_write(codec, 0x21, 0,
5038 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5045 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5046 is_ctia ? "yes" : "no");
5047 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5050 static void alc_update_headset_mode(struct hda_codec *codec)
5052 struct alc_spec *spec = codec->spec;
5054 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5055 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5057 int new_headset_mode;
5059 if (!snd_hda_jack_detect(codec, hp_pin))
5060 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5061 else if (mux_pin == spec->headset_mic_pin)
5062 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5063 else if (mux_pin == spec->headphone_mic_pin)
5064 new_headset_mode = ALC_HEADSET_MODE_MIC;
5066 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5068 if (new_headset_mode == spec->current_headset_mode) {
5069 snd_hda_gen_update_outputs(codec);
5073 switch (new_headset_mode) {
5074 case ALC_HEADSET_MODE_UNPLUGGED:
5075 alc_headset_mode_unplugged(codec);
5076 spec->gen.hp_jack_present = false;
5078 case ALC_HEADSET_MODE_HEADSET:
5079 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5080 alc_determine_headset_type(codec);
5081 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5082 alc_headset_mode_ctia(codec);
5083 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5084 alc_headset_mode_omtp(codec);
5085 spec->gen.hp_jack_present = true;
5087 case ALC_HEADSET_MODE_MIC:
5088 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5089 spec->gen.hp_jack_present = false;
5091 case ALC_HEADSET_MODE_HEADPHONE:
5092 alc_headset_mode_default(codec);
5093 spec->gen.hp_jack_present = true;
5096 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5097 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5098 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5099 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5100 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5103 spec->current_headset_mode = new_headset_mode;
5105 snd_hda_gen_update_outputs(codec);
5108 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5109 struct snd_kcontrol *kcontrol,
5110 struct snd_ctl_elem_value *ucontrol)
5112 alc_update_headset_mode(codec);
5115 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5116 struct hda_jack_callback *jack)
5118 struct alc_spec *spec = codec->spec;
5119 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5120 snd_hda_gen_hp_automute(codec, jack);
5121 alc_update_headset_mode(codec);
5124 static void alc_probe_headset_mode(struct hda_codec *codec)
5127 struct alc_spec *spec = codec->spec;
5128 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5131 for (i = 0; i < cfg->num_inputs; i++) {
5132 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5133 spec->headset_mic_pin = cfg->inputs[i].pin;
5134 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5135 spec->headphone_mic_pin = cfg->inputs[i].pin;
5138 WARN_ON(spec->gen.cap_sync_hook);
5139 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5140 spec->gen.automute_hook = alc_update_headset_mode;
5141 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5144 static void alc_fixup_headset_mode(struct hda_codec *codec,
5145 const struct hda_fixup *fix, int action)
5147 struct alc_spec *spec = codec->spec;
5150 case HDA_FIXUP_ACT_PRE_PROBE:
5151 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5153 case HDA_FIXUP_ACT_PROBE:
5154 alc_probe_headset_mode(codec);
5156 case HDA_FIXUP_ACT_INIT:
5157 spec->current_headset_mode = 0;
5158 alc_update_headset_mode(codec);
5163 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5164 const struct hda_fixup *fix, int action)
5166 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5167 struct alc_spec *spec = codec->spec;
5168 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5171 alc_fixup_headset_mode(codec, fix, action);
5174 static void alc255_set_default_jack_type(struct hda_codec *codec)
5176 /* Set to iphone type */
5177 static const struct coef_fw alc255fw[] = {
5178 WRITE_COEF(0x1b, 0x880b),
5179 WRITE_COEF(0x45, 0xd089),
5180 WRITE_COEF(0x1b, 0x080b),
5181 WRITE_COEF(0x46, 0x0004),
5182 WRITE_COEF(0x1b, 0x0c0b),
5185 static const struct coef_fw alc256fw[] = {
5186 WRITE_COEF(0x1b, 0x884b),
5187 WRITE_COEF(0x45, 0xd089),
5188 WRITE_COEF(0x1b, 0x084b),
5189 WRITE_COEF(0x46, 0x0004),
5190 WRITE_COEF(0x1b, 0x0c4b),
5193 switch (codec->core.vendor_id) {
5195 alc_process_coef_fw(codec, alc255fw);
5199 alc_process_coef_fw(codec, alc256fw);
5205 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5206 const struct hda_fixup *fix, int action)
5208 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5209 alc255_set_default_jack_type(codec);
5211 alc_fixup_headset_mode(codec, fix, action);
5214 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5215 const struct hda_fixup *fix, int action)
5217 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5218 struct alc_spec *spec = codec->spec;
5219 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5220 alc255_set_default_jack_type(codec);
5223 alc_fixup_headset_mode(codec, fix, action);
5226 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5227 struct hda_jack_callback *jack)
5229 struct alc_spec *spec = codec->spec;
5231 alc_update_headset_jack_cb(codec, jack);
5232 /* Headset Mic enable or disable, only for Dell Dino */
5233 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5236 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5237 const struct hda_fixup *fix, int action)
5239 alc_fixup_headset_mode(codec, fix, action);
5240 if (action == HDA_FIXUP_ACT_PROBE) {
5241 struct alc_spec *spec = codec->spec;
5242 /* toggled via hp_automute_hook */
5243 spec->gpio_mask |= 0x40;
5244 spec->gpio_dir |= 0x40;
5245 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5249 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5250 const struct hda_fixup *fix, int action)
5252 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5253 struct alc_spec *spec = codec->spec;
5254 spec->gen.auto_mute_via_amp = 1;
5258 static void alc_fixup_no_shutup(struct hda_codec *codec,
5259 const struct hda_fixup *fix, int action)
5261 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5262 struct alc_spec *spec = codec->spec;
5263 spec->no_shutup_pins = 1;
5267 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5268 const struct hda_fixup *fix, int action)
5270 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5271 struct alc_spec *spec = codec->spec;
5272 /* Disable AA-loopback as it causes white noise */
5273 spec->gen.mixer_nid = 0;
5277 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5278 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5279 const struct hda_fixup *fix, int action)
5281 static const struct hda_pintbl pincfgs[] = {
5282 { 0x16, 0x21211010 }, /* dock headphone */
5283 { 0x19, 0x21a11010 }, /* dock mic */
5286 struct alc_spec *spec = codec->spec;
5288 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5289 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5290 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5291 codec->power_save_node = 0; /* avoid click noises */
5292 snd_hda_apply_pincfgs(codec, pincfgs);
5296 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5297 const struct hda_fixup *fix, int action)
5299 static const struct hda_pintbl pincfgs[] = {
5300 { 0x17, 0x21211010 }, /* dock headphone */
5301 { 0x19, 0x21a11010 }, /* dock mic */
5304 struct alc_spec *spec = codec->spec;
5306 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5307 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5308 snd_hda_apply_pincfgs(codec, pincfgs);
5309 } else if (action == HDA_FIXUP_ACT_INIT) {
5310 /* Enable DOCK device */
5311 snd_hda_codec_write(codec, 0x17, 0,
5312 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5313 /* Enable DOCK device */
5314 snd_hda_codec_write(codec, 0x19, 0,
5315 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5319 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5320 const struct hda_fixup *fix, int action)
5322 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5323 * the speaker output becomes too low by some reason on Thinkpads with
5326 static hda_nid_t preferred_pairs[] = {
5327 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5330 struct alc_spec *spec = codec->spec;
5332 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5333 spec->gen.preferred_dacs = preferred_pairs;
5336 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5338 struct alc_spec *spec = codec->spec;
5339 int hp_pin = alc_get_hp_pin(spec);
5341 /* Prevent pop noises when headphones are plugged in */
5342 snd_hda_codec_write(codec, hp_pin, 0,
5343 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5347 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5348 const struct hda_fixup *fix, int action)
5350 struct alc_spec *spec = codec->spec;
5351 struct hda_input_mux *imux = &spec->gen.input_mux;
5355 case HDA_FIXUP_ACT_PRE_PROBE:
5356 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5357 * it causes a click noise at start up
5359 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5360 spec->shutup = alc_shutup_dell_xps13;
5362 case HDA_FIXUP_ACT_PROBE:
5363 /* Make the internal mic the default input source. */
5364 for (i = 0; i < imux->num_items; i++) {
5365 if (spec->gen.imux_pins[i] == 0x12) {
5366 spec->gen.cur_mux[0] = i;
5374 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5375 const struct hda_fixup *fix, int action)
5377 struct alc_spec *spec = codec->spec;
5379 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5380 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5381 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5383 /* Disable boost for mic-in permanently. (This code is only called
5384 from quirks that guarantee that the headphone is at NID 0x1b.) */
5385 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5386 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5388 alc_fixup_headset_mode(codec, fix, action);
5391 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5392 const struct hda_fixup *fix, int action)
5394 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5395 alc_write_coef_idx(codec, 0xc4, 0x8000);
5396 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5397 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5399 alc_fixup_headset_mode(codec, fix, action);
5402 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5403 static int find_ext_mic_pin(struct hda_codec *codec)
5405 struct alc_spec *spec = codec->spec;
5406 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5408 unsigned int defcfg;
5411 for (i = 0; i < cfg->num_inputs; i++) {
5412 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5414 nid = cfg->inputs[i].pin;
5415 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5416 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5424 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5425 const struct hda_fixup *fix,
5428 struct alc_spec *spec = codec->spec;
5430 if (action == HDA_FIXUP_ACT_PROBE) {
5431 int mic_pin = find_ext_mic_pin(codec);
5432 int hp_pin = alc_get_hp_pin(spec);
5434 if (snd_BUG_ON(!mic_pin || !hp_pin))
5436 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5440 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5441 const struct hda_fixup *fix,
5444 struct alc_spec *spec = codec->spec;
5445 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5448 /* The mic boosts on level 2 and 3 are too noisy
5449 on the internal mic input.
5450 Therefore limit the boost to 0 or 1. */
5452 if (action != HDA_FIXUP_ACT_PROBE)
5455 for (i = 0; i < cfg->num_inputs; i++) {
5456 hda_nid_t nid = cfg->inputs[i].pin;
5457 unsigned int defcfg;
5458 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5460 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5461 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5464 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5465 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5466 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5467 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5468 (0 << AC_AMPCAP_MUTE_SHIFT));
5472 static void alc283_hp_automute_hook(struct hda_codec *codec,
5473 struct hda_jack_callback *jack)
5475 struct alc_spec *spec = codec->spec;
5479 snd_hda_gen_hp_automute(codec, jack);
5481 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5484 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5488 static void alc283_fixup_chromebook(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 snd_hda_override_wcaps(codec, 0x03, 0);
5496 /* Disable AA-loopback as it causes white noise */
5497 spec->gen.mixer_nid = 0;
5499 case HDA_FIXUP_ACT_INIT:
5500 /* MIC2-VREF control */
5501 /* Set to manual mode */
5502 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5503 /* Enable Line1 input control by verb */
5504 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5509 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5510 const struct hda_fixup *fix, int action)
5512 struct alc_spec *spec = codec->spec;
5515 case HDA_FIXUP_ACT_PRE_PROBE:
5516 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5518 case HDA_FIXUP_ACT_INIT:
5519 /* MIC2-VREF control */
5520 /* Set to manual mode */
5521 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5526 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5527 static void asus_tx300_automute(struct hda_codec *codec)
5529 struct alc_spec *spec = codec->spec;
5530 snd_hda_gen_update_outputs(codec);
5531 if (snd_hda_jack_detect(codec, 0x1b))
5532 spec->gen.mute_bits |= (1ULL << 0x14);
5535 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5536 const struct hda_fixup *fix, int action)
5538 struct alc_spec *spec = codec->spec;
5539 static const struct hda_pintbl dock_pins[] = {
5540 { 0x1b, 0x21114000 }, /* dock speaker pin */
5545 case HDA_FIXUP_ACT_PRE_PROBE:
5546 spec->init_amp = ALC_INIT_DEFAULT;
5547 /* TX300 needs to set up GPIO2 for the speaker amp */
5548 alc_setup_gpio(codec, 0x04);
5549 snd_hda_apply_pincfgs(codec, dock_pins);
5550 spec->gen.auto_mute_via_amp = 1;
5551 spec->gen.automute_hook = asus_tx300_automute;
5552 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5553 snd_hda_gen_hp_automute);
5555 case HDA_FIXUP_ACT_PROBE:
5556 spec->init_amp = ALC_INIT_DEFAULT;
5558 case HDA_FIXUP_ACT_BUILD:
5559 /* this is a bit tricky; give more sane names for the main
5560 * (tablet) speaker and the dock speaker, respectively
5562 rename_ctl(codec, "Speaker Playback Switch",
5563 "Dock Speaker Playback Switch");
5564 rename_ctl(codec, "Bass Speaker Playback Switch",
5565 "Speaker Playback Switch");
5570 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5571 const struct hda_fixup *fix, int action)
5573 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5574 /* DAC node 0x03 is giving mono output. We therefore want to
5575 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5576 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5577 hda_nid_t conn1[2] = { 0x0c };
5578 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
5579 snd_hda_override_conn_list(codec, 0x15, 1, conn1);
5583 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5584 const struct hda_fixup *fix, int action)
5586 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5587 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5588 we can't adjust the speaker's volume since this node does not has
5589 Amp-out capability. we change the speaker's route to:
5590 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5591 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5592 speaker's volume now. */
5594 hda_nid_t conn1[1] = { 0x0c };
5595 snd_hda_override_conn_list(codec, 0x17, 1, conn1);
5599 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5600 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5601 const struct hda_fixup *fix, int action)
5603 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5604 hda_nid_t conn[2] = { 0x02, 0x03 };
5605 snd_hda_override_conn_list(codec, 0x17, 2, conn);
5609 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5610 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
5611 const struct hda_fixup *fix, int action)
5613 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5614 hda_nid_t conn[1] = { 0x02 };
5615 snd_hda_override_conn_list(codec, 0x17, 1, conn);
5619 /* Hook to update amp GPIO4 for automute */
5620 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5621 struct hda_jack_callback *jack)
5623 struct alc_spec *spec = codec->spec;
5625 snd_hda_gen_hp_automute(codec, jack);
5626 /* mute_led_polarity is set to 0, so we pass inverted value here */
5627 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
5628 !spec->gen.hp_jack_present);
5631 /* Manage GPIOs for HP EliteBook Folio 9480m.
5633 * GPIO4 is the headphone amplifier power control
5634 * GPIO3 is the audio output mute indicator LED
5637 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5638 const struct hda_fixup *fix,
5641 struct alc_spec *spec = codec->spec;
5643 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5644 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5645 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5646 spec->gpio_mask |= 0x10;
5647 spec->gpio_dir |= 0x10;
5648 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5652 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5653 const struct hda_fixup *fix,
5656 struct alc_spec *spec = codec->spec;
5658 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5659 spec->gpio_mask |= 0x04;
5660 spec->gpio_dir |= 0x04;
5661 /* set data bit low */
5665 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5666 const struct hda_fixup *fix,
5669 alc_fixup_dual_codecs(codec, fix, action);
5671 case HDA_FIXUP_ACT_PRE_PROBE:
5672 /* override card longname to provide a unique UCM profile */
5673 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5675 case HDA_FIXUP_ACT_BUILD:
5676 /* rename Capture controls depending on the codec */
5677 rename_ctl(codec, "Capture Volume",
5679 "Rear-Panel Capture Volume" :
5680 "Front-Panel Capture Volume");
5681 rename_ctl(codec, "Capture Switch",
5683 "Rear-Panel Capture Switch" :
5684 "Front-Panel Capture Switch");
5689 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
5690 const struct hda_fixup *fix, int action)
5692 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5695 codec->power_save_node = 1;
5698 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5699 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
5700 const struct hda_fixup *fix, int action)
5702 struct alc_spec *spec = codec->spec;
5703 static hda_nid_t preferred_pairs[] = {
5704 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5708 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5711 spec->gen.preferred_dacs = preferred_pairs;
5712 spec->gen.auto_mute_via_amp = 1;
5713 codec->power_save_node = 0;
5716 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5717 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5718 const struct hda_fixup *fix, int action)
5720 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5723 snd_hda_override_wcaps(codec, 0x03, 0);
5726 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
5727 const struct hda_fixup *fix, int action)
5729 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5730 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5733 /* for hda_fixup_thinkpad_acpi() */
5734 #include "thinkpad_helper.c"
5736 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5737 const struct hda_fixup *fix, int action)
5739 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5740 hda_fixup_thinkpad_acpi(codec, fix, action);
5743 /* for dell wmi mic mute led */
5744 #include "dell_wmi_helper.c"
5746 /* for alc295_fixup_hp_top_speakers */
5747 #include "hp_x360_helper.c"
5751 ALC269_FIXUP_SONY_VAIO,
5752 ALC275_FIXUP_SONY_VAIO_GPIO2,
5753 ALC269_FIXUP_DELL_M101Z,
5754 ALC269_FIXUP_SKU_IGNORE,
5755 ALC269_FIXUP_ASUS_G73JW,
5756 ALC269_FIXUP_LENOVO_EAPD,
5757 ALC275_FIXUP_SONY_HWEQ,
5758 ALC275_FIXUP_SONY_DISABLE_AAMIX,
5760 ALC269_FIXUP_PCM_44K,
5761 ALC269_FIXUP_STEREO_DMIC,
5762 ALC269_FIXUP_HEADSET_MIC,
5763 ALC269_FIXUP_QUANTA_MUTE,
5764 ALC269_FIXUP_LIFEBOOK,
5765 ALC269_FIXUP_LIFEBOOK_EXTMIC,
5766 ALC269_FIXUP_LIFEBOOK_HP_PIN,
5767 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5768 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
5771 ALC269VB_FIXUP_AMIC,
5772 ALC269VB_FIXUP_DMIC,
5773 ALC269_FIXUP_HP_MUTE_LED,
5774 ALC269_FIXUP_HP_MUTE_LED_MIC1,
5775 ALC269_FIXUP_HP_MUTE_LED_MIC2,
5776 ALC269_FIXUP_HP_MUTE_LED_MIC3,
5777 ALC269_FIXUP_HP_GPIO_LED,
5778 ALC269_FIXUP_HP_GPIO_MIC1_LED,
5779 ALC269_FIXUP_HP_LINE1_MIC1_LED,
5780 ALC269_FIXUP_INV_DMIC,
5781 ALC269_FIXUP_LENOVO_DOCK,
5782 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
5783 ALC269_FIXUP_NO_SHUTUP,
5784 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
5785 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
5786 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5787 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
5788 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5789 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
5790 ALC269_FIXUP_HEADSET_MODE,
5791 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
5792 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
5793 ALC269_FIXUP_ASUS_X101_FUNC,
5794 ALC269_FIXUP_ASUS_X101_VERB,
5795 ALC269_FIXUP_ASUS_X101,
5796 ALC271_FIXUP_AMIC_MIC2,
5797 ALC271_FIXUP_HP_GATE_MIC_JACK,
5798 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
5799 ALC269_FIXUP_ACER_AC700,
5800 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
5801 ALC269VB_FIXUP_ASUS_ZENBOOK,
5802 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
5803 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
5804 ALC269VB_FIXUP_ORDISSIMO_EVE2,
5805 ALC283_FIXUP_CHROME_BOOK,
5806 ALC283_FIXUP_SENSE_COMBO_JACK,
5807 ALC282_FIXUP_ASUS_TX300,
5808 ALC283_FIXUP_INT_MIC,
5809 ALC290_FIXUP_MONO_SPEAKERS,
5810 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
5811 ALC290_FIXUP_SUBWOOFER,
5812 ALC290_FIXUP_SUBWOOFER_HSJACK,
5813 ALC269_FIXUP_THINKPAD_ACPI,
5814 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5815 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
5816 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
5817 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5818 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
5819 ALC255_FIXUP_HEADSET_MODE,
5820 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
5821 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5822 ALC292_FIXUP_TPT440_DOCK,
5823 ALC292_FIXUP_TPT440,
5824 ALC283_FIXUP_HEADSET_MIC,
5825 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
5826 ALC282_FIXUP_ASPIRE_V5_PINS,
5827 ALC280_FIXUP_HP_GPIO4,
5828 ALC286_FIXUP_HP_GPIO_LED,
5829 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
5830 ALC280_FIXUP_HP_DOCK_PINS,
5831 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
5832 ALC280_FIXUP_HP_9480M,
5833 ALC288_FIXUP_DELL_HEADSET_MODE,
5834 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
5835 ALC288_FIXUP_DELL_XPS_13,
5836 ALC288_FIXUP_DISABLE_AAMIX,
5837 ALC292_FIXUP_DELL_E7X,
5838 ALC292_FIXUP_DISABLE_AAMIX,
5839 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
5840 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
5841 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
5842 ALC275_FIXUP_DELL_XPS,
5843 ALC293_FIXUP_LENOVO_SPK_NOISE,
5844 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
5845 ALC255_FIXUP_DELL_SPK_NOISE,
5846 ALC225_FIXUP_DISABLE_MIC_VREF,
5847 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
5848 ALC295_FIXUP_DISABLE_DAC3,
5849 ALC285_FIXUP_SPEAKER2_TO_DAC1,
5850 ALC280_FIXUP_HP_HEADSET_MIC,
5851 ALC221_FIXUP_HP_FRONT_MIC,
5852 ALC292_FIXUP_TPT460,
5853 ALC298_FIXUP_SPK_VOLUME,
5854 ALC298_FIXUP_LENOVO_SPK_VOLUME,
5855 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
5856 ALC269_FIXUP_ATIV_BOOK_8,
5857 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
5858 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
5859 ALC256_FIXUP_ASUS_HEADSET_MODE,
5860 ALC256_FIXUP_ASUS_MIC,
5861 ALC256_FIXUP_ASUS_AIO_GPIO2,
5862 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
5863 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
5864 ALC233_FIXUP_LENOVO_MULTI_CODECS,
5865 ALC233_FIXUP_ACER_HEADSET_MIC,
5866 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5867 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
5868 ALC225_FIXUP_S3_POP_NOISE,
5869 ALC700_FIXUP_INTEL_REFERENCE,
5870 ALC274_FIXUP_DELL_BIND_DACS,
5871 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
5872 ALC298_FIXUP_TPT470_DOCK_FIX,
5873 ALC298_FIXUP_TPT470_DOCK,
5874 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
5875 ALC255_FIXUP_DELL_HEADSET_MIC,
5876 ALC256_FIXUP_HUAWEI_MBXP_PINS,
5877 ALC295_FIXUP_HP_X360,
5878 ALC221_FIXUP_HP_HEADSET_MIC,
5879 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
5880 ALC295_FIXUP_HP_AUTO_MUTE,
5881 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
5882 ALC294_FIXUP_ASUS_MIC,
5883 ALC294_FIXUP_ASUS_HEADSET_MIC,
5884 ALC294_FIXUP_ASUS_SPK,
5885 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
5886 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
5887 ALC255_FIXUP_ACER_HEADSET_MIC,
5888 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
5889 ALC225_FIXUP_WYSE_AUTO_MUTE,
5890 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
5891 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
5892 ALC256_FIXUP_ASUS_HEADSET_MIC,
5893 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
5894 ALC299_FIXUP_PREDATOR_SPK,
5895 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
5896 ALC289_FIXUP_DELL_SPK2,
5897 ALC289_FIXUP_DUAL_SPK,
5898 ALC294_FIXUP_SPK2_TO_DAC1,
5899 ALC294_FIXUP_ASUS_DUAL_SPK,
5900 ALC294_FIXUP_ASUS_HPE,
5901 ALC285_FIXUP_HP_GPIO_LED,
5904 static const struct hda_fixup alc269_fixups[] = {
5905 [ALC269_FIXUP_GPIO2] = {
5906 .type = HDA_FIXUP_FUNC,
5907 .v.func = alc_fixup_gpio2,
5909 [ALC269_FIXUP_SONY_VAIO] = {
5910 .type = HDA_FIXUP_PINCTLS,
5911 .v.pins = (const struct hda_pintbl[]) {
5912 {0x19, PIN_VREFGRD},
5916 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
5917 .type = HDA_FIXUP_FUNC,
5918 .v.func = alc275_fixup_gpio4_off,
5920 .chain_id = ALC269_FIXUP_SONY_VAIO
5922 [ALC269_FIXUP_DELL_M101Z] = {
5923 .type = HDA_FIXUP_VERBS,
5924 .v.verbs = (const struct hda_verb[]) {
5925 /* Enables internal speaker */
5926 {0x20, AC_VERB_SET_COEF_INDEX, 13},
5927 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
5931 [ALC269_FIXUP_SKU_IGNORE] = {
5932 .type = HDA_FIXUP_FUNC,
5933 .v.func = alc_fixup_sku_ignore,
5935 [ALC269_FIXUP_ASUS_G73JW] = {
5936 .type = HDA_FIXUP_PINS,
5937 .v.pins = (const struct hda_pintbl[]) {
5938 { 0x17, 0x99130111 }, /* subwoofer */
5942 [ALC269_FIXUP_LENOVO_EAPD] = {
5943 .type = HDA_FIXUP_VERBS,
5944 .v.verbs = (const struct hda_verb[]) {
5945 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
5949 [ALC275_FIXUP_SONY_HWEQ] = {
5950 .type = HDA_FIXUP_FUNC,
5951 .v.func = alc269_fixup_hweq,
5953 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
5955 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
5956 .type = HDA_FIXUP_FUNC,
5957 .v.func = alc_fixup_disable_aamix,
5959 .chain_id = ALC269_FIXUP_SONY_VAIO
5961 [ALC271_FIXUP_DMIC] = {
5962 .type = HDA_FIXUP_FUNC,
5963 .v.func = alc271_fixup_dmic,
5965 [ALC269_FIXUP_PCM_44K] = {
5966 .type = HDA_FIXUP_FUNC,
5967 .v.func = alc269_fixup_pcm_44k,
5969 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5971 [ALC269_FIXUP_STEREO_DMIC] = {
5972 .type = HDA_FIXUP_FUNC,
5973 .v.func = alc269_fixup_stereo_dmic,
5975 [ALC269_FIXUP_HEADSET_MIC] = {
5976 .type = HDA_FIXUP_FUNC,
5977 .v.func = alc269_fixup_headset_mic,
5979 [ALC269_FIXUP_QUANTA_MUTE] = {
5980 .type = HDA_FIXUP_FUNC,
5981 .v.func = alc269_fixup_quanta_mute,
5983 [ALC269_FIXUP_LIFEBOOK] = {
5984 .type = HDA_FIXUP_PINS,
5985 .v.pins = (const struct hda_pintbl[]) {
5986 { 0x1a, 0x2101103f }, /* dock line-out */
5987 { 0x1b, 0x23a11040 }, /* dock mic-in */
5991 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5993 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
5994 .type = HDA_FIXUP_PINS,
5995 .v.pins = (const struct hda_pintbl[]) {
5996 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6000 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6001 .type = HDA_FIXUP_PINS,
6002 .v.pins = (const struct hda_pintbl[]) {
6003 { 0x21, 0x0221102f }, /* HP out */
6007 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6008 .type = HDA_FIXUP_FUNC,
6009 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6011 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6012 .type = HDA_FIXUP_FUNC,
6013 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6015 [ALC269_FIXUP_AMIC] = {
6016 .type = HDA_FIXUP_PINS,
6017 .v.pins = (const struct hda_pintbl[]) {
6018 { 0x14, 0x99130110 }, /* speaker */
6019 { 0x15, 0x0121401f }, /* HP out */
6020 { 0x18, 0x01a19c20 }, /* mic */
6021 { 0x19, 0x99a3092f }, /* int-mic */
6025 [ALC269_FIXUP_DMIC] = {
6026 .type = HDA_FIXUP_PINS,
6027 .v.pins = (const struct hda_pintbl[]) {
6028 { 0x12, 0x99a3092f }, /* int-mic */
6029 { 0x14, 0x99130110 }, /* speaker */
6030 { 0x15, 0x0121401f }, /* HP out */
6031 { 0x18, 0x01a19c20 }, /* mic */
6035 [ALC269VB_FIXUP_AMIC] = {
6036 .type = HDA_FIXUP_PINS,
6037 .v.pins = (const struct hda_pintbl[]) {
6038 { 0x14, 0x99130110 }, /* speaker */
6039 { 0x18, 0x01a19c20 }, /* mic */
6040 { 0x19, 0x99a3092f }, /* int-mic */
6041 { 0x21, 0x0121401f }, /* HP out */
6045 [ALC269VB_FIXUP_DMIC] = {
6046 .type = HDA_FIXUP_PINS,
6047 .v.pins = (const struct hda_pintbl[]) {
6048 { 0x12, 0x99a3092f }, /* int-mic */
6049 { 0x14, 0x99130110 }, /* speaker */
6050 { 0x18, 0x01a19c20 }, /* mic */
6051 { 0x21, 0x0121401f }, /* HP out */
6055 [ALC269_FIXUP_HP_MUTE_LED] = {
6056 .type = HDA_FIXUP_FUNC,
6057 .v.func = alc269_fixup_hp_mute_led,
6059 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6060 .type = HDA_FIXUP_FUNC,
6061 .v.func = alc269_fixup_hp_mute_led_mic1,
6063 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6064 .type = HDA_FIXUP_FUNC,
6065 .v.func = alc269_fixup_hp_mute_led_mic2,
6067 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6068 .type = HDA_FIXUP_FUNC,
6069 .v.func = alc269_fixup_hp_mute_led_mic3,
6071 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6073 [ALC269_FIXUP_HP_GPIO_LED] = {
6074 .type = HDA_FIXUP_FUNC,
6075 .v.func = alc269_fixup_hp_gpio_led,
6077 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6078 .type = HDA_FIXUP_FUNC,
6079 .v.func = alc269_fixup_hp_gpio_mic1_led,
6081 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6082 .type = HDA_FIXUP_FUNC,
6083 .v.func = alc269_fixup_hp_line1_mic1_led,
6085 [ALC269_FIXUP_INV_DMIC] = {
6086 .type = HDA_FIXUP_FUNC,
6087 .v.func = alc_fixup_inv_dmic,
6089 [ALC269_FIXUP_NO_SHUTUP] = {
6090 .type = HDA_FIXUP_FUNC,
6091 .v.func = alc_fixup_no_shutup,
6093 [ALC269_FIXUP_LENOVO_DOCK] = {
6094 .type = HDA_FIXUP_PINS,
6095 .v.pins = (const struct hda_pintbl[]) {
6096 { 0x19, 0x23a11040 }, /* dock mic */
6097 { 0x1b, 0x2121103f }, /* dock headphone */
6101 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6103 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6104 .type = HDA_FIXUP_FUNC,
6105 .v.func = alc269_fixup_limit_int_mic_boost,
6107 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6109 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6110 .type = HDA_FIXUP_FUNC,
6111 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6113 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6115 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6116 .type = HDA_FIXUP_PINS,
6117 .v.pins = (const struct hda_pintbl[]) {
6118 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6119 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6123 .chain_id = ALC269_FIXUP_HEADSET_MODE
6125 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6126 .type = HDA_FIXUP_PINS,
6127 .v.pins = (const struct hda_pintbl[]) {
6128 { 0x16, 0x21014020 }, /* dock line out */
6129 { 0x19, 0x21a19030 }, /* dock mic */
6130 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6134 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6136 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6137 .type = HDA_FIXUP_PINS,
6138 .v.pins = (const struct hda_pintbl[]) {
6139 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6143 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6145 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6146 .type = HDA_FIXUP_PINS,
6147 .v.pins = (const struct hda_pintbl[]) {
6148 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6149 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6153 .chain_id = ALC269_FIXUP_HEADSET_MODE
6155 [ALC269_FIXUP_HEADSET_MODE] = {
6156 .type = HDA_FIXUP_FUNC,
6157 .v.func = alc_fixup_headset_mode,
6159 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6161 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6162 .type = HDA_FIXUP_FUNC,
6163 .v.func = alc_fixup_headset_mode_no_hp_mic,
6165 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6166 .type = HDA_FIXUP_PINS,
6167 .v.pins = (const struct hda_pintbl[]) {
6168 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6172 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6174 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6175 .type = HDA_FIXUP_PINS,
6176 .v.pins = (const struct hda_pintbl[]) {
6177 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6181 .chain_id = ALC269_FIXUP_HEADSET_MIC
6183 [ALC256_FIXUP_HUAWEI_MBXP_PINS] = {
6184 .type = HDA_FIXUP_PINS,
6185 .v.pins = (const struct hda_pintbl[]) {
6199 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6200 .type = HDA_FIXUP_FUNC,
6201 .v.func = alc269_fixup_x101_headset_mic,
6203 [ALC269_FIXUP_ASUS_X101_VERB] = {
6204 .type = HDA_FIXUP_VERBS,
6205 .v.verbs = (const struct hda_verb[]) {
6206 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6207 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6208 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6212 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6214 [ALC269_FIXUP_ASUS_X101] = {
6215 .type = HDA_FIXUP_PINS,
6216 .v.pins = (const struct hda_pintbl[]) {
6217 { 0x18, 0x04a1182c }, /* Headset mic */
6221 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6223 [ALC271_FIXUP_AMIC_MIC2] = {
6224 .type = HDA_FIXUP_PINS,
6225 .v.pins = (const struct hda_pintbl[]) {
6226 { 0x14, 0x99130110 }, /* speaker */
6227 { 0x19, 0x01a19c20 }, /* mic */
6228 { 0x1b, 0x99a7012f }, /* int-mic */
6229 { 0x21, 0x0121401f }, /* HP out */
6233 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6234 .type = HDA_FIXUP_FUNC,
6235 .v.func = alc271_hp_gate_mic_jack,
6237 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6239 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6240 .type = HDA_FIXUP_FUNC,
6241 .v.func = alc269_fixup_limit_int_mic_boost,
6243 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6245 [ALC269_FIXUP_ACER_AC700] = {
6246 .type = HDA_FIXUP_PINS,
6247 .v.pins = (const struct hda_pintbl[]) {
6248 { 0x12, 0x99a3092f }, /* int-mic */
6249 { 0x14, 0x99130110 }, /* speaker */
6250 { 0x18, 0x03a11c20 }, /* mic */
6251 { 0x1e, 0x0346101e }, /* SPDIF1 */
6252 { 0x21, 0x0321101f }, /* HP out */
6256 .chain_id = ALC271_FIXUP_DMIC,
6258 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6259 .type = HDA_FIXUP_FUNC,
6260 .v.func = alc269_fixup_limit_int_mic_boost,
6262 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6264 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6265 .type = HDA_FIXUP_FUNC,
6266 .v.func = alc269_fixup_limit_int_mic_boost,
6268 .chain_id = ALC269VB_FIXUP_DMIC,
6270 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6271 .type = HDA_FIXUP_VERBS,
6272 .v.verbs = (const struct hda_verb[]) {
6273 /* class-D output amp +5dB */
6274 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6275 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6279 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6281 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6282 .type = HDA_FIXUP_FUNC,
6283 .v.func = alc269_fixup_limit_int_mic_boost,
6285 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6287 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6288 .type = HDA_FIXUP_PINS,
6289 .v.pins = (const struct hda_pintbl[]) {
6290 { 0x12, 0x99a3092f }, /* int-mic */
6291 { 0x18, 0x03a11d20 }, /* mic */
6292 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6296 [ALC283_FIXUP_CHROME_BOOK] = {
6297 .type = HDA_FIXUP_FUNC,
6298 .v.func = alc283_fixup_chromebook,
6300 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6301 .type = HDA_FIXUP_FUNC,
6302 .v.func = alc283_fixup_sense_combo_jack,
6304 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6306 [ALC282_FIXUP_ASUS_TX300] = {
6307 .type = HDA_FIXUP_FUNC,
6308 .v.func = alc282_fixup_asus_tx300,
6310 [ALC283_FIXUP_INT_MIC] = {
6311 .type = HDA_FIXUP_VERBS,
6312 .v.verbs = (const struct hda_verb[]) {
6313 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6314 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6318 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6320 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6321 .type = HDA_FIXUP_PINS,
6322 .v.pins = (const struct hda_pintbl[]) {
6323 { 0x17, 0x90170112 }, /* subwoofer */
6327 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6329 [ALC290_FIXUP_SUBWOOFER] = {
6330 .type = HDA_FIXUP_PINS,
6331 .v.pins = (const struct hda_pintbl[]) {
6332 { 0x17, 0x90170112 }, /* subwoofer */
6336 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6338 [ALC290_FIXUP_MONO_SPEAKERS] = {
6339 .type = HDA_FIXUP_FUNC,
6340 .v.func = alc290_fixup_mono_speakers,
6342 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6343 .type = HDA_FIXUP_FUNC,
6344 .v.func = alc290_fixup_mono_speakers,
6346 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6348 [ALC269_FIXUP_THINKPAD_ACPI] = {
6349 .type = HDA_FIXUP_FUNC,
6350 .v.func = alc_fixup_thinkpad_acpi,
6352 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6354 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6355 .type = HDA_FIXUP_FUNC,
6356 .v.func = alc_fixup_inv_dmic,
6358 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6360 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6361 .type = HDA_FIXUP_PINS,
6362 .v.pins = (const struct hda_pintbl[]) {
6363 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6367 .chain_id = ALC255_FIXUP_HEADSET_MODE
6369 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6370 .type = HDA_FIXUP_PINS,
6371 .v.pins = (const struct hda_pintbl[]) {
6372 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6376 .chain_id = ALC255_FIXUP_HEADSET_MODE
6378 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6379 .type = HDA_FIXUP_PINS,
6380 .v.pins = (const struct hda_pintbl[]) {
6381 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6382 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6386 .chain_id = ALC255_FIXUP_HEADSET_MODE
6388 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6389 .type = HDA_FIXUP_PINS,
6390 .v.pins = (const struct hda_pintbl[]) {
6391 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6395 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6397 [ALC255_FIXUP_HEADSET_MODE] = {
6398 .type = HDA_FIXUP_FUNC,
6399 .v.func = alc_fixup_headset_mode_alc255,
6401 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6403 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6404 .type = HDA_FIXUP_FUNC,
6405 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6407 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6408 .type = HDA_FIXUP_PINS,
6409 .v.pins = (const struct hda_pintbl[]) {
6410 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6411 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6415 .chain_id = ALC269_FIXUP_HEADSET_MODE
6417 [ALC292_FIXUP_TPT440_DOCK] = {
6418 .type = HDA_FIXUP_FUNC,
6419 .v.func = alc_fixup_tpt440_dock,
6421 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6423 [ALC292_FIXUP_TPT440] = {
6424 .type = HDA_FIXUP_FUNC,
6425 .v.func = alc_fixup_disable_aamix,
6427 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6429 [ALC283_FIXUP_HEADSET_MIC] = {
6430 .type = HDA_FIXUP_PINS,
6431 .v.pins = (const struct hda_pintbl[]) {
6432 { 0x19, 0x04a110f0 },
6436 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = {
6437 .type = HDA_FIXUP_FUNC,
6438 .v.func = alc_fixup_dell_wmi,
6440 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6441 .type = HDA_FIXUP_PINS,
6442 .v.pins = (const struct hda_pintbl[]) {
6443 { 0x12, 0x90a60130 },
6444 { 0x14, 0x90170110 },
6445 { 0x17, 0x40000008 },
6446 { 0x18, 0x411111f0 },
6447 { 0x19, 0x01a1913c },
6448 { 0x1a, 0x411111f0 },
6449 { 0x1b, 0x411111f0 },
6450 { 0x1d, 0x40f89b2d },
6451 { 0x1e, 0x411111f0 },
6452 { 0x21, 0x0321101f },
6456 [ALC280_FIXUP_HP_GPIO4] = {
6457 .type = HDA_FIXUP_FUNC,
6458 .v.func = alc280_fixup_hp_gpio4,
6460 [ALC286_FIXUP_HP_GPIO_LED] = {
6461 .type = HDA_FIXUP_FUNC,
6462 .v.func = alc286_fixup_hp_gpio_led,
6464 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6465 .type = HDA_FIXUP_FUNC,
6466 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6468 [ALC280_FIXUP_HP_DOCK_PINS] = {
6469 .type = HDA_FIXUP_PINS,
6470 .v.pins = (const struct hda_pintbl[]) {
6471 { 0x1b, 0x21011020 }, /* line-out */
6472 { 0x1a, 0x01a1903c }, /* headset mic */
6473 { 0x18, 0x2181103f }, /* line-in */
6477 .chain_id = ALC280_FIXUP_HP_GPIO4
6479 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6480 .type = HDA_FIXUP_PINS,
6481 .v.pins = (const struct hda_pintbl[]) {
6482 { 0x1b, 0x21011020 }, /* line-out */
6483 { 0x18, 0x2181103f }, /* line-in */
6487 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6489 [ALC280_FIXUP_HP_9480M] = {
6490 .type = HDA_FIXUP_FUNC,
6491 .v.func = alc280_fixup_hp_9480m,
6493 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6494 .type = HDA_FIXUP_FUNC,
6495 .v.func = alc_fixup_headset_mode_dell_alc288,
6497 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6499 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6500 .type = HDA_FIXUP_PINS,
6501 .v.pins = (const struct hda_pintbl[]) {
6502 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6503 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6507 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6509 [ALC288_FIXUP_DISABLE_AAMIX] = {
6510 .type = HDA_FIXUP_FUNC,
6511 .v.func = alc_fixup_disable_aamix,
6513 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6515 [ALC288_FIXUP_DELL_XPS_13] = {
6516 .type = HDA_FIXUP_FUNC,
6517 .v.func = alc_fixup_dell_xps13,
6519 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6521 [ALC292_FIXUP_DISABLE_AAMIX] = {
6522 .type = HDA_FIXUP_FUNC,
6523 .v.func = alc_fixup_disable_aamix,
6525 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6527 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
6528 .type = HDA_FIXUP_FUNC,
6529 .v.func = alc_fixup_disable_aamix,
6531 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6533 [ALC292_FIXUP_DELL_E7X] = {
6534 .type = HDA_FIXUP_FUNC,
6535 .v.func = alc_fixup_dell_xps13,
6537 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
6539 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6540 .type = HDA_FIXUP_PINS,
6541 .v.pins = (const struct hda_pintbl[]) {
6542 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6543 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6547 .chain_id = ALC269_FIXUP_HEADSET_MODE
6549 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
6550 .type = HDA_FIXUP_PINS,
6551 .v.pins = (const struct hda_pintbl[]) {
6552 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6556 .chain_id = ALC269_FIXUP_HEADSET_MODE
6558 [ALC275_FIXUP_DELL_XPS] = {
6559 .type = HDA_FIXUP_VERBS,
6560 .v.verbs = (const struct hda_verb[]) {
6561 /* Enables internal speaker */
6562 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
6563 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
6564 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
6565 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
6569 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
6570 .type = HDA_FIXUP_FUNC,
6571 .v.func = alc_fixup_disable_aamix,
6573 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6575 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
6576 .type = HDA_FIXUP_FUNC,
6577 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
6579 [ALC255_FIXUP_DELL_SPK_NOISE] = {
6580 .type = HDA_FIXUP_FUNC,
6581 .v.func = alc_fixup_disable_aamix,
6583 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6585 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
6586 .type = HDA_FIXUP_FUNC,
6587 .v.func = alc_fixup_disable_mic_vref,
6589 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6591 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6592 .type = HDA_FIXUP_VERBS,
6593 .v.verbs = (const struct hda_verb[]) {
6594 /* Disable pass-through path for FRONT 14h */
6595 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6596 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6600 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
6602 [ALC280_FIXUP_HP_HEADSET_MIC] = {
6603 .type = HDA_FIXUP_FUNC,
6604 .v.func = alc_fixup_disable_aamix,
6606 .chain_id = ALC269_FIXUP_HEADSET_MIC,
6608 [ALC221_FIXUP_HP_FRONT_MIC] = {
6609 .type = HDA_FIXUP_PINS,
6610 .v.pins = (const struct hda_pintbl[]) {
6611 { 0x19, 0x02a19020 }, /* Front Mic */
6615 [ALC292_FIXUP_TPT460] = {
6616 .type = HDA_FIXUP_FUNC,
6617 .v.func = alc_fixup_tpt440_dock,
6619 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
6621 [ALC298_FIXUP_SPK_VOLUME] = {
6622 .type = HDA_FIXUP_FUNC,
6623 .v.func = alc298_fixup_speaker_volume,
6625 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6627 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
6628 .type = HDA_FIXUP_FUNC,
6629 .v.func = alc298_fixup_speaker_volume,
6631 [ALC295_FIXUP_DISABLE_DAC3] = {
6632 .type = HDA_FIXUP_FUNC,
6633 .v.func = alc295_fixup_disable_dac3,
6635 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
6636 .type = HDA_FIXUP_FUNC,
6637 .v.func = alc285_fixup_speaker2_to_dac1,
6639 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6641 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
6642 .type = HDA_FIXUP_PINS,
6643 .v.pins = (const struct hda_pintbl[]) {
6644 { 0x1b, 0x90170151 },
6648 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6650 [ALC269_FIXUP_ATIV_BOOK_8] = {
6651 .type = HDA_FIXUP_FUNC,
6652 .v.func = alc_fixup_auto_mute_via_amp,
6654 .chain_id = ALC269_FIXUP_NO_SHUTUP
6656 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
6657 .type = HDA_FIXUP_PINS,
6658 .v.pins = (const struct hda_pintbl[]) {
6659 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6660 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
6664 .chain_id = ALC269_FIXUP_HEADSET_MODE
6666 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
6667 .type = HDA_FIXUP_PINS,
6668 .v.pins = (const struct hda_pintbl[]) {
6669 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6670 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6674 .chain_id = ALC269_FIXUP_HEADSET_MODE
6676 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
6677 .type = HDA_FIXUP_FUNC,
6678 .v.func = alc_fixup_headset_mode,
6680 [ALC256_FIXUP_ASUS_MIC] = {
6681 .type = HDA_FIXUP_PINS,
6682 .v.pins = (const struct hda_pintbl[]) {
6683 { 0x13, 0x90a60160 }, /* use as internal mic */
6684 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6688 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6690 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
6691 .type = HDA_FIXUP_FUNC,
6692 /* Set up GPIO2 for the speaker amp */
6693 .v.func = alc_fixup_gpio4,
6695 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6696 .type = HDA_FIXUP_PINS,
6697 .v.pins = (const struct hda_pintbl[]) {
6698 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6702 .chain_id = ALC269_FIXUP_HEADSET_MIC
6704 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
6705 .type = HDA_FIXUP_VERBS,
6706 .v.verbs = (const struct hda_verb[]) {
6707 /* Enables internal speaker */
6708 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
6709 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
6713 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6715 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
6716 .type = HDA_FIXUP_FUNC,
6717 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
6719 .chain_id = ALC269_FIXUP_GPIO2
6721 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
6722 .type = HDA_FIXUP_VERBS,
6723 .v.verbs = (const struct hda_verb[]) {
6724 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
6725 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
6729 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6731 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
6732 .type = HDA_FIXUP_PINS,
6733 .v.pins = (const struct hda_pintbl[]) {
6734 /* Change the mic location from front to right, otherwise there are
6735 two front mics with the same name, pulseaudio can't handle them.
6736 This is just a temporary workaround, after applying this fixup,
6737 there will be one "Front Mic" and one "Mic" in this machine.
6739 { 0x1a, 0x04a19040 },
6743 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
6744 .type = HDA_FIXUP_PINS,
6745 .v.pins = (const struct hda_pintbl[]) {
6746 { 0x16, 0x0101102f }, /* Rear Headset HP */
6747 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6748 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6749 { 0x1b, 0x02011020 },
6753 .chain_id = ALC225_FIXUP_S3_POP_NOISE
6755 [ALC225_FIXUP_S3_POP_NOISE] = {
6756 .type = HDA_FIXUP_FUNC,
6757 .v.func = alc225_fixup_s3_pop_noise,
6759 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6761 [ALC700_FIXUP_INTEL_REFERENCE] = {
6762 .type = HDA_FIXUP_VERBS,
6763 .v.verbs = (const struct hda_verb[]) {
6764 /* Enables internal speaker */
6765 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
6766 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
6767 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
6768 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
6769 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
6770 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
6771 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
6772 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
6776 [ALC274_FIXUP_DELL_BIND_DACS] = {
6777 .type = HDA_FIXUP_FUNC,
6778 .v.func = alc274_fixup_bind_dacs,
6780 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6782 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
6783 .type = HDA_FIXUP_PINS,
6784 .v.pins = (const struct hda_pintbl[]) {
6785 { 0x1b, 0x0401102f },
6789 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
6791 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
6792 .type = HDA_FIXUP_FUNC,
6793 .v.func = alc_fixup_tpt470_dock,
6795 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6797 [ALC298_FIXUP_TPT470_DOCK] = {
6798 .type = HDA_FIXUP_FUNC,
6799 .v.func = alc_fixup_tpt470_dacs,
6801 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
6803 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
6804 .type = HDA_FIXUP_PINS,
6805 .v.pins = (const struct hda_pintbl[]) {
6806 { 0x14, 0x0201101f },
6810 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6812 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
6813 .type = HDA_FIXUP_PINS,
6814 .v.pins = (const struct hda_pintbl[]) {
6815 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6819 .chain_id = ALC269_FIXUP_HEADSET_MIC
6821 [ALC295_FIXUP_HP_X360] = {
6822 .type = HDA_FIXUP_FUNC,
6823 .v.func = alc295_fixup_hp_top_speakers,
6825 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
6827 [ALC221_FIXUP_HP_HEADSET_MIC] = {
6828 .type = HDA_FIXUP_PINS,
6829 .v.pins = (const struct hda_pintbl[]) {
6830 { 0x19, 0x0181313f},
6834 .chain_id = ALC269_FIXUP_HEADSET_MIC
6836 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
6837 .type = HDA_FIXUP_FUNC,
6838 .v.func = alc285_fixup_invalidate_dacs,
6840 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6842 [ALC295_FIXUP_HP_AUTO_MUTE] = {
6843 .type = HDA_FIXUP_FUNC,
6844 .v.func = alc_fixup_auto_mute_via_amp,
6846 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
6847 .type = HDA_FIXUP_PINS,
6848 .v.pins = (const struct hda_pintbl[]) {
6849 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6853 .chain_id = ALC269_FIXUP_HEADSET_MIC
6855 [ALC294_FIXUP_ASUS_MIC] = {
6856 .type = HDA_FIXUP_PINS,
6857 .v.pins = (const struct hda_pintbl[]) {
6858 { 0x13, 0x90a60160 }, /* use as internal mic */
6859 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6863 .chain_id = ALC269_FIXUP_HEADSET_MIC
6865 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
6866 .type = HDA_FIXUP_PINS,
6867 .v.pins = (const struct hda_pintbl[]) {
6868 { 0x19, 0x01a1103c }, /* use as headset mic */
6872 .chain_id = ALC269_FIXUP_HEADSET_MIC
6874 [ALC294_FIXUP_ASUS_SPK] = {
6875 .type = HDA_FIXUP_VERBS,
6876 .v.verbs = (const struct hda_verb[]) {
6878 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
6879 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
6880 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
6881 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
6885 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
6887 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
6888 .type = HDA_FIXUP_PINS,
6889 .v.pins = (const struct hda_pintbl[]) {
6890 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6894 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6896 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
6897 .type = HDA_FIXUP_VERBS,
6898 .v.verbs = (const struct hda_verb[]) {
6899 /* Disable PCBEEP-IN passthrough */
6900 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6901 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6905 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6907 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
6908 .type = HDA_FIXUP_PINS,
6909 .v.pins = (const struct hda_pintbl[]) {
6910 { 0x19, 0x03a11130 },
6911 { 0x1a, 0x90a60140 }, /* use as internal mic */
6915 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6917 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
6918 .type = HDA_FIXUP_PINS,
6919 .v.pins = (const struct hda_pintbl[]) {
6920 { 0x16, 0x01011020 }, /* Rear Line out */
6921 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6925 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
6927 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
6928 .type = HDA_FIXUP_FUNC,
6929 .v.func = alc_fixup_auto_mute_via_amp,
6931 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6933 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
6934 .type = HDA_FIXUP_FUNC,
6935 .v.func = alc_fixup_disable_mic_vref,
6937 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6939 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
6940 .type = HDA_FIXUP_VERBS,
6941 .v.verbs = (const struct hda_verb[]) {
6942 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
6943 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
6947 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
6949 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
6950 .type = HDA_FIXUP_PINS,
6951 .v.pins = (const struct hda_pintbl[]) {
6952 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
6956 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6958 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6959 .type = HDA_FIXUP_PINS,
6960 .v.pins = (const struct hda_pintbl[]) {
6961 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6965 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6967 [ALC299_FIXUP_PREDATOR_SPK] = {
6968 .type = HDA_FIXUP_PINS,
6969 .v.pins = (const struct hda_pintbl[]) {
6970 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
6974 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
6975 .type = HDA_FIXUP_PINS,
6976 .v.pins = (const struct hda_pintbl[]) {
6977 { 0x19, 0x04a11040 },
6978 { 0x21, 0x04211020 },
6982 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6984 [ALC289_FIXUP_DELL_SPK2] = {
6985 .type = HDA_FIXUP_PINS,
6986 .v.pins = (const struct hda_pintbl[]) {
6987 { 0x17, 0x90170130 }, /* bass spk */
6991 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
6993 [ALC289_FIXUP_DUAL_SPK] = {
6994 .type = HDA_FIXUP_FUNC,
6995 .v.func = alc285_fixup_speaker2_to_dac1,
6997 .chain_id = ALC289_FIXUP_DELL_SPK2
6999 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7000 .type = HDA_FIXUP_FUNC,
7001 .v.func = alc285_fixup_speaker2_to_dac1,
7003 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7005 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7006 .type = HDA_FIXUP_FUNC,
7007 /* The GPIO must be pulled to initialize the AMP */
7008 .v.func = alc_fixup_gpio4,
7010 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7012 [ALC294_FIXUP_ASUS_HPE] = {
7013 .type = HDA_FIXUP_VERBS,
7014 .v.verbs = (const struct hda_verb[]) {
7016 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7017 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7021 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7023 [ALC285_FIXUP_HP_GPIO_LED] = {
7024 .type = HDA_FIXUP_FUNC,
7025 .v.func = alc285_fixup_hp_gpio_led,
7029 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
7030 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
7031 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
7032 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
7033 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7034 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7035 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7036 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
7037 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
7038 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7039 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7040 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
7041 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
7042 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
7043 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7044 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7045 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
7046 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7047 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7048 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7049 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7050 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
7051 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
7052 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
7053 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
7054 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
7055 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
7056 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
7057 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
7058 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
7059 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
7060 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7061 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7062 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7063 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7064 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7065 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
7066 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
7067 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
7068 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7069 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7070 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
7071 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7072 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
7073 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7074 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7075 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7076 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7077 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7078 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7079 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7080 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7081 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7082 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
7083 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
7084 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
7085 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
7086 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7087 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
7088 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
7089 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7090 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7091 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7092 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7093 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
7094 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
7095 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
7096 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7097 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7098 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7099 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7100 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7101 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7102 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7103 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
7104 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
7105 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7106 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7107 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7108 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7109 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7110 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
7111 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7112 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7113 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7114 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7115 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7116 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7117 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7118 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7119 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7120 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7121 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7122 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7123 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7124 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
7125 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
7126 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7127 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7128 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7129 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7130 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7131 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7132 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7133 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7134 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
7135 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7136 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7137 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7138 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7139 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7140 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7141 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7142 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7143 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7144 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7145 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7146 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7147 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7148 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7149 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7150 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7151 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7152 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7153 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
7154 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7155 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7156 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7157 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7158 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7159 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7160 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
7161 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7162 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7163 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7164 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
7165 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
7166 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7167 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7168 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7169 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7170 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7171 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7172 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7173 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
7174 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7175 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
7176 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7177 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
7178 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7179 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7180 SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
7181 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7182 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7183 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
7184 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7185 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7186 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
7187 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
7188 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
7189 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
7190 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
7191 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
7192 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
7193 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
7194 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7195 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
7196 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
7197 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
7198 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7199 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7200 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7201 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
7202 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
7203 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
7204 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
7205 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7206 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7207 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
7208 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
7209 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7210 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7211 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
7212 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7213 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7214 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
7215 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
7216 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7217 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7218 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
7219 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
7220 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
7221 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7222 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
7223 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
7224 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
7225 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
7226 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
7227 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
7228 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7229 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7230 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7231 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7232 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7233 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7234 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7235 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7236 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7237 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7238 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7239 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7240 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7241 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7242 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7243 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7244 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7245 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7246 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7247 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7248 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7249 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7250 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7251 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7252 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7253 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7254 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7255 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7256 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7257 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7258 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7259 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7260 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7261 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7262 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7263 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7264 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7265 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7266 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7267 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7268 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5|7][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
7269 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7270 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7271 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7272 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7273 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7274 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7275 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7276 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7277 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7278 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7279 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7280 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL5XNU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7281 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7282 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7283 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7284 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7285 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7286 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7287 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
7288 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7289 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
7290 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
7291 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
7292 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
7293 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
7294 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
7295 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
7296 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
7297 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
7298 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
7299 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
7300 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
7301 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
7302 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
7303 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
7304 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7305 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
7306 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7307 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
7308 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
7309 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
7310 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7311 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7312 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
7313 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
7314 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
7315 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7316 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7317 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
7318 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7319 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7320 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7321 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7322 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
7323 SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
7324 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7325 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7326 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7327 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7328 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7329 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7330 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7331 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7332 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7333 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7334 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
7335 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7336 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
7337 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7338 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
7339 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7340 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
7341 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
7342 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7343 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
7344 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
7345 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
7346 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
7347 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
7348 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
7349 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
7350 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
7351 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7352 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7353 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7354 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7355 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7356 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7357 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
7358 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS),
7359 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
7360 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
7361 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
7364 /* Below is a quirk table taken from the old code.
7365 * Basically the device should work as is without the fixup table.
7366 * If BIOS doesn't give a proper info, enable the corresponding
7369 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7371 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
7372 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
7373 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
7374 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
7375 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
7376 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
7377 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
7378 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
7379 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
7380 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
7381 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
7382 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
7383 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
7384 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
7385 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
7386 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
7387 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
7388 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
7389 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
7390 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
7391 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
7392 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
7393 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
7394 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
7395 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
7396 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
7397 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
7398 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
7399 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
7400 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
7401 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
7402 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
7403 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
7404 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
7405 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
7406 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
7407 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
7408 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
7409 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
7414 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
7415 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
7416 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
7417 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
7418 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
7422 static const struct hda_model_fixup alc269_fixup_models[] = {
7423 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
7424 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
7425 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
7426 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
7427 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7428 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
7429 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
7430 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
7431 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
7432 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
7433 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7434 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
7435 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
7436 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
7437 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
7438 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
7439 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
7440 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
7441 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
7442 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
7443 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
7444 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
7445 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
7446 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
7447 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
7448 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
7449 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
7450 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
7451 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
7452 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
7453 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
7454 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
7455 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
7456 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
7457 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
7458 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
7459 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
7460 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
7461 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
7462 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
7463 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
7464 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
7465 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
7466 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
7467 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
7468 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
7469 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
7470 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
7471 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
7472 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
7473 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
7474 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
7475 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
7476 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
7477 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
7478 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
7479 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
7480 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
7481 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
7482 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
7483 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
7484 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
7485 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
7486 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
7487 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
7488 {.id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, .name = "alc255-dell-mute"},
7489 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
7490 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
7491 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7492 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
7493 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
7494 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
7495 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
7496 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
7497 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
7498 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
7499 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
7500 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
7501 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
7502 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
7503 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
7504 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
7505 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
7506 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
7507 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
7508 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
7509 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
7510 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
7511 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
7512 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
7513 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
7514 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
7515 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
7516 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
7517 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
7518 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
7519 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
7520 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
7521 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
7522 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
7523 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
7524 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
7525 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
7526 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
7527 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
7528 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
7531 #define ALC225_STANDARD_PINS \
7534 #define ALC256_STANDARD_PINS \
7535 {0x12, 0x90a60140}, \
7536 {0x14, 0x90170110}, \
7539 #define ALC282_STANDARD_PINS \
7542 #define ALC290_STANDARD_PINS \
7545 #define ALC292_STANDARD_PINS \
7546 {0x14, 0x90170110}, \
7549 #define ALC295_STANDARD_PINS \
7550 {0x12, 0xb7a60130}, \
7551 {0x14, 0x90170110}, \
7554 #define ALC298_STANDARD_PINS \
7555 {0x12, 0x90a60130}, \
7558 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
7559 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
7564 {0x21, 0x0221102f}),
7565 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7568 {0x21, 0x02211030}),
7569 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7572 {0x21, 0x03211020}),
7573 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7576 {0x21, 0x03211020}),
7577 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7578 ALC225_STANDARD_PINS,
7580 {0x14, 0x901701a0}),
7581 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7582 ALC225_STANDARD_PINS,
7584 {0x14, 0x901701b0}),
7585 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7586 ALC225_STANDARD_PINS,
7588 {0x14, 0x901701a0}),
7589 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7590 ALC225_STANDARD_PINS,
7592 {0x14, 0x901701b0}),
7593 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7594 ALC225_STANDARD_PINS,
7596 {0x1b, 0x90170110}),
7597 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7600 {0x21, 0x02211020}),
7601 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7605 {0x21, 0x02211020}),
7606 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7611 {0x21, 0x0221101f}),
7612 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7617 {0x21, 0x0221101f}),
7618 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7622 {0x21, 0x0221101f}),
7623 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7626 {0x21, 0x02211020}),
7627 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7630 {0x21, 0x02211020}),
7631 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7632 {0x21, 0x02211020}),
7633 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7636 {0x21, 0x02211020}),
7637 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7639 {0x21, 0x02211020}),
7640 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7642 {0x21, 0x02211040}),
7643 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7646 {0x21, 0x02211020}),
7647 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7650 {0x21, 0x02211030}),
7651 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7654 {0x21, 0x0221101f}),
7655 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7658 {0x21, 0x0221101f}),
7659 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7662 {0x21, 0x0221103f}),
7663 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7666 {0x21, 0x0221103f}),
7667 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7670 {0x21, 0x0221103f}),
7671 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7674 {0x21, 0x0221105f}),
7675 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7678 {0x21, 0x0221101f}),
7679 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7683 {0x21, 0x0321102f}),
7684 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7687 {0x21, 0x02211040}),
7688 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7691 {0x21, 0x02211050}),
7692 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7695 {0x21, 0x02211030}),
7696 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7699 {0x21, 0x02211040}),
7700 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7703 {0x21, 0x02211040}),
7704 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7707 {0x21, 0x02211050}),
7708 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7711 {0x21, 0x02211040}),
7712 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7715 {0x21, 0x02211030}),
7716 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7718 {0x21, 0x02211010}),
7719 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7723 {0x21, 0x0221101f}),
7724 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7727 {0x21, 0x02211030}),
7728 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7731 {0x21, 0x02211030}),
7732 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7735 {0x21, 0x02211030}),
7736 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7739 {0x21, 0x02211020}),
7740 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7744 {0x21, 0x0221101f}),
7745 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7746 ALC256_STANDARD_PINS),
7747 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7750 {0x21, 0x0221101f}),
7751 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7754 {0x21, 0x04211020}),
7755 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7758 {0x21, 0x03211020}),
7759 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7762 {0x21, 0x03211020}),
7763 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7766 {0x21, 0x04211020}),
7767 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7770 {0x21, 0x03211020}),
7771 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7775 {0x21, 0x04211020}),
7776 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
7780 {0x1a, 0x04a11020}),
7781 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
7787 {0x1b, 0x02011020}),
7788 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7789 ALC282_STANDARD_PINS,
7792 {0x21, 0x0321101f}),
7793 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7794 ALC282_STANDARD_PINS,
7797 {0x21, 0x03211040}),
7798 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7799 ALC282_STANDARD_PINS,
7802 {0x21, 0x03211020}),
7803 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7804 ALC282_STANDARD_PINS,
7807 {0x21, 0x0421101f}),
7808 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
7809 ALC282_STANDARD_PINS,
7812 {0x21, 0x04211020}),
7813 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7814 ALC282_STANDARD_PINS,
7816 {0x21, 0x0321101f}),
7817 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7820 {0x21, 0x02211030}),
7821 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7822 ALC282_STANDARD_PINS,
7825 {0x21, 0x0321101f}),
7826 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7830 {0x21, 0x04211020}),
7831 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7834 {0x21, 0x02211020}),
7835 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7838 {0x21, 0x0321101f}),
7839 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7842 {0x21, 0x04211020}),
7843 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7844 ALC290_STANDARD_PINS,
7847 {0x1a, 0x04a11020}),
7848 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7849 ALC290_STANDARD_PINS,
7852 {0x1a, 0x04a11020}),
7853 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7854 ALC290_STANDARD_PINS,
7856 {0x1a, 0x04a11020}),
7857 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7858 ALC290_STANDARD_PINS,
7860 {0x1a, 0x04a11040}),
7861 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7862 ALC290_STANDARD_PINS,
7865 {0x1a, 0x04a11040}),
7866 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7867 ALC290_STANDARD_PINS,
7870 {0x1a, 0x04a11020}),
7871 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7872 ALC290_STANDARD_PINS,
7875 {0x1a, 0x04a11020}),
7876 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7877 ALC292_STANDARD_PINS,
7880 {0x19, 0x01a19030}),
7881 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7882 ALC292_STANDARD_PINS,
7886 {0x19, 0x01a1903e}),
7887 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7888 ALC292_STANDARD_PINS,
7889 {0x12, 0x90a60140}),
7890 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7891 ALC292_STANDARD_PINS,
7894 {0x19, 0x21a19030}),
7895 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7896 ALC292_STANDARD_PINS,
7897 {0x13, 0x90a60140}),
7898 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
7900 {0x21, 0x04211020}),
7901 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
7904 {0x21, 0x04211020}),
7905 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7908 {0x21, 0x03211020}),
7909 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7912 {0x21, 0x04211020}),
7913 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7916 {0x21, 0x03211020}),
7917 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7919 {0x21, 0x04211020}),
7920 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7922 {0x21, 0x04211030}),
7923 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7924 ALC295_STANDARD_PINS,
7926 {0x18, 0x21a19030}),
7927 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7928 ALC295_STANDARD_PINS,
7930 {0x18, 0x21a19050}),
7931 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7932 ALC295_STANDARD_PINS),
7933 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7934 ALC298_STANDARD_PINS,
7935 {0x17, 0x90170110}),
7936 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7937 ALC298_STANDARD_PINS,
7938 {0x17, 0x90170140}),
7939 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7940 ALC298_STANDARD_PINS,
7941 {0x17, 0x90170150}),
7942 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
7947 {0x21, 0x03211030}),
7948 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7949 ALC225_STANDARD_PINS,
7951 {0x17, 0x90170110}),
7952 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
7957 {0x21, 0x0221101f}),
7961 static void alc269_fill_coef(struct hda_codec *codec)
7963 struct alc_spec *spec = codec->spec;
7966 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
7969 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
7970 alc_write_coef_idx(codec, 0xf, 0x960b);
7971 alc_write_coef_idx(codec, 0xe, 0x8817);
7974 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
7975 alc_write_coef_idx(codec, 0xf, 0x960b);
7976 alc_write_coef_idx(codec, 0xe, 0x8814);
7979 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
7980 /* Power up output pin */
7981 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
7984 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
7985 val = alc_read_coef_idx(codec, 0xd);
7986 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
7987 /* Capless ramp up clock control */
7988 alc_write_coef_idx(codec, 0xd, val | (1<<10));
7990 val = alc_read_coef_idx(codec, 0x17);
7991 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
7992 /* Class D power on reset */
7993 alc_write_coef_idx(codec, 0x17, val | (1<<7));
7998 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
8003 static int patch_alc269(struct hda_codec *codec)
8005 struct alc_spec *spec;
8008 err = alc_alloc_spec(codec, 0x0b);
8013 spec->gen.shared_mic_vref_pin = 0x18;
8014 codec->power_save_node = 0;
8017 codec->patch_ops.suspend = alc269_suspend;
8018 codec->patch_ops.resume = alc269_resume;
8020 spec->shutup = alc_default_shutup;
8021 spec->init_hook = alc_default_init;
8023 switch (codec->core.vendor_id) {
8025 spec->codec_variant = ALC269_TYPE_ALC269VA;
8026 switch (alc_get_coef0(codec) & 0x00f0) {
8028 if (codec->bus->pci &&
8029 codec->bus->pci->subsystem_vendor == 0x1025 &&
8030 spec->cdefine.platform_type == 1)
8031 err = alc_codec_rename(codec, "ALC271X");
8032 spec->codec_variant = ALC269_TYPE_ALC269VB;
8035 if (codec->bus->pci &&
8036 codec->bus->pci->subsystem_vendor == 0x17aa &&
8037 codec->bus->pci->subsystem_device == 0x21f3)
8038 err = alc_codec_rename(codec, "ALC3202");
8039 spec->codec_variant = ALC269_TYPE_ALC269VC;
8042 spec->codec_variant = ALC269_TYPE_ALC269VD;
8045 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8049 spec->shutup = alc269_shutup;
8050 spec->init_hook = alc269_fill_coef;
8051 alc269_fill_coef(codec);
8056 spec->codec_variant = ALC269_TYPE_ALC280;
8059 spec->codec_variant = ALC269_TYPE_ALC282;
8060 spec->shutup = alc282_shutup;
8061 spec->init_hook = alc282_init;
8065 spec->codec_variant = ALC269_TYPE_ALC283;
8066 spec->shutup = alc283_shutup;
8067 spec->init_hook = alc283_init;
8071 spec->codec_variant = ALC269_TYPE_ALC284;
8074 spec->codec_variant = ALC269_TYPE_ALC293;
8078 spec->codec_variant = ALC269_TYPE_ALC286;
8081 spec->codec_variant = ALC269_TYPE_ALC298;
8085 spec->codec_variant = ALC269_TYPE_ALC255;
8086 spec->shutup = alc256_shutup;
8087 spec->init_hook = alc256_init;
8091 spec->codec_variant = ALC269_TYPE_ALC256;
8092 spec->shutup = alc256_shutup;
8093 spec->init_hook = alc256_init;
8094 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
8097 spec->codec_variant = ALC269_TYPE_ALC257;
8098 spec->shutup = alc256_shutup;
8099 spec->init_hook = alc256_init;
8100 spec->gen.mixer_nid = 0;
8107 spec->codec_variant = ALC269_TYPE_ALC215;
8108 spec->shutup = alc225_shutup;
8109 spec->init_hook = alc225_init;
8110 spec->gen.mixer_nid = 0;
8115 spec->codec_variant = ALC269_TYPE_ALC225;
8116 spec->shutup = alc225_shutup;
8117 spec->init_hook = alc225_init;
8118 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
8123 spec->codec_variant = ALC269_TYPE_ALC294;
8124 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
8125 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
8126 spec->init_hook = alc294_init;
8129 spec->codec_variant = ALC269_TYPE_ALC300;
8130 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
8133 spec->codec_variant = ALC269_TYPE_ALC623;
8139 spec->codec_variant = ALC269_TYPE_ALC700;
8140 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
8141 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
8142 spec->init_hook = alc294_init;
8147 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
8148 spec->has_alc5505_dsp = 1;
8149 spec->init_hook = alc5505_dsp_init;
8152 snd_hda_pick_fixup(codec, alc269_fixup_models,
8153 alc269_fixup_tbl, alc269_fixups);
8154 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
8155 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
8157 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8159 alc_auto_parse_customize_define(codec);
8161 if (has_cdefine_beep(codec))
8162 spec->gen.beep_nid = 0x01;
8164 /* automatic parse from the BIOS config */
8165 err = alc269_parse_auto_config(codec);
8169 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
8170 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
8175 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8188 static int alc861_parse_auto_config(struct hda_codec *codec)
8190 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
8191 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
8192 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
8195 /* Pin config fixes */
8197 ALC861_FIXUP_FSC_AMILO_PI1505,
8198 ALC861_FIXUP_AMP_VREF_0F,
8199 ALC861_FIXUP_NO_JACK_DETECT,
8200 ALC861_FIXUP_ASUS_A6RP,
8201 ALC660_FIXUP_ASUS_W7J,
8204 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
8205 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
8206 const struct hda_fixup *fix, int action)
8208 struct alc_spec *spec = codec->spec;
8211 if (action != HDA_FIXUP_ACT_INIT)
8213 val = snd_hda_codec_get_pin_target(codec, 0x0f);
8214 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
8215 val |= AC_PINCTL_IN_EN;
8216 val |= AC_PINCTL_VREF_50;
8217 snd_hda_set_pin_ctl(codec, 0x0f, val);
8218 spec->gen.keep_vref_in_automute = 1;
8221 /* suppress the jack-detection */
8222 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
8223 const struct hda_fixup *fix, int action)
8225 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8226 codec->no_jack_detect = 1;
8229 static const struct hda_fixup alc861_fixups[] = {
8230 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
8231 .type = HDA_FIXUP_PINS,
8232 .v.pins = (const struct hda_pintbl[]) {
8233 { 0x0b, 0x0221101f }, /* HP */
8234 { 0x0f, 0x90170310 }, /* speaker */
8238 [ALC861_FIXUP_AMP_VREF_0F] = {
8239 .type = HDA_FIXUP_FUNC,
8240 .v.func = alc861_fixup_asus_amp_vref_0f,
8242 [ALC861_FIXUP_NO_JACK_DETECT] = {
8243 .type = HDA_FIXUP_FUNC,
8244 .v.func = alc_fixup_no_jack_detect,
8246 [ALC861_FIXUP_ASUS_A6RP] = {
8247 .type = HDA_FIXUP_FUNC,
8248 .v.func = alc861_fixup_asus_amp_vref_0f,
8250 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
8252 [ALC660_FIXUP_ASUS_W7J] = {
8253 .type = HDA_FIXUP_VERBS,
8254 .v.verbs = (const struct hda_verb[]) {
8255 /* ASUS W7J needs a magic pin setup on unused NID 0x10
8256 * for enabling outputs
8258 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
8264 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
8265 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
8266 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
8267 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
8268 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
8269 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
8270 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
8271 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
8277 static int patch_alc861(struct hda_codec *codec)
8279 struct alc_spec *spec;
8282 err = alc_alloc_spec(codec, 0x15);
8287 spec->gen.beep_nid = 0x23;
8290 spec->power_hook = alc_power_eapd;
8293 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
8294 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8296 /* automatic parse from the BIOS config */
8297 err = alc861_parse_auto_config(codec);
8301 if (!spec->gen.no_analog) {
8302 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
8307 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8321 * In addition, an independent DAC
8323 static int alc861vd_parse_auto_config(struct hda_codec *codec)
8325 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
8326 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8327 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
8331 ALC660VD_FIX_ASUS_GPIO1,
8332 ALC861VD_FIX_DALLAS,
8335 /* exclude VREF80 */
8336 static void alc861vd_fixup_dallas(struct hda_codec *codec,
8337 const struct hda_fixup *fix, int action)
8339 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8340 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
8341 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8346 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
8347 const struct hda_fixup *fix, int action)
8349 struct alc_spec *spec = codec->spec;
8351 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8352 spec->gpio_mask |= 0x02;
8353 alc_fixup_gpio(codec, action, 0x01);
8356 static const struct hda_fixup alc861vd_fixups[] = {
8357 [ALC660VD_FIX_ASUS_GPIO1] = {
8358 .type = HDA_FIXUP_FUNC,
8359 .v.func = alc660vd_fixup_asus_gpio1,
8361 [ALC861VD_FIX_DALLAS] = {
8362 .type = HDA_FIXUP_FUNC,
8363 .v.func = alc861vd_fixup_dallas,
8367 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8368 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
8369 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8370 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
8376 static int patch_alc861vd(struct hda_codec *codec)
8378 struct alc_spec *spec;
8381 err = alc_alloc_spec(codec, 0x0b);
8386 spec->gen.beep_nid = 0x23;
8388 spec->shutup = alc_eapd_shutup;
8390 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
8391 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8393 /* automatic parse from the BIOS config */
8394 err = alc861vd_parse_auto_config(codec);
8398 if (!spec->gen.no_analog) {
8399 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
8404 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8416 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8417 * configuration. Each pin widget can choose any input DACs and a mixer.
8418 * Each ADC is connected from a mixer of all inputs. This makes possible
8419 * 6-channel independent captures.
8421 * In addition, an independent DAC for the multi-playback (not used in this
8426 * BIOS auto configuration
8429 static int alc662_parse_auto_config(struct hda_codec *codec)
8431 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
8432 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
8433 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8434 const hda_nid_t *ssids;
8436 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
8437 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
8438 codec->core.vendor_id == 0x10ec0671)
8439 ssids = alc663_ssids;
8441 ssids = alc662_ssids;
8442 return alc_parse_auto_config(codec, alc662_ignore, ssids);
8445 static void alc272_fixup_mario(struct hda_codec *codec,
8446 const struct hda_fixup *fix, int action)
8448 if (action != HDA_FIXUP_ACT_PRE_PROBE)
8450 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
8451 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
8452 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
8453 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
8454 (0 << AC_AMPCAP_MUTE_SHIFT)))
8455 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
8458 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
8460 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
8462 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
8463 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
8467 /* override the 2.1 chmap */
8468 static void alc_fixup_bass_chmap(struct hda_codec *codec,
8469 const struct hda_fixup *fix, int action)
8471 if (action == HDA_FIXUP_ACT_BUILD) {
8472 struct alc_spec *spec = codec->spec;
8473 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8477 /* avoid D3 for keeping GPIO up */
8478 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
8480 unsigned int power_state)
8482 struct alc_spec *spec = codec->spec;
8483 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
8488 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
8489 const struct hda_fixup *fix, int action)
8491 struct alc_spec *spec = codec->spec;
8493 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
8494 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8495 spec->mute_led_polarity = 1;
8496 codec->power_filter = gpio_led_power_filter;
8500 static void alc662_usi_automute_hook(struct hda_codec *codec,
8501 struct hda_jack_callback *jack)
8503 struct alc_spec *spec = codec->spec;
8506 snd_hda_gen_hp_automute(codec, jack);
8508 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
8510 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
8514 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
8515 const struct hda_fixup *fix, int action)
8517 struct alc_spec *spec = codec->spec;
8518 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8519 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8520 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
8524 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
8525 struct hda_jack_callback *cb)
8527 /* surround speakers at 0x1b already get muted automatically when
8528 * headphones are plugged in, but we have to mute/unmute the remaining
8529 * channels manually:
8530 * 0x15 - front left/front right
8531 * 0x18 - front center/ LFE
8533 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
8534 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
8535 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
8537 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
8538 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
8542 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
8543 const struct hda_fixup *fix, int action)
8545 /* Pin 0x1b: shared headphones jack and surround speakers */
8546 if (!is_jack_detectable(codec, 0x1b))
8550 case HDA_FIXUP_ACT_PRE_PROBE:
8551 snd_hda_jack_detect_enable_callback(codec, 0x1b,
8552 alc662_aspire_ethos_mute_speakers);
8553 /* subwoofer needs an extra GPIO setting to become audible */
8554 alc_setup_gpio(codec, 0x02);
8556 case HDA_FIXUP_ACT_INIT:
8557 /* Make sure to start in a correct state, i.e. if
8558 * headphones have been plugged in before powering up the system
8560 alc662_aspire_ethos_mute_speakers(codec, NULL);
8565 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
8566 const struct hda_fixup *fix, int action)
8568 struct alc_spec *spec = codec->spec;
8570 static const struct hda_pintbl pincfgs[] = {
8571 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
8572 { 0x1b, 0x0181304f },
8577 case HDA_FIXUP_ACT_PRE_PROBE:
8578 spec->gen.mixer_nid = 0;
8579 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8580 snd_hda_apply_pincfgs(codec, pincfgs);
8582 case HDA_FIXUP_ACT_INIT:
8583 alc_write_coef_idx(codec, 0x19, 0xa054);
8588 static void alc897_hp_automute_hook(struct hda_codec *codec,
8589 struct hda_jack_callback *jack)
8591 struct alc_spec *spec = codec->spec;
8594 snd_hda_gen_hp_automute(codec, jack);
8595 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
8596 snd_hda_set_pin_ctl(codec, 0x1b, vref);
8599 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
8600 const struct hda_fixup *fix, int action)
8602 struct alc_spec *spec = codec->spec;
8603 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8604 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
8605 spec->no_shutup_pins = 1;
8607 if (action == HDA_FIXUP_ACT_PROBE) {
8608 snd_hda_set_pin_ctl_cache(codec, 0x1a, PIN_IN | AC_PINCTL_VREF_100);
8612 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
8613 const struct hda_fixup *fix, int action)
8615 struct alc_spec *spec = codec->spec;
8617 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8618 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8619 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
8623 static const struct coef_fw alc668_coefs[] = {
8624 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
8625 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
8626 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
8627 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
8628 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
8629 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
8630 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
8631 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
8632 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
8633 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
8634 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
8635 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8636 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8637 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8638 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8639 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8640 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8641 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8642 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8643 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8647 static void alc668_restore_default_value(struct hda_codec *codec)
8649 alc_process_coef_fw(codec, alc668_coefs);
8653 ALC662_FIXUP_ASPIRE,
8654 ALC662_FIXUP_LED_GPIO1,
8655 ALC662_FIXUP_IDEAPAD,
8657 ALC662_FIXUP_CZC_P10T,
8658 ALC662_FIXUP_SKU_IGNORE,
8659 ALC662_FIXUP_HP_RP5800,
8660 ALC662_FIXUP_ASUS_MODE1,
8661 ALC662_FIXUP_ASUS_MODE2,
8662 ALC662_FIXUP_ASUS_MODE3,
8663 ALC662_FIXUP_ASUS_MODE4,
8664 ALC662_FIXUP_ASUS_MODE5,
8665 ALC662_FIXUP_ASUS_MODE6,
8666 ALC662_FIXUP_ASUS_MODE7,
8667 ALC662_FIXUP_ASUS_MODE8,
8668 ALC662_FIXUP_NO_JACK_DETECT,
8669 ALC662_FIXUP_ZOTAC_Z68,
8670 ALC662_FIXUP_INV_DMIC,
8671 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8672 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
8673 ALC662_FIXUP_HEADSET_MODE,
8674 ALC668_FIXUP_HEADSET_MODE,
8675 ALC662_FIXUP_BASS_MODE4_CHMAP,
8676 ALC662_FIXUP_BASS_16,
8677 ALC662_FIXUP_BASS_1A,
8678 ALC662_FIXUP_BASS_CHMAP,
8679 ALC668_FIXUP_AUTO_MUTE,
8680 ALC668_FIXUP_DELL_DISABLE_AAMIX,
8681 ALC668_FIXUP_DELL_XPS13,
8682 ALC662_FIXUP_ASUS_Nx50,
8683 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8684 ALC668_FIXUP_ASUS_Nx51,
8685 ALC668_FIXUP_MIC_COEF,
8686 ALC668_FIXUP_ASUS_G751,
8687 ALC891_FIXUP_HEADSET_MODE,
8688 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8689 ALC662_FIXUP_ACER_VERITON,
8690 ALC892_FIXUP_ASROCK_MOBO,
8691 ALC662_FIXUP_USI_FUNC,
8692 ALC662_FIXUP_USI_HEADSET_MODE,
8693 ALC662_FIXUP_LENOVO_MULTI_CODECS,
8694 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
8695 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
8696 ALC671_FIXUP_HP_HEADSET_MIC2,
8697 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
8698 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
8699 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
8700 ALC668_FIXUP_HEADSET_MIC,
8701 ALC668_FIXUP_MIC_DET_COEF,
8702 ALC897_FIXUP_LENOVO_HEADSET_MIC,
8703 ALC897_FIXUP_HEADSET_MIC_PIN,
8704 ALC897_FIXUP_HP_HSMIC_VERB,
8705 ALC897_FIXUP_LENOVO_HEADSET_MODE,
8706 ALC897_FIXUP_HEADSET_MIC_PIN2,
8709 static const struct hda_fixup alc662_fixups[] = {
8710 [ALC662_FIXUP_ASPIRE] = {
8711 .type = HDA_FIXUP_PINS,
8712 .v.pins = (const struct hda_pintbl[]) {
8713 { 0x15, 0x99130112 }, /* subwoofer */
8717 [ALC662_FIXUP_LED_GPIO1] = {
8718 .type = HDA_FIXUP_FUNC,
8719 .v.func = alc662_fixup_led_gpio1,
8721 [ALC662_FIXUP_IDEAPAD] = {
8722 .type = HDA_FIXUP_PINS,
8723 .v.pins = (const struct hda_pintbl[]) {
8724 { 0x17, 0x99130112 }, /* subwoofer */
8728 .chain_id = ALC662_FIXUP_LED_GPIO1,
8730 [ALC272_FIXUP_MARIO] = {
8731 .type = HDA_FIXUP_FUNC,
8732 .v.func = alc272_fixup_mario,
8734 [ALC662_FIXUP_CZC_P10T] = {
8735 .type = HDA_FIXUP_VERBS,
8736 .v.verbs = (const struct hda_verb[]) {
8737 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
8741 [ALC662_FIXUP_SKU_IGNORE] = {
8742 .type = HDA_FIXUP_FUNC,
8743 .v.func = alc_fixup_sku_ignore,
8745 [ALC662_FIXUP_HP_RP5800] = {
8746 .type = HDA_FIXUP_PINS,
8747 .v.pins = (const struct hda_pintbl[]) {
8748 { 0x14, 0x0221201f }, /* HP out */
8752 .chain_id = ALC662_FIXUP_SKU_IGNORE
8754 [ALC662_FIXUP_ASUS_MODE1] = {
8755 .type = HDA_FIXUP_PINS,
8756 .v.pins = (const struct hda_pintbl[]) {
8757 { 0x14, 0x99130110 }, /* speaker */
8758 { 0x18, 0x01a19c20 }, /* mic */
8759 { 0x19, 0x99a3092f }, /* int-mic */
8760 { 0x21, 0x0121401f }, /* HP out */
8764 .chain_id = ALC662_FIXUP_SKU_IGNORE
8766 [ALC662_FIXUP_ASUS_MODE2] = {
8767 .type = HDA_FIXUP_PINS,
8768 .v.pins = (const struct hda_pintbl[]) {
8769 { 0x14, 0x99130110 }, /* speaker */
8770 { 0x18, 0x01a19820 }, /* mic */
8771 { 0x19, 0x99a3092f }, /* int-mic */
8772 { 0x1b, 0x0121401f }, /* HP out */
8776 .chain_id = ALC662_FIXUP_SKU_IGNORE
8778 [ALC662_FIXUP_ASUS_MODE3] = {
8779 .type = HDA_FIXUP_PINS,
8780 .v.pins = (const struct hda_pintbl[]) {
8781 { 0x14, 0x99130110 }, /* speaker */
8782 { 0x15, 0x0121441f }, /* HP */
8783 { 0x18, 0x01a19840 }, /* mic */
8784 { 0x19, 0x99a3094f }, /* int-mic */
8785 { 0x21, 0x01211420 }, /* HP2 */
8789 .chain_id = ALC662_FIXUP_SKU_IGNORE
8791 [ALC662_FIXUP_ASUS_MODE4] = {
8792 .type = HDA_FIXUP_PINS,
8793 .v.pins = (const struct hda_pintbl[]) {
8794 { 0x14, 0x99130110 }, /* speaker */
8795 { 0x16, 0x99130111 }, /* speaker */
8796 { 0x18, 0x01a19840 }, /* mic */
8797 { 0x19, 0x99a3094f }, /* int-mic */
8798 { 0x21, 0x0121441f }, /* HP */
8802 .chain_id = ALC662_FIXUP_SKU_IGNORE
8804 [ALC662_FIXUP_ASUS_MODE5] = {
8805 .type = HDA_FIXUP_PINS,
8806 .v.pins = (const struct hda_pintbl[]) {
8807 { 0x14, 0x99130110 }, /* speaker */
8808 { 0x15, 0x0121441f }, /* HP */
8809 { 0x16, 0x99130111 }, /* speaker */
8810 { 0x18, 0x01a19840 }, /* mic */
8811 { 0x19, 0x99a3094f }, /* int-mic */
8815 .chain_id = ALC662_FIXUP_SKU_IGNORE
8817 [ALC662_FIXUP_ASUS_MODE6] = {
8818 .type = HDA_FIXUP_PINS,
8819 .v.pins = (const struct hda_pintbl[]) {
8820 { 0x14, 0x99130110 }, /* speaker */
8821 { 0x15, 0x01211420 }, /* HP2 */
8822 { 0x18, 0x01a19840 }, /* mic */
8823 { 0x19, 0x99a3094f }, /* int-mic */
8824 { 0x1b, 0x0121441f }, /* HP */
8828 .chain_id = ALC662_FIXUP_SKU_IGNORE
8830 [ALC662_FIXUP_ASUS_MODE7] = {
8831 .type = HDA_FIXUP_PINS,
8832 .v.pins = (const struct hda_pintbl[]) {
8833 { 0x14, 0x99130110 }, /* speaker */
8834 { 0x17, 0x99130111 }, /* speaker */
8835 { 0x18, 0x01a19840 }, /* mic */
8836 { 0x19, 0x99a3094f }, /* int-mic */
8837 { 0x1b, 0x01214020 }, /* HP */
8838 { 0x21, 0x0121401f }, /* HP */
8842 .chain_id = ALC662_FIXUP_SKU_IGNORE
8844 [ALC662_FIXUP_ASUS_MODE8] = {
8845 .type = HDA_FIXUP_PINS,
8846 .v.pins = (const struct hda_pintbl[]) {
8847 { 0x14, 0x99130110 }, /* speaker */
8848 { 0x12, 0x99a30970 }, /* int-mic */
8849 { 0x15, 0x01214020 }, /* HP */
8850 { 0x17, 0x99130111 }, /* speaker */
8851 { 0x18, 0x01a19840 }, /* mic */
8852 { 0x21, 0x0121401f }, /* HP */
8856 .chain_id = ALC662_FIXUP_SKU_IGNORE
8858 [ALC662_FIXUP_NO_JACK_DETECT] = {
8859 .type = HDA_FIXUP_FUNC,
8860 .v.func = alc_fixup_no_jack_detect,
8862 [ALC662_FIXUP_ZOTAC_Z68] = {
8863 .type = HDA_FIXUP_PINS,
8864 .v.pins = (const struct hda_pintbl[]) {
8865 { 0x1b, 0x02214020 }, /* Front HP */
8869 [ALC662_FIXUP_INV_DMIC] = {
8870 .type = HDA_FIXUP_FUNC,
8871 .v.func = alc_fixup_inv_dmic,
8873 [ALC668_FIXUP_DELL_XPS13] = {
8874 .type = HDA_FIXUP_FUNC,
8875 .v.func = alc_fixup_dell_xps13,
8877 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
8879 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
8880 .type = HDA_FIXUP_FUNC,
8881 .v.func = alc_fixup_disable_aamix,
8883 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8885 [ALC668_FIXUP_AUTO_MUTE] = {
8886 .type = HDA_FIXUP_FUNC,
8887 .v.func = alc_fixup_auto_mute_via_amp,
8889 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8891 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
8892 .type = HDA_FIXUP_PINS,
8893 .v.pins = (const struct hda_pintbl[]) {
8894 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8895 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8899 .chain_id = ALC662_FIXUP_HEADSET_MODE
8901 [ALC662_FIXUP_HEADSET_MODE] = {
8902 .type = HDA_FIXUP_FUNC,
8903 .v.func = alc_fixup_headset_mode_alc662,
8905 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
8906 .type = HDA_FIXUP_PINS,
8907 .v.pins = (const struct hda_pintbl[]) {
8908 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8909 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8913 .chain_id = ALC668_FIXUP_HEADSET_MODE
8915 [ALC668_FIXUP_HEADSET_MODE] = {
8916 .type = HDA_FIXUP_FUNC,
8917 .v.func = alc_fixup_headset_mode_alc668,
8919 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8920 .type = HDA_FIXUP_FUNC,
8921 .v.func = alc_fixup_bass_chmap,
8923 .chain_id = ALC662_FIXUP_ASUS_MODE4
8925 [ALC662_FIXUP_BASS_16] = {
8926 .type = HDA_FIXUP_PINS,
8927 .v.pins = (const struct hda_pintbl[]) {
8928 {0x16, 0x80106111}, /* bass speaker */
8932 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8934 [ALC662_FIXUP_BASS_1A] = {
8935 .type = HDA_FIXUP_PINS,
8936 .v.pins = (const struct hda_pintbl[]) {
8937 {0x1a, 0x80106111}, /* bass speaker */
8941 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8943 [ALC662_FIXUP_BASS_CHMAP] = {
8944 .type = HDA_FIXUP_FUNC,
8945 .v.func = alc_fixup_bass_chmap,
8947 [ALC662_FIXUP_ASUS_Nx50] = {
8948 .type = HDA_FIXUP_FUNC,
8949 .v.func = alc_fixup_auto_mute_via_amp,
8951 .chain_id = ALC662_FIXUP_BASS_1A
8953 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
8954 .type = HDA_FIXUP_FUNC,
8955 .v.func = alc_fixup_headset_mode_alc668,
8956 .chain_id = ALC662_FIXUP_BASS_CHMAP
8958 [ALC668_FIXUP_ASUS_Nx51] = {
8959 .type = HDA_FIXUP_PINS,
8960 .v.pins = (const struct hda_pintbl[]) {
8961 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8962 { 0x1a, 0x90170151 }, /* bass speaker */
8963 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8967 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8969 [ALC668_FIXUP_MIC_COEF] = {
8970 .type = HDA_FIXUP_VERBS,
8971 .v.verbs = (const struct hda_verb[]) {
8972 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
8973 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
8977 [ALC668_FIXUP_ASUS_G751] = {
8978 .type = HDA_FIXUP_PINS,
8979 .v.pins = (const struct hda_pintbl[]) {
8980 { 0x16, 0x0421101f }, /* HP */
8984 .chain_id = ALC668_FIXUP_MIC_COEF
8986 [ALC891_FIXUP_HEADSET_MODE] = {
8987 .type = HDA_FIXUP_FUNC,
8988 .v.func = alc_fixup_headset_mode,
8990 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
8991 .type = HDA_FIXUP_PINS,
8992 .v.pins = (const struct hda_pintbl[]) {
8993 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8994 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8998 .chain_id = ALC891_FIXUP_HEADSET_MODE
9000 [ALC662_FIXUP_ACER_VERITON] = {
9001 .type = HDA_FIXUP_PINS,
9002 .v.pins = (const struct hda_pintbl[]) {
9003 { 0x15, 0x50170120 }, /* no internal speaker */
9007 [ALC892_FIXUP_ASROCK_MOBO] = {
9008 .type = HDA_FIXUP_PINS,
9009 .v.pins = (const struct hda_pintbl[]) {
9010 { 0x15, 0x40f000f0 }, /* disabled */
9011 { 0x16, 0x40f000f0 }, /* disabled */
9015 [ALC662_FIXUP_USI_FUNC] = {
9016 .type = HDA_FIXUP_FUNC,
9017 .v.func = alc662_fixup_usi_headset_mic,
9019 [ALC662_FIXUP_USI_HEADSET_MODE] = {
9020 .type = HDA_FIXUP_PINS,
9021 .v.pins = (const struct hda_pintbl[]) {
9022 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
9023 { 0x18, 0x01a1903d },
9027 .chain_id = ALC662_FIXUP_USI_FUNC
9029 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
9030 .type = HDA_FIXUP_FUNC,
9031 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
9033 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
9034 .type = HDA_FIXUP_FUNC,
9035 .v.func = alc662_fixup_aspire_ethos_hp,
9037 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
9038 .type = HDA_FIXUP_PINS,
9039 .v.pins = (const struct hda_pintbl[]) {
9040 { 0x15, 0x92130110 }, /* front speakers */
9041 { 0x18, 0x99130111 }, /* center/subwoofer */
9042 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
9046 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
9048 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
9049 .type = HDA_FIXUP_FUNC,
9050 .v.func = alc671_fixup_hp_headset_mic2,
9052 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
9053 .type = HDA_FIXUP_PINS,
9054 .v.pins = (const struct hda_pintbl[]) {
9055 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9059 .chain_id = ALC662_FIXUP_USI_FUNC
9061 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
9062 .type = HDA_FIXUP_PINS,
9063 .v.pins = (const struct hda_pintbl[]) {
9064 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
9065 { 0x1b, 0x0221144f },
9069 .chain_id = ALC662_FIXUP_USI_FUNC
9071 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
9072 .type = HDA_FIXUP_PINS,
9073 .v.pins = (const struct hda_pintbl[]) {
9074 { 0x1b, 0x04a1112c },
9078 .chain_id = ALC668_FIXUP_HEADSET_MIC
9080 [ALC668_FIXUP_HEADSET_MIC] = {
9081 .type = HDA_FIXUP_FUNC,
9082 .v.func = alc269_fixup_headset_mic,
9084 .chain_id = ALC668_FIXUP_MIC_DET_COEF
9086 [ALC668_FIXUP_MIC_DET_COEF] = {
9087 .type = HDA_FIXUP_VERBS,
9088 .v.verbs = (const struct hda_verb[]) {
9089 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
9090 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
9094 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
9095 .type = HDA_FIXUP_FUNC,
9096 .v.func = alc897_fixup_lenovo_headset_mic,
9098 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
9099 .type = HDA_FIXUP_PINS,
9100 .v.pins = (const struct hda_pintbl[]) {
9101 { 0x1a, 0x03a11050 },
9105 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
9107 [ALC897_FIXUP_HP_HSMIC_VERB] = {
9108 .type = HDA_FIXUP_PINS,
9109 .v.pins = (const struct hda_pintbl[]) {
9110 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
9114 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
9115 .type = HDA_FIXUP_FUNC,
9116 .v.func = alc897_fixup_lenovo_headset_mode,
9118 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
9119 .type = HDA_FIXUP_PINS,
9120 .v.pins = (const struct hda_pintbl[]) {
9121 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
9125 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
9129 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
9130 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
9131 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
9132 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
9133 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
9134 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
9135 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
9136 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
9137 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9138 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
9139 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
9140 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9141 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9142 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
9143 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
9144 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
9145 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9146 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9147 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9148 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9149 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9150 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
9151 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
9152 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
9153 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
9154 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
9155 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9156 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
9157 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
9158 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9159 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9160 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
9161 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
9162 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
9163 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
9164 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
9165 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
9166 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9167 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
9168 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
9169 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
9170 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
9171 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
9172 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
9173 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
9174 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
9175 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
9176 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
9177 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
9178 SND_PCI_QUIRK(0x17aa, 0x3364, "Lenovo ThinkCentre M90 Gen5", ALC897_FIXUP_HEADSET_MIC_PIN),
9179 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
9180 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
9181 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
9182 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
9183 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9184 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
9185 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
9186 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
9189 /* Below is a quirk table taken from the old code.
9190 * Basically the device should work as is without the fixup table.
9191 * If BIOS doesn't give a proper info, enable the corresponding
9194 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
9195 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
9196 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
9197 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
9198 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9199 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9200 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9201 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
9202 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
9203 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9204 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
9205 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
9206 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
9207 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
9208 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
9209 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9210 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
9211 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
9212 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9213 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9214 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9215 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9216 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
9217 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
9218 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
9219 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9220 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
9221 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9222 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9223 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
9224 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9225 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9226 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
9227 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
9228 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
9229 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
9230 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
9231 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
9232 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
9233 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9234 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
9235 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
9236 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9237 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
9238 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
9239 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
9240 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
9241 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
9242 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9243 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
9248 static const struct hda_model_fixup alc662_fixup_models[] = {
9249 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
9250 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
9251 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
9252 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
9253 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
9254 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
9255 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
9256 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
9257 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
9258 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
9259 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
9260 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
9261 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
9262 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
9263 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
9264 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9265 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
9266 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
9267 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
9268 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
9269 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
9270 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
9271 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
9272 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
9273 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
9274 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
9275 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
9276 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
9277 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
9278 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9279 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
9283 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
9284 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9288 {0x21, 0x01014020}),
9289 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9293 {0x21, 0x01014020}),
9294 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9298 {0x1b, 0x0221401f}),
9299 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9303 {0x16, 0x03011020}),
9304 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9308 {0x16, 0x03011020}),
9309 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9313 {0x16, 0x03011020}),
9314 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9317 {0x16, 0x03011020}),
9318 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
9321 {0x15, 0x0321101f}),
9322 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9327 {0x21, 0x02211020}),
9328 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9332 {0x21, 0x02211020}),
9333 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9338 {0x21, 0x02211030}),
9344 static int patch_alc662(struct hda_codec *codec)
9346 struct alc_spec *spec;
9349 err = alc_alloc_spec(codec, 0x0b);
9355 spec->shutup = alc_eapd_shutup;
9357 /* handle multiple HPs as is */
9358 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
9360 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9362 switch (codec->core.vendor_id) {
9364 spec->init_hook = alc668_restore_default_value;
9368 snd_hda_pick_fixup(codec, alc662_fixup_models,
9369 alc662_fixup_tbl, alc662_fixups);
9370 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
9371 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9373 alc_auto_parse_customize_define(codec);
9375 if (has_cdefine_beep(codec))
9376 spec->gen.beep_nid = 0x01;
9378 if ((alc_get_coef0(codec) & (1 << 14)) &&
9379 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
9380 spec->cdefine.platform_type == 1) {
9381 err = alc_codec_rename(codec, "ALC272X");
9386 /* automatic parse from the BIOS config */
9387 err = alc662_parse_auto_config(codec);
9391 if (!spec->gen.no_analog && spec->gen.beep_nid) {
9392 switch (codec->core.vendor_id) {
9394 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9400 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
9403 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
9410 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9423 static int alc680_parse_auto_config(struct hda_codec *codec)
9425 return alc_parse_auto_config(codec, NULL, NULL);
9430 static int patch_alc680(struct hda_codec *codec)
9434 /* ALC680 has no aa-loopback mixer */
9435 err = alc_alloc_spec(codec, 0);
9439 /* automatic parse from the BIOS config */
9440 err = alc680_parse_auto_config(codec);
9452 static const struct hda_device_id snd_hda_id_realtek[] = {
9453 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
9454 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
9455 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
9456 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
9457 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
9458 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
9459 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
9460 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
9461 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
9462 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
9463 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
9464 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
9465 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
9466 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
9467 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
9468 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
9469 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
9470 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
9471 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
9472 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
9473 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
9474 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
9475 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
9476 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
9477 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
9478 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
9479 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
9480 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
9481 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
9482 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
9483 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
9484 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
9485 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
9486 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
9487 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
9488 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
9489 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
9490 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
9491 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
9492 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
9493 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
9494 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
9495 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
9496 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
9497 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
9498 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
9499 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
9500 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
9501 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
9502 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
9503 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
9504 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
9505 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
9506 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
9507 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
9508 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
9509 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
9510 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
9511 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
9512 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
9513 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
9514 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
9515 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
9516 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
9517 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
9518 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
9519 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
9520 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
9521 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
9522 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
9523 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
9524 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
9525 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
9526 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
9527 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
9528 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
9529 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
9532 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
9534 MODULE_LICENSE("GPL");
9535 MODULE_DESCRIPTION("Realtek HD-audio codec");
9537 static struct hda_codec_driver realtek_driver = {
9538 .id = snd_hda_id_realtek,
9541 module_hda_codec_driver(realtek_driver);