1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine;
82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
88 bool gpio_write_delay; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity;
92 int micmute_led_polarity;
93 hda_nid_t mute_led_nid;
94 hda_nid_t cap_mute_led_nid;
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
101 hda_nid_t headset_mic_pin;
102 hda_nid_t headphone_mic_pin;
103 int current_headset_mode;
104 int current_headset_type;
107 void (*init_hook)(struct hda_codec *codec);
109 void (*power_hook)(struct hda_codec *codec);
111 void (*shutup)(struct hda_codec *codec);
112 void (*reboot_notify)(struct hda_codec *codec);
115 int codec_variant; /* flag for other variants */
116 unsigned int has_alc5505_dsp:1;
117 unsigned int no_depop_delay:1;
118 unsigned int done_hp_init:1;
119 unsigned int no_shutup_pins:1;
120 unsigned int ultra_low_power:1;
121 unsigned int has_hs_key:1;
122 unsigned int no_internal_mic_pin: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);
292 static void alc_fixup_micmute_led(struct hda_codec *codec,
293 const struct hda_fixup *fix, int action)
295 if (action == HDA_FIXUP_ACT_PRE_PROBE)
296 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
300 * Fix hardware PLL issue
301 * On some codecs, the analog PLL gating control must be off while
302 * the default value is 1.
304 static void alc_fix_pll(struct hda_codec *codec)
306 struct alc_spec *spec = codec->spec;
309 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
310 1 << spec->pll_coef_bit, 0);
313 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
314 unsigned int coef_idx, unsigned int coef_bit)
316 struct alc_spec *spec = codec->spec;
318 spec->pll_coef_idx = coef_idx;
319 spec->pll_coef_bit = coef_bit;
323 /* update the master volume per volume-knob's unsol event */
324 static void alc_update_knob_master(struct hda_codec *codec,
325 struct hda_jack_callback *jack)
328 struct snd_kcontrol *kctl;
329 struct snd_ctl_elem_value *uctl;
331 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
334 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
337 val = snd_hda_codec_read(codec, jack->nid, 0,
338 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
339 val &= HDA_AMP_VOLMASK;
340 uctl->value.integer.value[0] = val;
341 uctl->value.integer.value[1] = val;
342 kctl->put(kctl, uctl);
346 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
348 /* For some reason, the res given from ALC880 is broken.
349 Here we adjust it properly. */
350 snd_hda_jack_unsol_event(codec, res >> 2);
353 /* Change EAPD to verb control */
354 static void alc_fill_eapd_coef(struct hda_codec *codec)
358 coef = alc_get_coef0(codec);
360 switch (codec->core.vendor_id) {
362 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
366 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
369 if ((coef & 0x00f0) == 0x0010)
370 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
371 if ((coef & 0x00f0) == 0x0020)
372 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
373 if ((coef & 0x00f0) == 0x0030)
374 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
380 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
385 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
403 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
406 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
409 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
410 alc_write_coef_idx(codec, 0x8, 0x4ab7);
413 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
422 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
425 if ((coef & 0x00f0) == 0x0030)
426 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
435 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
439 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
442 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
445 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
448 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
449 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
453 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
460 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
465 /* additional initialization for ALC888 variants */
466 static void alc888_coef_init(struct hda_codec *codec)
468 switch (alc_get_coef0(codec) & 0x00f0) {
473 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
478 /* turn on/off EAPD control (only if available) */
479 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
481 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
483 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
484 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
488 /* turn on/off EAPD controls of the codec */
489 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
491 /* We currently only handle front, HP */
492 static const hda_nid_t pins[] = {
493 0x0f, 0x10, 0x14, 0x15, 0x17, 0
496 for (p = pins; *p; p++)
497 set_eapd(codec, *p, on);
500 static int find_ext_mic_pin(struct hda_codec *codec);
502 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
504 const struct hda_pincfg *pin;
505 int mic_pin = find_ext_mic_pin(codec);
508 /* don't shut up pins when unloading the driver; otherwise it breaks
509 * the default pin setup at the next load of the driver
511 if (codec->bus->shutdown)
514 snd_array_for_each(&codec->init_pins, i, pin) {
515 /* use read here for syncing after issuing each verb */
516 if (pin->nid != mic_pin)
517 snd_hda_codec_read(codec, pin->nid, 0,
518 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
521 codec->pins_shutup = 1;
524 static void alc_shutup_pins(struct hda_codec *codec)
526 struct alc_spec *spec = codec->spec;
528 switch (codec->core.vendor_id) {
533 alc_headset_mic_no_shutup(codec);
536 if (!spec->no_shutup_pins)
537 snd_hda_shutup_pins(codec);
542 /* generic shutup callback;
543 * just turning off EAPD and a little pause for avoiding pop-noise
545 static void alc_eapd_shutup(struct hda_codec *codec)
547 struct alc_spec *spec = codec->spec;
549 alc_auto_setup_eapd(codec, false);
550 if (!spec->no_depop_delay)
552 alc_shutup_pins(codec);
555 /* generic EAPD initialization */
556 static void alc_auto_init_amp(struct hda_codec *codec, int type)
558 alc_auto_setup_eapd(codec, true);
559 alc_write_gpio(codec);
561 case ALC_INIT_DEFAULT:
562 switch (codec->core.vendor_id) {
564 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
570 alc_update_coef_idx(codec, 7, 0, 0x2030);
573 alc888_coef_init(codec);
580 /* get a primary headphone pin if available */
581 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
583 if (spec->gen.autocfg.hp_pins[0])
584 return spec->gen.autocfg.hp_pins[0];
585 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
586 return spec->gen.autocfg.line_out_pins[0];
591 * Realtek SSID verification
594 /* Could be any non-zero and even value. When used as fixup, tells
595 * the driver to ignore any present sku defines.
597 #define ALC_FIXUP_SKU_IGNORE (2)
599 static void alc_fixup_sku_ignore(struct hda_codec *codec,
600 const struct hda_fixup *fix, int action)
602 struct alc_spec *spec = codec->spec;
603 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
604 spec->cdefine.fixup = 1;
605 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
609 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
610 const struct hda_fixup *fix, int action)
612 struct alc_spec *spec = codec->spec;
614 if (action == HDA_FIXUP_ACT_PROBE) {
615 spec->no_depop_delay = 1;
616 codec->depop_delay = 0;
620 static int alc_auto_parse_customize_define(struct hda_codec *codec)
622 unsigned int ass, tmp, i;
624 struct alc_spec *spec = codec->spec;
626 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
628 if (spec->cdefine.fixup) {
629 ass = spec->cdefine.sku_cfg;
630 if (ass == ALC_FIXUP_SKU_IGNORE)
635 if (!codec->bus->pci)
637 ass = codec->core.subsystem_id & 0xffff;
638 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
642 if (codec->core.vendor_id == 0x10ec0260)
644 ass = snd_hda_codec_get_pincfg(codec, nid);
647 codec_info(codec, "%s: SKU not ready 0x%08x\n",
648 codec->core.chip_name, ass);
654 for (i = 1; i < 16; i++) {
658 if (((ass >> 16) & 0xf) != tmp)
661 spec->cdefine.port_connectivity = ass >> 30;
662 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
663 spec->cdefine.check_sum = (ass >> 16) & 0xf;
664 spec->cdefine.customization = ass >> 8;
666 spec->cdefine.sku_cfg = ass;
667 spec->cdefine.external_amp = (ass & 0x38) >> 3;
668 spec->cdefine.platform_type = (ass & 0x4) >> 2;
669 spec->cdefine.swap = (ass & 0x2) >> 1;
670 spec->cdefine.override = ass & 0x1;
672 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
673 nid, spec->cdefine.sku_cfg);
674 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
675 spec->cdefine.port_connectivity);
676 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
677 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
678 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
679 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
680 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
681 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
682 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
687 /* return the position of NID in the list, or -1 if not found */
688 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
691 for (i = 0; i < nums; i++)
696 /* return true if the given NID is found in the list */
697 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
699 return find_idx_in_nid_list(nid, list, nums) >= 0;
702 /* check subsystem ID and set up device-specific initialization;
703 * return 1 if initialized, 0 if invalid SSID
705 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
706 * 31 ~ 16 : Manufacture ID
708 * 7 ~ 0 : Assembly ID
709 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
711 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
713 unsigned int ass, tmp, i;
715 struct alc_spec *spec = codec->spec;
717 if (spec->cdefine.fixup) {
718 ass = spec->cdefine.sku_cfg;
719 if (ass == ALC_FIXUP_SKU_IGNORE)
724 ass = codec->core.subsystem_id & 0xffff;
725 if (codec->bus->pci &&
726 ass != codec->bus->pci->subsystem_device && (ass & 1))
729 /* invalid SSID, check the special NID pin defcfg instead */
731 * 31~30 : port connectivity
734 * 19~16 : Check sum (15:1)
739 if (codec->core.vendor_id == 0x10ec0260)
741 ass = snd_hda_codec_get_pincfg(codec, nid);
743 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
747 if ((ass >> 30) != 1) /* no physical connection */
752 for (i = 1; i < 16; i++) {
756 if (((ass >> 16) & 0xf) != tmp)
759 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
760 ass & 0xffff, codec->core.vendor_id);
764 * 2 : 0 --> Desktop, 1 --> Laptop
765 * 3~5 : External Amplifier control
768 tmp = (ass & 0x38) >> 3; /* external Amp control */
769 if (spec->init_amp == ALC_INIT_UNDEFINED) {
772 alc_setup_gpio(codec, 0x01);
775 alc_setup_gpio(codec, 0x02);
778 alc_setup_gpio(codec, 0x03);
782 spec->init_amp = ALC_INIT_DEFAULT;
787 /* is laptop or Desktop and enable the function "Mute internal speaker
788 * when the external headphone out jack is plugged"
793 * 10~8 : Jack location
794 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
796 * 15 : 1 --> enable the function "Mute internal speaker
797 * when the external headphone out jack is plugged"
799 if (!alc_get_hp_pin(spec)) {
801 tmp = (ass >> 11) & 0x3; /* HP to chassis */
803 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
804 spec->gen.autocfg.line_outs))
806 spec->gen.autocfg.hp_pins[0] = nid;
811 /* Check the validity of ALC subsystem-id
812 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
813 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
815 if (!alc_subsystem_id(codec, ports)) {
816 struct alc_spec *spec = codec->spec;
817 if (spec->init_amp == ALC_INIT_UNDEFINED) {
819 "realtek: Enable default setup for auto mode as fallback\n");
820 spec->init_amp = ALC_INIT_DEFAULT;
828 static void alc_fixup_inv_dmic(struct hda_codec *codec,
829 const struct hda_fixup *fix, int action)
831 struct alc_spec *spec = codec->spec;
833 spec->gen.inv_dmic_split = 1;
837 static int alc_build_controls(struct hda_codec *codec)
841 err = snd_hda_gen_build_controls(codec);
845 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
854 static void alc_pre_init(struct hda_codec *codec)
856 alc_fill_eapd_coef(codec);
859 #define is_s3_resume(codec) \
860 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
861 #define is_s4_resume(codec) \
862 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
864 static int alc_init(struct hda_codec *codec)
866 struct alc_spec *spec = codec->spec;
868 /* hibernation resume needs the full chip initialization */
869 if (is_s4_resume(codec))
873 spec->init_hook(codec);
875 spec->gen.skip_verbs = 1; /* applied in below */
876 snd_hda_gen_init(codec);
878 alc_auto_init_amp(codec, spec->init_amp);
879 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
881 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
886 static inline void alc_shutup(struct hda_codec *codec)
888 struct alc_spec *spec = codec->spec;
890 if (!snd_hda_get_bool_hint(codec, "shutup"))
891 return; /* disabled explicitly by hints */
893 if (spec && spec->shutup)
896 alc_shutup_pins(codec);
899 static void alc_reboot_notify(struct hda_codec *codec)
901 struct alc_spec *spec = codec->spec;
903 if (spec && spec->reboot_notify)
904 spec->reboot_notify(codec);
909 #define alc_free snd_hda_gen_free
912 static void alc_power_eapd(struct hda_codec *codec)
914 alc_auto_setup_eapd(codec, false);
917 static int alc_suspend(struct hda_codec *codec)
919 struct alc_spec *spec = codec->spec;
921 if (spec && spec->power_hook)
922 spec->power_hook(codec);
928 static int alc_resume(struct hda_codec *codec)
930 struct alc_spec *spec = codec->spec;
932 if (!spec->no_depop_delay)
933 msleep(150); /* to avoid pop noise */
934 codec->patch_ops.init(codec);
935 snd_hda_regmap_sync(codec);
936 hda_call_check_power_status(codec, 0x01);
943 static const struct hda_codec_ops alc_patch_ops = {
944 .build_controls = alc_build_controls,
945 .build_pcms = snd_hda_gen_build_pcms,
948 .unsol_event = snd_hda_jack_unsol_event,
950 .resume = alc_resume,
951 .suspend = alc_suspend,
952 .check_power_status = snd_hda_gen_check_power_status,
954 .reboot_notify = alc_reboot_notify,
958 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
961 * Rename codecs appropriately from COEF value or subvendor id
963 struct alc_codec_rename_table {
964 unsigned int vendor_id;
965 unsigned short coef_mask;
966 unsigned short coef_bits;
970 struct alc_codec_rename_pci_table {
971 unsigned int codec_vendor_id;
972 unsigned short pci_subvendor;
973 unsigned short pci_subdevice;
977 static const struct alc_codec_rename_table rename_tbl[] = {
978 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
979 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
980 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
981 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
982 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
983 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
984 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
985 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
986 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
987 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
988 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
989 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
990 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
991 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
992 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
993 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
994 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
998 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
999 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1000 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1001 { 0x10ec0283, 0x1028, 0, "ALC3223" },
1002 { 0x10ec0288, 0x1028, 0, "ALC3263" },
1003 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1004 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1005 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1006 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1007 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1008 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1009 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1010 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1011 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1012 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1013 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1014 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1015 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1016 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1017 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1018 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1019 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1020 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1021 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1022 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1023 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1024 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1025 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1026 { } /* terminator */
1029 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1031 const struct alc_codec_rename_table *p;
1032 const struct alc_codec_rename_pci_table *q;
1034 for (p = rename_tbl; p->vendor_id; p++) {
1035 if (p->vendor_id != codec->core.vendor_id)
1037 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1038 return alc_codec_rename(codec, p->name);
1041 if (!codec->bus->pci)
1043 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1044 if (q->codec_vendor_id != codec->core.vendor_id)
1046 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1048 if (!q->pci_subdevice ||
1049 q->pci_subdevice == codec->bus->pci->subsystem_device)
1050 return alc_codec_rename(codec, q->name);
1058 * Digital-beep handlers
1060 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1062 /* additional beep mixers; private_value will be overwritten */
1063 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1064 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1065 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1068 /* set up and create beep controls */
1069 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1072 struct snd_kcontrol_new *knew;
1073 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1076 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1077 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1078 &alc_beep_mixer[i]);
1081 knew->private_value = beep_amp;
1086 static const struct snd_pci_quirk beep_allow_list[] = {
1087 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1088 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1089 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1090 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1091 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1092 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1093 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1094 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1095 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1096 /* denylist -- no beep available */
1097 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1098 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1102 static inline int has_cdefine_beep(struct hda_codec *codec)
1104 struct alc_spec *spec = codec->spec;
1105 const struct snd_pci_quirk *q;
1106 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1109 return spec->cdefine.enable_pcbeep;
1112 #define set_beep_amp(spec, nid, idx, dir) 0
1113 #define has_cdefine_beep(codec) 0
1116 /* parse the BIOS configuration and set up the alc_spec */
1117 /* return 1 if successful, 0 if the proper config is not found,
1118 * or a negative error code
1120 static int alc_parse_auto_config(struct hda_codec *codec,
1121 const hda_nid_t *ignore_nids,
1122 const hda_nid_t *ssid_nids)
1124 struct alc_spec *spec = codec->spec;
1125 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1128 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1134 alc_ssid_check(codec, ssid_nids);
1136 err = snd_hda_gen_parse_auto_config(codec, cfg);
1143 /* common preparation job for alc_spec */
1144 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1146 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1152 snd_hda_gen_spec_init(&spec->gen);
1153 spec->gen.mixer_nid = mixer_nid;
1154 spec->gen.own_eapd_ctl = 1;
1155 codec->single_adc_amp = 1;
1156 /* FIXME: do we need this for all Realtek codec models? */
1157 codec->spdif_status_reset = 1;
1158 codec->forced_resume = 1;
1159 codec->patch_ops = alc_patch_ops;
1161 err = alc_codec_rename_from_preset(codec);
1169 static int alc880_parse_auto_config(struct hda_codec *codec)
1171 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1172 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1173 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1182 ALC880_FIXUP_MEDION_RIM,
1184 ALC880_FIXUP_LG_LW25,
1186 ALC880_FIXUP_EAPD_COEF,
1187 ALC880_FIXUP_TCL_S700,
1188 ALC880_FIXUP_VOL_KNOB,
1189 ALC880_FIXUP_FUJITSU,
1191 ALC880_FIXUP_UNIWILL,
1192 ALC880_FIXUP_UNIWILL_DIG,
1194 ALC880_FIXUP_ASUS_W5A,
1195 ALC880_FIXUP_3ST_BASE,
1197 ALC880_FIXUP_3ST_DIG,
1198 ALC880_FIXUP_5ST_BASE,
1200 ALC880_FIXUP_5ST_DIG,
1201 ALC880_FIXUP_6ST_BASE,
1203 ALC880_FIXUP_6ST_DIG,
1204 ALC880_FIXUP_6ST_AUTOMUTE,
1207 /* enable the volume-knob widget support on NID 0x21 */
1208 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1209 const struct hda_fixup *fix, int action)
1211 if (action == HDA_FIXUP_ACT_PROBE)
1212 snd_hda_jack_detect_enable_callback(codec, 0x21,
1213 alc_update_knob_master);
1216 static const struct hda_fixup alc880_fixups[] = {
1217 [ALC880_FIXUP_GPIO1] = {
1218 .type = HDA_FIXUP_FUNC,
1219 .v.func = alc_fixup_gpio1,
1221 [ALC880_FIXUP_GPIO2] = {
1222 .type = HDA_FIXUP_FUNC,
1223 .v.func = alc_fixup_gpio2,
1225 [ALC880_FIXUP_MEDION_RIM] = {
1226 .type = HDA_FIXUP_VERBS,
1227 .v.verbs = (const struct hda_verb[]) {
1228 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1229 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1233 .chain_id = ALC880_FIXUP_GPIO2,
1235 [ALC880_FIXUP_LG] = {
1236 .type = HDA_FIXUP_PINS,
1237 .v.pins = (const struct hda_pintbl[]) {
1238 /* disable bogus unused pins */
1239 { 0x16, 0x411111f0 },
1240 { 0x18, 0x411111f0 },
1241 { 0x1a, 0x411111f0 },
1245 [ALC880_FIXUP_LG_LW25] = {
1246 .type = HDA_FIXUP_PINS,
1247 .v.pins = (const struct hda_pintbl[]) {
1248 { 0x1a, 0x0181344f }, /* line-in */
1249 { 0x1b, 0x0321403f }, /* headphone */
1253 [ALC880_FIXUP_W810] = {
1254 .type = HDA_FIXUP_PINS,
1255 .v.pins = (const struct hda_pintbl[]) {
1256 /* disable bogus unused pins */
1257 { 0x17, 0x411111f0 },
1261 .chain_id = ALC880_FIXUP_GPIO2,
1263 [ALC880_FIXUP_EAPD_COEF] = {
1264 .type = HDA_FIXUP_VERBS,
1265 .v.verbs = (const struct hda_verb[]) {
1266 /* change to EAPD mode */
1267 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1268 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1272 [ALC880_FIXUP_TCL_S700] = {
1273 .type = HDA_FIXUP_VERBS,
1274 .v.verbs = (const struct hda_verb[]) {
1275 /* change to EAPD mode */
1276 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1277 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1281 .chain_id = ALC880_FIXUP_GPIO2,
1283 [ALC880_FIXUP_VOL_KNOB] = {
1284 .type = HDA_FIXUP_FUNC,
1285 .v.func = alc880_fixup_vol_knob,
1287 [ALC880_FIXUP_FUJITSU] = {
1288 /* override all pins as BIOS on old Amilo is broken */
1289 .type = HDA_FIXUP_PINS,
1290 .v.pins = (const struct hda_pintbl[]) {
1291 { 0x14, 0x0121401f }, /* HP */
1292 { 0x15, 0x99030120 }, /* speaker */
1293 { 0x16, 0x99030130 }, /* bass speaker */
1294 { 0x17, 0x411111f0 }, /* N/A */
1295 { 0x18, 0x411111f0 }, /* N/A */
1296 { 0x19, 0x01a19950 }, /* mic-in */
1297 { 0x1a, 0x411111f0 }, /* N/A */
1298 { 0x1b, 0x411111f0 }, /* N/A */
1299 { 0x1c, 0x411111f0 }, /* N/A */
1300 { 0x1d, 0x411111f0 }, /* N/A */
1301 { 0x1e, 0x01454140 }, /* SPDIF out */
1305 .chain_id = ALC880_FIXUP_VOL_KNOB,
1307 [ALC880_FIXUP_F1734] = {
1308 /* almost compatible with FUJITSU, but no bass and SPDIF */
1309 .type = HDA_FIXUP_PINS,
1310 .v.pins = (const struct hda_pintbl[]) {
1311 { 0x14, 0x0121401f }, /* HP */
1312 { 0x15, 0x99030120 }, /* speaker */
1313 { 0x16, 0x411111f0 }, /* N/A */
1314 { 0x17, 0x411111f0 }, /* N/A */
1315 { 0x18, 0x411111f0 }, /* N/A */
1316 { 0x19, 0x01a19950 }, /* mic-in */
1317 { 0x1a, 0x411111f0 }, /* N/A */
1318 { 0x1b, 0x411111f0 }, /* N/A */
1319 { 0x1c, 0x411111f0 }, /* N/A */
1320 { 0x1d, 0x411111f0 }, /* N/A */
1321 { 0x1e, 0x411111f0 }, /* N/A */
1325 .chain_id = ALC880_FIXUP_VOL_KNOB,
1327 [ALC880_FIXUP_UNIWILL] = {
1328 /* need to fix HP and speaker pins to be parsed correctly */
1329 .type = HDA_FIXUP_PINS,
1330 .v.pins = (const struct hda_pintbl[]) {
1331 { 0x14, 0x0121411f }, /* HP */
1332 { 0x15, 0x99030120 }, /* speaker */
1333 { 0x16, 0x99030130 }, /* bass speaker */
1337 [ALC880_FIXUP_UNIWILL_DIG] = {
1338 .type = HDA_FIXUP_PINS,
1339 .v.pins = (const struct hda_pintbl[]) {
1340 /* disable bogus unused pins */
1341 { 0x17, 0x411111f0 },
1342 { 0x19, 0x411111f0 },
1343 { 0x1b, 0x411111f0 },
1344 { 0x1f, 0x411111f0 },
1348 [ALC880_FIXUP_Z71V] = {
1349 .type = HDA_FIXUP_PINS,
1350 .v.pins = (const struct hda_pintbl[]) {
1351 /* set up the whole pins as BIOS is utterly broken */
1352 { 0x14, 0x99030120 }, /* speaker */
1353 { 0x15, 0x0121411f }, /* HP */
1354 { 0x16, 0x411111f0 }, /* N/A */
1355 { 0x17, 0x411111f0 }, /* N/A */
1356 { 0x18, 0x01a19950 }, /* mic-in */
1357 { 0x19, 0x411111f0 }, /* N/A */
1358 { 0x1a, 0x01813031 }, /* line-in */
1359 { 0x1b, 0x411111f0 }, /* N/A */
1360 { 0x1c, 0x411111f0 }, /* N/A */
1361 { 0x1d, 0x411111f0 }, /* N/A */
1362 { 0x1e, 0x0144111e }, /* SPDIF */
1366 [ALC880_FIXUP_ASUS_W5A] = {
1367 .type = HDA_FIXUP_PINS,
1368 .v.pins = (const struct hda_pintbl[]) {
1369 /* set up the whole pins as BIOS is utterly broken */
1370 { 0x14, 0x0121411f }, /* HP */
1371 { 0x15, 0x411111f0 }, /* N/A */
1372 { 0x16, 0x411111f0 }, /* N/A */
1373 { 0x17, 0x411111f0 }, /* N/A */
1374 { 0x18, 0x90a60160 }, /* mic */
1375 { 0x19, 0x411111f0 }, /* N/A */
1376 { 0x1a, 0x411111f0 }, /* N/A */
1377 { 0x1b, 0x411111f0 }, /* N/A */
1378 { 0x1c, 0x411111f0 }, /* N/A */
1379 { 0x1d, 0x411111f0 }, /* N/A */
1380 { 0x1e, 0xb743111e }, /* SPDIF out */
1384 .chain_id = ALC880_FIXUP_GPIO1,
1386 [ALC880_FIXUP_3ST_BASE] = {
1387 .type = HDA_FIXUP_PINS,
1388 .v.pins = (const struct hda_pintbl[]) {
1389 { 0x14, 0x01014010 }, /* line-out */
1390 { 0x15, 0x411111f0 }, /* N/A */
1391 { 0x16, 0x411111f0 }, /* N/A */
1392 { 0x17, 0x411111f0 }, /* N/A */
1393 { 0x18, 0x01a19c30 }, /* mic-in */
1394 { 0x19, 0x0121411f }, /* HP */
1395 { 0x1a, 0x01813031 }, /* line-in */
1396 { 0x1b, 0x02a19c40 }, /* front-mic */
1397 { 0x1c, 0x411111f0 }, /* N/A */
1398 { 0x1d, 0x411111f0 }, /* N/A */
1399 /* 0x1e is filled in below */
1400 { 0x1f, 0x411111f0 }, /* N/A */
1404 [ALC880_FIXUP_3ST] = {
1405 .type = HDA_FIXUP_PINS,
1406 .v.pins = (const struct hda_pintbl[]) {
1407 { 0x1e, 0x411111f0 }, /* N/A */
1411 .chain_id = ALC880_FIXUP_3ST_BASE,
1413 [ALC880_FIXUP_3ST_DIG] = {
1414 .type = HDA_FIXUP_PINS,
1415 .v.pins = (const struct hda_pintbl[]) {
1416 { 0x1e, 0x0144111e }, /* SPDIF */
1420 .chain_id = ALC880_FIXUP_3ST_BASE,
1422 [ALC880_FIXUP_5ST_BASE] = {
1423 .type = HDA_FIXUP_PINS,
1424 .v.pins = (const struct hda_pintbl[]) {
1425 { 0x14, 0x01014010 }, /* front */
1426 { 0x15, 0x411111f0 }, /* N/A */
1427 { 0x16, 0x01011411 }, /* CLFE */
1428 { 0x17, 0x01016412 }, /* surr */
1429 { 0x18, 0x01a19c30 }, /* mic-in */
1430 { 0x19, 0x0121411f }, /* HP */
1431 { 0x1a, 0x01813031 }, /* line-in */
1432 { 0x1b, 0x02a19c40 }, /* front-mic */
1433 { 0x1c, 0x411111f0 }, /* N/A */
1434 { 0x1d, 0x411111f0 }, /* N/A */
1435 /* 0x1e is filled in below */
1436 { 0x1f, 0x411111f0 }, /* N/A */
1440 [ALC880_FIXUP_5ST] = {
1441 .type = HDA_FIXUP_PINS,
1442 .v.pins = (const struct hda_pintbl[]) {
1443 { 0x1e, 0x411111f0 }, /* N/A */
1447 .chain_id = ALC880_FIXUP_5ST_BASE,
1449 [ALC880_FIXUP_5ST_DIG] = {
1450 .type = HDA_FIXUP_PINS,
1451 .v.pins = (const struct hda_pintbl[]) {
1452 { 0x1e, 0x0144111e }, /* SPDIF */
1456 .chain_id = ALC880_FIXUP_5ST_BASE,
1458 [ALC880_FIXUP_6ST_BASE] = {
1459 .type = HDA_FIXUP_PINS,
1460 .v.pins = (const struct hda_pintbl[]) {
1461 { 0x14, 0x01014010 }, /* front */
1462 { 0x15, 0x01016412 }, /* surr */
1463 { 0x16, 0x01011411 }, /* CLFE */
1464 { 0x17, 0x01012414 }, /* side */
1465 { 0x18, 0x01a19c30 }, /* mic-in */
1466 { 0x19, 0x02a19c40 }, /* front-mic */
1467 { 0x1a, 0x01813031 }, /* line-in */
1468 { 0x1b, 0x0121411f }, /* HP */
1469 { 0x1c, 0x411111f0 }, /* N/A */
1470 { 0x1d, 0x411111f0 }, /* N/A */
1471 /* 0x1e is filled in below */
1472 { 0x1f, 0x411111f0 }, /* N/A */
1476 [ALC880_FIXUP_6ST] = {
1477 .type = HDA_FIXUP_PINS,
1478 .v.pins = (const struct hda_pintbl[]) {
1479 { 0x1e, 0x411111f0 }, /* N/A */
1483 .chain_id = ALC880_FIXUP_6ST_BASE,
1485 [ALC880_FIXUP_6ST_DIG] = {
1486 .type = HDA_FIXUP_PINS,
1487 .v.pins = (const struct hda_pintbl[]) {
1488 { 0x1e, 0x0144111e }, /* SPDIF */
1492 .chain_id = ALC880_FIXUP_6ST_BASE,
1494 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1495 .type = HDA_FIXUP_PINS,
1496 .v.pins = (const struct hda_pintbl[]) {
1497 { 0x1b, 0x0121401f }, /* HP with jack detect */
1500 .chained_before = true,
1501 .chain_id = ALC880_FIXUP_6ST_BASE,
1505 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1506 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1507 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1508 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1509 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1510 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1511 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1512 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1513 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1514 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1515 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1516 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1517 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1518 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1519 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1520 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1521 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1522 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1523 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1524 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1525 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1526 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1527 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1528 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1530 /* Below is the copied entries from alc880_quirks.c.
1531 * It's not quite sure whether BIOS sets the correct pin-config table
1532 * on these machines, thus they are kept to be compatible with
1533 * the old static quirks. Once when it's confirmed to work without
1534 * these overrides, it'd be better to remove.
1536 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1537 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1538 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1539 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1540 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1541 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1542 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1543 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1544 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1545 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1546 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1547 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1548 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1549 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1550 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1551 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1552 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1553 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1554 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1555 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1556 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1557 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1558 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1559 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1560 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1561 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1562 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1563 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1564 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1565 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1566 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1567 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1568 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1570 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1571 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1572 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1576 static const struct hda_model_fixup alc880_fixup_models[] = {
1577 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1578 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1579 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1580 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1581 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1582 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1583 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1589 * OK, here we have finally the patch for ALC880
1591 static int patch_alc880(struct hda_codec *codec)
1593 struct alc_spec *spec;
1596 err = alc_alloc_spec(codec, 0x0b);
1601 spec->gen.need_dac_fix = 1;
1602 spec->gen.beep_nid = 0x01;
1604 codec->patch_ops.unsol_event = alc880_unsol_event;
1606 alc_pre_init(codec);
1608 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1610 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1612 /* automatic parse from the BIOS config */
1613 err = alc880_parse_auto_config(codec);
1617 if (!spec->gen.no_analog) {
1618 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1623 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1636 static int alc260_parse_auto_config(struct hda_codec *codec)
1638 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1639 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1640 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1647 ALC260_FIXUP_HP_DC5750,
1648 ALC260_FIXUP_HP_PIN_0F,
1651 ALC260_FIXUP_GPIO1_TOGGLE,
1652 ALC260_FIXUP_REPLACER,
1653 ALC260_FIXUP_HP_B1900,
1655 ALC260_FIXUP_FSC_S7020,
1656 ALC260_FIXUP_FSC_S7020_JWSE,
1657 ALC260_FIXUP_VAIO_PINS,
1660 static void alc260_gpio1_automute(struct hda_codec *codec)
1662 struct alc_spec *spec = codec->spec;
1664 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1667 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1668 const struct hda_fixup *fix, int action)
1670 struct alc_spec *spec = codec->spec;
1671 if (action == HDA_FIXUP_ACT_PROBE) {
1672 /* although the machine has only one output pin, we need to
1673 * toggle GPIO1 according to the jack state
1675 spec->gen.automute_hook = alc260_gpio1_automute;
1676 spec->gen.detect_hp = 1;
1677 spec->gen.automute_speaker = 1;
1678 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1679 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1680 snd_hda_gen_hp_automute);
1681 alc_setup_gpio(codec, 0x01);
1685 static void alc260_fixup_kn1(struct hda_codec *codec,
1686 const struct hda_fixup *fix, int action)
1688 struct alc_spec *spec = codec->spec;
1689 static const struct hda_pintbl pincfgs[] = {
1690 { 0x0f, 0x02214000 }, /* HP/speaker */
1691 { 0x12, 0x90a60160 }, /* int mic */
1692 { 0x13, 0x02a19000 }, /* ext mic */
1693 { 0x18, 0x01446000 }, /* SPDIF out */
1694 /* disable bogus I/O pins */
1695 { 0x10, 0x411111f0 },
1696 { 0x11, 0x411111f0 },
1697 { 0x14, 0x411111f0 },
1698 { 0x15, 0x411111f0 },
1699 { 0x16, 0x411111f0 },
1700 { 0x17, 0x411111f0 },
1701 { 0x19, 0x411111f0 },
1706 case HDA_FIXUP_ACT_PRE_PROBE:
1707 snd_hda_apply_pincfgs(codec, pincfgs);
1708 spec->init_amp = ALC_INIT_NONE;
1713 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1714 const struct hda_fixup *fix, int action)
1716 struct alc_spec *spec = codec->spec;
1717 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1718 spec->init_amp = ALC_INIT_NONE;
1721 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1722 const struct hda_fixup *fix, int action)
1724 struct alc_spec *spec = codec->spec;
1725 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1726 spec->gen.add_jack_modes = 1;
1727 spec->gen.hp_mic = 1;
1731 static const struct hda_fixup alc260_fixups[] = {
1732 [ALC260_FIXUP_HP_DC5750] = {
1733 .type = HDA_FIXUP_PINS,
1734 .v.pins = (const struct hda_pintbl[]) {
1735 { 0x11, 0x90130110 }, /* speaker */
1739 [ALC260_FIXUP_HP_PIN_0F] = {
1740 .type = HDA_FIXUP_PINS,
1741 .v.pins = (const struct hda_pintbl[]) {
1742 { 0x0f, 0x01214000 }, /* HP */
1746 [ALC260_FIXUP_COEF] = {
1747 .type = HDA_FIXUP_VERBS,
1748 .v.verbs = (const struct hda_verb[]) {
1749 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1750 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1754 [ALC260_FIXUP_GPIO1] = {
1755 .type = HDA_FIXUP_FUNC,
1756 .v.func = alc_fixup_gpio1,
1758 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1759 .type = HDA_FIXUP_FUNC,
1760 .v.func = alc260_fixup_gpio1_toggle,
1762 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1764 [ALC260_FIXUP_REPLACER] = {
1765 .type = HDA_FIXUP_VERBS,
1766 .v.verbs = (const struct hda_verb[]) {
1767 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1768 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1772 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1774 [ALC260_FIXUP_HP_B1900] = {
1775 .type = HDA_FIXUP_FUNC,
1776 .v.func = alc260_fixup_gpio1_toggle,
1778 .chain_id = ALC260_FIXUP_COEF,
1780 [ALC260_FIXUP_KN1] = {
1781 .type = HDA_FIXUP_FUNC,
1782 .v.func = alc260_fixup_kn1,
1784 [ALC260_FIXUP_FSC_S7020] = {
1785 .type = HDA_FIXUP_FUNC,
1786 .v.func = alc260_fixup_fsc_s7020,
1788 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1789 .type = HDA_FIXUP_FUNC,
1790 .v.func = alc260_fixup_fsc_s7020_jwse,
1792 .chain_id = ALC260_FIXUP_FSC_S7020,
1794 [ALC260_FIXUP_VAIO_PINS] = {
1795 .type = HDA_FIXUP_PINS,
1796 .v.pins = (const struct hda_pintbl[]) {
1797 /* Pin configs are missing completely on some VAIOs */
1798 { 0x0f, 0x01211020 },
1799 { 0x10, 0x0001003f },
1800 { 0x11, 0x411111f0 },
1801 { 0x12, 0x01a15930 },
1802 { 0x13, 0x411111f0 },
1803 { 0x14, 0x411111f0 },
1804 { 0x15, 0x411111f0 },
1805 { 0x16, 0x411111f0 },
1806 { 0x17, 0x411111f0 },
1807 { 0x18, 0x411111f0 },
1808 { 0x19, 0x411111f0 },
1814 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1815 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1816 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1817 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1818 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1819 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1820 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1821 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1822 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1823 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1824 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1825 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1826 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1830 static const struct hda_model_fixup alc260_fixup_models[] = {
1831 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1832 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1833 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1834 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1840 static int patch_alc260(struct hda_codec *codec)
1842 struct alc_spec *spec;
1845 err = alc_alloc_spec(codec, 0x07);
1850 /* as quite a few machines require HP amp for speaker outputs,
1851 * it's easier to enable it unconditionally; even if it's unneeded,
1852 * it's almost harmless.
1854 spec->gen.prefer_hp_amp = 1;
1855 spec->gen.beep_nid = 0x01;
1857 spec->shutup = alc_eapd_shutup;
1859 alc_pre_init(codec);
1861 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1863 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1865 /* automatic parse from the BIOS config */
1866 err = alc260_parse_auto_config(codec);
1870 if (!spec->gen.no_analog) {
1871 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1876 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1887 * ALC882/883/885/888/889 support
1889 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1890 * configuration. Each pin widget can choose any input DACs and a mixer.
1891 * Each ADC is connected from a mixer of all inputs. This makes possible
1892 * 6-channel independent captures.
1894 * In addition, an independent DAC for the multi-playback (not used in this
1902 ALC882_FIXUP_ABIT_AW9D_MAX,
1903 ALC882_FIXUP_LENOVO_Y530,
1904 ALC882_FIXUP_PB_M5210,
1905 ALC882_FIXUP_ACER_ASPIRE_7736,
1906 ALC882_FIXUP_ASUS_W90V,
1908 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1909 ALC889_FIXUP_VAIO_TT,
1910 ALC888_FIXUP_EEE1601,
1914 ALC883_FIXUP_ACER_EAPD,
1919 ALC882_FIXUP_ASUS_W2JC,
1920 ALC882_FIXUP_ACER_ASPIRE_4930G,
1921 ALC882_FIXUP_ACER_ASPIRE_8930G,
1922 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1923 ALC885_FIXUP_MACPRO_GPIO,
1924 ALC889_FIXUP_DAC_ROUTE,
1925 ALC889_FIXUP_MBP_VREF,
1926 ALC889_FIXUP_IMAC91_VREF,
1927 ALC889_FIXUP_MBA11_VREF,
1928 ALC889_FIXUP_MBA21_VREF,
1929 ALC889_FIXUP_MP11_VREF,
1930 ALC889_FIXUP_MP41_VREF,
1931 ALC882_FIXUP_INV_DMIC,
1932 ALC882_FIXUP_NO_PRIMARY_HP,
1933 ALC887_FIXUP_ASUS_BASS,
1934 ALC887_FIXUP_BASS_CHMAP,
1935 ALC1220_FIXUP_GB_DUAL_CODECS,
1936 ALC1220_FIXUP_CLEVO_P950,
1937 ALC1220_FIXUP_CLEVO_PB51ED,
1938 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1939 ALC887_FIXUP_ASUS_AUDIO,
1940 ALC887_FIXUP_ASUS_HMIC,
1943 static void alc889_fixup_coef(struct hda_codec *codec,
1944 const struct hda_fixup *fix, int action)
1946 if (action != HDA_FIXUP_ACT_INIT)
1948 alc_update_coef_idx(codec, 7, 0, 0x2030);
1951 /* set up GPIO at initialization */
1952 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1953 const struct hda_fixup *fix, int action)
1955 struct alc_spec *spec = codec->spec;
1957 spec->gpio_write_delay = true;
1958 alc_fixup_gpio3(codec, fix, action);
1961 /* Fix the connection of some pins for ALC889:
1962 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1963 * work correctly (bko#42740)
1965 static void alc889_fixup_dac_route(struct hda_codec *codec,
1966 const struct hda_fixup *fix, int action)
1968 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1969 /* fake the connections during parsing the tree */
1970 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1971 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1972 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1973 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1974 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1975 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1976 } else if (action == HDA_FIXUP_ACT_PROBE) {
1977 /* restore the connections */
1978 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1979 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1980 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1981 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1982 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1986 /* Set VREF on HP pin */
1987 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1988 const struct hda_fixup *fix, int action)
1990 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1991 struct alc_spec *spec = codec->spec;
1994 if (action != HDA_FIXUP_ACT_INIT)
1996 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1997 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1998 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2000 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2001 val |= AC_PINCTL_VREF_80;
2002 snd_hda_set_pin_ctl(codec, nids[i], val);
2003 spec->gen.keep_vref_in_automute = 1;
2008 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2009 const hda_nid_t *nids, int num_nids)
2011 struct alc_spec *spec = codec->spec;
2014 for (i = 0; i < num_nids; i++) {
2016 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2017 val |= AC_PINCTL_VREF_50;
2018 snd_hda_set_pin_ctl(codec, nids[i], val);
2020 spec->gen.keep_vref_in_automute = 1;
2023 /* Set VREF on speaker pins on imac91 */
2024 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2025 const struct hda_fixup *fix, int action)
2027 static const hda_nid_t nids[] = { 0x18, 0x1a };
2029 if (action == HDA_FIXUP_ACT_INIT)
2030 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2033 /* Set VREF on speaker pins on mba11 */
2034 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2035 const struct hda_fixup *fix, int action)
2037 static const hda_nid_t nids[] = { 0x18 };
2039 if (action == HDA_FIXUP_ACT_INIT)
2040 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2043 /* Set VREF on speaker pins on mba21 */
2044 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2045 const struct hda_fixup *fix, int action)
2047 static const hda_nid_t nids[] = { 0x18, 0x19 };
2049 if (action == HDA_FIXUP_ACT_INIT)
2050 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2053 /* Don't take HP output as primary
2054 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2055 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2057 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2058 const struct hda_fixup *fix, int action)
2060 struct alc_spec *spec = codec->spec;
2061 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2062 spec->gen.no_primary_hp = 1;
2063 spec->gen.no_multi_io = 1;
2067 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2068 const struct hda_fixup *fix, int action);
2070 /* For dual-codec configuration, we need to disable some features to avoid
2071 * conflicts of kctls and PCM streams
2073 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2074 const struct hda_fixup *fix, int action)
2076 struct alc_spec *spec = codec->spec;
2078 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2080 /* disable vmaster */
2081 spec->gen.suppress_vmaster = 1;
2082 /* auto-mute and auto-mic switch don't work with multiple codecs */
2083 spec->gen.suppress_auto_mute = 1;
2084 spec->gen.suppress_auto_mic = 1;
2085 /* disable aamix as well */
2086 spec->gen.mixer_nid = 0;
2087 /* add location prefix to avoid conflicts */
2088 codec->force_pin_prefix = 1;
2091 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2092 const char *newname)
2094 struct snd_kcontrol *kctl;
2096 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2098 strcpy(kctl->id.name, newname);
2101 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2102 const struct hda_fixup *fix,
2105 alc_fixup_dual_codecs(codec, fix, action);
2107 case HDA_FIXUP_ACT_PRE_PROBE:
2108 /* override card longname to provide a unique UCM profile */
2109 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2111 case HDA_FIXUP_ACT_BUILD:
2112 /* rename Capture controls depending on the codec */
2113 rename_ctl(codec, "Capture Volume",
2115 "Rear-Panel Capture Volume" :
2116 "Front-Panel Capture Volume");
2117 rename_ctl(codec, "Capture Switch",
2119 "Rear-Panel Capture Switch" :
2120 "Front-Panel Capture Switch");
2125 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2126 const struct hda_fixup *fix,
2129 static const hda_nid_t conn1[] = { 0x0c };
2131 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2134 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2135 /* We therefore want to make sure 0x14 (front headphone) and
2136 * 0x1b (speakers) use the stereo DAC 0x02
2138 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2139 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2142 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2143 const struct hda_fixup *fix, int action);
2145 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2146 const struct hda_fixup *fix,
2149 alc1220_fixup_clevo_p950(codec, fix, action);
2150 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2153 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2154 struct hda_jack_callback *jack)
2156 struct alc_spec *spec = codec->spec;
2159 snd_hda_gen_hp_automute(codec, jack);
2161 if (spec->gen.hp_jack_present)
2162 vref = AC_PINCTL_VREF_80;
2164 vref = AC_PINCTL_VREF_HIZ;
2165 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2168 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2169 const struct hda_fixup *fix, int action)
2171 struct alc_spec *spec = codec->spec;
2172 if (action != HDA_FIXUP_ACT_PROBE)
2174 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2175 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2178 static const struct hda_fixup alc882_fixups[] = {
2179 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2180 .type = HDA_FIXUP_PINS,
2181 .v.pins = (const struct hda_pintbl[]) {
2182 { 0x15, 0x01080104 }, /* side */
2183 { 0x16, 0x01011012 }, /* rear */
2184 { 0x17, 0x01016011 }, /* clfe */
2188 [ALC882_FIXUP_LENOVO_Y530] = {
2189 .type = HDA_FIXUP_PINS,
2190 .v.pins = (const struct hda_pintbl[]) {
2191 { 0x15, 0x99130112 }, /* rear int speakers */
2192 { 0x16, 0x99130111 }, /* subwoofer */
2196 [ALC882_FIXUP_PB_M5210] = {
2197 .type = HDA_FIXUP_PINCTLS,
2198 .v.pins = (const struct hda_pintbl[]) {
2199 { 0x19, PIN_VREF50 },
2203 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2204 .type = HDA_FIXUP_FUNC,
2205 .v.func = alc_fixup_sku_ignore,
2207 [ALC882_FIXUP_ASUS_W90V] = {
2208 .type = HDA_FIXUP_PINS,
2209 .v.pins = (const struct hda_pintbl[]) {
2210 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2214 [ALC889_FIXUP_CD] = {
2215 .type = HDA_FIXUP_PINS,
2216 .v.pins = (const struct hda_pintbl[]) {
2217 { 0x1c, 0x993301f0 }, /* CD */
2221 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2222 .type = HDA_FIXUP_PINS,
2223 .v.pins = (const struct hda_pintbl[]) {
2224 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2228 .chain_id = ALC889_FIXUP_CD,
2230 [ALC889_FIXUP_VAIO_TT] = {
2231 .type = HDA_FIXUP_PINS,
2232 .v.pins = (const struct hda_pintbl[]) {
2233 { 0x17, 0x90170111 }, /* hidden surround speaker */
2237 [ALC888_FIXUP_EEE1601] = {
2238 .type = HDA_FIXUP_VERBS,
2239 .v.verbs = (const struct hda_verb[]) {
2240 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2241 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2245 [ALC886_FIXUP_EAPD] = {
2246 .type = HDA_FIXUP_VERBS,
2247 .v.verbs = (const struct hda_verb[]) {
2248 /* change to EAPD mode */
2249 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2250 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2254 [ALC882_FIXUP_EAPD] = {
2255 .type = HDA_FIXUP_VERBS,
2256 .v.verbs = (const struct hda_verb[]) {
2257 /* change to EAPD mode */
2258 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2259 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2263 [ALC883_FIXUP_EAPD] = {
2264 .type = HDA_FIXUP_VERBS,
2265 .v.verbs = (const struct hda_verb[]) {
2266 /* change to EAPD mode */
2267 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2268 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2272 [ALC883_FIXUP_ACER_EAPD] = {
2273 .type = HDA_FIXUP_VERBS,
2274 .v.verbs = (const struct hda_verb[]) {
2275 /* eanable EAPD on Acer laptops */
2276 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2277 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2281 [ALC882_FIXUP_GPIO1] = {
2282 .type = HDA_FIXUP_FUNC,
2283 .v.func = alc_fixup_gpio1,
2285 [ALC882_FIXUP_GPIO2] = {
2286 .type = HDA_FIXUP_FUNC,
2287 .v.func = alc_fixup_gpio2,
2289 [ALC882_FIXUP_GPIO3] = {
2290 .type = HDA_FIXUP_FUNC,
2291 .v.func = alc_fixup_gpio3,
2293 [ALC882_FIXUP_ASUS_W2JC] = {
2294 .type = HDA_FIXUP_FUNC,
2295 .v.func = alc_fixup_gpio1,
2297 .chain_id = ALC882_FIXUP_EAPD,
2299 [ALC889_FIXUP_COEF] = {
2300 .type = HDA_FIXUP_FUNC,
2301 .v.func = alc889_fixup_coef,
2303 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2304 .type = HDA_FIXUP_PINS,
2305 .v.pins = (const struct hda_pintbl[]) {
2306 { 0x16, 0x99130111 }, /* CLFE speaker */
2307 { 0x17, 0x99130112 }, /* surround speaker */
2311 .chain_id = ALC882_FIXUP_GPIO1,
2313 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2314 .type = HDA_FIXUP_PINS,
2315 .v.pins = (const struct hda_pintbl[]) {
2316 { 0x16, 0x99130111 }, /* CLFE speaker */
2317 { 0x1b, 0x99130112 }, /* surround speaker */
2321 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2323 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2324 /* additional init verbs for Acer Aspire 8930G */
2325 .type = HDA_FIXUP_VERBS,
2326 .v.verbs = (const struct hda_verb[]) {
2327 /* Enable all DACs */
2328 /* DAC DISABLE/MUTE 1? */
2329 /* setting bits 1-5 disables DAC nids 0x02-0x06
2330 * apparently. Init=0x38 */
2331 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2332 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2333 /* DAC DISABLE/MUTE 2? */
2334 /* some bit here disables the other DACs.
2336 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2337 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2339 * This laptop has a stereo digital microphone.
2340 * The mics are only 1cm apart which makes the stereo
2341 * useless. However, either the mic or the ALC889
2342 * makes the signal become a difference/sum signal
2343 * instead of standard stereo, which is annoying.
2344 * So instead we flip this bit which makes the
2345 * codec replicate the sum signal to both channels,
2346 * turning it into a normal mono mic.
2348 /* DMIC_CONTROL? Init value = 0x0001 */
2349 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2350 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2351 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2352 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2356 .chain_id = ALC882_FIXUP_GPIO1,
2358 [ALC885_FIXUP_MACPRO_GPIO] = {
2359 .type = HDA_FIXUP_FUNC,
2360 .v.func = alc885_fixup_macpro_gpio,
2362 [ALC889_FIXUP_DAC_ROUTE] = {
2363 .type = HDA_FIXUP_FUNC,
2364 .v.func = alc889_fixup_dac_route,
2366 [ALC889_FIXUP_MBP_VREF] = {
2367 .type = HDA_FIXUP_FUNC,
2368 .v.func = alc889_fixup_mbp_vref,
2370 .chain_id = ALC882_FIXUP_GPIO1,
2372 [ALC889_FIXUP_IMAC91_VREF] = {
2373 .type = HDA_FIXUP_FUNC,
2374 .v.func = alc889_fixup_imac91_vref,
2376 .chain_id = ALC882_FIXUP_GPIO1,
2378 [ALC889_FIXUP_MBA11_VREF] = {
2379 .type = HDA_FIXUP_FUNC,
2380 .v.func = alc889_fixup_mba11_vref,
2382 .chain_id = ALC889_FIXUP_MBP_VREF,
2384 [ALC889_FIXUP_MBA21_VREF] = {
2385 .type = HDA_FIXUP_FUNC,
2386 .v.func = alc889_fixup_mba21_vref,
2388 .chain_id = ALC889_FIXUP_MBP_VREF,
2390 [ALC889_FIXUP_MP11_VREF] = {
2391 .type = HDA_FIXUP_FUNC,
2392 .v.func = alc889_fixup_mba11_vref,
2394 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2396 [ALC889_FIXUP_MP41_VREF] = {
2397 .type = HDA_FIXUP_FUNC,
2398 .v.func = alc889_fixup_mbp_vref,
2400 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2402 [ALC882_FIXUP_INV_DMIC] = {
2403 .type = HDA_FIXUP_FUNC,
2404 .v.func = alc_fixup_inv_dmic,
2406 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2407 .type = HDA_FIXUP_FUNC,
2408 .v.func = alc882_fixup_no_primary_hp,
2410 [ALC887_FIXUP_ASUS_BASS] = {
2411 .type = HDA_FIXUP_PINS,
2412 .v.pins = (const struct hda_pintbl[]) {
2413 {0x16, 0x99130130}, /* bass speaker */
2417 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2419 [ALC887_FIXUP_BASS_CHMAP] = {
2420 .type = HDA_FIXUP_FUNC,
2421 .v.func = alc_fixup_bass_chmap,
2423 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2424 .type = HDA_FIXUP_FUNC,
2425 .v.func = alc1220_fixup_gb_dual_codecs,
2427 [ALC1220_FIXUP_CLEVO_P950] = {
2428 .type = HDA_FIXUP_FUNC,
2429 .v.func = alc1220_fixup_clevo_p950,
2431 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2432 .type = HDA_FIXUP_FUNC,
2433 .v.func = alc1220_fixup_clevo_pb51ed,
2435 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2436 .type = HDA_FIXUP_PINS,
2437 .v.pins = (const struct hda_pintbl[]) {
2438 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2442 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2444 [ALC887_FIXUP_ASUS_AUDIO] = {
2445 .type = HDA_FIXUP_PINS,
2446 .v.pins = (const struct hda_pintbl[]) {
2447 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2448 { 0x19, 0x22219420 },
2452 [ALC887_FIXUP_ASUS_HMIC] = {
2453 .type = HDA_FIXUP_FUNC,
2454 .v.func = alc887_fixup_asus_jack,
2456 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2460 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2461 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2462 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2463 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2464 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2465 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2466 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2467 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2468 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2469 ALC882_FIXUP_ACER_ASPIRE_4930G),
2470 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2471 ALC882_FIXUP_ACER_ASPIRE_4930G),
2472 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2473 ALC882_FIXUP_ACER_ASPIRE_8930G),
2474 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2475 ALC882_FIXUP_ACER_ASPIRE_8930G),
2476 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2477 ALC882_FIXUP_ACER_ASPIRE_4930G),
2478 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2479 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2480 ALC882_FIXUP_ACER_ASPIRE_4930G),
2481 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2482 ALC882_FIXUP_ACER_ASPIRE_4930G),
2483 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2484 ALC882_FIXUP_ACER_ASPIRE_4930G),
2485 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2486 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2487 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2488 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2489 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2490 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2491 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2492 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2493 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2494 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2495 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2496 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2497 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2498 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2499 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2501 /* All Apple entries are in codec SSIDs */
2502 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2503 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2504 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2505 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2506 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2507 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2508 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2509 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2510 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2511 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2512 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2513 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2514 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2515 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2516 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2517 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2518 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2519 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2520 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2521 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2522 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2523 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2525 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2526 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2527 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2528 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2529 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
2530 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
2531 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2532 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2533 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2534 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2535 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2536 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2537 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2538 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2539 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2540 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2541 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2542 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2543 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2544 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2545 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2546 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2547 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2548 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2549 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2550 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2551 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2552 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2553 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2554 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2555 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2556 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2557 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2558 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2559 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2560 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2561 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2562 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2563 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2564 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2565 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2566 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2567 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2571 static const struct hda_model_fixup alc882_fixup_models[] = {
2572 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2573 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2574 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2575 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2576 {.id = ALC889_FIXUP_CD, .name = "cd"},
2577 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2578 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2579 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2580 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2581 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2582 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2583 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2584 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2585 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2586 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2587 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2588 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2589 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2590 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2591 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2592 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2593 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2594 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2595 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2596 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2597 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2598 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2599 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2600 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2601 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2602 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2606 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2607 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2615 {0x1e, 0x01456130}),
2616 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2624 {0x1e, 0x01451130}),
2629 * BIOS auto configuration
2631 /* almost identical with ALC880 parser... */
2632 static int alc882_parse_auto_config(struct hda_codec *codec)
2634 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2635 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2636 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2641 static int patch_alc882(struct hda_codec *codec)
2643 struct alc_spec *spec;
2646 err = alc_alloc_spec(codec, 0x0b);
2652 switch (codec->core.vendor_id) {
2660 /* ALC883 and variants */
2661 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2665 alc_pre_init(codec);
2667 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2669 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2670 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2672 alc_auto_parse_customize_define(codec);
2674 if (has_cdefine_beep(codec))
2675 spec->gen.beep_nid = 0x01;
2677 /* automatic parse from the BIOS config */
2678 err = alc882_parse_auto_config(codec);
2682 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2683 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2688 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2701 static int alc262_parse_auto_config(struct hda_codec *codec)
2703 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2704 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2705 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2712 ALC262_FIXUP_FSC_H270,
2713 ALC262_FIXUP_FSC_S7110,
2714 ALC262_FIXUP_HP_Z200,
2716 ALC262_FIXUP_LENOVO_3000,
2718 ALC262_FIXUP_BENQ_T31,
2719 ALC262_FIXUP_INV_DMIC,
2720 ALC262_FIXUP_INTEL_BAYLEYBAY,
2723 static const struct hda_fixup alc262_fixups[] = {
2724 [ALC262_FIXUP_FSC_H270] = {
2725 .type = HDA_FIXUP_PINS,
2726 .v.pins = (const struct hda_pintbl[]) {
2727 { 0x14, 0x99130110 }, /* speaker */
2728 { 0x15, 0x0221142f }, /* front HP */
2729 { 0x1b, 0x0121141f }, /* rear HP */
2733 [ALC262_FIXUP_FSC_S7110] = {
2734 .type = HDA_FIXUP_PINS,
2735 .v.pins = (const struct hda_pintbl[]) {
2736 { 0x15, 0x90170110 }, /* speaker */
2740 .chain_id = ALC262_FIXUP_BENQ,
2742 [ALC262_FIXUP_HP_Z200] = {
2743 .type = HDA_FIXUP_PINS,
2744 .v.pins = (const struct hda_pintbl[]) {
2745 { 0x16, 0x99130120 }, /* internal speaker */
2749 [ALC262_FIXUP_TYAN] = {
2750 .type = HDA_FIXUP_PINS,
2751 .v.pins = (const struct hda_pintbl[]) {
2752 { 0x14, 0x1993e1f0 }, /* int AUX */
2756 [ALC262_FIXUP_LENOVO_3000] = {
2757 .type = HDA_FIXUP_PINCTLS,
2758 .v.pins = (const struct hda_pintbl[]) {
2759 { 0x19, PIN_VREF50 },
2763 .chain_id = ALC262_FIXUP_BENQ,
2765 [ALC262_FIXUP_BENQ] = {
2766 .type = HDA_FIXUP_VERBS,
2767 .v.verbs = (const struct hda_verb[]) {
2768 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2769 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2773 [ALC262_FIXUP_BENQ_T31] = {
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, 0x3050 },
2781 [ALC262_FIXUP_INV_DMIC] = {
2782 .type = HDA_FIXUP_FUNC,
2783 .v.func = alc_fixup_inv_dmic,
2785 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2786 .type = HDA_FIXUP_FUNC,
2787 .v.func = alc_fixup_no_depop_delay,
2791 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2792 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2793 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2794 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2795 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2796 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2797 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2798 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2799 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2800 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2801 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2805 static const struct hda_model_fixup alc262_fixup_models[] = {
2806 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2807 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2808 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2809 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2810 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2811 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2812 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2813 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2814 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2820 static int patch_alc262(struct hda_codec *codec)
2822 struct alc_spec *spec;
2825 err = alc_alloc_spec(codec, 0x0b);
2830 spec->gen.shared_mic_vref_pin = 0x18;
2832 spec->shutup = alc_eapd_shutup;
2835 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2838 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2840 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2842 alc_pre_init(codec);
2844 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2846 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2848 alc_auto_parse_customize_define(codec);
2850 if (has_cdefine_beep(codec))
2851 spec->gen.beep_nid = 0x01;
2853 /* automatic parse from the BIOS config */
2854 err = alc262_parse_auto_config(codec);
2858 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2859 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2864 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2876 /* bind Beep switches of both NID 0x0f and 0x10 */
2877 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2878 struct snd_ctl_elem_value *ucontrol)
2880 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2884 mutex_lock(&codec->control_mutex);
2885 pval = kcontrol->private_value;
2886 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2887 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2889 kcontrol->private_value = (pval & ~0xff) | 0x10;
2890 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2892 kcontrol->private_value = pval;
2893 mutex_unlock(&codec->control_mutex);
2897 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2898 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2900 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2901 .name = "Beep Playback Switch",
2902 .subdevice = HDA_SUBDEV_AMP_FLAG,
2903 .info = snd_hda_mixer_amp_switch_info,
2904 .get = snd_hda_mixer_amp_switch_get,
2905 .put = alc268_beep_switch_put,
2906 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2910 /* set PCBEEP vol = 0, mute connections */
2911 static const struct hda_verb alc268_beep_init_verbs[] = {
2912 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2913 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2914 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2919 ALC268_FIXUP_INV_DMIC,
2920 ALC268_FIXUP_HP_EAPD,
2924 static const struct hda_fixup alc268_fixups[] = {
2925 [ALC268_FIXUP_INV_DMIC] = {
2926 .type = HDA_FIXUP_FUNC,
2927 .v.func = alc_fixup_inv_dmic,
2929 [ALC268_FIXUP_HP_EAPD] = {
2930 .type = HDA_FIXUP_VERBS,
2931 .v.verbs = (const struct hda_verb[]) {
2932 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2936 [ALC268_FIXUP_SPDIF] = {
2937 .type = HDA_FIXUP_PINS,
2938 .v.pins = (const struct hda_pintbl[]) {
2939 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2945 static const struct hda_model_fixup alc268_fixup_models[] = {
2946 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2947 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2948 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2952 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2953 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2954 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2955 /* below is codec SSID since multiple Toshiba laptops have the
2956 * same PCI SSID 1179:ff00
2958 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2963 * BIOS auto configuration
2965 static int alc268_parse_auto_config(struct hda_codec *codec)
2967 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2968 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2973 static int patch_alc268(struct hda_codec *codec)
2975 struct alc_spec *spec;
2978 /* ALC268 has no aa-loopback mixer */
2979 err = alc_alloc_spec(codec, 0);
2984 if (has_cdefine_beep(codec))
2985 spec->gen.beep_nid = 0x01;
2987 spec->shutup = alc_eapd_shutup;
2989 alc_pre_init(codec);
2991 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2992 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2994 /* automatic parse from the BIOS config */
2995 err = alc268_parse_auto_config(codec);
2999 if (err > 0 && !spec->gen.no_analog &&
3000 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3001 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3002 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3003 &alc268_beep_mixer[i])) {
3008 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3009 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3010 /* override the amp caps for beep generator */
3011 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3012 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3013 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3014 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3015 (0 << AC_AMPCAP_MUTE_SHIFT));
3018 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3031 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3032 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3035 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3036 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3039 /* different alc269-variants */
3041 ALC269_TYPE_ALC269VA,
3042 ALC269_TYPE_ALC269VB,
3043 ALC269_TYPE_ALC269VC,
3044 ALC269_TYPE_ALC269VD,
3064 * BIOS auto configuration
3066 static int alc269_parse_auto_config(struct hda_codec *codec)
3068 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3069 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3070 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3071 struct alc_spec *spec = codec->spec;
3072 const hda_nid_t *ssids;
3074 switch (spec->codec_variant) {
3075 case ALC269_TYPE_ALC269VA:
3076 case ALC269_TYPE_ALC269VC:
3077 case ALC269_TYPE_ALC280:
3078 case ALC269_TYPE_ALC284:
3079 case ALC269_TYPE_ALC293:
3080 ssids = alc269va_ssids;
3082 case ALC269_TYPE_ALC269VB:
3083 case ALC269_TYPE_ALC269VD:
3084 case ALC269_TYPE_ALC282:
3085 case ALC269_TYPE_ALC283:
3086 case ALC269_TYPE_ALC286:
3087 case ALC269_TYPE_ALC298:
3088 case ALC269_TYPE_ALC255:
3089 case ALC269_TYPE_ALC256:
3090 case ALC269_TYPE_ALC257:
3091 case ALC269_TYPE_ALC215:
3092 case ALC269_TYPE_ALC225:
3093 case ALC269_TYPE_ALC294:
3094 case ALC269_TYPE_ALC300:
3095 case ALC269_TYPE_ALC623:
3096 case ALC269_TYPE_ALC700:
3097 ssids = alc269_ssids;
3100 ssids = alc269_ssids;
3104 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3107 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3108 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3109 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3110 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3111 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3115 static void alc_headset_btn_callback(struct hda_codec *codec,
3116 struct hda_jack_callback *jack)
3120 if (jack->unsol_res & (7 << 13))
3121 report |= SND_JACK_BTN_0;
3123 if (jack->unsol_res & (1 << 16 | 3 << 8))
3124 report |= SND_JACK_BTN_1;
3127 if (jack->unsol_res & (7 << 23))
3128 report |= SND_JACK_BTN_2;
3130 /* Volume down key */
3131 if (jack->unsol_res & (7 << 10))
3132 report |= SND_JACK_BTN_3;
3134 snd_hda_jack_set_button_state(codec, jack->nid, report);
3137 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3139 struct alc_spec *spec = codec->spec;
3141 if (!spec->has_hs_key)
3144 switch (codec->core.vendor_id) {
3152 alc_write_coef_idx(codec, 0x48, 0x0);
3153 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3154 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3158 alc_write_coef_idx(codec, 0x48, 0x0);
3159 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3164 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3166 struct alc_spec *spec = codec->spec;
3168 if (!spec->has_hs_key)
3171 switch (codec->core.vendor_id) {
3179 alc_write_coef_idx(codec, 0x48, 0xd011);
3180 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3181 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3185 alc_write_coef_idx(codec, 0x48, 0xd011);
3186 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3191 static void alc_fixup_headset_jack(struct hda_codec *codec,
3192 const struct hda_fixup *fix, int action)
3194 struct alc_spec *spec = codec->spec;
3198 case HDA_FIXUP_ACT_PRE_PROBE:
3199 spec->has_hs_key = 1;
3200 snd_hda_jack_detect_enable_callback(codec, 0x55,
3201 alc_headset_btn_callback);
3203 case HDA_FIXUP_ACT_BUILD:
3204 hp_pin = alc_get_hp_pin(spec);
3205 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3206 alc_headset_btn_keymap,
3208 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3209 false, SND_JACK_HEADSET,
3210 alc_headset_btn_keymap);
3212 alc_enable_headset_jack_key(codec);
3217 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3219 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3222 static void alc269_shutup(struct hda_codec *codec)
3224 struct alc_spec *spec = codec->spec;
3226 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3227 alc269vb_toggle_power_output(codec, 0);
3228 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3229 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3232 alc_shutup_pins(codec);
3235 static const struct coef_fw alc282_coefs[] = {
3236 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3237 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3238 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3239 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3240 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3241 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3242 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3243 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3244 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3245 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3246 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3247 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3248 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3249 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3250 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3251 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3252 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3253 WRITE_COEF(0x63, 0x2902), /* PLL */
3254 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3255 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3256 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3257 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3258 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3259 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3260 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3261 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3262 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3263 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3264 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3268 static void alc282_restore_default_value(struct hda_codec *codec)
3270 alc_process_coef_fw(codec, alc282_coefs);
3273 static void alc282_init(struct hda_codec *codec)
3275 struct alc_spec *spec = codec->spec;
3276 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3280 alc282_restore_default_value(codec);
3284 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3285 coef78 = alc_read_coef_idx(codec, 0x78);
3287 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3288 /* Headphone capless set to high power mode */
3289 alc_write_coef_idx(codec, 0x78, 0x9004);
3294 snd_hda_codec_write(codec, hp_pin, 0,
3295 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3300 snd_hda_codec_write(codec, hp_pin, 0,
3301 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3306 /* Headphone capless set to normal mode */
3307 alc_write_coef_idx(codec, 0x78, coef78);
3310 static void alc282_shutup(struct hda_codec *codec)
3312 struct alc_spec *spec = codec->spec;
3313 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3318 alc269_shutup(codec);
3322 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3323 coef78 = alc_read_coef_idx(codec, 0x78);
3324 alc_write_coef_idx(codec, 0x78, 0x9004);
3329 snd_hda_codec_write(codec, hp_pin, 0,
3330 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3335 if (!spec->no_shutup_pins)
3336 snd_hda_codec_write(codec, hp_pin, 0,
3337 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3342 alc_auto_setup_eapd(codec, false);
3343 alc_shutup_pins(codec);
3344 alc_write_coef_idx(codec, 0x78, coef78);
3347 static const struct coef_fw alc283_coefs[] = {
3348 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3349 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3350 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3351 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3352 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3353 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3354 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3355 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3356 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3357 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3358 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3359 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3360 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3361 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3362 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3363 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3364 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3365 WRITE_COEF(0x2e, 0x2902), /* PLL */
3366 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3367 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3368 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3369 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3370 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3371 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3372 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3373 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3374 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3375 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3376 WRITE_COEF(0x49, 0x0), /* test mode */
3377 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3378 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3379 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3380 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3384 static void alc283_restore_default_value(struct hda_codec *codec)
3386 alc_process_coef_fw(codec, alc283_coefs);
3389 static void alc283_init(struct hda_codec *codec)
3391 struct alc_spec *spec = codec->spec;
3392 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3395 alc283_restore_default_value(codec);
3401 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3403 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3404 /* Headphone capless set to high power mode */
3405 alc_write_coef_idx(codec, 0x43, 0x9004);
3407 snd_hda_codec_write(codec, hp_pin, 0,
3408 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3413 snd_hda_codec_write(codec, hp_pin, 0,
3414 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3418 /* Index 0x46 Combo jack auto switch control 2 */
3419 /* 3k pull low control for Headset jack. */
3420 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3421 /* Headphone capless set to normal mode */
3422 alc_write_coef_idx(codec, 0x43, 0x9614);
3425 static void alc283_shutup(struct hda_codec *codec)
3427 struct alc_spec *spec = codec->spec;
3428 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3432 alc269_shutup(codec);
3436 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3438 alc_write_coef_idx(codec, 0x43, 0x9004);
3440 /*depop hp during suspend*/
3441 alc_write_coef_idx(codec, 0x06, 0x2100);
3443 snd_hda_codec_write(codec, hp_pin, 0,
3444 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3449 if (!spec->no_shutup_pins)
3450 snd_hda_codec_write(codec, hp_pin, 0,
3451 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3453 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3457 alc_auto_setup_eapd(codec, false);
3458 alc_shutup_pins(codec);
3459 alc_write_coef_idx(codec, 0x43, 0x9614);
3462 static void alc256_init(struct hda_codec *codec)
3464 struct alc_spec *spec = codec->spec;
3465 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3473 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3478 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3479 if (spec->ultra_low_power) {
3480 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3481 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3482 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3483 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3484 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3488 snd_hda_codec_write(codec, hp_pin, 0,
3489 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3491 if (hp_pin_sense || spec->ultra_low_power)
3494 snd_hda_codec_write(codec, hp_pin, 0,
3495 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3497 if (hp_pin_sense || spec->ultra_low_power)
3500 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3501 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3502 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3503 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3505 * Expose headphone mic (or possibly Line In on some machines) instead
3506 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3507 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3510 alc_write_coef_idx(codec, 0x36, 0x5757);
3513 static void alc256_shutup(struct hda_codec *codec)
3515 struct alc_spec *spec = codec->spec;
3516 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3522 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3527 snd_hda_codec_write(codec, hp_pin, 0,
3528 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3530 if (hp_pin_sense || spec->ultra_low_power)
3533 /* 3k pull low control for Headset jack. */
3534 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3535 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3536 * when booting with headset plugged. So skip setting it for the codec alc257
3538 if (codec->core.vendor_id != 0x10ec0257)
3539 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3541 if (!spec->no_shutup_pins)
3542 snd_hda_codec_write(codec, hp_pin, 0,
3543 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3545 if (hp_pin_sense || spec->ultra_low_power)
3548 alc_auto_setup_eapd(codec, false);
3549 alc_shutup_pins(codec);
3550 if (spec->ultra_low_power) {
3552 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3553 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3554 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3555 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3556 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3561 static void alc225_init(struct hda_codec *codec)
3563 struct alc_spec *spec = codec->spec;
3564 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3565 bool hp1_pin_sense, hp2_pin_sense;
3571 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3572 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3574 if (hp1_pin_sense || hp2_pin_sense)
3577 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3578 if (spec->ultra_low_power) {
3579 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3580 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3581 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3585 if (hp1_pin_sense || spec->ultra_low_power)
3586 snd_hda_codec_write(codec, hp_pin, 0,
3587 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3589 snd_hda_codec_write(codec, 0x16, 0,
3590 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3592 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3595 if (hp1_pin_sense || spec->ultra_low_power)
3596 snd_hda_codec_write(codec, hp_pin, 0,
3597 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3599 snd_hda_codec_write(codec, 0x16, 0,
3600 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3602 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3605 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3606 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3609 static void alc225_shutup(struct hda_codec *codec)
3611 struct alc_spec *spec = codec->spec;
3612 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3613 bool hp1_pin_sense, hp2_pin_sense;
3618 alc_disable_headset_jack_key(codec);
3619 /* 3k pull low control for Headset jack. */
3620 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3622 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3623 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3625 if (hp1_pin_sense || hp2_pin_sense)
3628 if (hp1_pin_sense || spec->ultra_low_power)
3629 snd_hda_codec_write(codec, hp_pin, 0,
3630 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3632 snd_hda_codec_write(codec, 0x16, 0,
3633 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3635 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3638 if (hp1_pin_sense || spec->ultra_low_power)
3639 snd_hda_codec_write(codec, hp_pin, 0,
3640 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3642 snd_hda_codec_write(codec, 0x16, 0,
3643 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3645 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3648 alc_auto_setup_eapd(codec, false);
3649 alc_shutup_pins(codec);
3650 if (spec->ultra_low_power) {
3652 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3653 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3654 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3655 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3659 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3660 alc_enable_headset_jack_key(codec);
3663 static void alc_default_init(struct hda_codec *codec)
3665 struct alc_spec *spec = codec->spec;
3666 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3674 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3679 snd_hda_codec_write(codec, hp_pin, 0,
3680 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3685 snd_hda_codec_write(codec, hp_pin, 0,
3686 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3692 static void alc_default_shutup(struct hda_codec *codec)
3694 struct alc_spec *spec = codec->spec;
3695 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3699 alc269_shutup(codec);
3703 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3708 snd_hda_codec_write(codec, hp_pin, 0,
3709 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3714 if (!spec->no_shutup_pins)
3715 snd_hda_codec_write(codec, hp_pin, 0,
3716 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3721 alc_auto_setup_eapd(codec, false);
3722 alc_shutup_pins(codec);
3725 static void alc294_hp_init(struct hda_codec *codec)
3727 struct alc_spec *spec = codec->spec;
3728 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3734 snd_hda_codec_write(codec, hp_pin, 0,
3735 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3739 if (!spec->no_shutup_pins)
3740 snd_hda_codec_write(codec, hp_pin, 0,
3741 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3743 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3744 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3746 /* Wait for depop procedure finish */
3747 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3748 for (i = 0; i < 20 && val & 0x0080; i++) {
3750 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3752 /* Set HP depop to auto mode */
3753 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3757 static void alc294_init(struct hda_codec *codec)
3759 struct alc_spec *spec = codec->spec;
3761 /* required only at boot or S4 resume time */
3762 if (!spec->done_hp_init ||
3763 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3764 alc294_hp_init(codec);
3765 spec->done_hp_init = true;
3767 alc_default_init(codec);
3770 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3773 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3774 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3775 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3778 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3782 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3783 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3785 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3790 static void alc5505_dsp_halt(struct hda_codec *codec)
3794 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3795 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3796 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3797 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3798 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3799 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3800 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3801 val = alc5505_coef_get(codec, 0x6220);
3802 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3805 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3807 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3808 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3809 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3810 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3811 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3812 alc5505_coef_set(codec, 0x880c, 0x00000004);
3815 static void alc5505_dsp_init(struct hda_codec *codec)
3819 alc5505_dsp_halt(codec);
3820 alc5505_dsp_back_from_halt(codec);
3821 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3822 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3823 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3824 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3825 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3826 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3827 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3828 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3829 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3830 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3831 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3832 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3833 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3835 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3837 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3839 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3841 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3842 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3843 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3844 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3845 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3846 alc5505_coef_set(codec, 0x880c, 0x00000003);
3847 alc5505_coef_set(codec, 0x880c, 0x00000010);
3849 #ifdef HALT_REALTEK_ALC5505
3850 alc5505_dsp_halt(codec);
3854 #ifdef HALT_REALTEK_ALC5505
3855 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3856 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3858 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3859 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3863 static int alc269_suspend(struct hda_codec *codec)
3865 struct alc_spec *spec = codec->spec;
3867 if (spec->has_alc5505_dsp)
3868 alc5505_dsp_suspend(codec);
3869 return alc_suspend(codec);
3872 static int alc269_resume(struct hda_codec *codec)
3874 struct alc_spec *spec = codec->spec;
3876 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3877 alc269vb_toggle_power_output(codec, 0);
3878 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3879 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3883 codec->patch_ops.init(codec);
3885 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3886 alc269vb_toggle_power_output(codec, 1);
3887 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3888 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3892 snd_hda_regmap_sync(codec);
3893 hda_call_check_power_status(codec, 0x01);
3895 /* on some machine, the BIOS will clear the codec gpio data when enter
3896 * suspend, and won't restore the data after resume, so we restore it
3899 if (spec->gpio_data)
3900 alc_write_gpio_data(codec);
3902 if (spec->has_alc5505_dsp)
3903 alc5505_dsp_resume(codec);
3907 #endif /* CONFIG_PM */
3909 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3910 const struct hda_fixup *fix, int action)
3912 struct alc_spec *spec = codec->spec;
3914 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3915 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3918 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3919 const struct hda_fixup *fix,
3922 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3923 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3925 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3926 snd_hda_codec_set_pincfg(codec, 0x19,
3927 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3928 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3931 static void alc269_fixup_hweq(struct hda_codec *codec,
3932 const struct hda_fixup *fix, int action)
3934 if (action == HDA_FIXUP_ACT_INIT)
3935 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3938 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3939 const struct hda_fixup *fix, int action)
3941 struct alc_spec *spec = codec->spec;
3943 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3944 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3947 static void alc271_fixup_dmic(struct hda_codec *codec,
3948 const struct hda_fixup *fix, int action)
3950 static const struct hda_verb verbs[] = {
3951 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3952 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3957 if (strcmp(codec->core.chip_name, "ALC271X") &&
3958 strcmp(codec->core.chip_name, "ALC269VB"))
3960 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3961 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3962 snd_hda_sequence_write(codec, verbs);
3965 /* Fix the speaker amp after resume, etc */
3966 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
3967 const struct hda_fixup *fix,
3970 if (action == HDA_FIXUP_ACT_INIT)
3971 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
3974 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3975 const struct hda_fixup *fix, int action)
3977 struct alc_spec *spec = codec->spec;
3979 if (action != HDA_FIXUP_ACT_PROBE)
3982 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3983 * fix the sample rate of analog I/O to 44.1kHz
3985 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3986 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3989 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3990 const struct hda_fixup *fix, int action)
3992 /* The digital-mic unit sends PDM (differential signal) instead of
3993 * the standard PCM, thus you can't record a valid mono stream as is.
3994 * Below is a workaround specific to ALC269 to control the dmic
3995 * signal source as mono.
3997 if (action == HDA_FIXUP_ACT_INIT)
3998 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4001 static void alc269_quanta_automute(struct hda_codec *codec)
4003 snd_hda_gen_update_outputs(codec);
4005 alc_write_coef_idx(codec, 0x0c, 0x680);
4006 alc_write_coef_idx(codec, 0x0c, 0x480);
4009 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4010 const struct hda_fixup *fix, int action)
4012 struct alc_spec *spec = codec->spec;
4013 if (action != HDA_FIXUP_ACT_PROBE)
4015 spec->gen.automute_hook = alc269_quanta_automute;
4018 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4019 struct hda_jack_callback *jack)
4021 struct alc_spec *spec = codec->spec;
4024 snd_hda_gen_hp_automute(codec, jack);
4026 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4028 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4031 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4036 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4038 struct hda_alc298_mbxinit {
4039 unsigned char value_0x23;
4040 unsigned char value_0x25;
4043 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4044 const struct hda_alc298_mbxinit *initval,
4047 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4048 alc_write_coef_idx(codec, 0x26, 0xb000);
4051 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4053 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4054 alc_write_coef_idx(codec, 0x26, 0xf000);
4055 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4057 if (initval->value_0x23 != 0x1e)
4058 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4060 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4061 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4064 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4065 const struct hda_fixup *fix,
4068 /* Initialization magic */
4069 static const struct hda_alc298_mbxinit dac_init[] = {
4070 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4071 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4072 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4073 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4074 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4075 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4077 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4078 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4079 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4082 const struct hda_alc298_mbxinit *seq;
4084 if (action != HDA_FIXUP_ACT_INIT)
4088 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4089 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4090 alc_write_coef_idx(codec, 0x26, 0xf000);
4091 alc_write_coef_idx(codec, 0x22, 0x31);
4092 alc_write_coef_idx(codec, 0x23, 0x0b);
4093 alc_write_coef_idx(codec, 0x25, 0x00);
4094 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4095 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4097 for (seq = dac_init; seq->value_0x23; seq++)
4098 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4101 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4102 const struct hda_fixup *fix, int action)
4104 struct alc_spec *spec = codec->spec;
4105 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4106 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4107 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4111 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4112 bool polarity, bool on)
4114 unsigned int pinval;
4120 pinval = snd_hda_codec_get_pin_target(codec, pin);
4121 pinval &= ~AC_PINCTL_VREFEN;
4122 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4123 /* temporarily power up/down for setting VREF */
4124 snd_hda_power_up_pm(codec);
4125 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4126 snd_hda_power_down_pm(codec);
4129 /* update mute-LED according to the speaker mute state via mic VREF pin */
4130 static int vref_mute_led_set(struct led_classdev *led_cdev,
4131 enum led_brightness brightness)
4133 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4134 struct alc_spec *spec = codec->spec;
4136 alc_update_vref_led(codec, spec->mute_led_nid,
4137 spec->mute_led_polarity, brightness);
4141 /* Make sure the led works even in runtime suspend */
4142 static unsigned int led_power_filter(struct hda_codec *codec,
4144 unsigned int power_state)
4146 struct alc_spec *spec = codec->spec;
4148 if (power_state != AC_PWRST_D3 || nid == 0 ||
4149 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4152 /* Set pin ctl again, it might have just been set to 0 */
4153 snd_hda_set_pin_ctl(codec, nid,
4154 snd_hda_codec_get_pin_target(codec, nid));
4156 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4159 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4160 const struct hda_fixup *fix, int action)
4162 struct alc_spec *spec = codec->spec;
4163 const struct dmi_device *dev = NULL;
4165 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4168 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4170 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4172 if (pin < 0x0a || pin >= 0x10)
4174 spec->mute_led_polarity = pol;
4175 spec->mute_led_nid = pin - 0x0a + 0x18;
4176 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4177 codec->power_filter = led_power_filter;
4179 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4180 spec->mute_led_polarity);
4185 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4186 const struct hda_fixup *fix,
4187 int action, hda_nid_t pin)
4189 struct alc_spec *spec = codec->spec;
4191 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4192 spec->mute_led_polarity = 0;
4193 spec->mute_led_nid = pin;
4194 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4195 codec->power_filter = led_power_filter;
4199 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4200 const struct hda_fixup *fix, int action)
4202 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4205 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4206 const struct hda_fixup *fix, int action)
4208 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4211 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4212 const struct hda_fixup *fix, int action)
4214 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4217 /* update LED status via GPIO */
4218 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4219 int polarity, bool enabled)
4223 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4226 /* turn on/off mute LED via GPIO per vmaster hook */
4227 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4228 enum led_brightness brightness)
4230 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4231 struct alc_spec *spec = codec->spec;
4233 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4234 spec->mute_led_polarity, !brightness);
4238 /* turn on/off mic-mute LED via GPIO per capture hook */
4239 static int micmute_led_set(struct led_classdev *led_cdev,
4240 enum led_brightness brightness)
4242 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4243 struct alc_spec *spec = codec->spec;
4245 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4246 spec->micmute_led_polarity, !brightness);
4250 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4251 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4253 unsigned int mute_mask,
4254 unsigned int micmute_mask)
4256 struct alc_spec *spec = codec->spec;
4258 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4260 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4263 spec->gpio_mute_led_mask = mute_mask;
4264 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4267 spec->gpio_mic_led_mask = micmute_mask;
4268 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4272 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4273 const struct hda_fixup *fix, int action)
4275 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4278 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4279 const struct hda_fixup *fix, int action)
4281 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4284 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4285 const struct hda_fixup *fix, int action)
4287 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4290 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4291 const struct hda_fixup *fix, int action)
4293 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4296 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4297 const struct hda_fixup *fix, int action)
4299 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4302 /* turn on/off mic-mute LED per capture hook via VREF change */
4303 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4304 enum led_brightness brightness)
4306 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4307 struct alc_spec *spec = codec->spec;
4309 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4310 spec->micmute_led_polarity, brightness);
4314 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4315 const struct hda_fixup *fix, int action)
4317 struct alc_spec *spec = codec->spec;
4319 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4320 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4321 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4322 * enable headphone amp
4324 spec->gpio_mask |= 0x10;
4325 spec->gpio_dir |= 0x10;
4326 spec->cap_mute_led_nid = 0x18;
4327 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4328 codec->power_filter = led_power_filter;
4332 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4333 const struct hda_fixup *fix, int action)
4335 struct alc_spec *spec = codec->spec;
4337 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4338 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4339 spec->cap_mute_led_nid = 0x18;
4340 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4341 codec->power_filter = led_power_filter;
4345 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4346 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4348 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4349 const struct hda_fixup *fix, int action)
4351 struct alc_spec *spec = codec->spec;
4354 case HDA_FIXUP_ACT_PRE_PROBE:
4355 spec->gpio_mask |= 0x01;
4356 spec->gpio_dir |= 0x01;
4358 case HDA_FIXUP_ACT_INIT:
4359 /* need to toggle GPIO to enable the amp */
4360 alc_update_gpio_data(codec, 0x01, true);
4362 alc_update_gpio_data(codec, 0x01, false);
4367 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4368 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4369 struct hda_codec *codec,
4370 struct snd_pcm_substream *substream,
4374 case HDA_GEN_PCM_ACT_PREPARE:
4375 alc_update_gpio_data(codec, 0x04, true);
4377 case HDA_GEN_PCM_ACT_CLEANUP:
4378 alc_update_gpio_data(codec, 0x04, false);
4383 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4384 const struct hda_fixup *fix,
4387 struct alc_spec *spec = codec->spec;
4389 if (action == HDA_FIXUP_ACT_PROBE) {
4390 spec->gpio_mask |= 0x04;
4391 spec->gpio_dir |= 0x04;
4392 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4396 static void alc_update_coef_led(struct hda_codec *codec,
4397 struct alc_coef_led *led,
4398 bool polarity, bool on)
4402 /* temporarily power up/down for setting COEF bit */
4403 alc_update_coef_idx(codec, led->idx, led->mask,
4404 on ? led->on : led->off);
4407 /* update mute-LED according to the speaker mute state via COEF bit */
4408 static int coef_mute_led_set(struct led_classdev *led_cdev,
4409 enum led_brightness brightness)
4411 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4412 struct alc_spec *spec = codec->spec;
4414 alc_update_coef_led(codec, &spec->mute_led_coef,
4415 spec->mute_led_polarity, brightness);
4419 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4420 const struct hda_fixup *fix,
4423 struct alc_spec *spec = codec->spec;
4425 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4426 spec->mute_led_polarity = 0;
4427 spec->mute_led_coef.idx = 0x0b;
4428 spec->mute_led_coef.mask = 1 << 3;
4429 spec->mute_led_coef.on = 1 << 3;
4430 spec->mute_led_coef.off = 0;
4431 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4435 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4436 const struct hda_fixup *fix,
4439 struct alc_spec *spec = codec->spec;
4441 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4442 spec->mute_led_polarity = 0;
4443 spec->mute_led_coef.idx = 0x34;
4444 spec->mute_led_coef.mask = 1 << 5;
4445 spec->mute_led_coef.on = 0;
4446 spec->mute_led_coef.off = 1 << 5;
4447 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4451 /* turn on/off mic-mute LED per capture hook by coef bit */
4452 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4453 enum led_brightness brightness)
4455 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4456 struct alc_spec *spec = codec->spec;
4458 alc_update_coef_led(codec, &spec->mic_led_coef,
4459 spec->micmute_led_polarity, brightness);
4463 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4464 const struct hda_fixup *fix, int action)
4466 struct alc_spec *spec = codec->spec;
4468 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4469 spec->mic_led_coef.idx = 0x19;
4470 spec->mic_led_coef.mask = 1 << 13;
4471 spec->mic_led_coef.on = 1 << 13;
4472 spec->mic_led_coef.off = 0;
4473 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4477 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4478 const struct hda_fixup *fix, int action)
4480 struct alc_spec *spec = codec->spec;
4482 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4483 spec->mic_led_coef.idx = 0x35;
4484 spec->mic_led_coef.mask = 3 << 2;
4485 spec->mic_led_coef.on = 2 << 2;
4486 spec->mic_led_coef.off = 1 << 2;
4487 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4491 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4492 const struct hda_fixup *fix, int action)
4494 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4495 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4498 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4499 const struct hda_fixup *fix, int action)
4501 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4502 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4505 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4506 const struct hda_fixup *fix, int action)
4508 struct alc_spec *spec = codec->spec;
4510 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4511 spec->cap_mute_led_nid = 0x1a;
4512 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4513 codec->power_filter = led_power_filter;
4517 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4518 const struct hda_fixup *fix, int action)
4520 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4521 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4524 #if IS_REACHABLE(CONFIG_INPUT)
4525 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4526 struct hda_jack_callback *event)
4528 struct alc_spec *spec = codec->spec;
4530 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4531 send both key on and key off event for every interrupt. */
4532 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4533 input_sync(spec->kb_dev);
4534 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4535 input_sync(spec->kb_dev);
4538 static int alc_register_micmute_input_device(struct hda_codec *codec)
4540 struct alc_spec *spec = codec->spec;
4543 spec->kb_dev = input_allocate_device();
4544 if (!spec->kb_dev) {
4545 codec_err(codec, "Out of memory (input_allocate_device)\n");
4549 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4551 spec->kb_dev->name = "Microphone Mute Button";
4552 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4553 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4554 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4555 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4556 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4557 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4559 if (input_register_device(spec->kb_dev)) {
4560 codec_err(codec, "input_register_device failed\n");
4561 input_free_device(spec->kb_dev);
4562 spec->kb_dev = NULL;
4569 /* GPIO1 = set according to SKU external amp
4570 * GPIO2 = mic mute hotkey
4572 * GPIO4 = mic mute LED
4574 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4575 const struct hda_fixup *fix, int action)
4577 struct alc_spec *spec = codec->spec;
4579 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4580 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4581 spec->init_amp = ALC_INIT_DEFAULT;
4582 if (alc_register_micmute_input_device(codec) != 0)
4585 spec->gpio_mask |= 0x06;
4586 spec->gpio_dir |= 0x02;
4587 spec->gpio_data |= 0x02;
4588 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4589 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4590 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4591 gpio2_mic_hotkey_event);
4599 case HDA_FIXUP_ACT_FREE:
4600 input_unregister_device(spec->kb_dev);
4601 spec->kb_dev = NULL;
4605 /* Line2 = mic mute hotkey
4606 * GPIO2 = mic mute LED
4608 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4609 const struct hda_fixup *fix, int action)
4611 struct alc_spec *spec = codec->spec;
4613 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4614 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4615 spec->init_amp = ALC_INIT_DEFAULT;
4616 if (alc_register_micmute_input_device(codec) != 0)
4619 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4620 gpio2_mic_hotkey_event);
4628 case HDA_FIXUP_ACT_FREE:
4629 input_unregister_device(spec->kb_dev);
4630 spec->kb_dev = NULL;
4634 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4635 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4638 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4639 const struct hda_fixup *fix, int action)
4641 struct alc_spec *spec = codec->spec;
4643 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4644 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4645 spec->cap_mute_led_nid = 0x18;
4646 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4650 static const struct coef_fw alc225_pre_hsmode[] = {
4651 UPDATE_COEF(0x4a, 1<<8, 0),
4652 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4653 UPDATE_COEF(0x63, 3<<14, 3<<14),
4654 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4655 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4656 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4657 UPDATE_COEF(0x4a, 3<<10, 0),
4661 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4663 struct alc_spec *spec = codec->spec;
4664 static const struct coef_fw coef0255[] = {
4665 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4666 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4667 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4668 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4669 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4672 static const struct coef_fw coef0256[] = {
4673 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4674 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4675 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4676 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4677 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4680 static const struct coef_fw coef0233[] = {
4681 WRITE_COEF(0x1b, 0x0c0b),
4682 WRITE_COEF(0x45, 0xc429),
4683 UPDATE_COEF(0x35, 0x4000, 0),
4684 WRITE_COEF(0x06, 0x2104),
4685 WRITE_COEF(0x1a, 0x0001),
4686 WRITE_COEF(0x26, 0x0004),
4687 WRITE_COEF(0x32, 0x42a3),
4690 static const struct coef_fw coef0288[] = {
4691 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4692 UPDATE_COEF(0x50, 0x2000, 0x2000),
4693 UPDATE_COEF(0x56, 0x0006, 0x0006),
4694 UPDATE_COEF(0x66, 0x0008, 0),
4695 UPDATE_COEF(0x67, 0x2000, 0),
4698 static const struct coef_fw coef0298[] = {
4699 UPDATE_COEF(0x19, 0x1300, 0x0300),
4702 static const struct coef_fw coef0292[] = {
4703 WRITE_COEF(0x76, 0x000e),
4704 WRITE_COEF(0x6c, 0x2400),
4705 WRITE_COEF(0x18, 0x7308),
4706 WRITE_COEF(0x6b, 0xc429),
4709 static const struct coef_fw coef0293[] = {
4710 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4711 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4712 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4713 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4714 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4715 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4718 static const struct coef_fw coef0668[] = {
4719 WRITE_COEF(0x15, 0x0d40),
4720 WRITE_COEF(0xb7, 0x802b),
4723 static const struct coef_fw coef0225[] = {
4724 UPDATE_COEF(0x63, 3<<14, 0),
4727 static const struct coef_fw coef0274[] = {
4728 UPDATE_COEF(0x4a, 0x0100, 0),
4729 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4730 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4731 UPDATE_COEF(0x4a, 0x0010, 0),
4732 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4733 WRITE_COEF(0x45, 0x5289),
4734 UPDATE_COEF(0x4a, 0x0c00, 0),
4738 if (spec->no_internal_mic_pin) {
4739 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4743 switch (codec->core.vendor_id) {
4745 alc_process_coef_fw(codec, coef0255);
4749 alc_process_coef_fw(codec, coef0256);
4754 alc_process_coef_fw(codec, coef0274);
4758 alc_process_coef_fw(codec, coef0233);
4762 alc_process_coef_fw(codec, coef0288);
4765 alc_process_coef_fw(codec, coef0298);
4766 alc_process_coef_fw(codec, coef0288);
4769 alc_process_coef_fw(codec, coef0292);
4772 alc_process_coef_fw(codec, coef0293);
4775 alc_process_coef_fw(codec, coef0668);
4783 alc_process_coef_fw(codec, alc225_pre_hsmode);
4784 alc_process_coef_fw(codec, coef0225);
4787 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4790 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4794 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4797 static const struct coef_fw coef0255[] = {
4798 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4799 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4802 static const struct coef_fw coef0256[] = {
4803 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4804 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4805 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4808 static const struct coef_fw coef0233[] = {
4809 UPDATE_COEF(0x35, 0, 1<<14),
4810 WRITE_COEF(0x06, 0x2100),
4811 WRITE_COEF(0x1a, 0x0021),
4812 WRITE_COEF(0x26, 0x008c),
4815 static const struct coef_fw coef0288[] = {
4816 UPDATE_COEF(0x4f, 0x00c0, 0),
4817 UPDATE_COEF(0x50, 0x2000, 0),
4818 UPDATE_COEF(0x56, 0x0006, 0),
4819 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4820 UPDATE_COEF(0x66, 0x0008, 0x0008),
4821 UPDATE_COEF(0x67, 0x2000, 0x2000),
4824 static const struct coef_fw coef0292[] = {
4825 WRITE_COEF(0x19, 0xa208),
4826 WRITE_COEF(0x2e, 0xacf0),
4829 static const struct coef_fw coef0293[] = {
4830 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4831 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4832 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4835 static const struct coef_fw coef0688[] = {
4836 WRITE_COEF(0xb7, 0x802b),
4837 WRITE_COEF(0xb5, 0x1040),
4838 UPDATE_COEF(0xc3, 0, 1<<12),
4841 static const struct coef_fw coef0225[] = {
4842 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4843 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4844 UPDATE_COEF(0x63, 3<<14, 0),
4847 static const struct coef_fw coef0274[] = {
4848 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4849 UPDATE_COEF(0x4a, 0x0010, 0),
4850 UPDATE_COEF(0x6b, 0xf000, 0),
4854 switch (codec->core.vendor_id) {
4856 alc_write_coef_idx(codec, 0x45, 0xc489);
4857 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4858 alc_process_coef_fw(codec, coef0255);
4859 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4863 alc_write_coef_idx(codec, 0x45, 0xc489);
4864 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4865 alc_process_coef_fw(codec, coef0256);
4866 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4871 alc_write_coef_idx(codec, 0x45, 0x4689);
4872 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4873 alc_process_coef_fw(codec, coef0274);
4874 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4878 alc_write_coef_idx(codec, 0x45, 0xc429);
4879 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4880 alc_process_coef_fw(codec, coef0233);
4881 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4886 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4887 alc_process_coef_fw(codec, coef0288);
4888 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4891 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4892 alc_process_coef_fw(codec, coef0292);
4895 /* Set to TRS mode */
4896 alc_write_coef_idx(codec, 0x45, 0xc429);
4897 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4898 alc_process_coef_fw(codec, coef0293);
4899 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4902 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4906 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4907 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4910 alc_write_coef_idx(codec, 0x11, 0x0001);
4911 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4912 alc_process_coef_fw(codec, coef0688);
4913 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4921 alc_process_coef_fw(codec, alc225_pre_hsmode);
4922 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4923 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4924 alc_process_coef_fw(codec, coef0225);
4925 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4928 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4931 static void alc_headset_mode_default(struct hda_codec *codec)
4933 static const struct coef_fw coef0225[] = {
4934 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4935 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4936 UPDATE_COEF(0x49, 3<<8, 0<<8),
4937 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4938 UPDATE_COEF(0x63, 3<<14, 0),
4939 UPDATE_COEF(0x67, 0xf000, 0x3000),
4942 static const struct coef_fw coef0255[] = {
4943 WRITE_COEF(0x45, 0xc089),
4944 WRITE_COEF(0x45, 0xc489),
4945 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4946 WRITE_COEF(0x49, 0x0049),
4949 static const struct coef_fw coef0256[] = {
4950 WRITE_COEF(0x45, 0xc489),
4951 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4952 WRITE_COEF(0x49, 0x0049),
4953 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4954 WRITE_COEF(0x06, 0x6100),
4957 static const struct coef_fw coef0233[] = {
4958 WRITE_COEF(0x06, 0x2100),
4959 WRITE_COEF(0x32, 0x4ea3),
4962 static const struct coef_fw coef0288[] = {
4963 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4964 UPDATE_COEF(0x50, 0x2000, 0x2000),
4965 UPDATE_COEF(0x56, 0x0006, 0x0006),
4966 UPDATE_COEF(0x66, 0x0008, 0),
4967 UPDATE_COEF(0x67, 0x2000, 0),
4970 static const struct coef_fw coef0292[] = {
4971 WRITE_COEF(0x76, 0x000e),
4972 WRITE_COEF(0x6c, 0x2400),
4973 WRITE_COEF(0x6b, 0xc429),
4974 WRITE_COEF(0x18, 0x7308),
4977 static const struct coef_fw coef0293[] = {
4978 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4979 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4980 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4983 static const struct coef_fw coef0688[] = {
4984 WRITE_COEF(0x11, 0x0041),
4985 WRITE_COEF(0x15, 0x0d40),
4986 WRITE_COEF(0xb7, 0x802b),
4989 static const struct coef_fw coef0274[] = {
4990 WRITE_COEF(0x45, 0x4289),
4991 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4992 UPDATE_COEF(0x6b, 0x0f00, 0),
4993 UPDATE_COEF(0x49, 0x0300, 0x0300),
4997 switch (codec->core.vendor_id) {
5004 alc_process_coef_fw(codec, alc225_pre_hsmode);
5005 alc_process_coef_fw(codec, coef0225);
5008 alc_process_coef_fw(codec, coef0255);
5012 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5013 alc_write_coef_idx(codec, 0x45, 0xc089);
5015 alc_process_coef_fw(codec, coef0256);
5020 alc_process_coef_fw(codec, coef0274);
5024 alc_process_coef_fw(codec, coef0233);
5029 alc_process_coef_fw(codec, coef0288);
5032 alc_process_coef_fw(codec, coef0292);
5035 alc_process_coef_fw(codec, coef0293);
5038 alc_process_coef_fw(codec, coef0688);
5041 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5044 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5048 static void alc_headset_mode_ctia(struct hda_codec *codec)
5052 static const struct coef_fw coef0255[] = {
5053 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5054 WRITE_COEF(0x1b, 0x0c2b),
5055 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5058 static const struct coef_fw coef0256[] = {
5059 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5060 WRITE_COEF(0x1b, 0x0e6b),
5063 static const struct coef_fw coef0233[] = {
5064 WRITE_COEF(0x45, 0xd429),
5065 WRITE_COEF(0x1b, 0x0c2b),
5066 WRITE_COEF(0x32, 0x4ea3),
5069 static const struct coef_fw coef0288[] = {
5070 UPDATE_COEF(0x50, 0x2000, 0x2000),
5071 UPDATE_COEF(0x56, 0x0006, 0x0006),
5072 UPDATE_COEF(0x66, 0x0008, 0),
5073 UPDATE_COEF(0x67, 0x2000, 0),
5076 static const struct coef_fw coef0292[] = {
5077 WRITE_COEF(0x6b, 0xd429),
5078 WRITE_COEF(0x76, 0x0008),
5079 WRITE_COEF(0x18, 0x7388),
5082 static const struct coef_fw coef0293[] = {
5083 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5084 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5087 static const struct coef_fw coef0688[] = {
5088 WRITE_COEF(0x11, 0x0001),
5089 WRITE_COEF(0x15, 0x0d60),
5090 WRITE_COEF(0xc3, 0x0000),
5093 static const struct coef_fw coef0225_1[] = {
5094 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5095 UPDATE_COEF(0x63, 3<<14, 2<<14),
5098 static const struct coef_fw coef0225_2[] = {
5099 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5100 UPDATE_COEF(0x63, 3<<14, 1<<14),
5104 switch (codec->core.vendor_id) {
5106 alc_process_coef_fw(codec, coef0255);
5110 alc_process_coef_fw(codec, coef0256);
5115 alc_write_coef_idx(codec, 0x45, 0xd689);
5119 alc_process_coef_fw(codec, coef0233);
5122 val = alc_read_coef_idx(codec, 0x50);
5123 if (val & (1 << 12)) {
5124 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5125 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5128 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5129 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5135 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5137 alc_process_coef_fw(codec, coef0288);
5140 alc_process_coef_fw(codec, coef0292);
5143 alc_process_coef_fw(codec, coef0293);
5146 alc_process_coef_fw(codec, coef0688);
5154 val = alc_read_coef_idx(codec, 0x45);
5156 alc_process_coef_fw(codec, coef0225_2);
5158 alc_process_coef_fw(codec, coef0225_1);
5161 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5164 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5168 static void alc_headset_mode_omtp(struct hda_codec *codec)
5170 static const struct coef_fw coef0255[] = {
5171 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5172 WRITE_COEF(0x1b, 0x0c2b),
5173 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5176 static const struct coef_fw coef0256[] = {
5177 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5178 WRITE_COEF(0x1b, 0x0e6b),
5181 static const struct coef_fw coef0233[] = {
5182 WRITE_COEF(0x45, 0xe429),
5183 WRITE_COEF(0x1b, 0x0c2b),
5184 WRITE_COEF(0x32, 0x4ea3),
5187 static const struct coef_fw coef0288[] = {
5188 UPDATE_COEF(0x50, 0x2000, 0x2000),
5189 UPDATE_COEF(0x56, 0x0006, 0x0006),
5190 UPDATE_COEF(0x66, 0x0008, 0),
5191 UPDATE_COEF(0x67, 0x2000, 0),
5194 static const struct coef_fw coef0292[] = {
5195 WRITE_COEF(0x6b, 0xe429),
5196 WRITE_COEF(0x76, 0x0008),
5197 WRITE_COEF(0x18, 0x7388),
5200 static const struct coef_fw coef0293[] = {
5201 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5202 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5205 static const struct coef_fw coef0688[] = {
5206 WRITE_COEF(0x11, 0x0001),
5207 WRITE_COEF(0x15, 0x0d50),
5208 WRITE_COEF(0xc3, 0x0000),
5211 static const struct coef_fw coef0225[] = {
5212 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5213 UPDATE_COEF(0x63, 3<<14, 2<<14),
5217 switch (codec->core.vendor_id) {
5219 alc_process_coef_fw(codec, coef0255);
5223 alc_process_coef_fw(codec, coef0256);
5228 alc_write_coef_idx(codec, 0x45, 0xe689);
5232 alc_process_coef_fw(codec, coef0233);
5235 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5236 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5241 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5243 alc_process_coef_fw(codec, coef0288);
5246 alc_process_coef_fw(codec, coef0292);
5249 alc_process_coef_fw(codec, coef0293);
5252 alc_process_coef_fw(codec, coef0688);
5260 alc_process_coef_fw(codec, coef0225);
5263 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5266 static void alc_determine_headset_type(struct hda_codec *codec)
5269 bool is_ctia = false;
5270 struct alc_spec *spec = codec->spec;
5271 static const struct coef_fw coef0255[] = {
5272 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5273 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5277 static const struct coef_fw coef0288[] = {
5278 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5281 static const struct coef_fw coef0298[] = {
5282 UPDATE_COEF(0x50, 0x2000, 0x2000),
5283 UPDATE_COEF(0x56, 0x0006, 0x0006),
5284 UPDATE_COEF(0x66, 0x0008, 0),
5285 UPDATE_COEF(0x67, 0x2000, 0),
5286 UPDATE_COEF(0x19, 0x1300, 0x1300),
5289 static const struct coef_fw coef0293[] = {
5290 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5291 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5294 static const struct coef_fw coef0688[] = {
5295 WRITE_COEF(0x11, 0x0001),
5296 WRITE_COEF(0xb7, 0x802b),
5297 WRITE_COEF(0x15, 0x0d60),
5298 WRITE_COEF(0xc3, 0x0c00),
5301 static const struct coef_fw coef0274[] = {
5302 UPDATE_COEF(0x4a, 0x0010, 0),
5303 UPDATE_COEF(0x4a, 0x8000, 0),
5304 WRITE_COEF(0x45, 0xd289),
5305 UPDATE_COEF(0x49, 0x0300, 0x0300),
5309 if (spec->no_internal_mic_pin) {
5310 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5314 switch (codec->core.vendor_id) {
5316 alc_process_coef_fw(codec, coef0255);
5318 val = alc_read_coef_idx(codec, 0x46);
5319 is_ctia = (val & 0x0070) == 0x0070;
5323 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5324 alc_write_coef_idx(codec, 0x06, 0x6104);
5325 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5327 snd_hda_codec_write(codec, 0x21, 0,
5328 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5330 snd_hda_codec_write(codec, 0x21, 0,
5331 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5333 alc_process_coef_fw(codec, coef0255);
5335 val = alc_read_coef_idx(codec, 0x46);
5336 is_ctia = (val & 0x0070) == 0x0070;
5338 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5339 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5341 snd_hda_codec_write(codec, 0x21, 0,
5342 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5344 snd_hda_codec_write(codec, 0x21, 0,
5345 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5350 alc_process_coef_fw(codec, coef0274);
5352 val = alc_read_coef_idx(codec, 0x46);
5353 is_ctia = (val & 0x00f0) == 0x00f0;
5357 alc_write_coef_idx(codec, 0x45, 0xd029);
5359 val = alc_read_coef_idx(codec, 0x46);
5360 is_ctia = (val & 0x0070) == 0x0070;
5363 snd_hda_codec_write(codec, 0x21, 0,
5364 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5366 snd_hda_codec_write(codec, 0x21, 0,
5367 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5370 val = alc_read_coef_idx(codec, 0x50);
5371 if (val & (1 << 12)) {
5372 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5373 alc_process_coef_fw(codec, coef0288);
5375 val = alc_read_coef_idx(codec, 0x50);
5376 is_ctia = (val & 0x0070) == 0x0070;
5378 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5379 alc_process_coef_fw(codec, coef0288);
5381 val = alc_read_coef_idx(codec, 0x50);
5382 is_ctia = (val & 0x0070) == 0x0070;
5384 alc_process_coef_fw(codec, coef0298);
5385 snd_hda_codec_write(codec, 0x21, 0,
5386 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5388 snd_hda_codec_write(codec, 0x21, 0,
5389 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5393 alc_process_coef_fw(codec, coef0288);
5395 val = alc_read_coef_idx(codec, 0x50);
5396 is_ctia = (val & 0x0070) == 0x0070;
5399 alc_write_coef_idx(codec, 0x6b, 0xd429);
5401 val = alc_read_coef_idx(codec, 0x6c);
5402 is_ctia = (val & 0x001c) == 0x001c;
5405 alc_process_coef_fw(codec, coef0293);
5407 val = alc_read_coef_idx(codec, 0x46);
5408 is_ctia = (val & 0x0070) == 0x0070;
5411 alc_process_coef_fw(codec, coef0688);
5413 val = alc_read_coef_idx(codec, 0xbe);
5414 is_ctia = (val & 0x1c02) == 0x1c02;
5422 snd_hda_codec_write(codec, 0x21, 0,
5423 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5425 snd_hda_codec_write(codec, 0x21, 0,
5426 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5428 alc_process_coef_fw(codec, alc225_pre_hsmode);
5429 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5430 val = alc_read_coef_idx(codec, 0x45);
5431 if (val & (1 << 9)) {
5432 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5433 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5435 val = alc_read_coef_idx(codec, 0x46);
5436 is_ctia = (val & 0x00f0) == 0x00f0;
5438 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5439 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5441 val = alc_read_coef_idx(codec, 0x46);
5442 is_ctia = (val & 0x00f0) == 0x00f0;
5444 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5445 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5446 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5448 snd_hda_codec_write(codec, 0x21, 0,
5449 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5451 snd_hda_codec_write(codec, 0x21, 0,
5452 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5459 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5460 is_ctia ? "yes" : "no");
5461 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5464 static void alc_update_headset_mode(struct hda_codec *codec)
5466 struct alc_spec *spec = codec->spec;
5468 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5469 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5471 int new_headset_mode;
5473 if (!snd_hda_jack_detect(codec, hp_pin))
5474 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5475 else if (mux_pin == spec->headset_mic_pin)
5476 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5477 else if (mux_pin == spec->headphone_mic_pin)
5478 new_headset_mode = ALC_HEADSET_MODE_MIC;
5480 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5482 if (new_headset_mode == spec->current_headset_mode) {
5483 snd_hda_gen_update_outputs(codec);
5487 switch (new_headset_mode) {
5488 case ALC_HEADSET_MODE_UNPLUGGED:
5489 alc_headset_mode_unplugged(codec);
5490 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5491 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5492 spec->gen.hp_jack_present = false;
5494 case ALC_HEADSET_MODE_HEADSET:
5495 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5496 alc_determine_headset_type(codec);
5497 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5498 alc_headset_mode_ctia(codec);
5499 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5500 alc_headset_mode_omtp(codec);
5501 spec->gen.hp_jack_present = true;
5503 case ALC_HEADSET_MODE_MIC:
5504 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5505 spec->gen.hp_jack_present = false;
5507 case ALC_HEADSET_MODE_HEADPHONE:
5508 alc_headset_mode_default(codec);
5509 spec->gen.hp_jack_present = true;
5512 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5513 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5514 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5515 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5516 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5519 spec->current_headset_mode = new_headset_mode;
5521 snd_hda_gen_update_outputs(codec);
5524 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5525 struct snd_kcontrol *kcontrol,
5526 struct snd_ctl_elem_value *ucontrol)
5528 alc_update_headset_mode(codec);
5531 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5532 struct hda_jack_callback *jack)
5534 snd_hda_gen_hp_automute(codec, jack);
5535 alc_update_headset_mode(codec);
5538 static void alc_probe_headset_mode(struct hda_codec *codec)
5541 struct alc_spec *spec = codec->spec;
5542 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5545 for (i = 0; i < cfg->num_inputs; i++) {
5546 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5547 spec->headset_mic_pin = cfg->inputs[i].pin;
5548 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5549 spec->headphone_mic_pin = cfg->inputs[i].pin;
5552 WARN_ON(spec->gen.cap_sync_hook);
5553 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5554 spec->gen.automute_hook = alc_update_headset_mode;
5555 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5558 static void alc_fixup_headset_mode(struct hda_codec *codec,
5559 const struct hda_fixup *fix, int action)
5561 struct alc_spec *spec = codec->spec;
5564 case HDA_FIXUP_ACT_PRE_PROBE:
5565 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5567 case HDA_FIXUP_ACT_PROBE:
5568 alc_probe_headset_mode(codec);
5570 case HDA_FIXUP_ACT_INIT:
5571 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5572 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5573 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5575 alc_update_headset_mode(codec);
5580 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5581 const struct hda_fixup *fix, int action)
5583 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5584 struct alc_spec *spec = codec->spec;
5585 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5588 alc_fixup_headset_mode(codec, fix, action);
5591 static void alc255_set_default_jack_type(struct hda_codec *codec)
5593 /* Set to iphone type */
5594 static const struct coef_fw alc255fw[] = {
5595 WRITE_COEF(0x1b, 0x880b),
5596 WRITE_COEF(0x45, 0xd089),
5597 WRITE_COEF(0x1b, 0x080b),
5598 WRITE_COEF(0x46, 0x0004),
5599 WRITE_COEF(0x1b, 0x0c0b),
5602 static const struct coef_fw alc256fw[] = {
5603 WRITE_COEF(0x1b, 0x884b),
5604 WRITE_COEF(0x45, 0xd089),
5605 WRITE_COEF(0x1b, 0x084b),
5606 WRITE_COEF(0x46, 0x0004),
5607 WRITE_COEF(0x1b, 0x0c4b),
5610 switch (codec->core.vendor_id) {
5612 alc_process_coef_fw(codec, alc255fw);
5616 alc_process_coef_fw(codec, alc256fw);
5622 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5623 const struct hda_fixup *fix, int action)
5625 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5626 alc255_set_default_jack_type(codec);
5628 alc_fixup_headset_mode(codec, fix, action);
5631 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5632 const struct hda_fixup *fix, int action)
5634 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5635 struct alc_spec *spec = codec->spec;
5636 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5637 alc255_set_default_jack_type(codec);
5640 alc_fixup_headset_mode(codec, fix, action);
5643 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5644 struct hda_jack_callback *jack)
5646 struct alc_spec *spec = codec->spec;
5648 alc_update_headset_jack_cb(codec, jack);
5649 /* Headset Mic enable or disable, only for Dell Dino */
5650 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5653 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5654 const struct hda_fixup *fix, int action)
5656 alc_fixup_headset_mode(codec, fix, action);
5657 if (action == HDA_FIXUP_ACT_PROBE) {
5658 struct alc_spec *spec = codec->spec;
5659 /* toggled via hp_automute_hook */
5660 spec->gpio_mask |= 0x40;
5661 spec->gpio_dir |= 0x40;
5662 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5666 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5667 const struct hda_fixup *fix, int action)
5669 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5670 struct alc_spec *spec = codec->spec;
5671 spec->gen.auto_mute_via_amp = 1;
5675 static void alc_fixup_no_shutup(struct hda_codec *codec,
5676 const struct hda_fixup *fix, int action)
5678 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5679 struct alc_spec *spec = codec->spec;
5680 spec->no_shutup_pins = 1;
5684 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5685 const struct hda_fixup *fix, int action)
5687 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5688 struct alc_spec *spec = codec->spec;
5689 /* Disable AA-loopback as it causes white noise */
5690 spec->gen.mixer_nid = 0;
5694 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5695 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5696 const struct hda_fixup *fix, int action)
5698 static const struct hda_pintbl pincfgs[] = {
5699 { 0x16, 0x21211010 }, /* dock headphone */
5700 { 0x19, 0x21a11010 }, /* dock mic */
5703 struct alc_spec *spec = codec->spec;
5705 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5706 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5707 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5708 codec->power_save_node = 0; /* avoid click noises */
5709 snd_hda_apply_pincfgs(codec, pincfgs);
5713 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5714 const struct hda_fixup *fix, int action)
5716 static const struct hda_pintbl pincfgs[] = {
5717 { 0x17, 0x21211010 }, /* dock headphone */
5718 { 0x19, 0x21a11010 }, /* dock mic */
5721 struct alc_spec *spec = codec->spec;
5723 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5724 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5725 snd_hda_apply_pincfgs(codec, pincfgs);
5726 } else if (action == HDA_FIXUP_ACT_INIT) {
5727 /* Enable DOCK device */
5728 snd_hda_codec_write(codec, 0x17, 0,
5729 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5730 /* Enable DOCK device */
5731 snd_hda_codec_write(codec, 0x19, 0,
5732 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5736 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5737 const struct hda_fixup *fix, int action)
5739 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5740 * the speaker output becomes too low by some reason on Thinkpads with
5743 static const hda_nid_t preferred_pairs[] = {
5744 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5747 struct alc_spec *spec = codec->spec;
5749 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5750 spec->gen.preferred_dacs = preferred_pairs;
5753 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5754 const struct hda_fixup *fix, int action)
5756 static const hda_nid_t preferred_pairs[] = {
5757 0x17, 0x02, 0x21, 0x03, 0
5759 struct alc_spec *spec = codec->spec;
5761 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5762 spec->gen.preferred_dacs = preferred_pairs;
5765 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5767 struct alc_spec *spec = codec->spec;
5768 int hp_pin = alc_get_hp_pin(spec);
5770 /* Prevent pop noises when headphones are plugged in */
5771 snd_hda_codec_write(codec, hp_pin, 0,
5772 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5776 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5777 const struct hda_fixup *fix, int action)
5779 struct alc_spec *spec = codec->spec;
5780 struct hda_input_mux *imux = &spec->gen.input_mux;
5784 case HDA_FIXUP_ACT_PRE_PROBE:
5785 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5786 * it causes a click noise at start up
5788 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5789 spec->shutup = alc_shutup_dell_xps13;
5791 case HDA_FIXUP_ACT_PROBE:
5792 /* Make the internal mic the default input source. */
5793 for (i = 0; i < imux->num_items; i++) {
5794 if (spec->gen.imux_pins[i] == 0x12) {
5795 spec->gen.cur_mux[0] = i;
5803 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5804 const struct hda_fixup *fix, int action)
5806 struct alc_spec *spec = codec->spec;
5808 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5809 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5810 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5812 /* Disable boost for mic-in permanently. (This code is only called
5813 from quirks that guarantee that the headphone is at NID 0x1b.) */
5814 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5815 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5817 alc_fixup_headset_mode(codec, fix, action);
5820 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5821 const struct hda_fixup *fix, int action)
5823 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5824 alc_write_coef_idx(codec, 0xc4, 0x8000);
5825 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5826 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5828 alc_fixup_headset_mode(codec, fix, action);
5831 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5832 static int find_ext_mic_pin(struct hda_codec *codec)
5834 struct alc_spec *spec = codec->spec;
5835 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5837 unsigned int defcfg;
5840 for (i = 0; i < cfg->num_inputs; i++) {
5841 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5843 nid = cfg->inputs[i].pin;
5844 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5845 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5853 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5854 const struct hda_fixup *fix,
5857 struct alc_spec *spec = codec->spec;
5859 if (action == HDA_FIXUP_ACT_PROBE) {
5860 int mic_pin = find_ext_mic_pin(codec);
5861 int hp_pin = alc_get_hp_pin(spec);
5863 if (snd_BUG_ON(!mic_pin || !hp_pin))
5865 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5869 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5870 const struct hda_fixup *fix,
5873 struct alc_spec *spec = codec->spec;
5874 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5877 /* The mic boosts on level 2 and 3 are too noisy
5878 on the internal mic input.
5879 Therefore limit the boost to 0 or 1. */
5881 if (action != HDA_FIXUP_ACT_PROBE)
5884 for (i = 0; i < cfg->num_inputs; i++) {
5885 hda_nid_t nid = cfg->inputs[i].pin;
5886 unsigned int defcfg;
5887 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5889 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5890 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5893 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5894 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5895 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5896 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5897 (0 << AC_AMPCAP_MUTE_SHIFT));
5901 static void alc283_hp_automute_hook(struct hda_codec *codec,
5902 struct hda_jack_callback *jack)
5904 struct alc_spec *spec = codec->spec;
5908 snd_hda_gen_hp_automute(codec, jack);
5910 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5913 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5917 static void alc283_fixup_chromebook(struct hda_codec *codec,
5918 const struct hda_fixup *fix, int action)
5920 struct alc_spec *spec = codec->spec;
5923 case HDA_FIXUP_ACT_PRE_PROBE:
5924 snd_hda_override_wcaps(codec, 0x03, 0);
5925 /* Disable AA-loopback as it causes white noise */
5926 spec->gen.mixer_nid = 0;
5928 case HDA_FIXUP_ACT_INIT:
5929 /* MIC2-VREF control */
5930 /* Set to manual mode */
5931 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5932 /* Enable Line1 input control by verb */
5933 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5938 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5939 const struct hda_fixup *fix, int action)
5941 struct alc_spec *spec = codec->spec;
5944 case HDA_FIXUP_ACT_PRE_PROBE:
5945 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5947 case HDA_FIXUP_ACT_INIT:
5948 /* MIC2-VREF control */
5949 /* Set to manual mode */
5950 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5955 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5956 static void asus_tx300_automute(struct hda_codec *codec)
5958 struct alc_spec *spec = codec->spec;
5959 snd_hda_gen_update_outputs(codec);
5960 if (snd_hda_jack_detect(codec, 0x1b))
5961 spec->gen.mute_bits |= (1ULL << 0x14);
5964 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5965 const struct hda_fixup *fix, int action)
5967 struct alc_spec *spec = codec->spec;
5968 static const struct hda_pintbl dock_pins[] = {
5969 { 0x1b, 0x21114000 }, /* dock speaker pin */
5974 case HDA_FIXUP_ACT_PRE_PROBE:
5975 spec->init_amp = ALC_INIT_DEFAULT;
5976 /* TX300 needs to set up GPIO2 for the speaker amp */
5977 alc_setup_gpio(codec, 0x04);
5978 snd_hda_apply_pincfgs(codec, dock_pins);
5979 spec->gen.auto_mute_via_amp = 1;
5980 spec->gen.automute_hook = asus_tx300_automute;
5981 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5982 snd_hda_gen_hp_automute);
5984 case HDA_FIXUP_ACT_PROBE:
5985 spec->init_amp = ALC_INIT_DEFAULT;
5987 case HDA_FIXUP_ACT_BUILD:
5988 /* this is a bit tricky; give more sane names for the main
5989 * (tablet) speaker and the dock speaker, respectively
5991 rename_ctl(codec, "Speaker Playback Switch",
5992 "Dock Speaker Playback Switch");
5993 rename_ctl(codec, "Bass Speaker Playback Switch",
5994 "Speaker Playback Switch");
5999 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6000 const struct hda_fixup *fix, int action)
6002 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6003 /* DAC node 0x03 is giving mono output. We therefore want to
6004 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6005 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6006 static const hda_nid_t conn1[] = { 0x0c };
6007 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6008 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6012 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6013 const struct hda_fixup *fix, int action)
6015 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6016 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6017 we can't adjust the speaker's volume since this node does not has
6018 Amp-out capability. we change the speaker's route to:
6019 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6020 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6021 speaker's volume now. */
6023 static const hda_nid_t conn1[] = { 0x0c };
6024 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6028 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6029 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6030 const struct hda_fixup *fix, int action)
6032 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6033 static const hda_nid_t conn[] = { 0x02, 0x03 };
6034 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6038 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6039 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6040 const struct hda_fixup *fix, int action)
6042 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6043 static const hda_nid_t conn[] = { 0x02 };
6044 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6048 /* Hook to update amp GPIO4 for automute */
6049 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6050 struct hda_jack_callback *jack)
6052 struct alc_spec *spec = codec->spec;
6054 snd_hda_gen_hp_automute(codec, jack);
6055 /* mute_led_polarity is set to 0, so we pass inverted value here */
6056 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6057 !spec->gen.hp_jack_present);
6060 /* Manage GPIOs for HP EliteBook Folio 9480m.
6062 * GPIO4 is the headphone amplifier power control
6063 * GPIO3 is the audio output mute indicator LED
6066 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6067 const struct hda_fixup *fix,
6070 struct alc_spec *spec = codec->spec;
6072 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6073 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6074 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6075 spec->gpio_mask |= 0x10;
6076 spec->gpio_dir |= 0x10;
6077 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6081 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6082 const struct hda_fixup *fix,
6085 struct alc_spec *spec = codec->spec;
6087 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6088 spec->gpio_mask |= 0x04;
6089 spec->gpio_dir |= 0x04;
6090 /* set data bit low */
6094 /* Quirk for Thinkpad X1 7th and 8th Gen
6095 * The following fixed routing needed
6096 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6097 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6098 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6100 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6101 const struct hda_fixup *fix, int action)
6103 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6104 static const hda_nid_t preferred_pairs[] = {
6105 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6107 struct alc_spec *spec = codec->spec;
6110 case HDA_FIXUP_ACT_PRE_PROBE:
6111 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6112 spec->gen.preferred_dacs = preferred_pairs;
6114 case HDA_FIXUP_ACT_BUILD:
6115 /* The generic parser creates somewhat unintuitive volume ctls
6116 * with the fixed routing above, and the shared DAC2 may be
6118 * Rename those to unique names so that PA doesn't touch them
6119 * and use only Master volume.
6121 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6122 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6127 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6128 const struct hda_fixup *fix,
6131 alc_fixup_dual_codecs(codec, fix, action);
6133 case HDA_FIXUP_ACT_PRE_PROBE:
6134 /* override card longname to provide a unique UCM profile */
6135 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6137 case HDA_FIXUP_ACT_BUILD:
6138 /* rename Capture controls depending on the codec */
6139 rename_ctl(codec, "Capture Volume",
6141 "Rear-Panel Capture Volume" :
6142 "Front-Panel Capture Volume");
6143 rename_ctl(codec, "Capture Switch",
6145 "Rear-Panel Capture Switch" :
6146 "Front-Panel Capture Switch");
6151 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6152 const struct hda_fixup *fix, int action)
6154 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6157 codec->power_save_node = 1;
6160 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6161 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6162 const struct hda_fixup *fix, int action)
6164 struct alc_spec *spec = codec->spec;
6165 static const hda_nid_t preferred_pairs[] = {
6166 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6170 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6173 spec->gen.preferred_dacs = preferred_pairs;
6174 spec->gen.auto_mute_via_amp = 1;
6175 codec->power_save_node = 0;
6178 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6179 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6180 const struct hda_fixup *fix, int action)
6182 static const hda_nid_t preferred_pairs[] = {
6183 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6185 struct alc_spec *spec = codec->spec;
6187 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6188 spec->gen.preferred_dacs = preferred_pairs;
6189 spec->gen.obey_preferred_dacs = 1;
6193 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6194 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6195 const struct hda_fixup *fix, int action)
6197 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6200 snd_hda_override_wcaps(codec, 0x03, 0);
6203 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6205 switch (codec->core.vendor_id) {
6211 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6212 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6218 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6219 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6224 static void alc295_fixup_chromebook(struct hda_codec *codec,
6225 const struct hda_fixup *fix, int action)
6227 struct alc_spec *spec = codec->spec;
6230 case HDA_FIXUP_ACT_PRE_PROBE:
6231 spec->ultra_low_power = true;
6233 case HDA_FIXUP_ACT_INIT:
6234 alc_combo_jack_hp_jd_restart(codec);
6239 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6240 const struct hda_fixup *fix, int action)
6242 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6243 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6247 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6248 struct hda_jack_callback *cb)
6250 /* The Windows driver sets the codec up in a very different way where
6251 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6253 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6254 alc_write_coef_idx(codec, 0x10, 0x8a20);
6256 alc_write_coef_idx(codec, 0x10, 0x0a20);
6259 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6260 const struct hda_fixup *fix, int action)
6262 /* Pin 0x21: headphones/headset mic */
6263 if (!is_jack_detectable(codec, 0x21))
6267 case HDA_FIXUP_ACT_PRE_PROBE:
6268 snd_hda_jack_detect_enable_callback(codec, 0x21,
6269 alc294_gx502_toggle_output);
6271 case HDA_FIXUP_ACT_INIT:
6272 /* Make sure to start in a correct state, i.e. if
6273 * headphones have been plugged in before powering up the system
6275 alc294_gx502_toggle_output(codec, NULL);
6280 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6281 struct hda_jack_callback *cb)
6283 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6284 * responsible from changes between speakers and headphones
6286 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6287 alc_write_coef_idx(codec, 0x10, 0x8420);
6289 alc_write_coef_idx(codec, 0x10, 0x0a20);
6292 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6293 const struct hda_fixup *fix, int action)
6295 if (!is_jack_detectable(codec, 0x21))
6299 case HDA_FIXUP_ACT_PRE_PROBE:
6300 snd_hda_jack_detect_enable_callback(codec, 0x21,
6301 alc294_gu502_toggle_output);
6303 case HDA_FIXUP_ACT_INIT:
6304 alc294_gu502_toggle_output(codec, NULL);
6309 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6310 const struct hda_fixup *fix, int action)
6312 if (action != HDA_FIXUP_ACT_INIT)
6316 alc_write_coef_idx(codec, 0x65, 0x0);
6319 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6320 const struct hda_fixup *fix, int action)
6323 case HDA_FIXUP_ACT_INIT:
6324 alc_combo_jack_hp_jd_restart(codec);
6329 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6330 const struct hda_fixup *fix, int action)
6332 struct alc_spec *spec = codec->spec;
6335 case HDA_FIXUP_ACT_PRE_PROBE:
6336 /* Mic RING SLEEVE swap for combo jack */
6337 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6338 spec->no_internal_mic_pin = true;
6340 case HDA_FIXUP_ACT_INIT:
6341 alc_combo_jack_hp_jd_restart(codec);
6346 /* for hda_fixup_thinkpad_acpi() */
6347 #include "thinkpad_helper.c"
6349 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6350 const struct hda_fixup *fix, int action)
6352 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6353 hda_fixup_thinkpad_acpi(codec, fix, action);
6356 /* for alc295_fixup_hp_top_speakers */
6357 #include "hp_x360_helper.c"
6359 /* for alc285_fixup_ideapad_s740_coef() */
6360 #include "ideapad_s740_helper.c"
6364 ALC269_FIXUP_SONY_VAIO,
6365 ALC275_FIXUP_SONY_VAIO_GPIO2,
6366 ALC269_FIXUP_DELL_M101Z,
6367 ALC269_FIXUP_SKU_IGNORE,
6368 ALC269_FIXUP_ASUS_G73JW,
6369 ALC269_FIXUP_LENOVO_EAPD,
6370 ALC275_FIXUP_SONY_HWEQ,
6371 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6373 ALC269_FIXUP_PCM_44K,
6374 ALC269_FIXUP_STEREO_DMIC,
6375 ALC269_FIXUP_HEADSET_MIC,
6376 ALC269_FIXUP_QUANTA_MUTE,
6377 ALC269_FIXUP_LIFEBOOK,
6378 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6379 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6380 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6381 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6384 ALC269VB_FIXUP_AMIC,
6385 ALC269VB_FIXUP_DMIC,
6386 ALC269_FIXUP_HP_MUTE_LED,
6387 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6388 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6389 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6390 ALC269_FIXUP_HP_GPIO_LED,
6391 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6392 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6393 ALC269_FIXUP_INV_DMIC,
6394 ALC269_FIXUP_LENOVO_DOCK,
6395 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6396 ALC269_FIXUP_NO_SHUTUP,
6397 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6398 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6399 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6400 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6401 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6402 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6403 ALC269_FIXUP_HEADSET_MODE,
6404 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6405 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6406 ALC269_FIXUP_ASUS_X101_FUNC,
6407 ALC269_FIXUP_ASUS_X101_VERB,
6408 ALC269_FIXUP_ASUS_X101,
6409 ALC271_FIXUP_AMIC_MIC2,
6410 ALC271_FIXUP_HP_GATE_MIC_JACK,
6411 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6412 ALC269_FIXUP_ACER_AC700,
6413 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6414 ALC269VB_FIXUP_ASUS_ZENBOOK,
6415 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6416 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6417 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6418 ALC283_FIXUP_CHROME_BOOK,
6419 ALC283_FIXUP_SENSE_COMBO_JACK,
6420 ALC282_FIXUP_ASUS_TX300,
6421 ALC283_FIXUP_INT_MIC,
6422 ALC290_FIXUP_MONO_SPEAKERS,
6423 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6424 ALC290_FIXUP_SUBWOOFER,
6425 ALC290_FIXUP_SUBWOOFER_HSJACK,
6426 ALC269_FIXUP_THINKPAD_ACPI,
6427 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6428 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6429 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6430 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6431 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6432 ALC255_FIXUP_HEADSET_MODE,
6433 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6434 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6435 ALC292_FIXUP_TPT440_DOCK,
6436 ALC292_FIXUP_TPT440,
6437 ALC283_FIXUP_HEADSET_MIC,
6438 ALC255_FIXUP_MIC_MUTE_LED,
6439 ALC282_FIXUP_ASPIRE_V5_PINS,
6440 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6441 ALC280_FIXUP_HP_GPIO4,
6442 ALC286_FIXUP_HP_GPIO_LED,
6443 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6444 ALC280_FIXUP_HP_DOCK_PINS,
6445 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6446 ALC280_FIXUP_HP_9480M,
6447 ALC245_FIXUP_HP_X360_AMP,
6448 ALC288_FIXUP_DELL_HEADSET_MODE,
6449 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6450 ALC288_FIXUP_DELL_XPS_13,
6451 ALC288_FIXUP_DISABLE_AAMIX,
6452 ALC292_FIXUP_DELL_E7X_AAMIX,
6453 ALC292_FIXUP_DELL_E7X,
6454 ALC292_FIXUP_DISABLE_AAMIX,
6455 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6456 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6457 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6458 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6459 ALC275_FIXUP_DELL_XPS,
6460 ALC293_FIXUP_LENOVO_SPK_NOISE,
6461 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6462 ALC255_FIXUP_DELL_SPK_NOISE,
6463 ALC225_FIXUP_DISABLE_MIC_VREF,
6464 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6465 ALC295_FIXUP_DISABLE_DAC3,
6466 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6467 ALC280_FIXUP_HP_HEADSET_MIC,
6468 ALC221_FIXUP_HP_FRONT_MIC,
6469 ALC292_FIXUP_TPT460,
6470 ALC298_FIXUP_SPK_VOLUME,
6471 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6472 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6473 ALC269_FIXUP_ATIV_BOOK_8,
6474 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6475 ALC256_FIXUP_ASUS_HEADSET_MODE,
6476 ALC256_FIXUP_ASUS_MIC,
6477 ALC256_FIXUP_ASUS_AIO_GPIO2,
6478 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6479 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6480 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6481 ALC233_FIXUP_ACER_HEADSET_MIC,
6482 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6483 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6484 ALC225_FIXUP_S3_POP_NOISE,
6485 ALC700_FIXUP_INTEL_REFERENCE,
6486 ALC274_FIXUP_DELL_BIND_DACS,
6487 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6488 ALC298_FIXUP_TPT470_DOCK_FIX,
6489 ALC298_FIXUP_TPT470_DOCK,
6490 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6491 ALC255_FIXUP_DELL_HEADSET_MIC,
6492 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6493 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6494 ALC295_FIXUP_HP_X360,
6495 ALC221_FIXUP_HP_HEADSET_MIC,
6496 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6497 ALC295_FIXUP_HP_AUTO_MUTE,
6498 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6499 ALC294_FIXUP_ASUS_MIC,
6500 ALC294_FIXUP_ASUS_HEADSET_MIC,
6501 ALC294_FIXUP_ASUS_SPK,
6502 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6503 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6504 ALC255_FIXUP_ACER_HEADSET_MIC,
6505 ALC295_FIXUP_CHROME_BOOK,
6506 ALC225_FIXUP_HEADSET_JACK,
6507 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6508 ALC225_FIXUP_WYSE_AUTO_MUTE,
6509 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6510 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6511 ALC256_FIXUP_ASUS_HEADSET_MIC,
6512 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6513 ALC299_FIXUP_PREDATOR_SPK,
6514 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6515 ALC289_FIXUP_DELL_SPK2,
6516 ALC289_FIXUP_DUAL_SPK,
6517 ALC294_FIXUP_SPK2_TO_DAC1,
6518 ALC294_FIXUP_ASUS_DUAL_SPK,
6519 ALC285_FIXUP_THINKPAD_X1_GEN7,
6520 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6521 ALC294_FIXUP_ASUS_HPE,
6522 ALC294_FIXUP_ASUS_COEF_1B,
6523 ALC294_FIXUP_ASUS_GX502_HP,
6524 ALC294_FIXUP_ASUS_GX502_PINS,
6525 ALC294_FIXUP_ASUS_GX502_VERBS,
6526 ALC294_FIXUP_ASUS_GU502_HP,
6527 ALC294_FIXUP_ASUS_GU502_PINS,
6528 ALC294_FIXUP_ASUS_GU502_VERBS,
6529 ALC285_FIXUP_HP_GPIO_LED,
6530 ALC285_FIXUP_HP_MUTE_LED,
6531 ALC236_FIXUP_HP_GPIO_LED,
6532 ALC236_FIXUP_HP_MUTE_LED,
6533 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6534 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6535 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6536 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6537 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6538 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6539 ALC289_FIXUP_ASUS_GA401,
6540 ALC289_FIXUP_ASUS_GA502,
6541 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6542 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6543 ALC269_FIXUP_CZC_B20,
6544 ALC269_FIXUP_CZC_TMI,
6545 ALC269_FIXUP_CZC_L101,
6546 ALC269_FIXUP_LEMOTE_A1802,
6547 ALC269_FIXUP_LEMOTE_A190X,
6548 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6549 ALC233_FIXUP_INTEL_NUC8_DMIC,
6550 ALC233_FIXUP_INTEL_NUC8_BOOST,
6551 ALC256_FIXUP_INTEL_NUC10,
6552 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6553 ALC274_FIXUP_HP_MIC,
6554 ALC274_FIXUP_HP_HEADSET_MIC,
6555 ALC274_FIXUP_HP_ENVY_GPIO,
6556 ALC256_FIXUP_ASUS_HPE,
6557 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6558 ALC287_FIXUP_HP_GPIO_LED,
6559 ALC256_FIXUP_HP_HEADSET_MIC,
6560 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6561 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6562 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6563 ALC256_FIXUP_ACER_HEADSET_MIC,
6564 ALC285_FIXUP_IDEAPAD_S740_COEF,
6565 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6566 ALC295_FIXUP_ASUS_DACS,
6567 ALC295_FIXUP_HP_OMEN,
6568 ALC285_FIXUP_HP_SPECTRE_X360,
6569 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6570 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6573 static const struct hda_fixup alc269_fixups[] = {
6574 [ALC269_FIXUP_GPIO2] = {
6575 .type = HDA_FIXUP_FUNC,
6576 .v.func = alc_fixup_gpio2,
6578 [ALC269_FIXUP_SONY_VAIO] = {
6579 .type = HDA_FIXUP_PINCTLS,
6580 .v.pins = (const struct hda_pintbl[]) {
6581 {0x19, PIN_VREFGRD},
6585 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6586 .type = HDA_FIXUP_FUNC,
6587 .v.func = alc275_fixup_gpio4_off,
6589 .chain_id = ALC269_FIXUP_SONY_VAIO
6591 [ALC269_FIXUP_DELL_M101Z] = {
6592 .type = HDA_FIXUP_VERBS,
6593 .v.verbs = (const struct hda_verb[]) {
6594 /* Enables internal speaker */
6595 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6596 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6600 [ALC269_FIXUP_SKU_IGNORE] = {
6601 .type = HDA_FIXUP_FUNC,
6602 .v.func = alc_fixup_sku_ignore,
6604 [ALC269_FIXUP_ASUS_G73JW] = {
6605 .type = HDA_FIXUP_PINS,
6606 .v.pins = (const struct hda_pintbl[]) {
6607 { 0x17, 0x99130111 }, /* subwoofer */
6611 [ALC269_FIXUP_LENOVO_EAPD] = {
6612 .type = HDA_FIXUP_VERBS,
6613 .v.verbs = (const struct hda_verb[]) {
6614 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6618 [ALC275_FIXUP_SONY_HWEQ] = {
6619 .type = HDA_FIXUP_FUNC,
6620 .v.func = alc269_fixup_hweq,
6622 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6624 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6625 .type = HDA_FIXUP_FUNC,
6626 .v.func = alc_fixup_disable_aamix,
6628 .chain_id = ALC269_FIXUP_SONY_VAIO
6630 [ALC271_FIXUP_DMIC] = {
6631 .type = HDA_FIXUP_FUNC,
6632 .v.func = alc271_fixup_dmic,
6634 [ALC269_FIXUP_PCM_44K] = {
6635 .type = HDA_FIXUP_FUNC,
6636 .v.func = alc269_fixup_pcm_44k,
6638 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6640 [ALC269_FIXUP_STEREO_DMIC] = {
6641 .type = HDA_FIXUP_FUNC,
6642 .v.func = alc269_fixup_stereo_dmic,
6644 [ALC269_FIXUP_HEADSET_MIC] = {
6645 .type = HDA_FIXUP_FUNC,
6646 .v.func = alc269_fixup_headset_mic,
6648 [ALC269_FIXUP_QUANTA_MUTE] = {
6649 .type = HDA_FIXUP_FUNC,
6650 .v.func = alc269_fixup_quanta_mute,
6652 [ALC269_FIXUP_LIFEBOOK] = {
6653 .type = HDA_FIXUP_PINS,
6654 .v.pins = (const struct hda_pintbl[]) {
6655 { 0x1a, 0x2101103f }, /* dock line-out */
6656 { 0x1b, 0x23a11040 }, /* dock mic-in */
6660 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6662 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6663 .type = HDA_FIXUP_PINS,
6664 .v.pins = (const struct hda_pintbl[]) {
6665 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6669 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6670 .type = HDA_FIXUP_PINS,
6671 .v.pins = (const struct hda_pintbl[]) {
6672 { 0x21, 0x0221102f }, /* HP out */
6676 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6677 .type = HDA_FIXUP_FUNC,
6678 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6680 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6681 .type = HDA_FIXUP_FUNC,
6682 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6684 [ALC269_FIXUP_AMIC] = {
6685 .type = HDA_FIXUP_PINS,
6686 .v.pins = (const struct hda_pintbl[]) {
6687 { 0x14, 0x99130110 }, /* speaker */
6688 { 0x15, 0x0121401f }, /* HP out */
6689 { 0x18, 0x01a19c20 }, /* mic */
6690 { 0x19, 0x99a3092f }, /* int-mic */
6694 [ALC269_FIXUP_DMIC] = {
6695 .type = HDA_FIXUP_PINS,
6696 .v.pins = (const struct hda_pintbl[]) {
6697 { 0x12, 0x99a3092f }, /* int-mic */
6698 { 0x14, 0x99130110 }, /* speaker */
6699 { 0x15, 0x0121401f }, /* HP out */
6700 { 0x18, 0x01a19c20 }, /* mic */
6704 [ALC269VB_FIXUP_AMIC] = {
6705 .type = HDA_FIXUP_PINS,
6706 .v.pins = (const struct hda_pintbl[]) {
6707 { 0x14, 0x99130110 }, /* speaker */
6708 { 0x18, 0x01a19c20 }, /* mic */
6709 { 0x19, 0x99a3092f }, /* int-mic */
6710 { 0x21, 0x0121401f }, /* HP out */
6714 [ALC269VB_FIXUP_DMIC] = {
6715 .type = HDA_FIXUP_PINS,
6716 .v.pins = (const struct hda_pintbl[]) {
6717 { 0x12, 0x99a3092f }, /* int-mic */
6718 { 0x14, 0x99130110 }, /* speaker */
6719 { 0x18, 0x01a19c20 }, /* mic */
6720 { 0x21, 0x0121401f }, /* HP out */
6724 [ALC269_FIXUP_HP_MUTE_LED] = {
6725 .type = HDA_FIXUP_FUNC,
6726 .v.func = alc269_fixup_hp_mute_led,
6728 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6729 .type = HDA_FIXUP_FUNC,
6730 .v.func = alc269_fixup_hp_mute_led_mic1,
6732 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6733 .type = HDA_FIXUP_FUNC,
6734 .v.func = alc269_fixup_hp_mute_led_mic2,
6736 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6737 .type = HDA_FIXUP_FUNC,
6738 .v.func = alc269_fixup_hp_mute_led_mic3,
6740 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6742 [ALC269_FIXUP_HP_GPIO_LED] = {
6743 .type = HDA_FIXUP_FUNC,
6744 .v.func = alc269_fixup_hp_gpio_led,
6746 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6747 .type = HDA_FIXUP_FUNC,
6748 .v.func = alc269_fixup_hp_gpio_mic1_led,
6750 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6751 .type = HDA_FIXUP_FUNC,
6752 .v.func = alc269_fixup_hp_line1_mic1_led,
6754 [ALC269_FIXUP_INV_DMIC] = {
6755 .type = HDA_FIXUP_FUNC,
6756 .v.func = alc_fixup_inv_dmic,
6758 [ALC269_FIXUP_NO_SHUTUP] = {
6759 .type = HDA_FIXUP_FUNC,
6760 .v.func = alc_fixup_no_shutup,
6762 [ALC269_FIXUP_LENOVO_DOCK] = {
6763 .type = HDA_FIXUP_PINS,
6764 .v.pins = (const struct hda_pintbl[]) {
6765 { 0x19, 0x23a11040 }, /* dock mic */
6766 { 0x1b, 0x2121103f }, /* dock headphone */
6770 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6772 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6773 .type = HDA_FIXUP_FUNC,
6774 .v.func = alc269_fixup_limit_int_mic_boost,
6776 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6778 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6779 .type = HDA_FIXUP_FUNC,
6780 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6782 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6784 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6785 .type = HDA_FIXUP_PINS,
6786 .v.pins = (const struct hda_pintbl[]) {
6787 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6788 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6792 .chain_id = ALC269_FIXUP_HEADSET_MODE
6794 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6795 .type = HDA_FIXUP_PINS,
6796 .v.pins = (const struct hda_pintbl[]) {
6797 { 0x16, 0x21014020 }, /* dock line out */
6798 { 0x19, 0x21a19030 }, /* dock mic */
6799 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6803 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6805 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6806 .type = HDA_FIXUP_PINS,
6807 .v.pins = (const struct hda_pintbl[]) {
6808 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6812 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6814 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6815 .type = HDA_FIXUP_PINS,
6816 .v.pins = (const struct hda_pintbl[]) {
6817 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6818 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6822 .chain_id = ALC269_FIXUP_HEADSET_MODE
6824 [ALC269_FIXUP_HEADSET_MODE] = {
6825 .type = HDA_FIXUP_FUNC,
6826 .v.func = alc_fixup_headset_mode,
6828 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6830 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6831 .type = HDA_FIXUP_FUNC,
6832 .v.func = alc_fixup_headset_mode_no_hp_mic,
6834 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6835 .type = HDA_FIXUP_PINS,
6836 .v.pins = (const struct hda_pintbl[]) {
6837 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6841 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6843 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6844 .type = HDA_FIXUP_PINS,
6845 .v.pins = (const struct hda_pintbl[]) {
6846 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6850 .chain_id = ALC269_FIXUP_HEADSET_MIC
6852 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
6853 .type = HDA_FIXUP_PINS,
6854 .v.pins = (const struct hda_pintbl[]) {
6868 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6870 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
6871 .type = HDA_FIXUP_FUNC,
6872 .v.func = alc298_fixup_huawei_mbx_stereo,
6874 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6876 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6877 .type = HDA_FIXUP_FUNC,
6878 .v.func = alc269_fixup_x101_headset_mic,
6880 [ALC269_FIXUP_ASUS_X101_VERB] = {
6881 .type = HDA_FIXUP_VERBS,
6882 .v.verbs = (const struct hda_verb[]) {
6883 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6884 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6885 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6889 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6891 [ALC269_FIXUP_ASUS_X101] = {
6892 .type = HDA_FIXUP_PINS,
6893 .v.pins = (const struct hda_pintbl[]) {
6894 { 0x18, 0x04a1182c }, /* Headset mic */
6898 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6900 [ALC271_FIXUP_AMIC_MIC2] = {
6901 .type = HDA_FIXUP_PINS,
6902 .v.pins = (const struct hda_pintbl[]) {
6903 { 0x14, 0x99130110 }, /* speaker */
6904 { 0x19, 0x01a19c20 }, /* mic */
6905 { 0x1b, 0x99a7012f }, /* int-mic */
6906 { 0x21, 0x0121401f }, /* HP out */
6910 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6911 .type = HDA_FIXUP_FUNC,
6912 .v.func = alc271_hp_gate_mic_jack,
6914 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6916 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6917 .type = HDA_FIXUP_FUNC,
6918 .v.func = alc269_fixup_limit_int_mic_boost,
6920 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6922 [ALC269_FIXUP_ACER_AC700] = {
6923 .type = HDA_FIXUP_PINS,
6924 .v.pins = (const struct hda_pintbl[]) {
6925 { 0x12, 0x99a3092f }, /* int-mic */
6926 { 0x14, 0x99130110 }, /* speaker */
6927 { 0x18, 0x03a11c20 }, /* mic */
6928 { 0x1e, 0x0346101e }, /* SPDIF1 */
6929 { 0x21, 0x0321101f }, /* HP out */
6933 .chain_id = ALC271_FIXUP_DMIC,
6935 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6936 .type = HDA_FIXUP_FUNC,
6937 .v.func = alc269_fixup_limit_int_mic_boost,
6939 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6941 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6942 .type = HDA_FIXUP_FUNC,
6943 .v.func = alc269_fixup_limit_int_mic_boost,
6945 .chain_id = ALC269VB_FIXUP_DMIC,
6947 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6948 .type = HDA_FIXUP_VERBS,
6949 .v.verbs = (const struct hda_verb[]) {
6950 /* class-D output amp +5dB */
6951 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6952 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6956 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6958 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6959 .type = HDA_FIXUP_FUNC,
6960 .v.func = alc269_fixup_limit_int_mic_boost,
6962 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6964 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6965 .type = HDA_FIXUP_PINS,
6966 .v.pins = (const struct hda_pintbl[]) {
6967 { 0x12, 0x99a3092f }, /* int-mic */
6968 { 0x18, 0x03a11d20 }, /* mic */
6969 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6973 [ALC283_FIXUP_CHROME_BOOK] = {
6974 .type = HDA_FIXUP_FUNC,
6975 .v.func = alc283_fixup_chromebook,
6977 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6978 .type = HDA_FIXUP_FUNC,
6979 .v.func = alc283_fixup_sense_combo_jack,
6981 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6983 [ALC282_FIXUP_ASUS_TX300] = {
6984 .type = HDA_FIXUP_FUNC,
6985 .v.func = alc282_fixup_asus_tx300,
6987 [ALC283_FIXUP_INT_MIC] = {
6988 .type = HDA_FIXUP_VERBS,
6989 .v.verbs = (const struct hda_verb[]) {
6990 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6991 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6995 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6997 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6998 .type = HDA_FIXUP_PINS,
6999 .v.pins = (const struct hda_pintbl[]) {
7000 { 0x17, 0x90170112 }, /* subwoofer */
7004 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7006 [ALC290_FIXUP_SUBWOOFER] = {
7007 .type = HDA_FIXUP_PINS,
7008 .v.pins = (const struct hda_pintbl[]) {
7009 { 0x17, 0x90170112 }, /* subwoofer */
7013 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7015 [ALC290_FIXUP_MONO_SPEAKERS] = {
7016 .type = HDA_FIXUP_FUNC,
7017 .v.func = alc290_fixup_mono_speakers,
7019 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7020 .type = HDA_FIXUP_FUNC,
7021 .v.func = alc290_fixup_mono_speakers,
7023 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7025 [ALC269_FIXUP_THINKPAD_ACPI] = {
7026 .type = HDA_FIXUP_FUNC,
7027 .v.func = alc_fixup_thinkpad_acpi,
7029 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7031 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7032 .type = HDA_FIXUP_FUNC,
7033 .v.func = alc_fixup_inv_dmic,
7035 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7037 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7038 .type = HDA_FIXUP_PINS,
7039 .v.pins = (const struct hda_pintbl[]) {
7040 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7044 .chain_id = ALC255_FIXUP_HEADSET_MODE
7046 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7047 .type = HDA_FIXUP_PINS,
7048 .v.pins = (const struct hda_pintbl[]) {
7049 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7053 .chain_id = ALC255_FIXUP_HEADSET_MODE
7055 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7056 .type = HDA_FIXUP_PINS,
7057 .v.pins = (const struct hda_pintbl[]) {
7058 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7059 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7063 .chain_id = ALC255_FIXUP_HEADSET_MODE
7065 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7066 .type = HDA_FIXUP_PINS,
7067 .v.pins = (const struct hda_pintbl[]) {
7068 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7072 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7074 [ALC255_FIXUP_HEADSET_MODE] = {
7075 .type = HDA_FIXUP_FUNC,
7076 .v.func = alc_fixup_headset_mode_alc255,
7078 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7080 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7081 .type = HDA_FIXUP_FUNC,
7082 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7084 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7085 .type = HDA_FIXUP_PINS,
7086 .v.pins = (const struct hda_pintbl[]) {
7087 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7088 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7092 .chain_id = ALC269_FIXUP_HEADSET_MODE
7094 [ALC292_FIXUP_TPT440_DOCK] = {
7095 .type = HDA_FIXUP_FUNC,
7096 .v.func = alc_fixup_tpt440_dock,
7098 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7100 [ALC292_FIXUP_TPT440] = {
7101 .type = HDA_FIXUP_FUNC,
7102 .v.func = alc_fixup_disable_aamix,
7104 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7106 [ALC283_FIXUP_HEADSET_MIC] = {
7107 .type = HDA_FIXUP_PINS,
7108 .v.pins = (const struct hda_pintbl[]) {
7109 { 0x19, 0x04a110f0 },
7113 [ALC255_FIXUP_MIC_MUTE_LED] = {
7114 .type = HDA_FIXUP_FUNC,
7115 .v.func = alc_fixup_micmute_led,
7117 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7118 .type = HDA_FIXUP_PINS,
7119 .v.pins = (const struct hda_pintbl[]) {
7120 { 0x12, 0x90a60130 },
7121 { 0x14, 0x90170110 },
7122 { 0x17, 0x40000008 },
7123 { 0x18, 0x411111f0 },
7124 { 0x19, 0x01a1913c },
7125 { 0x1a, 0x411111f0 },
7126 { 0x1b, 0x411111f0 },
7127 { 0x1d, 0x40f89b2d },
7128 { 0x1e, 0x411111f0 },
7129 { 0x21, 0x0321101f },
7133 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7134 .type = HDA_FIXUP_FUNC,
7135 .v.func = alc269vb_fixup_aspire_e1_coef,
7137 [ALC280_FIXUP_HP_GPIO4] = {
7138 .type = HDA_FIXUP_FUNC,
7139 .v.func = alc280_fixup_hp_gpio4,
7141 [ALC286_FIXUP_HP_GPIO_LED] = {
7142 .type = HDA_FIXUP_FUNC,
7143 .v.func = alc286_fixup_hp_gpio_led,
7145 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7146 .type = HDA_FIXUP_FUNC,
7147 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7149 [ALC280_FIXUP_HP_DOCK_PINS] = {
7150 .type = HDA_FIXUP_PINS,
7151 .v.pins = (const struct hda_pintbl[]) {
7152 { 0x1b, 0x21011020 }, /* line-out */
7153 { 0x1a, 0x01a1903c }, /* headset mic */
7154 { 0x18, 0x2181103f }, /* line-in */
7158 .chain_id = ALC280_FIXUP_HP_GPIO4
7160 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7161 .type = HDA_FIXUP_PINS,
7162 .v.pins = (const struct hda_pintbl[]) {
7163 { 0x1b, 0x21011020 }, /* line-out */
7164 { 0x18, 0x2181103f }, /* line-in */
7168 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7170 [ALC280_FIXUP_HP_9480M] = {
7171 .type = HDA_FIXUP_FUNC,
7172 .v.func = alc280_fixup_hp_9480m,
7174 [ALC245_FIXUP_HP_X360_AMP] = {
7175 .type = HDA_FIXUP_FUNC,
7176 .v.func = alc245_fixup_hp_x360_amp,
7178 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7179 .type = HDA_FIXUP_FUNC,
7180 .v.func = alc_fixup_headset_mode_dell_alc288,
7182 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7184 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7185 .type = HDA_FIXUP_PINS,
7186 .v.pins = (const struct hda_pintbl[]) {
7187 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7188 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7192 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7194 [ALC288_FIXUP_DISABLE_AAMIX] = {
7195 .type = HDA_FIXUP_FUNC,
7196 .v.func = alc_fixup_disable_aamix,
7198 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7200 [ALC288_FIXUP_DELL_XPS_13] = {
7201 .type = HDA_FIXUP_FUNC,
7202 .v.func = alc_fixup_dell_xps13,
7204 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7206 [ALC292_FIXUP_DISABLE_AAMIX] = {
7207 .type = HDA_FIXUP_FUNC,
7208 .v.func = alc_fixup_disable_aamix,
7210 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7212 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7213 .type = HDA_FIXUP_FUNC,
7214 .v.func = alc_fixup_disable_aamix,
7216 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7218 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7219 .type = HDA_FIXUP_FUNC,
7220 .v.func = alc_fixup_dell_xps13,
7222 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7224 [ALC292_FIXUP_DELL_E7X] = {
7225 .type = HDA_FIXUP_FUNC,
7226 .v.func = alc_fixup_micmute_led,
7227 /* micmute fixup must be applied at last */
7228 .chained_before = true,
7229 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7231 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7232 .type = HDA_FIXUP_PINS,
7233 .v.pins = (const struct hda_pintbl[]) {
7234 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7237 .chained_before = true,
7238 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7240 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7241 .type = HDA_FIXUP_PINS,
7242 .v.pins = (const struct hda_pintbl[]) {
7243 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7244 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7248 .chain_id = ALC269_FIXUP_HEADSET_MODE
7250 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7251 .type = HDA_FIXUP_PINS,
7252 .v.pins = (const struct hda_pintbl[]) {
7253 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7257 .chain_id = ALC269_FIXUP_HEADSET_MODE
7259 [ALC275_FIXUP_DELL_XPS] = {
7260 .type = HDA_FIXUP_VERBS,
7261 .v.verbs = (const struct hda_verb[]) {
7262 /* Enables internal speaker */
7263 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7264 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7265 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7266 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7270 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7271 .type = HDA_FIXUP_FUNC,
7272 .v.func = alc_fixup_disable_aamix,
7274 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7276 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7277 .type = HDA_FIXUP_FUNC,
7278 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7280 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7281 .type = HDA_FIXUP_FUNC,
7282 .v.func = alc_fixup_inv_dmic,
7284 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7286 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7287 .type = HDA_FIXUP_FUNC,
7288 .v.func = alc269_fixup_limit_int_mic_boost
7290 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7291 .type = HDA_FIXUP_FUNC,
7292 .v.func = alc_fixup_disable_aamix,
7294 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7296 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7297 .type = HDA_FIXUP_FUNC,
7298 .v.func = alc_fixup_disable_mic_vref,
7300 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7302 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7303 .type = HDA_FIXUP_VERBS,
7304 .v.verbs = (const struct hda_verb[]) {
7305 /* Disable pass-through path for FRONT 14h */
7306 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7307 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7311 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7313 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7314 .type = HDA_FIXUP_FUNC,
7315 .v.func = alc_fixup_disable_aamix,
7317 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7319 [ALC221_FIXUP_HP_FRONT_MIC] = {
7320 .type = HDA_FIXUP_PINS,
7321 .v.pins = (const struct hda_pintbl[]) {
7322 { 0x19, 0x02a19020 }, /* Front Mic */
7326 [ALC292_FIXUP_TPT460] = {
7327 .type = HDA_FIXUP_FUNC,
7328 .v.func = alc_fixup_tpt440_dock,
7330 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7332 [ALC298_FIXUP_SPK_VOLUME] = {
7333 .type = HDA_FIXUP_FUNC,
7334 .v.func = alc298_fixup_speaker_volume,
7336 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7338 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7339 .type = HDA_FIXUP_FUNC,
7340 .v.func = alc298_fixup_speaker_volume,
7342 [ALC295_FIXUP_DISABLE_DAC3] = {
7343 .type = HDA_FIXUP_FUNC,
7344 .v.func = alc295_fixup_disable_dac3,
7346 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7347 .type = HDA_FIXUP_FUNC,
7348 .v.func = alc285_fixup_speaker2_to_dac1,
7350 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7352 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7353 .type = HDA_FIXUP_PINS,
7354 .v.pins = (const struct hda_pintbl[]) {
7355 { 0x1b, 0x90170151 },
7359 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7361 [ALC269_FIXUP_ATIV_BOOK_8] = {
7362 .type = HDA_FIXUP_FUNC,
7363 .v.func = alc_fixup_auto_mute_via_amp,
7365 .chain_id = ALC269_FIXUP_NO_SHUTUP
7367 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7368 .type = HDA_FIXUP_PINS,
7369 .v.pins = (const struct hda_pintbl[]) {
7370 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7371 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7375 .chain_id = ALC269_FIXUP_HEADSET_MODE
7377 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7378 .type = HDA_FIXUP_FUNC,
7379 .v.func = alc_fixup_headset_mode,
7381 [ALC256_FIXUP_ASUS_MIC] = {
7382 .type = HDA_FIXUP_PINS,
7383 .v.pins = (const struct hda_pintbl[]) {
7384 { 0x13, 0x90a60160 }, /* use as internal mic */
7385 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7389 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7391 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7392 .type = HDA_FIXUP_FUNC,
7393 /* Set up GPIO2 for the speaker amp */
7394 .v.func = alc_fixup_gpio4,
7396 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7397 .type = HDA_FIXUP_PINS,
7398 .v.pins = (const struct hda_pintbl[]) {
7399 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7403 .chain_id = ALC269_FIXUP_HEADSET_MIC
7405 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7406 .type = HDA_FIXUP_VERBS,
7407 .v.verbs = (const struct hda_verb[]) {
7408 /* Enables internal speaker */
7409 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7410 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7414 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7416 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7417 .type = HDA_FIXUP_FUNC,
7418 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7420 .chain_id = ALC269_FIXUP_GPIO2
7422 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7423 .type = HDA_FIXUP_VERBS,
7424 .v.verbs = (const struct hda_verb[]) {
7425 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7426 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7430 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7432 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7433 .type = HDA_FIXUP_PINS,
7434 .v.pins = (const struct hda_pintbl[]) {
7435 /* Change the mic location from front to right, otherwise there are
7436 two front mics with the same name, pulseaudio can't handle them.
7437 This is just a temporary workaround, after applying this fixup,
7438 there will be one "Front Mic" and one "Mic" in this machine.
7440 { 0x1a, 0x04a19040 },
7444 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7445 .type = HDA_FIXUP_PINS,
7446 .v.pins = (const struct hda_pintbl[]) {
7447 { 0x16, 0x0101102f }, /* Rear Headset HP */
7448 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7449 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7450 { 0x1b, 0x02011020 },
7454 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7456 [ALC225_FIXUP_S3_POP_NOISE] = {
7457 .type = HDA_FIXUP_FUNC,
7458 .v.func = alc225_fixup_s3_pop_noise,
7460 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7462 [ALC700_FIXUP_INTEL_REFERENCE] = {
7463 .type = HDA_FIXUP_VERBS,
7464 .v.verbs = (const struct hda_verb[]) {
7465 /* Enables internal speaker */
7466 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7467 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7468 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7469 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7470 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7471 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7472 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7473 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7477 [ALC274_FIXUP_DELL_BIND_DACS] = {
7478 .type = HDA_FIXUP_FUNC,
7479 .v.func = alc274_fixup_bind_dacs,
7481 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7483 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7484 .type = HDA_FIXUP_PINS,
7485 .v.pins = (const struct hda_pintbl[]) {
7486 { 0x1b, 0x0401102f },
7490 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7492 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7493 .type = HDA_FIXUP_FUNC,
7494 .v.func = alc_fixup_tpt470_dock,
7496 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7498 [ALC298_FIXUP_TPT470_DOCK] = {
7499 .type = HDA_FIXUP_FUNC,
7500 .v.func = alc_fixup_tpt470_dacs,
7502 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7504 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7505 .type = HDA_FIXUP_PINS,
7506 .v.pins = (const struct hda_pintbl[]) {
7507 { 0x14, 0x0201101f },
7511 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7513 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7514 .type = HDA_FIXUP_PINS,
7515 .v.pins = (const struct hda_pintbl[]) {
7516 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7520 .chain_id = ALC269_FIXUP_HEADSET_MIC
7522 [ALC295_FIXUP_HP_X360] = {
7523 .type = HDA_FIXUP_FUNC,
7524 .v.func = alc295_fixup_hp_top_speakers,
7526 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7528 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7529 .type = HDA_FIXUP_PINS,
7530 .v.pins = (const struct hda_pintbl[]) {
7531 { 0x19, 0x0181313f},
7535 .chain_id = ALC269_FIXUP_HEADSET_MIC
7537 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7538 .type = HDA_FIXUP_FUNC,
7539 .v.func = alc285_fixup_invalidate_dacs,
7541 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7543 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7544 .type = HDA_FIXUP_FUNC,
7545 .v.func = alc_fixup_auto_mute_via_amp,
7547 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7548 .type = HDA_FIXUP_PINS,
7549 .v.pins = (const struct hda_pintbl[]) {
7550 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7554 .chain_id = ALC269_FIXUP_HEADSET_MIC
7556 [ALC294_FIXUP_ASUS_MIC] = {
7557 .type = HDA_FIXUP_PINS,
7558 .v.pins = (const struct hda_pintbl[]) {
7559 { 0x13, 0x90a60160 }, /* use as internal mic */
7560 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7564 .chain_id = ALC269_FIXUP_HEADSET_MIC
7566 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7567 .type = HDA_FIXUP_PINS,
7568 .v.pins = (const struct hda_pintbl[]) {
7569 { 0x19, 0x01a1103c }, /* use as headset mic */
7573 .chain_id = ALC269_FIXUP_HEADSET_MIC
7575 [ALC294_FIXUP_ASUS_SPK] = {
7576 .type = HDA_FIXUP_VERBS,
7577 .v.verbs = (const struct hda_verb[]) {
7579 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7580 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7581 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7582 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7586 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7588 [ALC295_FIXUP_CHROME_BOOK] = {
7589 .type = HDA_FIXUP_FUNC,
7590 .v.func = alc295_fixup_chromebook,
7592 .chain_id = ALC225_FIXUP_HEADSET_JACK
7594 [ALC225_FIXUP_HEADSET_JACK] = {
7595 .type = HDA_FIXUP_FUNC,
7596 .v.func = alc_fixup_headset_jack,
7598 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7599 .type = HDA_FIXUP_PINS,
7600 .v.pins = (const struct hda_pintbl[]) {
7601 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7605 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7607 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7608 .type = HDA_FIXUP_VERBS,
7609 .v.verbs = (const struct hda_verb[]) {
7610 /* Disable PCBEEP-IN passthrough */
7611 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7612 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7616 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7618 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7619 .type = HDA_FIXUP_PINS,
7620 .v.pins = (const struct hda_pintbl[]) {
7621 { 0x19, 0x03a11130 },
7622 { 0x1a, 0x90a60140 }, /* use as internal mic */
7626 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7628 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7629 .type = HDA_FIXUP_PINS,
7630 .v.pins = (const struct hda_pintbl[]) {
7631 { 0x16, 0x01011020 }, /* Rear Line out */
7632 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7636 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7638 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7639 .type = HDA_FIXUP_FUNC,
7640 .v.func = alc_fixup_auto_mute_via_amp,
7642 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7644 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7645 .type = HDA_FIXUP_FUNC,
7646 .v.func = alc_fixup_disable_mic_vref,
7648 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7650 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7651 .type = HDA_FIXUP_VERBS,
7652 .v.verbs = (const struct hda_verb[]) {
7653 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7654 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7658 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7660 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7661 .type = HDA_FIXUP_PINS,
7662 .v.pins = (const struct hda_pintbl[]) {
7663 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7667 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7669 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7670 .type = HDA_FIXUP_PINS,
7671 .v.pins = (const struct hda_pintbl[]) {
7672 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7676 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7678 [ALC299_FIXUP_PREDATOR_SPK] = {
7679 .type = HDA_FIXUP_PINS,
7680 .v.pins = (const struct hda_pintbl[]) {
7681 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7685 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7686 .type = HDA_FIXUP_PINS,
7687 .v.pins = (const struct hda_pintbl[]) {
7688 { 0x19, 0x04a11040 },
7689 { 0x21, 0x04211020 },
7693 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7695 [ALC289_FIXUP_DELL_SPK2] = {
7696 .type = HDA_FIXUP_PINS,
7697 .v.pins = (const struct hda_pintbl[]) {
7698 { 0x17, 0x90170130 }, /* bass spk */
7702 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7704 [ALC289_FIXUP_DUAL_SPK] = {
7705 .type = HDA_FIXUP_FUNC,
7706 .v.func = alc285_fixup_speaker2_to_dac1,
7708 .chain_id = ALC289_FIXUP_DELL_SPK2
7710 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7711 .type = HDA_FIXUP_FUNC,
7712 .v.func = alc285_fixup_speaker2_to_dac1,
7714 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7716 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7717 .type = HDA_FIXUP_FUNC,
7718 /* The GPIO must be pulled to initialize the AMP */
7719 .v.func = alc_fixup_gpio4,
7721 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7723 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
7724 .type = HDA_FIXUP_FUNC,
7725 .v.func = alc285_fixup_thinkpad_x1_gen7,
7727 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7729 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7730 .type = HDA_FIXUP_FUNC,
7731 .v.func = alc_fixup_headset_jack,
7733 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
7735 [ALC294_FIXUP_ASUS_HPE] = {
7736 .type = HDA_FIXUP_VERBS,
7737 .v.verbs = (const struct hda_verb[]) {
7739 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7740 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7744 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7746 [ALC294_FIXUP_ASUS_GX502_PINS] = {
7747 .type = HDA_FIXUP_PINS,
7748 .v.pins = (const struct hda_pintbl[]) {
7749 { 0x19, 0x03a11050 }, /* front HP mic */
7750 { 0x1a, 0x01a11830 }, /* rear external mic */
7751 { 0x21, 0x03211020 }, /* front HP out */
7755 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
7757 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
7758 .type = HDA_FIXUP_VERBS,
7759 .v.verbs = (const struct hda_verb[]) {
7760 /* set 0x15 to HP-OUT ctrl */
7761 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7762 /* unmute the 0x15 amp */
7763 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7767 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
7769 [ALC294_FIXUP_ASUS_GX502_HP] = {
7770 .type = HDA_FIXUP_FUNC,
7771 .v.func = alc294_fixup_gx502_hp,
7773 [ALC294_FIXUP_ASUS_GU502_PINS] = {
7774 .type = HDA_FIXUP_PINS,
7775 .v.pins = (const struct hda_pintbl[]) {
7776 { 0x19, 0x01a11050 }, /* rear HP mic */
7777 { 0x1a, 0x01a11830 }, /* rear external mic */
7778 { 0x21, 0x012110f0 }, /* rear HP out */
7782 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
7784 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
7785 .type = HDA_FIXUP_VERBS,
7786 .v.verbs = (const struct hda_verb[]) {
7787 /* set 0x15 to HP-OUT ctrl */
7788 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7789 /* unmute the 0x15 amp */
7790 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7791 /* set 0x1b to HP-OUT */
7792 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
7796 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
7798 [ALC294_FIXUP_ASUS_GU502_HP] = {
7799 .type = HDA_FIXUP_FUNC,
7800 .v.func = alc294_fixup_gu502_hp,
7802 [ALC294_FIXUP_ASUS_COEF_1B] = {
7803 .type = HDA_FIXUP_VERBS,
7804 .v.verbs = (const struct hda_verb[]) {
7805 /* Set bit 10 to correct noisy output after reboot from
7806 * Windows 10 (due to pop noise reduction?)
7808 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
7809 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
7813 [ALC285_FIXUP_HP_GPIO_LED] = {
7814 .type = HDA_FIXUP_FUNC,
7815 .v.func = alc285_fixup_hp_gpio_led,
7817 [ALC285_FIXUP_HP_MUTE_LED] = {
7818 .type = HDA_FIXUP_FUNC,
7819 .v.func = alc285_fixup_hp_mute_led,
7821 [ALC236_FIXUP_HP_GPIO_LED] = {
7822 .type = HDA_FIXUP_FUNC,
7823 .v.func = alc236_fixup_hp_gpio_led,
7825 [ALC236_FIXUP_HP_MUTE_LED] = {
7826 .type = HDA_FIXUP_FUNC,
7827 .v.func = alc236_fixup_hp_mute_led,
7829 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
7830 .type = HDA_FIXUP_FUNC,
7831 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
7833 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
7834 .type = HDA_FIXUP_VERBS,
7835 .v.verbs = (const struct hda_verb[]) {
7836 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
7840 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7841 .type = HDA_FIXUP_PINS,
7842 .v.pins = (const struct hda_pintbl[]) {
7843 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7847 .chain_id = ALC269_FIXUP_HEADSET_MODE
7849 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
7850 .type = HDA_FIXUP_PINS,
7851 .v.pins = (const struct hda_pintbl[]) {
7852 { 0x14, 0x90100120 }, /* use as internal speaker */
7853 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7854 { 0x1a, 0x01011020 }, /* use as line out */
7858 .chain_id = ALC269_FIXUP_HEADSET_MIC
7860 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
7861 .type = HDA_FIXUP_PINS,
7862 .v.pins = (const struct hda_pintbl[]) {
7863 { 0x18, 0x02a11030 }, /* use as headset mic */
7867 .chain_id = ALC269_FIXUP_HEADSET_MIC
7869 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
7870 .type = HDA_FIXUP_PINS,
7871 .v.pins = (const struct hda_pintbl[]) {
7872 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7876 .chain_id = ALC269_FIXUP_HEADSET_MIC
7878 [ALC289_FIXUP_ASUS_GA401] = {
7879 .type = HDA_FIXUP_FUNC,
7880 .v.func = alc289_fixup_asus_ga401,
7882 .chain_id = ALC289_FIXUP_ASUS_GA502,
7884 [ALC289_FIXUP_ASUS_GA502] = {
7885 .type = HDA_FIXUP_PINS,
7886 .v.pins = (const struct hda_pintbl[]) {
7887 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7891 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
7892 .type = HDA_FIXUP_PINS,
7893 .v.pins = (const struct hda_pintbl[]) {
7894 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
7898 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7900 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
7901 .type = HDA_FIXUP_FUNC,
7902 .v.func = alc285_fixup_hp_gpio_amp_init,
7904 .chain_id = ALC285_FIXUP_HP_GPIO_LED
7906 [ALC269_FIXUP_CZC_B20] = {
7907 .type = HDA_FIXUP_PINS,
7908 .v.pins = (const struct hda_pintbl[]) {
7909 { 0x12, 0x411111f0 },
7910 { 0x14, 0x90170110 }, /* speaker */
7911 { 0x15, 0x032f1020 }, /* HP out */
7912 { 0x17, 0x411111f0 },
7913 { 0x18, 0x03ab1040 }, /* mic */
7914 { 0x19, 0xb7a7013f },
7915 { 0x1a, 0x0181305f },
7916 { 0x1b, 0x411111f0 },
7917 { 0x1d, 0x411111f0 },
7918 { 0x1e, 0x411111f0 },
7921 .chain_id = ALC269_FIXUP_DMIC,
7923 [ALC269_FIXUP_CZC_TMI] = {
7924 .type = HDA_FIXUP_PINS,
7925 .v.pins = (const struct hda_pintbl[]) {
7926 { 0x12, 0x4000c000 },
7927 { 0x14, 0x90170110 }, /* speaker */
7928 { 0x15, 0x0421401f }, /* HP out */
7929 { 0x17, 0x411111f0 },
7930 { 0x18, 0x04a19020 }, /* mic */
7931 { 0x19, 0x411111f0 },
7932 { 0x1a, 0x411111f0 },
7933 { 0x1b, 0x411111f0 },
7934 { 0x1d, 0x40448505 },
7935 { 0x1e, 0x411111f0 },
7936 { 0x20, 0x8000ffff },
7939 .chain_id = ALC269_FIXUP_DMIC,
7941 [ALC269_FIXUP_CZC_L101] = {
7942 .type = HDA_FIXUP_PINS,
7943 .v.pins = (const struct hda_pintbl[]) {
7944 { 0x12, 0x40000000 },
7945 { 0x14, 0x01014010 }, /* speaker */
7946 { 0x15, 0x411111f0 }, /* HP out */
7947 { 0x16, 0x411111f0 },
7948 { 0x18, 0x01a19020 }, /* mic */
7949 { 0x19, 0x02a19021 },
7950 { 0x1a, 0x0181302f },
7951 { 0x1b, 0x0221401f },
7952 { 0x1c, 0x411111f0 },
7953 { 0x1d, 0x4044c601 },
7954 { 0x1e, 0x411111f0 },
7957 .chain_id = ALC269_FIXUP_DMIC,
7959 [ALC269_FIXUP_LEMOTE_A1802] = {
7960 .type = HDA_FIXUP_PINS,
7961 .v.pins = (const struct hda_pintbl[]) {
7962 { 0x12, 0x40000000 },
7963 { 0x14, 0x90170110 }, /* speaker */
7964 { 0x17, 0x411111f0 },
7965 { 0x18, 0x03a19040 }, /* mic1 */
7966 { 0x19, 0x90a70130 }, /* mic2 */
7967 { 0x1a, 0x411111f0 },
7968 { 0x1b, 0x411111f0 },
7969 { 0x1d, 0x40489d2d },
7970 { 0x1e, 0x411111f0 },
7971 { 0x20, 0x0003ffff },
7972 { 0x21, 0x03214020 },
7975 .chain_id = ALC269_FIXUP_DMIC,
7977 [ALC269_FIXUP_LEMOTE_A190X] = {
7978 .type = HDA_FIXUP_PINS,
7979 .v.pins = (const struct hda_pintbl[]) {
7980 { 0x14, 0x99130110 }, /* speaker */
7981 { 0x15, 0x0121401f }, /* HP out */
7982 { 0x18, 0x01a19c20 }, /* rear mic */
7983 { 0x19, 0x99a3092f }, /* front mic */
7984 { 0x1b, 0x0201401f }, /* front lineout */
7987 .chain_id = ALC269_FIXUP_DMIC,
7989 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
7990 .type = HDA_FIXUP_PINS,
7991 .v.pins = (const struct hda_pintbl[]) {
7992 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7996 .chain_id = ALC269_FIXUP_HEADSET_MODE
7998 [ALC256_FIXUP_INTEL_NUC10] = {
7999 .type = HDA_FIXUP_PINS,
8000 .v.pins = (const struct hda_pintbl[]) {
8001 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8005 .chain_id = ALC269_FIXUP_HEADSET_MODE
8007 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8008 .type = HDA_FIXUP_VERBS,
8009 .v.verbs = (const struct hda_verb[]) {
8010 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8011 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8015 .chain_id = ALC289_FIXUP_ASUS_GA502
8017 [ALC274_FIXUP_HP_MIC] = {
8018 .type = HDA_FIXUP_VERBS,
8019 .v.verbs = (const struct hda_verb[]) {
8020 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8021 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8025 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8026 .type = HDA_FIXUP_FUNC,
8027 .v.func = alc274_fixup_hp_headset_mic,
8029 .chain_id = ALC274_FIXUP_HP_MIC
8031 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8032 .type = HDA_FIXUP_FUNC,
8033 .v.func = alc274_fixup_hp_envy_gpio,
8035 [ALC256_FIXUP_ASUS_HPE] = {
8036 .type = HDA_FIXUP_VERBS,
8037 .v.verbs = (const struct hda_verb[]) {
8039 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8040 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8044 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8046 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8047 .type = HDA_FIXUP_FUNC,
8048 .v.func = alc_fixup_headset_jack,
8050 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8052 [ALC287_FIXUP_HP_GPIO_LED] = {
8053 .type = HDA_FIXUP_FUNC,
8054 .v.func = alc287_fixup_hp_gpio_led,
8056 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8057 .type = HDA_FIXUP_FUNC,
8058 .v.func = alc274_fixup_hp_headset_mic,
8060 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8061 .type = HDA_FIXUP_FUNC,
8062 .v.func = alc_fixup_no_int_mic,
8064 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8066 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8067 .type = HDA_FIXUP_PINS,
8068 .v.pins = (const struct hda_pintbl[]) {
8069 { 0x1b, 0x411111f0 },
8070 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8074 .chain_id = ALC269_FIXUP_HEADSET_MODE
8076 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8077 .type = HDA_FIXUP_FUNC,
8078 .v.func = alc269_fixup_limit_int_mic_boost,
8080 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8082 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8083 .type = HDA_FIXUP_PINS,
8084 .v.pins = (const struct hda_pintbl[]) {
8085 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8086 { 0x1a, 0x90a1092f }, /* use as internal mic */
8090 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8092 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8093 .type = HDA_FIXUP_FUNC,
8094 .v.func = alc285_fixup_ideapad_s740_coef,
8096 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8098 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8099 .type = HDA_FIXUP_FUNC,
8100 .v.func = alc269_fixup_limit_int_mic_boost,
8102 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8104 [ALC295_FIXUP_ASUS_DACS] = {
8105 .type = HDA_FIXUP_FUNC,
8106 .v.func = alc295_fixup_asus_dacs,
8108 [ALC295_FIXUP_HP_OMEN] = {
8109 .type = HDA_FIXUP_PINS,
8110 .v.pins = (const struct hda_pintbl[]) {
8111 { 0x12, 0xb7a60130 },
8112 { 0x13, 0x40000000 },
8113 { 0x14, 0x411111f0 },
8114 { 0x16, 0x411111f0 },
8115 { 0x17, 0x90170110 },
8116 { 0x18, 0x411111f0 },
8117 { 0x19, 0x02a11030 },
8118 { 0x1a, 0x411111f0 },
8119 { 0x1b, 0x04a19030 },
8120 { 0x1d, 0x40600001 },
8121 { 0x1e, 0x411111f0 },
8122 { 0x21, 0x03211020 },
8126 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8128 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8129 .type = HDA_FIXUP_PINS,
8130 .v.pins = (const struct hda_pintbl[]) {
8131 { 0x14, 0x90170110 }, /* enable top speaker */
8135 .chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1,
8137 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8138 .type = HDA_FIXUP_FUNC,
8139 .v.func = alc285_fixup_ideapad_s740_coef,
8141 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8143 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8144 .type = HDA_FIXUP_FUNC,
8145 .v.func = alc_fixup_no_shutup,
8147 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8151 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8152 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8153 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8154 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8155 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8156 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8157 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8158 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8159 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8160 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8161 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8162 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8163 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8164 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8165 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8166 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8167 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8168 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8169 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8170 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8171 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8172 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8173 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8174 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8175 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8176 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8177 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8178 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8179 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8180 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8181 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8182 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8183 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8184 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8185 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8186 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8187 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8188 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8189 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8190 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8191 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8192 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8193 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8194 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8195 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8196 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8197 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8198 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8199 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8200 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8201 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8202 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8203 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8204 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8205 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8206 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8207 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8208 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8209 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8210 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8211 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8212 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8213 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8214 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8215 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8216 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8217 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8218 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8219 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8220 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8221 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8222 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8223 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8224 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8225 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8226 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8227 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8228 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8229 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8230 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8231 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8232 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8233 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8234 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8235 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8236 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8237 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8238 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8239 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8240 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8241 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8242 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8243 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8244 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8245 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8246 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8247 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8248 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8249 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8250 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8251 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8252 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8253 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8254 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8255 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8256 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8257 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8258 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8259 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8260 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8261 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8262 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8263 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8264 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8265 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8266 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8267 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8268 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8269 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8270 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8271 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8272 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8273 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8274 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8275 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8276 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8277 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8278 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8279 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8280 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8281 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8282 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8283 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8284 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8285 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8286 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8287 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8288 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8289 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8290 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8291 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8292 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8293 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8294 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8295 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8296 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8297 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8298 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8299 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8300 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8301 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8302 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8303 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8304 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8305 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8306 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8307 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8308 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8309 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8310 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8311 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8312 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
8313 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8314 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
8315 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
8316 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8317 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8318 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
8319 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
8320 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8321 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8322 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8323 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8324 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8325 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
8326 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8327 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8328 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8329 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
8330 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8331 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8332 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8333 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8334 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8335 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8336 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
8337 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8338 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8339 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
8340 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8341 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
8342 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8343 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8344 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8345 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8346 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8347 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
8348 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8349 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8350 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
8351 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
8352 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
8353 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
8354 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
8355 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8356 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
8357 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
8358 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8359 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
8360 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
8361 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
8362 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8363 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
8364 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
8365 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
8366 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
8367 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
8368 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
8369 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8370 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8371 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
8372 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
8373 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
8374 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
8375 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
8376 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8377 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
8378 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8379 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8380 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8381 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8382 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
8383 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8384 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8385 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8386 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
8387 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8388 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8389 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
8390 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
8391 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8392 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
8393 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8394 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
8395 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
8396 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8397 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8398 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8399 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8400 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
8401 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
8402 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8403 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8404 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8405 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8406 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
8407 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8408 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8409 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8410 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8411 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
8412 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
8413 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8414 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8415 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8416 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8417 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8418 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8419 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8420 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8421 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8422 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8423 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8424 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8425 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8426 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8427 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8428 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8429 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8430 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8431 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8432 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8433 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8434 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8435 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8436 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8437 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8438 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8439 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8440 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8441 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8442 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8443 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8444 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8445 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8446 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8447 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8448 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8449 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8450 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8451 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
8452 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
8453 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5|7][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
8454 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8455 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8456 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8457 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8458 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8459 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8460 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8461 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8462 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8463 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8464 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8465 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL5XNU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8466 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8467 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8468 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8469 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8470 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8471 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8472 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
8473 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
8474 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8475 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8476 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8477 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8478 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
8479 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
8480 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
8481 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
8482 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
8483 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
8484 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
8485 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
8486 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
8487 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
8488 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
8489 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
8490 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
8491 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8492 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
8493 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
8494 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
8495 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8496 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8497 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
8498 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
8499 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
8500 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8501 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8502 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
8503 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8504 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8505 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8506 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8507 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8508 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8509 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8510 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8511 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8512 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8513 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8514 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8515 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8516 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8517 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8518 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8519 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8520 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8521 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
8522 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
8523 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
8524 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8525 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
8526 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8527 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
8528 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8529 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
8530 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
8531 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8532 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
8533 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
8534 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
8535 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
8536 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
8537 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
8538 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
8539 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
8540 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8541 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8542 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8543 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8544 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8545 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8546 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
8547 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
8548 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
8549 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
8550 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
8551 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
8552 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
8553 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
8554 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8555 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
8556 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
8557 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8558 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
8559 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
8560 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
8563 /* Below is a quirk table taken from the old code.
8564 * Basically the device should work as is without the fixup table.
8565 * If BIOS doesn't give a proper info, enable the corresponding
8568 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
8570 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
8571 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
8572 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
8573 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
8574 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
8575 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
8576 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
8577 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
8578 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
8579 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
8580 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
8581 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
8582 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
8583 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
8584 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
8585 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
8586 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
8587 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
8588 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
8589 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
8590 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
8591 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
8592 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
8593 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
8594 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
8595 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
8596 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
8597 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
8598 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
8599 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
8600 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
8601 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
8602 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
8603 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
8604 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
8605 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
8606 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
8607 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
8608 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
8613 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
8614 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
8615 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
8616 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
8617 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
8618 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
8622 static const struct hda_model_fixup alc269_fixup_models[] = {
8623 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
8624 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
8625 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
8626 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
8627 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
8628 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
8629 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
8630 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
8631 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
8632 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
8633 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8634 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
8635 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
8636 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
8637 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
8638 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
8639 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
8640 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
8641 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
8642 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
8643 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
8644 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
8645 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
8646 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
8647 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
8648 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
8649 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
8650 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
8651 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
8652 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
8653 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
8654 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
8655 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
8656 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
8657 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
8658 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
8659 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
8660 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
8661 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
8662 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
8663 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
8664 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
8665 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
8666 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
8667 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
8668 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
8669 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
8670 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
8671 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
8672 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
8673 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
8674 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
8675 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
8676 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
8677 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
8678 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
8679 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
8680 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
8681 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
8682 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
8683 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
8684 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
8685 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
8686 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
8687 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
8688 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
8689 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
8690 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
8691 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
8692 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8693 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
8694 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
8695 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
8696 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
8697 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
8698 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
8699 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
8700 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
8701 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
8702 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
8703 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
8704 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
8705 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
8706 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
8707 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
8708 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
8709 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
8710 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
8711 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
8712 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
8713 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
8714 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
8715 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
8716 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
8717 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
8718 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
8719 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
8720 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
8721 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
8722 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
8723 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
8724 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
8725 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
8726 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
8727 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8728 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
8729 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
8730 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
8731 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
8732 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
8733 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
8734 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
8735 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
8736 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
8737 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
8738 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
8739 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
8740 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
8743 #define ALC225_STANDARD_PINS \
8746 #define ALC256_STANDARD_PINS \
8747 {0x12, 0x90a60140}, \
8748 {0x14, 0x90170110}, \
8751 #define ALC282_STANDARD_PINS \
8754 #define ALC290_STANDARD_PINS \
8757 #define ALC292_STANDARD_PINS \
8758 {0x14, 0x90170110}, \
8761 #define ALC295_STANDARD_PINS \
8762 {0x12, 0xb7a60130}, \
8763 {0x14, 0x90170110}, \
8766 #define ALC298_STANDARD_PINS \
8767 {0x12, 0x90a60130}, \
8770 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8771 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
8776 {0x21, 0x0221102f}),
8777 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8780 {0x21, 0x02211030}),
8781 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8784 {0x21, 0x03211020}),
8785 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8788 {0x21, 0x03211020}),
8789 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8790 ALC225_STANDARD_PINS,
8792 {0x14, 0x901701a0}),
8793 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8794 ALC225_STANDARD_PINS,
8796 {0x14, 0x901701b0}),
8797 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8798 ALC225_STANDARD_PINS,
8800 {0x14, 0x901701a0}),
8801 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8802 ALC225_STANDARD_PINS,
8804 {0x14, 0x901701b0}),
8805 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8806 ALC225_STANDARD_PINS,
8808 {0x1b, 0x90170110}),
8809 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8812 {0x21, 0x02211020}),
8813 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
8817 {0x21, 0x02211020}),
8818 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8823 {0x21, 0x0221101f}),
8824 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8829 {0x21, 0x0221101f}),
8830 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8834 {0x21, 0x0221101f}),
8835 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
8836 {0x21, 0x02211010}),
8837 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
8840 {0x21, 0x02211030}),
8841 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
8843 {0x21, 0x02211020}),
8844 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8846 {0x21, 0x02211040}),
8847 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8850 {0x21, 0x02211020}),
8851 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8854 {0x21, 0x02211030}),
8855 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8858 {0x21, 0x0221101f}),
8859 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8862 {0x21, 0x0221101f}),
8863 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8866 {0x21, 0x0221103f}),
8867 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8870 {0x21, 0x0221103f}),
8871 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8874 {0x21, 0x0221103f}),
8875 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8878 {0x21, 0x0221105f}),
8879 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8882 {0x21, 0x0221101f}),
8883 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8887 {0x21, 0x0321102f}),
8888 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8891 {0x21, 0x02211040}),
8892 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8895 {0x21, 0x02211050}),
8896 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8899 {0x21, 0x02211030}),
8900 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8903 {0x21, 0x02211040}),
8904 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8907 {0x21, 0x02211040}),
8908 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8911 {0x21, 0x02211050}),
8912 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8915 {0x21, 0x02211040}),
8916 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8919 {0x21, 0x02211030}),
8920 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8922 {0x21, 0x02211010}),
8923 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8926 {0x21, 0x04211020}),
8927 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8930 {0x21, 0x03211020}),
8931 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8934 {0x21, 0x03211020}),
8935 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8938 {0x21, 0x04211020}),
8939 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8942 {0x21, 0x03211020}),
8943 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
8946 {0x21, 0x0221101f}),
8947 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
8950 {0x21, 0x03211020}),
8951 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
8955 {0x1a, 0x04a11020}),
8956 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
8962 {0x1b, 0x02011020}),
8963 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8964 ALC282_STANDARD_PINS,
8967 {0x21, 0x0321101f}),
8968 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8969 ALC282_STANDARD_PINS,
8972 {0x21, 0x03211040}),
8973 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8974 ALC282_STANDARD_PINS,
8977 {0x21, 0x03211020}),
8978 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8979 ALC282_STANDARD_PINS,
8982 {0x21, 0x0421101f}),
8983 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
8984 ALC282_STANDARD_PINS,
8987 {0x21, 0x04211020}),
8988 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
8989 ALC282_STANDARD_PINS,
8995 {0x21, 0x0321101f}),
8996 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
8997 ALC282_STANDARD_PINS,
9003 {0x21, 0x0321101f}),
9004 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9005 ALC282_STANDARD_PINS,
9007 {0x21, 0x0321101f}),
9008 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9011 {0x21, 0x02211030}),
9012 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9013 ALC282_STANDARD_PINS,
9016 {0x21, 0x0321101f}),
9017 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9021 {0x21, 0x04211020}),
9022 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9026 {0x21, 0x04211020}),
9027 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9030 {0x21, 0x04211020}),
9031 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9035 {0x21, 0x03211020}),
9036 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9039 {0x21, 0x02211020}),
9040 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9043 {0x21, 0x0321101f}),
9044 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9045 ALC290_STANDARD_PINS,
9048 {0x1a, 0x04a11020}),
9049 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9050 ALC290_STANDARD_PINS,
9053 {0x1a, 0x04a11020}),
9054 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9055 ALC290_STANDARD_PINS,
9057 {0x1a, 0x04a11020}),
9058 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9059 ALC290_STANDARD_PINS,
9061 {0x1a, 0x04a11040}),
9062 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9063 ALC290_STANDARD_PINS,
9066 {0x1a, 0x04a11040}),
9067 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9068 ALC290_STANDARD_PINS,
9071 {0x1a, 0x04a11020}),
9072 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9073 ALC290_STANDARD_PINS,
9076 {0x1a, 0x04a11020}),
9077 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9078 ALC292_STANDARD_PINS,
9081 {0x19, 0x01a19030}),
9082 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9083 ALC292_STANDARD_PINS,
9087 {0x19, 0x01a1903e}),
9088 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9089 ALC292_STANDARD_PINS,
9090 {0x12, 0x90a60140}),
9091 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9092 ALC292_STANDARD_PINS,
9095 {0x19, 0x21a19030}),
9096 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9097 ALC292_STANDARD_PINS,
9098 {0x13, 0x90a60140}),
9099 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9101 {0x21, 0x04211020}),
9102 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9105 {0x21, 0x04211020}),
9106 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9109 {0x21, 0x03211020}),
9110 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9113 {0x21, 0x04211020}),
9114 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9117 {0x21, 0x03211020}),
9118 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9121 {0x21, 0x04211030}),
9122 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9125 {0x21, 0x03211020}),
9126 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9129 {0x21, 0x03211020}),
9130 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9132 {0x21, 0x04211020}),
9133 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9135 {0x21, 0x04211030}),
9136 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9137 ALC295_STANDARD_PINS,
9139 {0x18, 0x21a19030}),
9140 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9141 ALC295_STANDARD_PINS,
9143 {0x18, 0x21a19050}),
9144 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9145 ALC295_STANDARD_PINS),
9146 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9147 ALC298_STANDARD_PINS,
9148 {0x17, 0x90170110}),
9149 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9150 ALC298_STANDARD_PINS,
9151 {0x17, 0x90170140}),
9152 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9153 ALC298_STANDARD_PINS,
9154 {0x17, 0x90170150}),
9155 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9160 {0x21, 0x03211030}),
9161 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9165 {0x21, 0x03211020}),
9166 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9167 ALC225_STANDARD_PINS,
9169 {0x17, 0x90170110}),
9170 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9175 {0x21, 0x0221101f}),
9179 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9180 * more machines, don't need to match all valid pins, just need to match
9181 * all the pins defined in the tbl. Just because of this reason, it is possible
9182 * that a single machine matches multiple tbls, so there is one limitation:
9183 * at most one tbl is allowed to define for the same vendor and same codec
9185 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9186 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9188 {0x1b, 0x40000000}),
9189 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9191 {0x1a, 0x40000000}),
9192 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9194 {0x1a, 0x40000000}),
9195 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9197 {0x1a, 0x40000000}),
9201 static void alc269_fill_coef(struct hda_codec *codec)
9203 struct alc_spec *spec = codec->spec;
9206 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9209 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9210 alc_write_coef_idx(codec, 0xf, 0x960b);
9211 alc_write_coef_idx(codec, 0xe, 0x8817);
9214 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9215 alc_write_coef_idx(codec, 0xf, 0x960b);
9216 alc_write_coef_idx(codec, 0xe, 0x8814);
9219 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9220 /* Power up output pin */
9221 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9224 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9225 val = alc_read_coef_idx(codec, 0xd);
9226 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9227 /* Capless ramp up clock control */
9228 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9230 val = alc_read_coef_idx(codec, 0x17);
9231 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9232 /* Class D power on reset */
9233 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9238 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
9243 static int patch_alc269(struct hda_codec *codec)
9245 struct alc_spec *spec;
9248 err = alc_alloc_spec(codec, 0x0b);
9253 spec->gen.shared_mic_vref_pin = 0x18;
9254 codec->power_save_node = 0;
9257 codec->patch_ops.suspend = alc269_suspend;
9258 codec->patch_ops.resume = alc269_resume;
9260 spec->shutup = alc_default_shutup;
9261 spec->init_hook = alc_default_init;
9263 switch (codec->core.vendor_id) {
9265 spec->codec_variant = ALC269_TYPE_ALC269VA;
9266 switch (alc_get_coef0(codec) & 0x00f0) {
9268 if (codec->bus->pci &&
9269 codec->bus->pci->subsystem_vendor == 0x1025 &&
9270 spec->cdefine.platform_type == 1)
9271 err = alc_codec_rename(codec, "ALC271X");
9272 spec->codec_variant = ALC269_TYPE_ALC269VB;
9275 if (codec->bus->pci &&
9276 codec->bus->pci->subsystem_vendor == 0x17aa &&
9277 codec->bus->pci->subsystem_device == 0x21f3)
9278 err = alc_codec_rename(codec, "ALC3202");
9279 spec->codec_variant = ALC269_TYPE_ALC269VC;
9282 spec->codec_variant = ALC269_TYPE_ALC269VD;
9285 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9289 spec->shutup = alc269_shutup;
9290 spec->init_hook = alc269_fill_coef;
9291 alc269_fill_coef(codec);
9296 spec->codec_variant = ALC269_TYPE_ALC280;
9299 spec->codec_variant = ALC269_TYPE_ALC282;
9300 spec->shutup = alc282_shutup;
9301 spec->init_hook = alc282_init;
9305 spec->codec_variant = ALC269_TYPE_ALC283;
9306 spec->shutup = alc283_shutup;
9307 spec->init_hook = alc283_init;
9311 spec->codec_variant = ALC269_TYPE_ALC284;
9314 spec->codec_variant = ALC269_TYPE_ALC293;
9318 spec->codec_variant = ALC269_TYPE_ALC286;
9321 spec->codec_variant = ALC269_TYPE_ALC298;
9325 spec->codec_variant = ALC269_TYPE_ALC255;
9326 spec->shutup = alc256_shutup;
9327 spec->init_hook = alc256_init;
9331 spec->codec_variant = ALC269_TYPE_ALC256;
9332 spec->shutup = alc256_shutup;
9333 spec->init_hook = alc256_init;
9334 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
9337 spec->codec_variant = ALC269_TYPE_ALC257;
9338 spec->shutup = alc256_shutup;
9339 spec->init_hook = alc256_init;
9340 spec->gen.mixer_nid = 0;
9347 spec->codec_variant = ALC269_TYPE_ALC215;
9348 spec->shutup = alc225_shutup;
9349 spec->init_hook = alc225_init;
9350 spec->gen.mixer_nid = 0;
9355 spec->codec_variant = ALC269_TYPE_ALC225;
9356 spec->shutup = alc225_shutup;
9357 spec->init_hook = alc225_init;
9358 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
9363 spec->codec_variant = ALC269_TYPE_ALC294;
9364 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
9365 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
9366 spec->init_hook = alc294_init;
9369 spec->codec_variant = ALC269_TYPE_ALC300;
9370 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
9373 spec->codec_variant = ALC269_TYPE_ALC623;
9379 spec->codec_variant = ALC269_TYPE_ALC700;
9380 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
9381 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
9382 spec->init_hook = alc294_init;
9387 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
9388 spec->has_alc5505_dsp = 1;
9389 spec->init_hook = alc5505_dsp_init;
9392 alc_pre_init(codec);
9394 snd_hda_pick_fixup(codec, alc269_fixup_models,
9395 alc269_fixup_tbl, alc269_fixups);
9396 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
9397 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
9398 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
9400 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9402 alc_auto_parse_customize_define(codec);
9404 if (has_cdefine_beep(codec))
9405 spec->gen.beep_nid = 0x01;
9407 /* automatic parse from the BIOS config */
9408 err = alc269_parse_auto_config(codec);
9412 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
9413 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9418 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9431 static int alc861_parse_auto_config(struct hda_codec *codec)
9433 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
9434 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9435 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
9438 /* Pin config fixes */
9440 ALC861_FIXUP_FSC_AMILO_PI1505,
9441 ALC861_FIXUP_AMP_VREF_0F,
9442 ALC861_FIXUP_NO_JACK_DETECT,
9443 ALC861_FIXUP_ASUS_A6RP,
9444 ALC660_FIXUP_ASUS_W7J,
9447 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9448 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
9449 const struct hda_fixup *fix, int action)
9451 struct alc_spec *spec = codec->spec;
9454 if (action != HDA_FIXUP_ACT_INIT)
9456 val = snd_hda_codec_get_pin_target(codec, 0x0f);
9457 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9458 val |= AC_PINCTL_IN_EN;
9459 val |= AC_PINCTL_VREF_50;
9460 snd_hda_set_pin_ctl(codec, 0x0f, val);
9461 spec->gen.keep_vref_in_automute = 1;
9464 /* suppress the jack-detection */
9465 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
9466 const struct hda_fixup *fix, int action)
9468 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9469 codec->no_jack_detect = 1;
9472 static const struct hda_fixup alc861_fixups[] = {
9473 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
9474 .type = HDA_FIXUP_PINS,
9475 .v.pins = (const struct hda_pintbl[]) {
9476 { 0x0b, 0x0221101f }, /* HP */
9477 { 0x0f, 0x90170310 }, /* speaker */
9481 [ALC861_FIXUP_AMP_VREF_0F] = {
9482 .type = HDA_FIXUP_FUNC,
9483 .v.func = alc861_fixup_asus_amp_vref_0f,
9485 [ALC861_FIXUP_NO_JACK_DETECT] = {
9486 .type = HDA_FIXUP_FUNC,
9487 .v.func = alc_fixup_no_jack_detect,
9489 [ALC861_FIXUP_ASUS_A6RP] = {
9490 .type = HDA_FIXUP_FUNC,
9491 .v.func = alc861_fixup_asus_amp_vref_0f,
9493 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
9495 [ALC660_FIXUP_ASUS_W7J] = {
9496 .type = HDA_FIXUP_VERBS,
9497 .v.verbs = (const struct hda_verb[]) {
9498 /* ASUS W7J needs a magic pin setup on unused NID 0x10
9499 * for enabling outputs
9501 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
9507 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
9508 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
9509 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
9510 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
9511 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
9512 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
9513 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
9514 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
9520 static int patch_alc861(struct hda_codec *codec)
9522 struct alc_spec *spec;
9525 err = alc_alloc_spec(codec, 0x15);
9530 if (has_cdefine_beep(codec))
9531 spec->gen.beep_nid = 0x23;
9534 spec->power_hook = alc_power_eapd;
9537 alc_pre_init(codec);
9539 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
9540 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9542 /* automatic parse from the BIOS config */
9543 err = alc861_parse_auto_config(codec);
9547 if (!spec->gen.no_analog) {
9548 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
9553 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9567 * In addition, an independent DAC
9569 static int alc861vd_parse_auto_config(struct hda_codec *codec)
9571 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
9572 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9573 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
9577 ALC660VD_FIX_ASUS_GPIO1,
9578 ALC861VD_FIX_DALLAS,
9581 /* exclude VREF80 */
9582 static void alc861vd_fixup_dallas(struct hda_codec *codec,
9583 const struct hda_fixup *fix, int action)
9585 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9586 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
9587 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
9592 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
9593 const struct hda_fixup *fix, int action)
9595 struct alc_spec *spec = codec->spec;
9597 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9598 spec->gpio_mask |= 0x02;
9599 alc_fixup_gpio(codec, action, 0x01);
9602 static const struct hda_fixup alc861vd_fixups[] = {
9603 [ALC660VD_FIX_ASUS_GPIO1] = {
9604 .type = HDA_FIXUP_FUNC,
9605 .v.func = alc660vd_fixup_asus_gpio1,
9607 [ALC861VD_FIX_DALLAS] = {
9608 .type = HDA_FIXUP_FUNC,
9609 .v.func = alc861vd_fixup_dallas,
9613 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
9614 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
9615 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
9616 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
9622 static int patch_alc861vd(struct hda_codec *codec)
9624 struct alc_spec *spec;
9627 err = alc_alloc_spec(codec, 0x0b);
9632 if (has_cdefine_beep(codec))
9633 spec->gen.beep_nid = 0x23;
9635 spec->shutup = alc_eapd_shutup;
9637 alc_pre_init(codec);
9639 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
9640 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9642 /* automatic parse from the BIOS config */
9643 err = alc861vd_parse_auto_config(codec);
9647 if (!spec->gen.no_analog) {
9648 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9653 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9665 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
9666 * configuration. Each pin widget can choose any input DACs and a mixer.
9667 * Each ADC is connected from a mixer of all inputs. This makes possible
9668 * 6-channel independent captures.
9670 * In addition, an independent DAC for the multi-playback (not used in this
9675 * BIOS auto configuration
9678 static int alc662_parse_auto_config(struct hda_codec *codec)
9680 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
9681 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
9682 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9683 const hda_nid_t *ssids;
9685 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
9686 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
9687 codec->core.vendor_id == 0x10ec0671)
9688 ssids = alc663_ssids;
9690 ssids = alc662_ssids;
9691 return alc_parse_auto_config(codec, alc662_ignore, ssids);
9694 static void alc272_fixup_mario(struct hda_codec *codec,
9695 const struct hda_fixup *fix, int action)
9697 if (action != HDA_FIXUP_ACT_PRE_PROBE)
9699 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
9700 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
9701 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
9702 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
9703 (0 << AC_AMPCAP_MUTE_SHIFT)))
9704 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
9707 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
9709 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
9711 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
9712 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
9716 /* override the 2.1 chmap */
9717 static void alc_fixup_bass_chmap(struct hda_codec *codec,
9718 const struct hda_fixup *fix, int action)
9720 if (action == HDA_FIXUP_ACT_BUILD) {
9721 struct alc_spec *spec = codec->spec;
9722 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
9726 /* avoid D3 for keeping GPIO up */
9727 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
9729 unsigned int power_state)
9731 struct alc_spec *spec = codec->spec;
9732 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
9737 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
9738 const struct hda_fixup *fix, int action)
9740 struct alc_spec *spec = codec->spec;
9742 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
9743 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9744 spec->mute_led_polarity = 1;
9745 codec->power_filter = gpio_led_power_filter;
9749 static void alc662_usi_automute_hook(struct hda_codec *codec,
9750 struct hda_jack_callback *jack)
9752 struct alc_spec *spec = codec->spec;
9755 snd_hda_gen_hp_automute(codec, jack);
9757 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
9759 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
9763 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
9764 const struct hda_fixup *fix, int action)
9766 struct alc_spec *spec = codec->spec;
9767 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9768 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9769 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
9773 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
9774 struct hda_jack_callback *cb)
9776 /* surround speakers at 0x1b already get muted automatically when
9777 * headphones are plugged in, but we have to mute/unmute the remaining
9778 * channels manually:
9779 * 0x15 - front left/front right
9780 * 0x18 - front center/ LFE
9782 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
9783 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
9784 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
9786 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
9787 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
9791 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
9792 const struct hda_fixup *fix, int action)
9794 /* Pin 0x1b: shared headphones jack and surround speakers */
9795 if (!is_jack_detectable(codec, 0x1b))
9799 case HDA_FIXUP_ACT_PRE_PROBE:
9800 snd_hda_jack_detect_enable_callback(codec, 0x1b,
9801 alc662_aspire_ethos_mute_speakers);
9802 /* subwoofer needs an extra GPIO setting to become audible */
9803 alc_setup_gpio(codec, 0x02);
9805 case HDA_FIXUP_ACT_INIT:
9806 /* Make sure to start in a correct state, i.e. if
9807 * headphones have been plugged in before powering up the system
9809 alc662_aspire_ethos_mute_speakers(codec, NULL);
9814 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
9815 const struct hda_fixup *fix, int action)
9817 struct alc_spec *spec = codec->spec;
9819 static const struct hda_pintbl pincfgs[] = {
9820 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
9821 { 0x1b, 0x0181304f },
9826 case HDA_FIXUP_ACT_PRE_PROBE:
9827 spec->gen.mixer_nid = 0;
9828 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9829 snd_hda_apply_pincfgs(codec, pincfgs);
9831 case HDA_FIXUP_ACT_INIT:
9832 alc_write_coef_idx(codec, 0x19, 0xa054);
9837 static const struct coef_fw alc668_coefs[] = {
9838 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
9839 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
9840 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
9841 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
9842 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
9843 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
9844 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
9845 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
9846 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
9847 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
9848 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
9849 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
9850 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
9851 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
9852 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
9853 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
9854 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
9855 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
9856 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
9857 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
9861 static void alc668_restore_default_value(struct hda_codec *codec)
9863 alc_process_coef_fw(codec, alc668_coefs);
9867 ALC662_FIXUP_ASPIRE,
9868 ALC662_FIXUP_LED_GPIO1,
9869 ALC662_FIXUP_IDEAPAD,
9871 ALC662_FIXUP_CZC_ET26,
9872 ALC662_FIXUP_CZC_P10T,
9873 ALC662_FIXUP_SKU_IGNORE,
9874 ALC662_FIXUP_HP_RP5800,
9875 ALC662_FIXUP_ASUS_MODE1,
9876 ALC662_FIXUP_ASUS_MODE2,
9877 ALC662_FIXUP_ASUS_MODE3,
9878 ALC662_FIXUP_ASUS_MODE4,
9879 ALC662_FIXUP_ASUS_MODE5,
9880 ALC662_FIXUP_ASUS_MODE6,
9881 ALC662_FIXUP_ASUS_MODE7,
9882 ALC662_FIXUP_ASUS_MODE8,
9883 ALC662_FIXUP_NO_JACK_DETECT,
9884 ALC662_FIXUP_ZOTAC_Z68,
9885 ALC662_FIXUP_INV_DMIC,
9886 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9887 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
9888 ALC662_FIXUP_HEADSET_MODE,
9889 ALC668_FIXUP_HEADSET_MODE,
9890 ALC662_FIXUP_BASS_MODE4_CHMAP,
9891 ALC662_FIXUP_BASS_16,
9892 ALC662_FIXUP_BASS_1A,
9893 ALC662_FIXUP_BASS_CHMAP,
9894 ALC668_FIXUP_AUTO_MUTE,
9895 ALC668_FIXUP_DELL_DISABLE_AAMIX,
9896 ALC668_FIXUP_DELL_XPS13,
9897 ALC662_FIXUP_ASUS_Nx50,
9898 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9899 ALC668_FIXUP_ASUS_Nx51,
9900 ALC668_FIXUP_MIC_COEF,
9901 ALC668_FIXUP_ASUS_G751,
9902 ALC891_FIXUP_HEADSET_MODE,
9903 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9904 ALC662_FIXUP_ACER_VERITON,
9905 ALC892_FIXUP_ASROCK_MOBO,
9906 ALC662_FIXUP_USI_FUNC,
9907 ALC662_FIXUP_USI_HEADSET_MODE,
9908 ALC662_FIXUP_LENOVO_MULTI_CODECS,
9909 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
9910 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
9911 ALC671_FIXUP_HP_HEADSET_MIC2,
9912 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
9913 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
9916 static const struct hda_fixup alc662_fixups[] = {
9917 [ALC662_FIXUP_ASPIRE] = {
9918 .type = HDA_FIXUP_PINS,
9919 .v.pins = (const struct hda_pintbl[]) {
9920 { 0x15, 0x99130112 }, /* subwoofer */
9924 [ALC662_FIXUP_LED_GPIO1] = {
9925 .type = HDA_FIXUP_FUNC,
9926 .v.func = alc662_fixup_led_gpio1,
9928 [ALC662_FIXUP_IDEAPAD] = {
9929 .type = HDA_FIXUP_PINS,
9930 .v.pins = (const struct hda_pintbl[]) {
9931 { 0x17, 0x99130112 }, /* subwoofer */
9935 .chain_id = ALC662_FIXUP_LED_GPIO1,
9937 [ALC272_FIXUP_MARIO] = {
9938 .type = HDA_FIXUP_FUNC,
9939 .v.func = alc272_fixup_mario,
9941 [ALC662_FIXUP_CZC_ET26] = {
9942 .type = HDA_FIXUP_PINS,
9943 .v.pins = (const struct hda_pintbl[]) {
9945 {0x14, 0x90170110}, /* speaker */
9948 {0x18, 0x01a19030}, /* mic */
9949 {0x19, 0x90a7013f}, /* int-mic */
9958 .chain_id = ALC662_FIXUP_SKU_IGNORE
9960 [ALC662_FIXUP_CZC_P10T] = {
9961 .type = HDA_FIXUP_VERBS,
9962 .v.verbs = (const struct hda_verb[]) {
9963 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
9967 [ALC662_FIXUP_SKU_IGNORE] = {
9968 .type = HDA_FIXUP_FUNC,
9969 .v.func = alc_fixup_sku_ignore,
9971 [ALC662_FIXUP_HP_RP5800] = {
9972 .type = HDA_FIXUP_PINS,
9973 .v.pins = (const struct hda_pintbl[]) {
9974 { 0x14, 0x0221201f }, /* HP out */
9978 .chain_id = ALC662_FIXUP_SKU_IGNORE
9980 [ALC662_FIXUP_ASUS_MODE1] = {
9981 .type = HDA_FIXUP_PINS,
9982 .v.pins = (const struct hda_pintbl[]) {
9983 { 0x14, 0x99130110 }, /* speaker */
9984 { 0x18, 0x01a19c20 }, /* mic */
9985 { 0x19, 0x99a3092f }, /* int-mic */
9986 { 0x21, 0x0121401f }, /* HP out */
9990 .chain_id = ALC662_FIXUP_SKU_IGNORE
9992 [ALC662_FIXUP_ASUS_MODE2] = {
9993 .type = HDA_FIXUP_PINS,
9994 .v.pins = (const struct hda_pintbl[]) {
9995 { 0x14, 0x99130110 }, /* speaker */
9996 { 0x18, 0x01a19820 }, /* mic */
9997 { 0x19, 0x99a3092f }, /* int-mic */
9998 { 0x1b, 0x0121401f }, /* HP out */
10002 .chain_id = ALC662_FIXUP_SKU_IGNORE
10004 [ALC662_FIXUP_ASUS_MODE3] = {
10005 .type = HDA_FIXUP_PINS,
10006 .v.pins = (const struct hda_pintbl[]) {
10007 { 0x14, 0x99130110 }, /* speaker */
10008 { 0x15, 0x0121441f }, /* HP */
10009 { 0x18, 0x01a19840 }, /* mic */
10010 { 0x19, 0x99a3094f }, /* int-mic */
10011 { 0x21, 0x01211420 }, /* HP2 */
10015 .chain_id = ALC662_FIXUP_SKU_IGNORE
10017 [ALC662_FIXUP_ASUS_MODE4] = {
10018 .type = HDA_FIXUP_PINS,
10019 .v.pins = (const struct hda_pintbl[]) {
10020 { 0x14, 0x99130110 }, /* speaker */
10021 { 0x16, 0x99130111 }, /* speaker */
10022 { 0x18, 0x01a19840 }, /* mic */
10023 { 0x19, 0x99a3094f }, /* int-mic */
10024 { 0x21, 0x0121441f }, /* HP */
10028 .chain_id = ALC662_FIXUP_SKU_IGNORE
10030 [ALC662_FIXUP_ASUS_MODE5] = {
10031 .type = HDA_FIXUP_PINS,
10032 .v.pins = (const struct hda_pintbl[]) {
10033 { 0x14, 0x99130110 }, /* speaker */
10034 { 0x15, 0x0121441f }, /* HP */
10035 { 0x16, 0x99130111 }, /* speaker */
10036 { 0x18, 0x01a19840 }, /* mic */
10037 { 0x19, 0x99a3094f }, /* int-mic */
10041 .chain_id = ALC662_FIXUP_SKU_IGNORE
10043 [ALC662_FIXUP_ASUS_MODE6] = {
10044 .type = HDA_FIXUP_PINS,
10045 .v.pins = (const struct hda_pintbl[]) {
10046 { 0x14, 0x99130110 }, /* speaker */
10047 { 0x15, 0x01211420 }, /* HP2 */
10048 { 0x18, 0x01a19840 }, /* mic */
10049 { 0x19, 0x99a3094f }, /* int-mic */
10050 { 0x1b, 0x0121441f }, /* HP */
10054 .chain_id = ALC662_FIXUP_SKU_IGNORE
10056 [ALC662_FIXUP_ASUS_MODE7] = {
10057 .type = HDA_FIXUP_PINS,
10058 .v.pins = (const struct hda_pintbl[]) {
10059 { 0x14, 0x99130110 }, /* speaker */
10060 { 0x17, 0x99130111 }, /* speaker */
10061 { 0x18, 0x01a19840 }, /* mic */
10062 { 0x19, 0x99a3094f }, /* int-mic */
10063 { 0x1b, 0x01214020 }, /* HP */
10064 { 0x21, 0x0121401f }, /* HP */
10068 .chain_id = ALC662_FIXUP_SKU_IGNORE
10070 [ALC662_FIXUP_ASUS_MODE8] = {
10071 .type = HDA_FIXUP_PINS,
10072 .v.pins = (const struct hda_pintbl[]) {
10073 { 0x14, 0x99130110 }, /* speaker */
10074 { 0x12, 0x99a30970 }, /* int-mic */
10075 { 0x15, 0x01214020 }, /* HP */
10076 { 0x17, 0x99130111 }, /* speaker */
10077 { 0x18, 0x01a19840 }, /* mic */
10078 { 0x21, 0x0121401f }, /* HP */
10082 .chain_id = ALC662_FIXUP_SKU_IGNORE
10084 [ALC662_FIXUP_NO_JACK_DETECT] = {
10085 .type = HDA_FIXUP_FUNC,
10086 .v.func = alc_fixup_no_jack_detect,
10088 [ALC662_FIXUP_ZOTAC_Z68] = {
10089 .type = HDA_FIXUP_PINS,
10090 .v.pins = (const struct hda_pintbl[]) {
10091 { 0x1b, 0x02214020 }, /* Front HP */
10095 [ALC662_FIXUP_INV_DMIC] = {
10096 .type = HDA_FIXUP_FUNC,
10097 .v.func = alc_fixup_inv_dmic,
10099 [ALC668_FIXUP_DELL_XPS13] = {
10100 .type = HDA_FIXUP_FUNC,
10101 .v.func = alc_fixup_dell_xps13,
10103 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10105 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10106 .type = HDA_FIXUP_FUNC,
10107 .v.func = alc_fixup_disable_aamix,
10109 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10111 [ALC668_FIXUP_AUTO_MUTE] = {
10112 .type = HDA_FIXUP_FUNC,
10113 .v.func = alc_fixup_auto_mute_via_amp,
10115 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10117 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10118 .type = HDA_FIXUP_PINS,
10119 .v.pins = (const struct hda_pintbl[]) {
10120 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10121 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10125 .chain_id = ALC662_FIXUP_HEADSET_MODE
10127 [ALC662_FIXUP_HEADSET_MODE] = {
10128 .type = HDA_FIXUP_FUNC,
10129 .v.func = alc_fixup_headset_mode_alc662,
10131 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10132 .type = HDA_FIXUP_PINS,
10133 .v.pins = (const struct hda_pintbl[]) {
10134 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10135 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10139 .chain_id = ALC668_FIXUP_HEADSET_MODE
10141 [ALC668_FIXUP_HEADSET_MODE] = {
10142 .type = HDA_FIXUP_FUNC,
10143 .v.func = alc_fixup_headset_mode_alc668,
10145 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10146 .type = HDA_FIXUP_FUNC,
10147 .v.func = alc_fixup_bass_chmap,
10149 .chain_id = ALC662_FIXUP_ASUS_MODE4
10151 [ALC662_FIXUP_BASS_16] = {
10152 .type = HDA_FIXUP_PINS,
10153 .v.pins = (const struct hda_pintbl[]) {
10154 {0x16, 0x80106111}, /* bass speaker */
10158 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10160 [ALC662_FIXUP_BASS_1A] = {
10161 .type = HDA_FIXUP_PINS,
10162 .v.pins = (const struct hda_pintbl[]) {
10163 {0x1a, 0x80106111}, /* bass speaker */
10167 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10169 [ALC662_FIXUP_BASS_CHMAP] = {
10170 .type = HDA_FIXUP_FUNC,
10171 .v.func = alc_fixup_bass_chmap,
10173 [ALC662_FIXUP_ASUS_Nx50] = {
10174 .type = HDA_FIXUP_FUNC,
10175 .v.func = alc_fixup_auto_mute_via_amp,
10177 .chain_id = ALC662_FIXUP_BASS_1A
10179 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10180 .type = HDA_FIXUP_FUNC,
10181 .v.func = alc_fixup_headset_mode_alc668,
10182 .chain_id = ALC662_FIXUP_BASS_CHMAP
10184 [ALC668_FIXUP_ASUS_Nx51] = {
10185 .type = HDA_FIXUP_PINS,
10186 .v.pins = (const struct hda_pintbl[]) {
10187 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10188 { 0x1a, 0x90170151 }, /* bass speaker */
10189 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10193 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10195 [ALC668_FIXUP_MIC_COEF] = {
10196 .type = HDA_FIXUP_VERBS,
10197 .v.verbs = (const struct hda_verb[]) {
10198 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10199 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10203 [ALC668_FIXUP_ASUS_G751] = {
10204 .type = HDA_FIXUP_PINS,
10205 .v.pins = (const struct hda_pintbl[]) {
10206 { 0x16, 0x0421101f }, /* HP */
10210 .chain_id = ALC668_FIXUP_MIC_COEF
10212 [ALC891_FIXUP_HEADSET_MODE] = {
10213 .type = HDA_FIXUP_FUNC,
10214 .v.func = alc_fixup_headset_mode,
10216 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10217 .type = HDA_FIXUP_PINS,
10218 .v.pins = (const struct hda_pintbl[]) {
10219 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10220 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10224 .chain_id = ALC891_FIXUP_HEADSET_MODE
10226 [ALC662_FIXUP_ACER_VERITON] = {
10227 .type = HDA_FIXUP_PINS,
10228 .v.pins = (const struct hda_pintbl[]) {
10229 { 0x15, 0x50170120 }, /* no internal speaker */
10233 [ALC892_FIXUP_ASROCK_MOBO] = {
10234 .type = HDA_FIXUP_PINS,
10235 .v.pins = (const struct hda_pintbl[]) {
10236 { 0x15, 0x40f000f0 }, /* disabled */
10237 { 0x16, 0x40f000f0 }, /* disabled */
10241 [ALC662_FIXUP_USI_FUNC] = {
10242 .type = HDA_FIXUP_FUNC,
10243 .v.func = alc662_fixup_usi_headset_mic,
10245 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10246 .type = HDA_FIXUP_PINS,
10247 .v.pins = (const struct hda_pintbl[]) {
10248 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10249 { 0x18, 0x01a1903d },
10253 .chain_id = ALC662_FIXUP_USI_FUNC
10255 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10256 .type = HDA_FIXUP_FUNC,
10257 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10259 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10260 .type = HDA_FIXUP_FUNC,
10261 .v.func = alc662_fixup_aspire_ethos_hp,
10263 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10264 .type = HDA_FIXUP_PINS,
10265 .v.pins = (const struct hda_pintbl[]) {
10266 { 0x15, 0x92130110 }, /* front speakers */
10267 { 0x18, 0x99130111 }, /* center/subwoofer */
10268 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10272 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
10274 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10275 .type = HDA_FIXUP_FUNC,
10276 .v.func = alc671_fixup_hp_headset_mic2,
10278 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10279 .type = HDA_FIXUP_PINS,
10280 .v.pins = (const struct hda_pintbl[]) {
10281 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10285 .chain_id = ALC662_FIXUP_USI_FUNC
10287 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10288 .type = HDA_FIXUP_PINS,
10289 .v.pins = (const struct hda_pintbl[]) {
10290 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10291 { 0x1b, 0x0221144f },
10295 .chain_id = ALC662_FIXUP_USI_FUNC
10299 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
10300 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
10301 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
10302 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
10303 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
10304 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
10305 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
10306 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
10307 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
10308 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
10309 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
10310 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
10311 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10312 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10313 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
10314 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
10315 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
10316 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10317 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10318 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10319 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10320 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10321 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
10322 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
10323 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
10324 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
10325 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
10326 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
10327 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
10328 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10329 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
10330 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
10331 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
10332 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
10333 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
10334 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10335 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
10336 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
10337 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
10338 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
10339 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
10340 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
10341 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
10342 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
10343 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
10344 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
10345 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
10346 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
10349 /* Below is a quirk table taken from the old code.
10350 * Basically the device should work as is without the fixup table.
10351 * If BIOS doesn't give a proper info, enable the corresponding
10354 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
10355 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
10356 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
10357 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
10358 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10359 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10360 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10361 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
10362 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
10363 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10364 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
10365 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
10366 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
10367 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
10368 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
10369 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10370 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
10371 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
10372 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10373 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10374 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10375 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10376 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
10377 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
10378 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
10379 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10380 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
10381 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10382 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10383 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
10384 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10385 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10386 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
10387 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
10388 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
10389 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
10390 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
10391 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
10392 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
10393 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10394 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
10395 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
10396 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10397 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
10398 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
10399 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
10400 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
10401 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
10402 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10403 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
10408 static const struct hda_model_fixup alc662_fixup_models[] = {
10409 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
10410 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
10411 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
10412 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
10413 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
10414 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
10415 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
10416 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
10417 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
10418 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
10419 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
10420 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
10421 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
10422 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
10423 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
10424 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10425 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
10426 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
10427 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
10428 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
10429 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
10430 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
10431 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
10432 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
10433 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
10434 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
10435 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
10436 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
10437 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
10438 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
10439 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10440 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
10444 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
10445 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10446 {0x17, 0x02211010},
10447 {0x18, 0x01a19030},
10448 {0x1a, 0x01813040},
10449 {0x21, 0x01014020}),
10450 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10451 {0x16, 0x01813030},
10452 {0x17, 0x02211010},
10453 {0x18, 0x01a19040},
10454 {0x21, 0x01014020}),
10455 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10456 {0x14, 0x01014010},
10457 {0x18, 0x01a19020},
10458 {0x1a, 0x0181302f},
10459 {0x1b, 0x0221401f}),
10460 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10461 {0x12, 0x99a30130},
10462 {0x14, 0x90170110},
10463 {0x15, 0x0321101f},
10464 {0x16, 0x03011020}),
10465 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10466 {0x12, 0x99a30140},
10467 {0x14, 0x90170110},
10468 {0x15, 0x0321101f},
10469 {0x16, 0x03011020}),
10470 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10471 {0x12, 0x99a30150},
10472 {0x14, 0x90170110},
10473 {0x15, 0x0321101f},
10474 {0x16, 0x03011020}),
10475 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10476 {0x14, 0x90170110},
10477 {0x15, 0x0321101f},
10478 {0x16, 0x03011020}),
10479 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
10480 {0x12, 0x90a60130},
10481 {0x14, 0x90170110},
10482 {0x15, 0x0321101f}),
10483 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10484 {0x14, 0x01014010},
10485 {0x17, 0x90170150},
10486 {0x19, 0x02a11060},
10487 {0x1b, 0x01813030},
10488 {0x21, 0x02211020}),
10489 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10490 {0x14, 0x01014010},
10491 {0x18, 0x01a19040},
10492 {0x1b, 0x01813030},
10493 {0x21, 0x02211020}),
10494 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10495 {0x14, 0x01014020},
10496 {0x17, 0x90170110},
10497 {0x18, 0x01a19050},
10498 {0x1b, 0x01813040},
10499 {0x21, 0x02211030}),
10505 static int patch_alc662(struct hda_codec *codec)
10507 struct alc_spec *spec;
10510 err = alc_alloc_spec(codec, 0x0b);
10514 spec = codec->spec;
10516 spec->shutup = alc_eapd_shutup;
10518 /* handle multiple HPs as is */
10519 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
10521 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10523 switch (codec->core.vendor_id) {
10525 spec->init_hook = alc668_restore_default_value;
10529 alc_pre_init(codec);
10531 snd_hda_pick_fixup(codec, alc662_fixup_models,
10532 alc662_fixup_tbl, alc662_fixups);
10533 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
10534 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10536 alc_auto_parse_customize_define(codec);
10538 if (has_cdefine_beep(codec))
10539 spec->gen.beep_nid = 0x01;
10541 if ((alc_get_coef0(codec) & (1 << 14)) &&
10542 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
10543 spec->cdefine.platform_type == 1) {
10544 err = alc_codec_rename(codec, "ALC272X");
10549 /* automatic parse from the BIOS config */
10550 err = alc662_parse_auto_config(codec);
10554 if (!spec->gen.no_analog && spec->gen.beep_nid) {
10555 switch (codec->core.vendor_id) {
10557 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10563 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
10566 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
10573 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10586 static int alc680_parse_auto_config(struct hda_codec *codec)
10588 return alc_parse_auto_config(codec, NULL, NULL);
10593 static int patch_alc680(struct hda_codec *codec)
10597 /* ALC680 has no aa-loopback mixer */
10598 err = alc_alloc_spec(codec, 0);
10602 /* automatic parse from the BIOS config */
10603 err = alc680_parse_auto_config(codec);
10615 static const struct hda_device_id snd_hda_id_realtek[] = {
10616 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
10617 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
10618 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
10619 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
10620 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
10621 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
10622 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
10623 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
10624 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
10625 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
10626 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
10627 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
10628 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
10629 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
10630 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
10631 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
10632 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
10633 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
10634 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
10635 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
10636 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
10637 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
10638 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
10639 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
10640 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
10641 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
10642 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
10643 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
10644 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
10645 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
10646 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
10647 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
10648 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
10649 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
10650 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
10651 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
10652 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
10653 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
10654 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
10655 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
10656 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
10657 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
10658 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
10659 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
10660 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
10661 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
10662 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
10663 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
10664 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
10665 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
10666 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
10667 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
10668 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
10669 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
10670 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
10671 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
10672 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
10673 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
10674 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
10675 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
10676 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
10677 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
10678 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
10679 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
10680 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
10681 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
10682 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
10683 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
10684 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
10685 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
10686 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
10687 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
10688 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
10689 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
10690 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
10691 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
10692 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
10693 {} /* terminator */
10695 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
10697 MODULE_LICENSE("GPL");
10698 MODULE_DESCRIPTION("Realtek HD-audio codec");
10700 static struct hda_codec_driver realtek_driver = {
10701 .id = snd_hda_id_realtek,
10704 module_hda_codec_driver(realtek_driver);