1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine;
82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
88 bool gpio_write_delay; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity;
92 int micmute_led_polarity;
93 hda_nid_t mute_led_nid;
94 hda_nid_t cap_mute_led_nid;
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
101 hda_nid_t headset_mic_pin;
102 hda_nid_t headphone_mic_pin;
103 int current_headset_mode;
104 int current_headset_type;
107 void (*init_hook)(struct hda_codec *codec);
109 void (*power_hook)(struct hda_codec *codec);
111 void (*shutup)(struct hda_codec *codec);
114 int codec_variant; /* flag for other variants */
115 unsigned int has_alc5505_dsp:1;
116 unsigned int no_depop_delay:1;
117 unsigned int done_hp_init:1;
118 unsigned int no_shutup_pins:1;
119 unsigned int ultra_low_power:1;
120 unsigned int has_hs_key:1;
121 unsigned int no_internal_mic_pin:1;
125 unsigned int pll_coef_idx, pll_coef_bit;
127 struct input_dev *kb_dev;
128 u8 alc_mute_keycode_map[1];
132 * COEF access helper functions
135 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
136 unsigned int coef_idx)
140 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
141 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
145 #define alc_read_coef_idx(codec, coef_idx) \
146 alc_read_coefex_idx(codec, 0x20, coef_idx)
148 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
149 unsigned int coef_idx, unsigned int coef_val)
151 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
152 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
155 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
156 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
158 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
159 unsigned int coef_idx, unsigned int mask,
160 unsigned int bits_set)
162 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
165 alc_write_coefex_idx(codec, nid, coef_idx,
166 (val & ~mask) | bits_set);
169 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
170 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
172 /* a special bypass for COEF 0; read the cached value at the second time */
173 static unsigned int alc_get_coef0(struct hda_codec *codec)
175 struct alc_spec *spec = codec->spec;
178 spec->coef0 = alc_read_coef_idx(codec, 0);
182 /* coef writes/updates batch */
190 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
191 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
192 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
193 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
194 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
196 static void alc_process_coef_fw(struct hda_codec *codec,
197 const struct coef_fw *fw)
199 for (; fw->nid; fw++) {
200 if (fw->mask == (unsigned short)-1)
201 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
203 alc_update_coefex_idx(codec, fw->nid, fw->idx,
209 * GPIO setup tables, used in initialization
212 /* Enable GPIO mask and set output */
213 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
215 struct alc_spec *spec = codec->spec;
217 spec->gpio_mask |= mask;
218 spec->gpio_dir |= mask;
219 spec->gpio_data |= mask;
222 static void alc_write_gpio_data(struct hda_codec *codec)
224 struct alc_spec *spec = codec->spec;
226 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
230 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
233 struct alc_spec *spec = codec->spec;
234 unsigned int oldval = spec->gpio_data;
237 spec->gpio_data |= mask;
239 spec->gpio_data &= ~mask;
240 if (oldval != spec->gpio_data)
241 alc_write_gpio_data(codec);
244 static void alc_write_gpio(struct hda_codec *codec)
246 struct alc_spec *spec = codec->spec;
248 if (!spec->gpio_mask)
251 snd_hda_codec_write(codec, codec->core.afg, 0,
252 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
253 snd_hda_codec_write(codec, codec->core.afg, 0,
254 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
255 if (spec->gpio_write_delay)
257 alc_write_gpio_data(codec);
260 static void alc_fixup_gpio(struct hda_codec *codec, int action,
263 if (action == HDA_FIXUP_ACT_PRE_PROBE)
264 alc_setup_gpio(codec, mask);
267 static void alc_fixup_gpio1(struct hda_codec *codec,
268 const struct hda_fixup *fix, int action)
270 alc_fixup_gpio(codec, action, 0x01);
273 static void alc_fixup_gpio2(struct hda_codec *codec,
274 const struct hda_fixup *fix, int action)
276 alc_fixup_gpio(codec, action, 0x02);
279 static void alc_fixup_gpio3(struct hda_codec *codec,
280 const struct hda_fixup *fix, int action)
282 alc_fixup_gpio(codec, action, 0x03);
285 static void alc_fixup_gpio4(struct hda_codec *codec,
286 const struct hda_fixup *fix, int action)
288 alc_fixup_gpio(codec, action, 0x04);
291 static void alc_fixup_micmute_led(struct hda_codec *codec,
292 const struct hda_fixup *fix, int action)
294 if (action == HDA_FIXUP_ACT_PRE_PROBE)
295 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
299 * Fix hardware PLL issue
300 * On some codecs, the analog PLL gating control must be off while
301 * the default value is 1.
303 static void alc_fix_pll(struct hda_codec *codec)
305 struct alc_spec *spec = codec->spec;
308 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
309 1 << spec->pll_coef_bit, 0);
312 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
313 unsigned int coef_idx, unsigned int coef_bit)
315 struct alc_spec *spec = codec->spec;
317 spec->pll_coef_idx = coef_idx;
318 spec->pll_coef_bit = coef_bit;
322 /* update the master volume per volume-knob's unsol event */
323 static void alc_update_knob_master(struct hda_codec *codec,
324 struct hda_jack_callback *jack)
327 struct snd_kcontrol *kctl;
328 struct snd_ctl_elem_value *uctl;
330 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
333 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
336 val = snd_hda_codec_read(codec, jack->nid, 0,
337 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
338 val &= HDA_AMP_VOLMASK;
339 uctl->value.integer.value[0] = val;
340 uctl->value.integer.value[1] = val;
341 kctl->put(kctl, uctl);
345 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
347 /* For some reason, the res given from ALC880 is broken.
348 Here we adjust it properly. */
349 snd_hda_jack_unsol_event(codec, res >> 2);
352 /* Change EAPD to verb control */
353 static void alc_fill_eapd_coef(struct hda_codec *codec)
357 coef = alc_get_coef0(codec);
359 switch (codec->core.vendor_id) {
361 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
365 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
368 if ((coef & 0x00f0) == 0x0010)
369 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
370 if ((coef & 0x00f0) == 0x0020)
371 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
372 if ((coef & 0x00f0) == 0x0030)
373 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
379 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
384 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
403 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
406 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
409 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
410 alc_write_coef_idx(codec, 0x8, 0x4ab7);
413 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
422 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
425 if ((coef & 0x00f0) == 0x0030)
426 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
435 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
439 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
442 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
445 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
448 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
449 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
453 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
460 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
465 /* additional initialization for ALC888 variants */
466 static void alc888_coef_init(struct hda_codec *codec)
468 switch (alc_get_coef0(codec) & 0x00f0) {
473 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
478 /* turn on/off EAPD control (only if available) */
479 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
481 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
483 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
484 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
488 /* turn on/off EAPD controls of the codec */
489 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
491 /* We currently only handle front, HP */
492 static const hda_nid_t pins[] = {
493 0x0f, 0x10, 0x14, 0x15, 0x17, 0
496 for (p = pins; *p; p++)
497 set_eapd(codec, *p, on);
500 static int find_ext_mic_pin(struct hda_codec *codec);
502 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
504 const struct hda_pincfg *pin;
505 int mic_pin = find_ext_mic_pin(codec);
508 /* don't shut up pins when unloading the driver; otherwise it breaks
509 * the default pin setup at the next load of the driver
511 if (codec->bus->shutdown)
514 snd_array_for_each(&codec->init_pins, i, pin) {
515 /* use read here for syncing after issuing each verb */
516 if (pin->nid != mic_pin)
517 snd_hda_codec_read(codec, pin->nid, 0,
518 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
521 codec->pins_shutup = 1;
524 static void alc_shutup_pins(struct hda_codec *codec)
526 struct alc_spec *spec = codec->spec;
528 switch (codec->core.vendor_id) {
535 alc_headset_mic_no_shutup(codec);
538 if (!spec->no_shutup_pins)
539 snd_hda_shutup_pins(codec);
544 /* generic shutup callback;
545 * just turning off EAPD and a little pause for avoiding pop-noise
547 static void alc_eapd_shutup(struct hda_codec *codec)
549 struct alc_spec *spec = codec->spec;
551 alc_auto_setup_eapd(codec, false);
552 if (!spec->no_depop_delay)
554 alc_shutup_pins(codec);
557 /* generic EAPD initialization */
558 static void alc_auto_init_amp(struct hda_codec *codec, int type)
560 alc_auto_setup_eapd(codec, true);
561 alc_write_gpio(codec);
563 case ALC_INIT_DEFAULT:
564 switch (codec->core.vendor_id) {
566 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
572 alc_update_coef_idx(codec, 7, 0, 0x2030);
575 alc888_coef_init(codec);
582 /* get a primary headphone pin if available */
583 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
585 if (spec->gen.autocfg.hp_pins[0])
586 return spec->gen.autocfg.hp_pins[0];
587 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
588 return spec->gen.autocfg.line_out_pins[0];
593 * Realtek SSID verification
596 /* Could be any non-zero and even value. When used as fixup, tells
597 * the driver to ignore any present sku defines.
599 #define ALC_FIXUP_SKU_IGNORE (2)
601 static void alc_fixup_sku_ignore(struct hda_codec *codec,
602 const struct hda_fixup *fix, int action)
604 struct alc_spec *spec = codec->spec;
605 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
606 spec->cdefine.fixup = 1;
607 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
611 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
612 const struct hda_fixup *fix, int action)
614 struct alc_spec *spec = codec->spec;
616 if (action == HDA_FIXUP_ACT_PROBE) {
617 spec->no_depop_delay = 1;
618 codec->depop_delay = 0;
622 static int alc_auto_parse_customize_define(struct hda_codec *codec)
624 unsigned int ass, tmp, i;
626 struct alc_spec *spec = codec->spec;
628 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
630 if (spec->cdefine.fixup) {
631 ass = spec->cdefine.sku_cfg;
632 if (ass == ALC_FIXUP_SKU_IGNORE)
637 if (!codec->bus->pci)
639 ass = codec->core.subsystem_id & 0xffff;
640 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
644 if (codec->core.vendor_id == 0x10ec0260)
646 ass = snd_hda_codec_get_pincfg(codec, nid);
649 codec_info(codec, "%s: SKU not ready 0x%08x\n",
650 codec->core.chip_name, ass);
656 for (i = 1; i < 16; i++) {
660 if (((ass >> 16) & 0xf) != tmp)
663 spec->cdefine.port_connectivity = ass >> 30;
664 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
665 spec->cdefine.check_sum = (ass >> 16) & 0xf;
666 spec->cdefine.customization = ass >> 8;
668 spec->cdefine.sku_cfg = ass;
669 spec->cdefine.external_amp = (ass & 0x38) >> 3;
670 spec->cdefine.platform_type = (ass & 0x4) >> 2;
671 spec->cdefine.swap = (ass & 0x2) >> 1;
672 spec->cdefine.override = ass & 0x1;
674 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
675 nid, spec->cdefine.sku_cfg);
676 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
677 spec->cdefine.port_connectivity);
678 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
679 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
680 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
681 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
682 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
683 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
684 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
689 /* return the position of NID in the list, or -1 if not found */
690 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
693 for (i = 0; i < nums; i++)
698 /* return true if the given NID is found in the list */
699 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
701 return find_idx_in_nid_list(nid, list, nums) >= 0;
704 /* check subsystem ID and set up device-specific initialization;
705 * return 1 if initialized, 0 if invalid SSID
707 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
708 * 31 ~ 16 : Manufacture ID
710 * 7 ~ 0 : Assembly ID
711 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
713 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
715 unsigned int ass, tmp, i;
717 struct alc_spec *spec = codec->spec;
719 if (spec->cdefine.fixup) {
720 ass = spec->cdefine.sku_cfg;
721 if (ass == ALC_FIXUP_SKU_IGNORE)
726 ass = codec->core.subsystem_id & 0xffff;
727 if (codec->bus->pci &&
728 ass != codec->bus->pci->subsystem_device && (ass & 1))
731 /* invalid SSID, check the special NID pin defcfg instead */
733 * 31~30 : port connectivity
736 * 19~16 : Check sum (15:1)
741 if (codec->core.vendor_id == 0x10ec0260)
743 ass = snd_hda_codec_get_pincfg(codec, nid);
745 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
749 if ((ass >> 30) != 1) /* no physical connection */
754 for (i = 1; i < 16; i++) {
758 if (((ass >> 16) & 0xf) != tmp)
761 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
762 ass & 0xffff, codec->core.vendor_id);
766 * 2 : 0 --> Desktop, 1 --> Laptop
767 * 3~5 : External Amplifier control
770 tmp = (ass & 0x38) >> 3; /* external Amp control */
771 if (spec->init_amp == ALC_INIT_UNDEFINED) {
774 alc_setup_gpio(codec, 0x01);
777 alc_setup_gpio(codec, 0x02);
780 alc_setup_gpio(codec, 0x03);
784 spec->init_amp = ALC_INIT_DEFAULT;
789 /* is laptop or Desktop and enable the function "Mute internal speaker
790 * when the external headphone out jack is plugged"
795 * 10~8 : Jack location
796 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
798 * 15 : 1 --> enable the function "Mute internal speaker
799 * when the external headphone out jack is plugged"
801 if (!alc_get_hp_pin(spec)) {
803 tmp = (ass >> 11) & 0x3; /* HP to chassis */
805 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
806 spec->gen.autocfg.line_outs))
808 spec->gen.autocfg.hp_pins[0] = nid;
813 /* Check the validity of ALC subsystem-id
814 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
815 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
817 if (!alc_subsystem_id(codec, ports)) {
818 struct alc_spec *spec = codec->spec;
819 if (spec->init_amp == ALC_INIT_UNDEFINED) {
821 "realtek: Enable default setup for auto mode as fallback\n");
822 spec->init_amp = ALC_INIT_DEFAULT;
830 static void alc_fixup_inv_dmic(struct hda_codec *codec,
831 const struct hda_fixup *fix, int action)
833 struct alc_spec *spec = codec->spec;
835 spec->gen.inv_dmic_split = 1;
839 static int alc_build_controls(struct hda_codec *codec)
843 err = snd_hda_gen_build_controls(codec);
847 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
856 static void alc_pre_init(struct hda_codec *codec)
858 alc_fill_eapd_coef(codec);
861 #define is_s3_resume(codec) \
862 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
863 #define is_s4_resume(codec) \
864 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
866 static int alc_init(struct hda_codec *codec)
868 struct alc_spec *spec = codec->spec;
870 /* hibernation resume needs the full chip initialization */
871 if (is_s4_resume(codec))
875 spec->init_hook(codec);
877 spec->gen.skip_verbs = 1; /* applied in below */
878 snd_hda_gen_init(codec);
880 alc_auto_init_amp(codec, spec->init_amp);
881 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
883 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
888 static inline void alc_shutup(struct hda_codec *codec)
890 struct alc_spec *spec = codec->spec;
892 if (!snd_hda_get_bool_hint(codec, "shutup"))
893 return; /* disabled explicitly by hints */
895 if (spec && spec->shutup)
898 alc_shutup_pins(codec);
901 #define alc_free snd_hda_gen_free
904 static void alc_power_eapd(struct hda_codec *codec)
906 alc_auto_setup_eapd(codec, false);
909 static int alc_suspend(struct hda_codec *codec)
911 struct alc_spec *spec = codec->spec;
913 if (spec && spec->power_hook)
914 spec->power_hook(codec);
920 static int alc_resume(struct hda_codec *codec)
922 struct alc_spec *spec = codec->spec;
924 if (!spec->no_depop_delay)
925 msleep(150); /* to avoid pop noise */
926 codec->patch_ops.init(codec);
927 snd_hda_regmap_sync(codec);
928 hda_call_check_power_status(codec, 0x01);
935 static const struct hda_codec_ops alc_patch_ops = {
936 .build_controls = alc_build_controls,
937 .build_pcms = snd_hda_gen_build_pcms,
940 .unsol_event = snd_hda_jack_unsol_event,
942 .resume = alc_resume,
943 .suspend = alc_suspend,
944 .check_power_status = snd_hda_gen_check_power_status,
949 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
952 * Rename codecs appropriately from COEF value or subvendor id
954 struct alc_codec_rename_table {
955 unsigned int vendor_id;
956 unsigned short coef_mask;
957 unsigned short coef_bits;
961 struct alc_codec_rename_pci_table {
962 unsigned int codec_vendor_id;
963 unsigned short pci_subvendor;
964 unsigned short pci_subdevice;
968 static const struct alc_codec_rename_table rename_tbl[] = {
969 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
970 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
971 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
972 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
973 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
974 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
975 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
976 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
977 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
978 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
979 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
980 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
981 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
982 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
983 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
984 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
985 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
989 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
990 { 0x10ec0280, 0x1028, 0, "ALC3220" },
991 { 0x10ec0282, 0x1028, 0, "ALC3221" },
992 { 0x10ec0283, 0x1028, 0, "ALC3223" },
993 { 0x10ec0288, 0x1028, 0, "ALC3263" },
994 { 0x10ec0292, 0x1028, 0, "ALC3226" },
995 { 0x10ec0293, 0x1028, 0, "ALC3235" },
996 { 0x10ec0255, 0x1028, 0, "ALC3234" },
997 { 0x10ec0668, 0x1028, 0, "ALC3661" },
998 { 0x10ec0275, 0x1028, 0, "ALC3260" },
999 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1000 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1001 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1002 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1003 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1004 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1005 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1006 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1007 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1008 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1009 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1010 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1011 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1012 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1013 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1014 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1015 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1016 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1017 { } /* terminator */
1020 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1022 const struct alc_codec_rename_table *p;
1023 const struct alc_codec_rename_pci_table *q;
1025 for (p = rename_tbl; p->vendor_id; p++) {
1026 if (p->vendor_id != codec->core.vendor_id)
1028 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1029 return alc_codec_rename(codec, p->name);
1032 if (!codec->bus->pci)
1034 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1035 if (q->codec_vendor_id != codec->core.vendor_id)
1037 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1039 if (!q->pci_subdevice ||
1040 q->pci_subdevice == codec->bus->pci->subsystem_device)
1041 return alc_codec_rename(codec, q->name);
1049 * Digital-beep handlers
1051 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1053 /* additional beep mixers; private_value will be overwritten */
1054 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1055 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1056 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1059 /* set up and create beep controls */
1060 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1063 struct snd_kcontrol_new *knew;
1064 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1067 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1068 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1069 &alc_beep_mixer[i]);
1072 knew->private_value = beep_amp;
1077 static const struct snd_pci_quirk beep_allow_list[] = {
1078 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1079 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1080 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1081 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1082 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1083 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1084 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1085 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1086 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1087 /* denylist -- no beep available */
1088 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1089 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1093 static inline int has_cdefine_beep(struct hda_codec *codec)
1095 struct alc_spec *spec = codec->spec;
1096 const struct snd_pci_quirk *q;
1097 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1100 return spec->cdefine.enable_pcbeep;
1103 #define set_beep_amp(spec, nid, idx, dir) 0
1104 #define has_cdefine_beep(codec) 0
1107 /* parse the BIOS configuration and set up the alc_spec */
1108 /* return 1 if successful, 0 if the proper config is not found,
1109 * or a negative error code
1111 static int alc_parse_auto_config(struct hda_codec *codec,
1112 const hda_nid_t *ignore_nids,
1113 const hda_nid_t *ssid_nids)
1115 struct alc_spec *spec = codec->spec;
1116 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1119 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1125 alc_ssid_check(codec, ssid_nids);
1127 err = snd_hda_gen_parse_auto_config(codec, cfg);
1134 /* common preparation job for alc_spec */
1135 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1137 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1143 snd_hda_gen_spec_init(&spec->gen);
1144 spec->gen.mixer_nid = mixer_nid;
1145 spec->gen.own_eapd_ctl = 1;
1146 codec->single_adc_amp = 1;
1147 /* FIXME: do we need this for all Realtek codec models? */
1148 codec->spdif_status_reset = 1;
1149 codec->forced_resume = 1;
1150 codec->patch_ops = alc_patch_ops;
1152 err = alc_codec_rename_from_preset(codec);
1160 static int alc880_parse_auto_config(struct hda_codec *codec)
1162 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1163 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1164 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1173 ALC880_FIXUP_MEDION_RIM,
1175 ALC880_FIXUP_LG_LW25,
1177 ALC880_FIXUP_EAPD_COEF,
1178 ALC880_FIXUP_TCL_S700,
1179 ALC880_FIXUP_VOL_KNOB,
1180 ALC880_FIXUP_FUJITSU,
1182 ALC880_FIXUP_UNIWILL,
1183 ALC880_FIXUP_UNIWILL_DIG,
1185 ALC880_FIXUP_ASUS_W5A,
1186 ALC880_FIXUP_3ST_BASE,
1188 ALC880_FIXUP_3ST_DIG,
1189 ALC880_FIXUP_5ST_BASE,
1191 ALC880_FIXUP_5ST_DIG,
1192 ALC880_FIXUP_6ST_BASE,
1194 ALC880_FIXUP_6ST_DIG,
1195 ALC880_FIXUP_6ST_AUTOMUTE,
1198 /* enable the volume-knob widget support on NID 0x21 */
1199 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1200 const struct hda_fixup *fix, int action)
1202 if (action == HDA_FIXUP_ACT_PROBE)
1203 snd_hda_jack_detect_enable_callback(codec, 0x21,
1204 alc_update_knob_master);
1207 static const struct hda_fixup alc880_fixups[] = {
1208 [ALC880_FIXUP_GPIO1] = {
1209 .type = HDA_FIXUP_FUNC,
1210 .v.func = alc_fixup_gpio1,
1212 [ALC880_FIXUP_GPIO2] = {
1213 .type = HDA_FIXUP_FUNC,
1214 .v.func = alc_fixup_gpio2,
1216 [ALC880_FIXUP_MEDION_RIM] = {
1217 .type = HDA_FIXUP_VERBS,
1218 .v.verbs = (const struct hda_verb[]) {
1219 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1220 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1224 .chain_id = ALC880_FIXUP_GPIO2,
1226 [ALC880_FIXUP_LG] = {
1227 .type = HDA_FIXUP_PINS,
1228 .v.pins = (const struct hda_pintbl[]) {
1229 /* disable bogus unused pins */
1230 { 0x16, 0x411111f0 },
1231 { 0x18, 0x411111f0 },
1232 { 0x1a, 0x411111f0 },
1236 [ALC880_FIXUP_LG_LW25] = {
1237 .type = HDA_FIXUP_PINS,
1238 .v.pins = (const struct hda_pintbl[]) {
1239 { 0x1a, 0x0181344f }, /* line-in */
1240 { 0x1b, 0x0321403f }, /* headphone */
1244 [ALC880_FIXUP_W810] = {
1245 .type = HDA_FIXUP_PINS,
1246 .v.pins = (const struct hda_pintbl[]) {
1247 /* disable bogus unused pins */
1248 { 0x17, 0x411111f0 },
1252 .chain_id = ALC880_FIXUP_GPIO2,
1254 [ALC880_FIXUP_EAPD_COEF] = {
1255 .type = HDA_FIXUP_VERBS,
1256 .v.verbs = (const struct hda_verb[]) {
1257 /* change to EAPD mode */
1258 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1259 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1263 [ALC880_FIXUP_TCL_S700] = {
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, 0x3070 },
1272 .chain_id = ALC880_FIXUP_GPIO2,
1274 [ALC880_FIXUP_VOL_KNOB] = {
1275 .type = HDA_FIXUP_FUNC,
1276 .v.func = alc880_fixup_vol_knob,
1278 [ALC880_FIXUP_FUJITSU] = {
1279 /* override all pins as BIOS on old Amilo is broken */
1280 .type = HDA_FIXUP_PINS,
1281 .v.pins = (const struct hda_pintbl[]) {
1282 { 0x14, 0x0121401f }, /* HP */
1283 { 0x15, 0x99030120 }, /* speaker */
1284 { 0x16, 0x99030130 }, /* bass speaker */
1285 { 0x17, 0x411111f0 }, /* N/A */
1286 { 0x18, 0x411111f0 }, /* N/A */
1287 { 0x19, 0x01a19950 }, /* mic-in */
1288 { 0x1a, 0x411111f0 }, /* N/A */
1289 { 0x1b, 0x411111f0 }, /* N/A */
1290 { 0x1c, 0x411111f0 }, /* N/A */
1291 { 0x1d, 0x411111f0 }, /* N/A */
1292 { 0x1e, 0x01454140 }, /* SPDIF out */
1296 .chain_id = ALC880_FIXUP_VOL_KNOB,
1298 [ALC880_FIXUP_F1734] = {
1299 /* almost compatible with FUJITSU, but no bass and SPDIF */
1300 .type = HDA_FIXUP_PINS,
1301 .v.pins = (const struct hda_pintbl[]) {
1302 { 0x14, 0x0121401f }, /* HP */
1303 { 0x15, 0x99030120 }, /* speaker */
1304 { 0x16, 0x411111f0 }, /* N/A */
1305 { 0x17, 0x411111f0 }, /* N/A */
1306 { 0x18, 0x411111f0 }, /* N/A */
1307 { 0x19, 0x01a19950 }, /* mic-in */
1308 { 0x1a, 0x411111f0 }, /* N/A */
1309 { 0x1b, 0x411111f0 }, /* N/A */
1310 { 0x1c, 0x411111f0 }, /* N/A */
1311 { 0x1d, 0x411111f0 }, /* N/A */
1312 { 0x1e, 0x411111f0 }, /* N/A */
1316 .chain_id = ALC880_FIXUP_VOL_KNOB,
1318 [ALC880_FIXUP_UNIWILL] = {
1319 /* need to fix HP and speaker pins to be parsed correctly */
1320 .type = HDA_FIXUP_PINS,
1321 .v.pins = (const struct hda_pintbl[]) {
1322 { 0x14, 0x0121411f }, /* HP */
1323 { 0x15, 0x99030120 }, /* speaker */
1324 { 0x16, 0x99030130 }, /* bass speaker */
1328 [ALC880_FIXUP_UNIWILL_DIG] = {
1329 .type = HDA_FIXUP_PINS,
1330 .v.pins = (const struct hda_pintbl[]) {
1331 /* disable bogus unused pins */
1332 { 0x17, 0x411111f0 },
1333 { 0x19, 0x411111f0 },
1334 { 0x1b, 0x411111f0 },
1335 { 0x1f, 0x411111f0 },
1339 [ALC880_FIXUP_Z71V] = {
1340 .type = HDA_FIXUP_PINS,
1341 .v.pins = (const struct hda_pintbl[]) {
1342 /* set up the whole pins as BIOS is utterly broken */
1343 { 0x14, 0x99030120 }, /* speaker */
1344 { 0x15, 0x0121411f }, /* HP */
1345 { 0x16, 0x411111f0 }, /* N/A */
1346 { 0x17, 0x411111f0 }, /* N/A */
1347 { 0x18, 0x01a19950 }, /* mic-in */
1348 { 0x19, 0x411111f0 }, /* N/A */
1349 { 0x1a, 0x01813031 }, /* line-in */
1350 { 0x1b, 0x411111f0 }, /* N/A */
1351 { 0x1c, 0x411111f0 }, /* N/A */
1352 { 0x1d, 0x411111f0 }, /* N/A */
1353 { 0x1e, 0x0144111e }, /* SPDIF */
1357 [ALC880_FIXUP_ASUS_W5A] = {
1358 .type = HDA_FIXUP_PINS,
1359 .v.pins = (const struct hda_pintbl[]) {
1360 /* set up the whole pins as BIOS is utterly broken */
1361 { 0x14, 0x0121411f }, /* HP */
1362 { 0x15, 0x411111f0 }, /* N/A */
1363 { 0x16, 0x411111f0 }, /* N/A */
1364 { 0x17, 0x411111f0 }, /* N/A */
1365 { 0x18, 0x90a60160 }, /* mic */
1366 { 0x19, 0x411111f0 }, /* N/A */
1367 { 0x1a, 0x411111f0 }, /* N/A */
1368 { 0x1b, 0x411111f0 }, /* N/A */
1369 { 0x1c, 0x411111f0 }, /* N/A */
1370 { 0x1d, 0x411111f0 }, /* N/A */
1371 { 0x1e, 0xb743111e }, /* SPDIF out */
1375 .chain_id = ALC880_FIXUP_GPIO1,
1377 [ALC880_FIXUP_3ST_BASE] = {
1378 .type = HDA_FIXUP_PINS,
1379 .v.pins = (const struct hda_pintbl[]) {
1380 { 0x14, 0x01014010 }, /* line-out */
1381 { 0x15, 0x411111f0 }, /* N/A */
1382 { 0x16, 0x411111f0 }, /* N/A */
1383 { 0x17, 0x411111f0 }, /* N/A */
1384 { 0x18, 0x01a19c30 }, /* mic-in */
1385 { 0x19, 0x0121411f }, /* HP */
1386 { 0x1a, 0x01813031 }, /* line-in */
1387 { 0x1b, 0x02a19c40 }, /* front-mic */
1388 { 0x1c, 0x411111f0 }, /* N/A */
1389 { 0x1d, 0x411111f0 }, /* N/A */
1390 /* 0x1e is filled in below */
1391 { 0x1f, 0x411111f0 }, /* N/A */
1395 [ALC880_FIXUP_3ST] = {
1396 .type = HDA_FIXUP_PINS,
1397 .v.pins = (const struct hda_pintbl[]) {
1398 { 0x1e, 0x411111f0 }, /* N/A */
1402 .chain_id = ALC880_FIXUP_3ST_BASE,
1404 [ALC880_FIXUP_3ST_DIG] = {
1405 .type = HDA_FIXUP_PINS,
1406 .v.pins = (const struct hda_pintbl[]) {
1407 { 0x1e, 0x0144111e }, /* SPDIF */
1411 .chain_id = ALC880_FIXUP_3ST_BASE,
1413 [ALC880_FIXUP_5ST_BASE] = {
1414 .type = HDA_FIXUP_PINS,
1415 .v.pins = (const struct hda_pintbl[]) {
1416 { 0x14, 0x01014010 }, /* front */
1417 { 0x15, 0x411111f0 }, /* N/A */
1418 { 0x16, 0x01011411 }, /* CLFE */
1419 { 0x17, 0x01016412 }, /* surr */
1420 { 0x18, 0x01a19c30 }, /* mic-in */
1421 { 0x19, 0x0121411f }, /* HP */
1422 { 0x1a, 0x01813031 }, /* line-in */
1423 { 0x1b, 0x02a19c40 }, /* front-mic */
1424 { 0x1c, 0x411111f0 }, /* N/A */
1425 { 0x1d, 0x411111f0 }, /* N/A */
1426 /* 0x1e is filled in below */
1427 { 0x1f, 0x411111f0 }, /* N/A */
1431 [ALC880_FIXUP_5ST] = {
1432 .type = HDA_FIXUP_PINS,
1433 .v.pins = (const struct hda_pintbl[]) {
1434 { 0x1e, 0x411111f0 }, /* N/A */
1438 .chain_id = ALC880_FIXUP_5ST_BASE,
1440 [ALC880_FIXUP_5ST_DIG] = {
1441 .type = HDA_FIXUP_PINS,
1442 .v.pins = (const struct hda_pintbl[]) {
1443 { 0x1e, 0x0144111e }, /* SPDIF */
1447 .chain_id = ALC880_FIXUP_5ST_BASE,
1449 [ALC880_FIXUP_6ST_BASE] = {
1450 .type = HDA_FIXUP_PINS,
1451 .v.pins = (const struct hda_pintbl[]) {
1452 { 0x14, 0x01014010 }, /* front */
1453 { 0x15, 0x01016412 }, /* surr */
1454 { 0x16, 0x01011411 }, /* CLFE */
1455 { 0x17, 0x01012414 }, /* side */
1456 { 0x18, 0x01a19c30 }, /* mic-in */
1457 { 0x19, 0x02a19c40 }, /* front-mic */
1458 { 0x1a, 0x01813031 }, /* line-in */
1459 { 0x1b, 0x0121411f }, /* HP */
1460 { 0x1c, 0x411111f0 }, /* N/A */
1461 { 0x1d, 0x411111f0 }, /* N/A */
1462 /* 0x1e is filled in below */
1463 { 0x1f, 0x411111f0 }, /* N/A */
1467 [ALC880_FIXUP_6ST] = {
1468 .type = HDA_FIXUP_PINS,
1469 .v.pins = (const struct hda_pintbl[]) {
1470 { 0x1e, 0x411111f0 }, /* N/A */
1474 .chain_id = ALC880_FIXUP_6ST_BASE,
1476 [ALC880_FIXUP_6ST_DIG] = {
1477 .type = HDA_FIXUP_PINS,
1478 .v.pins = (const struct hda_pintbl[]) {
1479 { 0x1e, 0x0144111e }, /* SPDIF */
1483 .chain_id = ALC880_FIXUP_6ST_BASE,
1485 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1486 .type = HDA_FIXUP_PINS,
1487 .v.pins = (const struct hda_pintbl[]) {
1488 { 0x1b, 0x0121401f }, /* HP with jack detect */
1491 .chained_before = true,
1492 .chain_id = ALC880_FIXUP_6ST_BASE,
1496 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1497 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1498 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1499 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1500 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1501 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1502 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1503 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1504 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1505 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1506 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1507 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1508 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1509 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1510 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1511 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1512 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1513 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1514 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1515 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1516 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1517 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1518 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1519 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1521 /* Below is the copied entries from alc880_quirks.c.
1522 * It's not quite sure whether BIOS sets the correct pin-config table
1523 * on these machines, thus they are kept to be compatible with
1524 * the old static quirks. Once when it's confirmed to work without
1525 * these overrides, it'd be better to remove.
1527 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1528 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1529 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1530 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1531 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1532 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1533 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1534 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1535 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1536 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1537 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1538 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1539 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1540 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1541 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1542 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1543 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1544 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1545 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1546 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1547 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1548 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1549 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1550 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1551 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1552 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1553 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1554 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1555 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1556 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1557 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1558 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1559 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1561 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1562 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1563 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1567 static const struct hda_model_fixup alc880_fixup_models[] = {
1568 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1569 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1570 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1571 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1572 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1573 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1574 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1580 * OK, here we have finally the patch for ALC880
1582 static int patch_alc880(struct hda_codec *codec)
1584 struct alc_spec *spec;
1587 err = alc_alloc_spec(codec, 0x0b);
1592 spec->gen.need_dac_fix = 1;
1593 spec->gen.beep_nid = 0x01;
1595 codec->patch_ops.unsol_event = alc880_unsol_event;
1597 alc_pre_init(codec);
1599 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1601 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1603 /* automatic parse from the BIOS config */
1604 err = alc880_parse_auto_config(codec);
1608 if (!spec->gen.no_analog) {
1609 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1614 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1627 static int alc260_parse_auto_config(struct hda_codec *codec)
1629 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1630 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1631 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1638 ALC260_FIXUP_HP_DC5750,
1639 ALC260_FIXUP_HP_PIN_0F,
1642 ALC260_FIXUP_GPIO1_TOGGLE,
1643 ALC260_FIXUP_REPLACER,
1644 ALC260_FIXUP_HP_B1900,
1646 ALC260_FIXUP_FSC_S7020,
1647 ALC260_FIXUP_FSC_S7020_JWSE,
1648 ALC260_FIXUP_VAIO_PINS,
1651 static void alc260_gpio1_automute(struct hda_codec *codec)
1653 struct alc_spec *spec = codec->spec;
1655 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1658 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1659 const struct hda_fixup *fix, int action)
1661 struct alc_spec *spec = codec->spec;
1662 if (action == HDA_FIXUP_ACT_PROBE) {
1663 /* although the machine has only one output pin, we need to
1664 * toggle GPIO1 according to the jack state
1666 spec->gen.automute_hook = alc260_gpio1_automute;
1667 spec->gen.detect_hp = 1;
1668 spec->gen.automute_speaker = 1;
1669 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1670 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1671 snd_hda_gen_hp_automute);
1672 alc_setup_gpio(codec, 0x01);
1676 static void alc260_fixup_kn1(struct hda_codec *codec,
1677 const struct hda_fixup *fix, int action)
1679 struct alc_spec *spec = codec->spec;
1680 static const struct hda_pintbl pincfgs[] = {
1681 { 0x0f, 0x02214000 }, /* HP/speaker */
1682 { 0x12, 0x90a60160 }, /* int mic */
1683 { 0x13, 0x02a19000 }, /* ext mic */
1684 { 0x18, 0x01446000 }, /* SPDIF out */
1685 /* disable bogus I/O pins */
1686 { 0x10, 0x411111f0 },
1687 { 0x11, 0x411111f0 },
1688 { 0x14, 0x411111f0 },
1689 { 0x15, 0x411111f0 },
1690 { 0x16, 0x411111f0 },
1691 { 0x17, 0x411111f0 },
1692 { 0x19, 0x411111f0 },
1697 case HDA_FIXUP_ACT_PRE_PROBE:
1698 snd_hda_apply_pincfgs(codec, pincfgs);
1699 spec->init_amp = ALC_INIT_NONE;
1704 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1705 const struct hda_fixup *fix, int action)
1707 struct alc_spec *spec = codec->spec;
1708 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1709 spec->init_amp = ALC_INIT_NONE;
1712 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1713 const struct hda_fixup *fix, int action)
1715 struct alc_spec *spec = codec->spec;
1716 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1717 spec->gen.add_jack_modes = 1;
1718 spec->gen.hp_mic = 1;
1722 static const struct hda_fixup alc260_fixups[] = {
1723 [ALC260_FIXUP_HP_DC5750] = {
1724 .type = HDA_FIXUP_PINS,
1725 .v.pins = (const struct hda_pintbl[]) {
1726 { 0x11, 0x90130110 }, /* speaker */
1730 [ALC260_FIXUP_HP_PIN_0F] = {
1731 .type = HDA_FIXUP_PINS,
1732 .v.pins = (const struct hda_pintbl[]) {
1733 { 0x0f, 0x01214000 }, /* HP */
1737 [ALC260_FIXUP_COEF] = {
1738 .type = HDA_FIXUP_VERBS,
1739 .v.verbs = (const struct hda_verb[]) {
1740 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1741 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1745 [ALC260_FIXUP_GPIO1] = {
1746 .type = HDA_FIXUP_FUNC,
1747 .v.func = alc_fixup_gpio1,
1749 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1750 .type = HDA_FIXUP_FUNC,
1751 .v.func = alc260_fixup_gpio1_toggle,
1753 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1755 [ALC260_FIXUP_REPLACER] = {
1756 .type = HDA_FIXUP_VERBS,
1757 .v.verbs = (const struct hda_verb[]) {
1758 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1759 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1763 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1765 [ALC260_FIXUP_HP_B1900] = {
1766 .type = HDA_FIXUP_FUNC,
1767 .v.func = alc260_fixup_gpio1_toggle,
1769 .chain_id = ALC260_FIXUP_COEF,
1771 [ALC260_FIXUP_KN1] = {
1772 .type = HDA_FIXUP_FUNC,
1773 .v.func = alc260_fixup_kn1,
1775 [ALC260_FIXUP_FSC_S7020] = {
1776 .type = HDA_FIXUP_FUNC,
1777 .v.func = alc260_fixup_fsc_s7020,
1779 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1780 .type = HDA_FIXUP_FUNC,
1781 .v.func = alc260_fixup_fsc_s7020_jwse,
1783 .chain_id = ALC260_FIXUP_FSC_S7020,
1785 [ALC260_FIXUP_VAIO_PINS] = {
1786 .type = HDA_FIXUP_PINS,
1787 .v.pins = (const struct hda_pintbl[]) {
1788 /* Pin configs are missing completely on some VAIOs */
1789 { 0x0f, 0x01211020 },
1790 { 0x10, 0x0001003f },
1791 { 0x11, 0x411111f0 },
1792 { 0x12, 0x01a15930 },
1793 { 0x13, 0x411111f0 },
1794 { 0x14, 0x411111f0 },
1795 { 0x15, 0x411111f0 },
1796 { 0x16, 0x411111f0 },
1797 { 0x17, 0x411111f0 },
1798 { 0x18, 0x411111f0 },
1799 { 0x19, 0x411111f0 },
1805 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1806 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1807 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1808 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1809 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1810 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1811 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1812 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1813 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1814 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1815 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1816 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1817 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1821 static const struct hda_model_fixup alc260_fixup_models[] = {
1822 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1823 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1824 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1825 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1831 static int patch_alc260(struct hda_codec *codec)
1833 struct alc_spec *spec;
1836 err = alc_alloc_spec(codec, 0x07);
1841 /* as quite a few machines require HP amp for speaker outputs,
1842 * it's easier to enable it unconditionally; even if it's unneeded,
1843 * it's almost harmless.
1845 spec->gen.prefer_hp_amp = 1;
1846 spec->gen.beep_nid = 0x01;
1848 spec->shutup = alc_eapd_shutup;
1850 alc_pre_init(codec);
1852 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1854 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1856 /* automatic parse from the BIOS config */
1857 err = alc260_parse_auto_config(codec);
1861 if (!spec->gen.no_analog) {
1862 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1867 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1878 * ALC882/883/885/888/889 support
1880 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1881 * configuration. Each pin widget can choose any input DACs and a mixer.
1882 * Each ADC is connected from a mixer of all inputs. This makes possible
1883 * 6-channel independent captures.
1885 * In addition, an independent DAC for the multi-playback (not used in this
1893 ALC882_FIXUP_ABIT_AW9D_MAX,
1894 ALC882_FIXUP_LENOVO_Y530,
1895 ALC882_FIXUP_PB_M5210,
1896 ALC882_FIXUP_ACER_ASPIRE_7736,
1897 ALC882_FIXUP_ASUS_W90V,
1899 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1900 ALC889_FIXUP_VAIO_TT,
1901 ALC888_FIXUP_EEE1601,
1905 ALC883_FIXUP_ACER_EAPD,
1910 ALC882_FIXUP_ASUS_W2JC,
1911 ALC882_FIXUP_ACER_ASPIRE_4930G,
1912 ALC882_FIXUP_ACER_ASPIRE_8930G,
1913 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1914 ALC885_FIXUP_MACPRO_GPIO,
1915 ALC889_FIXUP_DAC_ROUTE,
1916 ALC889_FIXUP_MBP_VREF,
1917 ALC889_FIXUP_IMAC91_VREF,
1918 ALC889_FIXUP_MBA11_VREF,
1919 ALC889_FIXUP_MBA21_VREF,
1920 ALC889_FIXUP_MP11_VREF,
1921 ALC889_FIXUP_MP41_VREF,
1922 ALC882_FIXUP_INV_DMIC,
1923 ALC882_FIXUP_NO_PRIMARY_HP,
1924 ALC887_FIXUP_ASUS_BASS,
1925 ALC887_FIXUP_BASS_CHMAP,
1926 ALC1220_FIXUP_GB_DUAL_CODECS,
1927 ALC1220_FIXUP_GB_X570,
1928 ALC1220_FIXUP_CLEVO_P950,
1929 ALC1220_FIXUP_CLEVO_PB51ED,
1930 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1931 ALC887_FIXUP_ASUS_AUDIO,
1932 ALC887_FIXUP_ASUS_HMIC,
1935 static void alc889_fixup_coef(struct hda_codec *codec,
1936 const struct hda_fixup *fix, int action)
1938 if (action != HDA_FIXUP_ACT_INIT)
1940 alc_update_coef_idx(codec, 7, 0, 0x2030);
1943 /* set up GPIO at initialization */
1944 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1945 const struct hda_fixup *fix, int action)
1947 struct alc_spec *spec = codec->spec;
1949 spec->gpio_write_delay = true;
1950 alc_fixup_gpio3(codec, fix, action);
1953 /* Fix the connection of some pins for ALC889:
1954 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1955 * work correctly (bko#42740)
1957 static void alc889_fixup_dac_route(struct hda_codec *codec,
1958 const struct hda_fixup *fix, int action)
1960 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1961 /* fake the connections during parsing the tree */
1962 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1963 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1964 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1965 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1966 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1967 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1968 } else if (action == HDA_FIXUP_ACT_PROBE) {
1969 /* restore the connections */
1970 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1971 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1972 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1973 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1974 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1978 /* Set VREF on HP pin */
1979 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1980 const struct hda_fixup *fix, int action)
1982 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1983 struct alc_spec *spec = codec->spec;
1986 if (action != HDA_FIXUP_ACT_INIT)
1988 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1989 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1990 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1992 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1993 val |= AC_PINCTL_VREF_80;
1994 snd_hda_set_pin_ctl(codec, nids[i], val);
1995 spec->gen.keep_vref_in_automute = 1;
2000 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2001 const hda_nid_t *nids, int num_nids)
2003 struct alc_spec *spec = codec->spec;
2006 for (i = 0; i < num_nids; i++) {
2008 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2009 val |= AC_PINCTL_VREF_50;
2010 snd_hda_set_pin_ctl(codec, nids[i], val);
2012 spec->gen.keep_vref_in_automute = 1;
2015 /* Set VREF on speaker pins on imac91 */
2016 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2017 const struct hda_fixup *fix, int action)
2019 static const hda_nid_t nids[] = { 0x18, 0x1a };
2021 if (action == HDA_FIXUP_ACT_INIT)
2022 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2025 /* Set VREF on speaker pins on mba11 */
2026 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2027 const struct hda_fixup *fix, int action)
2029 static const hda_nid_t nids[] = { 0x18 };
2031 if (action == HDA_FIXUP_ACT_INIT)
2032 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2035 /* Set VREF on speaker pins on mba21 */
2036 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2037 const struct hda_fixup *fix, int action)
2039 static const hda_nid_t nids[] = { 0x18, 0x19 };
2041 if (action == HDA_FIXUP_ACT_INIT)
2042 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2045 /* Don't take HP output as primary
2046 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2047 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2049 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2050 const struct hda_fixup *fix, int action)
2052 struct alc_spec *spec = codec->spec;
2053 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2054 spec->gen.no_primary_hp = 1;
2055 spec->gen.no_multi_io = 1;
2059 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2060 const struct hda_fixup *fix, int action);
2062 /* For dual-codec configuration, we need to disable some features to avoid
2063 * conflicts of kctls and PCM streams
2065 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2066 const struct hda_fixup *fix, int action)
2068 struct alc_spec *spec = codec->spec;
2070 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2072 /* disable vmaster */
2073 spec->gen.suppress_vmaster = 1;
2074 /* auto-mute and auto-mic switch don't work with multiple codecs */
2075 spec->gen.suppress_auto_mute = 1;
2076 spec->gen.suppress_auto_mic = 1;
2077 /* disable aamix as well */
2078 spec->gen.mixer_nid = 0;
2079 /* add location prefix to avoid conflicts */
2080 codec->force_pin_prefix = 1;
2083 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2084 const char *newname)
2086 struct snd_kcontrol *kctl;
2088 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2090 strcpy(kctl->id.name, newname);
2093 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2094 const struct hda_fixup *fix,
2097 alc_fixup_dual_codecs(codec, fix, action);
2099 case HDA_FIXUP_ACT_PRE_PROBE:
2100 /* override card longname to provide a unique UCM profile */
2101 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2103 case HDA_FIXUP_ACT_BUILD:
2104 /* rename Capture controls depending on the codec */
2105 rename_ctl(codec, "Capture Volume",
2107 "Rear-Panel Capture Volume" :
2108 "Front-Panel Capture Volume");
2109 rename_ctl(codec, "Capture Switch",
2111 "Rear-Panel Capture Switch" :
2112 "Front-Panel Capture Switch");
2117 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2118 const struct hda_fixup *fix,
2121 static const hda_nid_t conn1[] = { 0x0c };
2122 static const struct coef_fw gb_x570_coefs[] = {
2123 WRITE_COEF(0x1a, 0x01c1),
2124 WRITE_COEF(0x1b, 0x0202),
2125 WRITE_COEF(0x43, 0x3005),
2130 case HDA_FIXUP_ACT_PRE_PROBE:
2131 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2132 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2134 case HDA_FIXUP_ACT_INIT:
2135 alc_process_coef_fw(codec, gb_x570_coefs);
2140 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2141 const struct hda_fixup *fix,
2144 static const hda_nid_t conn1[] = { 0x0c };
2146 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2149 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2150 /* We therefore want to make sure 0x14 (front headphone) and
2151 * 0x1b (speakers) use the stereo DAC 0x02
2153 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2154 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2157 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2158 const struct hda_fixup *fix, int action);
2160 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2161 const struct hda_fixup *fix,
2164 alc1220_fixup_clevo_p950(codec, fix, action);
2165 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2168 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2169 struct hda_jack_callback *jack)
2171 struct alc_spec *spec = codec->spec;
2174 snd_hda_gen_hp_automute(codec, jack);
2176 if (spec->gen.hp_jack_present)
2177 vref = AC_PINCTL_VREF_80;
2179 vref = AC_PINCTL_VREF_HIZ;
2180 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2183 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2184 const struct hda_fixup *fix, int action)
2186 struct alc_spec *spec = codec->spec;
2187 if (action != HDA_FIXUP_ACT_PROBE)
2189 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2190 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2193 static const struct hda_fixup alc882_fixups[] = {
2194 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2195 .type = HDA_FIXUP_PINS,
2196 .v.pins = (const struct hda_pintbl[]) {
2197 { 0x15, 0x01080104 }, /* side */
2198 { 0x16, 0x01011012 }, /* rear */
2199 { 0x17, 0x01016011 }, /* clfe */
2203 [ALC882_FIXUP_LENOVO_Y530] = {
2204 .type = HDA_FIXUP_PINS,
2205 .v.pins = (const struct hda_pintbl[]) {
2206 { 0x15, 0x99130112 }, /* rear int speakers */
2207 { 0x16, 0x99130111 }, /* subwoofer */
2211 [ALC882_FIXUP_PB_M5210] = {
2212 .type = HDA_FIXUP_PINCTLS,
2213 .v.pins = (const struct hda_pintbl[]) {
2214 { 0x19, PIN_VREF50 },
2218 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2219 .type = HDA_FIXUP_FUNC,
2220 .v.func = alc_fixup_sku_ignore,
2222 [ALC882_FIXUP_ASUS_W90V] = {
2223 .type = HDA_FIXUP_PINS,
2224 .v.pins = (const struct hda_pintbl[]) {
2225 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2229 [ALC889_FIXUP_CD] = {
2230 .type = HDA_FIXUP_PINS,
2231 .v.pins = (const struct hda_pintbl[]) {
2232 { 0x1c, 0x993301f0 }, /* CD */
2236 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2237 .type = HDA_FIXUP_PINS,
2238 .v.pins = (const struct hda_pintbl[]) {
2239 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2243 .chain_id = ALC889_FIXUP_CD,
2245 [ALC889_FIXUP_VAIO_TT] = {
2246 .type = HDA_FIXUP_PINS,
2247 .v.pins = (const struct hda_pintbl[]) {
2248 { 0x17, 0x90170111 }, /* hidden surround speaker */
2252 [ALC888_FIXUP_EEE1601] = {
2253 .type = HDA_FIXUP_VERBS,
2254 .v.verbs = (const struct hda_verb[]) {
2255 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2256 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2260 [ALC886_FIXUP_EAPD] = {
2261 .type = HDA_FIXUP_VERBS,
2262 .v.verbs = (const struct hda_verb[]) {
2263 /* change to EAPD mode */
2264 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2265 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2269 [ALC882_FIXUP_EAPD] = {
2270 .type = HDA_FIXUP_VERBS,
2271 .v.verbs = (const struct hda_verb[]) {
2272 /* change to EAPD mode */
2273 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2274 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2278 [ALC883_FIXUP_EAPD] = {
2279 .type = HDA_FIXUP_VERBS,
2280 .v.verbs = (const struct hda_verb[]) {
2281 /* change to EAPD mode */
2282 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2283 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2287 [ALC883_FIXUP_ACER_EAPD] = {
2288 .type = HDA_FIXUP_VERBS,
2289 .v.verbs = (const struct hda_verb[]) {
2290 /* eanable EAPD on Acer laptops */
2291 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2292 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2296 [ALC882_FIXUP_GPIO1] = {
2297 .type = HDA_FIXUP_FUNC,
2298 .v.func = alc_fixup_gpio1,
2300 [ALC882_FIXUP_GPIO2] = {
2301 .type = HDA_FIXUP_FUNC,
2302 .v.func = alc_fixup_gpio2,
2304 [ALC882_FIXUP_GPIO3] = {
2305 .type = HDA_FIXUP_FUNC,
2306 .v.func = alc_fixup_gpio3,
2308 [ALC882_FIXUP_ASUS_W2JC] = {
2309 .type = HDA_FIXUP_FUNC,
2310 .v.func = alc_fixup_gpio1,
2312 .chain_id = ALC882_FIXUP_EAPD,
2314 [ALC889_FIXUP_COEF] = {
2315 .type = HDA_FIXUP_FUNC,
2316 .v.func = alc889_fixup_coef,
2318 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2319 .type = HDA_FIXUP_PINS,
2320 .v.pins = (const struct hda_pintbl[]) {
2321 { 0x16, 0x99130111 }, /* CLFE speaker */
2322 { 0x17, 0x99130112 }, /* surround speaker */
2326 .chain_id = ALC882_FIXUP_GPIO1,
2328 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2329 .type = HDA_FIXUP_PINS,
2330 .v.pins = (const struct hda_pintbl[]) {
2331 { 0x16, 0x99130111 }, /* CLFE speaker */
2332 { 0x1b, 0x99130112 }, /* surround speaker */
2336 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2338 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2339 /* additional init verbs for Acer Aspire 8930G */
2340 .type = HDA_FIXUP_VERBS,
2341 .v.verbs = (const struct hda_verb[]) {
2342 /* Enable all DACs */
2343 /* DAC DISABLE/MUTE 1? */
2344 /* setting bits 1-5 disables DAC nids 0x02-0x06
2345 * apparently. Init=0x38 */
2346 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2347 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2348 /* DAC DISABLE/MUTE 2? */
2349 /* some bit here disables the other DACs.
2351 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2352 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2354 * This laptop has a stereo digital microphone.
2355 * The mics are only 1cm apart which makes the stereo
2356 * useless. However, either the mic or the ALC889
2357 * makes the signal become a difference/sum signal
2358 * instead of standard stereo, which is annoying.
2359 * So instead we flip this bit which makes the
2360 * codec replicate the sum signal to both channels,
2361 * turning it into a normal mono mic.
2363 /* DMIC_CONTROL? Init value = 0x0001 */
2364 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2365 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2366 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2367 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2371 .chain_id = ALC882_FIXUP_GPIO1,
2373 [ALC885_FIXUP_MACPRO_GPIO] = {
2374 .type = HDA_FIXUP_FUNC,
2375 .v.func = alc885_fixup_macpro_gpio,
2377 [ALC889_FIXUP_DAC_ROUTE] = {
2378 .type = HDA_FIXUP_FUNC,
2379 .v.func = alc889_fixup_dac_route,
2381 [ALC889_FIXUP_MBP_VREF] = {
2382 .type = HDA_FIXUP_FUNC,
2383 .v.func = alc889_fixup_mbp_vref,
2385 .chain_id = ALC882_FIXUP_GPIO1,
2387 [ALC889_FIXUP_IMAC91_VREF] = {
2388 .type = HDA_FIXUP_FUNC,
2389 .v.func = alc889_fixup_imac91_vref,
2391 .chain_id = ALC882_FIXUP_GPIO1,
2393 [ALC889_FIXUP_MBA11_VREF] = {
2394 .type = HDA_FIXUP_FUNC,
2395 .v.func = alc889_fixup_mba11_vref,
2397 .chain_id = ALC889_FIXUP_MBP_VREF,
2399 [ALC889_FIXUP_MBA21_VREF] = {
2400 .type = HDA_FIXUP_FUNC,
2401 .v.func = alc889_fixup_mba21_vref,
2403 .chain_id = ALC889_FIXUP_MBP_VREF,
2405 [ALC889_FIXUP_MP11_VREF] = {
2406 .type = HDA_FIXUP_FUNC,
2407 .v.func = alc889_fixup_mba11_vref,
2409 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2411 [ALC889_FIXUP_MP41_VREF] = {
2412 .type = HDA_FIXUP_FUNC,
2413 .v.func = alc889_fixup_mbp_vref,
2415 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2417 [ALC882_FIXUP_INV_DMIC] = {
2418 .type = HDA_FIXUP_FUNC,
2419 .v.func = alc_fixup_inv_dmic,
2421 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2422 .type = HDA_FIXUP_FUNC,
2423 .v.func = alc882_fixup_no_primary_hp,
2425 [ALC887_FIXUP_ASUS_BASS] = {
2426 .type = HDA_FIXUP_PINS,
2427 .v.pins = (const struct hda_pintbl[]) {
2428 {0x16, 0x99130130}, /* bass speaker */
2432 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2434 [ALC887_FIXUP_BASS_CHMAP] = {
2435 .type = HDA_FIXUP_FUNC,
2436 .v.func = alc_fixup_bass_chmap,
2438 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2439 .type = HDA_FIXUP_FUNC,
2440 .v.func = alc1220_fixup_gb_dual_codecs,
2442 [ALC1220_FIXUP_GB_X570] = {
2443 .type = HDA_FIXUP_FUNC,
2444 .v.func = alc1220_fixup_gb_x570,
2446 [ALC1220_FIXUP_CLEVO_P950] = {
2447 .type = HDA_FIXUP_FUNC,
2448 .v.func = alc1220_fixup_clevo_p950,
2450 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2451 .type = HDA_FIXUP_FUNC,
2452 .v.func = alc1220_fixup_clevo_pb51ed,
2454 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2455 .type = HDA_FIXUP_PINS,
2456 .v.pins = (const struct hda_pintbl[]) {
2457 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2461 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2463 [ALC887_FIXUP_ASUS_AUDIO] = {
2464 .type = HDA_FIXUP_PINS,
2465 .v.pins = (const struct hda_pintbl[]) {
2466 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2467 { 0x19, 0x22219420 },
2471 [ALC887_FIXUP_ASUS_HMIC] = {
2472 .type = HDA_FIXUP_FUNC,
2473 .v.func = alc887_fixup_asus_jack,
2475 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2479 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2480 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2481 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2482 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2483 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2484 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2485 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2486 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2487 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2488 ALC882_FIXUP_ACER_ASPIRE_4930G),
2489 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2490 ALC882_FIXUP_ACER_ASPIRE_4930G),
2491 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2492 ALC882_FIXUP_ACER_ASPIRE_8930G),
2493 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2494 ALC882_FIXUP_ACER_ASPIRE_8930G),
2495 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2496 ALC882_FIXUP_ACER_ASPIRE_4930G),
2497 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2498 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2499 ALC882_FIXUP_ACER_ASPIRE_4930G),
2500 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2501 ALC882_FIXUP_ACER_ASPIRE_4930G),
2502 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2503 ALC882_FIXUP_ACER_ASPIRE_4930G),
2504 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2505 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2506 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2507 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2508 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2509 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2510 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2511 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2512 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2513 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2514 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2515 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2516 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2517 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2518 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2520 /* All Apple entries are in codec SSIDs */
2521 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2522 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2523 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2524 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2525 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2526 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2527 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2528 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2529 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2530 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2531 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2532 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2533 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2534 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2535 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2536 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2537 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2538 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2539 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2540 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2541 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2542 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2544 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2545 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2546 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2547 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2548 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2549 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
2550 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2551 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2552 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2553 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2554 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2555 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2556 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2557 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2558 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2559 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2560 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2561 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2562 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2563 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2564 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2565 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2566 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2567 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2568 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2569 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2570 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2571 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2572 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2573 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2574 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2575 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2576 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2577 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2578 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2579 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2580 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2581 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2582 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2583 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2584 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2585 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2586 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2587 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2588 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2589 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2593 static const struct hda_model_fixup alc882_fixup_models[] = {
2594 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2595 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2596 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2597 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2598 {.id = ALC889_FIXUP_CD, .name = "cd"},
2599 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2600 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2601 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2602 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2603 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2604 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2605 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2606 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2607 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2608 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2609 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2610 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2611 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2612 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2613 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2614 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2615 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2616 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2617 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2618 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2619 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2620 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2621 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2622 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2623 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2624 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2628 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2629 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2637 {0x1e, 0x01456130}),
2638 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2646 {0x1e, 0x01451130}),
2651 * BIOS auto configuration
2653 /* almost identical with ALC880 parser... */
2654 static int alc882_parse_auto_config(struct hda_codec *codec)
2656 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2657 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2658 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2663 static int patch_alc882(struct hda_codec *codec)
2665 struct alc_spec *spec;
2668 err = alc_alloc_spec(codec, 0x0b);
2674 switch (codec->core.vendor_id) {
2682 /* ALC883 and variants */
2683 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2687 alc_pre_init(codec);
2689 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2691 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2692 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2694 alc_auto_parse_customize_define(codec);
2696 if (has_cdefine_beep(codec))
2697 spec->gen.beep_nid = 0x01;
2699 /* automatic parse from the BIOS config */
2700 err = alc882_parse_auto_config(codec);
2704 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2705 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2710 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2723 static int alc262_parse_auto_config(struct hda_codec *codec)
2725 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2726 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2727 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2734 ALC262_FIXUP_FSC_H270,
2735 ALC262_FIXUP_FSC_S7110,
2736 ALC262_FIXUP_HP_Z200,
2738 ALC262_FIXUP_LENOVO_3000,
2740 ALC262_FIXUP_BENQ_T31,
2741 ALC262_FIXUP_INV_DMIC,
2742 ALC262_FIXUP_INTEL_BAYLEYBAY,
2745 static const struct hda_fixup alc262_fixups[] = {
2746 [ALC262_FIXUP_FSC_H270] = {
2747 .type = HDA_FIXUP_PINS,
2748 .v.pins = (const struct hda_pintbl[]) {
2749 { 0x14, 0x99130110 }, /* speaker */
2750 { 0x15, 0x0221142f }, /* front HP */
2751 { 0x1b, 0x0121141f }, /* rear HP */
2755 [ALC262_FIXUP_FSC_S7110] = {
2756 .type = HDA_FIXUP_PINS,
2757 .v.pins = (const struct hda_pintbl[]) {
2758 { 0x15, 0x90170110 }, /* speaker */
2762 .chain_id = ALC262_FIXUP_BENQ,
2764 [ALC262_FIXUP_HP_Z200] = {
2765 .type = HDA_FIXUP_PINS,
2766 .v.pins = (const struct hda_pintbl[]) {
2767 { 0x16, 0x99130120 }, /* internal speaker */
2771 [ALC262_FIXUP_TYAN] = {
2772 .type = HDA_FIXUP_PINS,
2773 .v.pins = (const struct hda_pintbl[]) {
2774 { 0x14, 0x1993e1f0 }, /* int AUX */
2778 [ALC262_FIXUP_LENOVO_3000] = {
2779 .type = HDA_FIXUP_PINCTLS,
2780 .v.pins = (const struct hda_pintbl[]) {
2781 { 0x19, PIN_VREF50 },
2785 .chain_id = ALC262_FIXUP_BENQ,
2787 [ALC262_FIXUP_BENQ] = {
2788 .type = HDA_FIXUP_VERBS,
2789 .v.verbs = (const struct hda_verb[]) {
2790 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2791 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2795 [ALC262_FIXUP_BENQ_T31] = {
2796 .type = HDA_FIXUP_VERBS,
2797 .v.verbs = (const struct hda_verb[]) {
2798 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2799 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2803 [ALC262_FIXUP_INV_DMIC] = {
2804 .type = HDA_FIXUP_FUNC,
2805 .v.func = alc_fixup_inv_dmic,
2807 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2808 .type = HDA_FIXUP_FUNC,
2809 .v.func = alc_fixup_no_depop_delay,
2813 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2814 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2815 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2816 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2817 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2818 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2819 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2820 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2821 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2822 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2823 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2827 static const struct hda_model_fixup alc262_fixup_models[] = {
2828 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2829 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2830 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2831 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2832 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2833 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2834 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2835 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2836 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2842 static int patch_alc262(struct hda_codec *codec)
2844 struct alc_spec *spec;
2847 err = alc_alloc_spec(codec, 0x0b);
2852 spec->gen.shared_mic_vref_pin = 0x18;
2854 spec->shutup = alc_eapd_shutup;
2857 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2860 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2862 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2864 alc_pre_init(codec);
2866 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2868 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2870 alc_auto_parse_customize_define(codec);
2872 if (has_cdefine_beep(codec))
2873 spec->gen.beep_nid = 0x01;
2875 /* automatic parse from the BIOS config */
2876 err = alc262_parse_auto_config(codec);
2880 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2881 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2886 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2898 /* bind Beep switches of both NID 0x0f and 0x10 */
2899 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2900 struct snd_ctl_elem_value *ucontrol)
2902 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2906 mutex_lock(&codec->control_mutex);
2907 pval = kcontrol->private_value;
2908 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2909 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2911 kcontrol->private_value = (pval & ~0xff) | 0x10;
2912 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2914 kcontrol->private_value = pval;
2915 mutex_unlock(&codec->control_mutex);
2919 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2920 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2922 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2923 .name = "Beep Playback Switch",
2924 .subdevice = HDA_SUBDEV_AMP_FLAG,
2925 .info = snd_hda_mixer_amp_switch_info,
2926 .get = snd_hda_mixer_amp_switch_get,
2927 .put = alc268_beep_switch_put,
2928 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2932 /* set PCBEEP vol = 0, mute connections */
2933 static const struct hda_verb alc268_beep_init_verbs[] = {
2934 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2935 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2936 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2941 ALC268_FIXUP_INV_DMIC,
2942 ALC268_FIXUP_HP_EAPD,
2946 static const struct hda_fixup alc268_fixups[] = {
2947 [ALC268_FIXUP_INV_DMIC] = {
2948 .type = HDA_FIXUP_FUNC,
2949 .v.func = alc_fixup_inv_dmic,
2951 [ALC268_FIXUP_HP_EAPD] = {
2952 .type = HDA_FIXUP_VERBS,
2953 .v.verbs = (const struct hda_verb[]) {
2954 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2958 [ALC268_FIXUP_SPDIF] = {
2959 .type = HDA_FIXUP_PINS,
2960 .v.pins = (const struct hda_pintbl[]) {
2961 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2967 static const struct hda_model_fixup alc268_fixup_models[] = {
2968 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2969 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2970 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2974 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2975 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2976 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2977 /* below is codec SSID since multiple Toshiba laptops have the
2978 * same PCI SSID 1179:ff00
2980 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2985 * BIOS auto configuration
2987 static int alc268_parse_auto_config(struct hda_codec *codec)
2989 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2990 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2995 static int patch_alc268(struct hda_codec *codec)
2997 struct alc_spec *spec;
3000 /* ALC268 has no aa-loopback mixer */
3001 err = alc_alloc_spec(codec, 0);
3006 if (has_cdefine_beep(codec))
3007 spec->gen.beep_nid = 0x01;
3009 spec->shutup = alc_eapd_shutup;
3011 alc_pre_init(codec);
3013 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3014 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3016 /* automatic parse from the BIOS config */
3017 err = alc268_parse_auto_config(codec);
3021 if (err > 0 && !spec->gen.no_analog &&
3022 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3023 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3024 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3025 &alc268_beep_mixer[i])) {
3030 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3031 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3032 /* override the amp caps for beep generator */
3033 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3034 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3035 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3036 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3037 (0 << AC_AMPCAP_MUTE_SHIFT));
3040 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3053 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3054 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3057 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3058 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3061 /* different alc269-variants */
3063 ALC269_TYPE_ALC269VA,
3064 ALC269_TYPE_ALC269VB,
3065 ALC269_TYPE_ALC269VC,
3066 ALC269_TYPE_ALC269VD,
3087 * BIOS auto configuration
3089 static int alc269_parse_auto_config(struct hda_codec *codec)
3091 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3092 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3093 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3094 struct alc_spec *spec = codec->spec;
3095 const hda_nid_t *ssids;
3097 switch (spec->codec_variant) {
3098 case ALC269_TYPE_ALC269VA:
3099 case ALC269_TYPE_ALC269VC:
3100 case ALC269_TYPE_ALC280:
3101 case ALC269_TYPE_ALC284:
3102 case ALC269_TYPE_ALC293:
3103 ssids = alc269va_ssids;
3105 case ALC269_TYPE_ALC269VB:
3106 case ALC269_TYPE_ALC269VD:
3107 case ALC269_TYPE_ALC282:
3108 case ALC269_TYPE_ALC283:
3109 case ALC269_TYPE_ALC286:
3110 case ALC269_TYPE_ALC298:
3111 case ALC269_TYPE_ALC255:
3112 case ALC269_TYPE_ALC256:
3113 case ALC269_TYPE_ALC257:
3114 case ALC269_TYPE_ALC215:
3115 case ALC269_TYPE_ALC225:
3116 case ALC269_TYPE_ALC287:
3117 case ALC269_TYPE_ALC294:
3118 case ALC269_TYPE_ALC300:
3119 case ALC269_TYPE_ALC623:
3120 case ALC269_TYPE_ALC700:
3121 ssids = alc269_ssids;
3124 ssids = alc269_ssids;
3128 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3131 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3132 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3133 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3134 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3135 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3139 static void alc_headset_btn_callback(struct hda_codec *codec,
3140 struct hda_jack_callback *jack)
3144 if (jack->unsol_res & (7 << 13))
3145 report |= SND_JACK_BTN_0;
3147 if (jack->unsol_res & (1 << 16 | 3 << 8))
3148 report |= SND_JACK_BTN_1;
3151 if (jack->unsol_res & (7 << 23))
3152 report |= SND_JACK_BTN_2;
3154 /* Volume down key */
3155 if (jack->unsol_res & (7 << 10))
3156 report |= SND_JACK_BTN_3;
3158 snd_hda_jack_set_button_state(codec, jack->nid, report);
3161 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3163 struct alc_spec *spec = codec->spec;
3165 if (!spec->has_hs_key)
3168 switch (codec->core.vendor_id) {
3176 alc_write_coef_idx(codec, 0x48, 0x0);
3177 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3178 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3183 alc_write_coef_idx(codec, 0x48, 0x0);
3184 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3189 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3191 struct alc_spec *spec = codec->spec;
3193 if (!spec->has_hs_key)
3196 switch (codec->core.vendor_id) {
3204 alc_write_coef_idx(codec, 0x48, 0xd011);
3205 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3206 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3211 alc_write_coef_idx(codec, 0x48, 0xd011);
3212 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3217 static void alc_fixup_headset_jack(struct hda_codec *codec,
3218 const struct hda_fixup *fix, int action)
3220 struct alc_spec *spec = codec->spec;
3224 case HDA_FIXUP_ACT_PRE_PROBE:
3225 spec->has_hs_key = 1;
3226 snd_hda_jack_detect_enable_callback(codec, 0x55,
3227 alc_headset_btn_callback);
3229 case HDA_FIXUP_ACT_BUILD:
3230 hp_pin = alc_get_hp_pin(spec);
3231 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3232 alc_headset_btn_keymap,
3234 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3235 false, SND_JACK_HEADSET,
3236 alc_headset_btn_keymap);
3238 alc_enable_headset_jack_key(codec);
3243 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3245 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3248 static void alc269_shutup(struct hda_codec *codec)
3250 struct alc_spec *spec = codec->spec;
3252 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3253 alc269vb_toggle_power_output(codec, 0);
3254 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3255 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3258 alc_shutup_pins(codec);
3261 static const struct coef_fw alc282_coefs[] = {
3262 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3263 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3264 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3265 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3266 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3267 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3268 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3269 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3270 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3271 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3272 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3273 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3274 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3275 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3276 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3277 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3278 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3279 WRITE_COEF(0x63, 0x2902), /* PLL */
3280 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3281 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3282 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3283 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3284 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3285 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3286 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3287 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3288 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3289 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3290 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3294 static void alc282_restore_default_value(struct hda_codec *codec)
3296 alc_process_coef_fw(codec, alc282_coefs);
3299 static void alc282_init(struct hda_codec *codec)
3301 struct alc_spec *spec = codec->spec;
3302 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3306 alc282_restore_default_value(codec);
3310 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3311 coef78 = alc_read_coef_idx(codec, 0x78);
3313 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3314 /* Headphone capless set to high power mode */
3315 alc_write_coef_idx(codec, 0x78, 0x9004);
3320 snd_hda_codec_write(codec, hp_pin, 0,
3321 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3326 snd_hda_codec_write(codec, hp_pin, 0,
3327 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3332 /* Headphone capless set to normal mode */
3333 alc_write_coef_idx(codec, 0x78, coef78);
3336 static void alc282_shutup(struct hda_codec *codec)
3338 struct alc_spec *spec = codec->spec;
3339 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3344 alc269_shutup(codec);
3348 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3349 coef78 = alc_read_coef_idx(codec, 0x78);
3350 alc_write_coef_idx(codec, 0x78, 0x9004);
3355 snd_hda_codec_write(codec, hp_pin, 0,
3356 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3361 if (!spec->no_shutup_pins)
3362 snd_hda_codec_write(codec, hp_pin, 0,
3363 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3368 alc_auto_setup_eapd(codec, false);
3369 alc_shutup_pins(codec);
3370 alc_write_coef_idx(codec, 0x78, coef78);
3373 static const struct coef_fw alc283_coefs[] = {
3374 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3375 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3376 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3377 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3378 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3379 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3380 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3381 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3382 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3383 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3384 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3385 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3386 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3387 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3388 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3389 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3390 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3391 WRITE_COEF(0x2e, 0x2902), /* PLL */
3392 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3393 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3394 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3395 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3396 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3397 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3398 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3399 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3400 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3401 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3402 WRITE_COEF(0x49, 0x0), /* test mode */
3403 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3404 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3405 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3406 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3410 static void alc283_restore_default_value(struct hda_codec *codec)
3412 alc_process_coef_fw(codec, alc283_coefs);
3415 static void alc283_init(struct hda_codec *codec)
3417 struct alc_spec *spec = codec->spec;
3418 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3421 alc283_restore_default_value(codec);
3427 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3429 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3430 /* Headphone capless set to high power mode */
3431 alc_write_coef_idx(codec, 0x43, 0x9004);
3433 snd_hda_codec_write(codec, hp_pin, 0,
3434 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3439 snd_hda_codec_write(codec, hp_pin, 0,
3440 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3444 /* Index 0x46 Combo jack auto switch control 2 */
3445 /* 3k pull low control for Headset jack. */
3446 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3447 /* Headphone capless set to normal mode */
3448 alc_write_coef_idx(codec, 0x43, 0x9614);
3451 static void alc283_shutup(struct hda_codec *codec)
3453 struct alc_spec *spec = codec->spec;
3454 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3458 alc269_shutup(codec);
3462 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3464 alc_write_coef_idx(codec, 0x43, 0x9004);
3466 /*depop hp during suspend*/
3467 alc_write_coef_idx(codec, 0x06, 0x2100);
3469 snd_hda_codec_write(codec, hp_pin, 0,
3470 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3475 if (!spec->no_shutup_pins)
3476 snd_hda_codec_write(codec, hp_pin, 0,
3477 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3479 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3483 alc_auto_setup_eapd(codec, false);
3484 alc_shutup_pins(codec);
3485 alc_write_coef_idx(codec, 0x43, 0x9614);
3488 static void alc256_init(struct hda_codec *codec)
3490 struct alc_spec *spec = codec->spec;
3491 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3499 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3504 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3505 if (spec->ultra_low_power) {
3506 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3507 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3508 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3509 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3510 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3514 snd_hda_codec_write(codec, hp_pin, 0,
3515 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3517 if (hp_pin_sense || spec->ultra_low_power)
3520 snd_hda_codec_write(codec, hp_pin, 0,
3521 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3523 if (hp_pin_sense || spec->ultra_low_power)
3526 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3527 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3528 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3529 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3531 * Expose headphone mic (or possibly Line In on some machines) instead
3532 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3533 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3536 alc_write_coef_idx(codec, 0x36, 0x5757);
3539 static void alc256_shutup(struct hda_codec *codec)
3541 struct alc_spec *spec = codec->spec;
3542 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3548 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3553 snd_hda_codec_write(codec, hp_pin, 0,
3554 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3556 if (hp_pin_sense || spec->ultra_low_power)
3559 /* 3k pull low control for Headset jack. */
3560 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3561 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3562 * when booting with headset plugged. So skip setting it for the codec alc257
3564 if (spec->codec_variant != ALC269_TYPE_ALC257 &&
3565 spec->codec_variant != ALC269_TYPE_ALC256)
3566 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3568 if (!spec->no_shutup_pins)
3569 snd_hda_codec_write(codec, hp_pin, 0,
3570 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3572 if (hp_pin_sense || spec->ultra_low_power)
3575 alc_auto_setup_eapd(codec, false);
3576 alc_shutup_pins(codec);
3577 if (spec->ultra_low_power) {
3579 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3580 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3581 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3582 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3583 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3588 static void alc285_hp_init(struct hda_codec *codec)
3590 struct alc_spec *spec = codec->spec;
3591 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3593 int coef38, coef0d, coef36;
3595 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3596 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3597 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3598 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3599 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3600 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3602 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3605 snd_hda_codec_write(codec, hp_pin, 0,
3606 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3609 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3610 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3613 snd_hda_codec_write(codec, hp_pin, 0,
3614 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3616 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3617 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3618 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3619 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3621 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3622 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3623 for (i = 0; i < 20 && val & 0x8000; i++) {
3625 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3626 } /* Wait for depop procedure finish */
3628 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3629 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3630 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3631 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3634 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3637 static void alc225_init(struct hda_codec *codec)
3639 struct alc_spec *spec = codec->spec;
3640 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3641 bool hp1_pin_sense, hp2_pin_sense;
3643 if (spec->codec_variant != ALC269_TYPE_ALC287)
3644 /* required only at boot or S3 and S4 resume time */
3645 if (!spec->done_hp_init ||
3646 is_s3_resume(codec) ||
3647 is_s4_resume(codec)) {
3648 alc285_hp_init(codec);
3649 spec->done_hp_init = true;
3656 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3657 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3659 if (hp1_pin_sense || hp2_pin_sense)
3662 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3663 if (spec->ultra_low_power) {
3664 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3665 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3666 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3670 if (hp1_pin_sense || spec->ultra_low_power)
3671 snd_hda_codec_write(codec, hp_pin, 0,
3672 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3674 snd_hda_codec_write(codec, 0x16, 0,
3675 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3677 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3680 if (hp1_pin_sense || spec->ultra_low_power)
3681 snd_hda_codec_write(codec, hp_pin, 0,
3682 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3684 snd_hda_codec_write(codec, 0x16, 0,
3685 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3687 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3690 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3691 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3694 static void alc225_shutup(struct hda_codec *codec)
3696 struct alc_spec *spec = codec->spec;
3697 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3698 bool hp1_pin_sense, hp2_pin_sense;
3703 alc_disable_headset_jack_key(codec);
3704 /* 3k pull low control for Headset jack. */
3705 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3707 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3708 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3710 if (hp1_pin_sense || hp2_pin_sense)
3713 if (hp1_pin_sense || spec->ultra_low_power)
3714 snd_hda_codec_write(codec, hp_pin, 0,
3715 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3717 snd_hda_codec_write(codec, 0x16, 0,
3718 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3720 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3723 if (hp1_pin_sense || spec->ultra_low_power)
3724 snd_hda_codec_write(codec, hp_pin, 0,
3725 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3727 snd_hda_codec_write(codec, 0x16, 0,
3728 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3730 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3733 alc_auto_setup_eapd(codec, false);
3734 alc_shutup_pins(codec);
3735 if (spec->ultra_low_power) {
3737 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3738 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3739 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3740 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3744 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3745 alc_enable_headset_jack_key(codec);
3748 static void alc_default_init(struct hda_codec *codec)
3750 struct alc_spec *spec = codec->spec;
3751 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3759 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3764 snd_hda_codec_write(codec, hp_pin, 0,
3765 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3770 snd_hda_codec_write(codec, hp_pin, 0,
3771 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3777 static void alc_default_shutup(struct hda_codec *codec)
3779 struct alc_spec *spec = codec->spec;
3780 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3784 alc269_shutup(codec);
3788 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3793 snd_hda_codec_write(codec, hp_pin, 0,
3794 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3799 if (!spec->no_shutup_pins)
3800 snd_hda_codec_write(codec, hp_pin, 0,
3801 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3806 alc_auto_setup_eapd(codec, false);
3807 alc_shutup_pins(codec);
3810 static void alc294_hp_init(struct hda_codec *codec)
3812 struct alc_spec *spec = codec->spec;
3813 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3819 snd_hda_codec_write(codec, hp_pin, 0,
3820 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3824 if (!spec->no_shutup_pins)
3825 snd_hda_codec_write(codec, hp_pin, 0,
3826 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3828 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3829 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3831 /* Wait for depop procedure finish */
3832 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3833 for (i = 0; i < 20 && val & 0x0080; i++) {
3835 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3837 /* Set HP depop to auto mode */
3838 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3842 static void alc294_init(struct hda_codec *codec)
3844 struct alc_spec *spec = codec->spec;
3846 /* required only at boot or S4 resume time */
3847 if (!spec->done_hp_init ||
3848 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3849 alc294_hp_init(codec);
3850 spec->done_hp_init = true;
3852 alc_default_init(codec);
3855 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3858 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3859 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3860 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3863 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3867 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3868 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3870 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3875 static void alc5505_dsp_halt(struct hda_codec *codec)
3879 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3880 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3881 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3882 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3883 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3884 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3885 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3886 val = alc5505_coef_get(codec, 0x6220);
3887 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3890 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3892 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3893 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3894 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3895 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3896 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3897 alc5505_coef_set(codec, 0x880c, 0x00000004);
3900 static void alc5505_dsp_init(struct hda_codec *codec)
3904 alc5505_dsp_halt(codec);
3905 alc5505_dsp_back_from_halt(codec);
3906 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3907 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3908 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3909 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3910 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3911 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3912 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3913 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3914 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3915 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3916 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3917 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3918 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3920 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3922 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3924 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3926 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3927 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3928 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3929 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3930 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3931 alc5505_coef_set(codec, 0x880c, 0x00000003);
3932 alc5505_coef_set(codec, 0x880c, 0x00000010);
3934 #ifdef HALT_REALTEK_ALC5505
3935 alc5505_dsp_halt(codec);
3939 #ifdef HALT_REALTEK_ALC5505
3940 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3941 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3943 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3944 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3948 static int alc269_suspend(struct hda_codec *codec)
3950 struct alc_spec *spec = codec->spec;
3952 if (spec->has_alc5505_dsp)
3953 alc5505_dsp_suspend(codec);
3954 return alc_suspend(codec);
3957 static int alc269_resume(struct hda_codec *codec)
3959 struct alc_spec *spec = codec->spec;
3961 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3962 alc269vb_toggle_power_output(codec, 0);
3963 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3964 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3968 codec->patch_ops.init(codec);
3970 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3971 alc269vb_toggle_power_output(codec, 1);
3972 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3973 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3977 snd_hda_regmap_sync(codec);
3978 hda_call_check_power_status(codec, 0x01);
3980 /* on some machine, the BIOS will clear the codec gpio data when enter
3981 * suspend, and won't restore the data after resume, so we restore it
3984 if (spec->gpio_data)
3985 alc_write_gpio_data(codec);
3987 if (spec->has_alc5505_dsp)
3988 alc5505_dsp_resume(codec);
3992 #endif /* CONFIG_PM */
3994 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3995 const struct hda_fixup *fix, int action)
3997 struct alc_spec *spec = codec->spec;
3999 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4000 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4003 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4004 const struct hda_fixup *fix,
4007 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4008 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4010 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4011 snd_hda_codec_set_pincfg(codec, 0x19,
4012 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4013 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4016 static void alc269_fixup_hweq(struct hda_codec *codec,
4017 const struct hda_fixup *fix, int action)
4019 if (action == HDA_FIXUP_ACT_INIT)
4020 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4023 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4024 const struct hda_fixup *fix, int action)
4026 struct alc_spec *spec = codec->spec;
4028 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4029 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4032 static void alc271_fixup_dmic(struct hda_codec *codec,
4033 const struct hda_fixup *fix, int action)
4035 static const struct hda_verb verbs[] = {
4036 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4037 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4042 if (strcmp(codec->core.chip_name, "ALC271X") &&
4043 strcmp(codec->core.chip_name, "ALC269VB"))
4045 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4046 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4047 snd_hda_sequence_write(codec, verbs);
4050 /* Fix the speaker amp after resume, etc */
4051 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4052 const struct hda_fixup *fix,
4055 if (action == HDA_FIXUP_ACT_INIT)
4056 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4059 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4060 const struct hda_fixup *fix, int action)
4062 struct alc_spec *spec = codec->spec;
4064 if (action != HDA_FIXUP_ACT_PROBE)
4067 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4068 * fix the sample rate of analog I/O to 44.1kHz
4070 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4071 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4074 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4075 const struct hda_fixup *fix, int action)
4077 /* The digital-mic unit sends PDM (differential signal) instead of
4078 * the standard PCM, thus you can't record a valid mono stream as is.
4079 * Below is a workaround specific to ALC269 to control the dmic
4080 * signal source as mono.
4082 if (action == HDA_FIXUP_ACT_INIT)
4083 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4086 static void alc269_quanta_automute(struct hda_codec *codec)
4088 snd_hda_gen_update_outputs(codec);
4090 alc_write_coef_idx(codec, 0x0c, 0x680);
4091 alc_write_coef_idx(codec, 0x0c, 0x480);
4094 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4095 const struct hda_fixup *fix, int action)
4097 struct alc_spec *spec = codec->spec;
4098 if (action != HDA_FIXUP_ACT_PROBE)
4100 spec->gen.automute_hook = alc269_quanta_automute;
4103 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4104 struct hda_jack_callback *jack)
4106 struct alc_spec *spec = codec->spec;
4109 snd_hda_gen_hp_automute(codec, jack);
4111 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4113 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4116 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4121 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4123 struct hda_alc298_mbxinit {
4124 unsigned char value_0x23;
4125 unsigned char value_0x25;
4128 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4129 const struct hda_alc298_mbxinit *initval,
4132 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4133 alc_write_coef_idx(codec, 0x26, 0xb000);
4136 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4138 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4139 alc_write_coef_idx(codec, 0x26, 0xf000);
4140 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4142 if (initval->value_0x23 != 0x1e)
4143 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4145 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4146 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4149 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4150 const struct hda_fixup *fix,
4153 /* Initialization magic */
4154 static const struct hda_alc298_mbxinit dac_init[] = {
4155 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4156 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4157 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4158 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4159 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4160 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4162 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4163 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4164 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4167 const struct hda_alc298_mbxinit *seq;
4169 if (action != HDA_FIXUP_ACT_INIT)
4173 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4174 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4175 alc_write_coef_idx(codec, 0x26, 0xf000);
4176 alc_write_coef_idx(codec, 0x22, 0x31);
4177 alc_write_coef_idx(codec, 0x23, 0x0b);
4178 alc_write_coef_idx(codec, 0x25, 0x00);
4179 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4180 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4182 for (seq = dac_init; seq->value_0x23; seq++)
4183 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4186 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4187 const struct hda_fixup *fix, int action)
4189 struct alc_spec *spec = codec->spec;
4190 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4191 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4192 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4196 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4197 bool polarity, bool on)
4199 unsigned int pinval;
4205 pinval = snd_hda_codec_get_pin_target(codec, pin);
4206 pinval &= ~AC_PINCTL_VREFEN;
4207 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4208 /* temporarily power up/down for setting VREF */
4209 snd_hda_power_up_pm(codec);
4210 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4211 snd_hda_power_down_pm(codec);
4214 /* update mute-LED according to the speaker mute state via mic VREF pin */
4215 static int vref_mute_led_set(struct led_classdev *led_cdev,
4216 enum led_brightness brightness)
4218 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4219 struct alc_spec *spec = codec->spec;
4221 alc_update_vref_led(codec, spec->mute_led_nid,
4222 spec->mute_led_polarity, brightness);
4226 /* Make sure the led works even in runtime suspend */
4227 static unsigned int led_power_filter(struct hda_codec *codec,
4229 unsigned int power_state)
4231 struct alc_spec *spec = codec->spec;
4233 if (power_state != AC_PWRST_D3 || nid == 0 ||
4234 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4237 /* Set pin ctl again, it might have just been set to 0 */
4238 snd_hda_set_pin_ctl(codec, nid,
4239 snd_hda_codec_get_pin_target(codec, nid));
4241 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4244 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4245 const struct hda_fixup *fix, int action)
4247 struct alc_spec *spec = codec->spec;
4248 const struct dmi_device *dev = NULL;
4250 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4253 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4255 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4257 if (pin < 0x0a || pin >= 0x10)
4259 spec->mute_led_polarity = pol;
4260 spec->mute_led_nid = pin - 0x0a + 0x18;
4261 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4262 codec->power_filter = led_power_filter;
4264 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4265 spec->mute_led_polarity);
4270 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4271 const struct hda_fixup *fix,
4272 int action, hda_nid_t pin)
4274 struct alc_spec *spec = codec->spec;
4276 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4277 spec->mute_led_polarity = 0;
4278 spec->mute_led_nid = pin;
4279 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4280 codec->power_filter = led_power_filter;
4284 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4285 const struct hda_fixup *fix, int action)
4287 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4290 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4291 const struct hda_fixup *fix, int action)
4293 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4296 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4297 const struct hda_fixup *fix, int action)
4299 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4302 /* update LED status via GPIO */
4303 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4304 int polarity, bool enabled)
4308 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4311 /* turn on/off mute LED via GPIO per vmaster hook */
4312 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4313 enum led_brightness brightness)
4315 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4316 struct alc_spec *spec = codec->spec;
4318 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4319 spec->mute_led_polarity, !brightness);
4323 /* turn on/off mic-mute LED via GPIO per capture hook */
4324 static int micmute_led_set(struct led_classdev *led_cdev,
4325 enum led_brightness brightness)
4327 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4328 struct alc_spec *spec = codec->spec;
4330 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4331 spec->micmute_led_polarity, !brightness);
4335 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4336 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4338 unsigned int mute_mask,
4339 unsigned int micmute_mask)
4341 struct alc_spec *spec = codec->spec;
4343 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4345 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4348 spec->gpio_mute_led_mask = mute_mask;
4349 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4352 spec->gpio_mic_led_mask = micmute_mask;
4353 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4357 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4358 const struct hda_fixup *fix, int action)
4360 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4363 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4364 const struct hda_fixup *fix, int action)
4366 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4369 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4370 const struct hda_fixup *fix, int action)
4372 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4375 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4376 const struct hda_fixup *fix, int action)
4378 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4381 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4382 const struct hda_fixup *fix, int action)
4384 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4387 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4388 const struct hda_fixup *fix, int action)
4390 struct alc_spec *spec = codec->spec;
4392 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4393 spec->micmute_led_polarity = 1;
4394 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4397 /* turn on/off mic-mute LED per capture hook via VREF change */
4398 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4399 enum led_brightness brightness)
4401 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4402 struct alc_spec *spec = codec->spec;
4404 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4405 spec->micmute_led_polarity, brightness);
4409 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4410 const struct hda_fixup *fix, int action)
4412 struct alc_spec *spec = codec->spec;
4414 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4415 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4416 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4417 * enable headphone amp
4419 spec->gpio_mask |= 0x10;
4420 spec->gpio_dir |= 0x10;
4421 spec->cap_mute_led_nid = 0x18;
4422 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4423 codec->power_filter = led_power_filter;
4427 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4428 const struct hda_fixup *fix, int action)
4430 struct alc_spec *spec = codec->spec;
4432 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4433 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4434 spec->cap_mute_led_nid = 0x18;
4435 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4436 codec->power_filter = led_power_filter;
4440 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4441 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4443 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4444 const struct hda_fixup *fix, int action)
4446 struct alc_spec *spec = codec->spec;
4449 case HDA_FIXUP_ACT_PRE_PROBE:
4450 spec->gpio_mask |= 0x01;
4451 spec->gpio_dir |= 0x01;
4453 case HDA_FIXUP_ACT_INIT:
4454 /* need to toggle GPIO to enable the amp */
4455 alc_update_gpio_data(codec, 0x01, true);
4457 alc_update_gpio_data(codec, 0x01, false);
4462 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4463 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4464 struct hda_codec *codec,
4465 struct snd_pcm_substream *substream,
4469 case HDA_GEN_PCM_ACT_PREPARE:
4470 alc_update_gpio_data(codec, 0x04, true);
4472 case HDA_GEN_PCM_ACT_CLEANUP:
4473 alc_update_gpio_data(codec, 0x04, false);
4478 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4479 const struct hda_fixup *fix,
4482 struct alc_spec *spec = codec->spec;
4484 if (action == HDA_FIXUP_ACT_PROBE) {
4485 spec->gpio_mask |= 0x04;
4486 spec->gpio_dir |= 0x04;
4487 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4491 static void alc_update_coef_led(struct hda_codec *codec,
4492 struct alc_coef_led *led,
4493 bool polarity, bool on)
4497 /* temporarily power up/down for setting COEF bit */
4498 alc_update_coef_idx(codec, led->idx, led->mask,
4499 on ? led->on : led->off);
4502 /* update mute-LED according to the speaker mute state via COEF bit */
4503 static int coef_mute_led_set(struct led_classdev *led_cdev,
4504 enum led_brightness brightness)
4506 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4507 struct alc_spec *spec = codec->spec;
4509 alc_update_coef_led(codec, &spec->mute_led_coef,
4510 spec->mute_led_polarity, brightness);
4514 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4515 const struct hda_fixup *fix,
4518 struct alc_spec *spec = codec->spec;
4520 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4521 spec->mute_led_polarity = 0;
4522 spec->mute_led_coef.idx = 0x0b;
4523 spec->mute_led_coef.mask = 1 << 3;
4524 spec->mute_led_coef.on = 1 << 3;
4525 spec->mute_led_coef.off = 0;
4526 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4530 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4531 const struct hda_fixup *fix,
4534 struct alc_spec *spec = codec->spec;
4536 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4537 spec->mute_led_polarity = 0;
4538 spec->mute_led_coef.idx = 0x34;
4539 spec->mute_led_coef.mask = 1 << 5;
4540 spec->mute_led_coef.on = 0;
4541 spec->mute_led_coef.off = 1 << 5;
4542 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4546 /* turn on/off mic-mute LED per capture hook by coef bit */
4547 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4548 enum led_brightness brightness)
4550 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4551 struct alc_spec *spec = codec->spec;
4553 alc_update_coef_led(codec, &spec->mic_led_coef,
4554 spec->micmute_led_polarity, brightness);
4558 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4559 const struct hda_fixup *fix, int action)
4561 struct alc_spec *spec = codec->spec;
4563 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4564 spec->mic_led_coef.idx = 0x19;
4565 spec->mic_led_coef.mask = 1 << 13;
4566 spec->mic_led_coef.on = 1 << 13;
4567 spec->mic_led_coef.off = 0;
4568 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4572 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4573 const struct hda_fixup *fix, int action)
4575 struct alc_spec *spec = codec->spec;
4577 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4578 spec->mic_led_coef.idx = 0x35;
4579 spec->mic_led_coef.mask = 3 << 2;
4580 spec->mic_led_coef.on = 2 << 2;
4581 spec->mic_led_coef.off = 1 << 2;
4582 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4586 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4587 const struct hda_fixup *fix, int action)
4589 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4590 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4593 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4594 const struct hda_fixup *fix, int action)
4596 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4597 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4600 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4601 const struct hda_fixup *fix, int action)
4603 struct alc_spec *spec = codec->spec;
4605 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4606 spec->cap_mute_led_nid = 0x1a;
4607 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4608 codec->power_filter = led_power_filter;
4612 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4613 const struct hda_fixup *fix, int action)
4615 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4616 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4619 #if IS_REACHABLE(CONFIG_INPUT)
4620 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4621 struct hda_jack_callback *event)
4623 struct alc_spec *spec = codec->spec;
4625 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4626 send both key on and key off event for every interrupt. */
4627 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4628 input_sync(spec->kb_dev);
4629 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4630 input_sync(spec->kb_dev);
4633 static int alc_register_micmute_input_device(struct hda_codec *codec)
4635 struct alc_spec *spec = codec->spec;
4638 spec->kb_dev = input_allocate_device();
4639 if (!spec->kb_dev) {
4640 codec_err(codec, "Out of memory (input_allocate_device)\n");
4644 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4646 spec->kb_dev->name = "Microphone Mute Button";
4647 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4648 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4649 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4650 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4651 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4652 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4654 if (input_register_device(spec->kb_dev)) {
4655 codec_err(codec, "input_register_device failed\n");
4656 input_free_device(spec->kb_dev);
4657 spec->kb_dev = NULL;
4664 /* GPIO1 = set according to SKU external amp
4665 * GPIO2 = mic mute hotkey
4667 * GPIO4 = mic mute LED
4669 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4670 const struct hda_fixup *fix, int action)
4672 struct alc_spec *spec = codec->spec;
4674 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4675 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4676 spec->init_amp = ALC_INIT_DEFAULT;
4677 if (alc_register_micmute_input_device(codec) != 0)
4680 spec->gpio_mask |= 0x06;
4681 spec->gpio_dir |= 0x02;
4682 spec->gpio_data |= 0x02;
4683 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4684 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4685 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4686 gpio2_mic_hotkey_event);
4694 case HDA_FIXUP_ACT_FREE:
4695 input_unregister_device(spec->kb_dev);
4696 spec->kb_dev = NULL;
4700 /* Line2 = mic mute hotkey
4701 * GPIO2 = mic mute LED
4703 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4704 const struct hda_fixup *fix, int action)
4706 struct alc_spec *spec = codec->spec;
4708 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4709 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4710 spec->init_amp = ALC_INIT_DEFAULT;
4711 if (alc_register_micmute_input_device(codec) != 0)
4714 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4715 gpio2_mic_hotkey_event);
4723 case HDA_FIXUP_ACT_FREE:
4724 input_unregister_device(spec->kb_dev);
4725 spec->kb_dev = NULL;
4729 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4730 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4733 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4734 const struct hda_fixup *fix, int action)
4736 struct alc_spec *spec = codec->spec;
4738 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4739 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4740 spec->cap_mute_led_nid = 0x18;
4741 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4745 static const struct coef_fw alc225_pre_hsmode[] = {
4746 UPDATE_COEF(0x4a, 1<<8, 0),
4747 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4748 UPDATE_COEF(0x63, 3<<14, 3<<14),
4749 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4750 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4751 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4752 UPDATE_COEF(0x4a, 3<<10, 0),
4756 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4758 struct alc_spec *spec = codec->spec;
4759 static const struct coef_fw coef0255[] = {
4760 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4761 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4762 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4763 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4764 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4767 static const struct coef_fw coef0256[] = {
4768 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4769 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4770 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4771 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4772 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4775 static const struct coef_fw coef0233[] = {
4776 WRITE_COEF(0x1b, 0x0c0b),
4777 WRITE_COEF(0x45, 0xc429),
4778 UPDATE_COEF(0x35, 0x4000, 0),
4779 WRITE_COEF(0x06, 0x2104),
4780 WRITE_COEF(0x1a, 0x0001),
4781 WRITE_COEF(0x26, 0x0004),
4782 WRITE_COEF(0x32, 0x42a3),
4785 static const struct coef_fw coef0288[] = {
4786 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4787 UPDATE_COEF(0x50, 0x2000, 0x2000),
4788 UPDATE_COEF(0x56, 0x0006, 0x0006),
4789 UPDATE_COEF(0x66, 0x0008, 0),
4790 UPDATE_COEF(0x67, 0x2000, 0),
4793 static const struct coef_fw coef0298[] = {
4794 UPDATE_COEF(0x19, 0x1300, 0x0300),
4797 static const struct coef_fw coef0292[] = {
4798 WRITE_COEF(0x76, 0x000e),
4799 WRITE_COEF(0x6c, 0x2400),
4800 WRITE_COEF(0x18, 0x7308),
4801 WRITE_COEF(0x6b, 0xc429),
4804 static const struct coef_fw coef0293[] = {
4805 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4806 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4807 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4808 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4809 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4810 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4813 static const struct coef_fw coef0668[] = {
4814 WRITE_COEF(0x15, 0x0d40),
4815 WRITE_COEF(0xb7, 0x802b),
4818 static const struct coef_fw coef0225[] = {
4819 UPDATE_COEF(0x63, 3<<14, 0),
4822 static const struct coef_fw coef0274[] = {
4823 UPDATE_COEF(0x4a, 0x0100, 0),
4824 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4825 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4826 UPDATE_COEF(0x4a, 0x0010, 0),
4827 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4828 WRITE_COEF(0x45, 0x5289),
4829 UPDATE_COEF(0x4a, 0x0c00, 0),
4833 if (spec->no_internal_mic_pin) {
4834 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4838 switch (codec->core.vendor_id) {
4840 alc_process_coef_fw(codec, coef0255);
4845 alc_process_coef_fw(codec, coef0256);
4850 alc_process_coef_fw(codec, coef0274);
4854 alc_process_coef_fw(codec, coef0233);
4858 alc_process_coef_fw(codec, coef0288);
4861 alc_process_coef_fw(codec, coef0298);
4862 alc_process_coef_fw(codec, coef0288);
4865 alc_process_coef_fw(codec, coef0292);
4868 alc_process_coef_fw(codec, coef0293);
4871 alc_process_coef_fw(codec, coef0668);
4879 alc_process_coef_fw(codec, alc225_pre_hsmode);
4880 alc_process_coef_fw(codec, coef0225);
4883 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4886 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4890 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4893 static const struct coef_fw coef0255[] = {
4894 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4895 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4898 static const struct coef_fw coef0256[] = {
4899 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4900 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4901 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4904 static const struct coef_fw coef0233[] = {
4905 UPDATE_COEF(0x35, 0, 1<<14),
4906 WRITE_COEF(0x06, 0x2100),
4907 WRITE_COEF(0x1a, 0x0021),
4908 WRITE_COEF(0x26, 0x008c),
4911 static const struct coef_fw coef0288[] = {
4912 UPDATE_COEF(0x4f, 0x00c0, 0),
4913 UPDATE_COEF(0x50, 0x2000, 0),
4914 UPDATE_COEF(0x56, 0x0006, 0),
4915 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4916 UPDATE_COEF(0x66, 0x0008, 0x0008),
4917 UPDATE_COEF(0x67, 0x2000, 0x2000),
4920 static const struct coef_fw coef0292[] = {
4921 WRITE_COEF(0x19, 0xa208),
4922 WRITE_COEF(0x2e, 0xacf0),
4925 static const struct coef_fw coef0293[] = {
4926 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4927 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4928 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4931 static const struct coef_fw coef0688[] = {
4932 WRITE_COEF(0xb7, 0x802b),
4933 WRITE_COEF(0xb5, 0x1040),
4934 UPDATE_COEF(0xc3, 0, 1<<12),
4937 static const struct coef_fw coef0225[] = {
4938 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4939 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4940 UPDATE_COEF(0x63, 3<<14, 0),
4943 static const struct coef_fw coef0274[] = {
4944 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4945 UPDATE_COEF(0x4a, 0x0010, 0),
4946 UPDATE_COEF(0x6b, 0xf000, 0),
4950 switch (codec->core.vendor_id) {
4952 alc_write_coef_idx(codec, 0x45, 0xc489);
4953 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4954 alc_process_coef_fw(codec, coef0255);
4955 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4960 alc_write_coef_idx(codec, 0x45, 0xc489);
4961 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4962 alc_process_coef_fw(codec, coef0256);
4963 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4968 alc_write_coef_idx(codec, 0x45, 0x4689);
4969 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4970 alc_process_coef_fw(codec, coef0274);
4971 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4975 alc_write_coef_idx(codec, 0x45, 0xc429);
4976 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4977 alc_process_coef_fw(codec, coef0233);
4978 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4983 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4984 alc_process_coef_fw(codec, coef0288);
4985 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4988 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4989 alc_process_coef_fw(codec, coef0292);
4992 /* Set to TRS mode */
4993 alc_write_coef_idx(codec, 0x45, 0xc429);
4994 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4995 alc_process_coef_fw(codec, coef0293);
4996 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4999 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5003 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5004 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5007 alc_write_coef_idx(codec, 0x11, 0x0001);
5008 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5009 alc_process_coef_fw(codec, coef0688);
5010 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5018 alc_process_coef_fw(codec, alc225_pre_hsmode);
5019 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5020 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5021 alc_process_coef_fw(codec, coef0225);
5022 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5025 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5028 static void alc_headset_mode_default(struct hda_codec *codec)
5030 static const struct coef_fw coef0225[] = {
5031 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5032 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5033 UPDATE_COEF(0x49, 3<<8, 0<<8),
5034 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5035 UPDATE_COEF(0x63, 3<<14, 0),
5036 UPDATE_COEF(0x67, 0xf000, 0x3000),
5039 static const struct coef_fw coef0255[] = {
5040 WRITE_COEF(0x45, 0xc089),
5041 WRITE_COEF(0x45, 0xc489),
5042 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5043 WRITE_COEF(0x49, 0x0049),
5046 static const struct coef_fw coef0256[] = {
5047 WRITE_COEF(0x45, 0xc489),
5048 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5049 WRITE_COEF(0x49, 0x0049),
5050 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5051 WRITE_COEF(0x06, 0x6100),
5054 static const struct coef_fw coef0233[] = {
5055 WRITE_COEF(0x06, 0x2100),
5056 WRITE_COEF(0x32, 0x4ea3),
5059 static const struct coef_fw coef0288[] = {
5060 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5061 UPDATE_COEF(0x50, 0x2000, 0x2000),
5062 UPDATE_COEF(0x56, 0x0006, 0x0006),
5063 UPDATE_COEF(0x66, 0x0008, 0),
5064 UPDATE_COEF(0x67, 0x2000, 0),
5067 static const struct coef_fw coef0292[] = {
5068 WRITE_COEF(0x76, 0x000e),
5069 WRITE_COEF(0x6c, 0x2400),
5070 WRITE_COEF(0x6b, 0xc429),
5071 WRITE_COEF(0x18, 0x7308),
5074 static const struct coef_fw coef0293[] = {
5075 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5076 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5077 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5080 static const struct coef_fw coef0688[] = {
5081 WRITE_COEF(0x11, 0x0041),
5082 WRITE_COEF(0x15, 0x0d40),
5083 WRITE_COEF(0xb7, 0x802b),
5086 static const struct coef_fw coef0274[] = {
5087 WRITE_COEF(0x45, 0x4289),
5088 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5089 UPDATE_COEF(0x6b, 0x0f00, 0),
5090 UPDATE_COEF(0x49, 0x0300, 0x0300),
5094 switch (codec->core.vendor_id) {
5101 alc_process_coef_fw(codec, alc225_pre_hsmode);
5102 alc_process_coef_fw(codec, coef0225);
5105 alc_process_coef_fw(codec, coef0255);
5110 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5111 alc_write_coef_idx(codec, 0x45, 0xc089);
5113 alc_process_coef_fw(codec, coef0256);
5118 alc_process_coef_fw(codec, coef0274);
5122 alc_process_coef_fw(codec, coef0233);
5127 alc_process_coef_fw(codec, coef0288);
5130 alc_process_coef_fw(codec, coef0292);
5133 alc_process_coef_fw(codec, coef0293);
5136 alc_process_coef_fw(codec, coef0688);
5139 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5142 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5146 static void alc_headset_mode_ctia(struct hda_codec *codec)
5150 static const struct coef_fw coef0255[] = {
5151 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5152 WRITE_COEF(0x1b, 0x0c2b),
5153 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5156 static const struct coef_fw coef0256[] = {
5157 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5158 WRITE_COEF(0x1b, 0x0e6b),
5161 static const struct coef_fw coef0233[] = {
5162 WRITE_COEF(0x45, 0xd429),
5163 WRITE_COEF(0x1b, 0x0c2b),
5164 WRITE_COEF(0x32, 0x4ea3),
5167 static const struct coef_fw coef0288[] = {
5168 UPDATE_COEF(0x50, 0x2000, 0x2000),
5169 UPDATE_COEF(0x56, 0x0006, 0x0006),
5170 UPDATE_COEF(0x66, 0x0008, 0),
5171 UPDATE_COEF(0x67, 0x2000, 0),
5174 static const struct coef_fw coef0292[] = {
5175 WRITE_COEF(0x6b, 0xd429),
5176 WRITE_COEF(0x76, 0x0008),
5177 WRITE_COEF(0x18, 0x7388),
5180 static const struct coef_fw coef0293[] = {
5181 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5182 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5185 static const struct coef_fw coef0688[] = {
5186 WRITE_COEF(0x11, 0x0001),
5187 WRITE_COEF(0x15, 0x0d60),
5188 WRITE_COEF(0xc3, 0x0000),
5191 static const struct coef_fw coef0225_1[] = {
5192 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5193 UPDATE_COEF(0x63, 3<<14, 2<<14),
5196 static const struct coef_fw coef0225_2[] = {
5197 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5198 UPDATE_COEF(0x63, 3<<14, 1<<14),
5202 switch (codec->core.vendor_id) {
5204 alc_process_coef_fw(codec, coef0255);
5209 alc_process_coef_fw(codec, coef0256);
5214 alc_write_coef_idx(codec, 0x45, 0xd689);
5218 alc_process_coef_fw(codec, coef0233);
5221 val = alc_read_coef_idx(codec, 0x50);
5222 if (val & (1 << 12)) {
5223 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5224 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5227 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5228 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5234 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5236 alc_process_coef_fw(codec, coef0288);
5239 alc_process_coef_fw(codec, coef0292);
5242 alc_process_coef_fw(codec, coef0293);
5245 alc_process_coef_fw(codec, coef0688);
5253 val = alc_read_coef_idx(codec, 0x45);
5255 alc_process_coef_fw(codec, coef0225_2);
5257 alc_process_coef_fw(codec, coef0225_1);
5260 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5263 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5267 static void alc_headset_mode_omtp(struct hda_codec *codec)
5269 static const struct coef_fw coef0255[] = {
5270 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5271 WRITE_COEF(0x1b, 0x0c2b),
5272 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5275 static const struct coef_fw coef0256[] = {
5276 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5277 WRITE_COEF(0x1b, 0x0e6b),
5280 static const struct coef_fw coef0233[] = {
5281 WRITE_COEF(0x45, 0xe429),
5282 WRITE_COEF(0x1b, 0x0c2b),
5283 WRITE_COEF(0x32, 0x4ea3),
5286 static const struct coef_fw coef0288[] = {
5287 UPDATE_COEF(0x50, 0x2000, 0x2000),
5288 UPDATE_COEF(0x56, 0x0006, 0x0006),
5289 UPDATE_COEF(0x66, 0x0008, 0),
5290 UPDATE_COEF(0x67, 0x2000, 0),
5293 static const struct coef_fw coef0292[] = {
5294 WRITE_COEF(0x6b, 0xe429),
5295 WRITE_COEF(0x76, 0x0008),
5296 WRITE_COEF(0x18, 0x7388),
5299 static const struct coef_fw coef0293[] = {
5300 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5301 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5304 static const struct coef_fw coef0688[] = {
5305 WRITE_COEF(0x11, 0x0001),
5306 WRITE_COEF(0x15, 0x0d50),
5307 WRITE_COEF(0xc3, 0x0000),
5310 static const struct coef_fw coef0225[] = {
5311 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5312 UPDATE_COEF(0x63, 3<<14, 2<<14),
5316 switch (codec->core.vendor_id) {
5318 alc_process_coef_fw(codec, coef0255);
5323 alc_process_coef_fw(codec, coef0256);
5328 alc_write_coef_idx(codec, 0x45, 0xe689);
5332 alc_process_coef_fw(codec, coef0233);
5335 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5336 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5341 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5343 alc_process_coef_fw(codec, coef0288);
5346 alc_process_coef_fw(codec, coef0292);
5349 alc_process_coef_fw(codec, coef0293);
5352 alc_process_coef_fw(codec, coef0688);
5360 alc_process_coef_fw(codec, coef0225);
5363 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5366 static void alc_determine_headset_type(struct hda_codec *codec)
5369 bool is_ctia = false;
5370 struct alc_spec *spec = codec->spec;
5371 static const struct coef_fw coef0255[] = {
5372 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5373 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5377 static const struct coef_fw coef0288[] = {
5378 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5381 static const struct coef_fw coef0298[] = {
5382 UPDATE_COEF(0x50, 0x2000, 0x2000),
5383 UPDATE_COEF(0x56, 0x0006, 0x0006),
5384 UPDATE_COEF(0x66, 0x0008, 0),
5385 UPDATE_COEF(0x67, 0x2000, 0),
5386 UPDATE_COEF(0x19, 0x1300, 0x1300),
5389 static const struct coef_fw coef0293[] = {
5390 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5391 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5394 static const struct coef_fw coef0688[] = {
5395 WRITE_COEF(0x11, 0x0001),
5396 WRITE_COEF(0xb7, 0x802b),
5397 WRITE_COEF(0x15, 0x0d60),
5398 WRITE_COEF(0xc3, 0x0c00),
5401 static const struct coef_fw coef0274[] = {
5402 UPDATE_COEF(0x4a, 0x0010, 0),
5403 UPDATE_COEF(0x4a, 0x8000, 0),
5404 WRITE_COEF(0x45, 0xd289),
5405 UPDATE_COEF(0x49, 0x0300, 0x0300),
5409 if (spec->no_internal_mic_pin) {
5410 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5414 switch (codec->core.vendor_id) {
5416 alc_process_coef_fw(codec, coef0255);
5418 val = alc_read_coef_idx(codec, 0x46);
5419 is_ctia = (val & 0x0070) == 0x0070;
5424 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5425 alc_write_coef_idx(codec, 0x06, 0x6104);
5426 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5428 snd_hda_codec_write(codec, 0x21, 0,
5429 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5431 snd_hda_codec_write(codec, 0x21, 0,
5432 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5434 alc_process_coef_fw(codec, coef0255);
5436 val = alc_read_coef_idx(codec, 0x46);
5437 is_ctia = (val & 0x0070) == 0x0070;
5439 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5440 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5442 snd_hda_codec_write(codec, 0x21, 0,
5443 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5445 snd_hda_codec_write(codec, 0x21, 0,
5446 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5451 alc_process_coef_fw(codec, coef0274);
5453 val = alc_read_coef_idx(codec, 0x46);
5454 is_ctia = (val & 0x00f0) == 0x00f0;
5458 alc_write_coef_idx(codec, 0x45, 0xd029);
5460 val = alc_read_coef_idx(codec, 0x46);
5461 is_ctia = (val & 0x0070) == 0x0070;
5464 snd_hda_codec_write(codec, 0x21, 0,
5465 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5467 snd_hda_codec_write(codec, 0x21, 0,
5468 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5471 val = alc_read_coef_idx(codec, 0x50);
5472 if (val & (1 << 12)) {
5473 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5474 alc_process_coef_fw(codec, coef0288);
5476 val = alc_read_coef_idx(codec, 0x50);
5477 is_ctia = (val & 0x0070) == 0x0070;
5479 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5480 alc_process_coef_fw(codec, coef0288);
5482 val = alc_read_coef_idx(codec, 0x50);
5483 is_ctia = (val & 0x0070) == 0x0070;
5485 alc_process_coef_fw(codec, coef0298);
5486 snd_hda_codec_write(codec, 0x21, 0,
5487 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5489 snd_hda_codec_write(codec, 0x21, 0,
5490 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5494 alc_process_coef_fw(codec, coef0288);
5496 val = alc_read_coef_idx(codec, 0x50);
5497 is_ctia = (val & 0x0070) == 0x0070;
5500 alc_write_coef_idx(codec, 0x6b, 0xd429);
5502 val = alc_read_coef_idx(codec, 0x6c);
5503 is_ctia = (val & 0x001c) == 0x001c;
5506 alc_process_coef_fw(codec, coef0293);
5508 val = alc_read_coef_idx(codec, 0x46);
5509 is_ctia = (val & 0x0070) == 0x0070;
5512 alc_process_coef_fw(codec, coef0688);
5514 val = alc_read_coef_idx(codec, 0xbe);
5515 is_ctia = (val & 0x1c02) == 0x1c02;
5523 snd_hda_codec_write(codec, 0x21, 0,
5524 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5526 snd_hda_codec_write(codec, 0x21, 0,
5527 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5529 alc_process_coef_fw(codec, alc225_pre_hsmode);
5530 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5531 val = alc_read_coef_idx(codec, 0x45);
5532 if (val & (1 << 9)) {
5533 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5534 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5536 val = alc_read_coef_idx(codec, 0x46);
5537 is_ctia = (val & 0x00f0) == 0x00f0;
5539 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5540 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5542 val = alc_read_coef_idx(codec, 0x46);
5543 is_ctia = (val & 0x00f0) == 0x00f0;
5545 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5546 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5547 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5549 snd_hda_codec_write(codec, 0x21, 0,
5550 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5552 snd_hda_codec_write(codec, 0x21, 0,
5553 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5560 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5561 is_ctia ? "yes" : "no");
5562 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5565 static void alc_update_headset_mode(struct hda_codec *codec)
5567 struct alc_spec *spec = codec->spec;
5569 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5570 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5572 int new_headset_mode;
5574 if (!snd_hda_jack_detect(codec, hp_pin))
5575 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5576 else if (mux_pin == spec->headset_mic_pin)
5577 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5578 else if (mux_pin == spec->headphone_mic_pin)
5579 new_headset_mode = ALC_HEADSET_MODE_MIC;
5581 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5583 if (new_headset_mode == spec->current_headset_mode) {
5584 snd_hda_gen_update_outputs(codec);
5588 switch (new_headset_mode) {
5589 case ALC_HEADSET_MODE_UNPLUGGED:
5590 alc_headset_mode_unplugged(codec);
5591 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5592 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5593 spec->gen.hp_jack_present = false;
5595 case ALC_HEADSET_MODE_HEADSET:
5596 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5597 alc_determine_headset_type(codec);
5598 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5599 alc_headset_mode_ctia(codec);
5600 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5601 alc_headset_mode_omtp(codec);
5602 spec->gen.hp_jack_present = true;
5604 case ALC_HEADSET_MODE_MIC:
5605 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5606 spec->gen.hp_jack_present = false;
5608 case ALC_HEADSET_MODE_HEADPHONE:
5609 alc_headset_mode_default(codec);
5610 spec->gen.hp_jack_present = true;
5613 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5614 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5615 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5616 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5617 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5620 spec->current_headset_mode = new_headset_mode;
5622 snd_hda_gen_update_outputs(codec);
5625 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5626 struct snd_kcontrol *kcontrol,
5627 struct snd_ctl_elem_value *ucontrol)
5629 alc_update_headset_mode(codec);
5632 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5633 struct hda_jack_callback *jack)
5635 snd_hda_gen_hp_automute(codec, jack);
5636 alc_update_headset_mode(codec);
5639 static void alc_probe_headset_mode(struct hda_codec *codec)
5642 struct alc_spec *spec = codec->spec;
5643 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5646 for (i = 0; i < cfg->num_inputs; i++) {
5647 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5648 spec->headset_mic_pin = cfg->inputs[i].pin;
5649 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5650 spec->headphone_mic_pin = cfg->inputs[i].pin;
5653 WARN_ON(spec->gen.cap_sync_hook);
5654 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5655 spec->gen.automute_hook = alc_update_headset_mode;
5656 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5659 static void alc_fixup_headset_mode(struct hda_codec *codec,
5660 const struct hda_fixup *fix, int action)
5662 struct alc_spec *spec = codec->spec;
5665 case HDA_FIXUP_ACT_PRE_PROBE:
5666 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5668 case HDA_FIXUP_ACT_PROBE:
5669 alc_probe_headset_mode(codec);
5671 case HDA_FIXUP_ACT_INIT:
5672 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5673 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5674 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5676 alc_update_headset_mode(codec);
5681 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5682 const struct hda_fixup *fix, int action)
5684 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5685 struct alc_spec *spec = codec->spec;
5686 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5689 alc_fixup_headset_mode(codec, fix, action);
5692 static void alc255_set_default_jack_type(struct hda_codec *codec)
5694 /* Set to iphone type */
5695 static const struct coef_fw alc255fw[] = {
5696 WRITE_COEF(0x1b, 0x880b),
5697 WRITE_COEF(0x45, 0xd089),
5698 WRITE_COEF(0x1b, 0x080b),
5699 WRITE_COEF(0x46, 0x0004),
5700 WRITE_COEF(0x1b, 0x0c0b),
5703 static const struct coef_fw alc256fw[] = {
5704 WRITE_COEF(0x1b, 0x884b),
5705 WRITE_COEF(0x45, 0xd089),
5706 WRITE_COEF(0x1b, 0x084b),
5707 WRITE_COEF(0x46, 0x0004),
5708 WRITE_COEF(0x1b, 0x0c4b),
5711 switch (codec->core.vendor_id) {
5713 alc_process_coef_fw(codec, alc255fw);
5718 alc_process_coef_fw(codec, alc256fw);
5724 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5725 const struct hda_fixup *fix, int action)
5727 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5728 alc255_set_default_jack_type(codec);
5730 alc_fixup_headset_mode(codec, fix, action);
5733 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5734 const struct hda_fixup *fix, int action)
5736 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5737 struct alc_spec *spec = codec->spec;
5738 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5739 alc255_set_default_jack_type(codec);
5742 alc_fixup_headset_mode(codec, fix, action);
5745 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5746 struct hda_jack_callback *jack)
5748 struct alc_spec *spec = codec->spec;
5750 alc_update_headset_jack_cb(codec, jack);
5751 /* Headset Mic enable or disable, only for Dell Dino */
5752 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5755 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5756 const struct hda_fixup *fix, int action)
5758 alc_fixup_headset_mode(codec, fix, action);
5759 if (action == HDA_FIXUP_ACT_PROBE) {
5760 struct alc_spec *spec = codec->spec;
5761 /* toggled via hp_automute_hook */
5762 spec->gpio_mask |= 0x40;
5763 spec->gpio_dir |= 0x40;
5764 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5768 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5769 const struct hda_fixup *fix, int action)
5771 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5772 struct alc_spec *spec = codec->spec;
5773 spec->gen.auto_mute_via_amp = 1;
5777 static void alc_fixup_no_shutup(struct hda_codec *codec,
5778 const struct hda_fixup *fix, int action)
5780 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5781 struct alc_spec *spec = codec->spec;
5782 spec->no_shutup_pins = 1;
5786 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5787 const struct hda_fixup *fix, int action)
5789 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5790 struct alc_spec *spec = codec->spec;
5791 /* Disable AA-loopback as it causes white noise */
5792 spec->gen.mixer_nid = 0;
5796 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5797 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5798 const struct hda_fixup *fix, int action)
5800 static const struct hda_pintbl pincfgs[] = {
5801 { 0x16, 0x21211010 }, /* dock headphone */
5802 { 0x19, 0x21a11010 }, /* dock mic */
5805 struct alc_spec *spec = codec->spec;
5807 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5808 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5809 codec->power_save_node = 0; /* avoid click noises */
5810 snd_hda_apply_pincfgs(codec, pincfgs);
5814 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5815 const struct hda_fixup *fix, int action)
5817 static const struct hda_pintbl pincfgs[] = {
5818 { 0x17, 0x21211010 }, /* dock headphone */
5819 { 0x19, 0x21a11010 }, /* dock mic */
5822 struct alc_spec *spec = codec->spec;
5824 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5825 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5826 snd_hda_apply_pincfgs(codec, pincfgs);
5827 } else if (action == HDA_FIXUP_ACT_INIT) {
5828 /* Enable DOCK device */
5829 snd_hda_codec_write(codec, 0x17, 0,
5830 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5831 /* Enable DOCK device */
5832 snd_hda_codec_write(codec, 0x19, 0,
5833 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5837 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5838 const struct hda_fixup *fix, int action)
5840 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5841 * the speaker output becomes too low by some reason on Thinkpads with
5844 static const hda_nid_t preferred_pairs[] = {
5845 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5848 struct alc_spec *spec = codec->spec;
5850 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5851 spec->gen.preferred_dacs = preferred_pairs;
5854 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5855 const struct hda_fixup *fix, int action)
5857 static const hda_nid_t preferred_pairs[] = {
5858 0x17, 0x02, 0x21, 0x03, 0
5860 struct alc_spec *spec = codec->spec;
5862 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5863 spec->gen.preferred_dacs = preferred_pairs;
5866 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5868 struct alc_spec *spec = codec->spec;
5869 int hp_pin = alc_get_hp_pin(spec);
5871 /* Prevent pop noises when headphones are plugged in */
5872 snd_hda_codec_write(codec, hp_pin, 0,
5873 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5877 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5878 const struct hda_fixup *fix, int action)
5880 struct alc_spec *spec = codec->spec;
5881 struct hda_input_mux *imux = &spec->gen.input_mux;
5885 case HDA_FIXUP_ACT_PRE_PROBE:
5886 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5887 * it causes a click noise at start up
5889 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5890 spec->shutup = alc_shutup_dell_xps13;
5892 case HDA_FIXUP_ACT_PROBE:
5893 /* Make the internal mic the default input source. */
5894 for (i = 0; i < imux->num_items; i++) {
5895 if (spec->gen.imux_pins[i] == 0x12) {
5896 spec->gen.cur_mux[0] = i;
5904 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5905 const struct hda_fixup *fix, int action)
5907 struct alc_spec *spec = codec->spec;
5909 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5910 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5911 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5913 /* Disable boost for mic-in permanently. (This code is only called
5914 from quirks that guarantee that the headphone is at NID 0x1b.) */
5915 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5916 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5918 alc_fixup_headset_mode(codec, fix, action);
5921 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5922 const struct hda_fixup *fix, int action)
5924 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5925 alc_write_coef_idx(codec, 0xc4, 0x8000);
5926 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5927 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5929 alc_fixup_headset_mode(codec, fix, action);
5932 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5933 static int find_ext_mic_pin(struct hda_codec *codec)
5935 struct alc_spec *spec = codec->spec;
5936 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5938 unsigned int defcfg;
5941 for (i = 0; i < cfg->num_inputs; i++) {
5942 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5944 nid = cfg->inputs[i].pin;
5945 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5946 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5954 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5955 const struct hda_fixup *fix,
5958 struct alc_spec *spec = codec->spec;
5960 if (action == HDA_FIXUP_ACT_PROBE) {
5961 int mic_pin = find_ext_mic_pin(codec);
5962 int hp_pin = alc_get_hp_pin(spec);
5964 if (snd_BUG_ON(!mic_pin || !hp_pin))
5966 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5970 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5971 const struct hda_fixup *fix,
5974 struct alc_spec *spec = codec->spec;
5975 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5978 /* The mic boosts on level 2 and 3 are too noisy
5979 on the internal mic input.
5980 Therefore limit the boost to 0 or 1. */
5982 if (action != HDA_FIXUP_ACT_PROBE)
5985 for (i = 0; i < cfg->num_inputs; i++) {
5986 hda_nid_t nid = cfg->inputs[i].pin;
5987 unsigned int defcfg;
5988 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5990 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5991 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5994 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5995 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5996 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5997 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5998 (0 << AC_AMPCAP_MUTE_SHIFT));
6002 static void alc283_hp_automute_hook(struct hda_codec *codec,
6003 struct hda_jack_callback *jack)
6005 struct alc_spec *spec = codec->spec;
6009 snd_hda_gen_hp_automute(codec, jack);
6011 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6014 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6018 static void alc283_fixup_chromebook(struct hda_codec *codec,
6019 const struct hda_fixup *fix, int action)
6021 struct alc_spec *spec = codec->spec;
6024 case HDA_FIXUP_ACT_PRE_PROBE:
6025 snd_hda_override_wcaps(codec, 0x03, 0);
6026 /* Disable AA-loopback as it causes white noise */
6027 spec->gen.mixer_nid = 0;
6029 case HDA_FIXUP_ACT_INIT:
6030 /* MIC2-VREF control */
6031 /* Set to manual mode */
6032 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6033 /* Enable Line1 input control by verb */
6034 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6039 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6040 const struct hda_fixup *fix, int action)
6042 struct alc_spec *spec = codec->spec;
6045 case HDA_FIXUP_ACT_PRE_PROBE:
6046 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6048 case HDA_FIXUP_ACT_INIT:
6049 /* MIC2-VREF control */
6050 /* Set to manual mode */
6051 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6056 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6057 static void asus_tx300_automute(struct hda_codec *codec)
6059 struct alc_spec *spec = codec->spec;
6060 snd_hda_gen_update_outputs(codec);
6061 if (snd_hda_jack_detect(codec, 0x1b))
6062 spec->gen.mute_bits |= (1ULL << 0x14);
6065 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6066 const struct hda_fixup *fix, int action)
6068 struct alc_spec *spec = codec->spec;
6069 static const struct hda_pintbl dock_pins[] = {
6070 { 0x1b, 0x21114000 }, /* dock speaker pin */
6075 case HDA_FIXUP_ACT_PRE_PROBE:
6076 spec->init_amp = ALC_INIT_DEFAULT;
6077 /* TX300 needs to set up GPIO2 for the speaker amp */
6078 alc_setup_gpio(codec, 0x04);
6079 snd_hda_apply_pincfgs(codec, dock_pins);
6080 spec->gen.auto_mute_via_amp = 1;
6081 spec->gen.automute_hook = asus_tx300_automute;
6082 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6083 snd_hda_gen_hp_automute);
6085 case HDA_FIXUP_ACT_PROBE:
6086 spec->init_amp = ALC_INIT_DEFAULT;
6088 case HDA_FIXUP_ACT_BUILD:
6089 /* this is a bit tricky; give more sane names for the main
6090 * (tablet) speaker and the dock speaker, respectively
6092 rename_ctl(codec, "Speaker Playback Switch",
6093 "Dock Speaker Playback Switch");
6094 rename_ctl(codec, "Bass Speaker Playback Switch",
6095 "Speaker Playback Switch");
6100 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6101 const struct hda_fixup *fix, int action)
6103 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6104 /* DAC node 0x03 is giving mono output. We therefore want to
6105 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6106 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6107 static const hda_nid_t conn1[] = { 0x0c };
6108 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6109 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6113 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6114 const struct hda_fixup *fix, int action)
6116 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6117 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6118 we can't adjust the speaker's volume since this node does not has
6119 Amp-out capability. we change the speaker's route to:
6120 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6121 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6122 speaker's volume now. */
6124 static const hda_nid_t conn1[] = { 0x0c };
6125 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6129 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6130 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6131 const struct hda_fixup *fix, int action)
6133 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6134 static const hda_nid_t conn[] = { 0x02, 0x03 };
6135 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6139 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6140 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6141 const struct hda_fixup *fix, int action)
6143 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6144 static const hda_nid_t conn[] = { 0x02 };
6145 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6149 /* Hook to update amp GPIO4 for automute */
6150 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6151 struct hda_jack_callback *jack)
6153 struct alc_spec *spec = codec->spec;
6155 snd_hda_gen_hp_automute(codec, jack);
6156 /* mute_led_polarity is set to 0, so we pass inverted value here */
6157 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6158 !spec->gen.hp_jack_present);
6161 /* Manage GPIOs for HP EliteBook Folio 9480m.
6163 * GPIO4 is the headphone amplifier power control
6164 * GPIO3 is the audio output mute indicator LED
6167 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6168 const struct hda_fixup *fix,
6171 struct alc_spec *spec = codec->spec;
6173 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6174 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6175 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6176 spec->gpio_mask |= 0x10;
6177 spec->gpio_dir |= 0x10;
6178 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6182 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6183 const struct hda_fixup *fix,
6186 struct alc_spec *spec = codec->spec;
6188 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6189 spec->gpio_mask |= 0x04;
6190 spec->gpio_dir |= 0x04;
6191 /* set data bit low */
6195 /* Quirk for Thinkpad X1 7th and 8th Gen
6196 * The following fixed routing needed
6197 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6198 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6199 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6201 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6202 const struct hda_fixup *fix, int action)
6204 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6205 static const hda_nid_t preferred_pairs[] = {
6206 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6208 struct alc_spec *spec = codec->spec;
6211 case HDA_FIXUP_ACT_PRE_PROBE:
6212 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6213 spec->gen.preferred_dacs = preferred_pairs;
6215 case HDA_FIXUP_ACT_BUILD:
6216 /* The generic parser creates somewhat unintuitive volume ctls
6217 * with the fixed routing above, and the shared DAC2 may be
6219 * Rename those to unique names so that PA doesn't touch them
6220 * and use only Master volume.
6222 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6223 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6228 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6229 const struct hda_fixup *fix,
6232 alc_fixup_dual_codecs(codec, fix, action);
6234 case HDA_FIXUP_ACT_PRE_PROBE:
6235 /* override card longname to provide a unique UCM profile */
6236 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6238 case HDA_FIXUP_ACT_BUILD:
6239 /* rename Capture controls depending on the codec */
6240 rename_ctl(codec, "Capture Volume",
6242 "Rear-Panel Capture Volume" :
6243 "Front-Panel Capture Volume");
6244 rename_ctl(codec, "Capture Switch",
6246 "Rear-Panel Capture Switch" :
6247 "Front-Panel Capture Switch");
6252 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6253 const struct hda_fixup *fix, int action)
6255 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6258 codec->power_save_node = 1;
6261 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6262 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6263 const struct hda_fixup *fix, int action)
6265 struct alc_spec *spec = codec->spec;
6266 static const hda_nid_t preferred_pairs[] = {
6267 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6271 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6274 spec->gen.preferred_dacs = preferred_pairs;
6275 spec->gen.auto_mute_via_amp = 1;
6276 codec->power_save_node = 0;
6279 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6280 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6281 const struct hda_fixup *fix, int action)
6283 static const hda_nid_t preferred_pairs[] = {
6284 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6286 struct alc_spec *spec = codec->spec;
6288 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6289 spec->gen.preferred_dacs = preferred_pairs;
6290 spec->gen.obey_preferred_dacs = 1;
6294 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6295 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6296 const struct hda_fixup *fix, int action)
6298 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6301 snd_hda_override_wcaps(codec, 0x03, 0);
6304 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6306 switch (codec->core.vendor_id) {
6312 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6313 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6320 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6321 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6326 static void alc295_fixup_chromebook(struct hda_codec *codec,
6327 const struct hda_fixup *fix, int action)
6329 struct alc_spec *spec = codec->spec;
6332 case HDA_FIXUP_ACT_PRE_PROBE:
6333 spec->ultra_low_power = true;
6335 case HDA_FIXUP_ACT_INIT:
6336 alc_combo_jack_hp_jd_restart(codec);
6341 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6342 const struct hda_fixup *fix, int action)
6344 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6345 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6349 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6350 struct hda_jack_callback *cb)
6352 /* The Windows driver sets the codec up in a very different way where
6353 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6355 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6356 alc_write_coef_idx(codec, 0x10, 0x8a20);
6358 alc_write_coef_idx(codec, 0x10, 0x0a20);
6361 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6362 const struct hda_fixup *fix, int action)
6364 /* Pin 0x21: headphones/headset mic */
6365 if (!is_jack_detectable(codec, 0x21))
6369 case HDA_FIXUP_ACT_PRE_PROBE:
6370 snd_hda_jack_detect_enable_callback(codec, 0x21,
6371 alc294_gx502_toggle_output);
6373 case HDA_FIXUP_ACT_INIT:
6374 /* Make sure to start in a correct state, i.e. if
6375 * headphones have been plugged in before powering up the system
6377 alc294_gx502_toggle_output(codec, NULL);
6382 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6383 struct hda_jack_callback *cb)
6385 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6386 * responsible from changes between speakers and headphones
6388 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6389 alc_write_coef_idx(codec, 0x10, 0x8420);
6391 alc_write_coef_idx(codec, 0x10, 0x0a20);
6394 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6395 const struct hda_fixup *fix, int action)
6397 if (!is_jack_detectable(codec, 0x21))
6401 case HDA_FIXUP_ACT_PRE_PROBE:
6402 snd_hda_jack_detect_enable_callback(codec, 0x21,
6403 alc294_gu502_toggle_output);
6405 case HDA_FIXUP_ACT_INIT:
6406 alc294_gu502_toggle_output(codec, NULL);
6411 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6412 const struct hda_fixup *fix, int action)
6414 if (action != HDA_FIXUP_ACT_INIT)
6418 alc_write_coef_idx(codec, 0x65, 0x0);
6421 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6422 const struct hda_fixup *fix, int action)
6425 case HDA_FIXUP_ACT_INIT:
6426 alc_combo_jack_hp_jd_restart(codec);
6431 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6432 const struct hda_fixup *fix, int action)
6434 struct alc_spec *spec = codec->spec;
6437 case HDA_FIXUP_ACT_PRE_PROBE:
6438 /* Mic RING SLEEVE swap for combo jack */
6439 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6440 spec->no_internal_mic_pin = true;
6442 case HDA_FIXUP_ACT_INIT:
6443 alc_combo_jack_hp_jd_restart(codec);
6448 /* GPIO1 = amplifier on/off
6449 * GPIO3 = mic mute LED
6451 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6452 const struct hda_fixup *fix, int action)
6454 static const hda_nid_t conn[] = { 0x02 };
6456 struct alc_spec *spec = codec->spec;
6457 static const struct hda_pintbl pincfgs[] = {
6458 { 0x14, 0x90170110 }, /* front/high speakers */
6459 { 0x17, 0x90170130 }, /* back/bass speakers */
6463 //enable micmute led
6464 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6467 case HDA_FIXUP_ACT_PRE_PROBE:
6468 spec->micmute_led_polarity = 1;
6469 /* needed for amp of back speakers */
6470 spec->gpio_mask |= 0x01;
6471 spec->gpio_dir |= 0x01;
6472 snd_hda_apply_pincfgs(codec, pincfgs);
6473 /* share DAC to have unified volume control */
6474 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6475 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6477 case HDA_FIXUP_ACT_INIT:
6478 /* need to toggle GPIO to enable the amp of back speakers */
6479 alc_update_gpio_data(codec, 0x01, true);
6481 alc_update_gpio_data(codec, 0x01, false);
6486 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6487 const struct hda_fixup *fix, int action)
6489 static const hda_nid_t conn[] = { 0x02 };
6490 static const struct hda_pintbl pincfgs[] = {
6491 { 0x14, 0x90170110 }, /* rear speaker */
6496 case HDA_FIXUP_ACT_PRE_PROBE:
6497 snd_hda_apply_pincfgs(codec, pincfgs);
6498 /* force front speaker to DAC1 */
6499 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6504 /* for hda_fixup_thinkpad_acpi() */
6505 #include "thinkpad_helper.c"
6507 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6508 const struct hda_fixup *fix, int action)
6510 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6511 hda_fixup_thinkpad_acpi(codec, fix, action);
6514 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6515 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6516 const struct hda_fixup *fix,
6519 struct alc_spec *spec = codec->spec;
6522 case HDA_FIXUP_ACT_PRE_PROBE:
6523 spec->gen.suppress_auto_mute = 1;
6528 /* for alc295_fixup_hp_top_speakers */
6529 #include "hp_x360_helper.c"
6531 /* for alc285_fixup_ideapad_s740_coef() */
6532 #include "ideapad_s740_helper.c"
6534 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6535 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6536 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6537 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6541 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6542 const struct hda_fixup *fix,
6546 * A certain other OS sets these coeffs to different values. On at least
6547 * one TongFang barebone these settings might survive even a cold
6548 * reboot. So to restore a clean slate the values are explicitly reset
6549 * to default here. Without this, the external microphone is always in a
6550 * plugged-in state, while the internal microphone is always in an
6551 * unplugged state, breaking the ability to use the internal microphone.
6553 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6556 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6557 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6558 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6559 WRITE_COEF(0x49, 0x0149),
6563 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6564 const struct hda_fixup *fix,
6568 * The audio jack input and output is not detected on the ASRock NUC Box
6569 * 1100 series when cold booting without this fix. Warm rebooting from a
6570 * certain other OS makes the audio functional, as COEF settings are
6571 * preserved in this case. This fix sets these altered COEF values as
6574 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6577 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6578 const struct hda_fixup *fix,
6582 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6583 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6584 * needs an additional quirk for sound working after suspend and resume.
6586 if (codec->core.vendor_id == 0x10ec0256) {
6587 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6588 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6590 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6596 ALC269_FIXUP_SONY_VAIO,
6597 ALC275_FIXUP_SONY_VAIO_GPIO2,
6598 ALC269_FIXUP_DELL_M101Z,
6599 ALC269_FIXUP_SKU_IGNORE,
6600 ALC269_FIXUP_ASUS_G73JW,
6601 ALC269_FIXUP_LENOVO_EAPD,
6602 ALC275_FIXUP_SONY_HWEQ,
6603 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6605 ALC269_FIXUP_PCM_44K,
6606 ALC269_FIXUP_STEREO_DMIC,
6607 ALC269_FIXUP_HEADSET_MIC,
6608 ALC269_FIXUP_QUANTA_MUTE,
6609 ALC269_FIXUP_LIFEBOOK,
6610 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6611 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6612 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6613 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6616 ALC269VB_FIXUP_AMIC,
6617 ALC269VB_FIXUP_DMIC,
6618 ALC269_FIXUP_HP_MUTE_LED,
6619 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6620 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6621 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6622 ALC269_FIXUP_HP_GPIO_LED,
6623 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6624 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6625 ALC269_FIXUP_INV_DMIC,
6626 ALC269_FIXUP_LENOVO_DOCK,
6627 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6628 ALC269_FIXUP_NO_SHUTUP,
6629 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6630 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6631 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6632 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6633 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6634 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6635 ALC269_FIXUP_HEADSET_MODE,
6636 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6637 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6638 ALC269_FIXUP_ASUS_X101_FUNC,
6639 ALC269_FIXUP_ASUS_X101_VERB,
6640 ALC269_FIXUP_ASUS_X101,
6641 ALC271_FIXUP_AMIC_MIC2,
6642 ALC271_FIXUP_HP_GATE_MIC_JACK,
6643 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6644 ALC269_FIXUP_ACER_AC700,
6645 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6646 ALC269VB_FIXUP_ASUS_ZENBOOK,
6647 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6648 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6649 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6650 ALC283_FIXUP_CHROME_BOOK,
6651 ALC283_FIXUP_SENSE_COMBO_JACK,
6652 ALC282_FIXUP_ASUS_TX300,
6653 ALC283_FIXUP_INT_MIC,
6654 ALC290_FIXUP_MONO_SPEAKERS,
6655 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6656 ALC290_FIXUP_SUBWOOFER,
6657 ALC290_FIXUP_SUBWOOFER_HSJACK,
6658 ALC269_FIXUP_THINKPAD_ACPI,
6659 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6660 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6661 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6662 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6663 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6664 ALC255_FIXUP_HEADSET_MODE,
6665 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6666 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6667 ALC292_FIXUP_TPT440_DOCK,
6668 ALC292_FIXUP_TPT440,
6669 ALC283_FIXUP_HEADSET_MIC,
6670 ALC255_FIXUP_MIC_MUTE_LED,
6671 ALC282_FIXUP_ASPIRE_V5_PINS,
6672 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6673 ALC280_FIXUP_HP_GPIO4,
6674 ALC286_FIXUP_HP_GPIO_LED,
6675 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6676 ALC280_FIXUP_HP_DOCK_PINS,
6677 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6678 ALC280_FIXUP_HP_9480M,
6679 ALC245_FIXUP_HP_X360_AMP,
6680 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
6681 ALC288_FIXUP_DELL_HEADSET_MODE,
6682 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6683 ALC288_FIXUP_DELL_XPS_13,
6684 ALC288_FIXUP_DISABLE_AAMIX,
6685 ALC292_FIXUP_DELL_E7X_AAMIX,
6686 ALC292_FIXUP_DELL_E7X,
6687 ALC292_FIXUP_DISABLE_AAMIX,
6688 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6689 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6690 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6691 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6692 ALC275_FIXUP_DELL_XPS,
6693 ALC293_FIXUP_LENOVO_SPK_NOISE,
6694 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6695 ALC255_FIXUP_DELL_SPK_NOISE,
6696 ALC225_FIXUP_DISABLE_MIC_VREF,
6697 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6698 ALC295_FIXUP_DISABLE_DAC3,
6699 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6700 ALC280_FIXUP_HP_HEADSET_MIC,
6701 ALC221_FIXUP_HP_FRONT_MIC,
6702 ALC292_FIXUP_TPT460,
6703 ALC298_FIXUP_SPK_VOLUME,
6704 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6705 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6706 ALC269_FIXUP_ATIV_BOOK_8,
6707 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6708 ALC256_FIXUP_ASUS_HEADSET_MODE,
6709 ALC256_FIXUP_ASUS_MIC,
6710 ALC256_FIXUP_ASUS_AIO_GPIO2,
6711 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6712 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6713 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6714 ALC233_FIXUP_ACER_HEADSET_MIC,
6715 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6716 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6717 ALC225_FIXUP_S3_POP_NOISE,
6718 ALC700_FIXUP_INTEL_REFERENCE,
6719 ALC274_FIXUP_DELL_BIND_DACS,
6720 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6721 ALC298_FIXUP_TPT470_DOCK_FIX,
6722 ALC298_FIXUP_TPT470_DOCK,
6723 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6724 ALC255_FIXUP_DELL_HEADSET_MIC,
6725 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6726 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6727 ALC295_FIXUP_HP_X360,
6728 ALC221_FIXUP_HP_HEADSET_MIC,
6729 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6730 ALC295_FIXUP_HP_AUTO_MUTE,
6731 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6732 ALC294_FIXUP_ASUS_MIC,
6733 ALC294_FIXUP_ASUS_HEADSET_MIC,
6734 ALC294_FIXUP_ASUS_SPK,
6735 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6736 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6737 ALC255_FIXUP_ACER_HEADSET_MIC,
6738 ALC295_FIXUP_CHROME_BOOK,
6739 ALC225_FIXUP_HEADSET_JACK,
6740 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6741 ALC225_FIXUP_WYSE_AUTO_MUTE,
6742 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6743 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6744 ALC256_FIXUP_ASUS_HEADSET_MIC,
6745 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6746 ALC299_FIXUP_PREDATOR_SPK,
6747 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6748 ALC289_FIXUP_DELL_SPK2,
6749 ALC289_FIXUP_DUAL_SPK,
6750 ALC294_FIXUP_SPK2_TO_DAC1,
6751 ALC294_FIXUP_ASUS_DUAL_SPK,
6752 ALC285_FIXUP_THINKPAD_X1_GEN7,
6753 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6754 ALC294_FIXUP_ASUS_HPE,
6755 ALC294_FIXUP_ASUS_COEF_1B,
6756 ALC294_FIXUP_ASUS_GX502_HP,
6757 ALC294_FIXUP_ASUS_GX502_PINS,
6758 ALC294_FIXUP_ASUS_GX502_VERBS,
6759 ALC294_FIXUP_ASUS_GU502_HP,
6760 ALC294_FIXUP_ASUS_GU502_PINS,
6761 ALC294_FIXUP_ASUS_GU502_VERBS,
6762 ALC285_FIXUP_HP_GPIO_LED,
6763 ALC285_FIXUP_HP_MUTE_LED,
6764 ALC236_FIXUP_HP_GPIO_LED,
6765 ALC236_FIXUP_HP_MUTE_LED,
6766 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6767 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6768 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6769 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6770 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6771 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6772 ALC289_FIXUP_ASUS_GA401,
6773 ALC289_FIXUP_ASUS_GA502,
6774 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6775 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6776 ALC269_FIXUP_CZC_B20,
6777 ALC269_FIXUP_CZC_TMI,
6778 ALC269_FIXUP_CZC_L101,
6779 ALC269_FIXUP_LEMOTE_A1802,
6780 ALC269_FIXUP_LEMOTE_A190X,
6781 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6782 ALC233_FIXUP_INTEL_NUC8_DMIC,
6783 ALC233_FIXUP_INTEL_NUC8_BOOST,
6784 ALC256_FIXUP_INTEL_NUC10,
6785 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6786 ALC274_FIXUP_HP_MIC,
6787 ALC274_FIXUP_HP_HEADSET_MIC,
6788 ALC274_FIXUP_HP_ENVY_GPIO,
6789 ALC256_FIXUP_ASUS_HPE,
6790 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6791 ALC287_FIXUP_HP_GPIO_LED,
6792 ALC256_FIXUP_HP_HEADSET_MIC,
6793 ALC245_FIXUP_HP_GPIO_LED,
6794 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6795 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6796 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6797 ALC256_FIXUP_ACER_HEADSET_MIC,
6798 ALC285_FIXUP_IDEAPAD_S740_COEF,
6799 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6800 ALC295_FIXUP_ASUS_DACS,
6801 ALC295_FIXUP_HP_OMEN,
6802 ALC285_FIXUP_HP_SPECTRE_X360,
6803 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6804 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6805 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6806 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6807 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6808 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6809 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
6810 ALC287_FIXUP_13S_GEN2_SPEAKERS,
6811 ALC256_FIXUP_SET_COEF_DEFAULTS,
6812 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6813 ALC233_FIXUP_NO_AUDIO_JACK,
6814 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
6817 static const struct hda_fixup alc269_fixups[] = {
6818 [ALC269_FIXUP_GPIO2] = {
6819 .type = HDA_FIXUP_FUNC,
6820 .v.func = alc_fixup_gpio2,
6822 [ALC269_FIXUP_SONY_VAIO] = {
6823 .type = HDA_FIXUP_PINCTLS,
6824 .v.pins = (const struct hda_pintbl[]) {
6825 {0x19, PIN_VREFGRD},
6829 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6830 .type = HDA_FIXUP_FUNC,
6831 .v.func = alc275_fixup_gpio4_off,
6833 .chain_id = ALC269_FIXUP_SONY_VAIO
6835 [ALC269_FIXUP_DELL_M101Z] = {
6836 .type = HDA_FIXUP_VERBS,
6837 .v.verbs = (const struct hda_verb[]) {
6838 /* Enables internal speaker */
6839 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6840 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6844 [ALC269_FIXUP_SKU_IGNORE] = {
6845 .type = HDA_FIXUP_FUNC,
6846 .v.func = alc_fixup_sku_ignore,
6848 [ALC269_FIXUP_ASUS_G73JW] = {
6849 .type = HDA_FIXUP_PINS,
6850 .v.pins = (const struct hda_pintbl[]) {
6851 { 0x17, 0x99130111 }, /* subwoofer */
6855 [ALC269_FIXUP_LENOVO_EAPD] = {
6856 .type = HDA_FIXUP_VERBS,
6857 .v.verbs = (const struct hda_verb[]) {
6858 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6862 [ALC275_FIXUP_SONY_HWEQ] = {
6863 .type = HDA_FIXUP_FUNC,
6864 .v.func = alc269_fixup_hweq,
6866 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6868 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6869 .type = HDA_FIXUP_FUNC,
6870 .v.func = alc_fixup_disable_aamix,
6872 .chain_id = ALC269_FIXUP_SONY_VAIO
6874 [ALC271_FIXUP_DMIC] = {
6875 .type = HDA_FIXUP_FUNC,
6876 .v.func = alc271_fixup_dmic,
6878 [ALC269_FIXUP_PCM_44K] = {
6879 .type = HDA_FIXUP_FUNC,
6880 .v.func = alc269_fixup_pcm_44k,
6882 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6884 [ALC269_FIXUP_STEREO_DMIC] = {
6885 .type = HDA_FIXUP_FUNC,
6886 .v.func = alc269_fixup_stereo_dmic,
6888 [ALC269_FIXUP_HEADSET_MIC] = {
6889 .type = HDA_FIXUP_FUNC,
6890 .v.func = alc269_fixup_headset_mic,
6892 [ALC269_FIXUP_QUANTA_MUTE] = {
6893 .type = HDA_FIXUP_FUNC,
6894 .v.func = alc269_fixup_quanta_mute,
6896 [ALC269_FIXUP_LIFEBOOK] = {
6897 .type = HDA_FIXUP_PINS,
6898 .v.pins = (const struct hda_pintbl[]) {
6899 { 0x1a, 0x2101103f }, /* dock line-out */
6900 { 0x1b, 0x23a11040 }, /* dock mic-in */
6904 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6906 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6907 .type = HDA_FIXUP_PINS,
6908 .v.pins = (const struct hda_pintbl[]) {
6909 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6913 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6914 .type = HDA_FIXUP_PINS,
6915 .v.pins = (const struct hda_pintbl[]) {
6916 { 0x21, 0x0221102f }, /* HP out */
6920 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6921 .type = HDA_FIXUP_FUNC,
6922 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6924 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6925 .type = HDA_FIXUP_FUNC,
6926 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6928 [ALC269_FIXUP_AMIC] = {
6929 .type = HDA_FIXUP_PINS,
6930 .v.pins = (const struct hda_pintbl[]) {
6931 { 0x14, 0x99130110 }, /* speaker */
6932 { 0x15, 0x0121401f }, /* HP out */
6933 { 0x18, 0x01a19c20 }, /* mic */
6934 { 0x19, 0x99a3092f }, /* int-mic */
6938 [ALC269_FIXUP_DMIC] = {
6939 .type = HDA_FIXUP_PINS,
6940 .v.pins = (const struct hda_pintbl[]) {
6941 { 0x12, 0x99a3092f }, /* int-mic */
6942 { 0x14, 0x99130110 }, /* speaker */
6943 { 0x15, 0x0121401f }, /* HP out */
6944 { 0x18, 0x01a19c20 }, /* mic */
6948 [ALC269VB_FIXUP_AMIC] = {
6949 .type = HDA_FIXUP_PINS,
6950 .v.pins = (const struct hda_pintbl[]) {
6951 { 0x14, 0x99130110 }, /* speaker */
6952 { 0x18, 0x01a19c20 }, /* mic */
6953 { 0x19, 0x99a3092f }, /* int-mic */
6954 { 0x21, 0x0121401f }, /* HP out */
6958 [ALC269VB_FIXUP_DMIC] = {
6959 .type = HDA_FIXUP_PINS,
6960 .v.pins = (const struct hda_pintbl[]) {
6961 { 0x12, 0x99a3092f }, /* int-mic */
6962 { 0x14, 0x99130110 }, /* speaker */
6963 { 0x18, 0x01a19c20 }, /* mic */
6964 { 0x21, 0x0121401f }, /* HP out */
6968 [ALC269_FIXUP_HP_MUTE_LED] = {
6969 .type = HDA_FIXUP_FUNC,
6970 .v.func = alc269_fixup_hp_mute_led,
6972 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6973 .type = HDA_FIXUP_FUNC,
6974 .v.func = alc269_fixup_hp_mute_led_mic1,
6976 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6977 .type = HDA_FIXUP_FUNC,
6978 .v.func = alc269_fixup_hp_mute_led_mic2,
6980 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6981 .type = HDA_FIXUP_FUNC,
6982 .v.func = alc269_fixup_hp_mute_led_mic3,
6984 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6986 [ALC269_FIXUP_HP_GPIO_LED] = {
6987 .type = HDA_FIXUP_FUNC,
6988 .v.func = alc269_fixup_hp_gpio_led,
6990 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6991 .type = HDA_FIXUP_FUNC,
6992 .v.func = alc269_fixup_hp_gpio_mic1_led,
6994 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6995 .type = HDA_FIXUP_FUNC,
6996 .v.func = alc269_fixup_hp_line1_mic1_led,
6998 [ALC269_FIXUP_INV_DMIC] = {
6999 .type = HDA_FIXUP_FUNC,
7000 .v.func = alc_fixup_inv_dmic,
7002 [ALC269_FIXUP_NO_SHUTUP] = {
7003 .type = HDA_FIXUP_FUNC,
7004 .v.func = alc_fixup_no_shutup,
7006 [ALC269_FIXUP_LENOVO_DOCK] = {
7007 .type = HDA_FIXUP_PINS,
7008 .v.pins = (const struct hda_pintbl[]) {
7009 { 0x19, 0x23a11040 }, /* dock mic */
7010 { 0x1b, 0x2121103f }, /* dock headphone */
7014 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7016 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7017 .type = HDA_FIXUP_FUNC,
7018 .v.func = alc269_fixup_limit_int_mic_boost,
7020 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7022 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7023 .type = HDA_FIXUP_FUNC,
7024 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7026 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7028 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7029 .type = HDA_FIXUP_PINS,
7030 .v.pins = (const struct hda_pintbl[]) {
7031 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7032 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7036 .chain_id = ALC269_FIXUP_HEADSET_MODE
7038 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7039 .type = HDA_FIXUP_PINS,
7040 .v.pins = (const struct hda_pintbl[]) {
7041 { 0x16, 0x21014020 }, /* dock line out */
7042 { 0x19, 0x21a19030 }, /* dock mic */
7043 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7047 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7049 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7050 .type = HDA_FIXUP_PINS,
7051 .v.pins = (const struct hda_pintbl[]) {
7052 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7056 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7058 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7059 .type = HDA_FIXUP_PINS,
7060 .v.pins = (const struct hda_pintbl[]) {
7061 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7062 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7066 .chain_id = ALC269_FIXUP_HEADSET_MODE
7068 [ALC269_FIXUP_HEADSET_MODE] = {
7069 .type = HDA_FIXUP_FUNC,
7070 .v.func = alc_fixup_headset_mode,
7072 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7074 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7075 .type = HDA_FIXUP_FUNC,
7076 .v.func = alc_fixup_headset_mode_no_hp_mic,
7078 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7079 .type = HDA_FIXUP_PINS,
7080 .v.pins = (const struct hda_pintbl[]) {
7081 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7085 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7087 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7088 .type = HDA_FIXUP_PINS,
7089 .v.pins = (const struct hda_pintbl[]) {
7090 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7094 .chain_id = ALC269_FIXUP_HEADSET_MIC
7096 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7097 .type = HDA_FIXUP_PINS,
7098 .v.pins = (const struct hda_pintbl[]) {
7112 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7114 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7115 .type = HDA_FIXUP_FUNC,
7116 .v.func = alc298_fixup_huawei_mbx_stereo,
7118 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7120 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7121 .type = HDA_FIXUP_FUNC,
7122 .v.func = alc269_fixup_x101_headset_mic,
7124 [ALC269_FIXUP_ASUS_X101_VERB] = {
7125 .type = HDA_FIXUP_VERBS,
7126 .v.verbs = (const struct hda_verb[]) {
7127 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7128 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7129 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7133 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7135 [ALC269_FIXUP_ASUS_X101] = {
7136 .type = HDA_FIXUP_PINS,
7137 .v.pins = (const struct hda_pintbl[]) {
7138 { 0x18, 0x04a1182c }, /* Headset mic */
7142 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7144 [ALC271_FIXUP_AMIC_MIC2] = {
7145 .type = HDA_FIXUP_PINS,
7146 .v.pins = (const struct hda_pintbl[]) {
7147 { 0x14, 0x99130110 }, /* speaker */
7148 { 0x19, 0x01a19c20 }, /* mic */
7149 { 0x1b, 0x99a7012f }, /* int-mic */
7150 { 0x21, 0x0121401f }, /* HP out */
7154 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7155 .type = HDA_FIXUP_FUNC,
7156 .v.func = alc271_hp_gate_mic_jack,
7158 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7160 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7161 .type = HDA_FIXUP_FUNC,
7162 .v.func = alc269_fixup_limit_int_mic_boost,
7164 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7166 [ALC269_FIXUP_ACER_AC700] = {
7167 .type = HDA_FIXUP_PINS,
7168 .v.pins = (const struct hda_pintbl[]) {
7169 { 0x12, 0x99a3092f }, /* int-mic */
7170 { 0x14, 0x99130110 }, /* speaker */
7171 { 0x18, 0x03a11c20 }, /* mic */
7172 { 0x1e, 0x0346101e }, /* SPDIF1 */
7173 { 0x21, 0x0321101f }, /* HP out */
7177 .chain_id = ALC271_FIXUP_DMIC,
7179 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7180 .type = HDA_FIXUP_FUNC,
7181 .v.func = alc269_fixup_limit_int_mic_boost,
7183 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7185 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7186 .type = HDA_FIXUP_FUNC,
7187 .v.func = alc269_fixup_limit_int_mic_boost,
7189 .chain_id = ALC269VB_FIXUP_DMIC,
7191 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7192 .type = HDA_FIXUP_VERBS,
7193 .v.verbs = (const struct hda_verb[]) {
7194 /* class-D output amp +5dB */
7195 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7196 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7200 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7202 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7203 .type = HDA_FIXUP_FUNC,
7204 .v.func = alc269_fixup_limit_int_mic_boost,
7206 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7208 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7209 .type = HDA_FIXUP_PINS,
7210 .v.pins = (const struct hda_pintbl[]) {
7211 { 0x12, 0x99a3092f }, /* int-mic */
7212 { 0x18, 0x03a11d20 }, /* mic */
7213 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7217 [ALC283_FIXUP_CHROME_BOOK] = {
7218 .type = HDA_FIXUP_FUNC,
7219 .v.func = alc283_fixup_chromebook,
7221 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7222 .type = HDA_FIXUP_FUNC,
7223 .v.func = alc283_fixup_sense_combo_jack,
7225 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7227 [ALC282_FIXUP_ASUS_TX300] = {
7228 .type = HDA_FIXUP_FUNC,
7229 .v.func = alc282_fixup_asus_tx300,
7231 [ALC283_FIXUP_INT_MIC] = {
7232 .type = HDA_FIXUP_VERBS,
7233 .v.verbs = (const struct hda_verb[]) {
7234 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7235 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7239 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7241 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7242 .type = HDA_FIXUP_PINS,
7243 .v.pins = (const struct hda_pintbl[]) {
7244 { 0x17, 0x90170112 }, /* subwoofer */
7248 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7250 [ALC290_FIXUP_SUBWOOFER] = {
7251 .type = HDA_FIXUP_PINS,
7252 .v.pins = (const struct hda_pintbl[]) {
7253 { 0x17, 0x90170112 }, /* subwoofer */
7257 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7259 [ALC290_FIXUP_MONO_SPEAKERS] = {
7260 .type = HDA_FIXUP_FUNC,
7261 .v.func = alc290_fixup_mono_speakers,
7263 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7264 .type = HDA_FIXUP_FUNC,
7265 .v.func = alc290_fixup_mono_speakers,
7267 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7269 [ALC269_FIXUP_THINKPAD_ACPI] = {
7270 .type = HDA_FIXUP_FUNC,
7271 .v.func = alc_fixup_thinkpad_acpi,
7273 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7275 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7276 .type = HDA_FIXUP_FUNC,
7277 .v.func = alc_fixup_inv_dmic,
7279 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7281 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7282 .type = HDA_FIXUP_PINS,
7283 .v.pins = (const struct hda_pintbl[]) {
7284 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7288 .chain_id = ALC255_FIXUP_HEADSET_MODE
7290 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7291 .type = HDA_FIXUP_PINS,
7292 .v.pins = (const struct hda_pintbl[]) {
7293 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7297 .chain_id = ALC255_FIXUP_HEADSET_MODE
7299 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7300 .type = HDA_FIXUP_PINS,
7301 .v.pins = (const struct hda_pintbl[]) {
7302 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7303 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7307 .chain_id = ALC255_FIXUP_HEADSET_MODE
7309 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7310 .type = HDA_FIXUP_PINS,
7311 .v.pins = (const struct hda_pintbl[]) {
7312 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7316 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7318 [ALC255_FIXUP_HEADSET_MODE] = {
7319 .type = HDA_FIXUP_FUNC,
7320 .v.func = alc_fixup_headset_mode_alc255,
7322 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7324 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7325 .type = HDA_FIXUP_FUNC,
7326 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7328 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7329 .type = HDA_FIXUP_PINS,
7330 .v.pins = (const struct hda_pintbl[]) {
7331 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7332 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7336 .chain_id = ALC269_FIXUP_HEADSET_MODE
7338 [ALC292_FIXUP_TPT440_DOCK] = {
7339 .type = HDA_FIXUP_FUNC,
7340 .v.func = alc_fixup_tpt440_dock,
7342 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7344 [ALC292_FIXUP_TPT440] = {
7345 .type = HDA_FIXUP_FUNC,
7346 .v.func = alc_fixup_disable_aamix,
7348 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7350 [ALC283_FIXUP_HEADSET_MIC] = {
7351 .type = HDA_FIXUP_PINS,
7352 .v.pins = (const struct hda_pintbl[]) {
7353 { 0x19, 0x04a110f0 },
7357 [ALC255_FIXUP_MIC_MUTE_LED] = {
7358 .type = HDA_FIXUP_FUNC,
7359 .v.func = alc_fixup_micmute_led,
7361 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7362 .type = HDA_FIXUP_PINS,
7363 .v.pins = (const struct hda_pintbl[]) {
7364 { 0x12, 0x90a60130 },
7365 { 0x14, 0x90170110 },
7366 { 0x17, 0x40000008 },
7367 { 0x18, 0x411111f0 },
7368 { 0x19, 0x01a1913c },
7369 { 0x1a, 0x411111f0 },
7370 { 0x1b, 0x411111f0 },
7371 { 0x1d, 0x40f89b2d },
7372 { 0x1e, 0x411111f0 },
7373 { 0x21, 0x0321101f },
7377 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7378 .type = HDA_FIXUP_FUNC,
7379 .v.func = alc269vb_fixup_aspire_e1_coef,
7381 [ALC280_FIXUP_HP_GPIO4] = {
7382 .type = HDA_FIXUP_FUNC,
7383 .v.func = alc280_fixup_hp_gpio4,
7385 [ALC286_FIXUP_HP_GPIO_LED] = {
7386 .type = HDA_FIXUP_FUNC,
7387 .v.func = alc286_fixup_hp_gpio_led,
7389 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7390 .type = HDA_FIXUP_FUNC,
7391 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7393 [ALC280_FIXUP_HP_DOCK_PINS] = {
7394 .type = HDA_FIXUP_PINS,
7395 .v.pins = (const struct hda_pintbl[]) {
7396 { 0x1b, 0x21011020 }, /* line-out */
7397 { 0x1a, 0x01a1903c }, /* headset mic */
7398 { 0x18, 0x2181103f }, /* line-in */
7402 .chain_id = ALC280_FIXUP_HP_GPIO4
7404 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7405 .type = HDA_FIXUP_PINS,
7406 .v.pins = (const struct hda_pintbl[]) {
7407 { 0x1b, 0x21011020 }, /* line-out */
7408 { 0x18, 0x2181103f }, /* line-in */
7412 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7414 [ALC280_FIXUP_HP_9480M] = {
7415 .type = HDA_FIXUP_FUNC,
7416 .v.func = alc280_fixup_hp_9480m,
7418 [ALC245_FIXUP_HP_X360_AMP] = {
7419 .type = HDA_FIXUP_FUNC,
7420 .v.func = alc245_fixup_hp_x360_amp,
7422 .chain_id = ALC245_FIXUP_HP_GPIO_LED
7424 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7425 .type = HDA_FIXUP_FUNC,
7426 .v.func = alc_fixup_headset_mode_dell_alc288,
7428 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7430 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7431 .type = HDA_FIXUP_PINS,
7432 .v.pins = (const struct hda_pintbl[]) {
7433 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7434 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7438 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7440 [ALC288_FIXUP_DISABLE_AAMIX] = {
7441 .type = HDA_FIXUP_FUNC,
7442 .v.func = alc_fixup_disable_aamix,
7444 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7446 [ALC288_FIXUP_DELL_XPS_13] = {
7447 .type = HDA_FIXUP_FUNC,
7448 .v.func = alc_fixup_dell_xps13,
7450 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7452 [ALC292_FIXUP_DISABLE_AAMIX] = {
7453 .type = HDA_FIXUP_FUNC,
7454 .v.func = alc_fixup_disable_aamix,
7456 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7458 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7459 .type = HDA_FIXUP_FUNC,
7460 .v.func = alc_fixup_disable_aamix,
7462 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7464 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7465 .type = HDA_FIXUP_FUNC,
7466 .v.func = alc_fixup_dell_xps13,
7468 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7470 [ALC292_FIXUP_DELL_E7X] = {
7471 .type = HDA_FIXUP_FUNC,
7472 .v.func = alc_fixup_micmute_led,
7473 /* micmute fixup must be applied at last */
7474 .chained_before = true,
7475 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7477 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7478 .type = HDA_FIXUP_PINS,
7479 .v.pins = (const struct hda_pintbl[]) {
7480 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7483 .chained_before = true,
7484 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7486 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7487 .type = HDA_FIXUP_PINS,
7488 .v.pins = (const struct hda_pintbl[]) {
7489 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7490 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7494 .chain_id = ALC269_FIXUP_HEADSET_MODE
7496 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7497 .type = HDA_FIXUP_PINS,
7498 .v.pins = (const struct hda_pintbl[]) {
7499 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7503 .chain_id = ALC269_FIXUP_HEADSET_MODE
7505 [ALC275_FIXUP_DELL_XPS] = {
7506 .type = HDA_FIXUP_VERBS,
7507 .v.verbs = (const struct hda_verb[]) {
7508 /* Enables internal speaker */
7509 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7510 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7511 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7512 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7516 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7517 .type = HDA_FIXUP_FUNC,
7518 .v.func = alc_fixup_disable_aamix,
7520 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7522 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7523 .type = HDA_FIXUP_FUNC,
7524 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7526 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7527 .type = HDA_FIXUP_FUNC,
7528 .v.func = alc_fixup_inv_dmic,
7530 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7532 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7533 .type = HDA_FIXUP_FUNC,
7534 .v.func = alc269_fixup_limit_int_mic_boost
7536 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7537 .type = HDA_FIXUP_FUNC,
7538 .v.func = alc_fixup_disable_aamix,
7540 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7542 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7543 .type = HDA_FIXUP_FUNC,
7544 .v.func = alc_fixup_disable_mic_vref,
7546 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7548 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7549 .type = HDA_FIXUP_VERBS,
7550 .v.verbs = (const struct hda_verb[]) {
7551 /* Disable pass-through path for FRONT 14h */
7552 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7553 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7557 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7559 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7560 .type = HDA_FIXUP_FUNC,
7561 .v.func = alc_fixup_disable_aamix,
7563 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7565 [ALC221_FIXUP_HP_FRONT_MIC] = {
7566 .type = HDA_FIXUP_PINS,
7567 .v.pins = (const struct hda_pintbl[]) {
7568 { 0x19, 0x02a19020 }, /* Front Mic */
7572 [ALC292_FIXUP_TPT460] = {
7573 .type = HDA_FIXUP_FUNC,
7574 .v.func = alc_fixup_tpt440_dock,
7576 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7578 [ALC298_FIXUP_SPK_VOLUME] = {
7579 .type = HDA_FIXUP_FUNC,
7580 .v.func = alc298_fixup_speaker_volume,
7582 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7584 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7585 .type = HDA_FIXUP_FUNC,
7586 .v.func = alc298_fixup_speaker_volume,
7588 [ALC295_FIXUP_DISABLE_DAC3] = {
7589 .type = HDA_FIXUP_FUNC,
7590 .v.func = alc295_fixup_disable_dac3,
7592 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7593 .type = HDA_FIXUP_FUNC,
7594 .v.func = alc285_fixup_speaker2_to_dac1,
7596 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7598 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7599 .type = HDA_FIXUP_PINS,
7600 .v.pins = (const struct hda_pintbl[]) {
7601 { 0x1b, 0x90170151 },
7605 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7607 [ALC269_FIXUP_ATIV_BOOK_8] = {
7608 .type = HDA_FIXUP_FUNC,
7609 .v.func = alc_fixup_auto_mute_via_amp,
7611 .chain_id = ALC269_FIXUP_NO_SHUTUP
7613 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7614 .type = HDA_FIXUP_PINS,
7615 .v.pins = (const struct hda_pintbl[]) {
7616 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7617 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7621 .chain_id = ALC269_FIXUP_HEADSET_MODE
7623 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7624 .type = HDA_FIXUP_FUNC,
7625 .v.func = alc_fixup_headset_mode,
7627 [ALC256_FIXUP_ASUS_MIC] = {
7628 .type = HDA_FIXUP_PINS,
7629 .v.pins = (const struct hda_pintbl[]) {
7630 { 0x13, 0x90a60160 }, /* use as internal mic */
7631 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7635 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7637 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7638 .type = HDA_FIXUP_FUNC,
7639 /* Set up GPIO2 for the speaker amp */
7640 .v.func = alc_fixup_gpio4,
7642 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7643 .type = HDA_FIXUP_PINS,
7644 .v.pins = (const struct hda_pintbl[]) {
7645 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7649 .chain_id = ALC269_FIXUP_HEADSET_MIC
7651 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7652 .type = HDA_FIXUP_VERBS,
7653 .v.verbs = (const struct hda_verb[]) {
7654 /* Enables internal speaker */
7655 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7656 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7660 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7662 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7663 .type = HDA_FIXUP_FUNC,
7664 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7666 .chain_id = ALC269_FIXUP_GPIO2
7668 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7669 .type = HDA_FIXUP_VERBS,
7670 .v.verbs = (const struct hda_verb[]) {
7671 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7672 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7676 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7678 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7679 .type = HDA_FIXUP_PINS,
7680 .v.pins = (const struct hda_pintbl[]) {
7681 /* Change the mic location from front to right, otherwise there are
7682 two front mics with the same name, pulseaudio can't handle them.
7683 This is just a temporary workaround, after applying this fixup,
7684 there will be one "Front Mic" and one "Mic" in this machine.
7686 { 0x1a, 0x04a19040 },
7690 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7691 .type = HDA_FIXUP_PINS,
7692 .v.pins = (const struct hda_pintbl[]) {
7693 { 0x16, 0x0101102f }, /* Rear Headset HP */
7694 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7695 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7696 { 0x1b, 0x02011020 },
7700 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7702 [ALC225_FIXUP_S3_POP_NOISE] = {
7703 .type = HDA_FIXUP_FUNC,
7704 .v.func = alc225_fixup_s3_pop_noise,
7706 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7708 [ALC700_FIXUP_INTEL_REFERENCE] = {
7709 .type = HDA_FIXUP_VERBS,
7710 .v.verbs = (const struct hda_verb[]) {
7711 /* Enables internal speaker */
7712 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7713 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7714 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7715 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7716 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7717 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7718 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7719 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7723 [ALC274_FIXUP_DELL_BIND_DACS] = {
7724 .type = HDA_FIXUP_FUNC,
7725 .v.func = alc274_fixup_bind_dacs,
7727 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7729 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7730 .type = HDA_FIXUP_PINS,
7731 .v.pins = (const struct hda_pintbl[]) {
7732 { 0x1b, 0x0401102f },
7736 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7738 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7739 .type = HDA_FIXUP_FUNC,
7740 .v.func = alc_fixup_tpt470_dock,
7742 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7744 [ALC298_FIXUP_TPT470_DOCK] = {
7745 .type = HDA_FIXUP_FUNC,
7746 .v.func = alc_fixup_tpt470_dacs,
7748 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7750 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7751 .type = HDA_FIXUP_PINS,
7752 .v.pins = (const struct hda_pintbl[]) {
7753 { 0x14, 0x0201101f },
7757 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7759 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7760 .type = HDA_FIXUP_PINS,
7761 .v.pins = (const struct hda_pintbl[]) {
7762 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7766 .chain_id = ALC269_FIXUP_HEADSET_MIC
7768 [ALC295_FIXUP_HP_X360] = {
7769 .type = HDA_FIXUP_FUNC,
7770 .v.func = alc295_fixup_hp_top_speakers,
7772 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7774 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7775 .type = HDA_FIXUP_PINS,
7776 .v.pins = (const struct hda_pintbl[]) {
7777 { 0x19, 0x0181313f},
7781 .chain_id = ALC269_FIXUP_HEADSET_MIC
7783 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7784 .type = HDA_FIXUP_FUNC,
7785 .v.func = alc285_fixup_invalidate_dacs,
7787 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7789 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7790 .type = HDA_FIXUP_FUNC,
7791 .v.func = alc_fixup_auto_mute_via_amp,
7793 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7794 .type = HDA_FIXUP_PINS,
7795 .v.pins = (const struct hda_pintbl[]) {
7796 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7800 .chain_id = ALC269_FIXUP_HEADSET_MIC
7802 [ALC294_FIXUP_ASUS_MIC] = {
7803 .type = HDA_FIXUP_PINS,
7804 .v.pins = (const struct hda_pintbl[]) {
7805 { 0x13, 0x90a60160 }, /* use as internal mic */
7806 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7810 .chain_id = ALC269_FIXUP_HEADSET_MIC
7812 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7813 .type = HDA_FIXUP_PINS,
7814 .v.pins = (const struct hda_pintbl[]) {
7815 { 0x19, 0x01a1103c }, /* use as headset mic */
7819 .chain_id = ALC269_FIXUP_HEADSET_MIC
7821 [ALC294_FIXUP_ASUS_SPK] = {
7822 .type = HDA_FIXUP_VERBS,
7823 .v.verbs = (const struct hda_verb[]) {
7825 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7826 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7827 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7828 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7832 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7834 [ALC295_FIXUP_CHROME_BOOK] = {
7835 .type = HDA_FIXUP_FUNC,
7836 .v.func = alc295_fixup_chromebook,
7838 .chain_id = ALC225_FIXUP_HEADSET_JACK
7840 [ALC225_FIXUP_HEADSET_JACK] = {
7841 .type = HDA_FIXUP_FUNC,
7842 .v.func = alc_fixup_headset_jack,
7844 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7845 .type = HDA_FIXUP_PINS,
7846 .v.pins = (const struct hda_pintbl[]) {
7847 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7851 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7853 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7854 .type = HDA_FIXUP_VERBS,
7855 .v.verbs = (const struct hda_verb[]) {
7856 /* Disable PCBEEP-IN passthrough */
7857 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7858 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7862 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7864 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7865 .type = HDA_FIXUP_PINS,
7866 .v.pins = (const struct hda_pintbl[]) {
7867 { 0x19, 0x03a11130 },
7868 { 0x1a, 0x90a60140 }, /* use as internal mic */
7872 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7874 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7875 .type = HDA_FIXUP_PINS,
7876 .v.pins = (const struct hda_pintbl[]) {
7877 { 0x16, 0x01011020 }, /* Rear Line out */
7878 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7882 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7884 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7885 .type = HDA_FIXUP_FUNC,
7886 .v.func = alc_fixup_auto_mute_via_amp,
7888 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7890 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7891 .type = HDA_FIXUP_FUNC,
7892 .v.func = alc_fixup_disable_mic_vref,
7894 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7896 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7897 .type = HDA_FIXUP_VERBS,
7898 .v.verbs = (const struct hda_verb[]) {
7899 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7900 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7904 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7906 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7907 .type = HDA_FIXUP_PINS,
7908 .v.pins = (const struct hda_pintbl[]) {
7909 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7913 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7915 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7916 .type = HDA_FIXUP_PINS,
7917 .v.pins = (const struct hda_pintbl[]) {
7918 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7922 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7924 [ALC299_FIXUP_PREDATOR_SPK] = {
7925 .type = HDA_FIXUP_PINS,
7926 .v.pins = (const struct hda_pintbl[]) {
7927 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7931 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7932 .type = HDA_FIXUP_PINS,
7933 .v.pins = (const struct hda_pintbl[]) {
7934 { 0x19, 0x04a11040 },
7935 { 0x21, 0x04211020 },
7939 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7941 [ALC289_FIXUP_DELL_SPK2] = {
7942 .type = HDA_FIXUP_PINS,
7943 .v.pins = (const struct hda_pintbl[]) {
7944 { 0x17, 0x90170130 }, /* bass spk */
7948 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7950 [ALC289_FIXUP_DUAL_SPK] = {
7951 .type = HDA_FIXUP_FUNC,
7952 .v.func = alc285_fixup_speaker2_to_dac1,
7954 .chain_id = ALC289_FIXUP_DELL_SPK2
7956 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7957 .type = HDA_FIXUP_FUNC,
7958 .v.func = alc285_fixup_speaker2_to_dac1,
7960 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7962 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7963 .type = HDA_FIXUP_FUNC,
7964 /* The GPIO must be pulled to initialize the AMP */
7965 .v.func = alc_fixup_gpio4,
7967 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7969 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
7970 .type = HDA_FIXUP_FUNC,
7971 .v.func = alc285_fixup_thinkpad_x1_gen7,
7973 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7975 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7976 .type = HDA_FIXUP_FUNC,
7977 .v.func = alc_fixup_headset_jack,
7979 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
7981 [ALC294_FIXUP_ASUS_HPE] = {
7982 .type = HDA_FIXUP_VERBS,
7983 .v.verbs = (const struct hda_verb[]) {
7985 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7986 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7990 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7992 [ALC294_FIXUP_ASUS_GX502_PINS] = {
7993 .type = HDA_FIXUP_PINS,
7994 .v.pins = (const struct hda_pintbl[]) {
7995 { 0x19, 0x03a11050 }, /* front HP mic */
7996 { 0x1a, 0x01a11830 }, /* rear external mic */
7997 { 0x21, 0x03211020 }, /* front HP out */
8001 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8003 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8004 .type = HDA_FIXUP_VERBS,
8005 .v.verbs = (const struct hda_verb[]) {
8006 /* set 0x15 to HP-OUT ctrl */
8007 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8008 /* unmute the 0x15 amp */
8009 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8013 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8015 [ALC294_FIXUP_ASUS_GX502_HP] = {
8016 .type = HDA_FIXUP_FUNC,
8017 .v.func = alc294_fixup_gx502_hp,
8019 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8020 .type = HDA_FIXUP_PINS,
8021 .v.pins = (const struct hda_pintbl[]) {
8022 { 0x19, 0x01a11050 }, /* rear HP mic */
8023 { 0x1a, 0x01a11830 }, /* rear external mic */
8024 { 0x21, 0x012110f0 }, /* rear HP out */
8028 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8030 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8031 .type = HDA_FIXUP_VERBS,
8032 .v.verbs = (const struct hda_verb[]) {
8033 /* set 0x15 to HP-OUT ctrl */
8034 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8035 /* unmute the 0x15 amp */
8036 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8037 /* set 0x1b to HP-OUT */
8038 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8042 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8044 [ALC294_FIXUP_ASUS_GU502_HP] = {
8045 .type = HDA_FIXUP_FUNC,
8046 .v.func = alc294_fixup_gu502_hp,
8048 [ALC294_FIXUP_ASUS_COEF_1B] = {
8049 .type = HDA_FIXUP_VERBS,
8050 .v.verbs = (const struct hda_verb[]) {
8051 /* Set bit 10 to correct noisy output after reboot from
8052 * Windows 10 (due to pop noise reduction?)
8054 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8055 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8059 .chain_id = ALC289_FIXUP_ASUS_GA401,
8061 [ALC285_FIXUP_HP_GPIO_LED] = {
8062 .type = HDA_FIXUP_FUNC,
8063 .v.func = alc285_fixup_hp_gpio_led,
8065 [ALC285_FIXUP_HP_MUTE_LED] = {
8066 .type = HDA_FIXUP_FUNC,
8067 .v.func = alc285_fixup_hp_mute_led,
8069 [ALC236_FIXUP_HP_GPIO_LED] = {
8070 .type = HDA_FIXUP_FUNC,
8071 .v.func = alc236_fixup_hp_gpio_led,
8073 [ALC236_FIXUP_HP_MUTE_LED] = {
8074 .type = HDA_FIXUP_FUNC,
8075 .v.func = alc236_fixup_hp_mute_led,
8077 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8078 .type = HDA_FIXUP_FUNC,
8079 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8081 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8082 .type = HDA_FIXUP_VERBS,
8083 .v.verbs = (const struct hda_verb[]) {
8084 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8088 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8089 .type = HDA_FIXUP_PINS,
8090 .v.pins = (const struct hda_pintbl[]) {
8091 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8095 .chain_id = ALC269_FIXUP_HEADSET_MODE
8097 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8098 .type = HDA_FIXUP_PINS,
8099 .v.pins = (const struct hda_pintbl[]) {
8100 { 0x14, 0x90100120 }, /* use as internal speaker */
8101 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8102 { 0x1a, 0x01011020 }, /* use as line out */
8106 .chain_id = ALC269_FIXUP_HEADSET_MIC
8108 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8109 .type = HDA_FIXUP_PINS,
8110 .v.pins = (const struct hda_pintbl[]) {
8111 { 0x18, 0x02a11030 }, /* use as headset mic */
8115 .chain_id = ALC269_FIXUP_HEADSET_MIC
8117 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8118 .type = HDA_FIXUP_PINS,
8119 .v.pins = (const struct hda_pintbl[]) {
8120 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8124 .chain_id = ALC269_FIXUP_HEADSET_MIC
8126 [ALC289_FIXUP_ASUS_GA401] = {
8127 .type = HDA_FIXUP_FUNC,
8128 .v.func = alc289_fixup_asus_ga401,
8130 .chain_id = ALC289_FIXUP_ASUS_GA502,
8132 [ALC289_FIXUP_ASUS_GA502] = {
8133 .type = HDA_FIXUP_PINS,
8134 .v.pins = (const struct hda_pintbl[]) {
8135 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8139 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8140 .type = HDA_FIXUP_PINS,
8141 .v.pins = (const struct hda_pintbl[]) {
8142 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8146 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8148 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8149 .type = HDA_FIXUP_FUNC,
8150 .v.func = alc285_fixup_hp_gpio_amp_init,
8152 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8154 [ALC269_FIXUP_CZC_B20] = {
8155 .type = HDA_FIXUP_PINS,
8156 .v.pins = (const struct hda_pintbl[]) {
8157 { 0x12, 0x411111f0 },
8158 { 0x14, 0x90170110 }, /* speaker */
8159 { 0x15, 0x032f1020 }, /* HP out */
8160 { 0x17, 0x411111f0 },
8161 { 0x18, 0x03ab1040 }, /* mic */
8162 { 0x19, 0xb7a7013f },
8163 { 0x1a, 0x0181305f },
8164 { 0x1b, 0x411111f0 },
8165 { 0x1d, 0x411111f0 },
8166 { 0x1e, 0x411111f0 },
8169 .chain_id = ALC269_FIXUP_DMIC,
8171 [ALC269_FIXUP_CZC_TMI] = {
8172 .type = HDA_FIXUP_PINS,
8173 .v.pins = (const struct hda_pintbl[]) {
8174 { 0x12, 0x4000c000 },
8175 { 0x14, 0x90170110 }, /* speaker */
8176 { 0x15, 0x0421401f }, /* HP out */
8177 { 0x17, 0x411111f0 },
8178 { 0x18, 0x04a19020 }, /* mic */
8179 { 0x19, 0x411111f0 },
8180 { 0x1a, 0x411111f0 },
8181 { 0x1b, 0x411111f0 },
8182 { 0x1d, 0x40448505 },
8183 { 0x1e, 0x411111f0 },
8184 { 0x20, 0x8000ffff },
8187 .chain_id = ALC269_FIXUP_DMIC,
8189 [ALC269_FIXUP_CZC_L101] = {
8190 .type = HDA_FIXUP_PINS,
8191 .v.pins = (const struct hda_pintbl[]) {
8192 { 0x12, 0x40000000 },
8193 { 0x14, 0x01014010 }, /* speaker */
8194 { 0x15, 0x411111f0 }, /* HP out */
8195 { 0x16, 0x411111f0 },
8196 { 0x18, 0x01a19020 }, /* mic */
8197 { 0x19, 0x02a19021 },
8198 { 0x1a, 0x0181302f },
8199 { 0x1b, 0x0221401f },
8200 { 0x1c, 0x411111f0 },
8201 { 0x1d, 0x4044c601 },
8202 { 0x1e, 0x411111f0 },
8205 .chain_id = ALC269_FIXUP_DMIC,
8207 [ALC269_FIXUP_LEMOTE_A1802] = {
8208 .type = HDA_FIXUP_PINS,
8209 .v.pins = (const struct hda_pintbl[]) {
8210 { 0x12, 0x40000000 },
8211 { 0x14, 0x90170110 }, /* speaker */
8212 { 0x17, 0x411111f0 },
8213 { 0x18, 0x03a19040 }, /* mic1 */
8214 { 0x19, 0x90a70130 }, /* mic2 */
8215 { 0x1a, 0x411111f0 },
8216 { 0x1b, 0x411111f0 },
8217 { 0x1d, 0x40489d2d },
8218 { 0x1e, 0x411111f0 },
8219 { 0x20, 0x0003ffff },
8220 { 0x21, 0x03214020 },
8223 .chain_id = ALC269_FIXUP_DMIC,
8225 [ALC269_FIXUP_LEMOTE_A190X] = {
8226 .type = HDA_FIXUP_PINS,
8227 .v.pins = (const struct hda_pintbl[]) {
8228 { 0x14, 0x99130110 }, /* speaker */
8229 { 0x15, 0x0121401f }, /* HP out */
8230 { 0x18, 0x01a19c20 }, /* rear mic */
8231 { 0x19, 0x99a3092f }, /* front mic */
8232 { 0x1b, 0x0201401f }, /* front lineout */
8235 .chain_id = ALC269_FIXUP_DMIC,
8237 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8238 .type = HDA_FIXUP_PINS,
8239 .v.pins = (const struct hda_pintbl[]) {
8240 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8244 .chain_id = ALC269_FIXUP_HEADSET_MODE
8246 [ALC256_FIXUP_INTEL_NUC10] = {
8247 .type = HDA_FIXUP_PINS,
8248 .v.pins = (const struct hda_pintbl[]) {
8249 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8253 .chain_id = ALC269_FIXUP_HEADSET_MODE
8255 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8256 .type = HDA_FIXUP_VERBS,
8257 .v.verbs = (const struct hda_verb[]) {
8258 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8259 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8263 .chain_id = ALC289_FIXUP_ASUS_GA502
8265 [ALC274_FIXUP_HP_MIC] = {
8266 .type = HDA_FIXUP_VERBS,
8267 .v.verbs = (const struct hda_verb[]) {
8268 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8269 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8273 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8274 .type = HDA_FIXUP_FUNC,
8275 .v.func = alc274_fixup_hp_headset_mic,
8277 .chain_id = ALC274_FIXUP_HP_MIC
8279 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8280 .type = HDA_FIXUP_FUNC,
8281 .v.func = alc274_fixup_hp_envy_gpio,
8283 [ALC256_FIXUP_ASUS_HPE] = {
8284 .type = HDA_FIXUP_VERBS,
8285 .v.verbs = (const struct hda_verb[]) {
8287 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8288 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8292 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8294 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8295 .type = HDA_FIXUP_FUNC,
8296 .v.func = alc_fixup_headset_jack,
8298 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8300 [ALC287_FIXUP_HP_GPIO_LED] = {
8301 .type = HDA_FIXUP_FUNC,
8302 .v.func = alc287_fixup_hp_gpio_led,
8304 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8305 .type = HDA_FIXUP_FUNC,
8306 .v.func = alc274_fixup_hp_headset_mic,
8308 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8309 .type = HDA_FIXUP_FUNC,
8310 .v.func = alc_fixup_no_int_mic,
8312 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8314 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8315 .type = HDA_FIXUP_PINS,
8316 .v.pins = (const struct hda_pintbl[]) {
8317 { 0x1b, 0x411111f0 },
8318 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8322 .chain_id = ALC269_FIXUP_HEADSET_MODE
8324 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8325 .type = HDA_FIXUP_FUNC,
8326 .v.func = alc269_fixup_limit_int_mic_boost,
8328 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8330 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8331 .type = HDA_FIXUP_PINS,
8332 .v.pins = (const struct hda_pintbl[]) {
8333 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8334 { 0x1a, 0x90a1092f }, /* use as internal mic */
8338 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8340 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8341 .type = HDA_FIXUP_FUNC,
8342 .v.func = alc285_fixup_ideapad_s740_coef,
8344 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8346 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8347 .type = HDA_FIXUP_FUNC,
8348 .v.func = alc269_fixup_limit_int_mic_boost,
8350 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8352 [ALC295_FIXUP_ASUS_DACS] = {
8353 .type = HDA_FIXUP_FUNC,
8354 .v.func = alc295_fixup_asus_dacs,
8356 [ALC295_FIXUP_HP_OMEN] = {
8357 .type = HDA_FIXUP_PINS,
8358 .v.pins = (const struct hda_pintbl[]) {
8359 { 0x12, 0xb7a60130 },
8360 { 0x13, 0x40000000 },
8361 { 0x14, 0x411111f0 },
8362 { 0x16, 0x411111f0 },
8363 { 0x17, 0x90170110 },
8364 { 0x18, 0x411111f0 },
8365 { 0x19, 0x02a11030 },
8366 { 0x1a, 0x411111f0 },
8367 { 0x1b, 0x04a19030 },
8368 { 0x1d, 0x40600001 },
8369 { 0x1e, 0x411111f0 },
8370 { 0x21, 0x03211020 },
8374 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8376 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8377 .type = HDA_FIXUP_FUNC,
8378 .v.func = alc285_fixup_hp_spectre_x360,
8380 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8381 .type = HDA_FIXUP_FUNC,
8382 .v.func = alc285_fixup_hp_spectre_x360_eb1
8384 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8385 .type = HDA_FIXUP_FUNC,
8386 .v.func = alc285_fixup_ideapad_s740_coef,
8388 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8390 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8391 .type = HDA_FIXUP_FUNC,
8392 .v.func = alc_fixup_no_shutup,
8394 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8396 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8397 .type = HDA_FIXUP_PINS,
8398 .v.pins = (const struct hda_pintbl[]) {
8399 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8403 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8405 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8406 .type = HDA_FIXUP_FUNC,
8407 .v.func = alc269_fixup_limit_int_mic_boost,
8409 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8411 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8412 .type = HDA_FIXUP_VERBS,
8413 //.v.verbs = legion_15imhg05_coefs,
8414 .v.verbs = (const struct hda_verb[]) {
8415 // set left speaker Legion 7i.
8416 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8417 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8419 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8420 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8421 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8422 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8423 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8425 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8426 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8427 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8428 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8429 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8431 // set right speaker Legion 7i.
8432 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8433 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8435 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8436 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8437 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8438 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8439 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8441 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8442 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8443 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8444 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8445 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8449 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8451 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8452 .type = HDA_FIXUP_FUNC,
8453 .v.func = alc287_fixup_legion_15imhg05_speakers,
8455 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8457 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8458 .type = HDA_FIXUP_VERBS,
8459 .v.verbs = (const struct hda_verb[]) {
8460 // set left speaker Yoga 7i.
8461 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8462 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8464 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8465 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8466 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8467 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8468 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8470 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8471 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8472 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8473 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8474 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8476 // set right speaker Yoga 7i.
8477 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8478 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8480 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8481 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8482 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8483 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8484 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8486 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8487 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8488 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8489 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8490 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8494 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8496 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8497 .type = HDA_FIXUP_VERBS,
8498 .v.verbs = (const struct hda_verb[]) {
8499 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8500 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8501 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8502 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8503 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8504 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8505 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8506 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8507 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8508 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8509 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8510 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8511 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8512 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8516 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8518 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
8519 .type = HDA_FIXUP_FUNC,
8520 .v.func = alc256_fixup_set_coef_defaults,
8522 [ALC245_FIXUP_HP_GPIO_LED] = {
8523 .type = HDA_FIXUP_FUNC,
8524 .v.func = alc245_fixup_hp_gpio_led,
8526 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8527 .type = HDA_FIXUP_PINS,
8528 .v.pins = (const struct hda_pintbl[]) {
8529 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8533 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8535 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8536 .type = HDA_FIXUP_FUNC,
8537 .v.func = alc233_fixup_no_audio_jack,
8539 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8540 .type = HDA_FIXUP_FUNC,
8541 .v.func = alc256_fixup_mic_no_presence_and_resume,
8543 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8547 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8548 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8549 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8550 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8551 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8552 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8553 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8554 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8555 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8556 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8557 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8558 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8559 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8560 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8561 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8562 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8563 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8564 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8565 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8566 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8567 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8568 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8569 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8570 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8571 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8572 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8573 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8574 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8575 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8576 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8577 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8578 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8579 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8580 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8581 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8582 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8583 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8584 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8585 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8586 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8587 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8588 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8589 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8590 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8591 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8592 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8593 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8594 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8595 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8596 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8597 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8598 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8599 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8600 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8601 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8602 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8603 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8604 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8605 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8606 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8607 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8608 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8609 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8610 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8611 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8612 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8613 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8614 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8615 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8616 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8617 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8618 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8619 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8620 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8621 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8622 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8623 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8624 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8625 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8626 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8627 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8628 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8629 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8630 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8631 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8632 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8633 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8634 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8635 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8636 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8637 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
8638 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8639 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8640 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8641 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8642 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8643 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8644 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8645 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8646 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8647 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8648 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8649 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8650 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8651 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8652 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8653 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8654 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8655 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8656 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8657 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8658 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8659 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8660 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8661 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8662 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8663 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8664 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8665 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8666 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8667 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8668 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8669 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8670 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8671 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8672 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8673 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8674 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8675 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8676 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8677 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8678 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8679 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8680 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8681 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8682 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8683 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8684 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8685 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8686 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8687 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8688 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8689 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8690 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8691 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8692 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8693 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8694 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8695 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8696 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8697 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8698 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8699 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8700 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8701 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8702 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8703 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8704 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8705 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8706 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8707 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8708 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8709 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8710 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8711 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8712 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8713 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8714 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8715 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8716 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8717 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8718 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
8719 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8720 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8721 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
8722 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
8723 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
8724 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8725 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8726 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8727 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
8728 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
8729 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8730 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8731 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8732 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8733 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8734 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
8735 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
8736 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8737 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8738 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8739 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8740 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8741 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
8742 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8743 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8744 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8745 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8746 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8747 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8748 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8749 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8750 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8751 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8752 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8753 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8754 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8755 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8756 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8757 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
8758 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
8759 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8760 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
8761 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
8762 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8763 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8764 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
8765 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8766 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
8767 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8768 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8769 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8770 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8771 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8772 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
8773 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8774 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8775 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
8776 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
8777 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
8778 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
8779 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
8780 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8781 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
8782 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
8783 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
8784 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8785 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
8786 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
8787 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
8788 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
8789 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8790 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
8791 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
8792 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
8793 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
8794 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
8795 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
8796 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8797 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8798 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
8799 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
8800 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
8801 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
8802 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
8803 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8804 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
8805 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8806 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8807 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8808 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8809 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
8810 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8811 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8812 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8813 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
8814 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8815 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8816 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
8817 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
8818 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8819 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
8820 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8821 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
8822 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
8823 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8824 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8825 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8826 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8827 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
8828 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
8829 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8830 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8831 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8832 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8833 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
8834 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8835 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8836 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8837 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8838 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
8839 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
8840 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8841 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8842 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8843 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8844 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8845 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8846 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8847 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8848 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8849 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8850 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8851 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8852 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8853 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8854 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8855 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8856 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8857 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8858 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8859 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8860 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8861 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8862 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8863 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8864 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8865 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8866 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8867 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8868 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8869 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8870 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8871 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8872 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8873 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8874 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8875 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8876 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8877 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8878 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8879 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8880 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8881 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8882 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8883 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
8884 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
8885 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8886 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8887 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
8888 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8889 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8890 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8891 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8892 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8893 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8894 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8895 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8896 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8897 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8898 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8899 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8900 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8901 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8902 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8903 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
8904 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
8905 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8906 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8907 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8908 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8909 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
8910 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
8911 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
8912 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
8913 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
8914 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
8915 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
8916 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
8917 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
8918 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
8919 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
8920 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
8921 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
8922 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8923 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
8924 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
8925 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
8926 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8927 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8928 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
8929 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
8930 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
8931 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8932 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8933 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
8934 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8935 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8936 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8937 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8938 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8939 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8940 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8941 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8942 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8943 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8944 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8945 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8946 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8947 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8948 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8949 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8950 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8951 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8952 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
8953 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
8954 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
8955 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
8956 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
8957 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8958 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8959 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
8960 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
8961 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8962 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
8963 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8964 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
8965 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8966 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
8967 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
8968 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8969 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
8970 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
8971 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
8972 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
8973 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
8974 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
8975 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
8976 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
8977 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8978 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8979 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8980 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8981 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8982 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8983 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
8984 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
8985 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
8986 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
8987 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
8988 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
8989 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
8990 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
8991 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
8992 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
8993 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8994 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
8995 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
8996 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8997 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
8998 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
8999 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9002 /* Below is a quirk table taken from the old code.
9003 * Basically the device should work as is without the fixup table.
9004 * If BIOS doesn't give a proper info, enable the corresponding
9007 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9009 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9010 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9011 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9012 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9013 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9014 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9015 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9016 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9017 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9018 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9019 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9020 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9021 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9022 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9023 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9024 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9025 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9026 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9027 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9028 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9029 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9030 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9031 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9032 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9033 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9034 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9035 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9036 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9037 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9038 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9039 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9040 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9041 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9042 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9043 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9044 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9045 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9046 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9047 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9052 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9053 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9054 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9055 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9056 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9057 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9061 static const struct hda_model_fixup alc269_fixup_models[] = {
9062 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9063 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9064 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9065 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9066 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9067 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9068 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9069 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9070 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9071 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9072 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9073 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9074 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9075 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9076 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9077 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9078 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9079 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9080 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9081 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9082 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9083 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9084 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9085 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9086 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9087 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9088 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9089 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9090 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9091 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9092 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9093 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9094 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9095 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9096 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9097 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9098 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9099 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9100 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9101 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9102 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9103 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9104 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9105 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9106 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9107 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9108 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9109 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9110 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9111 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9112 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9113 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9114 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9115 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9116 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9117 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9118 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9119 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9120 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9121 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9122 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9123 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9124 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9125 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9126 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
9127 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
9128 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
9129 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
9130 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9131 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9132 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9133 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9134 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9135 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9136 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9137 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9138 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9139 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9140 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9141 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9142 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9143 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
9144 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9145 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9146 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
9147 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
9148 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
9149 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
9150 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9151 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9152 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9153 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9154 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9155 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9156 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9157 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9158 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9159 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9160 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9161 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9162 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9163 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9164 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9165 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9166 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
9167 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9168 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
9169 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
9170 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
9171 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
9172 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
9173 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
9174 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
9175 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
9176 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
9177 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
9178 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9179 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
9180 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
9181 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9182 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
9185 #define ALC225_STANDARD_PINS \
9188 #define ALC256_STANDARD_PINS \
9189 {0x12, 0x90a60140}, \
9190 {0x14, 0x90170110}, \
9193 #define ALC282_STANDARD_PINS \
9196 #define ALC290_STANDARD_PINS \
9199 #define ALC292_STANDARD_PINS \
9200 {0x14, 0x90170110}, \
9203 #define ALC295_STANDARD_PINS \
9204 {0x12, 0xb7a60130}, \
9205 {0x14, 0x90170110}, \
9208 #define ALC298_STANDARD_PINS \
9209 {0x12, 0x90a60130}, \
9212 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
9213 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9218 {0x21, 0x0221102f}),
9219 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9222 {0x21, 0x02211030}),
9223 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9226 {0x21, 0x03211020}),
9227 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9230 {0x21, 0x03211020}),
9231 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9232 ALC225_STANDARD_PINS,
9234 {0x14, 0x901701a0}),
9235 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9236 ALC225_STANDARD_PINS,
9238 {0x14, 0x901701b0}),
9239 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9240 ALC225_STANDARD_PINS,
9242 {0x14, 0x901701a0}),
9243 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9244 ALC225_STANDARD_PINS,
9246 {0x14, 0x901701b0}),
9247 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9248 ALC225_STANDARD_PINS,
9250 {0x1b, 0x90170110}),
9251 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9254 {0x21, 0x02211020}),
9255 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9259 {0x21, 0x02211020}),
9260 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9265 {0x21, 0x0221101f}),
9266 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9271 {0x21, 0x0221101f}),
9272 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9276 {0x21, 0x0221101f}),
9277 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9278 {0x21, 0x02211010}),
9279 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9282 {0x21, 0x02211030}),
9283 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9285 {0x21, 0x02211020}),
9286 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9288 {0x21, 0x02211040}),
9289 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9292 {0x21, 0x02211020}),
9293 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9296 {0x21, 0x02211030}),
9297 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9300 {0x21, 0x0221101f}),
9301 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9304 {0x21, 0x0221101f}),
9305 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9308 {0x21, 0x0221103f}),
9309 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9312 {0x21, 0x0221103f}),
9313 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9316 {0x21, 0x0221103f}),
9317 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9320 {0x21, 0x0221105f}),
9321 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9324 {0x21, 0x0221101f}),
9325 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9329 {0x21, 0x0321102f}),
9330 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9333 {0x21, 0x02211040}),
9334 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9337 {0x21, 0x02211050}),
9338 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9341 {0x21, 0x02211030}),
9342 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9345 {0x21, 0x02211040}),
9346 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9349 {0x21, 0x02211040}),
9350 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9353 {0x21, 0x02211050}),
9354 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9357 {0x21, 0x02211040}),
9358 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9361 {0x21, 0x02211030}),
9362 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9364 {0x21, 0x02211010}),
9365 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9368 {0x21, 0x04211020}),
9369 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9372 {0x21, 0x03211020}),
9373 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9376 {0x21, 0x03211020}),
9377 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9380 {0x21, 0x04211020}),
9381 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9384 {0x21, 0x03211020}),
9385 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9388 {0x21, 0x0221101f}),
9389 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9392 {0x21, 0x03211020}),
9393 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9397 {0x1a, 0x04a11020}),
9398 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9404 {0x1b, 0x02011020}),
9405 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9406 ALC282_STANDARD_PINS,
9409 {0x21, 0x0321101f}),
9410 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9411 ALC282_STANDARD_PINS,
9414 {0x21, 0x03211040}),
9415 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9416 ALC282_STANDARD_PINS,
9419 {0x21, 0x03211020}),
9420 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9421 ALC282_STANDARD_PINS,
9424 {0x21, 0x0421101f}),
9425 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9426 ALC282_STANDARD_PINS,
9429 {0x21, 0x04211020}),
9430 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9431 ALC282_STANDARD_PINS,
9437 {0x21, 0x0321101f}),
9438 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9439 ALC282_STANDARD_PINS,
9445 {0x21, 0x0321101f}),
9446 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9447 ALC282_STANDARD_PINS,
9449 {0x21, 0x0321101f}),
9450 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9453 {0x21, 0x02211030}),
9454 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9455 ALC282_STANDARD_PINS,
9458 {0x21, 0x0321101f}),
9459 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9463 {0x21, 0x04211020}),
9464 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9468 {0x21, 0x04211020}),
9469 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9472 {0x21, 0x04211020}),
9473 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9477 {0x21, 0x03211020}),
9478 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9481 {0x21, 0x02211020}),
9482 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9485 {0x21, 0x0321101f}),
9486 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9487 ALC290_STANDARD_PINS,
9490 {0x1a, 0x04a11020}),
9491 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9492 ALC290_STANDARD_PINS,
9495 {0x1a, 0x04a11020}),
9496 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9497 ALC290_STANDARD_PINS,
9499 {0x1a, 0x04a11020}),
9500 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9501 ALC290_STANDARD_PINS,
9503 {0x1a, 0x04a11040}),
9504 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9505 ALC290_STANDARD_PINS,
9508 {0x1a, 0x04a11040}),
9509 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9510 ALC290_STANDARD_PINS,
9513 {0x1a, 0x04a11020}),
9514 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9515 ALC290_STANDARD_PINS,
9518 {0x1a, 0x04a11020}),
9519 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9520 ALC292_STANDARD_PINS,
9523 {0x19, 0x01a19030}),
9524 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9525 ALC292_STANDARD_PINS,
9529 {0x19, 0x01a1903e}),
9530 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9531 ALC292_STANDARD_PINS,
9532 {0x12, 0x90a60140}),
9533 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9534 ALC292_STANDARD_PINS,
9537 {0x19, 0x21a19030}),
9538 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9539 ALC292_STANDARD_PINS,
9540 {0x13, 0x90a60140}),
9541 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9543 {0x21, 0x04211020}),
9544 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9547 {0x21, 0x04211020}),
9548 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9551 {0x21, 0x03211020}),
9552 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9555 {0x21, 0x04211020}),
9556 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9559 {0x21, 0x03211020}),
9560 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9563 {0x21, 0x04211030}),
9564 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9567 {0x21, 0x03211020}),
9568 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9571 {0x21, 0x03211020}),
9572 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9574 {0x21, 0x04211020}),
9575 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9577 {0x21, 0x04211030}),
9578 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9579 ALC295_STANDARD_PINS,
9581 {0x18, 0x21a19030}),
9582 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9583 ALC295_STANDARD_PINS,
9585 {0x18, 0x21a19050}),
9586 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9587 ALC295_STANDARD_PINS),
9588 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9589 ALC298_STANDARD_PINS,
9590 {0x17, 0x90170110}),
9591 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9592 ALC298_STANDARD_PINS,
9593 {0x17, 0x90170140}),
9594 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9595 ALC298_STANDARD_PINS,
9596 {0x17, 0x90170150}),
9597 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9602 {0x21, 0x03211030}),
9603 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9607 {0x21, 0x03211020}),
9608 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9609 ALC225_STANDARD_PINS,
9611 {0x17, 0x90170110}),
9612 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9617 {0x21, 0x0221101f}),
9621 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9622 * more machines, don't need to match all valid pins, just need to match
9623 * all the pins defined in the tbl. Just because of this reason, it is possible
9624 * that a single machine matches multiple tbls, so there is one limitation:
9625 * at most one tbl is allowed to define for the same vendor and same codec
9627 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9628 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9630 {0x1b, 0x40000000}),
9631 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9633 {0x1a, 0x40000000}),
9634 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9636 {0x1a, 0x40000000}),
9637 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9639 {0x1a, 0x40000000}),
9643 static void alc269_fill_coef(struct hda_codec *codec)
9645 struct alc_spec *spec = codec->spec;
9648 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9651 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9652 alc_write_coef_idx(codec, 0xf, 0x960b);
9653 alc_write_coef_idx(codec, 0xe, 0x8817);
9656 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9657 alc_write_coef_idx(codec, 0xf, 0x960b);
9658 alc_write_coef_idx(codec, 0xe, 0x8814);
9661 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9662 /* Power up output pin */
9663 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9666 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9667 val = alc_read_coef_idx(codec, 0xd);
9668 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9669 /* Capless ramp up clock control */
9670 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9672 val = alc_read_coef_idx(codec, 0x17);
9673 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9674 /* Class D power on reset */
9675 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9680 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
9685 static int patch_alc269(struct hda_codec *codec)
9687 struct alc_spec *spec;
9690 err = alc_alloc_spec(codec, 0x0b);
9695 spec->gen.shared_mic_vref_pin = 0x18;
9696 codec->power_save_node = 0;
9699 codec->patch_ops.suspend = alc269_suspend;
9700 codec->patch_ops.resume = alc269_resume;
9702 spec->shutup = alc_default_shutup;
9703 spec->init_hook = alc_default_init;
9705 switch (codec->core.vendor_id) {
9707 spec->codec_variant = ALC269_TYPE_ALC269VA;
9708 switch (alc_get_coef0(codec) & 0x00f0) {
9710 if (codec->bus->pci &&
9711 codec->bus->pci->subsystem_vendor == 0x1025 &&
9712 spec->cdefine.platform_type == 1)
9713 err = alc_codec_rename(codec, "ALC271X");
9714 spec->codec_variant = ALC269_TYPE_ALC269VB;
9717 if (codec->bus->pci &&
9718 codec->bus->pci->subsystem_vendor == 0x17aa &&
9719 codec->bus->pci->subsystem_device == 0x21f3)
9720 err = alc_codec_rename(codec, "ALC3202");
9721 spec->codec_variant = ALC269_TYPE_ALC269VC;
9724 spec->codec_variant = ALC269_TYPE_ALC269VD;
9727 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9731 spec->shutup = alc269_shutup;
9732 spec->init_hook = alc269_fill_coef;
9733 alc269_fill_coef(codec);
9738 spec->codec_variant = ALC269_TYPE_ALC280;
9741 spec->codec_variant = ALC269_TYPE_ALC282;
9742 spec->shutup = alc282_shutup;
9743 spec->init_hook = alc282_init;
9747 spec->codec_variant = ALC269_TYPE_ALC283;
9748 spec->shutup = alc283_shutup;
9749 spec->init_hook = alc283_init;
9753 spec->codec_variant = ALC269_TYPE_ALC284;
9756 spec->codec_variant = ALC269_TYPE_ALC293;
9760 spec->codec_variant = ALC269_TYPE_ALC286;
9763 spec->codec_variant = ALC269_TYPE_ALC298;
9767 spec->codec_variant = ALC269_TYPE_ALC255;
9768 spec->shutup = alc256_shutup;
9769 spec->init_hook = alc256_init;
9774 spec->codec_variant = ALC269_TYPE_ALC256;
9775 spec->shutup = alc256_shutup;
9776 spec->init_hook = alc256_init;
9777 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
9780 spec->codec_variant = ALC269_TYPE_ALC257;
9781 spec->shutup = alc256_shutup;
9782 spec->init_hook = alc256_init;
9783 spec->gen.mixer_nid = 0;
9789 spec->codec_variant = ALC269_TYPE_ALC215;
9790 spec->shutup = alc225_shutup;
9791 spec->init_hook = alc225_init;
9792 spec->gen.mixer_nid = 0;
9797 spec->codec_variant = ALC269_TYPE_ALC225;
9798 spec->shutup = alc225_shutup;
9799 spec->init_hook = alc225_init;
9800 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
9803 spec->codec_variant = ALC269_TYPE_ALC287;
9804 spec->shutup = alc225_shutup;
9805 spec->init_hook = alc225_init;
9806 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
9811 spec->codec_variant = ALC269_TYPE_ALC294;
9812 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
9813 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
9814 spec->init_hook = alc294_init;
9817 spec->codec_variant = ALC269_TYPE_ALC300;
9818 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
9821 spec->codec_variant = ALC269_TYPE_ALC623;
9827 spec->codec_variant = ALC269_TYPE_ALC700;
9828 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
9829 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
9830 spec->init_hook = alc294_init;
9835 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
9836 spec->has_alc5505_dsp = 1;
9837 spec->init_hook = alc5505_dsp_init;
9840 alc_pre_init(codec);
9842 snd_hda_pick_fixup(codec, alc269_fixup_models,
9843 alc269_fixup_tbl, alc269_fixups);
9844 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
9845 * the quirk breaks the latter (bko#214101).
9846 * Clear the wrong entry.
9848 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
9849 codec->core.vendor_id == 0x10ec0294) {
9850 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
9851 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
9854 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
9855 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
9856 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
9858 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9860 alc_auto_parse_customize_define(codec);
9862 if (has_cdefine_beep(codec))
9863 spec->gen.beep_nid = 0x01;
9865 /* automatic parse from the BIOS config */
9866 err = alc269_parse_auto_config(codec);
9870 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
9871 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9876 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9889 static int alc861_parse_auto_config(struct hda_codec *codec)
9891 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
9892 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9893 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
9896 /* Pin config fixes */
9898 ALC861_FIXUP_FSC_AMILO_PI1505,
9899 ALC861_FIXUP_AMP_VREF_0F,
9900 ALC861_FIXUP_NO_JACK_DETECT,
9901 ALC861_FIXUP_ASUS_A6RP,
9902 ALC660_FIXUP_ASUS_W7J,
9905 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9906 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
9907 const struct hda_fixup *fix, int action)
9909 struct alc_spec *spec = codec->spec;
9912 if (action != HDA_FIXUP_ACT_INIT)
9914 val = snd_hda_codec_get_pin_target(codec, 0x0f);
9915 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9916 val |= AC_PINCTL_IN_EN;
9917 val |= AC_PINCTL_VREF_50;
9918 snd_hda_set_pin_ctl(codec, 0x0f, val);
9919 spec->gen.keep_vref_in_automute = 1;
9922 /* suppress the jack-detection */
9923 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
9924 const struct hda_fixup *fix, int action)
9926 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9927 codec->no_jack_detect = 1;
9930 static const struct hda_fixup alc861_fixups[] = {
9931 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
9932 .type = HDA_FIXUP_PINS,
9933 .v.pins = (const struct hda_pintbl[]) {
9934 { 0x0b, 0x0221101f }, /* HP */
9935 { 0x0f, 0x90170310 }, /* speaker */
9939 [ALC861_FIXUP_AMP_VREF_0F] = {
9940 .type = HDA_FIXUP_FUNC,
9941 .v.func = alc861_fixup_asus_amp_vref_0f,
9943 [ALC861_FIXUP_NO_JACK_DETECT] = {
9944 .type = HDA_FIXUP_FUNC,
9945 .v.func = alc_fixup_no_jack_detect,
9947 [ALC861_FIXUP_ASUS_A6RP] = {
9948 .type = HDA_FIXUP_FUNC,
9949 .v.func = alc861_fixup_asus_amp_vref_0f,
9951 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
9953 [ALC660_FIXUP_ASUS_W7J] = {
9954 .type = HDA_FIXUP_VERBS,
9955 .v.verbs = (const struct hda_verb[]) {
9956 /* ASUS W7J needs a magic pin setup on unused NID 0x10
9957 * for enabling outputs
9959 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
9965 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
9966 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
9967 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
9968 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
9969 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
9970 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
9971 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
9972 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
9978 static int patch_alc861(struct hda_codec *codec)
9980 struct alc_spec *spec;
9983 err = alc_alloc_spec(codec, 0x15);
9988 if (has_cdefine_beep(codec))
9989 spec->gen.beep_nid = 0x23;
9992 spec->power_hook = alc_power_eapd;
9995 alc_pre_init(codec);
9997 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
9998 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10000 /* automatic parse from the BIOS config */
10001 err = alc861_parse_auto_config(codec);
10005 if (!spec->gen.no_analog) {
10006 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10011 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10021 * ALC861-VD support
10025 * In addition, an independent DAC
10027 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10029 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10030 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10031 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10035 ALC660VD_FIX_ASUS_GPIO1,
10036 ALC861VD_FIX_DALLAS,
10039 /* exclude VREF80 */
10040 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10041 const struct hda_fixup *fix, int action)
10043 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10044 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10045 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10050 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10051 const struct hda_fixup *fix, int action)
10053 struct alc_spec *spec = codec->spec;
10055 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10056 spec->gpio_mask |= 0x02;
10057 alc_fixup_gpio(codec, action, 0x01);
10060 static const struct hda_fixup alc861vd_fixups[] = {
10061 [ALC660VD_FIX_ASUS_GPIO1] = {
10062 .type = HDA_FIXUP_FUNC,
10063 .v.func = alc660vd_fixup_asus_gpio1,
10065 [ALC861VD_FIX_DALLAS] = {
10066 .type = HDA_FIXUP_FUNC,
10067 .v.func = alc861vd_fixup_dallas,
10071 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10072 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10073 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10074 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10080 static int patch_alc861vd(struct hda_codec *codec)
10082 struct alc_spec *spec;
10085 err = alc_alloc_spec(codec, 0x0b);
10089 spec = codec->spec;
10090 if (has_cdefine_beep(codec))
10091 spec->gen.beep_nid = 0x23;
10093 spec->shutup = alc_eapd_shutup;
10095 alc_pre_init(codec);
10097 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10098 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10100 /* automatic parse from the BIOS config */
10101 err = alc861vd_parse_auto_config(codec);
10105 if (!spec->gen.no_analog) {
10106 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10111 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10123 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10124 * configuration. Each pin widget can choose any input DACs and a mixer.
10125 * Each ADC is connected from a mixer of all inputs. This makes possible
10126 * 6-channel independent captures.
10128 * In addition, an independent DAC for the multi-playback (not used in this
10133 * BIOS auto configuration
10136 static int alc662_parse_auto_config(struct hda_codec *codec)
10138 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
10139 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10140 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10141 const hda_nid_t *ssids;
10143 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10144 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10145 codec->core.vendor_id == 0x10ec0671)
10146 ssids = alc663_ssids;
10148 ssids = alc662_ssids;
10149 return alc_parse_auto_config(codec, alc662_ignore, ssids);
10152 static void alc272_fixup_mario(struct hda_codec *codec,
10153 const struct hda_fixup *fix, int action)
10155 if (action != HDA_FIXUP_ACT_PRE_PROBE)
10157 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10158 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10159 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10160 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10161 (0 << AC_AMPCAP_MUTE_SHIFT)))
10162 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
10165 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10167 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10169 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10170 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10174 /* override the 2.1 chmap */
10175 static void alc_fixup_bass_chmap(struct hda_codec *codec,
10176 const struct hda_fixup *fix, int action)
10178 if (action == HDA_FIXUP_ACT_BUILD) {
10179 struct alc_spec *spec = codec->spec;
10180 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
10184 /* avoid D3 for keeping GPIO up */
10185 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10187 unsigned int power_state)
10189 struct alc_spec *spec = codec->spec;
10190 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
10191 return AC_PWRST_D0;
10192 return power_state;
10195 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10196 const struct hda_fixup *fix, int action)
10198 struct alc_spec *spec = codec->spec;
10200 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
10201 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10202 spec->mute_led_polarity = 1;
10203 codec->power_filter = gpio_led_power_filter;
10207 static void alc662_usi_automute_hook(struct hda_codec *codec,
10208 struct hda_jack_callback *jack)
10210 struct alc_spec *spec = codec->spec;
10213 snd_hda_gen_hp_automute(codec, jack);
10215 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10217 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10221 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10222 const struct hda_fixup *fix, int action)
10224 struct alc_spec *spec = codec->spec;
10225 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10226 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10227 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10231 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10232 struct hda_jack_callback *cb)
10234 /* surround speakers at 0x1b already get muted automatically when
10235 * headphones are plugged in, but we have to mute/unmute the remaining
10236 * channels manually:
10237 * 0x15 - front left/front right
10238 * 0x18 - front center/ LFE
10240 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10241 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10242 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10244 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10245 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10249 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10250 const struct hda_fixup *fix, int action)
10252 /* Pin 0x1b: shared headphones jack and surround speakers */
10253 if (!is_jack_detectable(codec, 0x1b))
10257 case HDA_FIXUP_ACT_PRE_PROBE:
10258 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10259 alc662_aspire_ethos_mute_speakers);
10260 /* subwoofer needs an extra GPIO setting to become audible */
10261 alc_setup_gpio(codec, 0x02);
10263 case HDA_FIXUP_ACT_INIT:
10264 /* Make sure to start in a correct state, i.e. if
10265 * headphones have been plugged in before powering up the system
10267 alc662_aspire_ethos_mute_speakers(codec, NULL);
10272 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10273 const struct hda_fixup *fix, int action)
10275 struct alc_spec *spec = codec->spec;
10277 static const struct hda_pintbl pincfgs[] = {
10278 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10279 { 0x1b, 0x0181304f },
10284 case HDA_FIXUP_ACT_PRE_PROBE:
10285 spec->gen.mixer_nid = 0;
10286 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10287 snd_hda_apply_pincfgs(codec, pincfgs);
10289 case HDA_FIXUP_ACT_INIT:
10290 alc_write_coef_idx(codec, 0x19, 0xa054);
10295 static void alc897_hp_automute_hook(struct hda_codec *codec,
10296 struct hda_jack_callback *jack)
10298 struct alc_spec *spec = codec->spec;
10301 snd_hda_gen_hp_automute(codec, jack);
10302 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10303 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10307 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10308 const struct hda_fixup *fix, int action)
10310 struct alc_spec *spec = codec->spec;
10311 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10312 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10316 static const struct coef_fw alc668_coefs[] = {
10317 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10318 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10319 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10320 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10321 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10322 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10323 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10324 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10325 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10326 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10327 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10328 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10329 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10330 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10331 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10332 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10333 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10334 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10335 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10336 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10340 static void alc668_restore_default_value(struct hda_codec *codec)
10342 alc_process_coef_fw(codec, alc668_coefs);
10346 ALC662_FIXUP_ASPIRE,
10347 ALC662_FIXUP_LED_GPIO1,
10348 ALC662_FIXUP_IDEAPAD,
10349 ALC272_FIXUP_MARIO,
10350 ALC662_FIXUP_CZC_ET26,
10351 ALC662_FIXUP_CZC_P10T,
10352 ALC662_FIXUP_SKU_IGNORE,
10353 ALC662_FIXUP_HP_RP5800,
10354 ALC662_FIXUP_ASUS_MODE1,
10355 ALC662_FIXUP_ASUS_MODE2,
10356 ALC662_FIXUP_ASUS_MODE3,
10357 ALC662_FIXUP_ASUS_MODE4,
10358 ALC662_FIXUP_ASUS_MODE5,
10359 ALC662_FIXUP_ASUS_MODE6,
10360 ALC662_FIXUP_ASUS_MODE7,
10361 ALC662_FIXUP_ASUS_MODE8,
10362 ALC662_FIXUP_NO_JACK_DETECT,
10363 ALC662_FIXUP_ZOTAC_Z68,
10364 ALC662_FIXUP_INV_DMIC,
10365 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10366 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10367 ALC662_FIXUP_HEADSET_MODE,
10368 ALC668_FIXUP_HEADSET_MODE,
10369 ALC662_FIXUP_BASS_MODE4_CHMAP,
10370 ALC662_FIXUP_BASS_16,
10371 ALC662_FIXUP_BASS_1A,
10372 ALC662_FIXUP_BASS_CHMAP,
10373 ALC668_FIXUP_AUTO_MUTE,
10374 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10375 ALC668_FIXUP_DELL_XPS13,
10376 ALC662_FIXUP_ASUS_Nx50,
10377 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10378 ALC668_FIXUP_ASUS_Nx51,
10379 ALC668_FIXUP_MIC_COEF,
10380 ALC668_FIXUP_ASUS_G751,
10381 ALC891_FIXUP_HEADSET_MODE,
10382 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10383 ALC662_FIXUP_ACER_VERITON,
10384 ALC892_FIXUP_ASROCK_MOBO,
10385 ALC662_FIXUP_USI_FUNC,
10386 ALC662_FIXUP_USI_HEADSET_MODE,
10387 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10388 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10389 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10390 ALC671_FIXUP_HP_HEADSET_MIC2,
10391 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10392 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10393 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10394 ALC668_FIXUP_HEADSET_MIC,
10395 ALC668_FIXUP_MIC_DET_COEF,
10396 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10397 ALC897_FIXUP_HEADSET_MIC_PIN,
10400 static const struct hda_fixup alc662_fixups[] = {
10401 [ALC662_FIXUP_ASPIRE] = {
10402 .type = HDA_FIXUP_PINS,
10403 .v.pins = (const struct hda_pintbl[]) {
10404 { 0x15, 0x99130112 }, /* subwoofer */
10408 [ALC662_FIXUP_LED_GPIO1] = {
10409 .type = HDA_FIXUP_FUNC,
10410 .v.func = alc662_fixup_led_gpio1,
10412 [ALC662_FIXUP_IDEAPAD] = {
10413 .type = HDA_FIXUP_PINS,
10414 .v.pins = (const struct hda_pintbl[]) {
10415 { 0x17, 0x99130112 }, /* subwoofer */
10419 .chain_id = ALC662_FIXUP_LED_GPIO1,
10421 [ALC272_FIXUP_MARIO] = {
10422 .type = HDA_FIXUP_FUNC,
10423 .v.func = alc272_fixup_mario,
10425 [ALC662_FIXUP_CZC_ET26] = {
10426 .type = HDA_FIXUP_PINS,
10427 .v.pins = (const struct hda_pintbl[]) {
10428 {0x12, 0x403cc000},
10429 {0x14, 0x90170110}, /* speaker */
10430 {0x15, 0x411111f0},
10431 {0x16, 0x411111f0},
10432 {0x18, 0x01a19030}, /* mic */
10433 {0x19, 0x90a7013f}, /* int-mic */
10434 {0x1a, 0x01014020},
10435 {0x1b, 0x0121401f},
10436 {0x1c, 0x411111f0},
10437 {0x1d, 0x411111f0},
10438 {0x1e, 0x40478e35},
10442 .chain_id = ALC662_FIXUP_SKU_IGNORE
10444 [ALC662_FIXUP_CZC_P10T] = {
10445 .type = HDA_FIXUP_VERBS,
10446 .v.verbs = (const struct hda_verb[]) {
10447 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10451 [ALC662_FIXUP_SKU_IGNORE] = {
10452 .type = HDA_FIXUP_FUNC,
10453 .v.func = alc_fixup_sku_ignore,
10455 [ALC662_FIXUP_HP_RP5800] = {
10456 .type = HDA_FIXUP_PINS,
10457 .v.pins = (const struct hda_pintbl[]) {
10458 { 0x14, 0x0221201f }, /* HP out */
10462 .chain_id = ALC662_FIXUP_SKU_IGNORE
10464 [ALC662_FIXUP_ASUS_MODE1] = {
10465 .type = HDA_FIXUP_PINS,
10466 .v.pins = (const struct hda_pintbl[]) {
10467 { 0x14, 0x99130110 }, /* speaker */
10468 { 0x18, 0x01a19c20 }, /* mic */
10469 { 0x19, 0x99a3092f }, /* int-mic */
10470 { 0x21, 0x0121401f }, /* HP out */
10474 .chain_id = ALC662_FIXUP_SKU_IGNORE
10476 [ALC662_FIXUP_ASUS_MODE2] = {
10477 .type = HDA_FIXUP_PINS,
10478 .v.pins = (const struct hda_pintbl[]) {
10479 { 0x14, 0x99130110 }, /* speaker */
10480 { 0x18, 0x01a19820 }, /* mic */
10481 { 0x19, 0x99a3092f }, /* int-mic */
10482 { 0x1b, 0x0121401f }, /* HP out */
10486 .chain_id = ALC662_FIXUP_SKU_IGNORE
10488 [ALC662_FIXUP_ASUS_MODE3] = {
10489 .type = HDA_FIXUP_PINS,
10490 .v.pins = (const struct hda_pintbl[]) {
10491 { 0x14, 0x99130110 }, /* speaker */
10492 { 0x15, 0x0121441f }, /* HP */
10493 { 0x18, 0x01a19840 }, /* mic */
10494 { 0x19, 0x99a3094f }, /* int-mic */
10495 { 0x21, 0x01211420 }, /* HP2 */
10499 .chain_id = ALC662_FIXUP_SKU_IGNORE
10501 [ALC662_FIXUP_ASUS_MODE4] = {
10502 .type = HDA_FIXUP_PINS,
10503 .v.pins = (const struct hda_pintbl[]) {
10504 { 0x14, 0x99130110 }, /* speaker */
10505 { 0x16, 0x99130111 }, /* speaker */
10506 { 0x18, 0x01a19840 }, /* mic */
10507 { 0x19, 0x99a3094f }, /* int-mic */
10508 { 0x21, 0x0121441f }, /* HP */
10512 .chain_id = ALC662_FIXUP_SKU_IGNORE
10514 [ALC662_FIXUP_ASUS_MODE5] = {
10515 .type = HDA_FIXUP_PINS,
10516 .v.pins = (const struct hda_pintbl[]) {
10517 { 0x14, 0x99130110 }, /* speaker */
10518 { 0x15, 0x0121441f }, /* HP */
10519 { 0x16, 0x99130111 }, /* speaker */
10520 { 0x18, 0x01a19840 }, /* mic */
10521 { 0x19, 0x99a3094f }, /* int-mic */
10525 .chain_id = ALC662_FIXUP_SKU_IGNORE
10527 [ALC662_FIXUP_ASUS_MODE6] = {
10528 .type = HDA_FIXUP_PINS,
10529 .v.pins = (const struct hda_pintbl[]) {
10530 { 0x14, 0x99130110 }, /* speaker */
10531 { 0x15, 0x01211420 }, /* HP2 */
10532 { 0x18, 0x01a19840 }, /* mic */
10533 { 0x19, 0x99a3094f }, /* int-mic */
10534 { 0x1b, 0x0121441f }, /* HP */
10538 .chain_id = ALC662_FIXUP_SKU_IGNORE
10540 [ALC662_FIXUP_ASUS_MODE7] = {
10541 .type = HDA_FIXUP_PINS,
10542 .v.pins = (const struct hda_pintbl[]) {
10543 { 0x14, 0x99130110 }, /* speaker */
10544 { 0x17, 0x99130111 }, /* speaker */
10545 { 0x18, 0x01a19840 }, /* mic */
10546 { 0x19, 0x99a3094f }, /* int-mic */
10547 { 0x1b, 0x01214020 }, /* HP */
10548 { 0x21, 0x0121401f }, /* HP */
10552 .chain_id = ALC662_FIXUP_SKU_IGNORE
10554 [ALC662_FIXUP_ASUS_MODE8] = {
10555 .type = HDA_FIXUP_PINS,
10556 .v.pins = (const struct hda_pintbl[]) {
10557 { 0x14, 0x99130110 }, /* speaker */
10558 { 0x12, 0x99a30970 }, /* int-mic */
10559 { 0x15, 0x01214020 }, /* HP */
10560 { 0x17, 0x99130111 }, /* speaker */
10561 { 0x18, 0x01a19840 }, /* mic */
10562 { 0x21, 0x0121401f }, /* HP */
10566 .chain_id = ALC662_FIXUP_SKU_IGNORE
10568 [ALC662_FIXUP_NO_JACK_DETECT] = {
10569 .type = HDA_FIXUP_FUNC,
10570 .v.func = alc_fixup_no_jack_detect,
10572 [ALC662_FIXUP_ZOTAC_Z68] = {
10573 .type = HDA_FIXUP_PINS,
10574 .v.pins = (const struct hda_pintbl[]) {
10575 { 0x1b, 0x02214020 }, /* Front HP */
10579 [ALC662_FIXUP_INV_DMIC] = {
10580 .type = HDA_FIXUP_FUNC,
10581 .v.func = alc_fixup_inv_dmic,
10583 [ALC668_FIXUP_DELL_XPS13] = {
10584 .type = HDA_FIXUP_FUNC,
10585 .v.func = alc_fixup_dell_xps13,
10587 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10589 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10590 .type = HDA_FIXUP_FUNC,
10591 .v.func = alc_fixup_disable_aamix,
10593 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10595 [ALC668_FIXUP_AUTO_MUTE] = {
10596 .type = HDA_FIXUP_FUNC,
10597 .v.func = alc_fixup_auto_mute_via_amp,
10599 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10601 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10602 .type = HDA_FIXUP_PINS,
10603 .v.pins = (const struct hda_pintbl[]) {
10604 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10605 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10609 .chain_id = ALC662_FIXUP_HEADSET_MODE
10611 [ALC662_FIXUP_HEADSET_MODE] = {
10612 .type = HDA_FIXUP_FUNC,
10613 .v.func = alc_fixup_headset_mode_alc662,
10615 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10616 .type = HDA_FIXUP_PINS,
10617 .v.pins = (const struct hda_pintbl[]) {
10618 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10619 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10623 .chain_id = ALC668_FIXUP_HEADSET_MODE
10625 [ALC668_FIXUP_HEADSET_MODE] = {
10626 .type = HDA_FIXUP_FUNC,
10627 .v.func = alc_fixup_headset_mode_alc668,
10629 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10630 .type = HDA_FIXUP_FUNC,
10631 .v.func = alc_fixup_bass_chmap,
10633 .chain_id = ALC662_FIXUP_ASUS_MODE4
10635 [ALC662_FIXUP_BASS_16] = {
10636 .type = HDA_FIXUP_PINS,
10637 .v.pins = (const struct hda_pintbl[]) {
10638 {0x16, 0x80106111}, /* bass speaker */
10642 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10644 [ALC662_FIXUP_BASS_1A] = {
10645 .type = HDA_FIXUP_PINS,
10646 .v.pins = (const struct hda_pintbl[]) {
10647 {0x1a, 0x80106111}, /* bass speaker */
10651 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10653 [ALC662_FIXUP_BASS_CHMAP] = {
10654 .type = HDA_FIXUP_FUNC,
10655 .v.func = alc_fixup_bass_chmap,
10657 [ALC662_FIXUP_ASUS_Nx50] = {
10658 .type = HDA_FIXUP_FUNC,
10659 .v.func = alc_fixup_auto_mute_via_amp,
10661 .chain_id = ALC662_FIXUP_BASS_1A
10663 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10664 .type = HDA_FIXUP_FUNC,
10665 .v.func = alc_fixup_headset_mode_alc668,
10666 .chain_id = ALC662_FIXUP_BASS_CHMAP
10668 [ALC668_FIXUP_ASUS_Nx51] = {
10669 .type = HDA_FIXUP_PINS,
10670 .v.pins = (const struct hda_pintbl[]) {
10671 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10672 { 0x1a, 0x90170151 }, /* bass speaker */
10673 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10677 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10679 [ALC668_FIXUP_MIC_COEF] = {
10680 .type = HDA_FIXUP_VERBS,
10681 .v.verbs = (const struct hda_verb[]) {
10682 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10683 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10687 [ALC668_FIXUP_ASUS_G751] = {
10688 .type = HDA_FIXUP_PINS,
10689 .v.pins = (const struct hda_pintbl[]) {
10690 { 0x16, 0x0421101f }, /* HP */
10694 .chain_id = ALC668_FIXUP_MIC_COEF
10696 [ALC891_FIXUP_HEADSET_MODE] = {
10697 .type = HDA_FIXUP_FUNC,
10698 .v.func = alc_fixup_headset_mode,
10700 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10701 .type = HDA_FIXUP_PINS,
10702 .v.pins = (const struct hda_pintbl[]) {
10703 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10704 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10708 .chain_id = ALC891_FIXUP_HEADSET_MODE
10710 [ALC662_FIXUP_ACER_VERITON] = {
10711 .type = HDA_FIXUP_PINS,
10712 .v.pins = (const struct hda_pintbl[]) {
10713 { 0x15, 0x50170120 }, /* no internal speaker */
10717 [ALC892_FIXUP_ASROCK_MOBO] = {
10718 .type = HDA_FIXUP_PINS,
10719 .v.pins = (const struct hda_pintbl[]) {
10720 { 0x15, 0x40f000f0 }, /* disabled */
10721 { 0x16, 0x40f000f0 }, /* disabled */
10725 [ALC662_FIXUP_USI_FUNC] = {
10726 .type = HDA_FIXUP_FUNC,
10727 .v.func = alc662_fixup_usi_headset_mic,
10729 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10730 .type = HDA_FIXUP_PINS,
10731 .v.pins = (const struct hda_pintbl[]) {
10732 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10733 { 0x18, 0x01a1903d },
10737 .chain_id = ALC662_FIXUP_USI_FUNC
10739 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10740 .type = HDA_FIXUP_FUNC,
10741 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10743 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10744 .type = HDA_FIXUP_FUNC,
10745 .v.func = alc662_fixup_aspire_ethos_hp,
10747 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10748 .type = HDA_FIXUP_PINS,
10749 .v.pins = (const struct hda_pintbl[]) {
10750 { 0x15, 0x92130110 }, /* front speakers */
10751 { 0x18, 0x99130111 }, /* center/subwoofer */
10752 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10756 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
10758 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10759 .type = HDA_FIXUP_FUNC,
10760 .v.func = alc671_fixup_hp_headset_mic2,
10762 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10763 .type = HDA_FIXUP_PINS,
10764 .v.pins = (const struct hda_pintbl[]) {
10765 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10769 .chain_id = ALC662_FIXUP_USI_FUNC
10771 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10772 .type = HDA_FIXUP_PINS,
10773 .v.pins = (const struct hda_pintbl[]) {
10774 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10775 { 0x1b, 0x0221144f },
10779 .chain_id = ALC662_FIXUP_USI_FUNC
10781 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
10782 .type = HDA_FIXUP_PINS,
10783 .v.pins = (const struct hda_pintbl[]) {
10784 { 0x1b, 0x04a1112c },
10788 .chain_id = ALC668_FIXUP_HEADSET_MIC
10790 [ALC668_FIXUP_HEADSET_MIC] = {
10791 .type = HDA_FIXUP_FUNC,
10792 .v.func = alc269_fixup_headset_mic,
10794 .chain_id = ALC668_FIXUP_MIC_DET_COEF
10796 [ALC668_FIXUP_MIC_DET_COEF] = {
10797 .type = HDA_FIXUP_VERBS,
10798 .v.verbs = (const struct hda_verb[]) {
10799 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
10800 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
10804 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
10805 .type = HDA_FIXUP_FUNC,
10806 .v.func = alc897_fixup_lenovo_headset_mic,
10808 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
10809 .type = HDA_FIXUP_PINS,
10810 .v.pins = (const struct hda_pintbl[]) {
10811 { 0x1a, 0x03a11050 },
10815 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
10819 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
10820 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
10821 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
10822 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
10823 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
10824 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
10825 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
10826 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
10827 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
10828 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
10829 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
10830 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
10831 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10832 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10833 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
10834 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
10835 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
10836 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10837 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10838 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10839 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10840 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10841 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
10842 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
10843 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
10844 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
10845 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
10846 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
10847 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
10848 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10849 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
10850 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
10851 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
10852 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
10853 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
10854 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
10855 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10856 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
10857 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
10858 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
10859 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
10860 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
10861 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
10862 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
10863 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
10864 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
10865 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
10866 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
10867 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
10868 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
10869 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
10870 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
10871 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
10874 /* Below is a quirk table taken from the old code.
10875 * Basically the device should work as is without the fixup table.
10876 * If BIOS doesn't give a proper info, enable the corresponding
10879 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
10880 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
10881 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
10882 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
10883 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10884 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10885 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10886 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
10887 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
10888 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10889 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
10890 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
10891 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
10892 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
10893 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
10894 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10895 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
10896 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
10897 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10898 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10899 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10900 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10901 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
10902 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
10903 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
10904 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10905 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
10906 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10907 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10908 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
10909 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10910 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10911 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
10912 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
10913 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
10914 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
10915 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
10916 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
10917 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
10918 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10919 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
10920 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
10921 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10922 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
10923 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
10924 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
10925 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
10926 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
10927 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10928 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
10933 static const struct hda_model_fixup alc662_fixup_models[] = {
10934 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
10935 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
10936 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
10937 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
10938 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
10939 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
10940 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
10941 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
10942 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
10943 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
10944 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
10945 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
10946 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
10947 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
10948 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
10949 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10950 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
10951 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
10952 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
10953 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
10954 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
10955 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
10956 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
10957 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
10958 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
10959 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
10960 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
10961 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
10962 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
10963 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
10964 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10965 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
10969 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
10970 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10971 {0x17, 0x02211010},
10972 {0x18, 0x01a19030},
10973 {0x1a, 0x01813040},
10974 {0x21, 0x01014020}),
10975 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10976 {0x16, 0x01813030},
10977 {0x17, 0x02211010},
10978 {0x18, 0x01a19040},
10979 {0x21, 0x01014020}),
10980 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10981 {0x14, 0x01014010},
10982 {0x18, 0x01a19020},
10983 {0x1a, 0x0181302f},
10984 {0x1b, 0x0221401f}),
10985 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10986 {0x12, 0x99a30130},
10987 {0x14, 0x90170110},
10988 {0x15, 0x0321101f},
10989 {0x16, 0x03011020}),
10990 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10991 {0x12, 0x99a30140},
10992 {0x14, 0x90170110},
10993 {0x15, 0x0321101f},
10994 {0x16, 0x03011020}),
10995 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10996 {0x12, 0x99a30150},
10997 {0x14, 0x90170110},
10998 {0x15, 0x0321101f},
10999 {0x16, 0x03011020}),
11000 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11001 {0x14, 0x90170110},
11002 {0x15, 0x0321101f},
11003 {0x16, 0x03011020}),
11004 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11005 {0x12, 0x90a60130},
11006 {0x14, 0x90170110},
11007 {0x15, 0x0321101f}),
11008 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11009 {0x14, 0x01014010},
11010 {0x17, 0x90170150},
11011 {0x19, 0x02a11060},
11012 {0x1b, 0x01813030},
11013 {0x21, 0x02211020}),
11014 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11015 {0x14, 0x01014010},
11016 {0x18, 0x01a19040},
11017 {0x1b, 0x01813030},
11018 {0x21, 0x02211020}),
11019 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11020 {0x14, 0x01014020},
11021 {0x17, 0x90170110},
11022 {0x18, 0x01a19050},
11023 {0x1b, 0x01813040},
11024 {0x21, 0x02211030}),
11030 static int patch_alc662(struct hda_codec *codec)
11032 struct alc_spec *spec;
11035 err = alc_alloc_spec(codec, 0x0b);
11039 spec = codec->spec;
11041 spec->shutup = alc_eapd_shutup;
11043 /* handle multiple HPs as is */
11044 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11046 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11048 switch (codec->core.vendor_id) {
11050 spec->init_hook = alc668_restore_default_value;
11054 alc_pre_init(codec);
11056 snd_hda_pick_fixup(codec, alc662_fixup_models,
11057 alc662_fixup_tbl, alc662_fixups);
11058 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
11059 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11061 alc_auto_parse_customize_define(codec);
11063 if (has_cdefine_beep(codec))
11064 spec->gen.beep_nid = 0x01;
11066 if ((alc_get_coef0(codec) & (1 << 14)) &&
11067 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
11068 spec->cdefine.platform_type == 1) {
11069 err = alc_codec_rename(codec, "ALC272X");
11074 /* automatic parse from the BIOS config */
11075 err = alc662_parse_auto_config(codec);
11079 if (!spec->gen.no_analog && spec->gen.beep_nid) {
11080 switch (codec->core.vendor_id) {
11082 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11088 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
11091 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
11098 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11111 static int alc680_parse_auto_config(struct hda_codec *codec)
11113 return alc_parse_auto_config(codec, NULL, NULL);
11118 static int patch_alc680(struct hda_codec *codec)
11122 /* ALC680 has no aa-loopback mixer */
11123 err = alc_alloc_spec(codec, 0);
11127 /* automatic parse from the BIOS config */
11128 err = alc680_parse_auto_config(codec);
11140 static const struct hda_device_id snd_hda_id_realtek[] = {
11141 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
11142 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
11143 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
11144 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
11145 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
11146 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11147 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
11148 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
11149 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
11150 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
11151 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
11152 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11153 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
11154 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
11155 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11156 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11157 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11158 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11159 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11160 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11161 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
11162 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
11163 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11164 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11165 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11166 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11167 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11168 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
11169 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
11170 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
11171 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
11172 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
11173 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
11174 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11175 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11176 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
11177 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
11178 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
11179 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
11180 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
11181 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
11182 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
11183 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11184 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11185 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11186 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11187 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11188 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11189 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11190 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11191 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11192 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11193 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11194 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11195 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11196 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
11197 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11198 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11199 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
11200 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
11201 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
11202 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11203 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11204 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11205 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11206 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11207 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11208 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11209 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11210 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11211 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11212 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
11213 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
11214 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11215 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
11216 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
11217 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
11218 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
11219 {} /* terminator */
11221 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
11223 MODULE_LICENSE("GPL");
11224 MODULE_DESCRIPTION("Realtek HD-audio codec");
11226 static struct hda_codec_driver realtek_driver = {
11227 .id = snd_hda_id_realtek,
11230 module_hda_codec_driver(realtek_driver);