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"
28 #include "hda_component.h"
30 /* keep halting ALC5505 DSP, for power saving */
31 #define HALT_REALTEK_ALC5505
33 /* extra amp-initialization sequence types */
41 ALC_HEADSET_MODE_UNKNOWN,
42 ALC_HEADSET_MODE_UNPLUGGED,
43 ALC_HEADSET_MODE_HEADSET,
45 ALC_HEADSET_MODE_HEADPHONE,
49 ALC_HEADSET_TYPE_UNKNOWN,
50 ALC_HEADSET_TYPE_CTIA,
51 ALC_HEADSET_TYPE_OMTP,
55 ALC_KEY_MICMUTE_INDEX,
58 struct alc_customize_define {
60 unsigned char port_connectivity;
61 unsigned char check_sum;
62 unsigned char customization;
63 unsigned char external_amp;
64 unsigned int enable_pcbeep:1;
65 unsigned int platform_type:1;
67 unsigned int override:1;
68 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
79 struct hda_gen_spec gen; /* must be at head */
81 /* codec parameterization */
82 struct alc_customize_define cdefine;
83 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
86 unsigned int gpio_mask;
87 unsigned int gpio_dir;
88 unsigned int gpio_data;
89 bool gpio_write_delay; /* add a delay before writing gpio_data */
91 /* mute LED for HP laptops, see vref_mute_led_set() */
92 int mute_led_polarity;
93 int micmute_led_polarity;
94 hda_nid_t mute_led_nid;
95 hda_nid_t cap_mute_led_nid;
97 unsigned int gpio_mute_led_mask;
98 unsigned int gpio_mic_led_mask;
99 struct alc_coef_led mute_led_coef;
100 struct alc_coef_led mic_led_coef;
101 struct mutex coef_mutex;
103 hda_nid_t headset_mic_pin;
104 hda_nid_t headphone_mic_pin;
105 int current_headset_mode;
106 int current_headset_type;
109 void (*init_hook)(struct hda_codec *codec);
111 void (*power_hook)(struct hda_codec *codec);
113 void (*shutup)(struct hda_codec *codec);
116 int codec_variant; /* flag for other variants */
117 unsigned int has_alc5505_dsp:1;
118 unsigned int no_depop_delay:1;
119 unsigned int done_hp_init:1;
120 unsigned int no_shutup_pins:1;
121 unsigned int ultra_low_power:1;
122 unsigned int has_hs_key:1;
123 unsigned int no_internal_mic_pin:1;
127 unsigned int pll_coef_idx, pll_coef_bit;
129 struct input_dev *kb_dev;
130 u8 alc_mute_keycode_map[1];
132 /* component binding */
133 struct component_match *match;
134 struct hda_component comps[HDA_MAX_COMPONENTS];
138 * COEF access helper functions
141 static void coef_mutex_lock(struct hda_codec *codec)
143 struct alc_spec *spec = codec->spec;
145 snd_hda_power_up_pm(codec);
146 mutex_lock(&spec->coef_mutex);
149 static void coef_mutex_unlock(struct hda_codec *codec)
151 struct alc_spec *spec = codec->spec;
153 mutex_unlock(&spec->coef_mutex);
154 snd_hda_power_down_pm(codec);
157 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
158 unsigned int coef_idx)
162 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
163 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
167 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
168 unsigned int coef_idx)
172 coef_mutex_lock(codec);
173 val = __alc_read_coefex_idx(codec, nid, coef_idx);
174 coef_mutex_unlock(codec);
178 #define alc_read_coef_idx(codec, coef_idx) \
179 alc_read_coefex_idx(codec, 0x20, coef_idx)
181 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
182 unsigned int coef_idx, unsigned int coef_val)
184 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
185 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
188 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
189 unsigned int coef_idx, unsigned int coef_val)
191 coef_mutex_lock(codec);
192 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
193 coef_mutex_unlock(codec);
196 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
197 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
199 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
200 unsigned int coef_idx, unsigned int mask,
201 unsigned int bits_set)
203 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
206 __alc_write_coefex_idx(codec, nid, coef_idx,
207 (val & ~mask) | bits_set);
210 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
211 unsigned int coef_idx, unsigned int mask,
212 unsigned int bits_set)
214 coef_mutex_lock(codec);
215 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
216 coef_mutex_unlock(codec);
219 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
220 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
222 /* a special bypass for COEF 0; read the cached value at the second time */
223 static unsigned int alc_get_coef0(struct hda_codec *codec)
225 struct alc_spec *spec = codec->spec;
228 spec->coef0 = alc_read_coef_idx(codec, 0);
232 /* coef writes/updates batch */
240 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
241 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
242 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
243 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
244 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
246 static void alc_process_coef_fw(struct hda_codec *codec,
247 const struct coef_fw *fw)
249 coef_mutex_lock(codec);
250 for (; fw->nid; fw++) {
251 if (fw->mask == (unsigned short)-1)
252 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
254 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
257 coef_mutex_unlock(codec);
261 * GPIO setup tables, used in initialization
264 /* Enable GPIO mask and set output */
265 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
267 struct alc_spec *spec = codec->spec;
269 spec->gpio_mask |= mask;
270 spec->gpio_dir |= mask;
271 spec->gpio_data |= mask;
274 static void alc_write_gpio_data(struct hda_codec *codec)
276 struct alc_spec *spec = codec->spec;
278 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
282 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
285 struct alc_spec *spec = codec->spec;
286 unsigned int oldval = spec->gpio_data;
289 spec->gpio_data |= mask;
291 spec->gpio_data &= ~mask;
292 if (oldval != spec->gpio_data)
293 alc_write_gpio_data(codec);
296 static void alc_write_gpio(struct hda_codec *codec)
298 struct alc_spec *spec = codec->spec;
300 if (!spec->gpio_mask)
303 snd_hda_codec_write(codec, codec->core.afg, 0,
304 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
305 snd_hda_codec_write(codec, codec->core.afg, 0,
306 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
307 if (spec->gpio_write_delay)
309 alc_write_gpio_data(codec);
312 static void alc_fixup_gpio(struct hda_codec *codec, int action,
315 if (action == HDA_FIXUP_ACT_PRE_PROBE)
316 alc_setup_gpio(codec, mask);
319 static void alc_fixup_gpio1(struct hda_codec *codec,
320 const struct hda_fixup *fix, int action)
322 alc_fixup_gpio(codec, action, 0x01);
325 static void alc_fixup_gpio2(struct hda_codec *codec,
326 const struct hda_fixup *fix, int action)
328 alc_fixup_gpio(codec, action, 0x02);
331 static void alc_fixup_gpio3(struct hda_codec *codec,
332 const struct hda_fixup *fix, int action)
334 alc_fixup_gpio(codec, action, 0x03);
337 static void alc_fixup_gpio4(struct hda_codec *codec,
338 const struct hda_fixup *fix, int action)
340 alc_fixup_gpio(codec, action, 0x04);
343 static void alc_fixup_micmute_led(struct hda_codec *codec,
344 const struct hda_fixup *fix, int action)
346 if (action == HDA_FIXUP_ACT_PRE_PROBE)
347 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
351 * Fix hardware PLL issue
352 * On some codecs, the analog PLL gating control must be off while
353 * the default value is 1.
355 static void alc_fix_pll(struct hda_codec *codec)
357 struct alc_spec *spec = codec->spec;
360 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
361 1 << spec->pll_coef_bit, 0);
364 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
365 unsigned int coef_idx, unsigned int coef_bit)
367 struct alc_spec *spec = codec->spec;
369 spec->pll_coef_idx = coef_idx;
370 spec->pll_coef_bit = coef_bit;
374 /* update the master volume per volume-knob's unsol event */
375 static void alc_update_knob_master(struct hda_codec *codec,
376 struct hda_jack_callback *jack)
379 struct snd_kcontrol *kctl;
380 struct snd_ctl_elem_value *uctl;
382 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
385 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
388 val = snd_hda_codec_read(codec, jack->nid, 0,
389 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
390 val &= HDA_AMP_VOLMASK;
391 uctl->value.integer.value[0] = val;
392 uctl->value.integer.value[1] = val;
393 kctl->put(kctl, uctl);
397 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
399 /* For some reason, the res given from ALC880 is broken.
400 Here we adjust it properly. */
401 snd_hda_jack_unsol_event(codec, res >> 2);
404 /* Change EAPD to verb control */
405 static void alc_fill_eapd_coef(struct hda_codec *codec)
409 coef = alc_get_coef0(codec);
411 switch (codec->core.vendor_id) {
413 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
417 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
420 if ((coef & 0x00f0) == 0x0010)
421 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
422 if ((coef & 0x00f0) == 0x0020)
423 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
424 if ((coef & 0x00f0) == 0x0030)
425 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
431 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
436 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
455 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
458 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
461 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
462 alc_write_coef_idx(codec, 0x8, 0x4ab7);
465 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
474 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
477 if ((coef & 0x00f0) == 0x0030)
478 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
487 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
491 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
494 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
497 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
500 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
501 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
505 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
512 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
517 /* additional initialization for ALC888 variants */
518 static void alc888_coef_init(struct hda_codec *codec)
520 switch (alc_get_coef0(codec) & 0x00f0) {
525 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
530 /* turn on/off EAPD control (only if available) */
531 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
533 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
535 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
536 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
540 /* turn on/off EAPD controls of the codec */
541 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
543 /* We currently only handle front, HP */
544 static const hda_nid_t pins[] = {
545 0x0f, 0x10, 0x14, 0x15, 0x17, 0
548 for (p = pins; *p; p++)
549 set_eapd(codec, *p, on);
552 static int find_ext_mic_pin(struct hda_codec *codec);
554 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
556 const struct hda_pincfg *pin;
557 int mic_pin = find_ext_mic_pin(codec);
560 /* don't shut up pins when unloading the driver; otherwise it breaks
561 * the default pin setup at the next load of the driver
563 if (codec->bus->shutdown)
566 snd_array_for_each(&codec->init_pins, i, pin) {
567 /* use read here for syncing after issuing each verb */
568 if (pin->nid != mic_pin)
569 snd_hda_codec_read(codec, pin->nid, 0,
570 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
573 codec->pins_shutup = 1;
576 static void alc_shutup_pins(struct hda_codec *codec)
578 struct alc_spec *spec = codec->spec;
580 switch (codec->core.vendor_id) {
587 alc_headset_mic_no_shutup(codec);
590 if (!spec->no_shutup_pins)
591 snd_hda_shutup_pins(codec);
596 /* generic shutup callback;
597 * just turning off EAPD and a little pause for avoiding pop-noise
599 static void alc_eapd_shutup(struct hda_codec *codec)
601 struct alc_spec *spec = codec->spec;
603 alc_auto_setup_eapd(codec, false);
604 if (!spec->no_depop_delay)
606 alc_shutup_pins(codec);
609 /* generic EAPD initialization */
610 static void alc_auto_init_amp(struct hda_codec *codec, int type)
612 alc_auto_setup_eapd(codec, true);
613 alc_write_gpio(codec);
615 case ALC_INIT_DEFAULT:
616 switch (codec->core.vendor_id) {
618 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
624 alc_update_coef_idx(codec, 7, 0, 0x2030);
627 alc888_coef_init(codec);
634 /* get a primary headphone pin if available */
635 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
637 if (spec->gen.autocfg.hp_pins[0])
638 return spec->gen.autocfg.hp_pins[0];
639 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
640 return spec->gen.autocfg.line_out_pins[0];
645 * Realtek SSID verification
648 /* Could be any non-zero and even value. When used as fixup, tells
649 * the driver to ignore any present sku defines.
651 #define ALC_FIXUP_SKU_IGNORE (2)
653 static void alc_fixup_sku_ignore(struct hda_codec *codec,
654 const struct hda_fixup *fix, int action)
656 struct alc_spec *spec = codec->spec;
657 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
658 spec->cdefine.fixup = 1;
659 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
663 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
664 const struct hda_fixup *fix, int action)
666 struct alc_spec *spec = codec->spec;
668 if (action == HDA_FIXUP_ACT_PROBE) {
669 spec->no_depop_delay = 1;
670 codec->depop_delay = 0;
674 static int alc_auto_parse_customize_define(struct hda_codec *codec)
676 unsigned int ass, tmp, i;
678 struct alc_spec *spec = codec->spec;
680 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
682 if (spec->cdefine.fixup) {
683 ass = spec->cdefine.sku_cfg;
684 if (ass == ALC_FIXUP_SKU_IGNORE)
689 if (!codec->bus->pci)
691 ass = codec->core.subsystem_id & 0xffff;
692 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
696 if (codec->core.vendor_id == 0x10ec0260)
698 ass = snd_hda_codec_get_pincfg(codec, nid);
701 codec_info(codec, "%s: SKU not ready 0x%08x\n",
702 codec->core.chip_name, ass);
708 for (i = 1; i < 16; i++) {
712 if (((ass >> 16) & 0xf) != tmp)
715 spec->cdefine.port_connectivity = ass >> 30;
716 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
717 spec->cdefine.check_sum = (ass >> 16) & 0xf;
718 spec->cdefine.customization = ass >> 8;
720 spec->cdefine.sku_cfg = ass;
721 spec->cdefine.external_amp = (ass & 0x38) >> 3;
722 spec->cdefine.platform_type = (ass & 0x4) >> 2;
723 spec->cdefine.swap = (ass & 0x2) >> 1;
724 spec->cdefine.override = ass & 0x1;
726 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
727 nid, spec->cdefine.sku_cfg);
728 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
729 spec->cdefine.port_connectivity);
730 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
731 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
732 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
733 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
734 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
735 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
736 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
741 /* return the position of NID in the list, or -1 if not found */
742 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
745 for (i = 0; i < nums; i++)
750 /* return true if the given NID is found in the list */
751 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
753 return find_idx_in_nid_list(nid, list, nums) >= 0;
756 /* check subsystem ID and set up device-specific initialization;
757 * return 1 if initialized, 0 if invalid SSID
759 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
760 * 31 ~ 16 : Manufacture ID
762 * 7 ~ 0 : Assembly ID
763 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
765 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
767 unsigned int ass, tmp, i;
769 struct alc_spec *spec = codec->spec;
771 if (spec->cdefine.fixup) {
772 ass = spec->cdefine.sku_cfg;
773 if (ass == ALC_FIXUP_SKU_IGNORE)
778 ass = codec->core.subsystem_id & 0xffff;
779 if (codec->bus->pci &&
780 ass != codec->bus->pci->subsystem_device && (ass & 1))
783 /* invalid SSID, check the special NID pin defcfg instead */
785 * 31~30 : port connectivity
788 * 19~16 : Check sum (15:1)
793 if (codec->core.vendor_id == 0x10ec0260)
795 ass = snd_hda_codec_get_pincfg(codec, nid);
797 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
801 if ((ass >> 30) != 1) /* no physical connection */
806 for (i = 1; i < 16; i++) {
810 if (((ass >> 16) & 0xf) != tmp)
813 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
814 ass & 0xffff, codec->core.vendor_id);
818 * 2 : 0 --> Desktop, 1 --> Laptop
819 * 3~5 : External Amplifier control
822 tmp = (ass & 0x38) >> 3; /* external Amp control */
823 if (spec->init_amp == ALC_INIT_UNDEFINED) {
826 alc_setup_gpio(codec, 0x01);
829 alc_setup_gpio(codec, 0x02);
832 alc_setup_gpio(codec, 0x03);
836 spec->init_amp = ALC_INIT_DEFAULT;
841 /* is laptop or Desktop and enable the function "Mute internal speaker
842 * when the external headphone out jack is plugged"
847 * 10~8 : Jack location
848 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
850 * 15 : 1 --> enable the function "Mute internal speaker
851 * when the external headphone out jack is plugged"
853 if (!alc_get_hp_pin(spec)) {
855 tmp = (ass >> 11) & 0x3; /* HP to chassis */
857 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
858 spec->gen.autocfg.line_outs))
860 spec->gen.autocfg.hp_pins[0] = nid;
865 /* Check the validity of ALC subsystem-id
866 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
867 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
869 if (!alc_subsystem_id(codec, ports)) {
870 struct alc_spec *spec = codec->spec;
871 if (spec->init_amp == ALC_INIT_UNDEFINED) {
873 "realtek: Enable default setup for auto mode as fallback\n");
874 spec->init_amp = ALC_INIT_DEFAULT;
882 static void alc_fixup_inv_dmic(struct hda_codec *codec,
883 const struct hda_fixup *fix, int action)
885 struct alc_spec *spec = codec->spec;
887 spec->gen.inv_dmic_split = 1;
891 static int alc_build_controls(struct hda_codec *codec)
895 err = snd_hda_gen_build_controls(codec);
899 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
908 static void alc_pre_init(struct hda_codec *codec)
910 alc_fill_eapd_coef(codec);
913 #define is_s3_resume(codec) \
914 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
915 #define is_s4_resume(codec) \
916 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
918 static int alc_init(struct hda_codec *codec)
920 struct alc_spec *spec = codec->spec;
922 /* hibernation resume needs the full chip initialization */
923 if (is_s4_resume(codec))
927 spec->init_hook(codec);
929 spec->gen.skip_verbs = 1; /* applied in below */
930 snd_hda_gen_init(codec);
932 alc_auto_init_amp(codec, spec->init_amp);
933 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
935 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
940 #define alc_free snd_hda_gen_free
943 static inline void alc_shutup(struct hda_codec *codec)
945 struct alc_spec *spec = codec->spec;
947 if (!snd_hda_get_bool_hint(codec, "shutup"))
948 return; /* disabled explicitly by hints */
950 if (spec && spec->shutup)
953 alc_shutup_pins(codec);
956 static void alc_power_eapd(struct hda_codec *codec)
958 alc_auto_setup_eapd(codec, false);
961 static int alc_suspend(struct hda_codec *codec)
963 struct alc_spec *spec = codec->spec;
965 if (spec && spec->power_hook)
966 spec->power_hook(codec);
970 static int alc_resume(struct hda_codec *codec)
972 struct alc_spec *spec = codec->spec;
974 if (!spec->no_depop_delay)
975 msleep(150); /* to avoid pop noise */
976 codec->patch_ops.init(codec);
977 snd_hda_regmap_sync(codec);
978 hda_call_check_power_status(codec, 0x01);
985 static const struct hda_codec_ops alc_patch_ops = {
986 .build_controls = alc_build_controls,
987 .build_pcms = snd_hda_gen_build_pcms,
990 .unsol_event = snd_hda_jack_unsol_event,
992 .resume = alc_resume,
993 .suspend = alc_suspend,
994 .check_power_status = snd_hda_gen_check_power_status,
999 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1002 * Rename codecs appropriately from COEF value or subvendor id
1004 struct alc_codec_rename_table {
1005 unsigned int vendor_id;
1006 unsigned short coef_mask;
1007 unsigned short coef_bits;
1011 struct alc_codec_rename_pci_table {
1012 unsigned int codec_vendor_id;
1013 unsigned short pci_subvendor;
1014 unsigned short pci_subdevice;
1018 static const struct alc_codec_rename_table rename_tbl[] = {
1019 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1020 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1021 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1022 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1023 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1024 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1025 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1026 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1027 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1028 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1029 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1030 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1031 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1032 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1033 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1034 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1035 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1036 { } /* terminator */
1039 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1040 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1041 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1042 { 0x10ec0283, 0x1028, 0, "ALC3223" },
1043 { 0x10ec0288, 0x1028, 0, "ALC3263" },
1044 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1045 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1046 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1047 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1048 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1049 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1050 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1051 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1052 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1053 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1054 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1055 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1056 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1057 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1058 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1059 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1060 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1061 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1062 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1063 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1064 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1065 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1066 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1067 { } /* terminator */
1070 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1072 const struct alc_codec_rename_table *p;
1073 const struct alc_codec_rename_pci_table *q;
1075 for (p = rename_tbl; p->vendor_id; p++) {
1076 if (p->vendor_id != codec->core.vendor_id)
1078 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1079 return alc_codec_rename(codec, p->name);
1082 if (!codec->bus->pci)
1084 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1085 if (q->codec_vendor_id != codec->core.vendor_id)
1087 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1089 if (!q->pci_subdevice ||
1090 q->pci_subdevice == codec->bus->pci->subsystem_device)
1091 return alc_codec_rename(codec, q->name);
1099 * Digital-beep handlers
1101 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1103 /* additional beep mixers; private_value will be overwritten */
1104 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1105 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1106 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1109 /* set up and create beep controls */
1110 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1113 struct snd_kcontrol_new *knew;
1114 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1117 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1118 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1119 &alc_beep_mixer[i]);
1122 knew->private_value = beep_amp;
1127 static const struct snd_pci_quirk beep_allow_list[] = {
1128 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1129 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1130 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1131 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1132 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1133 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1134 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1135 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1136 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1137 /* denylist -- no beep available */
1138 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1139 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1143 static inline int has_cdefine_beep(struct hda_codec *codec)
1145 struct alc_spec *spec = codec->spec;
1146 const struct snd_pci_quirk *q;
1147 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1150 return spec->cdefine.enable_pcbeep;
1153 #define set_beep_amp(spec, nid, idx, dir) 0
1154 #define has_cdefine_beep(codec) 0
1157 /* parse the BIOS configuration and set up the alc_spec */
1158 /* return 1 if successful, 0 if the proper config is not found,
1159 * or a negative error code
1161 static int alc_parse_auto_config(struct hda_codec *codec,
1162 const hda_nid_t *ignore_nids,
1163 const hda_nid_t *ssid_nids)
1165 struct alc_spec *spec = codec->spec;
1166 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1169 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1175 alc_ssid_check(codec, ssid_nids);
1177 err = snd_hda_gen_parse_auto_config(codec, cfg);
1184 /* common preparation job for alc_spec */
1185 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1187 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1193 snd_hda_gen_spec_init(&spec->gen);
1194 spec->gen.mixer_nid = mixer_nid;
1195 spec->gen.own_eapd_ctl = 1;
1196 codec->single_adc_amp = 1;
1197 /* FIXME: do we need this for all Realtek codec models? */
1198 codec->spdif_status_reset = 1;
1199 codec->forced_resume = 1;
1200 codec->patch_ops = alc_patch_ops;
1201 mutex_init(&spec->coef_mutex);
1203 err = alc_codec_rename_from_preset(codec);
1211 static int alc880_parse_auto_config(struct hda_codec *codec)
1213 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1214 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1215 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1224 ALC880_FIXUP_MEDION_RIM,
1226 ALC880_FIXUP_LG_LW25,
1228 ALC880_FIXUP_EAPD_COEF,
1229 ALC880_FIXUP_TCL_S700,
1230 ALC880_FIXUP_VOL_KNOB,
1231 ALC880_FIXUP_FUJITSU,
1233 ALC880_FIXUP_UNIWILL,
1234 ALC880_FIXUP_UNIWILL_DIG,
1236 ALC880_FIXUP_ASUS_W5A,
1237 ALC880_FIXUP_3ST_BASE,
1239 ALC880_FIXUP_3ST_DIG,
1240 ALC880_FIXUP_5ST_BASE,
1242 ALC880_FIXUP_5ST_DIG,
1243 ALC880_FIXUP_6ST_BASE,
1245 ALC880_FIXUP_6ST_DIG,
1246 ALC880_FIXUP_6ST_AUTOMUTE,
1249 /* enable the volume-knob widget support on NID 0x21 */
1250 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1251 const struct hda_fixup *fix, int action)
1253 if (action == HDA_FIXUP_ACT_PROBE)
1254 snd_hda_jack_detect_enable_callback(codec, 0x21,
1255 alc_update_knob_master);
1258 static const struct hda_fixup alc880_fixups[] = {
1259 [ALC880_FIXUP_GPIO1] = {
1260 .type = HDA_FIXUP_FUNC,
1261 .v.func = alc_fixup_gpio1,
1263 [ALC880_FIXUP_GPIO2] = {
1264 .type = HDA_FIXUP_FUNC,
1265 .v.func = alc_fixup_gpio2,
1267 [ALC880_FIXUP_MEDION_RIM] = {
1268 .type = HDA_FIXUP_VERBS,
1269 .v.verbs = (const struct hda_verb[]) {
1270 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1271 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1275 .chain_id = ALC880_FIXUP_GPIO2,
1277 [ALC880_FIXUP_LG] = {
1278 .type = HDA_FIXUP_PINS,
1279 .v.pins = (const struct hda_pintbl[]) {
1280 /* disable bogus unused pins */
1281 { 0x16, 0x411111f0 },
1282 { 0x18, 0x411111f0 },
1283 { 0x1a, 0x411111f0 },
1287 [ALC880_FIXUP_LG_LW25] = {
1288 .type = HDA_FIXUP_PINS,
1289 .v.pins = (const struct hda_pintbl[]) {
1290 { 0x1a, 0x0181344f }, /* line-in */
1291 { 0x1b, 0x0321403f }, /* headphone */
1295 [ALC880_FIXUP_W810] = {
1296 .type = HDA_FIXUP_PINS,
1297 .v.pins = (const struct hda_pintbl[]) {
1298 /* disable bogus unused pins */
1299 { 0x17, 0x411111f0 },
1303 .chain_id = ALC880_FIXUP_GPIO2,
1305 [ALC880_FIXUP_EAPD_COEF] = {
1306 .type = HDA_FIXUP_VERBS,
1307 .v.verbs = (const struct hda_verb[]) {
1308 /* change to EAPD mode */
1309 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1310 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1314 [ALC880_FIXUP_TCL_S700] = {
1315 .type = HDA_FIXUP_VERBS,
1316 .v.verbs = (const struct hda_verb[]) {
1317 /* change to EAPD mode */
1318 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1319 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1323 .chain_id = ALC880_FIXUP_GPIO2,
1325 [ALC880_FIXUP_VOL_KNOB] = {
1326 .type = HDA_FIXUP_FUNC,
1327 .v.func = alc880_fixup_vol_knob,
1329 [ALC880_FIXUP_FUJITSU] = {
1330 /* override all pins as BIOS on old Amilo is broken */
1331 .type = HDA_FIXUP_PINS,
1332 .v.pins = (const struct hda_pintbl[]) {
1333 { 0x14, 0x0121401f }, /* HP */
1334 { 0x15, 0x99030120 }, /* speaker */
1335 { 0x16, 0x99030130 }, /* bass speaker */
1336 { 0x17, 0x411111f0 }, /* N/A */
1337 { 0x18, 0x411111f0 }, /* N/A */
1338 { 0x19, 0x01a19950 }, /* mic-in */
1339 { 0x1a, 0x411111f0 }, /* N/A */
1340 { 0x1b, 0x411111f0 }, /* N/A */
1341 { 0x1c, 0x411111f0 }, /* N/A */
1342 { 0x1d, 0x411111f0 }, /* N/A */
1343 { 0x1e, 0x01454140 }, /* SPDIF out */
1347 .chain_id = ALC880_FIXUP_VOL_KNOB,
1349 [ALC880_FIXUP_F1734] = {
1350 /* almost compatible with FUJITSU, but no bass and SPDIF */
1351 .type = HDA_FIXUP_PINS,
1352 .v.pins = (const struct hda_pintbl[]) {
1353 { 0x14, 0x0121401f }, /* HP */
1354 { 0x15, 0x99030120 }, /* speaker */
1355 { 0x16, 0x411111f0 }, /* N/A */
1356 { 0x17, 0x411111f0 }, /* N/A */
1357 { 0x18, 0x411111f0 }, /* N/A */
1358 { 0x19, 0x01a19950 }, /* mic-in */
1359 { 0x1a, 0x411111f0 }, /* N/A */
1360 { 0x1b, 0x411111f0 }, /* N/A */
1361 { 0x1c, 0x411111f0 }, /* N/A */
1362 { 0x1d, 0x411111f0 }, /* N/A */
1363 { 0x1e, 0x411111f0 }, /* N/A */
1367 .chain_id = ALC880_FIXUP_VOL_KNOB,
1369 [ALC880_FIXUP_UNIWILL] = {
1370 /* need to fix HP and speaker pins to be parsed correctly */
1371 .type = HDA_FIXUP_PINS,
1372 .v.pins = (const struct hda_pintbl[]) {
1373 { 0x14, 0x0121411f }, /* HP */
1374 { 0x15, 0x99030120 }, /* speaker */
1375 { 0x16, 0x99030130 }, /* bass speaker */
1379 [ALC880_FIXUP_UNIWILL_DIG] = {
1380 .type = HDA_FIXUP_PINS,
1381 .v.pins = (const struct hda_pintbl[]) {
1382 /* disable bogus unused pins */
1383 { 0x17, 0x411111f0 },
1384 { 0x19, 0x411111f0 },
1385 { 0x1b, 0x411111f0 },
1386 { 0x1f, 0x411111f0 },
1390 [ALC880_FIXUP_Z71V] = {
1391 .type = HDA_FIXUP_PINS,
1392 .v.pins = (const struct hda_pintbl[]) {
1393 /* set up the whole pins as BIOS is utterly broken */
1394 { 0x14, 0x99030120 }, /* speaker */
1395 { 0x15, 0x0121411f }, /* HP */
1396 { 0x16, 0x411111f0 }, /* N/A */
1397 { 0x17, 0x411111f0 }, /* N/A */
1398 { 0x18, 0x01a19950 }, /* mic-in */
1399 { 0x19, 0x411111f0 }, /* N/A */
1400 { 0x1a, 0x01813031 }, /* line-in */
1401 { 0x1b, 0x411111f0 }, /* N/A */
1402 { 0x1c, 0x411111f0 }, /* N/A */
1403 { 0x1d, 0x411111f0 }, /* N/A */
1404 { 0x1e, 0x0144111e }, /* SPDIF */
1408 [ALC880_FIXUP_ASUS_W5A] = {
1409 .type = HDA_FIXUP_PINS,
1410 .v.pins = (const struct hda_pintbl[]) {
1411 /* set up the whole pins as BIOS is utterly broken */
1412 { 0x14, 0x0121411f }, /* HP */
1413 { 0x15, 0x411111f0 }, /* N/A */
1414 { 0x16, 0x411111f0 }, /* N/A */
1415 { 0x17, 0x411111f0 }, /* N/A */
1416 { 0x18, 0x90a60160 }, /* mic */
1417 { 0x19, 0x411111f0 }, /* N/A */
1418 { 0x1a, 0x411111f0 }, /* N/A */
1419 { 0x1b, 0x411111f0 }, /* N/A */
1420 { 0x1c, 0x411111f0 }, /* N/A */
1421 { 0x1d, 0x411111f0 }, /* N/A */
1422 { 0x1e, 0xb743111e }, /* SPDIF out */
1426 .chain_id = ALC880_FIXUP_GPIO1,
1428 [ALC880_FIXUP_3ST_BASE] = {
1429 .type = HDA_FIXUP_PINS,
1430 .v.pins = (const struct hda_pintbl[]) {
1431 { 0x14, 0x01014010 }, /* line-out */
1432 { 0x15, 0x411111f0 }, /* N/A */
1433 { 0x16, 0x411111f0 }, /* N/A */
1434 { 0x17, 0x411111f0 }, /* N/A */
1435 { 0x18, 0x01a19c30 }, /* mic-in */
1436 { 0x19, 0x0121411f }, /* HP */
1437 { 0x1a, 0x01813031 }, /* line-in */
1438 { 0x1b, 0x02a19c40 }, /* front-mic */
1439 { 0x1c, 0x411111f0 }, /* N/A */
1440 { 0x1d, 0x411111f0 }, /* N/A */
1441 /* 0x1e is filled in below */
1442 { 0x1f, 0x411111f0 }, /* N/A */
1446 [ALC880_FIXUP_3ST] = {
1447 .type = HDA_FIXUP_PINS,
1448 .v.pins = (const struct hda_pintbl[]) {
1449 { 0x1e, 0x411111f0 }, /* N/A */
1453 .chain_id = ALC880_FIXUP_3ST_BASE,
1455 [ALC880_FIXUP_3ST_DIG] = {
1456 .type = HDA_FIXUP_PINS,
1457 .v.pins = (const struct hda_pintbl[]) {
1458 { 0x1e, 0x0144111e }, /* SPDIF */
1462 .chain_id = ALC880_FIXUP_3ST_BASE,
1464 [ALC880_FIXUP_5ST_BASE] = {
1465 .type = HDA_FIXUP_PINS,
1466 .v.pins = (const struct hda_pintbl[]) {
1467 { 0x14, 0x01014010 }, /* front */
1468 { 0x15, 0x411111f0 }, /* N/A */
1469 { 0x16, 0x01011411 }, /* CLFE */
1470 { 0x17, 0x01016412 }, /* surr */
1471 { 0x18, 0x01a19c30 }, /* mic-in */
1472 { 0x19, 0x0121411f }, /* HP */
1473 { 0x1a, 0x01813031 }, /* line-in */
1474 { 0x1b, 0x02a19c40 }, /* front-mic */
1475 { 0x1c, 0x411111f0 }, /* N/A */
1476 { 0x1d, 0x411111f0 }, /* N/A */
1477 /* 0x1e is filled in below */
1478 { 0x1f, 0x411111f0 }, /* N/A */
1482 [ALC880_FIXUP_5ST] = {
1483 .type = HDA_FIXUP_PINS,
1484 .v.pins = (const struct hda_pintbl[]) {
1485 { 0x1e, 0x411111f0 }, /* N/A */
1489 .chain_id = ALC880_FIXUP_5ST_BASE,
1491 [ALC880_FIXUP_5ST_DIG] = {
1492 .type = HDA_FIXUP_PINS,
1493 .v.pins = (const struct hda_pintbl[]) {
1494 { 0x1e, 0x0144111e }, /* SPDIF */
1498 .chain_id = ALC880_FIXUP_5ST_BASE,
1500 [ALC880_FIXUP_6ST_BASE] = {
1501 .type = HDA_FIXUP_PINS,
1502 .v.pins = (const struct hda_pintbl[]) {
1503 { 0x14, 0x01014010 }, /* front */
1504 { 0x15, 0x01016412 }, /* surr */
1505 { 0x16, 0x01011411 }, /* CLFE */
1506 { 0x17, 0x01012414 }, /* side */
1507 { 0x18, 0x01a19c30 }, /* mic-in */
1508 { 0x19, 0x02a19c40 }, /* front-mic */
1509 { 0x1a, 0x01813031 }, /* line-in */
1510 { 0x1b, 0x0121411f }, /* HP */
1511 { 0x1c, 0x411111f0 }, /* N/A */
1512 { 0x1d, 0x411111f0 }, /* N/A */
1513 /* 0x1e is filled in below */
1514 { 0x1f, 0x411111f0 }, /* N/A */
1518 [ALC880_FIXUP_6ST] = {
1519 .type = HDA_FIXUP_PINS,
1520 .v.pins = (const struct hda_pintbl[]) {
1521 { 0x1e, 0x411111f0 }, /* N/A */
1525 .chain_id = ALC880_FIXUP_6ST_BASE,
1527 [ALC880_FIXUP_6ST_DIG] = {
1528 .type = HDA_FIXUP_PINS,
1529 .v.pins = (const struct hda_pintbl[]) {
1530 { 0x1e, 0x0144111e }, /* SPDIF */
1534 .chain_id = ALC880_FIXUP_6ST_BASE,
1536 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1537 .type = HDA_FIXUP_PINS,
1538 .v.pins = (const struct hda_pintbl[]) {
1539 { 0x1b, 0x0121401f }, /* HP with jack detect */
1542 .chained_before = true,
1543 .chain_id = ALC880_FIXUP_6ST_BASE,
1547 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1548 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1549 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1550 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1551 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1552 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1553 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1554 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1555 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1556 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1557 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1558 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1559 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1560 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1561 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1562 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1563 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1564 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1565 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1566 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1567 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1568 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1569 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1570 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1572 /* Below is the copied entries from alc880_quirks.c.
1573 * It's not quite sure whether BIOS sets the correct pin-config table
1574 * on these machines, thus they are kept to be compatible with
1575 * the old static quirks. Once when it's confirmed to work without
1576 * these overrides, it'd be better to remove.
1578 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1579 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1580 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1581 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1582 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1583 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1584 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1585 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1586 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1587 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1588 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1589 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1590 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1591 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1592 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1593 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1594 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1595 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1596 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1597 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1598 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1599 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1600 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1601 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1602 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1603 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1604 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1605 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1606 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1607 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1608 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1609 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1610 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1612 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1613 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1614 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1618 static const struct hda_model_fixup alc880_fixup_models[] = {
1619 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1620 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1621 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1622 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1623 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1624 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1625 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1631 * OK, here we have finally the patch for ALC880
1633 static int patch_alc880(struct hda_codec *codec)
1635 struct alc_spec *spec;
1638 err = alc_alloc_spec(codec, 0x0b);
1643 spec->gen.need_dac_fix = 1;
1644 spec->gen.beep_nid = 0x01;
1646 codec->patch_ops.unsol_event = alc880_unsol_event;
1648 alc_pre_init(codec);
1650 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1652 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1654 /* automatic parse from the BIOS config */
1655 err = alc880_parse_auto_config(codec);
1659 if (!spec->gen.no_analog) {
1660 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1665 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1678 static int alc260_parse_auto_config(struct hda_codec *codec)
1680 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1681 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1682 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1689 ALC260_FIXUP_HP_DC5750,
1690 ALC260_FIXUP_HP_PIN_0F,
1693 ALC260_FIXUP_GPIO1_TOGGLE,
1694 ALC260_FIXUP_REPLACER,
1695 ALC260_FIXUP_HP_B1900,
1697 ALC260_FIXUP_FSC_S7020,
1698 ALC260_FIXUP_FSC_S7020_JWSE,
1699 ALC260_FIXUP_VAIO_PINS,
1702 static void alc260_gpio1_automute(struct hda_codec *codec)
1704 struct alc_spec *spec = codec->spec;
1706 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1709 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1710 const struct hda_fixup *fix, int action)
1712 struct alc_spec *spec = codec->spec;
1713 if (action == HDA_FIXUP_ACT_PROBE) {
1714 /* although the machine has only one output pin, we need to
1715 * toggle GPIO1 according to the jack state
1717 spec->gen.automute_hook = alc260_gpio1_automute;
1718 spec->gen.detect_hp = 1;
1719 spec->gen.automute_speaker = 1;
1720 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1721 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1722 snd_hda_gen_hp_automute);
1723 alc_setup_gpio(codec, 0x01);
1727 static void alc260_fixup_kn1(struct hda_codec *codec,
1728 const struct hda_fixup *fix, int action)
1730 struct alc_spec *spec = codec->spec;
1731 static const struct hda_pintbl pincfgs[] = {
1732 { 0x0f, 0x02214000 }, /* HP/speaker */
1733 { 0x12, 0x90a60160 }, /* int mic */
1734 { 0x13, 0x02a19000 }, /* ext mic */
1735 { 0x18, 0x01446000 }, /* SPDIF out */
1736 /* disable bogus I/O pins */
1737 { 0x10, 0x411111f0 },
1738 { 0x11, 0x411111f0 },
1739 { 0x14, 0x411111f0 },
1740 { 0x15, 0x411111f0 },
1741 { 0x16, 0x411111f0 },
1742 { 0x17, 0x411111f0 },
1743 { 0x19, 0x411111f0 },
1748 case HDA_FIXUP_ACT_PRE_PROBE:
1749 snd_hda_apply_pincfgs(codec, pincfgs);
1750 spec->init_amp = ALC_INIT_NONE;
1755 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1756 const struct hda_fixup *fix, int action)
1758 struct alc_spec *spec = codec->spec;
1759 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1760 spec->init_amp = ALC_INIT_NONE;
1763 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1764 const struct hda_fixup *fix, int action)
1766 struct alc_spec *spec = codec->spec;
1767 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1768 spec->gen.add_jack_modes = 1;
1769 spec->gen.hp_mic = 1;
1773 static const struct hda_fixup alc260_fixups[] = {
1774 [ALC260_FIXUP_HP_DC5750] = {
1775 .type = HDA_FIXUP_PINS,
1776 .v.pins = (const struct hda_pintbl[]) {
1777 { 0x11, 0x90130110 }, /* speaker */
1781 [ALC260_FIXUP_HP_PIN_0F] = {
1782 .type = HDA_FIXUP_PINS,
1783 .v.pins = (const struct hda_pintbl[]) {
1784 { 0x0f, 0x01214000 }, /* HP */
1788 [ALC260_FIXUP_COEF] = {
1789 .type = HDA_FIXUP_VERBS,
1790 .v.verbs = (const struct hda_verb[]) {
1791 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1792 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1796 [ALC260_FIXUP_GPIO1] = {
1797 .type = HDA_FIXUP_FUNC,
1798 .v.func = alc_fixup_gpio1,
1800 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1801 .type = HDA_FIXUP_FUNC,
1802 .v.func = alc260_fixup_gpio1_toggle,
1804 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1806 [ALC260_FIXUP_REPLACER] = {
1807 .type = HDA_FIXUP_VERBS,
1808 .v.verbs = (const struct hda_verb[]) {
1809 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1810 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1814 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1816 [ALC260_FIXUP_HP_B1900] = {
1817 .type = HDA_FIXUP_FUNC,
1818 .v.func = alc260_fixup_gpio1_toggle,
1820 .chain_id = ALC260_FIXUP_COEF,
1822 [ALC260_FIXUP_KN1] = {
1823 .type = HDA_FIXUP_FUNC,
1824 .v.func = alc260_fixup_kn1,
1826 [ALC260_FIXUP_FSC_S7020] = {
1827 .type = HDA_FIXUP_FUNC,
1828 .v.func = alc260_fixup_fsc_s7020,
1830 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1831 .type = HDA_FIXUP_FUNC,
1832 .v.func = alc260_fixup_fsc_s7020_jwse,
1834 .chain_id = ALC260_FIXUP_FSC_S7020,
1836 [ALC260_FIXUP_VAIO_PINS] = {
1837 .type = HDA_FIXUP_PINS,
1838 .v.pins = (const struct hda_pintbl[]) {
1839 /* Pin configs are missing completely on some VAIOs */
1840 { 0x0f, 0x01211020 },
1841 { 0x10, 0x0001003f },
1842 { 0x11, 0x411111f0 },
1843 { 0x12, 0x01a15930 },
1844 { 0x13, 0x411111f0 },
1845 { 0x14, 0x411111f0 },
1846 { 0x15, 0x411111f0 },
1847 { 0x16, 0x411111f0 },
1848 { 0x17, 0x411111f0 },
1849 { 0x18, 0x411111f0 },
1850 { 0x19, 0x411111f0 },
1856 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1857 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1858 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1859 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1860 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1861 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1862 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1863 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1864 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1865 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1866 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1867 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1868 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1872 static const struct hda_model_fixup alc260_fixup_models[] = {
1873 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1874 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1875 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1876 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1882 static int patch_alc260(struct hda_codec *codec)
1884 struct alc_spec *spec;
1887 err = alc_alloc_spec(codec, 0x07);
1892 /* as quite a few machines require HP amp for speaker outputs,
1893 * it's easier to enable it unconditionally; even if it's unneeded,
1894 * it's almost harmless.
1896 spec->gen.prefer_hp_amp = 1;
1897 spec->gen.beep_nid = 0x01;
1899 spec->shutup = alc_eapd_shutup;
1901 alc_pre_init(codec);
1903 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1905 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1907 /* automatic parse from the BIOS config */
1908 err = alc260_parse_auto_config(codec);
1912 if (!spec->gen.no_analog) {
1913 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1918 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1929 * ALC882/883/885/888/889 support
1931 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1932 * configuration. Each pin widget can choose any input DACs and a mixer.
1933 * Each ADC is connected from a mixer of all inputs. This makes possible
1934 * 6-channel independent captures.
1936 * In addition, an independent DAC for the multi-playback (not used in this
1944 ALC882_FIXUP_ABIT_AW9D_MAX,
1945 ALC882_FIXUP_LENOVO_Y530,
1946 ALC882_FIXUP_PB_M5210,
1947 ALC882_FIXUP_ACER_ASPIRE_7736,
1948 ALC882_FIXUP_ASUS_W90V,
1950 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1951 ALC889_FIXUP_VAIO_TT,
1952 ALC888_FIXUP_EEE1601,
1956 ALC883_FIXUP_ACER_EAPD,
1961 ALC882_FIXUP_ASUS_W2JC,
1962 ALC882_FIXUP_ACER_ASPIRE_4930G,
1963 ALC882_FIXUP_ACER_ASPIRE_8930G,
1964 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1965 ALC885_FIXUP_MACPRO_GPIO,
1966 ALC889_FIXUP_DAC_ROUTE,
1967 ALC889_FIXUP_MBP_VREF,
1968 ALC889_FIXUP_IMAC91_VREF,
1969 ALC889_FIXUP_MBA11_VREF,
1970 ALC889_FIXUP_MBA21_VREF,
1971 ALC889_FIXUP_MP11_VREF,
1972 ALC889_FIXUP_MP41_VREF,
1973 ALC882_FIXUP_INV_DMIC,
1974 ALC882_FIXUP_NO_PRIMARY_HP,
1975 ALC887_FIXUP_ASUS_BASS,
1976 ALC887_FIXUP_BASS_CHMAP,
1977 ALC1220_FIXUP_GB_DUAL_CODECS,
1978 ALC1220_FIXUP_GB_X570,
1979 ALC1220_FIXUP_CLEVO_P950,
1980 ALC1220_FIXUP_CLEVO_PB51ED,
1981 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1982 ALC887_FIXUP_ASUS_AUDIO,
1983 ALC887_FIXUP_ASUS_HMIC,
1984 ALCS1200A_FIXUP_MIC_VREF,
1987 static void alc889_fixup_coef(struct hda_codec *codec,
1988 const struct hda_fixup *fix, int action)
1990 if (action != HDA_FIXUP_ACT_INIT)
1992 alc_update_coef_idx(codec, 7, 0, 0x2030);
1995 /* set up GPIO at initialization */
1996 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1997 const struct hda_fixup *fix, int action)
1999 struct alc_spec *spec = codec->spec;
2001 spec->gpio_write_delay = true;
2002 alc_fixup_gpio3(codec, fix, action);
2005 /* Fix the connection of some pins for ALC889:
2006 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2007 * work correctly (bko#42740)
2009 static void alc889_fixup_dac_route(struct hda_codec *codec,
2010 const struct hda_fixup *fix, int action)
2012 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2013 /* fake the connections during parsing the tree */
2014 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2015 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2016 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2017 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2018 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2019 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2020 } else if (action == HDA_FIXUP_ACT_PROBE) {
2021 /* restore the connections */
2022 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2023 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2024 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2025 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2026 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2030 /* Set VREF on HP pin */
2031 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2032 const struct hda_fixup *fix, int action)
2034 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2035 struct alc_spec *spec = codec->spec;
2038 if (action != HDA_FIXUP_ACT_INIT)
2040 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2041 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2042 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2044 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2045 val |= AC_PINCTL_VREF_80;
2046 snd_hda_set_pin_ctl(codec, nids[i], val);
2047 spec->gen.keep_vref_in_automute = 1;
2052 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2053 const hda_nid_t *nids, int num_nids)
2055 struct alc_spec *spec = codec->spec;
2058 for (i = 0; i < num_nids; i++) {
2060 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2061 val |= AC_PINCTL_VREF_50;
2062 snd_hda_set_pin_ctl(codec, nids[i], val);
2064 spec->gen.keep_vref_in_automute = 1;
2067 /* Set VREF on speaker pins on imac91 */
2068 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2069 const struct hda_fixup *fix, int action)
2071 static const hda_nid_t nids[] = { 0x18, 0x1a };
2073 if (action == HDA_FIXUP_ACT_INIT)
2074 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2077 /* Set VREF on speaker pins on mba11 */
2078 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2079 const struct hda_fixup *fix, int action)
2081 static const hda_nid_t nids[] = { 0x18 };
2083 if (action == HDA_FIXUP_ACT_INIT)
2084 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2087 /* Set VREF on speaker pins on mba21 */
2088 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2089 const struct hda_fixup *fix, int action)
2091 static const hda_nid_t nids[] = { 0x18, 0x19 };
2093 if (action == HDA_FIXUP_ACT_INIT)
2094 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2097 /* Don't take HP output as primary
2098 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2099 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2101 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2102 const struct hda_fixup *fix, int action)
2104 struct alc_spec *spec = codec->spec;
2105 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2106 spec->gen.no_primary_hp = 1;
2107 spec->gen.no_multi_io = 1;
2111 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2112 const struct hda_fixup *fix, int action);
2114 /* For dual-codec configuration, we need to disable some features to avoid
2115 * conflicts of kctls and PCM streams
2117 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2118 const struct hda_fixup *fix, int action)
2120 struct alc_spec *spec = codec->spec;
2122 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2124 /* disable vmaster */
2125 spec->gen.suppress_vmaster = 1;
2126 /* auto-mute and auto-mic switch don't work with multiple codecs */
2127 spec->gen.suppress_auto_mute = 1;
2128 spec->gen.suppress_auto_mic = 1;
2129 /* disable aamix as well */
2130 spec->gen.mixer_nid = 0;
2131 /* add location prefix to avoid conflicts */
2132 codec->force_pin_prefix = 1;
2135 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2136 const char *newname)
2138 struct snd_kcontrol *kctl;
2140 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2142 strcpy(kctl->id.name, newname);
2145 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2146 const struct hda_fixup *fix,
2149 alc_fixup_dual_codecs(codec, fix, action);
2151 case HDA_FIXUP_ACT_PRE_PROBE:
2152 /* override card longname to provide a unique UCM profile */
2153 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2155 case HDA_FIXUP_ACT_BUILD:
2156 /* rename Capture controls depending on the codec */
2157 rename_ctl(codec, "Capture Volume",
2159 "Rear-Panel Capture Volume" :
2160 "Front-Panel Capture Volume");
2161 rename_ctl(codec, "Capture Switch",
2163 "Rear-Panel Capture Switch" :
2164 "Front-Panel Capture Switch");
2169 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2170 const struct hda_fixup *fix,
2173 static const hda_nid_t conn1[] = { 0x0c };
2174 static const struct coef_fw gb_x570_coefs[] = {
2175 WRITE_COEF(0x07, 0x03c0),
2176 WRITE_COEF(0x1a, 0x01c1),
2177 WRITE_COEF(0x1b, 0x0202),
2178 WRITE_COEF(0x43, 0x3005),
2183 case HDA_FIXUP_ACT_PRE_PROBE:
2184 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2185 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2187 case HDA_FIXUP_ACT_INIT:
2188 alc_process_coef_fw(codec, gb_x570_coefs);
2193 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2194 const struct hda_fixup *fix,
2197 static const hda_nid_t conn1[] = { 0x0c };
2199 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2202 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2203 /* We therefore want to make sure 0x14 (front headphone) and
2204 * 0x1b (speakers) use the stereo DAC 0x02
2206 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2207 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2210 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2211 const struct hda_fixup *fix, int action);
2213 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2214 const struct hda_fixup *fix,
2217 alc1220_fixup_clevo_p950(codec, fix, action);
2218 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2221 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2222 struct hda_jack_callback *jack)
2224 struct alc_spec *spec = codec->spec;
2227 snd_hda_gen_hp_automute(codec, jack);
2229 if (spec->gen.hp_jack_present)
2230 vref = AC_PINCTL_VREF_80;
2232 vref = AC_PINCTL_VREF_HIZ;
2233 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2236 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2237 const struct hda_fixup *fix, int action)
2239 struct alc_spec *spec = codec->spec;
2240 if (action != HDA_FIXUP_ACT_PROBE)
2242 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2243 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2246 static const struct hda_fixup alc882_fixups[] = {
2247 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2248 .type = HDA_FIXUP_PINS,
2249 .v.pins = (const struct hda_pintbl[]) {
2250 { 0x15, 0x01080104 }, /* side */
2251 { 0x16, 0x01011012 }, /* rear */
2252 { 0x17, 0x01016011 }, /* clfe */
2256 [ALC882_FIXUP_LENOVO_Y530] = {
2257 .type = HDA_FIXUP_PINS,
2258 .v.pins = (const struct hda_pintbl[]) {
2259 { 0x15, 0x99130112 }, /* rear int speakers */
2260 { 0x16, 0x99130111 }, /* subwoofer */
2264 [ALC882_FIXUP_PB_M5210] = {
2265 .type = HDA_FIXUP_PINCTLS,
2266 .v.pins = (const struct hda_pintbl[]) {
2267 { 0x19, PIN_VREF50 },
2271 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2272 .type = HDA_FIXUP_FUNC,
2273 .v.func = alc_fixup_sku_ignore,
2275 [ALC882_FIXUP_ASUS_W90V] = {
2276 .type = HDA_FIXUP_PINS,
2277 .v.pins = (const struct hda_pintbl[]) {
2278 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2282 [ALC889_FIXUP_CD] = {
2283 .type = HDA_FIXUP_PINS,
2284 .v.pins = (const struct hda_pintbl[]) {
2285 { 0x1c, 0x993301f0 }, /* CD */
2289 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2290 .type = HDA_FIXUP_PINS,
2291 .v.pins = (const struct hda_pintbl[]) {
2292 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2296 .chain_id = ALC889_FIXUP_CD,
2298 [ALC889_FIXUP_VAIO_TT] = {
2299 .type = HDA_FIXUP_PINS,
2300 .v.pins = (const struct hda_pintbl[]) {
2301 { 0x17, 0x90170111 }, /* hidden surround speaker */
2305 [ALC888_FIXUP_EEE1601] = {
2306 .type = HDA_FIXUP_VERBS,
2307 .v.verbs = (const struct hda_verb[]) {
2308 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2309 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2313 [ALC886_FIXUP_EAPD] = {
2314 .type = HDA_FIXUP_VERBS,
2315 .v.verbs = (const struct hda_verb[]) {
2316 /* change to EAPD mode */
2317 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2318 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2322 [ALC882_FIXUP_EAPD] = {
2323 .type = HDA_FIXUP_VERBS,
2324 .v.verbs = (const struct hda_verb[]) {
2325 /* change to EAPD mode */
2326 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2327 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2331 [ALC883_FIXUP_EAPD] = {
2332 .type = HDA_FIXUP_VERBS,
2333 .v.verbs = (const struct hda_verb[]) {
2334 /* change to EAPD mode */
2335 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2336 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2340 [ALC883_FIXUP_ACER_EAPD] = {
2341 .type = HDA_FIXUP_VERBS,
2342 .v.verbs = (const struct hda_verb[]) {
2343 /* eanable EAPD on Acer laptops */
2344 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2345 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2349 [ALC882_FIXUP_GPIO1] = {
2350 .type = HDA_FIXUP_FUNC,
2351 .v.func = alc_fixup_gpio1,
2353 [ALC882_FIXUP_GPIO2] = {
2354 .type = HDA_FIXUP_FUNC,
2355 .v.func = alc_fixup_gpio2,
2357 [ALC882_FIXUP_GPIO3] = {
2358 .type = HDA_FIXUP_FUNC,
2359 .v.func = alc_fixup_gpio3,
2361 [ALC882_FIXUP_ASUS_W2JC] = {
2362 .type = HDA_FIXUP_FUNC,
2363 .v.func = alc_fixup_gpio1,
2365 .chain_id = ALC882_FIXUP_EAPD,
2367 [ALC889_FIXUP_COEF] = {
2368 .type = HDA_FIXUP_FUNC,
2369 .v.func = alc889_fixup_coef,
2371 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2372 .type = HDA_FIXUP_PINS,
2373 .v.pins = (const struct hda_pintbl[]) {
2374 { 0x16, 0x99130111 }, /* CLFE speaker */
2375 { 0x17, 0x99130112 }, /* surround speaker */
2379 .chain_id = ALC882_FIXUP_GPIO1,
2381 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2382 .type = HDA_FIXUP_PINS,
2383 .v.pins = (const struct hda_pintbl[]) {
2384 { 0x16, 0x99130111 }, /* CLFE speaker */
2385 { 0x1b, 0x99130112 }, /* surround speaker */
2389 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2391 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2392 /* additional init verbs for Acer Aspire 8930G */
2393 .type = HDA_FIXUP_VERBS,
2394 .v.verbs = (const struct hda_verb[]) {
2395 /* Enable all DACs */
2396 /* DAC DISABLE/MUTE 1? */
2397 /* setting bits 1-5 disables DAC nids 0x02-0x06
2398 * apparently. Init=0x38 */
2399 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2400 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2401 /* DAC DISABLE/MUTE 2? */
2402 /* some bit here disables the other DACs.
2404 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2405 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2407 * This laptop has a stereo digital microphone.
2408 * The mics are only 1cm apart which makes the stereo
2409 * useless. However, either the mic or the ALC889
2410 * makes the signal become a difference/sum signal
2411 * instead of standard stereo, which is annoying.
2412 * So instead we flip this bit which makes the
2413 * codec replicate the sum signal to both channels,
2414 * turning it into a normal mono mic.
2416 /* DMIC_CONTROL? Init value = 0x0001 */
2417 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2418 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2419 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2420 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2424 .chain_id = ALC882_FIXUP_GPIO1,
2426 [ALC885_FIXUP_MACPRO_GPIO] = {
2427 .type = HDA_FIXUP_FUNC,
2428 .v.func = alc885_fixup_macpro_gpio,
2430 [ALC889_FIXUP_DAC_ROUTE] = {
2431 .type = HDA_FIXUP_FUNC,
2432 .v.func = alc889_fixup_dac_route,
2434 [ALC889_FIXUP_MBP_VREF] = {
2435 .type = HDA_FIXUP_FUNC,
2436 .v.func = alc889_fixup_mbp_vref,
2438 .chain_id = ALC882_FIXUP_GPIO1,
2440 [ALC889_FIXUP_IMAC91_VREF] = {
2441 .type = HDA_FIXUP_FUNC,
2442 .v.func = alc889_fixup_imac91_vref,
2444 .chain_id = ALC882_FIXUP_GPIO1,
2446 [ALC889_FIXUP_MBA11_VREF] = {
2447 .type = HDA_FIXUP_FUNC,
2448 .v.func = alc889_fixup_mba11_vref,
2450 .chain_id = ALC889_FIXUP_MBP_VREF,
2452 [ALC889_FIXUP_MBA21_VREF] = {
2453 .type = HDA_FIXUP_FUNC,
2454 .v.func = alc889_fixup_mba21_vref,
2456 .chain_id = ALC889_FIXUP_MBP_VREF,
2458 [ALC889_FIXUP_MP11_VREF] = {
2459 .type = HDA_FIXUP_FUNC,
2460 .v.func = alc889_fixup_mba11_vref,
2462 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2464 [ALC889_FIXUP_MP41_VREF] = {
2465 .type = HDA_FIXUP_FUNC,
2466 .v.func = alc889_fixup_mbp_vref,
2468 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2470 [ALC882_FIXUP_INV_DMIC] = {
2471 .type = HDA_FIXUP_FUNC,
2472 .v.func = alc_fixup_inv_dmic,
2474 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2475 .type = HDA_FIXUP_FUNC,
2476 .v.func = alc882_fixup_no_primary_hp,
2478 [ALC887_FIXUP_ASUS_BASS] = {
2479 .type = HDA_FIXUP_PINS,
2480 .v.pins = (const struct hda_pintbl[]) {
2481 {0x16, 0x99130130}, /* bass speaker */
2485 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2487 [ALC887_FIXUP_BASS_CHMAP] = {
2488 .type = HDA_FIXUP_FUNC,
2489 .v.func = alc_fixup_bass_chmap,
2491 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2492 .type = HDA_FIXUP_FUNC,
2493 .v.func = alc1220_fixup_gb_dual_codecs,
2495 [ALC1220_FIXUP_GB_X570] = {
2496 .type = HDA_FIXUP_FUNC,
2497 .v.func = alc1220_fixup_gb_x570,
2499 [ALC1220_FIXUP_CLEVO_P950] = {
2500 .type = HDA_FIXUP_FUNC,
2501 .v.func = alc1220_fixup_clevo_p950,
2503 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2504 .type = HDA_FIXUP_FUNC,
2505 .v.func = alc1220_fixup_clevo_pb51ed,
2507 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2508 .type = HDA_FIXUP_PINS,
2509 .v.pins = (const struct hda_pintbl[]) {
2510 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2514 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2516 [ALC887_FIXUP_ASUS_AUDIO] = {
2517 .type = HDA_FIXUP_PINS,
2518 .v.pins = (const struct hda_pintbl[]) {
2519 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2520 { 0x19, 0x22219420 },
2524 [ALC887_FIXUP_ASUS_HMIC] = {
2525 .type = HDA_FIXUP_FUNC,
2526 .v.func = alc887_fixup_asus_jack,
2528 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2530 [ALCS1200A_FIXUP_MIC_VREF] = {
2531 .type = HDA_FIXUP_PINCTLS,
2532 .v.pins = (const struct hda_pintbl[]) {
2533 { 0x18, PIN_VREF50 }, /* rear mic */
2534 { 0x19, PIN_VREF50 }, /* front mic */
2540 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2541 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2542 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2543 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2544 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2545 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2546 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2547 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2548 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2549 ALC882_FIXUP_ACER_ASPIRE_4930G),
2550 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2551 ALC882_FIXUP_ACER_ASPIRE_4930G),
2552 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2553 ALC882_FIXUP_ACER_ASPIRE_8930G),
2554 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2555 ALC882_FIXUP_ACER_ASPIRE_8930G),
2556 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2557 ALC882_FIXUP_ACER_ASPIRE_4930G),
2558 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2559 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2560 ALC882_FIXUP_ACER_ASPIRE_4930G),
2561 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2562 ALC882_FIXUP_ACER_ASPIRE_4930G),
2563 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2564 ALC882_FIXUP_ACER_ASPIRE_4930G),
2565 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2566 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2567 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2568 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2569 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2570 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2571 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2572 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2573 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2574 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2575 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2576 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2577 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2578 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2579 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2580 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2582 /* All Apple entries are in codec SSIDs */
2583 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2584 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2585 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2586 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2587 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2588 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2589 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2590 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2591 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2592 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2593 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2594 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2595 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2596 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2597 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2598 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2599 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2600 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2601 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2602 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2603 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2604 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2606 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2607 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2608 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2609 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2610 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2611 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2612 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2613 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2614 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2615 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2616 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2617 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2618 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2619 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2620 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2621 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2622 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2623 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2624 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2625 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2626 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2627 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2628 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2629 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2630 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2631 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2632 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2633 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2634 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2635 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2636 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2637 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2638 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2639 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2640 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2641 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2642 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2643 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2644 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2645 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2646 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2647 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2648 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2649 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2650 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2651 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2652 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2653 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2657 static const struct hda_model_fixup alc882_fixup_models[] = {
2658 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2659 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2660 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2661 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2662 {.id = ALC889_FIXUP_CD, .name = "cd"},
2663 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2664 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2665 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2666 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2667 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2668 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2669 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2670 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2671 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2672 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2673 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2674 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2675 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2676 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2677 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2678 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2679 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2680 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2681 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2682 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2683 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2684 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2685 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2686 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2687 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2688 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2689 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2693 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2694 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2702 {0x1e, 0x01456130}),
2703 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2711 {0x1e, 0x01451130}),
2716 * BIOS auto configuration
2718 /* almost identical with ALC880 parser... */
2719 static int alc882_parse_auto_config(struct hda_codec *codec)
2721 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2722 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2723 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2728 static int patch_alc882(struct hda_codec *codec)
2730 struct alc_spec *spec;
2733 err = alc_alloc_spec(codec, 0x0b);
2739 switch (codec->core.vendor_id) {
2747 /* ALC883 and variants */
2748 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2752 alc_pre_init(codec);
2754 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2756 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2757 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2759 alc_auto_parse_customize_define(codec);
2761 if (has_cdefine_beep(codec))
2762 spec->gen.beep_nid = 0x01;
2764 /* automatic parse from the BIOS config */
2765 err = alc882_parse_auto_config(codec);
2769 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2770 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2775 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2788 static int alc262_parse_auto_config(struct hda_codec *codec)
2790 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2791 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2792 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2799 ALC262_FIXUP_FSC_H270,
2800 ALC262_FIXUP_FSC_S7110,
2801 ALC262_FIXUP_HP_Z200,
2803 ALC262_FIXUP_LENOVO_3000,
2805 ALC262_FIXUP_BENQ_T31,
2806 ALC262_FIXUP_INV_DMIC,
2807 ALC262_FIXUP_INTEL_BAYLEYBAY,
2810 static const struct hda_fixup alc262_fixups[] = {
2811 [ALC262_FIXUP_FSC_H270] = {
2812 .type = HDA_FIXUP_PINS,
2813 .v.pins = (const struct hda_pintbl[]) {
2814 { 0x14, 0x99130110 }, /* speaker */
2815 { 0x15, 0x0221142f }, /* front HP */
2816 { 0x1b, 0x0121141f }, /* rear HP */
2820 [ALC262_FIXUP_FSC_S7110] = {
2821 .type = HDA_FIXUP_PINS,
2822 .v.pins = (const struct hda_pintbl[]) {
2823 { 0x15, 0x90170110 }, /* speaker */
2827 .chain_id = ALC262_FIXUP_BENQ,
2829 [ALC262_FIXUP_HP_Z200] = {
2830 .type = HDA_FIXUP_PINS,
2831 .v.pins = (const struct hda_pintbl[]) {
2832 { 0x16, 0x99130120 }, /* internal speaker */
2836 [ALC262_FIXUP_TYAN] = {
2837 .type = HDA_FIXUP_PINS,
2838 .v.pins = (const struct hda_pintbl[]) {
2839 { 0x14, 0x1993e1f0 }, /* int AUX */
2843 [ALC262_FIXUP_LENOVO_3000] = {
2844 .type = HDA_FIXUP_PINCTLS,
2845 .v.pins = (const struct hda_pintbl[]) {
2846 { 0x19, PIN_VREF50 },
2850 .chain_id = ALC262_FIXUP_BENQ,
2852 [ALC262_FIXUP_BENQ] = {
2853 .type = HDA_FIXUP_VERBS,
2854 .v.verbs = (const struct hda_verb[]) {
2855 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2856 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2860 [ALC262_FIXUP_BENQ_T31] = {
2861 .type = HDA_FIXUP_VERBS,
2862 .v.verbs = (const struct hda_verb[]) {
2863 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2864 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2868 [ALC262_FIXUP_INV_DMIC] = {
2869 .type = HDA_FIXUP_FUNC,
2870 .v.func = alc_fixup_inv_dmic,
2872 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2873 .type = HDA_FIXUP_FUNC,
2874 .v.func = alc_fixup_no_depop_delay,
2878 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2879 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2880 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2881 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2882 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2883 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2884 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2885 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2886 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2887 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2888 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2892 static const struct hda_model_fixup alc262_fixup_models[] = {
2893 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2894 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2895 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2896 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2897 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2898 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2899 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2900 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2901 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2907 static int patch_alc262(struct hda_codec *codec)
2909 struct alc_spec *spec;
2912 err = alc_alloc_spec(codec, 0x0b);
2917 spec->gen.shared_mic_vref_pin = 0x18;
2919 spec->shutup = alc_eapd_shutup;
2922 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2925 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2927 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2929 alc_pre_init(codec);
2931 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2933 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2935 alc_auto_parse_customize_define(codec);
2937 if (has_cdefine_beep(codec))
2938 spec->gen.beep_nid = 0x01;
2940 /* automatic parse from the BIOS config */
2941 err = alc262_parse_auto_config(codec);
2945 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2946 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2951 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2963 /* bind Beep switches of both NID 0x0f and 0x10 */
2964 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2965 struct snd_ctl_elem_value *ucontrol)
2967 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2971 mutex_lock(&codec->control_mutex);
2972 pval = kcontrol->private_value;
2973 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2974 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2976 kcontrol->private_value = (pval & ~0xff) | 0x10;
2977 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2979 kcontrol->private_value = pval;
2980 mutex_unlock(&codec->control_mutex);
2984 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2985 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2987 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2988 .name = "Beep Playback Switch",
2989 .subdevice = HDA_SUBDEV_AMP_FLAG,
2990 .info = snd_hda_mixer_amp_switch_info,
2991 .get = snd_hda_mixer_amp_switch_get,
2992 .put = alc268_beep_switch_put,
2993 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2997 /* set PCBEEP vol = 0, mute connections */
2998 static const struct hda_verb alc268_beep_init_verbs[] = {
2999 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3000 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3001 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3006 ALC268_FIXUP_INV_DMIC,
3007 ALC268_FIXUP_HP_EAPD,
3011 static const struct hda_fixup alc268_fixups[] = {
3012 [ALC268_FIXUP_INV_DMIC] = {
3013 .type = HDA_FIXUP_FUNC,
3014 .v.func = alc_fixup_inv_dmic,
3016 [ALC268_FIXUP_HP_EAPD] = {
3017 .type = HDA_FIXUP_VERBS,
3018 .v.verbs = (const struct hda_verb[]) {
3019 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3023 [ALC268_FIXUP_SPDIF] = {
3024 .type = HDA_FIXUP_PINS,
3025 .v.pins = (const struct hda_pintbl[]) {
3026 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3032 static const struct hda_model_fixup alc268_fixup_models[] = {
3033 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3034 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3035 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3039 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3040 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3041 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3042 /* below is codec SSID since multiple Toshiba laptops have the
3043 * same PCI SSID 1179:ff00
3045 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3050 * BIOS auto configuration
3052 static int alc268_parse_auto_config(struct hda_codec *codec)
3054 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3055 return alc_parse_auto_config(codec, NULL, alc268_ssids);
3060 static int patch_alc268(struct hda_codec *codec)
3062 struct alc_spec *spec;
3065 /* ALC268 has no aa-loopback mixer */
3066 err = alc_alloc_spec(codec, 0);
3071 if (has_cdefine_beep(codec))
3072 spec->gen.beep_nid = 0x01;
3074 spec->shutup = alc_eapd_shutup;
3076 alc_pre_init(codec);
3078 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3079 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3081 /* automatic parse from the BIOS config */
3082 err = alc268_parse_auto_config(codec);
3086 if (err > 0 && !spec->gen.no_analog &&
3087 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3088 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3089 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3090 &alc268_beep_mixer[i])) {
3095 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3096 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3097 /* override the amp caps for beep generator */
3098 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3099 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3100 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3101 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3102 (0 << AC_AMPCAP_MUTE_SHIFT));
3105 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3118 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3119 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3122 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3123 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3126 /* different alc269-variants */
3128 ALC269_TYPE_ALC269VA,
3129 ALC269_TYPE_ALC269VB,
3130 ALC269_TYPE_ALC269VC,
3131 ALC269_TYPE_ALC269VD,
3153 * BIOS auto configuration
3155 static int alc269_parse_auto_config(struct hda_codec *codec)
3157 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3158 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3159 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3160 struct alc_spec *spec = codec->spec;
3161 const hda_nid_t *ssids;
3163 switch (spec->codec_variant) {
3164 case ALC269_TYPE_ALC269VA:
3165 case ALC269_TYPE_ALC269VC:
3166 case ALC269_TYPE_ALC280:
3167 case ALC269_TYPE_ALC284:
3168 case ALC269_TYPE_ALC293:
3169 ssids = alc269va_ssids;
3171 case ALC269_TYPE_ALC269VB:
3172 case ALC269_TYPE_ALC269VD:
3173 case ALC269_TYPE_ALC282:
3174 case ALC269_TYPE_ALC283:
3175 case ALC269_TYPE_ALC286:
3176 case ALC269_TYPE_ALC298:
3177 case ALC269_TYPE_ALC255:
3178 case ALC269_TYPE_ALC256:
3179 case ALC269_TYPE_ALC257:
3180 case ALC269_TYPE_ALC215:
3181 case ALC269_TYPE_ALC225:
3182 case ALC269_TYPE_ALC245:
3183 case ALC269_TYPE_ALC287:
3184 case ALC269_TYPE_ALC294:
3185 case ALC269_TYPE_ALC300:
3186 case ALC269_TYPE_ALC623:
3187 case ALC269_TYPE_ALC700:
3188 ssids = alc269_ssids;
3191 ssids = alc269_ssids;
3195 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3198 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3199 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3200 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3201 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3202 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3206 static void alc_headset_btn_callback(struct hda_codec *codec,
3207 struct hda_jack_callback *jack)
3211 if (jack->unsol_res & (7 << 13))
3212 report |= SND_JACK_BTN_0;
3214 if (jack->unsol_res & (1 << 16 | 3 << 8))
3215 report |= SND_JACK_BTN_1;
3218 if (jack->unsol_res & (7 << 23))
3219 report |= SND_JACK_BTN_2;
3221 /* Volume down key */
3222 if (jack->unsol_res & (7 << 10))
3223 report |= SND_JACK_BTN_3;
3225 snd_hda_jack_set_button_state(codec, jack->nid, report);
3228 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3230 struct alc_spec *spec = codec->spec;
3232 if (!spec->has_hs_key)
3235 switch (codec->core.vendor_id) {
3243 alc_write_coef_idx(codec, 0x48, 0x0);
3244 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3245 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3250 alc_write_coef_idx(codec, 0x48, 0x0);
3251 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3256 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3258 struct alc_spec *spec = codec->spec;
3260 if (!spec->has_hs_key)
3263 switch (codec->core.vendor_id) {
3271 alc_write_coef_idx(codec, 0x48, 0xd011);
3272 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3273 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3278 alc_write_coef_idx(codec, 0x48, 0xd011);
3279 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3284 static void alc_fixup_headset_jack(struct hda_codec *codec,
3285 const struct hda_fixup *fix, int action)
3287 struct alc_spec *spec = codec->spec;
3291 case HDA_FIXUP_ACT_PRE_PROBE:
3292 spec->has_hs_key = 1;
3293 snd_hda_jack_detect_enable_callback(codec, 0x55,
3294 alc_headset_btn_callback);
3296 case HDA_FIXUP_ACT_BUILD:
3297 hp_pin = alc_get_hp_pin(spec);
3298 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3299 alc_headset_btn_keymap,
3301 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3302 false, SND_JACK_HEADSET,
3303 alc_headset_btn_keymap);
3305 alc_enable_headset_jack_key(codec);
3310 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3312 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3315 static void alc269_shutup(struct hda_codec *codec)
3317 struct alc_spec *spec = codec->spec;
3319 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3320 alc269vb_toggle_power_output(codec, 0);
3321 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3322 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3325 alc_shutup_pins(codec);
3328 static const struct coef_fw alc282_coefs[] = {
3329 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3330 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3331 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3332 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3333 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3334 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3335 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3336 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3337 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3338 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3339 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3340 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3341 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3342 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3343 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3344 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3345 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3346 WRITE_COEF(0x63, 0x2902), /* PLL */
3347 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3348 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3349 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3350 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3351 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3352 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3353 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3354 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3355 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3356 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3357 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3361 static void alc282_restore_default_value(struct hda_codec *codec)
3363 alc_process_coef_fw(codec, alc282_coefs);
3366 static void alc282_init(struct hda_codec *codec)
3368 struct alc_spec *spec = codec->spec;
3369 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3373 alc282_restore_default_value(codec);
3377 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3378 coef78 = alc_read_coef_idx(codec, 0x78);
3380 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3381 /* Headphone capless set to high power mode */
3382 alc_write_coef_idx(codec, 0x78, 0x9004);
3387 snd_hda_codec_write(codec, hp_pin, 0,
3388 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3393 snd_hda_codec_write(codec, hp_pin, 0,
3394 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3399 /* Headphone capless set to normal mode */
3400 alc_write_coef_idx(codec, 0x78, coef78);
3403 static void alc282_shutup(struct hda_codec *codec)
3405 struct alc_spec *spec = codec->spec;
3406 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3411 alc269_shutup(codec);
3415 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3416 coef78 = alc_read_coef_idx(codec, 0x78);
3417 alc_write_coef_idx(codec, 0x78, 0x9004);
3422 snd_hda_codec_write(codec, hp_pin, 0,
3423 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3428 if (!spec->no_shutup_pins)
3429 snd_hda_codec_write(codec, hp_pin, 0,
3430 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3435 alc_auto_setup_eapd(codec, false);
3436 alc_shutup_pins(codec);
3437 alc_write_coef_idx(codec, 0x78, coef78);
3440 static const struct coef_fw alc283_coefs[] = {
3441 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3442 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3443 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3444 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3445 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3446 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3447 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3448 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3449 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3450 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3451 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3452 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3453 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3454 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3455 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3456 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3457 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3458 WRITE_COEF(0x2e, 0x2902), /* PLL */
3459 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3460 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3461 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3462 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3463 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3464 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3465 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3466 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3467 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3468 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3469 WRITE_COEF(0x49, 0x0), /* test mode */
3470 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3471 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3472 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3473 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3477 static void alc283_restore_default_value(struct hda_codec *codec)
3479 alc_process_coef_fw(codec, alc283_coefs);
3482 static void alc283_init(struct hda_codec *codec)
3484 struct alc_spec *spec = codec->spec;
3485 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3488 alc283_restore_default_value(codec);
3494 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3496 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3497 /* Headphone capless set to high power mode */
3498 alc_write_coef_idx(codec, 0x43, 0x9004);
3500 snd_hda_codec_write(codec, hp_pin, 0,
3501 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3506 snd_hda_codec_write(codec, hp_pin, 0,
3507 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3511 /* Index 0x46 Combo jack auto switch control 2 */
3512 /* 3k pull low control for Headset jack. */
3513 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3514 /* Headphone capless set to normal mode */
3515 alc_write_coef_idx(codec, 0x43, 0x9614);
3518 static void alc283_shutup(struct hda_codec *codec)
3520 struct alc_spec *spec = codec->spec;
3521 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3525 alc269_shutup(codec);
3529 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3531 alc_write_coef_idx(codec, 0x43, 0x9004);
3533 /*depop hp during suspend*/
3534 alc_write_coef_idx(codec, 0x06, 0x2100);
3536 snd_hda_codec_write(codec, hp_pin, 0,
3537 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3542 if (!spec->no_shutup_pins)
3543 snd_hda_codec_write(codec, hp_pin, 0,
3544 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3546 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3550 alc_auto_setup_eapd(codec, false);
3551 alc_shutup_pins(codec);
3552 alc_write_coef_idx(codec, 0x43, 0x9614);
3555 static void alc256_init(struct hda_codec *codec)
3557 struct alc_spec *spec = codec->spec;
3558 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3566 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3571 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3572 if (spec->ultra_low_power) {
3573 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3574 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3575 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3576 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3577 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3581 snd_hda_codec_write(codec, hp_pin, 0,
3582 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3584 if (hp_pin_sense || spec->ultra_low_power)
3587 snd_hda_codec_write(codec, hp_pin, 0,
3588 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3590 if (hp_pin_sense || spec->ultra_low_power)
3593 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3594 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3595 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3596 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3598 * Expose headphone mic (or possibly Line In on some machines) instead
3599 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3600 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3603 alc_write_coef_idx(codec, 0x36, 0x5757);
3606 static void alc256_shutup(struct hda_codec *codec)
3608 struct alc_spec *spec = codec->spec;
3609 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3615 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3620 snd_hda_codec_write(codec, hp_pin, 0,
3621 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3623 if (hp_pin_sense || spec->ultra_low_power)
3626 /* 3k pull low control for Headset jack. */
3627 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3628 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3629 * when booting with headset plugged. So skip setting it for the codec alc257
3631 if (codec->core.vendor_id != 0x10ec0236 &&
3632 codec->core.vendor_id != 0x10ec0257)
3633 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3635 if (!spec->no_shutup_pins)
3636 snd_hda_codec_write(codec, hp_pin, 0,
3637 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3639 if (hp_pin_sense || spec->ultra_low_power)
3642 alc_auto_setup_eapd(codec, false);
3643 alc_shutup_pins(codec);
3644 if (spec->ultra_low_power) {
3646 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3647 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3648 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3649 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3650 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3655 static void alc285_hp_init(struct hda_codec *codec)
3657 struct alc_spec *spec = codec->spec;
3658 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3660 int coef38, coef0d, coef36;
3662 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3663 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3664 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3665 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3666 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3667 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3669 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3672 snd_hda_codec_write(codec, hp_pin, 0,
3673 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3676 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3677 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3680 snd_hda_codec_write(codec, hp_pin, 0,
3681 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3683 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3684 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3685 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3686 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3688 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3689 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3690 for (i = 0; i < 20 && val & 0x8000; i++) {
3692 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3693 } /* Wait for depop procedure finish */
3695 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3696 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3697 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3698 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3701 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3704 static void alc225_init(struct hda_codec *codec)
3706 struct alc_spec *spec = codec->spec;
3707 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3708 bool hp1_pin_sense, hp2_pin_sense;
3710 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3711 spec->codec_variant != ALC269_TYPE_ALC245)
3712 /* required only at boot or S3 and S4 resume time */
3713 if (!spec->done_hp_init ||
3714 is_s3_resume(codec) ||
3715 is_s4_resume(codec)) {
3716 alc285_hp_init(codec);
3717 spec->done_hp_init = true;
3724 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3725 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3727 if (hp1_pin_sense || hp2_pin_sense)
3730 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3731 if (spec->ultra_low_power) {
3732 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3733 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3734 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3738 if (hp1_pin_sense || spec->ultra_low_power)
3739 snd_hda_codec_write(codec, hp_pin, 0,
3740 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3742 snd_hda_codec_write(codec, 0x16, 0,
3743 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3745 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3748 if (hp1_pin_sense || spec->ultra_low_power)
3749 snd_hda_codec_write(codec, hp_pin, 0,
3750 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3752 snd_hda_codec_write(codec, 0x16, 0,
3753 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3755 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3758 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3759 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3762 static void alc225_shutup(struct hda_codec *codec)
3764 struct alc_spec *spec = codec->spec;
3765 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3766 bool hp1_pin_sense, hp2_pin_sense;
3771 alc_disable_headset_jack_key(codec);
3772 /* 3k pull low control for Headset jack. */
3773 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3775 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3776 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3778 if (hp1_pin_sense || hp2_pin_sense)
3781 if (hp1_pin_sense || spec->ultra_low_power)
3782 snd_hda_codec_write(codec, hp_pin, 0,
3783 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3785 snd_hda_codec_write(codec, 0x16, 0,
3786 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3788 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3791 if (hp1_pin_sense || spec->ultra_low_power)
3792 snd_hda_codec_write(codec, hp_pin, 0,
3793 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3795 snd_hda_codec_write(codec, 0x16, 0,
3796 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3798 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3801 alc_auto_setup_eapd(codec, false);
3802 alc_shutup_pins(codec);
3803 if (spec->ultra_low_power) {
3805 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3806 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3807 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3808 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3812 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3813 alc_enable_headset_jack_key(codec);
3816 static void alc_default_init(struct hda_codec *codec)
3818 struct alc_spec *spec = codec->spec;
3819 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3827 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3832 snd_hda_codec_write(codec, hp_pin, 0,
3833 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3838 snd_hda_codec_write(codec, hp_pin, 0,
3839 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3845 static void alc_default_shutup(struct hda_codec *codec)
3847 struct alc_spec *spec = codec->spec;
3848 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3852 alc269_shutup(codec);
3856 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3861 snd_hda_codec_write(codec, hp_pin, 0,
3862 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3867 if (!spec->no_shutup_pins)
3868 snd_hda_codec_write(codec, hp_pin, 0,
3869 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3874 alc_auto_setup_eapd(codec, false);
3875 alc_shutup_pins(codec);
3878 static void alc294_hp_init(struct hda_codec *codec)
3880 struct alc_spec *spec = codec->spec;
3881 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3887 snd_hda_codec_write(codec, hp_pin, 0,
3888 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3892 if (!spec->no_shutup_pins)
3893 snd_hda_codec_write(codec, hp_pin, 0,
3894 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3896 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3897 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3899 /* Wait for depop procedure finish */
3900 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3901 for (i = 0; i < 20 && val & 0x0080; i++) {
3903 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3905 /* Set HP depop to auto mode */
3906 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3910 static void alc294_init(struct hda_codec *codec)
3912 struct alc_spec *spec = codec->spec;
3914 /* required only at boot or S4 resume time */
3915 if (!spec->done_hp_init ||
3916 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3917 alc294_hp_init(codec);
3918 spec->done_hp_init = true;
3920 alc_default_init(codec);
3923 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3926 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3927 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3928 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3931 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3935 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3936 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3938 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3943 static void alc5505_dsp_halt(struct hda_codec *codec)
3947 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3948 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3949 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3950 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3951 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3952 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3953 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3954 val = alc5505_coef_get(codec, 0x6220);
3955 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3958 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3960 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3961 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3962 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3963 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3964 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3965 alc5505_coef_set(codec, 0x880c, 0x00000004);
3968 static void alc5505_dsp_init(struct hda_codec *codec)
3972 alc5505_dsp_halt(codec);
3973 alc5505_dsp_back_from_halt(codec);
3974 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3975 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3976 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3977 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3978 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3979 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3980 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3981 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3982 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3983 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3984 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3985 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3986 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3988 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3990 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3992 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3994 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3995 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3996 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3997 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3998 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3999 alc5505_coef_set(codec, 0x880c, 0x00000003);
4000 alc5505_coef_set(codec, 0x880c, 0x00000010);
4002 #ifdef HALT_REALTEK_ALC5505
4003 alc5505_dsp_halt(codec);
4007 #ifdef HALT_REALTEK_ALC5505
4008 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4009 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
4011 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4012 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4016 static int alc269_suspend(struct hda_codec *codec)
4018 struct alc_spec *spec = codec->spec;
4020 if (spec->has_alc5505_dsp)
4021 alc5505_dsp_suspend(codec);
4022 return alc_suspend(codec);
4025 static int alc269_resume(struct hda_codec *codec)
4027 struct alc_spec *spec = codec->spec;
4029 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4030 alc269vb_toggle_power_output(codec, 0);
4031 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4032 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
4036 codec->patch_ops.init(codec);
4038 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4039 alc269vb_toggle_power_output(codec, 1);
4040 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4041 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
4045 snd_hda_regmap_sync(codec);
4046 hda_call_check_power_status(codec, 0x01);
4048 /* on some machine, the BIOS will clear the codec gpio data when enter
4049 * suspend, and won't restore the data after resume, so we restore it
4052 if (spec->gpio_data)
4053 alc_write_gpio_data(codec);
4055 if (spec->has_alc5505_dsp)
4056 alc5505_dsp_resume(codec);
4060 #endif /* CONFIG_PM */
4062 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4063 const struct hda_fixup *fix, int action)
4065 struct alc_spec *spec = codec->spec;
4067 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4068 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4071 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4072 const struct hda_fixup *fix,
4075 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4076 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4078 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4079 snd_hda_codec_set_pincfg(codec, 0x19,
4080 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4081 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4084 static void alc269_fixup_hweq(struct hda_codec *codec,
4085 const struct hda_fixup *fix, int action)
4087 if (action == HDA_FIXUP_ACT_INIT)
4088 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4091 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4092 const struct hda_fixup *fix, int action)
4094 struct alc_spec *spec = codec->spec;
4096 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4097 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4100 static void alc271_fixup_dmic(struct hda_codec *codec,
4101 const struct hda_fixup *fix, int action)
4103 static const struct hda_verb verbs[] = {
4104 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4105 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4110 if (strcmp(codec->core.chip_name, "ALC271X") &&
4111 strcmp(codec->core.chip_name, "ALC269VB"))
4113 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4114 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4115 snd_hda_sequence_write(codec, verbs);
4118 /* Fix the speaker amp after resume, etc */
4119 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4120 const struct hda_fixup *fix,
4123 if (action == HDA_FIXUP_ACT_INIT)
4124 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4127 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4128 const struct hda_fixup *fix, int action)
4130 struct alc_spec *spec = codec->spec;
4132 if (action != HDA_FIXUP_ACT_PROBE)
4135 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4136 * fix the sample rate of analog I/O to 44.1kHz
4138 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4139 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4142 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4143 const struct hda_fixup *fix, int action)
4145 /* The digital-mic unit sends PDM (differential signal) instead of
4146 * the standard PCM, thus you can't record a valid mono stream as is.
4147 * Below is a workaround specific to ALC269 to control the dmic
4148 * signal source as mono.
4150 if (action == HDA_FIXUP_ACT_INIT)
4151 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4154 static void alc269_quanta_automute(struct hda_codec *codec)
4156 snd_hda_gen_update_outputs(codec);
4158 alc_write_coef_idx(codec, 0x0c, 0x680);
4159 alc_write_coef_idx(codec, 0x0c, 0x480);
4162 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4163 const struct hda_fixup *fix, int action)
4165 struct alc_spec *spec = codec->spec;
4166 if (action != HDA_FIXUP_ACT_PROBE)
4168 spec->gen.automute_hook = alc269_quanta_automute;
4171 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4172 struct hda_jack_callback *jack)
4174 struct alc_spec *spec = codec->spec;
4177 snd_hda_gen_hp_automute(codec, jack);
4179 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4181 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4184 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4189 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4191 struct hda_alc298_mbxinit {
4192 unsigned char value_0x23;
4193 unsigned char value_0x25;
4196 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4197 const struct hda_alc298_mbxinit *initval,
4200 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4201 alc_write_coef_idx(codec, 0x26, 0xb000);
4204 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4206 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4207 alc_write_coef_idx(codec, 0x26, 0xf000);
4208 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4210 if (initval->value_0x23 != 0x1e)
4211 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4213 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4214 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4217 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4218 const struct hda_fixup *fix,
4221 /* Initialization magic */
4222 static const struct hda_alc298_mbxinit dac_init[] = {
4223 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4224 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4225 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4226 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4227 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4228 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4230 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4231 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4232 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4235 const struct hda_alc298_mbxinit *seq;
4237 if (action != HDA_FIXUP_ACT_INIT)
4241 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4242 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4243 alc_write_coef_idx(codec, 0x26, 0xf000);
4244 alc_write_coef_idx(codec, 0x22, 0x31);
4245 alc_write_coef_idx(codec, 0x23, 0x0b);
4246 alc_write_coef_idx(codec, 0x25, 0x00);
4247 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4248 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4250 for (seq = dac_init; seq->value_0x23; seq++)
4251 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4254 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4255 const struct hda_fixup *fix, int action)
4257 struct alc_spec *spec = codec->spec;
4258 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4259 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4260 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4264 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4265 bool polarity, bool on)
4267 unsigned int pinval;
4273 pinval = snd_hda_codec_get_pin_target(codec, pin);
4274 pinval &= ~AC_PINCTL_VREFEN;
4275 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4276 /* temporarily power up/down for setting VREF */
4277 snd_hda_power_up_pm(codec);
4278 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4279 snd_hda_power_down_pm(codec);
4282 /* update mute-LED according to the speaker mute state via mic VREF pin */
4283 static int vref_mute_led_set(struct led_classdev *led_cdev,
4284 enum led_brightness brightness)
4286 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4287 struct alc_spec *spec = codec->spec;
4289 alc_update_vref_led(codec, spec->mute_led_nid,
4290 spec->mute_led_polarity, brightness);
4294 /* Make sure the led works even in runtime suspend */
4295 static unsigned int led_power_filter(struct hda_codec *codec,
4297 unsigned int power_state)
4299 struct alc_spec *spec = codec->spec;
4301 if (power_state != AC_PWRST_D3 || nid == 0 ||
4302 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4305 /* Set pin ctl again, it might have just been set to 0 */
4306 snd_hda_set_pin_ctl(codec, nid,
4307 snd_hda_codec_get_pin_target(codec, nid));
4309 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4312 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4313 const struct hda_fixup *fix, int action)
4315 struct alc_spec *spec = codec->spec;
4316 const struct dmi_device *dev = NULL;
4318 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4321 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4323 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4325 if (pin < 0x0a || pin >= 0x10)
4327 spec->mute_led_polarity = pol;
4328 spec->mute_led_nid = pin - 0x0a + 0x18;
4329 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4330 codec->power_filter = led_power_filter;
4332 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4333 spec->mute_led_polarity);
4338 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4339 const struct hda_fixup *fix,
4340 int action, hda_nid_t pin)
4342 struct alc_spec *spec = codec->spec;
4344 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4345 spec->mute_led_polarity = 0;
4346 spec->mute_led_nid = pin;
4347 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4348 codec->power_filter = led_power_filter;
4352 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4353 const struct hda_fixup *fix, int action)
4355 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4358 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4359 const struct hda_fixup *fix, int action)
4361 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4364 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4365 const struct hda_fixup *fix, int action)
4367 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4370 /* update LED status via GPIO */
4371 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4372 int polarity, bool enabled)
4376 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4379 /* turn on/off mute LED via GPIO per vmaster hook */
4380 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4381 enum led_brightness brightness)
4383 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4384 struct alc_spec *spec = codec->spec;
4386 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4387 spec->mute_led_polarity, !brightness);
4391 /* turn on/off mic-mute LED via GPIO per capture hook */
4392 static int micmute_led_set(struct led_classdev *led_cdev,
4393 enum led_brightness brightness)
4395 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4396 struct alc_spec *spec = codec->spec;
4398 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4399 spec->micmute_led_polarity, !brightness);
4403 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4404 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4406 unsigned int mute_mask,
4407 unsigned int micmute_mask)
4409 struct alc_spec *spec = codec->spec;
4411 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4413 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4416 spec->gpio_mute_led_mask = mute_mask;
4417 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4420 spec->gpio_mic_led_mask = micmute_mask;
4421 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4425 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4426 const struct hda_fixup *fix, int action)
4428 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4431 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4432 const struct hda_fixup *fix, int action)
4434 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4437 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4438 const struct hda_fixup *fix, int action)
4440 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4443 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4444 const struct hda_fixup *fix, int action)
4446 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4449 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4450 const struct hda_fixup *fix, int action)
4452 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4455 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4456 const struct hda_fixup *fix, int action)
4458 struct alc_spec *spec = codec->spec;
4460 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4461 spec->micmute_led_polarity = 1;
4462 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4465 /* turn on/off mic-mute LED per capture hook via VREF change */
4466 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4467 enum led_brightness brightness)
4469 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4470 struct alc_spec *spec = codec->spec;
4472 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4473 spec->micmute_led_polarity, brightness);
4477 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4478 const struct hda_fixup *fix, int action)
4480 struct alc_spec *spec = codec->spec;
4482 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4483 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4484 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4485 * enable headphone amp
4487 spec->gpio_mask |= 0x10;
4488 spec->gpio_dir |= 0x10;
4489 spec->cap_mute_led_nid = 0x18;
4490 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4491 codec->power_filter = led_power_filter;
4495 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4496 const struct hda_fixup *fix, int action)
4498 struct alc_spec *spec = codec->spec;
4500 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4501 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4502 spec->cap_mute_led_nid = 0x18;
4503 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4504 codec->power_filter = led_power_filter;
4508 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4509 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4511 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4512 const struct hda_fixup *fix, int action)
4514 struct alc_spec *spec = codec->spec;
4517 case HDA_FIXUP_ACT_PRE_PROBE:
4518 spec->gpio_mask |= 0x01;
4519 spec->gpio_dir |= 0x01;
4521 case HDA_FIXUP_ACT_INIT:
4522 /* need to toggle GPIO to enable the amp */
4523 alc_update_gpio_data(codec, 0x01, true);
4525 alc_update_gpio_data(codec, 0x01, false);
4530 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4531 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4532 struct hda_codec *codec,
4533 struct snd_pcm_substream *substream,
4537 case HDA_GEN_PCM_ACT_PREPARE:
4538 alc_update_gpio_data(codec, 0x04, true);
4540 case HDA_GEN_PCM_ACT_CLEANUP:
4541 alc_update_gpio_data(codec, 0x04, false);
4546 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4547 const struct hda_fixup *fix,
4550 struct alc_spec *spec = codec->spec;
4552 if (action == HDA_FIXUP_ACT_PROBE) {
4553 spec->gpio_mask |= 0x04;
4554 spec->gpio_dir |= 0x04;
4555 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4559 static void alc_update_coef_led(struct hda_codec *codec,
4560 struct alc_coef_led *led,
4561 bool polarity, bool on)
4565 /* temporarily power up/down for setting COEF bit */
4566 alc_update_coef_idx(codec, led->idx, led->mask,
4567 on ? led->on : led->off);
4570 /* update mute-LED according to the speaker mute state via COEF bit */
4571 static int coef_mute_led_set(struct led_classdev *led_cdev,
4572 enum led_brightness brightness)
4574 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4575 struct alc_spec *spec = codec->spec;
4577 alc_update_coef_led(codec, &spec->mute_led_coef,
4578 spec->mute_led_polarity, brightness);
4582 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4583 const struct hda_fixup *fix,
4586 struct alc_spec *spec = codec->spec;
4588 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4589 spec->mute_led_polarity = 0;
4590 spec->mute_led_coef.idx = 0x0b;
4591 spec->mute_led_coef.mask = 1 << 3;
4592 spec->mute_led_coef.on = 1 << 3;
4593 spec->mute_led_coef.off = 0;
4594 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4598 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4599 const struct hda_fixup *fix,
4602 struct alc_spec *spec = codec->spec;
4604 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4605 spec->mute_led_polarity = 0;
4606 spec->mute_led_coef.idx = 0x34;
4607 spec->mute_led_coef.mask = 1 << 5;
4608 spec->mute_led_coef.on = 0;
4609 spec->mute_led_coef.off = 1 << 5;
4610 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4614 /* turn on/off mic-mute LED per capture hook by coef bit */
4615 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4616 enum led_brightness brightness)
4618 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4619 struct alc_spec *spec = codec->spec;
4621 alc_update_coef_led(codec, &spec->mic_led_coef,
4622 spec->micmute_led_polarity, brightness);
4626 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4627 const struct hda_fixup *fix, int action)
4629 struct alc_spec *spec = codec->spec;
4631 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4632 spec->mic_led_coef.idx = 0x19;
4633 spec->mic_led_coef.mask = 1 << 13;
4634 spec->mic_led_coef.on = 1 << 13;
4635 spec->mic_led_coef.off = 0;
4636 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4640 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4641 const struct hda_fixup *fix, int action)
4643 struct alc_spec *spec = codec->spec;
4645 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4646 spec->mic_led_coef.idx = 0x35;
4647 spec->mic_led_coef.mask = 3 << 2;
4648 spec->mic_led_coef.on = 2 << 2;
4649 spec->mic_led_coef.off = 1 << 2;
4650 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4654 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4655 const struct hda_fixup *fix, int action)
4657 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4658 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4661 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4662 const struct hda_fixup *fix, int action)
4664 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4665 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4668 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4669 const struct hda_fixup *fix, int action)
4671 struct alc_spec *spec = codec->spec;
4673 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4674 spec->cap_mute_led_nid = 0x1a;
4675 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4676 codec->power_filter = led_power_filter;
4680 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4681 const struct hda_fixup *fix, int action)
4683 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4684 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4687 #if IS_REACHABLE(CONFIG_INPUT)
4688 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4689 struct hda_jack_callback *event)
4691 struct alc_spec *spec = codec->spec;
4693 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4694 send both key on and key off event for every interrupt. */
4695 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4696 input_sync(spec->kb_dev);
4697 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4698 input_sync(spec->kb_dev);
4701 static int alc_register_micmute_input_device(struct hda_codec *codec)
4703 struct alc_spec *spec = codec->spec;
4706 spec->kb_dev = input_allocate_device();
4707 if (!spec->kb_dev) {
4708 codec_err(codec, "Out of memory (input_allocate_device)\n");
4712 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4714 spec->kb_dev->name = "Microphone Mute Button";
4715 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4716 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4717 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4718 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4719 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4720 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4722 if (input_register_device(spec->kb_dev)) {
4723 codec_err(codec, "input_register_device failed\n");
4724 input_free_device(spec->kb_dev);
4725 spec->kb_dev = NULL;
4732 /* GPIO1 = set according to SKU external amp
4733 * GPIO2 = mic mute hotkey
4735 * GPIO4 = mic mute LED
4737 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4738 const struct hda_fixup *fix, int action)
4740 struct alc_spec *spec = codec->spec;
4742 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4743 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4744 spec->init_amp = ALC_INIT_DEFAULT;
4745 if (alc_register_micmute_input_device(codec) != 0)
4748 spec->gpio_mask |= 0x06;
4749 spec->gpio_dir |= 0x02;
4750 spec->gpio_data |= 0x02;
4751 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4752 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4753 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4754 gpio2_mic_hotkey_event);
4762 case HDA_FIXUP_ACT_FREE:
4763 input_unregister_device(spec->kb_dev);
4764 spec->kb_dev = NULL;
4768 /* Line2 = mic mute hotkey
4769 * GPIO2 = mic mute LED
4771 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4772 const struct hda_fixup *fix, int action)
4774 struct alc_spec *spec = codec->spec;
4776 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4777 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4778 spec->init_amp = ALC_INIT_DEFAULT;
4779 if (alc_register_micmute_input_device(codec) != 0)
4782 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4783 gpio2_mic_hotkey_event);
4791 case HDA_FIXUP_ACT_FREE:
4792 input_unregister_device(spec->kb_dev);
4793 spec->kb_dev = NULL;
4797 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4798 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4801 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4802 const struct hda_fixup *fix, int action)
4804 struct alc_spec *spec = codec->spec;
4806 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4807 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4808 spec->cap_mute_led_nid = 0x18;
4809 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4813 static const struct coef_fw alc225_pre_hsmode[] = {
4814 UPDATE_COEF(0x4a, 1<<8, 0),
4815 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4816 UPDATE_COEF(0x63, 3<<14, 3<<14),
4817 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4818 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4819 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4820 UPDATE_COEF(0x4a, 3<<10, 0),
4824 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4826 struct alc_spec *spec = codec->spec;
4827 static const struct coef_fw coef0255[] = {
4828 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4829 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4830 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4831 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4832 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4835 static const struct coef_fw coef0256[] = {
4836 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4837 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4838 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4839 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4840 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4843 static const struct coef_fw coef0233[] = {
4844 WRITE_COEF(0x1b, 0x0c0b),
4845 WRITE_COEF(0x45, 0xc429),
4846 UPDATE_COEF(0x35, 0x4000, 0),
4847 WRITE_COEF(0x06, 0x2104),
4848 WRITE_COEF(0x1a, 0x0001),
4849 WRITE_COEF(0x26, 0x0004),
4850 WRITE_COEF(0x32, 0x42a3),
4853 static const struct coef_fw coef0288[] = {
4854 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4855 UPDATE_COEF(0x50, 0x2000, 0x2000),
4856 UPDATE_COEF(0x56, 0x0006, 0x0006),
4857 UPDATE_COEF(0x66, 0x0008, 0),
4858 UPDATE_COEF(0x67, 0x2000, 0),
4861 static const struct coef_fw coef0298[] = {
4862 UPDATE_COEF(0x19, 0x1300, 0x0300),
4865 static const struct coef_fw coef0292[] = {
4866 WRITE_COEF(0x76, 0x000e),
4867 WRITE_COEF(0x6c, 0x2400),
4868 WRITE_COEF(0x18, 0x7308),
4869 WRITE_COEF(0x6b, 0xc429),
4872 static const struct coef_fw coef0293[] = {
4873 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4874 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4875 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4876 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4877 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4878 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4881 static const struct coef_fw coef0668[] = {
4882 WRITE_COEF(0x15, 0x0d40),
4883 WRITE_COEF(0xb7, 0x802b),
4886 static const struct coef_fw coef0225[] = {
4887 UPDATE_COEF(0x63, 3<<14, 0),
4890 static const struct coef_fw coef0274[] = {
4891 UPDATE_COEF(0x4a, 0x0100, 0),
4892 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4893 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4894 UPDATE_COEF(0x4a, 0x0010, 0),
4895 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4896 WRITE_COEF(0x45, 0x5289),
4897 UPDATE_COEF(0x4a, 0x0c00, 0),
4901 if (spec->no_internal_mic_pin) {
4902 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4906 switch (codec->core.vendor_id) {
4908 alc_process_coef_fw(codec, coef0255);
4913 alc_process_coef_fw(codec, coef0256);
4918 alc_process_coef_fw(codec, coef0274);
4922 alc_process_coef_fw(codec, coef0233);
4926 alc_process_coef_fw(codec, coef0288);
4929 alc_process_coef_fw(codec, coef0298);
4930 alc_process_coef_fw(codec, coef0288);
4933 alc_process_coef_fw(codec, coef0292);
4936 alc_process_coef_fw(codec, coef0293);
4939 alc_process_coef_fw(codec, coef0668);
4947 alc_process_coef_fw(codec, alc225_pre_hsmode);
4948 alc_process_coef_fw(codec, coef0225);
4951 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4954 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4958 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4961 static const struct coef_fw coef0255[] = {
4962 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4963 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4966 static const struct coef_fw coef0256[] = {
4967 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4968 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4969 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4972 static const struct coef_fw coef0233[] = {
4973 UPDATE_COEF(0x35, 0, 1<<14),
4974 WRITE_COEF(0x06, 0x2100),
4975 WRITE_COEF(0x1a, 0x0021),
4976 WRITE_COEF(0x26, 0x008c),
4979 static const struct coef_fw coef0288[] = {
4980 UPDATE_COEF(0x4f, 0x00c0, 0),
4981 UPDATE_COEF(0x50, 0x2000, 0),
4982 UPDATE_COEF(0x56, 0x0006, 0),
4983 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4984 UPDATE_COEF(0x66, 0x0008, 0x0008),
4985 UPDATE_COEF(0x67, 0x2000, 0x2000),
4988 static const struct coef_fw coef0292[] = {
4989 WRITE_COEF(0x19, 0xa208),
4990 WRITE_COEF(0x2e, 0xacf0),
4993 static const struct coef_fw coef0293[] = {
4994 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4995 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4996 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4999 static const struct coef_fw coef0688[] = {
5000 WRITE_COEF(0xb7, 0x802b),
5001 WRITE_COEF(0xb5, 0x1040),
5002 UPDATE_COEF(0xc3, 0, 1<<12),
5005 static const struct coef_fw coef0225[] = {
5006 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5007 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5008 UPDATE_COEF(0x63, 3<<14, 0),
5011 static const struct coef_fw coef0274[] = {
5012 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5013 UPDATE_COEF(0x4a, 0x0010, 0),
5014 UPDATE_COEF(0x6b, 0xf000, 0),
5018 switch (codec->core.vendor_id) {
5020 alc_write_coef_idx(codec, 0x45, 0xc489);
5021 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5022 alc_process_coef_fw(codec, coef0255);
5023 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5028 alc_write_coef_idx(codec, 0x45, 0xc489);
5029 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5030 alc_process_coef_fw(codec, coef0256);
5031 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5036 alc_write_coef_idx(codec, 0x45, 0x4689);
5037 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5038 alc_process_coef_fw(codec, coef0274);
5039 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5043 alc_write_coef_idx(codec, 0x45, 0xc429);
5044 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5045 alc_process_coef_fw(codec, coef0233);
5046 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5051 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5052 alc_process_coef_fw(codec, coef0288);
5053 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5056 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5057 alc_process_coef_fw(codec, coef0292);
5060 /* Set to TRS mode */
5061 alc_write_coef_idx(codec, 0x45, 0xc429);
5062 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5063 alc_process_coef_fw(codec, coef0293);
5064 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5067 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5071 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5072 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5075 alc_write_coef_idx(codec, 0x11, 0x0001);
5076 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5077 alc_process_coef_fw(codec, coef0688);
5078 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5086 alc_process_coef_fw(codec, alc225_pre_hsmode);
5087 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5088 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5089 alc_process_coef_fw(codec, coef0225);
5090 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5093 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5096 static void alc_headset_mode_default(struct hda_codec *codec)
5098 static const struct coef_fw coef0225[] = {
5099 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5100 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5101 UPDATE_COEF(0x49, 3<<8, 0<<8),
5102 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5103 UPDATE_COEF(0x63, 3<<14, 0),
5104 UPDATE_COEF(0x67, 0xf000, 0x3000),
5107 static const struct coef_fw coef0255[] = {
5108 WRITE_COEF(0x45, 0xc089),
5109 WRITE_COEF(0x45, 0xc489),
5110 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5111 WRITE_COEF(0x49, 0x0049),
5114 static const struct coef_fw coef0256[] = {
5115 WRITE_COEF(0x45, 0xc489),
5116 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5117 WRITE_COEF(0x49, 0x0049),
5118 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5119 WRITE_COEF(0x06, 0x6100),
5122 static const struct coef_fw coef0233[] = {
5123 WRITE_COEF(0x06, 0x2100),
5124 WRITE_COEF(0x32, 0x4ea3),
5127 static const struct coef_fw coef0288[] = {
5128 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5129 UPDATE_COEF(0x50, 0x2000, 0x2000),
5130 UPDATE_COEF(0x56, 0x0006, 0x0006),
5131 UPDATE_COEF(0x66, 0x0008, 0),
5132 UPDATE_COEF(0x67, 0x2000, 0),
5135 static const struct coef_fw coef0292[] = {
5136 WRITE_COEF(0x76, 0x000e),
5137 WRITE_COEF(0x6c, 0x2400),
5138 WRITE_COEF(0x6b, 0xc429),
5139 WRITE_COEF(0x18, 0x7308),
5142 static const struct coef_fw coef0293[] = {
5143 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5144 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5145 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5148 static const struct coef_fw coef0688[] = {
5149 WRITE_COEF(0x11, 0x0041),
5150 WRITE_COEF(0x15, 0x0d40),
5151 WRITE_COEF(0xb7, 0x802b),
5154 static const struct coef_fw coef0274[] = {
5155 WRITE_COEF(0x45, 0x4289),
5156 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5157 UPDATE_COEF(0x6b, 0x0f00, 0),
5158 UPDATE_COEF(0x49, 0x0300, 0x0300),
5162 switch (codec->core.vendor_id) {
5169 alc_process_coef_fw(codec, alc225_pre_hsmode);
5170 alc_process_coef_fw(codec, coef0225);
5173 alc_process_coef_fw(codec, coef0255);
5178 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5179 alc_write_coef_idx(codec, 0x45, 0xc089);
5181 alc_process_coef_fw(codec, coef0256);
5186 alc_process_coef_fw(codec, coef0274);
5190 alc_process_coef_fw(codec, coef0233);
5195 alc_process_coef_fw(codec, coef0288);
5198 alc_process_coef_fw(codec, coef0292);
5201 alc_process_coef_fw(codec, coef0293);
5204 alc_process_coef_fw(codec, coef0688);
5207 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5210 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5214 static void alc_headset_mode_ctia(struct hda_codec *codec)
5218 static const struct coef_fw coef0255[] = {
5219 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5220 WRITE_COEF(0x1b, 0x0c2b),
5221 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5224 static const struct coef_fw coef0256[] = {
5225 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5226 WRITE_COEF(0x1b, 0x0e6b),
5229 static const struct coef_fw coef0233[] = {
5230 WRITE_COEF(0x45, 0xd429),
5231 WRITE_COEF(0x1b, 0x0c2b),
5232 WRITE_COEF(0x32, 0x4ea3),
5235 static const struct coef_fw coef0288[] = {
5236 UPDATE_COEF(0x50, 0x2000, 0x2000),
5237 UPDATE_COEF(0x56, 0x0006, 0x0006),
5238 UPDATE_COEF(0x66, 0x0008, 0),
5239 UPDATE_COEF(0x67, 0x2000, 0),
5242 static const struct coef_fw coef0292[] = {
5243 WRITE_COEF(0x6b, 0xd429),
5244 WRITE_COEF(0x76, 0x0008),
5245 WRITE_COEF(0x18, 0x7388),
5248 static const struct coef_fw coef0293[] = {
5249 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5250 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5253 static const struct coef_fw coef0688[] = {
5254 WRITE_COEF(0x11, 0x0001),
5255 WRITE_COEF(0x15, 0x0d60),
5256 WRITE_COEF(0xc3, 0x0000),
5259 static const struct coef_fw coef0225_1[] = {
5260 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5261 UPDATE_COEF(0x63, 3<<14, 2<<14),
5264 static const struct coef_fw coef0225_2[] = {
5265 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5266 UPDATE_COEF(0x63, 3<<14, 1<<14),
5270 switch (codec->core.vendor_id) {
5272 alc_process_coef_fw(codec, coef0255);
5277 alc_process_coef_fw(codec, coef0256);
5282 alc_write_coef_idx(codec, 0x45, 0xd689);
5286 alc_process_coef_fw(codec, coef0233);
5289 val = alc_read_coef_idx(codec, 0x50);
5290 if (val & (1 << 12)) {
5291 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5292 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5295 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5296 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5302 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5304 alc_process_coef_fw(codec, coef0288);
5307 alc_process_coef_fw(codec, coef0292);
5310 alc_process_coef_fw(codec, coef0293);
5313 alc_process_coef_fw(codec, coef0688);
5321 val = alc_read_coef_idx(codec, 0x45);
5323 alc_process_coef_fw(codec, coef0225_2);
5325 alc_process_coef_fw(codec, coef0225_1);
5328 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5331 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5335 static void alc_headset_mode_omtp(struct hda_codec *codec)
5337 static const struct coef_fw coef0255[] = {
5338 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5339 WRITE_COEF(0x1b, 0x0c2b),
5340 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5343 static const struct coef_fw coef0256[] = {
5344 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5345 WRITE_COEF(0x1b, 0x0e6b),
5348 static const struct coef_fw coef0233[] = {
5349 WRITE_COEF(0x45, 0xe429),
5350 WRITE_COEF(0x1b, 0x0c2b),
5351 WRITE_COEF(0x32, 0x4ea3),
5354 static const struct coef_fw coef0288[] = {
5355 UPDATE_COEF(0x50, 0x2000, 0x2000),
5356 UPDATE_COEF(0x56, 0x0006, 0x0006),
5357 UPDATE_COEF(0x66, 0x0008, 0),
5358 UPDATE_COEF(0x67, 0x2000, 0),
5361 static const struct coef_fw coef0292[] = {
5362 WRITE_COEF(0x6b, 0xe429),
5363 WRITE_COEF(0x76, 0x0008),
5364 WRITE_COEF(0x18, 0x7388),
5367 static const struct coef_fw coef0293[] = {
5368 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5369 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5372 static const struct coef_fw coef0688[] = {
5373 WRITE_COEF(0x11, 0x0001),
5374 WRITE_COEF(0x15, 0x0d50),
5375 WRITE_COEF(0xc3, 0x0000),
5378 static const struct coef_fw coef0225[] = {
5379 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5380 UPDATE_COEF(0x63, 3<<14, 2<<14),
5384 switch (codec->core.vendor_id) {
5386 alc_process_coef_fw(codec, coef0255);
5391 alc_process_coef_fw(codec, coef0256);
5396 alc_write_coef_idx(codec, 0x45, 0xe689);
5400 alc_process_coef_fw(codec, coef0233);
5403 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5404 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5409 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5411 alc_process_coef_fw(codec, coef0288);
5414 alc_process_coef_fw(codec, coef0292);
5417 alc_process_coef_fw(codec, coef0293);
5420 alc_process_coef_fw(codec, coef0688);
5428 alc_process_coef_fw(codec, coef0225);
5431 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5434 static void alc_determine_headset_type(struct hda_codec *codec)
5437 bool is_ctia = false;
5438 struct alc_spec *spec = codec->spec;
5439 static const struct coef_fw coef0255[] = {
5440 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5441 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5445 static const struct coef_fw coef0288[] = {
5446 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5449 static const struct coef_fw coef0298[] = {
5450 UPDATE_COEF(0x50, 0x2000, 0x2000),
5451 UPDATE_COEF(0x56, 0x0006, 0x0006),
5452 UPDATE_COEF(0x66, 0x0008, 0),
5453 UPDATE_COEF(0x67, 0x2000, 0),
5454 UPDATE_COEF(0x19, 0x1300, 0x1300),
5457 static const struct coef_fw coef0293[] = {
5458 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5459 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5462 static const struct coef_fw coef0688[] = {
5463 WRITE_COEF(0x11, 0x0001),
5464 WRITE_COEF(0xb7, 0x802b),
5465 WRITE_COEF(0x15, 0x0d60),
5466 WRITE_COEF(0xc3, 0x0c00),
5469 static const struct coef_fw coef0274[] = {
5470 UPDATE_COEF(0x4a, 0x0010, 0),
5471 UPDATE_COEF(0x4a, 0x8000, 0),
5472 WRITE_COEF(0x45, 0xd289),
5473 UPDATE_COEF(0x49, 0x0300, 0x0300),
5477 if (spec->no_internal_mic_pin) {
5478 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5482 switch (codec->core.vendor_id) {
5484 alc_process_coef_fw(codec, coef0255);
5486 val = alc_read_coef_idx(codec, 0x46);
5487 is_ctia = (val & 0x0070) == 0x0070;
5492 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5493 alc_write_coef_idx(codec, 0x06, 0x6104);
5494 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5496 snd_hda_codec_write(codec, 0x21, 0,
5497 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5499 snd_hda_codec_write(codec, 0x21, 0,
5500 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5502 alc_process_coef_fw(codec, coef0255);
5504 val = alc_read_coef_idx(codec, 0x46);
5505 is_ctia = (val & 0x0070) == 0x0070;
5507 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5508 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5510 snd_hda_codec_write(codec, 0x21, 0,
5511 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5513 snd_hda_codec_write(codec, 0x21, 0,
5514 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5519 alc_process_coef_fw(codec, coef0274);
5521 val = alc_read_coef_idx(codec, 0x46);
5522 is_ctia = (val & 0x00f0) == 0x00f0;
5526 alc_write_coef_idx(codec, 0x45, 0xd029);
5528 val = alc_read_coef_idx(codec, 0x46);
5529 is_ctia = (val & 0x0070) == 0x0070;
5532 snd_hda_codec_write(codec, 0x21, 0,
5533 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5535 snd_hda_codec_write(codec, 0x21, 0,
5536 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5539 val = alc_read_coef_idx(codec, 0x50);
5540 if (val & (1 << 12)) {
5541 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5542 alc_process_coef_fw(codec, coef0288);
5544 val = alc_read_coef_idx(codec, 0x50);
5545 is_ctia = (val & 0x0070) == 0x0070;
5547 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5548 alc_process_coef_fw(codec, coef0288);
5550 val = alc_read_coef_idx(codec, 0x50);
5551 is_ctia = (val & 0x0070) == 0x0070;
5553 alc_process_coef_fw(codec, coef0298);
5554 snd_hda_codec_write(codec, 0x21, 0,
5555 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5557 snd_hda_codec_write(codec, 0x21, 0,
5558 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5562 alc_process_coef_fw(codec, coef0288);
5564 val = alc_read_coef_idx(codec, 0x50);
5565 is_ctia = (val & 0x0070) == 0x0070;
5568 alc_write_coef_idx(codec, 0x6b, 0xd429);
5570 val = alc_read_coef_idx(codec, 0x6c);
5571 is_ctia = (val & 0x001c) == 0x001c;
5574 alc_process_coef_fw(codec, coef0293);
5576 val = alc_read_coef_idx(codec, 0x46);
5577 is_ctia = (val & 0x0070) == 0x0070;
5580 alc_process_coef_fw(codec, coef0688);
5582 val = alc_read_coef_idx(codec, 0xbe);
5583 is_ctia = (val & 0x1c02) == 0x1c02;
5591 snd_hda_codec_write(codec, 0x21, 0,
5592 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5594 snd_hda_codec_write(codec, 0x21, 0,
5595 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5597 alc_process_coef_fw(codec, alc225_pre_hsmode);
5598 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5599 val = alc_read_coef_idx(codec, 0x45);
5600 if (val & (1 << 9)) {
5601 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5602 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5604 val = alc_read_coef_idx(codec, 0x46);
5605 is_ctia = (val & 0x00f0) == 0x00f0;
5607 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5608 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5610 val = alc_read_coef_idx(codec, 0x46);
5611 is_ctia = (val & 0x00f0) == 0x00f0;
5613 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5614 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5615 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5617 snd_hda_codec_write(codec, 0x21, 0,
5618 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5620 snd_hda_codec_write(codec, 0x21, 0,
5621 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5628 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5629 is_ctia ? "yes" : "no");
5630 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5633 static void alc_update_headset_mode(struct hda_codec *codec)
5635 struct alc_spec *spec = codec->spec;
5637 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5638 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5640 int new_headset_mode;
5642 if (!snd_hda_jack_detect(codec, hp_pin))
5643 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5644 else if (mux_pin == spec->headset_mic_pin)
5645 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5646 else if (mux_pin == spec->headphone_mic_pin)
5647 new_headset_mode = ALC_HEADSET_MODE_MIC;
5649 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5651 if (new_headset_mode == spec->current_headset_mode) {
5652 snd_hda_gen_update_outputs(codec);
5656 switch (new_headset_mode) {
5657 case ALC_HEADSET_MODE_UNPLUGGED:
5658 alc_headset_mode_unplugged(codec);
5659 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5660 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5661 spec->gen.hp_jack_present = false;
5663 case ALC_HEADSET_MODE_HEADSET:
5664 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5665 alc_determine_headset_type(codec);
5666 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5667 alc_headset_mode_ctia(codec);
5668 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5669 alc_headset_mode_omtp(codec);
5670 spec->gen.hp_jack_present = true;
5672 case ALC_HEADSET_MODE_MIC:
5673 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5674 spec->gen.hp_jack_present = false;
5676 case ALC_HEADSET_MODE_HEADPHONE:
5677 alc_headset_mode_default(codec);
5678 spec->gen.hp_jack_present = true;
5681 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5682 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5683 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5684 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5685 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5688 spec->current_headset_mode = new_headset_mode;
5690 snd_hda_gen_update_outputs(codec);
5693 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5694 struct snd_kcontrol *kcontrol,
5695 struct snd_ctl_elem_value *ucontrol)
5697 alc_update_headset_mode(codec);
5700 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5701 struct hda_jack_callback *jack)
5703 snd_hda_gen_hp_automute(codec, jack);
5704 alc_update_headset_mode(codec);
5707 static void alc_probe_headset_mode(struct hda_codec *codec)
5710 struct alc_spec *spec = codec->spec;
5711 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5714 for (i = 0; i < cfg->num_inputs; i++) {
5715 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5716 spec->headset_mic_pin = cfg->inputs[i].pin;
5717 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5718 spec->headphone_mic_pin = cfg->inputs[i].pin;
5721 WARN_ON(spec->gen.cap_sync_hook);
5722 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5723 spec->gen.automute_hook = alc_update_headset_mode;
5724 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5727 static void alc_fixup_headset_mode(struct hda_codec *codec,
5728 const struct hda_fixup *fix, int action)
5730 struct alc_spec *spec = codec->spec;
5733 case HDA_FIXUP_ACT_PRE_PROBE:
5734 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5736 case HDA_FIXUP_ACT_PROBE:
5737 alc_probe_headset_mode(codec);
5739 case HDA_FIXUP_ACT_INIT:
5740 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5741 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5742 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5744 alc_update_headset_mode(codec);
5749 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5750 const struct hda_fixup *fix, int action)
5752 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5753 struct alc_spec *spec = codec->spec;
5754 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5757 alc_fixup_headset_mode(codec, fix, action);
5760 static void alc255_set_default_jack_type(struct hda_codec *codec)
5762 /* Set to iphone type */
5763 static const struct coef_fw alc255fw[] = {
5764 WRITE_COEF(0x1b, 0x880b),
5765 WRITE_COEF(0x45, 0xd089),
5766 WRITE_COEF(0x1b, 0x080b),
5767 WRITE_COEF(0x46, 0x0004),
5768 WRITE_COEF(0x1b, 0x0c0b),
5771 static const struct coef_fw alc256fw[] = {
5772 WRITE_COEF(0x1b, 0x884b),
5773 WRITE_COEF(0x45, 0xd089),
5774 WRITE_COEF(0x1b, 0x084b),
5775 WRITE_COEF(0x46, 0x0004),
5776 WRITE_COEF(0x1b, 0x0c4b),
5779 switch (codec->core.vendor_id) {
5781 alc_process_coef_fw(codec, alc255fw);
5786 alc_process_coef_fw(codec, alc256fw);
5792 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5793 const struct hda_fixup *fix, int action)
5795 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5796 alc255_set_default_jack_type(codec);
5798 alc_fixup_headset_mode(codec, fix, action);
5801 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5802 const struct hda_fixup *fix, int action)
5804 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5805 struct alc_spec *spec = codec->spec;
5806 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5807 alc255_set_default_jack_type(codec);
5810 alc_fixup_headset_mode(codec, fix, action);
5813 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5814 struct hda_jack_callback *jack)
5816 struct alc_spec *spec = codec->spec;
5818 alc_update_headset_jack_cb(codec, jack);
5819 /* Headset Mic enable or disable, only for Dell Dino */
5820 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5823 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5824 const struct hda_fixup *fix, int action)
5826 alc_fixup_headset_mode(codec, fix, action);
5827 if (action == HDA_FIXUP_ACT_PROBE) {
5828 struct alc_spec *spec = codec->spec;
5829 /* toggled via hp_automute_hook */
5830 spec->gpio_mask |= 0x40;
5831 spec->gpio_dir |= 0x40;
5832 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5836 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5837 const struct hda_fixup *fix, int action)
5839 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5840 struct alc_spec *spec = codec->spec;
5841 spec->gen.auto_mute_via_amp = 1;
5845 static void alc_fixup_no_shutup(struct hda_codec *codec,
5846 const struct hda_fixup *fix, int action)
5848 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5849 struct alc_spec *spec = codec->spec;
5850 spec->no_shutup_pins = 1;
5854 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5855 const struct hda_fixup *fix, int action)
5857 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5858 struct alc_spec *spec = codec->spec;
5859 /* Disable AA-loopback as it causes white noise */
5860 spec->gen.mixer_nid = 0;
5864 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5865 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5866 const struct hda_fixup *fix, int action)
5868 static const struct hda_pintbl pincfgs[] = {
5869 { 0x16, 0x21211010 }, /* dock headphone */
5870 { 0x19, 0x21a11010 }, /* dock mic */
5873 struct alc_spec *spec = codec->spec;
5875 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5876 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5877 codec->power_save_node = 0; /* avoid click noises */
5878 snd_hda_apply_pincfgs(codec, pincfgs);
5882 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5883 const struct hda_fixup *fix, int action)
5885 static const struct hda_pintbl pincfgs[] = {
5886 { 0x17, 0x21211010 }, /* dock headphone */
5887 { 0x19, 0x21a11010 }, /* dock mic */
5890 struct alc_spec *spec = codec->spec;
5892 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5893 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5894 snd_hda_apply_pincfgs(codec, pincfgs);
5895 } else if (action == HDA_FIXUP_ACT_INIT) {
5896 /* Enable DOCK device */
5897 snd_hda_codec_write(codec, 0x17, 0,
5898 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5899 /* Enable DOCK device */
5900 snd_hda_codec_write(codec, 0x19, 0,
5901 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5905 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5906 const struct hda_fixup *fix, int action)
5908 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5909 * the speaker output becomes too low by some reason on Thinkpads with
5912 static const hda_nid_t preferred_pairs[] = {
5913 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5916 struct alc_spec *spec = codec->spec;
5918 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5919 spec->gen.preferred_dacs = preferred_pairs;
5922 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5923 const struct hda_fixup *fix, int action)
5925 static const hda_nid_t preferred_pairs[] = {
5926 0x17, 0x02, 0x21, 0x03, 0
5928 struct alc_spec *spec = codec->spec;
5930 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5931 spec->gen.preferred_dacs = preferred_pairs;
5934 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5936 struct alc_spec *spec = codec->spec;
5937 int hp_pin = alc_get_hp_pin(spec);
5939 /* Prevent pop noises when headphones are plugged in */
5940 snd_hda_codec_write(codec, hp_pin, 0,
5941 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5945 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5946 const struct hda_fixup *fix, int action)
5948 struct alc_spec *spec = codec->spec;
5949 struct hda_input_mux *imux = &spec->gen.input_mux;
5953 case HDA_FIXUP_ACT_PRE_PROBE:
5954 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5955 * it causes a click noise at start up
5957 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5958 spec->shutup = alc_shutup_dell_xps13;
5960 case HDA_FIXUP_ACT_PROBE:
5961 /* Make the internal mic the default input source. */
5962 for (i = 0; i < imux->num_items; i++) {
5963 if (spec->gen.imux_pins[i] == 0x12) {
5964 spec->gen.cur_mux[0] = i;
5972 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5973 const struct hda_fixup *fix, int action)
5975 struct alc_spec *spec = codec->spec;
5977 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5978 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5979 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5981 /* Disable boost for mic-in permanently. (This code is only called
5982 from quirks that guarantee that the headphone is at NID 0x1b.) */
5983 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5984 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5986 alc_fixup_headset_mode(codec, fix, action);
5989 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5990 const struct hda_fixup *fix, int action)
5992 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5993 alc_write_coef_idx(codec, 0xc4, 0x8000);
5994 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5995 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5997 alc_fixup_headset_mode(codec, fix, action);
6000 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6001 static int find_ext_mic_pin(struct hda_codec *codec)
6003 struct alc_spec *spec = codec->spec;
6004 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6006 unsigned int defcfg;
6009 for (i = 0; i < cfg->num_inputs; i++) {
6010 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6012 nid = cfg->inputs[i].pin;
6013 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6014 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6022 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6023 const struct hda_fixup *fix,
6026 struct alc_spec *spec = codec->spec;
6028 if (action == HDA_FIXUP_ACT_PROBE) {
6029 int mic_pin = find_ext_mic_pin(codec);
6030 int hp_pin = alc_get_hp_pin(spec);
6032 if (snd_BUG_ON(!mic_pin || !hp_pin))
6034 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6038 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6039 const struct hda_fixup *fix,
6042 struct alc_spec *spec = codec->spec;
6043 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6046 /* The mic boosts on level 2 and 3 are too noisy
6047 on the internal mic input.
6048 Therefore limit the boost to 0 or 1. */
6050 if (action != HDA_FIXUP_ACT_PROBE)
6053 for (i = 0; i < cfg->num_inputs; i++) {
6054 hda_nid_t nid = cfg->inputs[i].pin;
6055 unsigned int defcfg;
6056 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6058 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6059 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6062 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6063 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6064 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6065 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6066 (0 << AC_AMPCAP_MUTE_SHIFT));
6070 static void alc283_hp_automute_hook(struct hda_codec *codec,
6071 struct hda_jack_callback *jack)
6073 struct alc_spec *spec = codec->spec;
6077 snd_hda_gen_hp_automute(codec, jack);
6079 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6082 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6086 static void alc283_fixup_chromebook(struct hda_codec *codec,
6087 const struct hda_fixup *fix, int action)
6089 struct alc_spec *spec = codec->spec;
6092 case HDA_FIXUP_ACT_PRE_PROBE:
6093 snd_hda_override_wcaps(codec, 0x03, 0);
6094 /* Disable AA-loopback as it causes white noise */
6095 spec->gen.mixer_nid = 0;
6097 case HDA_FIXUP_ACT_INIT:
6098 /* MIC2-VREF control */
6099 /* Set to manual mode */
6100 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6101 /* Enable Line1 input control by verb */
6102 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6107 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6108 const struct hda_fixup *fix, int action)
6110 struct alc_spec *spec = codec->spec;
6113 case HDA_FIXUP_ACT_PRE_PROBE:
6114 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6116 case HDA_FIXUP_ACT_INIT:
6117 /* MIC2-VREF control */
6118 /* Set to manual mode */
6119 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6124 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6125 static void asus_tx300_automute(struct hda_codec *codec)
6127 struct alc_spec *spec = codec->spec;
6128 snd_hda_gen_update_outputs(codec);
6129 if (snd_hda_jack_detect(codec, 0x1b))
6130 spec->gen.mute_bits |= (1ULL << 0x14);
6133 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6134 const struct hda_fixup *fix, int action)
6136 struct alc_spec *spec = codec->spec;
6137 static const struct hda_pintbl dock_pins[] = {
6138 { 0x1b, 0x21114000 }, /* dock speaker pin */
6143 case HDA_FIXUP_ACT_PRE_PROBE:
6144 spec->init_amp = ALC_INIT_DEFAULT;
6145 /* TX300 needs to set up GPIO2 for the speaker amp */
6146 alc_setup_gpio(codec, 0x04);
6147 snd_hda_apply_pincfgs(codec, dock_pins);
6148 spec->gen.auto_mute_via_amp = 1;
6149 spec->gen.automute_hook = asus_tx300_automute;
6150 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6151 snd_hda_gen_hp_automute);
6153 case HDA_FIXUP_ACT_PROBE:
6154 spec->init_amp = ALC_INIT_DEFAULT;
6156 case HDA_FIXUP_ACT_BUILD:
6157 /* this is a bit tricky; give more sane names for the main
6158 * (tablet) speaker and the dock speaker, respectively
6160 rename_ctl(codec, "Speaker Playback Switch",
6161 "Dock Speaker Playback Switch");
6162 rename_ctl(codec, "Bass Speaker Playback Switch",
6163 "Speaker Playback Switch");
6168 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6169 const struct hda_fixup *fix, int action)
6171 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6172 /* DAC node 0x03 is giving mono output. We therefore want to
6173 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6174 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6175 static const hda_nid_t conn1[] = { 0x0c };
6176 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6177 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6181 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6182 const struct hda_fixup *fix, int action)
6184 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6185 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6186 we can't adjust the speaker's volume since this node does not has
6187 Amp-out capability. we change the speaker's route to:
6188 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6189 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6190 speaker's volume now. */
6192 static const hda_nid_t conn1[] = { 0x0c };
6193 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6197 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6198 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6199 const struct hda_fixup *fix, int action)
6201 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6202 static const hda_nid_t conn[] = { 0x02, 0x03 };
6203 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6207 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6208 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6209 const struct hda_fixup *fix, int action)
6211 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6212 static const hda_nid_t conn[] = { 0x02 };
6213 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6217 /* Hook to update amp GPIO4 for automute */
6218 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6219 struct hda_jack_callback *jack)
6221 struct alc_spec *spec = codec->spec;
6223 snd_hda_gen_hp_automute(codec, jack);
6224 /* mute_led_polarity is set to 0, so we pass inverted value here */
6225 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6226 !spec->gen.hp_jack_present);
6229 /* Manage GPIOs for HP EliteBook Folio 9480m.
6231 * GPIO4 is the headphone amplifier power control
6232 * GPIO3 is the audio output mute indicator LED
6235 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6236 const struct hda_fixup *fix,
6239 struct alc_spec *spec = codec->spec;
6241 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6242 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6243 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6244 spec->gpio_mask |= 0x10;
6245 spec->gpio_dir |= 0x10;
6246 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6250 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6251 const struct hda_fixup *fix,
6254 struct alc_spec *spec = codec->spec;
6256 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6257 spec->gpio_mask |= 0x04;
6258 spec->gpio_dir |= 0x04;
6259 /* set data bit low */
6263 /* Quirk for Thinkpad X1 7th and 8th Gen
6264 * The following fixed routing needed
6265 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6266 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6267 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6269 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6270 const struct hda_fixup *fix, int action)
6272 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6273 static const hda_nid_t preferred_pairs[] = {
6274 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6276 struct alc_spec *spec = codec->spec;
6279 case HDA_FIXUP_ACT_PRE_PROBE:
6280 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6281 spec->gen.preferred_dacs = preferred_pairs;
6283 case HDA_FIXUP_ACT_BUILD:
6284 /* The generic parser creates somewhat unintuitive volume ctls
6285 * with the fixed routing above, and the shared DAC2 may be
6287 * Rename those to unique names so that PA doesn't touch them
6288 * and use only Master volume.
6290 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6291 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6296 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6297 const struct hda_fixup *fix,
6300 alc_fixup_dual_codecs(codec, fix, action);
6302 case HDA_FIXUP_ACT_PRE_PROBE:
6303 /* override card longname to provide a unique UCM profile */
6304 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6306 case HDA_FIXUP_ACT_BUILD:
6307 /* rename Capture controls depending on the codec */
6308 rename_ctl(codec, "Capture Volume",
6310 "Rear-Panel Capture Volume" :
6311 "Front-Panel Capture Volume");
6312 rename_ctl(codec, "Capture Switch",
6314 "Rear-Panel Capture Switch" :
6315 "Front-Panel Capture Switch");
6320 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6321 const struct hda_fixup *fix, int action)
6323 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6326 codec->power_save_node = 1;
6329 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6330 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6331 const struct hda_fixup *fix, int action)
6333 struct alc_spec *spec = codec->spec;
6334 static const hda_nid_t preferred_pairs[] = {
6335 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6339 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6342 spec->gen.preferred_dacs = preferred_pairs;
6343 spec->gen.auto_mute_via_amp = 1;
6344 codec->power_save_node = 0;
6347 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6348 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6349 const struct hda_fixup *fix, int action)
6351 static const hda_nid_t preferred_pairs[] = {
6352 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6354 struct alc_spec *spec = codec->spec;
6356 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6357 spec->gen.preferred_dacs = preferred_pairs;
6358 spec->gen.obey_preferred_dacs = 1;
6362 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6363 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6364 const struct hda_fixup *fix, int action)
6366 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6369 snd_hda_override_wcaps(codec, 0x03, 0);
6372 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6374 switch (codec->core.vendor_id) {
6380 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6381 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6388 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6389 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6394 static void alc295_fixup_chromebook(struct hda_codec *codec,
6395 const struct hda_fixup *fix, int action)
6397 struct alc_spec *spec = codec->spec;
6400 case HDA_FIXUP_ACT_PRE_PROBE:
6401 spec->ultra_low_power = true;
6403 case HDA_FIXUP_ACT_INIT:
6404 alc_combo_jack_hp_jd_restart(codec);
6409 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6410 const struct hda_fixup *fix, int action)
6412 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6413 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6417 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6418 struct hda_jack_callback *cb)
6420 /* The Windows driver sets the codec up in a very different way where
6421 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6423 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6424 alc_write_coef_idx(codec, 0x10, 0x8a20);
6426 alc_write_coef_idx(codec, 0x10, 0x0a20);
6429 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6430 const struct hda_fixup *fix, int action)
6432 /* Pin 0x21: headphones/headset mic */
6433 if (!is_jack_detectable(codec, 0x21))
6437 case HDA_FIXUP_ACT_PRE_PROBE:
6438 snd_hda_jack_detect_enable_callback(codec, 0x21,
6439 alc294_gx502_toggle_output);
6441 case HDA_FIXUP_ACT_INIT:
6442 /* Make sure to start in a correct state, i.e. if
6443 * headphones have been plugged in before powering up the system
6445 alc294_gx502_toggle_output(codec, NULL);
6450 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6451 struct hda_jack_callback *cb)
6453 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6454 * responsible from changes between speakers and headphones
6456 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6457 alc_write_coef_idx(codec, 0x10, 0x8420);
6459 alc_write_coef_idx(codec, 0x10, 0x0a20);
6462 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6463 const struct hda_fixup *fix, int action)
6465 if (!is_jack_detectable(codec, 0x21))
6469 case HDA_FIXUP_ACT_PRE_PROBE:
6470 snd_hda_jack_detect_enable_callback(codec, 0x21,
6471 alc294_gu502_toggle_output);
6473 case HDA_FIXUP_ACT_INIT:
6474 alc294_gu502_toggle_output(codec, NULL);
6479 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6480 const struct hda_fixup *fix, int action)
6482 if (action != HDA_FIXUP_ACT_INIT)
6486 alc_write_coef_idx(codec, 0x65, 0x0);
6489 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6490 const struct hda_fixup *fix, int action)
6493 case HDA_FIXUP_ACT_INIT:
6494 alc_combo_jack_hp_jd_restart(codec);
6499 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6500 const struct hda_fixup *fix, int action)
6502 struct alc_spec *spec = codec->spec;
6505 case HDA_FIXUP_ACT_PRE_PROBE:
6506 /* Mic RING SLEEVE swap for combo jack */
6507 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6508 spec->no_internal_mic_pin = true;
6510 case HDA_FIXUP_ACT_INIT:
6511 alc_combo_jack_hp_jd_restart(codec);
6516 /* GPIO1 = amplifier on/off
6517 * GPIO3 = mic mute LED
6519 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6520 const struct hda_fixup *fix, int action)
6522 static const hda_nid_t conn[] = { 0x02 };
6524 struct alc_spec *spec = codec->spec;
6525 static const struct hda_pintbl pincfgs[] = {
6526 { 0x14, 0x90170110 }, /* front/high speakers */
6527 { 0x17, 0x90170130 }, /* back/bass speakers */
6531 //enable micmute led
6532 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6535 case HDA_FIXUP_ACT_PRE_PROBE:
6536 spec->micmute_led_polarity = 1;
6537 /* needed for amp of back speakers */
6538 spec->gpio_mask |= 0x01;
6539 spec->gpio_dir |= 0x01;
6540 snd_hda_apply_pincfgs(codec, pincfgs);
6541 /* share DAC to have unified volume control */
6542 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6543 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6545 case HDA_FIXUP_ACT_INIT:
6546 /* need to toggle GPIO to enable the amp of back speakers */
6547 alc_update_gpio_data(codec, 0x01, true);
6549 alc_update_gpio_data(codec, 0x01, false);
6554 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6555 const struct hda_fixup *fix, int action)
6557 static const hda_nid_t conn[] = { 0x02 };
6558 static const struct hda_pintbl pincfgs[] = {
6559 { 0x14, 0x90170110 }, /* rear speaker */
6564 case HDA_FIXUP_ACT_PRE_PROBE:
6565 snd_hda_apply_pincfgs(codec, pincfgs);
6566 /* force front speaker to DAC1 */
6567 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6572 /* for hda_fixup_thinkpad_acpi() */
6573 #include "thinkpad_helper.c"
6575 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6576 const struct hda_fixup *fix, int action)
6578 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6579 hda_fixup_thinkpad_acpi(codec, fix, action);
6582 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6583 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6584 const struct hda_fixup *fix,
6587 struct alc_spec *spec = codec->spec;
6590 case HDA_FIXUP_ACT_PRE_PROBE:
6591 spec->gen.suppress_auto_mute = 1;
6596 static int comp_bind(struct device *dev)
6598 struct hda_codec *cdc = dev_to_hda_codec(dev);
6599 struct alc_spec *spec = cdc->spec;
6601 return component_bind_all(dev, spec->comps);
6604 static void comp_unbind(struct device *dev)
6606 struct hda_codec *cdc = dev_to_hda_codec(dev);
6607 struct alc_spec *spec = cdc->spec;
6609 component_unbind_all(dev, spec->comps);
6612 static const struct component_master_ops comp_master_ops = {
6614 .unbind = comp_unbind,
6617 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6618 struct snd_pcm_substream *sub, int action)
6620 struct alc_spec *spec = cdc->spec;
6623 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6624 if (spec->comps[i].dev)
6625 spec->comps[i].playback_hook(spec->comps[i].dev, action);
6629 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6630 const char *hid, int count)
6632 struct device *dev = hda_codec_dev(cdc);
6633 struct alc_spec *spec = cdc->spec;
6638 case HDA_FIXUP_ACT_PRE_PROBE:
6639 for (i = 0; i < count; i++) {
6640 name = devm_kasprintf(dev, GFP_KERNEL,
6641 "%s-%s:00-cs35l41-hda.%d", bus, hid, i);
6644 component_match_add(dev, &spec->match, component_compare_dev_name, name);
6646 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6648 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6650 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6655 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6657 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6660 static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6662 cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 2);
6665 static void cs35l41_fixup_spi_four(struct hda_codec *codec, const struct hda_fixup *fix, int action)
6667 cs35l41_generic_fixup(codec, action, "spi0", "CSC3551", 4);
6670 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6673 cs35l41_generic_fixup(cdc, action, "i2c", "CLSA0100", 2);
6676 /* for alc295_fixup_hp_top_speakers */
6677 #include "hp_x360_helper.c"
6679 /* for alc285_fixup_ideapad_s740_coef() */
6680 #include "ideapad_s740_helper.c"
6682 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6683 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6684 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6685 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6689 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6690 const struct hda_fixup *fix,
6694 * A certain other OS sets these coeffs to different values. On at least
6695 * one TongFang barebone these settings might survive even a cold
6696 * reboot. So to restore a clean slate the values are explicitly reset
6697 * to default here. Without this, the external microphone is always in a
6698 * plugged-in state, while the internal microphone is always in an
6699 * unplugged state, breaking the ability to use the internal microphone.
6701 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6704 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6705 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6706 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6707 WRITE_COEF(0x49, 0x0149),
6711 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6712 const struct hda_fixup *fix,
6716 * The audio jack input and output is not detected on the ASRock NUC Box
6717 * 1100 series when cold booting without this fix. Warm rebooting from a
6718 * certain other OS makes the audio functional, as COEF settings are
6719 * preserved in this case. This fix sets these altered COEF values as
6722 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6725 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6726 const struct hda_fixup *fix,
6730 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6731 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6732 * needs an additional quirk for sound working after suspend and resume.
6734 if (codec->core.vendor_id == 0x10ec0256) {
6735 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6736 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6738 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6742 static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec,
6743 const struct hda_fixup *fix,
6746 struct alc_spec *spec = codec->spec;
6747 struct hda_input_mux *imux = &spec->gen.input_mux;
6750 alc269_fixup_limit_int_mic_boost(codec, fix, action);
6753 case HDA_FIXUP_ACT_PRE_PROBE:
6755 * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic)
6756 * to Hi-Z to avoid pop noises at startup and when plugging and
6757 * unplugging headphones.
6759 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6760 snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ);
6762 case HDA_FIXUP_ACT_PROBE:
6764 * Make the internal mic (0x12) the default input source to
6765 * prevent pop noises on cold boot.
6767 for (i = 0; i < imux->num_items; i++) {
6768 if (spec->gen.imux_pins[i] == 0x12) {
6769 spec->gen.cur_mux[0] = i;
6779 ALC269_FIXUP_SONY_VAIO,
6780 ALC275_FIXUP_SONY_VAIO_GPIO2,
6781 ALC269_FIXUP_DELL_M101Z,
6782 ALC269_FIXUP_SKU_IGNORE,
6783 ALC269_FIXUP_ASUS_G73JW,
6784 ALC269_FIXUP_LENOVO_EAPD,
6785 ALC275_FIXUP_SONY_HWEQ,
6786 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6788 ALC269_FIXUP_PCM_44K,
6789 ALC269_FIXUP_STEREO_DMIC,
6790 ALC269_FIXUP_HEADSET_MIC,
6791 ALC269_FIXUP_QUANTA_MUTE,
6792 ALC269_FIXUP_LIFEBOOK,
6793 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6794 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6795 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6796 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6799 ALC269VB_FIXUP_AMIC,
6800 ALC269VB_FIXUP_DMIC,
6801 ALC269_FIXUP_HP_MUTE_LED,
6802 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6803 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6804 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6805 ALC269_FIXUP_HP_GPIO_LED,
6806 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6807 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6808 ALC269_FIXUP_INV_DMIC,
6809 ALC269_FIXUP_LENOVO_DOCK,
6810 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6811 ALC269_FIXUP_NO_SHUTUP,
6812 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6813 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6814 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6815 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6816 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6817 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6818 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET,
6819 ALC269_FIXUP_HEADSET_MODE,
6820 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6821 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6822 ALC269_FIXUP_ASUS_X101_FUNC,
6823 ALC269_FIXUP_ASUS_X101_VERB,
6824 ALC269_FIXUP_ASUS_X101,
6825 ALC271_FIXUP_AMIC_MIC2,
6826 ALC271_FIXUP_HP_GATE_MIC_JACK,
6827 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6828 ALC269_FIXUP_ACER_AC700,
6829 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6830 ALC269VB_FIXUP_ASUS_ZENBOOK,
6831 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6832 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6833 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6834 ALC283_FIXUP_CHROME_BOOK,
6835 ALC283_FIXUP_SENSE_COMBO_JACK,
6836 ALC282_FIXUP_ASUS_TX300,
6837 ALC283_FIXUP_INT_MIC,
6838 ALC290_FIXUP_MONO_SPEAKERS,
6839 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6840 ALC290_FIXUP_SUBWOOFER,
6841 ALC290_FIXUP_SUBWOOFER_HSJACK,
6842 ALC269_FIXUP_THINKPAD_ACPI,
6843 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6844 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6845 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6846 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6847 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6848 ALC255_FIXUP_HEADSET_MODE,
6849 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6850 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6851 ALC292_FIXUP_TPT440_DOCK,
6852 ALC292_FIXUP_TPT440,
6853 ALC283_FIXUP_HEADSET_MIC,
6854 ALC255_FIXUP_MIC_MUTE_LED,
6855 ALC282_FIXUP_ASPIRE_V5_PINS,
6856 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6857 ALC280_FIXUP_HP_GPIO4,
6858 ALC286_FIXUP_HP_GPIO_LED,
6859 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6860 ALC280_FIXUP_HP_DOCK_PINS,
6861 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6862 ALC280_FIXUP_HP_9480M,
6863 ALC245_FIXUP_HP_X360_AMP,
6864 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
6865 ALC288_FIXUP_DELL_HEADSET_MODE,
6866 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6867 ALC288_FIXUP_DELL_XPS_13,
6868 ALC288_FIXUP_DISABLE_AAMIX,
6869 ALC292_FIXUP_DELL_E7X_AAMIX,
6870 ALC292_FIXUP_DELL_E7X,
6871 ALC292_FIXUP_DISABLE_AAMIX,
6872 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6873 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6874 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6875 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6876 ALC275_FIXUP_DELL_XPS,
6877 ALC293_FIXUP_LENOVO_SPK_NOISE,
6878 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6879 ALC255_FIXUP_DELL_SPK_NOISE,
6880 ALC225_FIXUP_DISABLE_MIC_VREF,
6881 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6882 ALC295_FIXUP_DISABLE_DAC3,
6883 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6884 ALC280_FIXUP_HP_HEADSET_MIC,
6885 ALC221_FIXUP_HP_FRONT_MIC,
6886 ALC292_FIXUP_TPT460,
6887 ALC298_FIXUP_SPK_VOLUME,
6888 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6889 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6890 ALC269_FIXUP_ATIV_BOOK_8,
6891 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6892 ALC256_FIXUP_ASUS_HEADSET_MODE,
6893 ALC256_FIXUP_ASUS_MIC,
6894 ALC256_FIXUP_ASUS_AIO_GPIO2,
6895 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6896 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6897 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6898 ALC233_FIXUP_ACER_HEADSET_MIC,
6899 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6900 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6901 ALC225_FIXUP_S3_POP_NOISE,
6902 ALC700_FIXUP_INTEL_REFERENCE,
6903 ALC274_FIXUP_DELL_BIND_DACS,
6904 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6905 ALC298_FIXUP_TPT470_DOCK_FIX,
6906 ALC298_FIXUP_TPT470_DOCK,
6907 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6908 ALC255_FIXUP_DELL_HEADSET_MIC,
6909 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6910 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6911 ALC295_FIXUP_HP_X360,
6912 ALC221_FIXUP_HP_HEADSET_MIC,
6913 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6914 ALC295_FIXUP_HP_AUTO_MUTE,
6915 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6916 ALC294_FIXUP_ASUS_MIC,
6917 ALC294_FIXUP_ASUS_HEADSET_MIC,
6918 ALC294_FIXUP_ASUS_SPK,
6919 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6920 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6921 ALC255_FIXUP_ACER_HEADSET_MIC,
6922 ALC295_FIXUP_CHROME_BOOK,
6923 ALC225_FIXUP_HEADSET_JACK,
6924 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6925 ALC225_FIXUP_WYSE_AUTO_MUTE,
6926 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6927 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6928 ALC256_FIXUP_ASUS_HEADSET_MIC,
6929 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6930 ALC299_FIXUP_PREDATOR_SPK,
6931 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6932 ALC289_FIXUP_DELL_SPK2,
6933 ALC289_FIXUP_DUAL_SPK,
6934 ALC294_FIXUP_SPK2_TO_DAC1,
6935 ALC294_FIXUP_ASUS_DUAL_SPK,
6936 ALC285_FIXUP_THINKPAD_X1_GEN7,
6937 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6938 ALC294_FIXUP_ASUS_HPE,
6939 ALC294_FIXUP_ASUS_COEF_1B,
6940 ALC294_FIXUP_ASUS_GX502_HP,
6941 ALC294_FIXUP_ASUS_GX502_PINS,
6942 ALC294_FIXUP_ASUS_GX502_VERBS,
6943 ALC294_FIXUP_ASUS_GU502_HP,
6944 ALC294_FIXUP_ASUS_GU502_PINS,
6945 ALC294_FIXUP_ASUS_GU502_VERBS,
6946 ALC285_FIXUP_HP_GPIO_LED,
6947 ALC285_FIXUP_HP_MUTE_LED,
6948 ALC236_FIXUP_HP_GPIO_LED,
6949 ALC236_FIXUP_HP_MUTE_LED,
6950 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6951 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6952 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6953 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6954 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6955 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6956 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6957 ALC289_FIXUP_ASUS_GA401,
6958 ALC289_FIXUP_ASUS_GA502,
6959 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6960 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6961 ALC269_FIXUP_CZC_B20,
6962 ALC269_FIXUP_CZC_TMI,
6963 ALC269_FIXUP_CZC_L101,
6964 ALC269_FIXUP_LEMOTE_A1802,
6965 ALC269_FIXUP_LEMOTE_A190X,
6966 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6967 ALC233_FIXUP_INTEL_NUC8_DMIC,
6968 ALC233_FIXUP_INTEL_NUC8_BOOST,
6969 ALC256_FIXUP_INTEL_NUC10,
6970 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6971 ALC274_FIXUP_HP_MIC,
6972 ALC274_FIXUP_HP_HEADSET_MIC,
6973 ALC274_FIXUP_HP_ENVY_GPIO,
6974 ALC256_FIXUP_ASUS_HPE,
6975 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6976 ALC287_FIXUP_HP_GPIO_LED,
6977 ALC256_FIXUP_HP_HEADSET_MIC,
6978 ALC245_FIXUP_HP_GPIO_LED,
6979 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6980 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6981 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6982 ALC256_FIXUP_ACER_HEADSET_MIC,
6983 ALC285_FIXUP_IDEAPAD_S740_COEF,
6984 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6985 ALC295_FIXUP_ASUS_DACS,
6986 ALC295_FIXUP_HP_OMEN,
6987 ALC285_FIXUP_HP_SPECTRE_X360,
6988 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6989 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6990 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6991 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6992 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6993 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6994 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
6995 ALC287_FIXUP_13S_GEN2_SPEAKERS,
6996 ALC256_FIXUP_SET_COEF_DEFAULTS,
6997 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6998 ALC233_FIXUP_NO_AUDIO_JACK,
6999 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7000 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7001 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7002 ALC287_FIXUP_LEGION_16ACHG6,
7003 ALC287_FIXUP_CS35L41_I2C_2,
7004 ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED,
7005 ALC245_FIXUP_CS35L41_SPI_2,
7006 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED,
7007 ALC245_FIXUP_CS35L41_SPI_4,
7008 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED,
7009 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7010 ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
7013 static const struct hda_fixup alc269_fixups[] = {
7014 [ALC269_FIXUP_GPIO2] = {
7015 .type = HDA_FIXUP_FUNC,
7016 .v.func = alc_fixup_gpio2,
7018 [ALC269_FIXUP_SONY_VAIO] = {
7019 .type = HDA_FIXUP_PINCTLS,
7020 .v.pins = (const struct hda_pintbl[]) {
7021 {0x19, PIN_VREFGRD},
7025 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7026 .type = HDA_FIXUP_FUNC,
7027 .v.func = alc275_fixup_gpio4_off,
7029 .chain_id = ALC269_FIXUP_SONY_VAIO
7031 [ALC269_FIXUP_DELL_M101Z] = {
7032 .type = HDA_FIXUP_VERBS,
7033 .v.verbs = (const struct hda_verb[]) {
7034 /* Enables internal speaker */
7035 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7036 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7040 [ALC269_FIXUP_SKU_IGNORE] = {
7041 .type = HDA_FIXUP_FUNC,
7042 .v.func = alc_fixup_sku_ignore,
7044 [ALC269_FIXUP_ASUS_G73JW] = {
7045 .type = HDA_FIXUP_PINS,
7046 .v.pins = (const struct hda_pintbl[]) {
7047 { 0x17, 0x99130111 }, /* subwoofer */
7051 [ALC269_FIXUP_LENOVO_EAPD] = {
7052 .type = HDA_FIXUP_VERBS,
7053 .v.verbs = (const struct hda_verb[]) {
7054 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7058 [ALC275_FIXUP_SONY_HWEQ] = {
7059 .type = HDA_FIXUP_FUNC,
7060 .v.func = alc269_fixup_hweq,
7062 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7064 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7065 .type = HDA_FIXUP_FUNC,
7066 .v.func = alc_fixup_disable_aamix,
7068 .chain_id = ALC269_FIXUP_SONY_VAIO
7070 [ALC271_FIXUP_DMIC] = {
7071 .type = HDA_FIXUP_FUNC,
7072 .v.func = alc271_fixup_dmic,
7074 [ALC269_FIXUP_PCM_44K] = {
7075 .type = HDA_FIXUP_FUNC,
7076 .v.func = alc269_fixup_pcm_44k,
7078 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7080 [ALC269_FIXUP_STEREO_DMIC] = {
7081 .type = HDA_FIXUP_FUNC,
7082 .v.func = alc269_fixup_stereo_dmic,
7084 [ALC269_FIXUP_HEADSET_MIC] = {
7085 .type = HDA_FIXUP_FUNC,
7086 .v.func = alc269_fixup_headset_mic,
7088 [ALC269_FIXUP_QUANTA_MUTE] = {
7089 .type = HDA_FIXUP_FUNC,
7090 .v.func = alc269_fixup_quanta_mute,
7092 [ALC269_FIXUP_LIFEBOOK] = {
7093 .type = HDA_FIXUP_PINS,
7094 .v.pins = (const struct hda_pintbl[]) {
7095 { 0x1a, 0x2101103f }, /* dock line-out */
7096 { 0x1b, 0x23a11040 }, /* dock mic-in */
7100 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7102 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7103 .type = HDA_FIXUP_PINS,
7104 .v.pins = (const struct hda_pintbl[]) {
7105 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7109 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7110 .type = HDA_FIXUP_PINS,
7111 .v.pins = (const struct hda_pintbl[]) {
7112 { 0x21, 0x0221102f }, /* HP out */
7116 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7117 .type = HDA_FIXUP_FUNC,
7118 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7120 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7121 .type = HDA_FIXUP_FUNC,
7122 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7124 [ALC269_FIXUP_AMIC] = {
7125 .type = HDA_FIXUP_PINS,
7126 .v.pins = (const struct hda_pintbl[]) {
7127 { 0x14, 0x99130110 }, /* speaker */
7128 { 0x15, 0x0121401f }, /* HP out */
7129 { 0x18, 0x01a19c20 }, /* mic */
7130 { 0x19, 0x99a3092f }, /* int-mic */
7134 [ALC269_FIXUP_DMIC] = {
7135 .type = HDA_FIXUP_PINS,
7136 .v.pins = (const struct hda_pintbl[]) {
7137 { 0x12, 0x99a3092f }, /* int-mic */
7138 { 0x14, 0x99130110 }, /* speaker */
7139 { 0x15, 0x0121401f }, /* HP out */
7140 { 0x18, 0x01a19c20 }, /* mic */
7144 [ALC269VB_FIXUP_AMIC] = {
7145 .type = HDA_FIXUP_PINS,
7146 .v.pins = (const struct hda_pintbl[]) {
7147 { 0x14, 0x99130110 }, /* speaker */
7148 { 0x18, 0x01a19c20 }, /* mic */
7149 { 0x19, 0x99a3092f }, /* int-mic */
7150 { 0x21, 0x0121401f }, /* HP out */
7154 [ALC269VB_FIXUP_DMIC] = {
7155 .type = HDA_FIXUP_PINS,
7156 .v.pins = (const struct hda_pintbl[]) {
7157 { 0x12, 0x99a3092f }, /* int-mic */
7158 { 0x14, 0x99130110 }, /* speaker */
7159 { 0x18, 0x01a19c20 }, /* mic */
7160 { 0x21, 0x0121401f }, /* HP out */
7164 [ALC269_FIXUP_HP_MUTE_LED] = {
7165 .type = HDA_FIXUP_FUNC,
7166 .v.func = alc269_fixup_hp_mute_led,
7168 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7169 .type = HDA_FIXUP_FUNC,
7170 .v.func = alc269_fixup_hp_mute_led_mic1,
7172 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7173 .type = HDA_FIXUP_FUNC,
7174 .v.func = alc269_fixup_hp_mute_led_mic2,
7176 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7177 .type = HDA_FIXUP_FUNC,
7178 .v.func = alc269_fixup_hp_mute_led_mic3,
7180 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7182 [ALC269_FIXUP_HP_GPIO_LED] = {
7183 .type = HDA_FIXUP_FUNC,
7184 .v.func = alc269_fixup_hp_gpio_led,
7186 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7187 .type = HDA_FIXUP_FUNC,
7188 .v.func = alc269_fixup_hp_gpio_mic1_led,
7190 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7191 .type = HDA_FIXUP_FUNC,
7192 .v.func = alc269_fixup_hp_line1_mic1_led,
7194 [ALC269_FIXUP_INV_DMIC] = {
7195 .type = HDA_FIXUP_FUNC,
7196 .v.func = alc_fixup_inv_dmic,
7198 [ALC269_FIXUP_NO_SHUTUP] = {
7199 .type = HDA_FIXUP_FUNC,
7200 .v.func = alc_fixup_no_shutup,
7202 [ALC269_FIXUP_LENOVO_DOCK] = {
7203 .type = HDA_FIXUP_PINS,
7204 .v.pins = (const struct hda_pintbl[]) {
7205 { 0x19, 0x23a11040 }, /* dock mic */
7206 { 0x1b, 0x2121103f }, /* dock headphone */
7210 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7212 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7213 .type = HDA_FIXUP_FUNC,
7214 .v.func = alc269_fixup_limit_int_mic_boost,
7216 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7218 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7219 .type = HDA_FIXUP_FUNC,
7220 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7222 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7224 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7225 .type = HDA_FIXUP_PINS,
7226 .v.pins = (const struct hda_pintbl[]) {
7227 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7228 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7232 .chain_id = ALC269_FIXUP_HEADSET_MODE
7234 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7235 .type = HDA_FIXUP_PINS,
7236 .v.pins = (const struct hda_pintbl[]) {
7237 { 0x16, 0x21014020 }, /* dock line out */
7238 { 0x19, 0x21a19030 }, /* dock mic */
7239 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7243 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7245 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7246 .type = HDA_FIXUP_PINS,
7247 .v.pins = (const struct hda_pintbl[]) {
7248 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7252 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7254 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7255 .type = HDA_FIXUP_PINS,
7256 .v.pins = (const struct hda_pintbl[]) {
7257 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7258 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7262 .chain_id = ALC269_FIXUP_HEADSET_MODE
7264 [ALC269_FIXUP_HEADSET_MODE] = {
7265 .type = HDA_FIXUP_FUNC,
7266 .v.func = alc_fixup_headset_mode,
7268 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7270 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7271 .type = HDA_FIXUP_FUNC,
7272 .v.func = alc_fixup_headset_mode_no_hp_mic,
7274 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7275 .type = HDA_FIXUP_PINS,
7276 .v.pins = (const struct hda_pintbl[]) {
7277 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7281 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7283 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7284 .type = HDA_FIXUP_PINS,
7285 .v.pins = (const struct hda_pintbl[]) {
7286 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7290 .chain_id = ALC269_FIXUP_HEADSET_MIC
7292 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7293 .type = HDA_FIXUP_PINS,
7294 .v.pins = (const struct hda_pintbl[]) {
7308 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7310 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7311 .type = HDA_FIXUP_FUNC,
7312 .v.func = alc298_fixup_huawei_mbx_stereo,
7314 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7316 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7317 .type = HDA_FIXUP_FUNC,
7318 .v.func = alc269_fixup_x101_headset_mic,
7320 [ALC269_FIXUP_ASUS_X101_VERB] = {
7321 .type = HDA_FIXUP_VERBS,
7322 .v.verbs = (const struct hda_verb[]) {
7323 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7324 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7325 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7329 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7331 [ALC269_FIXUP_ASUS_X101] = {
7332 .type = HDA_FIXUP_PINS,
7333 .v.pins = (const struct hda_pintbl[]) {
7334 { 0x18, 0x04a1182c }, /* Headset mic */
7338 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7340 [ALC271_FIXUP_AMIC_MIC2] = {
7341 .type = HDA_FIXUP_PINS,
7342 .v.pins = (const struct hda_pintbl[]) {
7343 { 0x14, 0x99130110 }, /* speaker */
7344 { 0x19, 0x01a19c20 }, /* mic */
7345 { 0x1b, 0x99a7012f }, /* int-mic */
7346 { 0x21, 0x0121401f }, /* HP out */
7350 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7351 .type = HDA_FIXUP_FUNC,
7352 .v.func = alc271_hp_gate_mic_jack,
7354 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7356 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7357 .type = HDA_FIXUP_FUNC,
7358 .v.func = alc269_fixup_limit_int_mic_boost,
7360 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7362 [ALC269_FIXUP_ACER_AC700] = {
7363 .type = HDA_FIXUP_PINS,
7364 .v.pins = (const struct hda_pintbl[]) {
7365 { 0x12, 0x99a3092f }, /* int-mic */
7366 { 0x14, 0x99130110 }, /* speaker */
7367 { 0x18, 0x03a11c20 }, /* mic */
7368 { 0x1e, 0x0346101e }, /* SPDIF1 */
7369 { 0x21, 0x0321101f }, /* HP out */
7373 .chain_id = ALC271_FIXUP_DMIC,
7375 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7376 .type = HDA_FIXUP_FUNC,
7377 .v.func = alc269_fixup_limit_int_mic_boost,
7379 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7381 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7382 .type = HDA_FIXUP_FUNC,
7383 .v.func = alc269_fixup_limit_int_mic_boost,
7385 .chain_id = ALC269VB_FIXUP_DMIC,
7387 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7388 .type = HDA_FIXUP_VERBS,
7389 .v.verbs = (const struct hda_verb[]) {
7390 /* class-D output amp +5dB */
7391 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7392 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7396 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7398 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7399 .type = HDA_FIXUP_FUNC,
7400 .v.func = alc269_fixup_limit_int_mic_boost,
7402 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7404 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7405 .type = HDA_FIXUP_PINS,
7406 .v.pins = (const struct hda_pintbl[]) {
7407 { 0x12, 0x99a3092f }, /* int-mic */
7408 { 0x18, 0x03a11d20 }, /* mic */
7409 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7413 [ALC283_FIXUP_CHROME_BOOK] = {
7414 .type = HDA_FIXUP_FUNC,
7415 .v.func = alc283_fixup_chromebook,
7417 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7418 .type = HDA_FIXUP_FUNC,
7419 .v.func = alc283_fixup_sense_combo_jack,
7421 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7423 [ALC282_FIXUP_ASUS_TX300] = {
7424 .type = HDA_FIXUP_FUNC,
7425 .v.func = alc282_fixup_asus_tx300,
7427 [ALC283_FIXUP_INT_MIC] = {
7428 .type = HDA_FIXUP_VERBS,
7429 .v.verbs = (const struct hda_verb[]) {
7430 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7431 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7435 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7437 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7438 .type = HDA_FIXUP_PINS,
7439 .v.pins = (const struct hda_pintbl[]) {
7440 { 0x17, 0x90170112 }, /* subwoofer */
7444 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7446 [ALC290_FIXUP_SUBWOOFER] = {
7447 .type = HDA_FIXUP_PINS,
7448 .v.pins = (const struct hda_pintbl[]) {
7449 { 0x17, 0x90170112 }, /* subwoofer */
7453 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7455 [ALC290_FIXUP_MONO_SPEAKERS] = {
7456 .type = HDA_FIXUP_FUNC,
7457 .v.func = alc290_fixup_mono_speakers,
7459 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7460 .type = HDA_FIXUP_FUNC,
7461 .v.func = alc290_fixup_mono_speakers,
7463 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7465 [ALC269_FIXUP_THINKPAD_ACPI] = {
7466 .type = HDA_FIXUP_FUNC,
7467 .v.func = alc_fixup_thinkpad_acpi,
7469 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7471 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7472 .type = HDA_FIXUP_FUNC,
7473 .v.func = alc_fixup_inv_dmic,
7475 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7477 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7478 .type = HDA_FIXUP_PINS,
7479 .v.pins = (const struct hda_pintbl[]) {
7480 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7484 .chain_id = ALC255_FIXUP_HEADSET_MODE
7486 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7487 .type = HDA_FIXUP_PINS,
7488 .v.pins = (const struct hda_pintbl[]) {
7489 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7493 .chain_id = ALC255_FIXUP_HEADSET_MODE
7495 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7496 .type = HDA_FIXUP_PINS,
7497 .v.pins = (const struct hda_pintbl[]) {
7498 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7499 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7503 .chain_id = ALC255_FIXUP_HEADSET_MODE
7505 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7506 .type = HDA_FIXUP_PINS,
7507 .v.pins = (const struct hda_pintbl[]) {
7508 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7512 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7514 [ALC255_FIXUP_HEADSET_MODE] = {
7515 .type = HDA_FIXUP_FUNC,
7516 .v.func = alc_fixup_headset_mode_alc255,
7518 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7520 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7521 .type = HDA_FIXUP_FUNC,
7522 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7524 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7525 .type = HDA_FIXUP_PINS,
7526 .v.pins = (const struct hda_pintbl[]) {
7527 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7528 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7532 .chain_id = ALC269_FIXUP_HEADSET_MODE
7534 [ALC292_FIXUP_TPT440_DOCK] = {
7535 .type = HDA_FIXUP_FUNC,
7536 .v.func = alc_fixup_tpt440_dock,
7538 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7540 [ALC292_FIXUP_TPT440] = {
7541 .type = HDA_FIXUP_FUNC,
7542 .v.func = alc_fixup_disable_aamix,
7544 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7546 [ALC283_FIXUP_HEADSET_MIC] = {
7547 .type = HDA_FIXUP_PINS,
7548 .v.pins = (const struct hda_pintbl[]) {
7549 { 0x19, 0x04a110f0 },
7553 [ALC255_FIXUP_MIC_MUTE_LED] = {
7554 .type = HDA_FIXUP_FUNC,
7555 .v.func = alc_fixup_micmute_led,
7557 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7558 .type = HDA_FIXUP_PINS,
7559 .v.pins = (const struct hda_pintbl[]) {
7560 { 0x12, 0x90a60130 },
7561 { 0x14, 0x90170110 },
7562 { 0x17, 0x40000008 },
7563 { 0x18, 0x411111f0 },
7564 { 0x19, 0x01a1913c },
7565 { 0x1a, 0x411111f0 },
7566 { 0x1b, 0x411111f0 },
7567 { 0x1d, 0x40f89b2d },
7568 { 0x1e, 0x411111f0 },
7569 { 0x21, 0x0321101f },
7573 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7574 .type = HDA_FIXUP_FUNC,
7575 .v.func = alc269vb_fixup_aspire_e1_coef,
7577 [ALC280_FIXUP_HP_GPIO4] = {
7578 .type = HDA_FIXUP_FUNC,
7579 .v.func = alc280_fixup_hp_gpio4,
7581 [ALC286_FIXUP_HP_GPIO_LED] = {
7582 .type = HDA_FIXUP_FUNC,
7583 .v.func = alc286_fixup_hp_gpio_led,
7585 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7586 .type = HDA_FIXUP_FUNC,
7587 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7589 [ALC280_FIXUP_HP_DOCK_PINS] = {
7590 .type = HDA_FIXUP_PINS,
7591 .v.pins = (const struct hda_pintbl[]) {
7592 { 0x1b, 0x21011020 }, /* line-out */
7593 { 0x1a, 0x01a1903c }, /* headset mic */
7594 { 0x18, 0x2181103f }, /* line-in */
7598 .chain_id = ALC280_FIXUP_HP_GPIO4
7600 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7601 .type = HDA_FIXUP_PINS,
7602 .v.pins = (const struct hda_pintbl[]) {
7603 { 0x1b, 0x21011020 }, /* line-out */
7604 { 0x18, 0x2181103f }, /* line-in */
7608 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7610 [ALC280_FIXUP_HP_9480M] = {
7611 .type = HDA_FIXUP_FUNC,
7612 .v.func = alc280_fixup_hp_9480m,
7614 [ALC245_FIXUP_HP_X360_AMP] = {
7615 .type = HDA_FIXUP_FUNC,
7616 .v.func = alc245_fixup_hp_x360_amp,
7618 .chain_id = ALC245_FIXUP_HP_GPIO_LED
7620 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7621 .type = HDA_FIXUP_FUNC,
7622 .v.func = alc_fixup_headset_mode_dell_alc288,
7624 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7626 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7627 .type = HDA_FIXUP_PINS,
7628 .v.pins = (const struct hda_pintbl[]) {
7629 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7630 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7634 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7636 [ALC288_FIXUP_DISABLE_AAMIX] = {
7637 .type = HDA_FIXUP_FUNC,
7638 .v.func = alc_fixup_disable_aamix,
7640 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7642 [ALC288_FIXUP_DELL_XPS_13] = {
7643 .type = HDA_FIXUP_FUNC,
7644 .v.func = alc_fixup_dell_xps13,
7646 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7648 [ALC292_FIXUP_DISABLE_AAMIX] = {
7649 .type = HDA_FIXUP_FUNC,
7650 .v.func = alc_fixup_disable_aamix,
7652 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7654 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7655 .type = HDA_FIXUP_FUNC,
7656 .v.func = alc_fixup_disable_aamix,
7658 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7660 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7661 .type = HDA_FIXUP_FUNC,
7662 .v.func = alc_fixup_dell_xps13,
7664 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7666 [ALC292_FIXUP_DELL_E7X] = {
7667 .type = HDA_FIXUP_FUNC,
7668 .v.func = alc_fixup_micmute_led,
7669 /* micmute fixup must be applied at last */
7670 .chained_before = true,
7671 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7673 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7674 .type = HDA_FIXUP_PINS,
7675 .v.pins = (const struct hda_pintbl[]) {
7676 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7679 .chained_before = true,
7680 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7682 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7683 .type = HDA_FIXUP_PINS,
7684 .v.pins = (const struct hda_pintbl[]) {
7685 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7686 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7690 .chain_id = ALC269_FIXUP_HEADSET_MODE
7692 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7693 .type = HDA_FIXUP_PINS,
7694 .v.pins = (const struct hda_pintbl[]) {
7695 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7699 .chain_id = ALC269_FIXUP_HEADSET_MODE
7701 [ALC275_FIXUP_DELL_XPS] = {
7702 .type = HDA_FIXUP_VERBS,
7703 .v.verbs = (const struct hda_verb[]) {
7704 /* Enables internal speaker */
7705 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7706 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7707 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7708 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7712 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7713 .type = HDA_FIXUP_FUNC,
7714 .v.func = alc_fixup_disable_aamix,
7716 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7718 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7719 .type = HDA_FIXUP_FUNC,
7720 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7722 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7723 .type = HDA_FIXUP_FUNC,
7724 .v.func = alc_fixup_inv_dmic,
7726 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7728 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7729 .type = HDA_FIXUP_FUNC,
7730 .v.func = alc269_fixup_limit_int_mic_boost
7732 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7733 .type = HDA_FIXUP_FUNC,
7734 .v.func = alc_fixup_disable_aamix,
7736 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7738 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7739 .type = HDA_FIXUP_FUNC,
7740 .v.func = alc_fixup_disable_mic_vref,
7742 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7744 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7745 .type = HDA_FIXUP_VERBS,
7746 .v.verbs = (const struct hda_verb[]) {
7747 /* Disable pass-through path for FRONT 14h */
7748 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7749 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7753 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7755 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7756 .type = HDA_FIXUP_FUNC,
7757 .v.func = alc_fixup_disable_aamix,
7759 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7761 [ALC221_FIXUP_HP_FRONT_MIC] = {
7762 .type = HDA_FIXUP_PINS,
7763 .v.pins = (const struct hda_pintbl[]) {
7764 { 0x19, 0x02a19020 }, /* Front Mic */
7768 [ALC292_FIXUP_TPT460] = {
7769 .type = HDA_FIXUP_FUNC,
7770 .v.func = alc_fixup_tpt440_dock,
7772 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7774 [ALC298_FIXUP_SPK_VOLUME] = {
7775 .type = HDA_FIXUP_FUNC,
7776 .v.func = alc298_fixup_speaker_volume,
7778 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7780 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7781 .type = HDA_FIXUP_FUNC,
7782 .v.func = alc298_fixup_speaker_volume,
7784 [ALC295_FIXUP_DISABLE_DAC3] = {
7785 .type = HDA_FIXUP_FUNC,
7786 .v.func = alc295_fixup_disable_dac3,
7788 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7789 .type = HDA_FIXUP_FUNC,
7790 .v.func = alc285_fixup_speaker2_to_dac1,
7792 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7794 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7795 .type = HDA_FIXUP_PINS,
7796 .v.pins = (const struct hda_pintbl[]) {
7797 { 0x1b, 0x90170151 },
7801 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7803 [ALC269_FIXUP_ATIV_BOOK_8] = {
7804 .type = HDA_FIXUP_FUNC,
7805 .v.func = alc_fixup_auto_mute_via_amp,
7807 .chain_id = ALC269_FIXUP_NO_SHUTUP
7809 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7810 .type = HDA_FIXUP_PINS,
7811 .v.pins = (const struct hda_pintbl[]) {
7812 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7813 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7817 .chain_id = ALC269_FIXUP_HEADSET_MODE
7819 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7820 .type = HDA_FIXUP_FUNC,
7821 .v.func = alc_fixup_headset_mode,
7823 [ALC256_FIXUP_ASUS_MIC] = {
7824 .type = HDA_FIXUP_PINS,
7825 .v.pins = (const struct hda_pintbl[]) {
7826 { 0x13, 0x90a60160 }, /* use as internal mic */
7827 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7831 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7833 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7834 .type = HDA_FIXUP_FUNC,
7835 /* Set up GPIO2 for the speaker amp */
7836 .v.func = alc_fixup_gpio4,
7838 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7839 .type = HDA_FIXUP_PINS,
7840 .v.pins = (const struct hda_pintbl[]) {
7841 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7845 .chain_id = ALC269_FIXUP_HEADSET_MIC
7847 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7848 .type = HDA_FIXUP_VERBS,
7849 .v.verbs = (const struct hda_verb[]) {
7850 /* Enables internal speaker */
7851 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7852 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7856 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7858 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7859 .type = HDA_FIXUP_FUNC,
7860 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7862 .chain_id = ALC269_FIXUP_GPIO2
7864 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7865 .type = HDA_FIXUP_VERBS,
7866 .v.verbs = (const struct hda_verb[]) {
7867 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7868 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7872 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7874 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7875 .type = HDA_FIXUP_PINS,
7876 .v.pins = (const struct hda_pintbl[]) {
7877 /* Change the mic location from front to right, otherwise there are
7878 two front mics with the same name, pulseaudio can't handle them.
7879 This is just a temporary workaround, after applying this fixup,
7880 there will be one "Front Mic" and one "Mic" in this machine.
7882 { 0x1a, 0x04a19040 },
7886 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7887 .type = HDA_FIXUP_PINS,
7888 .v.pins = (const struct hda_pintbl[]) {
7889 { 0x16, 0x0101102f }, /* Rear Headset HP */
7890 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7891 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7892 { 0x1b, 0x02011020 },
7896 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7898 [ALC225_FIXUP_S3_POP_NOISE] = {
7899 .type = HDA_FIXUP_FUNC,
7900 .v.func = alc225_fixup_s3_pop_noise,
7902 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7904 [ALC700_FIXUP_INTEL_REFERENCE] = {
7905 .type = HDA_FIXUP_VERBS,
7906 .v.verbs = (const struct hda_verb[]) {
7907 /* Enables internal speaker */
7908 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7909 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7910 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7911 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7912 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7913 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7914 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7915 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7919 [ALC274_FIXUP_DELL_BIND_DACS] = {
7920 .type = HDA_FIXUP_FUNC,
7921 .v.func = alc274_fixup_bind_dacs,
7923 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7925 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7926 .type = HDA_FIXUP_PINS,
7927 .v.pins = (const struct hda_pintbl[]) {
7928 { 0x1b, 0x0401102f },
7932 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7934 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7935 .type = HDA_FIXUP_FUNC,
7936 .v.func = alc_fixup_tpt470_dock,
7938 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7940 [ALC298_FIXUP_TPT470_DOCK] = {
7941 .type = HDA_FIXUP_FUNC,
7942 .v.func = alc_fixup_tpt470_dacs,
7944 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7946 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7947 .type = HDA_FIXUP_PINS,
7948 .v.pins = (const struct hda_pintbl[]) {
7949 { 0x14, 0x0201101f },
7953 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7955 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7956 .type = HDA_FIXUP_PINS,
7957 .v.pins = (const struct hda_pintbl[]) {
7958 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7962 .chain_id = ALC269_FIXUP_HEADSET_MIC
7964 [ALC295_FIXUP_HP_X360] = {
7965 .type = HDA_FIXUP_FUNC,
7966 .v.func = alc295_fixup_hp_top_speakers,
7968 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7970 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7971 .type = HDA_FIXUP_PINS,
7972 .v.pins = (const struct hda_pintbl[]) {
7973 { 0x19, 0x0181313f},
7977 .chain_id = ALC269_FIXUP_HEADSET_MIC
7979 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7980 .type = HDA_FIXUP_FUNC,
7981 .v.func = alc285_fixup_invalidate_dacs,
7983 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7985 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7986 .type = HDA_FIXUP_FUNC,
7987 .v.func = alc_fixup_auto_mute_via_amp,
7989 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7990 .type = HDA_FIXUP_PINS,
7991 .v.pins = (const struct hda_pintbl[]) {
7992 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7996 .chain_id = ALC269_FIXUP_HEADSET_MIC
7998 [ALC294_FIXUP_ASUS_MIC] = {
7999 .type = HDA_FIXUP_PINS,
8000 .v.pins = (const struct hda_pintbl[]) {
8001 { 0x13, 0x90a60160 }, /* use as internal mic */
8002 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8006 .chain_id = ALC269_FIXUP_HEADSET_MIC
8008 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8009 .type = HDA_FIXUP_PINS,
8010 .v.pins = (const struct hda_pintbl[]) {
8011 { 0x19, 0x01a1103c }, /* use as headset mic */
8015 .chain_id = ALC269_FIXUP_HEADSET_MIC
8017 [ALC294_FIXUP_ASUS_SPK] = {
8018 .type = HDA_FIXUP_VERBS,
8019 .v.verbs = (const struct hda_verb[]) {
8021 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8022 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8023 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8024 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8028 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8030 [ALC295_FIXUP_CHROME_BOOK] = {
8031 .type = HDA_FIXUP_FUNC,
8032 .v.func = alc295_fixup_chromebook,
8034 .chain_id = ALC225_FIXUP_HEADSET_JACK
8036 [ALC225_FIXUP_HEADSET_JACK] = {
8037 .type = HDA_FIXUP_FUNC,
8038 .v.func = alc_fixup_headset_jack,
8040 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8041 .type = HDA_FIXUP_PINS,
8042 .v.pins = (const struct hda_pintbl[]) {
8043 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8047 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8049 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8050 .type = HDA_FIXUP_VERBS,
8051 .v.verbs = (const struct hda_verb[]) {
8052 /* Disable PCBEEP-IN passthrough */
8053 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8054 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8058 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8060 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8061 .type = HDA_FIXUP_PINS,
8062 .v.pins = (const struct hda_pintbl[]) {
8063 { 0x19, 0x03a11130 },
8064 { 0x1a, 0x90a60140 }, /* use as internal mic */
8068 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8070 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8071 .type = HDA_FIXUP_PINS,
8072 .v.pins = (const struct hda_pintbl[]) {
8073 { 0x16, 0x01011020 }, /* Rear Line out */
8074 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8078 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8080 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8081 .type = HDA_FIXUP_FUNC,
8082 .v.func = alc_fixup_auto_mute_via_amp,
8084 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8086 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8087 .type = HDA_FIXUP_FUNC,
8088 .v.func = alc_fixup_disable_mic_vref,
8090 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8092 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8093 .type = HDA_FIXUP_VERBS,
8094 .v.verbs = (const struct hda_verb[]) {
8095 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8096 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8100 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8102 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8103 .type = HDA_FIXUP_PINS,
8104 .v.pins = (const struct hda_pintbl[]) {
8105 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8109 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8111 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8112 .type = HDA_FIXUP_PINS,
8113 .v.pins = (const struct hda_pintbl[]) {
8114 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8118 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8120 [ALC299_FIXUP_PREDATOR_SPK] = {
8121 .type = HDA_FIXUP_PINS,
8122 .v.pins = (const struct hda_pintbl[]) {
8123 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8127 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8128 .type = HDA_FIXUP_PINS,
8129 .v.pins = (const struct hda_pintbl[]) {
8130 { 0x19, 0x04a11040 },
8131 { 0x21, 0x04211020 },
8135 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8137 [ALC289_FIXUP_DELL_SPK2] = {
8138 .type = HDA_FIXUP_PINS,
8139 .v.pins = (const struct hda_pintbl[]) {
8140 { 0x17, 0x90170130 }, /* bass spk */
8144 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8146 [ALC289_FIXUP_DUAL_SPK] = {
8147 .type = HDA_FIXUP_FUNC,
8148 .v.func = alc285_fixup_speaker2_to_dac1,
8150 .chain_id = ALC289_FIXUP_DELL_SPK2
8152 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8153 .type = HDA_FIXUP_FUNC,
8154 .v.func = alc285_fixup_speaker2_to_dac1,
8156 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8158 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
8159 .type = HDA_FIXUP_FUNC,
8160 /* The GPIO must be pulled to initialize the AMP */
8161 .v.func = alc_fixup_gpio4,
8163 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8165 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8166 .type = HDA_FIXUP_FUNC,
8167 .v.func = alc285_fixup_thinkpad_x1_gen7,
8169 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8171 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8172 .type = HDA_FIXUP_FUNC,
8173 .v.func = alc_fixup_headset_jack,
8175 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8177 [ALC294_FIXUP_ASUS_HPE] = {
8178 .type = HDA_FIXUP_VERBS,
8179 .v.verbs = (const struct hda_verb[]) {
8181 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8182 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8186 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8188 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8189 .type = HDA_FIXUP_PINS,
8190 .v.pins = (const struct hda_pintbl[]) {
8191 { 0x19, 0x03a11050 }, /* front HP mic */
8192 { 0x1a, 0x01a11830 }, /* rear external mic */
8193 { 0x21, 0x03211020 }, /* front HP out */
8197 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8199 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8200 .type = HDA_FIXUP_VERBS,
8201 .v.verbs = (const struct hda_verb[]) {
8202 /* set 0x15 to HP-OUT ctrl */
8203 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8204 /* unmute the 0x15 amp */
8205 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8209 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8211 [ALC294_FIXUP_ASUS_GX502_HP] = {
8212 .type = HDA_FIXUP_FUNC,
8213 .v.func = alc294_fixup_gx502_hp,
8215 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8216 .type = HDA_FIXUP_PINS,
8217 .v.pins = (const struct hda_pintbl[]) {
8218 { 0x19, 0x01a11050 }, /* rear HP mic */
8219 { 0x1a, 0x01a11830 }, /* rear external mic */
8220 { 0x21, 0x012110f0 }, /* rear HP out */
8224 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8226 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8227 .type = HDA_FIXUP_VERBS,
8228 .v.verbs = (const struct hda_verb[]) {
8229 /* set 0x15 to HP-OUT ctrl */
8230 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8231 /* unmute the 0x15 amp */
8232 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8233 /* set 0x1b to HP-OUT */
8234 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8238 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8240 [ALC294_FIXUP_ASUS_GU502_HP] = {
8241 .type = HDA_FIXUP_FUNC,
8242 .v.func = alc294_fixup_gu502_hp,
8244 [ALC294_FIXUP_ASUS_COEF_1B] = {
8245 .type = HDA_FIXUP_VERBS,
8246 .v.verbs = (const struct hda_verb[]) {
8247 /* Set bit 10 to correct noisy output after reboot from
8248 * Windows 10 (due to pop noise reduction?)
8250 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8251 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8255 .chain_id = ALC289_FIXUP_ASUS_GA401,
8257 [ALC285_FIXUP_HP_GPIO_LED] = {
8258 .type = HDA_FIXUP_FUNC,
8259 .v.func = alc285_fixup_hp_gpio_led,
8261 [ALC285_FIXUP_HP_MUTE_LED] = {
8262 .type = HDA_FIXUP_FUNC,
8263 .v.func = alc285_fixup_hp_mute_led,
8265 [ALC236_FIXUP_HP_GPIO_LED] = {
8266 .type = HDA_FIXUP_FUNC,
8267 .v.func = alc236_fixup_hp_gpio_led,
8269 [ALC236_FIXUP_HP_MUTE_LED] = {
8270 .type = HDA_FIXUP_FUNC,
8271 .v.func = alc236_fixup_hp_mute_led,
8273 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8274 .type = HDA_FIXUP_FUNC,
8275 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8277 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8278 .type = HDA_FIXUP_VERBS,
8279 .v.verbs = (const struct hda_verb[]) {
8280 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8284 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8285 .type = HDA_FIXUP_VERBS,
8286 .v.verbs = (const struct hda_verb[]) {
8287 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8288 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8292 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8293 .type = HDA_FIXUP_PINS,
8294 .v.pins = (const struct hda_pintbl[]) {
8295 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8299 .chain_id = ALC269_FIXUP_HEADSET_MODE
8301 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8302 .type = HDA_FIXUP_PINS,
8303 .v.pins = (const struct hda_pintbl[]) {
8304 { 0x14, 0x90100120 }, /* use as internal speaker */
8305 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8306 { 0x1a, 0x01011020 }, /* use as line out */
8310 .chain_id = ALC269_FIXUP_HEADSET_MIC
8312 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8313 .type = HDA_FIXUP_PINS,
8314 .v.pins = (const struct hda_pintbl[]) {
8315 { 0x18, 0x02a11030 }, /* use as headset mic */
8319 .chain_id = ALC269_FIXUP_HEADSET_MIC
8321 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8322 .type = HDA_FIXUP_PINS,
8323 .v.pins = (const struct hda_pintbl[]) {
8324 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8328 .chain_id = ALC269_FIXUP_HEADSET_MIC
8330 [ALC289_FIXUP_ASUS_GA401] = {
8331 .type = HDA_FIXUP_FUNC,
8332 .v.func = alc289_fixup_asus_ga401,
8334 .chain_id = ALC289_FIXUP_ASUS_GA502,
8336 [ALC289_FIXUP_ASUS_GA502] = {
8337 .type = HDA_FIXUP_PINS,
8338 .v.pins = (const struct hda_pintbl[]) {
8339 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8343 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8344 .type = HDA_FIXUP_PINS,
8345 .v.pins = (const struct hda_pintbl[]) {
8346 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8350 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8352 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8353 .type = HDA_FIXUP_FUNC,
8354 .v.func = alc285_fixup_hp_gpio_amp_init,
8356 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8358 [ALC269_FIXUP_CZC_B20] = {
8359 .type = HDA_FIXUP_PINS,
8360 .v.pins = (const struct hda_pintbl[]) {
8361 { 0x12, 0x411111f0 },
8362 { 0x14, 0x90170110 }, /* speaker */
8363 { 0x15, 0x032f1020 }, /* HP out */
8364 { 0x17, 0x411111f0 },
8365 { 0x18, 0x03ab1040 }, /* mic */
8366 { 0x19, 0xb7a7013f },
8367 { 0x1a, 0x0181305f },
8368 { 0x1b, 0x411111f0 },
8369 { 0x1d, 0x411111f0 },
8370 { 0x1e, 0x411111f0 },
8373 .chain_id = ALC269_FIXUP_DMIC,
8375 [ALC269_FIXUP_CZC_TMI] = {
8376 .type = HDA_FIXUP_PINS,
8377 .v.pins = (const struct hda_pintbl[]) {
8378 { 0x12, 0x4000c000 },
8379 { 0x14, 0x90170110 }, /* speaker */
8380 { 0x15, 0x0421401f }, /* HP out */
8381 { 0x17, 0x411111f0 },
8382 { 0x18, 0x04a19020 }, /* mic */
8383 { 0x19, 0x411111f0 },
8384 { 0x1a, 0x411111f0 },
8385 { 0x1b, 0x411111f0 },
8386 { 0x1d, 0x40448505 },
8387 { 0x1e, 0x411111f0 },
8388 { 0x20, 0x8000ffff },
8391 .chain_id = ALC269_FIXUP_DMIC,
8393 [ALC269_FIXUP_CZC_L101] = {
8394 .type = HDA_FIXUP_PINS,
8395 .v.pins = (const struct hda_pintbl[]) {
8396 { 0x12, 0x40000000 },
8397 { 0x14, 0x01014010 }, /* speaker */
8398 { 0x15, 0x411111f0 }, /* HP out */
8399 { 0x16, 0x411111f0 },
8400 { 0x18, 0x01a19020 }, /* mic */
8401 { 0x19, 0x02a19021 },
8402 { 0x1a, 0x0181302f },
8403 { 0x1b, 0x0221401f },
8404 { 0x1c, 0x411111f0 },
8405 { 0x1d, 0x4044c601 },
8406 { 0x1e, 0x411111f0 },
8409 .chain_id = ALC269_FIXUP_DMIC,
8411 [ALC269_FIXUP_LEMOTE_A1802] = {
8412 .type = HDA_FIXUP_PINS,
8413 .v.pins = (const struct hda_pintbl[]) {
8414 { 0x12, 0x40000000 },
8415 { 0x14, 0x90170110 }, /* speaker */
8416 { 0x17, 0x411111f0 },
8417 { 0x18, 0x03a19040 }, /* mic1 */
8418 { 0x19, 0x90a70130 }, /* mic2 */
8419 { 0x1a, 0x411111f0 },
8420 { 0x1b, 0x411111f0 },
8421 { 0x1d, 0x40489d2d },
8422 { 0x1e, 0x411111f0 },
8423 { 0x20, 0x0003ffff },
8424 { 0x21, 0x03214020 },
8427 .chain_id = ALC269_FIXUP_DMIC,
8429 [ALC269_FIXUP_LEMOTE_A190X] = {
8430 .type = HDA_FIXUP_PINS,
8431 .v.pins = (const struct hda_pintbl[]) {
8432 { 0x14, 0x99130110 }, /* speaker */
8433 { 0x15, 0x0121401f }, /* HP out */
8434 { 0x18, 0x01a19c20 }, /* rear mic */
8435 { 0x19, 0x99a3092f }, /* front mic */
8436 { 0x1b, 0x0201401f }, /* front lineout */
8439 .chain_id = ALC269_FIXUP_DMIC,
8441 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8442 .type = HDA_FIXUP_PINS,
8443 .v.pins = (const struct hda_pintbl[]) {
8444 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8448 .chain_id = ALC269_FIXUP_HEADSET_MODE
8450 [ALC256_FIXUP_INTEL_NUC10] = {
8451 .type = HDA_FIXUP_PINS,
8452 .v.pins = (const struct hda_pintbl[]) {
8453 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8457 .chain_id = ALC269_FIXUP_HEADSET_MODE
8459 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8460 .type = HDA_FIXUP_VERBS,
8461 .v.verbs = (const struct hda_verb[]) {
8462 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8463 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8467 .chain_id = ALC289_FIXUP_ASUS_GA502
8469 [ALC274_FIXUP_HP_MIC] = {
8470 .type = HDA_FIXUP_VERBS,
8471 .v.verbs = (const struct hda_verb[]) {
8472 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8473 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8477 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8478 .type = HDA_FIXUP_FUNC,
8479 .v.func = alc274_fixup_hp_headset_mic,
8481 .chain_id = ALC274_FIXUP_HP_MIC
8483 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8484 .type = HDA_FIXUP_FUNC,
8485 .v.func = alc274_fixup_hp_envy_gpio,
8487 [ALC256_FIXUP_ASUS_HPE] = {
8488 .type = HDA_FIXUP_VERBS,
8489 .v.verbs = (const struct hda_verb[]) {
8491 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8492 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8496 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8498 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8499 .type = HDA_FIXUP_FUNC,
8500 .v.func = alc_fixup_headset_jack,
8502 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8504 [ALC287_FIXUP_HP_GPIO_LED] = {
8505 .type = HDA_FIXUP_FUNC,
8506 .v.func = alc287_fixup_hp_gpio_led,
8508 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8509 .type = HDA_FIXUP_FUNC,
8510 .v.func = alc274_fixup_hp_headset_mic,
8512 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8513 .type = HDA_FIXUP_FUNC,
8514 .v.func = alc_fixup_no_int_mic,
8516 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8518 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8519 .type = HDA_FIXUP_PINS,
8520 .v.pins = (const struct hda_pintbl[]) {
8521 { 0x1b, 0x411111f0 },
8522 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8526 .chain_id = ALC269_FIXUP_HEADSET_MODE
8528 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8529 .type = HDA_FIXUP_FUNC,
8530 .v.func = alc269_fixup_limit_int_mic_boost,
8532 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8534 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8535 .type = HDA_FIXUP_PINS,
8536 .v.pins = (const struct hda_pintbl[]) {
8537 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8538 { 0x1a, 0x90a1092f }, /* use as internal mic */
8542 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8544 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8545 .type = HDA_FIXUP_FUNC,
8546 .v.func = alc285_fixup_ideapad_s740_coef,
8548 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8550 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8551 .type = HDA_FIXUP_FUNC,
8552 .v.func = alc269_fixup_limit_int_mic_boost,
8554 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8556 [ALC295_FIXUP_ASUS_DACS] = {
8557 .type = HDA_FIXUP_FUNC,
8558 .v.func = alc295_fixup_asus_dacs,
8560 [ALC295_FIXUP_HP_OMEN] = {
8561 .type = HDA_FIXUP_PINS,
8562 .v.pins = (const struct hda_pintbl[]) {
8563 { 0x12, 0xb7a60130 },
8564 { 0x13, 0x40000000 },
8565 { 0x14, 0x411111f0 },
8566 { 0x16, 0x411111f0 },
8567 { 0x17, 0x90170110 },
8568 { 0x18, 0x411111f0 },
8569 { 0x19, 0x02a11030 },
8570 { 0x1a, 0x411111f0 },
8571 { 0x1b, 0x04a19030 },
8572 { 0x1d, 0x40600001 },
8573 { 0x1e, 0x411111f0 },
8574 { 0x21, 0x03211020 },
8578 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8580 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8581 .type = HDA_FIXUP_FUNC,
8582 .v.func = alc285_fixup_hp_spectre_x360,
8584 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8585 .type = HDA_FIXUP_FUNC,
8586 .v.func = alc285_fixup_hp_spectre_x360_eb1
8588 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8589 .type = HDA_FIXUP_FUNC,
8590 .v.func = alc285_fixup_ideapad_s740_coef,
8592 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8594 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8595 .type = HDA_FIXUP_FUNC,
8596 .v.func = alc_fixup_no_shutup,
8598 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8600 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8601 .type = HDA_FIXUP_PINS,
8602 .v.pins = (const struct hda_pintbl[]) {
8603 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8607 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8609 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8610 .type = HDA_FIXUP_FUNC,
8611 .v.func = alc269_fixup_limit_int_mic_boost,
8613 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8615 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8616 .type = HDA_FIXUP_FUNC,
8617 .v.func = alc285_fixup_ideapad_s740_coef,
8619 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8621 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8622 .type = HDA_FIXUP_FUNC,
8623 .v.func = alc287_fixup_legion_15imhg05_speakers,
8625 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8627 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8628 .type = HDA_FIXUP_VERBS,
8629 //.v.verbs = legion_15imhg05_coefs,
8630 .v.verbs = (const struct hda_verb[]) {
8631 // set left speaker Legion 7i.
8632 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8633 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8635 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8636 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8637 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8638 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8639 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8641 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8642 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8643 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8644 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8645 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8647 // set right speaker Legion 7i.
8648 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8649 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8651 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8652 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8653 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8654 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8655 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8657 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8658 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8659 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8660 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8661 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8665 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8667 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8668 .type = HDA_FIXUP_FUNC,
8669 .v.func = alc287_fixup_legion_15imhg05_speakers,
8671 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8673 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8674 .type = HDA_FIXUP_VERBS,
8675 .v.verbs = (const struct hda_verb[]) {
8676 // set left speaker Yoga 7i.
8677 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8678 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8680 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8681 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8682 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8683 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8684 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8686 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8687 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8688 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8689 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8690 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8692 // set right speaker Yoga 7i.
8693 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8694 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8696 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8697 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8698 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8699 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8700 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8702 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8703 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8704 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8705 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8706 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8710 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8712 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8713 .type = HDA_FIXUP_VERBS,
8714 .v.verbs = (const struct hda_verb[]) {
8715 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8716 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8717 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8718 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8719 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8720 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8721 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8722 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8723 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8724 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8725 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8726 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8727 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8728 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8732 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8734 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
8735 .type = HDA_FIXUP_FUNC,
8736 .v.func = alc256_fixup_set_coef_defaults,
8738 [ALC245_FIXUP_HP_GPIO_LED] = {
8739 .type = HDA_FIXUP_FUNC,
8740 .v.func = alc245_fixup_hp_gpio_led,
8742 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8743 .type = HDA_FIXUP_PINS,
8744 .v.pins = (const struct hda_pintbl[]) {
8745 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8749 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8751 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8752 .type = HDA_FIXUP_FUNC,
8753 .v.func = alc233_fixup_no_audio_jack,
8755 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8756 .type = HDA_FIXUP_FUNC,
8757 .v.func = alc256_fixup_mic_no_presence_and_resume,
8759 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8761 [ALC287_FIXUP_LEGION_16ACHG6] = {
8762 .type = HDA_FIXUP_FUNC,
8763 .v.func = alc287_fixup_legion_16achg6_speakers,
8765 [ALC287_FIXUP_CS35L41_I2C_2] = {
8766 .type = HDA_FIXUP_FUNC,
8767 .v.func = cs35l41_fixup_i2c_two,
8769 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8771 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = {
8772 .type = HDA_FIXUP_FUNC,
8773 .v.func = cs35l41_fixup_i2c_two,
8775 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8777 [ALC245_FIXUP_CS35L41_SPI_2] = {
8778 .type = HDA_FIXUP_FUNC,
8779 .v.func = cs35l41_fixup_spi_two,
8781 [ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED] = {
8782 .type = HDA_FIXUP_FUNC,
8783 .v.func = cs35l41_fixup_spi_two,
8785 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
8787 [ALC245_FIXUP_CS35L41_SPI_4] = {
8788 .type = HDA_FIXUP_FUNC,
8789 .v.func = cs35l41_fixup_spi_four,
8791 [ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED] = {
8792 .type = HDA_FIXUP_FUNC,
8793 .v.func = cs35l41_fixup_spi_four,
8795 .chain_id = ALC285_FIXUP_HP_GPIO_LED,
8797 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
8798 .type = HDA_FIXUP_VERBS,
8799 .v.verbs = (const struct hda_verb[]) {
8800 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
8801 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
8805 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8807 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = {
8808 .type = HDA_FIXUP_FUNC,
8809 .v.func = alc_fixup_dell4_mic_no_presence_quiet,
8811 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8813 [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = {
8814 .type = HDA_FIXUP_PINS,
8815 .v.pins = (const struct hda_pintbl[]) {
8816 { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */
8820 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8824 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8825 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8826 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8827 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8828 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8829 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8830 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8831 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8832 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8833 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8834 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8835 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8836 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8837 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8838 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8839 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8840 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8841 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8842 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8843 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8844 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8845 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8846 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8847 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8848 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8849 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8850 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8851 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8852 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8853 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8854 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8855 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8856 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8857 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8858 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8859 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8860 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8861 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8862 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8863 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8864 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8865 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8866 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8867 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8868 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8869 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8870 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8871 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8872 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8873 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8874 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8875 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8876 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8877 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8878 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8879 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8880 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8881 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8882 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8883 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8884 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8885 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8886 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8887 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8888 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8889 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8890 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8891 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8892 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8893 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8894 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8895 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8896 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8897 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8898 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8899 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8900 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8901 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8902 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8903 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8904 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8905 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8906 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8907 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8908 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8909 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8910 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8911 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8912 SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET),
8913 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8914 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8915 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
8916 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8917 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8918 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
8919 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8920 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8921 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8922 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8923 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8924 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8925 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8926 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8927 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8928 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8929 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8930 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8931 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8932 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8933 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8934 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8935 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8936 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8937 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8938 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8939 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8940 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8941 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8942 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8943 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8944 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8945 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8946 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8947 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8948 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8949 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8950 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8951 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8952 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8953 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8954 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8955 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8956 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8957 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8958 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8959 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8960 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8961 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8962 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8963 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8964 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8965 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8966 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8967 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8968 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8969 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8970 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8971 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8972 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8973 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8974 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8975 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8976 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8977 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8978 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8979 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8980 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8981 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8982 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8983 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8984 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8985 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8986 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8987 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8988 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8989 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8990 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8991 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8992 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8993 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8994 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8995 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8996 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8997 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
8998 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8999 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9000 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
9001 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
9002 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
9003 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9004 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9005 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9006 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
9007 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
9008 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9009 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9010 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9011 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9012 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9013 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9014 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
9015 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9016 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9017 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9018 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9019 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9020 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
9021 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9022 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9023 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9024 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9025 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9026 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9027 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9028 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9029 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9030 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9031 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9032 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9033 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9034 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9035 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9036 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
9037 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
9038 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
9039 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9040 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
9041 SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9042 SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9043 SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9044 SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9045 SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9046 SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9047 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4),
9048 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9049 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2),
9050 SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9051 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2),
9052 SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED),
9053 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2),
9054 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED),
9055 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED),
9056 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
9057 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED),
9058 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED),
9059 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
9060 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
9061 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9062 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9063 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9064 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9065 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
9066 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9067 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9068 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9069 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9070 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9071 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9072 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9073 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9074 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
9075 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
9076 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
9077 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
9078 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
9079 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
9080 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
9081 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
9082 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9083 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
9084 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
9085 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
9086 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
9087 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
9088 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
9089 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
9090 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
9091 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
9092 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
9093 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
9094 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
9095 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9096 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9097 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
9098 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
9099 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
9100 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
9101 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
9102 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
9103 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
9104 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9105 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
9106 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9107 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9108 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9109 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9110 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
9111 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9112 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9113 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9114 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
9115 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9116 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9117 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
9118 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
9119 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9120 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
9121 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9122 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
9123 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
9124 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
9125 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9126 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9127 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9128 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
9129 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
9130 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9131 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9132 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9133 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9134 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
9135 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9136 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9137 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9138 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9139 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
9140 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
9141 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
9142 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9143 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9144 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9145 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9146 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9147 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9148 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9149 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9150 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9151 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9152 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9153 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9154 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9155 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9156 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9157 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9158 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9159 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9160 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9161 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9162 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9163 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9164 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9165 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9166 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9167 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9168 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9169 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9170 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9171 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9172 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9173 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9174 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9175 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9176 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9177 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9178 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9179 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9180 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9181 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9182 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9183 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9184 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9185 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9186 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
9187 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9188 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9189 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9190 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9191 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9192 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
9193 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9194 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9195 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9196 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9197 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9198 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9199 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9200 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9201 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9202 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9203 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9204 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9205 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9206 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9207 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9208 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
9209 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9210 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9211 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9212 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9213 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9214 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
9215 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
9216 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
9217 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
9218 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
9219 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
9220 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9221 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
9222 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
9223 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
9224 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
9225 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
9226 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
9227 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9228 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
9229 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
9230 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
9231 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9232 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9233 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
9234 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
9235 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9236 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9237 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9238 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
9239 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9240 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9241 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9242 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9243 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9244 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9245 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9246 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9247 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9248 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9249 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9250 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9251 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9252 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9253 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9254 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9255 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9256 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9257 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9258 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9259 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9260 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9261 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9262 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
9263 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
9264 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9265 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9266 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
9267 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9268 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9269 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
9270 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
9271 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9272 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9273 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9274 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9275 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
9276 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9277 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
9278 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9279 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
9280 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
9281 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9282 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
9283 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
9284 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
9285 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
9286 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
9287 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9288 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
9289 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
9290 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9291 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9292 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9293 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9294 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9295 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9296 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9297 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
9298 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
9299 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
9300 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9301 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9302 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
9303 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
9304 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9305 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
9306 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
9307 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9308 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9309 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9310 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9311 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9312 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9313 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9314 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
9315 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9316 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
9317 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9318 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9319 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
9320 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
9321 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9322 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),
9325 /* Below is a quirk table taken from the old code.
9326 * Basically the device should work as is without the fixup table.
9327 * If BIOS doesn't give a proper info, enable the corresponding
9330 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9332 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9333 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9334 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9335 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9336 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9337 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9338 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9339 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9340 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9341 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9342 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9343 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9344 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9345 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9346 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9347 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9348 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9349 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9350 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9351 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9352 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9353 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9354 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9355 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9356 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9357 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9358 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9359 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9360 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9361 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9362 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9363 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9364 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9365 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9366 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9367 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9368 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9369 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9370 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9375 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9376 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9377 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9378 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9379 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9380 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9384 static const struct hda_model_fixup alc269_fixup_models[] = {
9385 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9386 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9387 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9388 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9389 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9390 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9391 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9392 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9393 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9394 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9395 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9396 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9397 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9398 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9399 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9400 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9401 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9402 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9403 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9404 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9405 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9406 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9407 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9408 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9409 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9410 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9411 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9412 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9413 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9414 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9415 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9416 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9417 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9418 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9419 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9420 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9421 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9422 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9423 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9424 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9425 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9426 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9427 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9428 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9429 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9430 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9431 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9432 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9433 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9434 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9435 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9436 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9437 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9438 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9439 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9440 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9441 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9442 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9443 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9444 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9445 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9446 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9447 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9448 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9449 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
9450 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
9451 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
9452 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
9453 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9454 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9455 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9456 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9457 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9458 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9459 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9460 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9461 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9462 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9463 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9464 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9465 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9466 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
9467 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9468 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9469 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
9470 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
9471 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
9472 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
9473 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9474 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9475 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9476 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9477 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9478 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9479 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9480 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9481 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9482 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9483 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9484 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9485 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9486 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9487 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9488 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9489 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
9490 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9491 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
9492 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
9493 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
9494 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
9495 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
9496 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
9497 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
9498 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
9499 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
9500 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
9501 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
9502 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9503 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
9504 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
9505 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9506 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
9509 #define ALC225_STANDARD_PINS \
9512 #define ALC256_STANDARD_PINS \
9513 {0x12, 0x90a60140}, \
9514 {0x14, 0x90170110}, \
9517 #define ALC282_STANDARD_PINS \
9520 #define ALC290_STANDARD_PINS \
9523 #define ALC292_STANDARD_PINS \
9524 {0x14, 0x90170110}, \
9527 #define ALC295_STANDARD_PINS \
9528 {0x12, 0xb7a60130}, \
9529 {0x14, 0x90170110}, \
9532 #define ALC298_STANDARD_PINS \
9533 {0x12, 0x90a60130}, \
9536 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
9537 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9542 {0x21, 0x0221102f}),
9543 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9546 {0x21, 0x02211030}),
9547 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9550 {0x21, 0x03211020}),
9551 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9554 {0x21, 0x03211020}),
9555 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9556 ALC225_STANDARD_PINS,
9558 {0x14, 0x901701a0}),
9559 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9560 ALC225_STANDARD_PINS,
9562 {0x14, 0x901701b0}),
9563 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9564 ALC225_STANDARD_PINS,
9566 {0x14, 0x901701a0}),
9567 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9568 ALC225_STANDARD_PINS,
9570 {0x14, 0x901701b0}),
9571 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9572 ALC225_STANDARD_PINS,
9574 {0x1b, 0x90170110}),
9575 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9578 {0x21, 0x02211020}),
9579 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9583 {0x21, 0x02211020}),
9584 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9589 {0x21, 0x0221101f}),
9590 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9595 {0x21, 0x0221101f}),
9596 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9600 {0x21, 0x0221101f}),
9601 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9602 {0x21, 0x02211010}),
9603 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9606 {0x21, 0x02211030}),
9607 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9609 {0x21, 0x02211020}),
9610 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9612 {0x21, 0x02211040}),
9613 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9616 {0x21, 0x02211020}),
9617 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9620 {0x21, 0x02211030}),
9621 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9624 {0x21, 0x0221101f}),
9625 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9628 {0x21, 0x0221101f}),
9629 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9632 {0x21, 0x0221103f}),
9633 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9636 {0x21, 0x0221103f}),
9637 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9640 {0x21, 0x0221103f}),
9641 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9644 {0x21, 0x0221105f}),
9645 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9648 {0x21, 0x0221101f}),
9649 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9653 {0x21, 0x0321102f}),
9654 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9657 {0x21, 0x02211040}),
9658 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9661 {0x21, 0x02211050}),
9662 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9665 {0x21, 0x02211030}),
9666 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9669 {0x21, 0x02211040}),
9670 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9673 {0x21, 0x02211040}),
9674 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9677 {0x21, 0x02211050}),
9678 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9681 {0x21, 0x02211040}),
9682 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9685 {0x21, 0x02211030}),
9686 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9688 {0x21, 0x02211010}),
9689 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9692 {0x21, 0x04211020}),
9693 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9696 {0x21, 0x03211020}),
9697 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9700 {0x21, 0x03211020}),
9701 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9704 {0x21, 0x04211020}),
9705 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9708 {0x21, 0x03211020}),
9709 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9712 {0x21, 0x0221101f}),
9713 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9716 {0x21, 0x03211020}),
9717 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9721 {0x1a, 0x04a11020}),
9722 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9728 {0x1b, 0x02011020}),
9729 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9730 ALC282_STANDARD_PINS,
9733 {0x21, 0x0321101f}),
9734 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9735 ALC282_STANDARD_PINS,
9738 {0x21, 0x03211040}),
9739 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9740 ALC282_STANDARD_PINS,
9743 {0x21, 0x03211020}),
9744 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9745 ALC282_STANDARD_PINS,
9748 {0x21, 0x0421101f}),
9749 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9750 ALC282_STANDARD_PINS,
9753 {0x21, 0x04211020}),
9754 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9755 ALC282_STANDARD_PINS,
9761 {0x21, 0x0321101f}),
9762 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9763 ALC282_STANDARD_PINS,
9769 {0x21, 0x0321101f}),
9770 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9771 ALC282_STANDARD_PINS,
9773 {0x21, 0x0321101f}),
9774 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9777 {0x21, 0x02211030}),
9778 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9779 ALC282_STANDARD_PINS,
9782 {0x21, 0x0321101f}),
9783 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9787 {0x21, 0x04211020}),
9788 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9792 {0x21, 0x04211020}),
9793 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9796 {0x21, 0x04211020}),
9797 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9801 {0x21, 0x03211020}),
9802 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9805 {0x21, 0x02211020}),
9806 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9809 {0x21, 0x0321101f}),
9810 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9811 ALC290_STANDARD_PINS,
9814 {0x1a, 0x04a11020}),
9815 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9816 ALC290_STANDARD_PINS,
9819 {0x1a, 0x04a11020}),
9820 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9821 ALC290_STANDARD_PINS,
9823 {0x1a, 0x04a11020}),
9824 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9825 ALC290_STANDARD_PINS,
9827 {0x1a, 0x04a11040}),
9828 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9829 ALC290_STANDARD_PINS,
9832 {0x1a, 0x04a11040}),
9833 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9834 ALC290_STANDARD_PINS,
9837 {0x1a, 0x04a11020}),
9838 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9839 ALC290_STANDARD_PINS,
9842 {0x1a, 0x04a11020}),
9843 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9844 ALC292_STANDARD_PINS,
9847 {0x19, 0x01a19030}),
9848 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9849 ALC292_STANDARD_PINS,
9853 {0x19, 0x01a1903e}),
9854 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9855 ALC292_STANDARD_PINS,
9856 {0x12, 0x90a60140}),
9857 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9858 ALC292_STANDARD_PINS,
9861 {0x19, 0x21a19030}),
9862 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9863 ALC292_STANDARD_PINS,
9864 {0x13, 0x90a60140}),
9865 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9867 {0x21, 0x04211020}),
9868 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9871 {0x21, 0x04211020}),
9872 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9875 {0x21, 0x03211020}),
9876 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9879 {0x21, 0x04211020}),
9880 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9883 {0x21, 0x03211020}),
9884 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9887 {0x21, 0x04211030}),
9888 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9891 {0x21, 0x03211020}),
9892 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9895 {0x21, 0x03211020}),
9896 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9898 {0x21, 0x04211020}),
9899 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9901 {0x21, 0x04211030}),
9902 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9903 ALC295_STANDARD_PINS,
9905 {0x18, 0x21a19030}),
9906 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9907 ALC295_STANDARD_PINS,
9909 {0x18, 0x21a19050}),
9910 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9911 ALC295_STANDARD_PINS),
9912 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9913 ALC298_STANDARD_PINS,
9914 {0x17, 0x90170110}),
9915 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9916 ALC298_STANDARD_PINS,
9917 {0x17, 0x90170140}),
9918 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9919 ALC298_STANDARD_PINS,
9920 {0x17, 0x90170150}),
9921 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9926 {0x21, 0x03211030}),
9927 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9931 {0x21, 0x03211020}),
9932 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9933 ALC225_STANDARD_PINS,
9935 {0x17, 0x90170110}),
9936 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9941 {0x21, 0x0221101f}),
9945 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9946 * more machines, don't need to match all valid pins, just need to match
9947 * all the pins defined in the tbl. Just because of this reason, it is possible
9948 * that a single machine matches multiple tbls, so there is one limitation:
9949 * at most one tbl is allowed to define for the same vendor and same codec
9951 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9952 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9954 {0x1b, 0x40000000}),
9955 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9957 {0x1a, 0x40000000}),
9958 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9960 {0x1a, 0x40000000}),
9961 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9963 {0x1a, 0x40000000}),
9967 static void alc269_fill_coef(struct hda_codec *codec)
9969 struct alc_spec *spec = codec->spec;
9972 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9975 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9976 alc_write_coef_idx(codec, 0xf, 0x960b);
9977 alc_write_coef_idx(codec, 0xe, 0x8817);
9980 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9981 alc_write_coef_idx(codec, 0xf, 0x960b);
9982 alc_write_coef_idx(codec, 0xe, 0x8814);
9985 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9986 /* Power up output pin */
9987 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9990 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9991 val = alc_read_coef_idx(codec, 0xd);
9992 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9993 /* Capless ramp up clock control */
9994 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9996 val = alc_read_coef_idx(codec, 0x17);
9997 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9998 /* Class D power on reset */
9999 alc_write_coef_idx(codec, 0x17, val | (1<<7));
10004 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
10009 static int patch_alc269(struct hda_codec *codec)
10011 struct alc_spec *spec;
10014 err = alc_alloc_spec(codec, 0x0b);
10018 spec = codec->spec;
10019 spec->gen.shared_mic_vref_pin = 0x18;
10020 codec->power_save_node = 0;
10023 codec->patch_ops.suspend = alc269_suspend;
10024 codec->patch_ops.resume = alc269_resume;
10026 spec->shutup = alc_default_shutup;
10027 spec->init_hook = alc_default_init;
10029 switch (codec->core.vendor_id) {
10031 spec->codec_variant = ALC269_TYPE_ALC269VA;
10032 switch (alc_get_coef0(codec) & 0x00f0) {
10034 if (codec->bus->pci &&
10035 codec->bus->pci->subsystem_vendor == 0x1025 &&
10036 spec->cdefine.platform_type == 1)
10037 err = alc_codec_rename(codec, "ALC271X");
10038 spec->codec_variant = ALC269_TYPE_ALC269VB;
10041 if (codec->bus->pci &&
10042 codec->bus->pci->subsystem_vendor == 0x17aa &&
10043 codec->bus->pci->subsystem_device == 0x21f3)
10044 err = alc_codec_rename(codec, "ALC3202");
10045 spec->codec_variant = ALC269_TYPE_ALC269VC;
10048 spec->codec_variant = ALC269_TYPE_ALC269VD;
10051 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10055 spec->shutup = alc269_shutup;
10056 spec->init_hook = alc269_fill_coef;
10057 alc269_fill_coef(codec);
10062 spec->codec_variant = ALC269_TYPE_ALC280;
10065 spec->codec_variant = ALC269_TYPE_ALC282;
10066 spec->shutup = alc282_shutup;
10067 spec->init_hook = alc282_init;
10071 spec->codec_variant = ALC269_TYPE_ALC283;
10072 spec->shutup = alc283_shutup;
10073 spec->init_hook = alc283_init;
10077 spec->codec_variant = ALC269_TYPE_ALC284;
10080 spec->codec_variant = ALC269_TYPE_ALC293;
10084 spec->codec_variant = ALC269_TYPE_ALC286;
10087 spec->codec_variant = ALC269_TYPE_ALC298;
10091 spec->codec_variant = ALC269_TYPE_ALC255;
10092 spec->shutup = alc256_shutup;
10093 spec->init_hook = alc256_init;
10098 spec->codec_variant = ALC269_TYPE_ALC256;
10099 spec->shutup = alc256_shutup;
10100 spec->init_hook = alc256_init;
10101 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
10104 spec->codec_variant = ALC269_TYPE_ALC257;
10105 spec->shutup = alc256_shutup;
10106 spec->init_hook = alc256_init;
10107 spec->gen.mixer_nid = 0;
10113 if (alc_get_coef0(codec) & 0x0010)
10114 spec->codec_variant = ALC269_TYPE_ALC245;
10116 spec->codec_variant = ALC269_TYPE_ALC215;
10117 spec->shutup = alc225_shutup;
10118 spec->init_hook = alc225_init;
10119 spec->gen.mixer_nid = 0;
10124 spec->codec_variant = ALC269_TYPE_ALC225;
10125 spec->shutup = alc225_shutup;
10126 spec->init_hook = alc225_init;
10127 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
10130 spec->codec_variant = ALC269_TYPE_ALC287;
10131 spec->shutup = alc225_shutup;
10132 spec->init_hook = alc225_init;
10133 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10138 spec->codec_variant = ALC269_TYPE_ALC294;
10139 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
10140 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
10141 spec->init_hook = alc294_init;
10144 spec->codec_variant = ALC269_TYPE_ALC300;
10145 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
10148 spec->codec_variant = ALC269_TYPE_ALC623;
10154 spec->codec_variant = ALC269_TYPE_ALC700;
10155 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
10156 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
10157 spec->init_hook = alc294_init;
10162 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
10163 spec->has_alc5505_dsp = 1;
10164 spec->init_hook = alc5505_dsp_init;
10167 alc_pre_init(codec);
10169 snd_hda_pick_fixup(codec, alc269_fixup_models,
10170 alc269_fixup_tbl, alc269_fixups);
10171 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10172 * the quirk breaks the latter (bko#214101).
10173 * Clear the wrong entry.
10175 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10176 codec->core.vendor_id == 0x10ec0294) {
10177 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10178 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10181 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
10182 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
10183 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10185 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10187 alc_auto_parse_customize_define(codec);
10189 if (has_cdefine_beep(codec))
10190 spec->gen.beep_nid = 0x01;
10192 /* automatic parse from the BIOS config */
10193 err = alc269_parse_auto_config(codec);
10197 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10198 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10203 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10216 static int alc861_parse_auto_config(struct hda_codec *codec)
10218 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
10219 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10220 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
10223 /* Pin config fixes */
10225 ALC861_FIXUP_FSC_AMILO_PI1505,
10226 ALC861_FIXUP_AMP_VREF_0F,
10227 ALC861_FIXUP_NO_JACK_DETECT,
10228 ALC861_FIXUP_ASUS_A6RP,
10229 ALC660_FIXUP_ASUS_W7J,
10232 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10233 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
10234 const struct hda_fixup *fix, int action)
10236 struct alc_spec *spec = codec->spec;
10239 if (action != HDA_FIXUP_ACT_INIT)
10241 val = snd_hda_codec_get_pin_target(codec, 0x0f);
10242 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10243 val |= AC_PINCTL_IN_EN;
10244 val |= AC_PINCTL_VREF_50;
10245 snd_hda_set_pin_ctl(codec, 0x0f, val);
10246 spec->gen.keep_vref_in_automute = 1;
10249 /* suppress the jack-detection */
10250 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
10251 const struct hda_fixup *fix, int action)
10253 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10254 codec->no_jack_detect = 1;
10257 static const struct hda_fixup alc861_fixups[] = {
10258 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
10259 .type = HDA_FIXUP_PINS,
10260 .v.pins = (const struct hda_pintbl[]) {
10261 { 0x0b, 0x0221101f }, /* HP */
10262 { 0x0f, 0x90170310 }, /* speaker */
10266 [ALC861_FIXUP_AMP_VREF_0F] = {
10267 .type = HDA_FIXUP_FUNC,
10268 .v.func = alc861_fixup_asus_amp_vref_0f,
10270 [ALC861_FIXUP_NO_JACK_DETECT] = {
10271 .type = HDA_FIXUP_FUNC,
10272 .v.func = alc_fixup_no_jack_detect,
10274 [ALC861_FIXUP_ASUS_A6RP] = {
10275 .type = HDA_FIXUP_FUNC,
10276 .v.func = alc861_fixup_asus_amp_vref_0f,
10278 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
10280 [ALC660_FIXUP_ASUS_W7J] = {
10281 .type = HDA_FIXUP_VERBS,
10282 .v.verbs = (const struct hda_verb[]) {
10283 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10284 * for enabling outputs
10286 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10292 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
10293 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
10294 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
10295 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10296 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10297 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
10298 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
10299 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
10305 static int patch_alc861(struct hda_codec *codec)
10307 struct alc_spec *spec;
10310 err = alc_alloc_spec(codec, 0x15);
10314 spec = codec->spec;
10315 if (has_cdefine_beep(codec))
10316 spec->gen.beep_nid = 0x23;
10319 spec->power_hook = alc_power_eapd;
10322 alc_pre_init(codec);
10324 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10325 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10327 /* automatic parse from the BIOS config */
10328 err = alc861_parse_auto_config(codec);
10332 if (!spec->gen.no_analog) {
10333 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10338 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10348 * ALC861-VD support
10352 * In addition, an independent DAC
10354 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10356 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10357 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10358 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10362 ALC660VD_FIX_ASUS_GPIO1,
10363 ALC861VD_FIX_DALLAS,
10366 /* exclude VREF80 */
10367 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10368 const struct hda_fixup *fix, int action)
10370 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10371 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10372 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10377 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10378 const struct hda_fixup *fix, int action)
10380 struct alc_spec *spec = codec->spec;
10382 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10383 spec->gpio_mask |= 0x02;
10384 alc_fixup_gpio(codec, action, 0x01);
10387 static const struct hda_fixup alc861vd_fixups[] = {
10388 [ALC660VD_FIX_ASUS_GPIO1] = {
10389 .type = HDA_FIXUP_FUNC,
10390 .v.func = alc660vd_fixup_asus_gpio1,
10392 [ALC861VD_FIX_DALLAS] = {
10393 .type = HDA_FIXUP_FUNC,
10394 .v.func = alc861vd_fixup_dallas,
10398 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10399 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10400 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10401 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10407 static int patch_alc861vd(struct hda_codec *codec)
10409 struct alc_spec *spec;
10412 err = alc_alloc_spec(codec, 0x0b);
10416 spec = codec->spec;
10417 if (has_cdefine_beep(codec))
10418 spec->gen.beep_nid = 0x23;
10420 spec->shutup = alc_eapd_shutup;
10422 alc_pre_init(codec);
10424 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10425 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10427 /* automatic parse from the BIOS config */
10428 err = alc861vd_parse_auto_config(codec);
10432 if (!spec->gen.no_analog) {
10433 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10438 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10450 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10451 * configuration. Each pin widget can choose any input DACs and a mixer.
10452 * Each ADC is connected from a mixer of all inputs. This makes possible
10453 * 6-channel independent captures.
10455 * In addition, an independent DAC for the multi-playback (not used in this
10460 * BIOS auto configuration
10463 static int alc662_parse_auto_config(struct hda_codec *codec)
10465 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
10466 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10467 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10468 const hda_nid_t *ssids;
10470 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10471 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10472 codec->core.vendor_id == 0x10ec0671)
10473 ssids = alc663_ssids;
10475 ssids = alc662_ssids;
10476 return alc_parse_auto_config(codec, alc662_ignore, ssids);
10479 static void alc272_fixup_mario(struct hda_codec *codec,
10480 const struct hda_fixup *fix, int action)
10482 if (action != HDA_FIXUP_ACT_PRE_PROBE)
10484 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10485 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10486 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10487 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10488 (0 << AC_AMPCAP_MUTE_SHIFT)))
10489 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
10492 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10494 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10496 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10497 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10501 /* override the 2.1 chmap */
10502 static void alc_fixup_bass_chmap(struct hda_codec *codec,
10503 const struct hda_fixup *fix, int action)
10505 if (action == HDA_FIXUP_ACT_BUILD) {
10506 struct alc_spec *spec = codec->spec;
10507 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
10511 /* avoid D3 for keeping GPIO up */
10512 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10514 unsigned int power_state)
10516 struct alc_spec *spec = codec->spec;
10517 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
10518 return AC_PWRST_D0;
10519 return power_state;
10522 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10523 const struct hda_fixup *fix, int action)
10525 struct alc_spec *spec = codec->spec;
10527 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
10528 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10529 spec->mute_led_polarity = 1;
10530 codec->power_filter = gpio_led_power_filter;
10534 static void alc662_usi_automute_hook(struct hda_codec *codec,
10535 struct hda_jack_callback *jack)
10537 struct alc_spec *spec = codec->spec;
10540 snd_hda_gen_hp_automute(codec, jack);
10542 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10544 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10548 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10549 const struct hda_fixup *fix, int action)
10551 struct alc_spec *spec = codec->spec;
10552 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10553 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10554 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10558 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10559 struct hda_jack_callback *cb)
10561 /* surround speakers at 0x1b already get muted automatically when
10562 * headphones are plugged in, but we have to mute/unmute the remaining
10563 * channels manually:
10564 * 0x15 - front left/front right
10565 * 0x18 - front center/ LFE
10567 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10568 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10569 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10571 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10572 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10576 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10577 const struct hda_fixup *fix, int action)
10579 /* Pin 0x1b: shared headphones jack and surround speakers */
10580 if (!is_jack_detectable(codec, 0x1b))
10584 case HDA_FIXUP_ACT_PRE_PROBE:
10585 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10586 alc662_aspire_ethos_mute_speakers);
10587 /* subwoofer needs an extra GPIO setting to become audible */
10588 alc_setup_gpio(codec, 0x02);
10590 case HDA_FIXUP_ACT_INIT:
10591 /* Make sure to start in a correct state, i.e. if
10592 * headphones have been plugged in before powering up the system
10594 alc662_aspire_ethos_mute_speakers(codec, NULL);
10599 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10600 const struct hda_fixup *fix, int action)
10602 struct alc_spec *spec = codec->spec;
10604 static const struct hda_pintbl pincfgs[] = {
10605 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10606 { 0x1b, 0x0181304f },
10611 case HDA_FIXUP_ACT_PRE_PROBE:
10612 spec->gen.mixer_nid = 0;
10613 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10614 snd_hda_apply_pincfgs(codec, pincfgs);
10616 case HDA_FIXUP_ACT_INIT:
10617 alc_write_coef_idx(codec, 0x19, 0xa054);
10622 static void alc897_hp_automute_hook(struct hda_codec *codec,
10623 struct hda_jack_callback *jack)
10625 struct alc_spec *spec = codec->spec;
10628 snd_hda_gen_hp_automute(codec, jack);
10629 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10630 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10634 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10635 const struct hda_fixup *fix, int action)
10637 struct alc_spec *spec = codec->spec;
10638 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10639 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10643 static const struct coef_fw alc668_coefs[] = {
10644 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10645 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10646 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10647 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10648 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10649 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10650 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10651 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10652 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10653 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10654 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10655 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10656 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10657 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10658 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10659 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10660 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10661 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10662 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10663 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10667 static void alc668_restore_default_value(struct hda_codec *codec)
10669 alc_process_coef_fw(codec, alc668_coefs);
10673 ALC662_FIXUP_ASPIRE,
10674 ALC662_FIXUP_LED_GPIO1,
10675 ALC662_FIXUP_IDEAPAD,
10676 ALC272_FIXUP_MARIO,
10677 ALC662_FIXUP_CZC_ET26,
10678 ALC662_FIXUP_CZC_P10T,
10679 ALC662_FIXUP_SKU_IGNORE,
10680 ALC662_FIXUP_HP_RP5800,
10681 ALC662_FIXUP_ASUS_MODE1,
10682 ALC662_FIXUP_ASUS_MODE2,
10683 ALC662_FIXUP_ASUS_MODE3,
10684 ALC662_FIXUP_ASUS_MODE4,
10685 ALC662_FIXUP_ASUS_MODE5,
10686 ALC662_FIXUP_ASUS_MODE6,
10687 ALC662_FIXUP_ASUS_MODE7,
10688 ALC662_FIXUP_ASUS_MODE8,
10689 ALC662_FIXUP_NO_JACK_DETECT,
10690 ALC662_FIXUP_ZOTAC_Z68,
10691 ALC662_FIXUP_INV_DMIC,
10692 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10693 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10694 ALC662_FIXUP_HEADSET_MODE,
10695 ALC668_FIXUP_HEADSET_MODE,
10696 ALC662_FIXUP_BASS_MODE4_CHMAP,
10697 ALC662_FIXUP_BASS_16,
10698 ALC662_FIXUP_BASS_1A,
10699 ALC662_FIXUP_BASS_CHMAP,
10700 ALC668_FIXUP_AUTO_MUTE,
10701 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10702 ALC668_FIXUP_DELL_XPS13,
10703 ALC662_FIXUP_ASUS_Nx50,
10704 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10705 ALC668_FIXUP_ASUS_Nx51,
10706 ALC668_FIXUP_MIC_COEF,
10707 ALC668_FIXUP_ASUS_G751,
10708 ALC891_FIXUP_HEADSET_MODE,
10709 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10710 ALC662_FIXUP_ACER_VERITON,
10711 ALC892_FIXUP_ASROCK_MOBO,
10712 ALC662_FIXUP_USI_FUNC,
10713 ALC662_FIXUP_USI_HEADSET_MODE,
10714 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10715 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10716 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10717 ALC671_FIXUP_HP_HEADSET_MIC2,
10718 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10719 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10720 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10721 ALC668_FIXUP_HEADSET_MIC,
10722 ALC668_FIXUP_MIC_DET_COEF,
10723 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10724 ALC897_FIXUP_HEADSET_MIC_PIN,
10727 static const struct hda_fixup alc662_fixups[] = {
10728 [ALC662_FIXUP_ASPIRE] = {
10729 .type = HDA_FIXUP_PINS,
10730 .v.pins = (const struct hda_pintbl[]) {
10731 { 0x15, 0x99130112 }, /* subwoofer */
10735 [ALC662_FIXUP_LED_GPIO1] = {
10736 .type = HDA_FIXUP_FUNC,
10737 .v.func = alc662_fixup_led_gpio1,
10739 [ALC662_FIXUP_IDEAPAD] = {
10740 .type = HDA_FIXUP_PINS,
10741 .v.pins = (const struct hda_pintbl[]) {
10742 { 0x17, 0x99130112 }, /* subwoofer */
10746 .chain_id = ALC662_FIXUP_LED_GPIO1,
10748 [ALC272_FIXUP_MARIO] = {
10749 .type = HDA_FIXUP_FUNC,
10750 .v.func = alc272_fixup_mario,
10752 [ALC662_FIXUP_CZC_ET26] = {
10753 .type = HDA_FIXUP_PINS,
10754 .v.pins = (const struct hda_pintbl[]) {
10755 {0x12, 0x403cc000},
10756 {0x14, 0x90170110}, /* speaker */
10757 {0x15, 0x411111f0},
10758 {0x16, 0x411111f0},
10759 {0x18, 0x01a19030}, /* mic */
10760 {0x19, 0x90a7013f}, /* int-mic */
10761 {0x1a, 0x01014020},
10762 {0x1b, 0x0121401f},
10763 {0x1c, 0x411111f0},
10764 {0x1d, 0x411111f0},
10765 {0x1e, 0x40478e35},
10769 .chain_id = ALC662_FIXUP_SKU_IGNORE
10771 [ALC662_FIXUP_CZC_P10T] = {
10772 .type = HDA_FIXUP_VERBS,
10773 .v.verbs = (const struct hda_verb[]) {
10774 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10778 [ALC662_FIXUP_SKU_IGNORE] = {
10779 .type = HDA_FIXUP_FUNC,
10780 .v.func = alc_fixup_sku_ignore,
10782 [ALC662_FIXUP_HP_RP5800] = {
10783 .type = HDA_FIXUP_PINS,
10784 .v.pins = (const struct hda_pintbl[]) {
10785 { 0x14, 0x0221201f }, /* HP out */
10789 .chain_id = ALC662_FIXUP_SKU_IGNORE
10791 [ALC662_FIXUP_ASUS_MODE1] = {
10792 .type = HDA_FIXUP_PINS,
10793 .v.pins = (const struct hda_pintbl[]) {
10794 { 0x14, 0x99130110 }, /* speaker */
10795 { 0x18, 0x01a19c20 }, /* mic */
10796 { 0x19, 0x99a3092f }, /* int-mic */
10797 { 0x21, 0x0121401f }, /* HP out */
10801 .chain_id = ALC662_FIXUP_SKU_IGNORE
10803 [ALC662_FIXUP_ASUS_MODE2] = {
10804 .type = HDA_FIXUP_PINS,
10805 .v.pins = (const struct hda_pintbl[]) {
10806 { 0x14, 0x99130110 }, /* speaker */
10807 { 0x18, 0x01a19820 }, /* mic */
10808 { 0x19, 0x99a3092f }, /* int-mic */
10809 { 0x1b, 0x0121401f }, /* HP out */
10813 .chain_id = ALC662_FIXUP_SKU_IGNORE
10815 [ALC662_FIXUP_ASUS_MODE3] = {
10816 .type = HDA_FIXUP_PINS,
10817 .v.pins = (const struct hda_pintbl[]) {
10818 { 0x14, 0x99130110 }, /* speaker */
10819 { 0x15, 0x0121441f }, /* HP */
10820 { 0x18, 0x01a19840 }, /* mic */
10821 { 0x19, 0x99a3094f }, /* int-mic */
10822 { 0x21, 0x01211420 }, /* HP2 */
10826 .chain_id = ALC662_FIXUP_SKU_IGNORE
10828 [ALC662_FIXUP_ASUS_MODE4] = {
10829 .type = HDA_FIXUP_PINS,
10830 .v.pins = (const struct hda_pintbl[]) {
10831 { 0x14, 0x99130110 }, /* speaker */
10832 { 0x16, 0x99130111 }, /* speaker */
10833 { 0x18, 0x01a19840 }, /* mic */
10834 { 0x19, 0x99a3094f }, /* int-mic */
10835 { 0x21, 0x0121441f }, /* HP */
10839 .chain_id = ALC662_FIXUP_SKU_IGNORE
10841 [ALC662_FIXUP_ASUS_MODE5] = {
10842 .type = HDA_FIXUP_PINS,
10843 .v.pins = (const struct hda_pintbl[]) {
10844 { 0x14, 0x99130110 }, /* speaker */
10845 { 0x15, 0x0121441f }, /* HP */
10846 { 0x16, 0x99130111 }, /* speaker */
10847 { 0x18, 0x01a19840 }, /* mic */
10848 { 0x19, 0x99a3094f }, /* int-mic */
10852 .chain_id = ALC662_FIXUP_SKU_IGNORE
10854 [ALC662_FIXUP_ASUS_MODE6] = {
10855 .type = HDA_FIXUP_PINS,
10856 .v.pins = (const struct hda_pintbl[]) {
10857 { 0x14, 0x99130110 }, /* speaker */
10858 { 0x15, 0x01211420 }, /* HP2 */
10859 { 0x18, 0x01a19840 }, /* mic */
10860 { 0x19, 0x99a3094f }, /* int-mic */
10861 { 0x1b, 0x0121441f }, /* HP */
10865 .chain_id = ALC662_FIXUP_SKU_IGNORE
10867 [ALC662_FIXUP_ASUS_MODE7] = {
10868 .type = HDA_FIXUP_PINS,
10869 .v.pins = (const struct hda_pintbl[]) {
10870 { 0x14, 0x99130110 }, /* speaker */
10871 { 0x17, 0x99130111 }, /* speaker */
10872 { 0x18, 0x01a19840 }, /* mic */
10873 { 0x19, 0x99a3094f }, /* int-mic */
10874 { 0x1b, 0x01214020 }, /* HP */
10875 { 0x21, 0x0121401f }, /* HP */
10879 .chain_id = ALC662_FIXUP_SKU_IGNORE
10881 [ALC662_FIXUP_ASUS_MODE8] = {
10882 .type = HDA_FIXUP_PINS,
10883 .v.pins = (const struct hda_pintbl[]) {
10884 { 0x14, 0x99130110 }, /* speaker */
10885 { 0x12, 0x99a30970 }, /* int-mic */
10886 { 0x15, 0x01214020 }, /* HP */
10887 { 0x17, 0x99130111 }, /* speaker */
10888 { 0x18, 0x01a19840 }, /* mic */
10889 { 0x21, 0x0121401f }, /* HP */
10893 .chain_id = ALC662_FIXUP_SKU_IGNORE
10895 [ALC662_FIXUP_NO_JACK_DETECT] = {
10896 .type = HDA_FIXUP_FUNC,
10897 .v.func = alc_fixup_no_jack_detect,
10899 [ALC662_FIXUP_ZOTAC_Z68] = {
10900 .type = HDA_FIXUP_PINS,
10901 .v.pins = (const struct hda_pintbl[]) {
10902 { 0x1b, 0x02214020 }, /* Front HP */
10906 [ALC662_FIXUP_INV_DMIC] = {
10907 .type = HDA_FIXUP_FUNC,
10908 .v.func = alc_fixup_inv_dmic,
10910 [ALC668_FIXUP_DELL_XPS13] = {
10911 .type = HDA_FIXUP_FUNC,
10912 .v.func = alc_fixup_dell_xps13,
10914 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10916 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10917 .type = HDA_FIXUP_FUNC,
10918 .v.func = alc_fixup_disable_aamix,
10920 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10922 [ALC668_FIXUP_AUTO_MUTE] = {
10923 .type = HDA_FIXUP_FUNC,
10924 .v.func = alc_fixup_auto_mute_via_amp,
10926 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10928 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10929 .type = HDA_FIXUP_PINS,
10930 .v.pins = (const struct hda_pintbl[]) {
10931 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10932 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10936 .chain_id = ALC662_FIXUP_HEADSET_MODE
10938 [ALC662_FIXUP_HEADSET_MODE] = {
10939 .type = HDA_FIXUP_FUNC,
10940 .v.func = alc_fixup_headset_mode_alc662,
10942 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10943 .type = HDA_FIXUP_PINS,
10944 .v.pins = (const struct hda_pintbl[]) {
10945 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10946 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10950 .chain_id = ALC668_FIXUP_HEADSET_MODE
10952 [ALC668_FIXUP_HEADSET_MODE] = {
10953 .type = HDA_FIXUP_FUNC,
10954 .v.func = alc_fixup_headset_mode_alc668,
10956 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10957 .type = HDA_FIXUP_FUNC,
10958 .v.func = alc_fixup_bass_chmap,
10960 .chain_id = ALC662_FIXUP_ASUS_MODE4
10962 [ALC662_FIXUP_BASS_16] = {
10963 .type = HDA_FIXUP_PINS,
10964 .v.pins = (const struct hda_pintbl[]) {
10965 {0x16, 0x80106111}, /* bass speaker */
10969 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10971 [ALC662_FIXUP_BASS_1A] = {
10972 .type = HDA_FIXUP_PINS,
10973 .v.pins = (const struct hda_pintbl[]) {
10974 {0x1a, 0x80106111}, /* bass speaker */
10978 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10980 [ALC662_FIXUP_BASS_CHMAP] = {
10981 .type = HDA_FIXUP_FUNC,
10982 .v.func = alc_fixup_bass_chmap,
10984 [ALC662_FIXUP_ASUS_Nx50] = {
10985 .type = HDA_FIXUP_FUNC,
10986 .v.func = alc_fixup_auto_mute_via_amp,
10988 .chain_id = ALC662_FIXUP_BASS_1A
10990 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10991 .type = HDA_FIXUP_FUNC,
10992 .v.func = alc_fixup_headset_mode_alc668,
10993 .chain_id = ALC662_FIXUP_BASS_CHMAP
10995 [ALC668_FIXUP_ASUS_Nx51] = {
10996 .type = HDA_FIXUP_PINS,
10997 .v.pins = (const struct hda_pintbl[]) {
10998 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10999 { 0x1a, 0x90170151 }, /* bass speaker */
11000 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11004 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11006 [ALC668_FIXUP_MIC_COEF] = {
11007 .type = HDA_FIXUP_VERBS,
11008 .v.verbs = (const struct hda_verb[]) {
11009 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
11010 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
11014 [ALC668_FIXUP_ASUS_G751] = {
11015 .type = HDA_FIXUP_PINS,
11016 .v.pins = (const struct hda_pintbl[]) {
11017 { 0x16, 0x0421101f }, /* HP */
11021 .chain_id = ALC668_FIXUP_MIC_COEF
11023 [ALC891_FIXUP_HEADSET_MODE] = {
11024 .type = HDA_FIXUP_FUNC,
11025 .v.func = alc_fixup_headset_mode,
11027 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
11028 .type = HDA_FIXUP_PINS,
11029 .v.pins = (const struct hda_pintbl[]) {
11030 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11031 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11035 .chain_id = ALC891_FIXUP_HEADSET_MODE
11037 [ALC662_FIXUP_ACER_VERITON] = {
11038 .type = HDA_FIXUP_PINS,
11039 .v.pins = (const struct hda_pintbl[]) {
11040 { 0x15, 0x50170120 }, /* no internal speaker */
11044 [ALC892_FIXUP_ASROCK_MOBO] = {
11045 .type = HDA_FIXUP_PINS,
11046 .v.pins = (const struct hda_pintbl[]) {
11047 { 0x15, 0x40f000f0 }, /* disabled */
11048 { 0x16, 0x40f000f0 }, /* disabled */
11052 [ALC662_FIXUP_USI_FUNC] = {
11053 .type = HDA_FIXUP_FUNC,
11054 .v.func = alc662_fixup_usi_headset_mic,
11056 [ALC662_FIXUP_USI_HEADSET_MODE] = {
11057 .type = HDA_FIXUP_PINS,
11058 .v.pins = (const struct hda_pintbl[]) {
11059 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11060 { 0x18, 0x01a1903d },
11064 .chain_id = ALC662_FIXUP_USI_FUNC
11066 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11067 .type = HDA_FIXUP_FUNC,
11068 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11070 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11071 .type = HDA_FIXUP_FUNC,
11072 .v.func = alc662_fixup_aspire_ethos_hp,
11074 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11075 .type = HDA_FIXUP_PINS,
11076 .v.pins = (const struct hda_pintbl[]) {
11077 { 0x15, 0x92130110 }, /* front speakers */
11078 { 0x18, 0x99130111 }, /* center/subwoofer */
11079 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
11083 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
11085 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
11086 .type = HDA_FIXUP_FUNC,
11087 .v.func = alc671_fixup_hp_headset_mic2,
11089 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11090 .type = HDA_FIXUP_PINS,
11091 .v.pins = (const struct hda_pintbl[]) {
11092 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11096 .chain_id = ALC662_FIXUP_USI_FUNC
11098 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11099 .type = HDA_FIXUP_PINS,
11100 .v.pins = (const struct hda_pintbl[]) {
11101 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11102 { 0x1b, 0x0221144f },
11106 .chain_id = ALC662_FIXUP_USI_FUNC
11108 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11109 .type = HDA_FIXUP_PINS,
11110 .v.pins = (const struct hda_pintbl[]) {
11111 { 0x1b, 0x04a1112c },
11115 .chain_id = ALC668_FIXUP_HEADSET_MIC
11117 [ALC668_FIXUP_HEADSET_MIC] = {
11118 .type = HDA_FIXUP_FUNC,
11119 .v.func = alc269_fixup_headset_mic,
11121 .chain_id = ALC668_FIXUP_MIC_DET_COEF
11123 [ALC668_FIXUP_MIC_DET_COEF] = {
11124 .type = HDA_FIXUP_VERBS,
11125 .v.verbs = (const struct hda_verb[]) {
11126 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11127 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11131 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11132 .type = HDA_FIXUP_FUNC,
11133 .v.func = alc897_fixup_lenovo_headset_mic,
11135 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
11136 .type = HDA_FIXUP_PINS,
11137 .v.pins = (const struct hda_pintbl[]) {
11138 { 0x1a, 0x03a11050 },
11142 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11146 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
11147 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
11148 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
11149 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
11150 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
11151 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
11152 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
11153 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
11154 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
11155 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
11156 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
11157 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
11158 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11159 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11160 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
11161 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
11162 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
11163 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11164 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11165 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11166 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11167 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11168 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11169 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
11170 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
11171 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
11172 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
11173 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11174 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
11175 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
11176 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11177 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
11178 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11179 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
11180 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
11181 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
11182 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
11183 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11184 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
11185 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
11186 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
11187 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
11188 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
11189 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
11190 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11191 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11192 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11193 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
11194 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
11195 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
11196 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
11197 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
11198 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
11199 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
11200 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11203 /* Below is a quirk table taken from the old code.
11204 * Basically the device should work as is without the fixup table.
11205 * If BIOS doesn't give a proper info, enable the corresponding
11208 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11209 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11210 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11211 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11212 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11213 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11214 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11215 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11216 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11217 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11218 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11219 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11220 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11221 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11222 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11223 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11224 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11225 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11226 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11227 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11228 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11229 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11230 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11231 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11232 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11233 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11234 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11235 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11236 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11237 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11238 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11239 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11240 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11241 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11242 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11243 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11244 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11245 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11246 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11247 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11248 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11249 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11250 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11251 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11252 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11253 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11254 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11255 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11256 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11257 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11262 static const struct hda_model_fixup alc662_fixup_models[] = {
11263 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11264 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
11265 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
11266 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
11267 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11268 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11269 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11270 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11271 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11272 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11273 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11274 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
11275 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
11276 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
11277 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
11278 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11279 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11280 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11281 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11282 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11283 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11284 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11285 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11286 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
11287 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
11288 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11289 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11290 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11291 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11292 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
11293 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11294 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
11298 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
11299 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11300 {0x17, 0x02211010},
11301 {0x18, 0x01a19030},
11302 {0x1a, 0x01813040},
11303 {0x21, 0x01014020}),
11304 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11305 {0x16, 0x01813030},
11306 {0x17, 0x02211010},
11307 {0x18, 0x01a19040},
11308 {0x21, 0x01014020}),
11309 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11310 {0x14, 0x01014010},
11311 {0x18, 0x01a19020},
11312 {0x1a, 0x0181302f},
11313 {0x1b, 0x0221401f}),
11314 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11315 {0x12, 0x99a30130},
11316 {0x14, 0x90170110},
11317 {0x15, 0x0321101f},
11318 {0x16, 0x03011020}),
11319 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11320 {0x12, 0x99a30140},
11321 {0x14, 0x90170110},
11322 {0x15, 0x0321101f},
11323 {0x16, 0x03011020}),
11324 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11325 {0x12, 0x99a30150},
11326 {0x14, 0x90170110},
11327 {0x15, 0x0321101f},
11328 {0x16, 0x03011020}),
11329 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11330 {0x14, 0x90170110},
11331 {0x15, 0x0321101f},
11332 {0x16, 0x03011020}),
11333 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11334 {0x12, 0x90a60130},
11335 {0x14, 0x90170110},
11336 {0x15, 0x0321101f}),
11337 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11338 {0x14, 0x01014010},
11339 {0x17, 0x90170150},
11340 {0x19, 0x02a11060},
11341 {0x1b, 0x01813030},
11342 {0x21, 0x02211020}),
11343 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11344 {0x14, 0x01014010},
11345 {0x18, 0x01a19040},
11346 {0x1b, 0x01813030},
11347 {0x21, 0x02211020}),
11348 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11349 {0x14, 0x01014020},
11350 {0x17, 0x90170110},
11351 {0x18, 0x01a19050},
11352 {0x1b, 0x01813040},
11353 {0x21, 0x02211030}),
11359 static int patch_alc662(struct hda_codec *codec)
11361 struct alc_spec *spec;
11364 err = alc_alloc_spec(codec, 0x0b);
11368 spec = codec->spec;
11370 spec->shutup = alc_eapd_shutup;
11372 /* handle multiple HPs as is */
11373 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11375 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11377 switch (codec->core.vendor_id) {
11379 spec->init_hook = alc668_restore_default_value;
11383 alc_pre_init(codec);
11385 snd_hda_pick_fixup(codec, alc662_fixup_models,
11386 alc662_fixup_tbl, alc662_fixups);
11387 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
11388 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11390 alc_auto_parse_customize_define(codec);
11392 if (has_cdefine_beep(codec))
11393 spec->gen.beep_nid = 0x01;
11395 if ((alc_get_coef0(codec) & (1 << 14)) &&
11396 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
11397 spec->cdefine.platform_type == 1) {
11398 err = alc_codec_rename(codec, "ALC272X");
11403 /* automatic parse from the BIOS config */
11404 err = alc662_parse_auto_config(codec);
11408 if (!spec->gen.no_analog && spec->gen.beep_nid) {
11409 switch (codec->core.vendor_id) {
11411 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11417 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
11420 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
11427 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11440 static int alc680_parse_auto_config(struct hda_codec *codec)
11442 return alc_parse_auto_config(codec, NULL, NULL);
11447 static int patch_alc680(struct hda_codec *codec)
11451 /* ALC680 has no aa-loopback mixer */
11452 err = alc_alloc_spec(codec, 0);
11456 /* automatic parse from the BIOS config */
11457 err = alc680_parse_auto_config(codec);
11469 static const struct hda_device_id snd_hda_id_realtek[] = {
11470 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
11471 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
11472 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
11473 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
11474 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
11475 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11476 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
11477 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
11478 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
11479 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
11480 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
11481 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11482 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
11483 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
11484 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11485 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11486 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11487 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11488 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11489 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11490 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
11491 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
11492 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11493 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11494 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11495 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11496 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11497 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
11498 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
11499 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
11500 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
11501 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
11502 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
11503 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11504 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11505 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
11506 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
11507 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
11508 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
11509 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
11510 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
11511 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
11512 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11513 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11514 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11515 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11516 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11517 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11518 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11519 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11520 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11521 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11522 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11523 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11524 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11525 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
11526 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11527 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11528 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
11529 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
11530 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
11531 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11532 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11533 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11534 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11535 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11536 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11537 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11538 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11539 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11540 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11541 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
11542 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
11543 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11544 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
11545 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
11546 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
11547 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
11548 {} /* terminator */
11550 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
11552 MODULE_LICENSE("GPL");
11553 MODULE_DESCRIPTION("Realtek HD-audio codec");
11555 static struct hda_codec_driver realtek_driver = {
11556 .id = snd_hda_id_realtek,
11559 module_hda_codec_driver(realtek_driver);