1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine;
82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
88 bool gpio_write_delay; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity;
92 int micmute_led_polarity;
93 hda_nid_t mute_led_nid;
94 hda_nid_t cap_mute_led_nid;
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
100 struct mutex coef_mutex;
102 hda_nid_t headset_mic_pin;
103 hda_nid_t headphone_mic_pin;
104 int current_headset_mode;
105 int current_headset_type;
108 void (*init_hook)(struct hda_codec *codec);
110 void (*power_hook)(struct hda_codec *codec);
112 void (*shutup)(struct hda_codec *codec);
115 int codec_variant; /* flag for other variants */
116 unsigned int has_alc5505_dsp:1;
117 unsigned int no_depop_delay:1;
118 unsigned int done_hp_init:1;
119 unsigned int no_shutup_pins:1;
120 unsigned int ultra_low_power:1;
121 unsigned int has_hs_key:1;
122 unsigned int no_internal_mic_pin:1;
123 unsigned int en_3kpull_low:1;
127 unsigned int pll_coef_idx, pll_coef_bit;
129 struct input_dev *kb_dev;
130 u8 alc_mute_keycode_map[1];
134 * COEF access helper functions
137 static void coef_mutex_lock(struct hda_codec *codec)
139 struct alc_spec *spec = codec->spec;
141 snd_hda_power_up_pm(codec);
142 mutex_lock(&spec->coef_mutex);
145 static void coef_mutex_unlock(struct hda_codec *codec)
147 struct alc_spec *spec = codec->spec;
149 mutex_unlock(&spec->coef_mutex);
150 snd_hda_power_down_pm(codec);
153 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
154 unsigned int coef_idx)
158 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
159 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
163 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
164 unsigned int coef_idx)
168 coef_mutex_lock(codec);
169 val = __alc_read_coefex_idx(codec, nid, coef_idx);
170 coef_mutex_unlock(codec);
174 #define alc_read_coef_idx(codec, coef_idx) \
175 alc_read_coefex_idx(codec, 0x20, coef_idx)
177 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
178 unsigned int coef_idx, unsigned int coef_val)
180 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
181 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
184 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
185 unsigned int coef_idx, unsigned int coef_val)
187 coef_mutex_lock(codec);
188 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
189 coef_mutex_unlock(codec);
192 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
193 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
195 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
196 unsigned int coef_idx, unsigned int mask,
197 unsigned int bits_set)
199 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
202 __alc_write_coefex_idx(codec, nid, coef_idx,
203 (val & ~mask) | bits_set);
206 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
207 unsigned int coef_idx, unsigned int mask,
208 unsigned int bits_set)
210 coef_mutex_lock(codec);
211 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
212 coef_mutex_unlock(codec);
215 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
216 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
218 /* a special bypass for COEF 0; read the cached value at the second time */
219 static unsigned int alc_get_coef0(struct hda_codec *codec)
221 struct alc_spec *spec = codec->spec;
224 spec->coef0 = alc_read_coef_idx(codec, 0);
228 /* coef writes/updates batch */
236 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
237 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
238 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
239 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
240 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
242 static void alc_process_coef_fw(struct hda_codec *codec,
243 const struct coef_fw *fw)
245 coef_mutex_lock(codec);
246 for (; fw->nid; fw++) {
247 if (fw->mask == (unsigned short)-1)
248 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
250 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
253 coef_mutex_unlock(codec);
257 * GPIO setup tables, used in initialization
260 /* Enable GPIO mask and set output */
261 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
263 struct alc_spec *spec = codec->spec;
265 spec->gpio_mask |= mask;
266 spec->gpio_dir |= mask;
267 spec->gpio_data |= mask;
270 static void alc_write_gpio_data(struct hda_codec *codec)
272 struct alc_spec *spec = codec->spec;
274 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
278 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
281 struct alc_spec *spec = codec->spec;
282 unsigned int oldval = spec->gpio_data;
285 spec->gpio_data |= mask;
287 spec->gpio_data &= ~mask;
288 if (oldval != spec->gpio_data)
289 alc_write_gpio_data(codec);
292 static void alc_write_gpio(struct hda_codec *codec)
294 struct alc_spec *spec = codec->spec;
296 if (!spec->gpio_mask)
299 snd_hda_codec_write(codec, codec->core.afg, 0,
300 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
301 snd_hda_codec_write(codec, codec->core.afg, 0,
302 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
303 if (spec->gpio_write_delay)
305 alc_write_gpio_data(codec);
308 static void alc_fixup_gpio(struct hda_codec *codec, int action,
311 if (action == HDA_FIXUP_ACT_PRE_PROBE)
312 alc_setup_gpio(codec, mask);
315 static void alc_fixup_gpio1(struct hda_codec *codec,
316 const struct hda_fixup *fix, int action)
318 alc_fixup_gpio(codec, action, 0x01);
321 static void alc_fixup_gpio2(struct hda_codec *codec,
322 const struct hda_fixup *fix, int action)
324 alc_fixup_gpio(codec, action, 0x02);
327 static void alc_fixup_gpio3(struct hda_codec *codec,
328 const struct hda_fixup *fix, int action)
330 alc_fixup_gpio(codec, action, 0x03);
333 static void alc_fixup_gpio4(struct hda_codec *codec,
334 const struct hda_fixup *fix, int action)
336 alc_fixup_gpio(codec, action, 0x04);
339 static void alc_fixup_micmute_led(struct hda_codec *codec,
340 const struct hda_fixup *fix, int action)
342 if (action == HDA_FIXUP_ACT_PRE_PROBE)
343 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
347 * Fix hardware PLL issue
348 * On some codecs, the analog PLL gating control must be off while
349 * the default value is 1.
351 static void alc_fix_pll(struct hda_codec *codec)
353 struct alc_spec *spec = codec->spec;
356 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
357 1 << spec->pll_coef_bit, 0);
360 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
361 unsigned int coef_idx, unsigned int coef_bit)
363 struct alc_spec *spec = codec->spec;
365 spec->pll_coef_idx = coef_idx;
366 spec->pll_coef_bit = coef_bit;
370 /* update the master volume per volume-knob's unsol event */
371 static void alc_update_knob_master(struct hda_codec *codec,
372 struct hda_jack_callback *jack)
375 struct snd_kcontrol *kctl;
376 struct snd_ctl_elem_value *uctl;
378 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
381 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
384 val = snd_hda_codec_read(codec, jack->nid, 0,
385 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
386 val &= HDA_AMP_VOLMASK;
387 uctl->value.integer.value[0] = val;
388 uctl->value.integer.value[1] = val;
389 kctl->put(kctl, uctl);
393 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
395 /* For some reason, the res given from ALC880 is broken.
396 Here we adjust it properly. */
397 snd_hda_jack_unsol_event(codec, res >> 2);
400 /* Change EAPD to verb control */
401 static void alc_fill_eapd_coef(struct hda_codec *codec)
405 coef = alc_get_coef0(codec);
407 switch (codec->core.vendor_id) {
409 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
413 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
416 if ((coef & 0x00f0) == 0x0010)
417 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
418 if ((coef & 0x00f0) == 0x0020)
419 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
420 if ((coef & 0x00f0) == 0x0030)
421 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
427 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
432 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
452 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
455 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
458 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
459 alc_write_coef_idx(codec, 0x8, 0x4ab7);
462 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
471 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
474 if ((coef & 0x00f0) == 0x0030)
475 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
484 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
488 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
491 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
494 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
497 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
498 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
502 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
509 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
514 /* additional initialization for ALC888 variants */
515 static void alc888_coef_init(struct hda_codec *codec)
517 switch (alc_get_coef0(codec) & 0x00f0) {
522 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
527 /* turn on/off EAPD control (only if available) */
528 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
530 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
532 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
533 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
537 /* turn on/off EAPD controls of the codec */
538 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
540 /* We currently only handle front, HP */
541 static const hda_nid_t pins[] = {
542 0x0f, 0x10, 0x14, 0x15, 0x17, 0
545 for (p = pins; *p; p++)
546 set_eapd(codec, *p, on);
549 static int find_ext_mic_pin(struct hda_codec *codec);
551 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
553 const struct hda_pincfg *pin;
554 int mic_pin = find_ext_mic_pin(codec);
557 /* don't shut up pins when unloading the driver; otherwise it breaks
558 * the default pin setup at the next load of the driver
560 if (codec->bus->shutdown)
563 snd_array_for_each(&codec->init_pins, i, pin) {
564 /* use read here for syncing after issuing each verb */
565 if (pin->nid != mic_pin)
566 snd_hda_codec_read(codec, pin->nid, 0,
567 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
570 codec->pins_shutup = 1;
573 static void alc_shutup_pins(struct hda_codec *codec)
575 struct alc_spec *spec = codec->spec;
577 switch (codec->core.vendor_id) {
585 alc_headset_mic_no_shutup(codec);
588 if (!spec->no_shutup_pins)
589 snd_hda_shutup_pins(codec);
594 /* generic shutup callback;
595 * just turning off EAPD and a little pause for avoiding pop-noise
597 static void alc_eapd_shutup(struct hda_codec *codec)
599 struct alc_spec *spec = codec->spec;
601 alc_auto_setup_eapd(codec, false);
602 if (!spec->no_depop_delay)
604 alc_shutup_pins(codec);
607 /* generic EAPD initialization */
608 static void alc_auto_init_amp(struct hda_codec *codec, int type)
610 alc_auto_setup_eapd(codec, true);
611 alc_write_gpio(codec);
613 case ALC_INIT_DEFAULT:
614 switch (codec->core.vendor_id) {
616 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
622 alc_update_coef_idx(codec, 7, 0, 0x2030);
625 alc888_coef_init(codec);
632 /* get a primary headphone pin if available */
633 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
635 if (spec->gen.autocfg.hp_pins[0])
636 return spec->gen.autocfg.hp_pins[0];
637 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
638 return spec->gen.autocfg.line_out_pins[0];
643 * Realtek SSID verification
646 /* Could be any non-zero and even value. When used as fixup, tells
647 * the driver to ignore any present sku defines.
649 #define ALC_FIXUP_SKU_IGNORE (2)
651 static void alc_fixup_sku_ignore(struct hda_codec *codec,
652 const struct hda_fixup *fix, int action)
654 struct alc_spec *spec = codec->spec;
655 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
656 spec->cdefine.fixup = 1;
657 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
661 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
662 const struct hda_fixup *fix, int action)
664 struct alc_spec *spec = codec->spec;
666 if (action == HDA_FIXUP_ACT_PROBE) {
667 spec->no_depop_delay = 1;
668 codec->depop_delay = 0;
672 static int alc_auto_parse_customize_define(struct hda_codec *codec)
674 unsigned int ass, tmp, i;
676 struct alc_spec *spec = codec->spec;
678 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
680 if (spec->cdefine.fixup) {
681 ass = spec->cdefine.sku_cfg;
682 if (ass == ALC_FIXUP_SKU_IGNORE)
687 if (!codec->bus->pci)
689 ass = codec->core.subsystem_id & 0xffff;
690 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
694 if (codec->core.vendor_id == 0x10ec0260)
696 ass = snd_hda_codec_get_pincfg(codec, nid);
699 codec_info(codec, "%s: SKU not ready 0x%08x\n",
700 codec->core.chip_name, ass);
706 for (i = 1; i < 16; i++) {
710 if (((ass >> 16) & 0xf) != tmp)
713 spec->cdefine.port_connectivity = ass >> 30;
714 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
715 spec->cdefine.check_sum = (ass >> 16) & 0xf;
716 spec->cdefine.customization = ass >> 8;
718 spec->cdefine.sku_cfg = ass;
719 spec->cdefine.external_amp = (ass & 0x38) >> 3;
720 spec->cdefine.platform_type = (ass & 0x4) >> 2;
721 spec->cdefine.swap = (ass & 0x2) >> 1;
722 spec->cdefine.override = ass & 0x1;
724 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
725 nid, spec->cdefine.sku_cfg);
726 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
727 spec->cdefine.port_connectivity);
728 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
729 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
730 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
731 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
732 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
733 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
734 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
739 /* return the position of NID in the list, or -1 if not found */
740 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
743 for (i = 0; i < nums; i++)
748 /* return true if the given NID is found in the list */
749 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
751 return find_idx_in_nid_list(nid, list, nums) >= 0;
754 /* check subsystem ID and set up device-specific initialization;
755 * return 1 if initialized, 0 if invalid SSID
757 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
758 * 31 ~ 16 : Manufacture ID
760 * 7 ~ 0 : Assembly ID
761 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
763 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
765 unsigned int ass, tmp, i;
767 struct alc_spec *spec = codec->spec;
769 if (spec->cdefine.fixup) {
770 ass = spec->cdefine.sku_cfg;
771 if (ass == ALC_FIXUP_SKU_IGNORE)
776 ass = codec->core.subsystem_id & 0xffff;
777 if (codec->bus->pci &&
778 ass != codec->bus->pci->subsystem_device && (ass & 1))
781 /* invalid SSID, check the special NID pin defcfg instead */
783 * 31~30 : port connectivity
786 * 19~16 : Check sum (15:1)
791 if (codec->core.vendor_id == 0x10ec0260)
793 ass = snd_hda_codec_get_pincfg(codec, nid);
795 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
799 if ((ass >> 30) != 1) /* no physical connection */
804 for (i = 1; i < 16; i++) {
808 if (((ass >> 16) & 0xf) != tmp)
811 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
812 ass & 0xffff, codec->core.vendor_id);
816 * 2 : 0 --> Desktop, 1 --> Laptop
817 * 3~5 : External Amplifier control
820 tmp = (ass & 0x38) >> 3; /* external Amp control */
821 if (spec->init_amp == ALC_INIT_UNDEFINED) {
824 alc_setup_gpio(codec, 0x01);
827 alc_setup_gpio(codec, 0x02);
830 alc_setup_gpio(codec, 0x04);
834 spec->init_amp = ALC_INIT_DEFAULT;
839 /* is laptop or Desktop and enable the function "Mute internal speaker
840 * when the external headphone out jack is plugged"
845 * 10~8 : Jack location
846 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
848 * 15 : 1 --> enable the function "Mute internal speaker
849 * when the external headphone out jack is plugged"
851 if (!alc_get_hp_pin(spec)) {
853 tmp = (ass >> 11) & 0x3; /* HP to chassis */
855 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
856 spec->gen.autocfg.line_outs))
858 spec->gen.autocfg.hp_pins[0] = nid;
863 /* Check the validity of ALC subsystem-id
864 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
865 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
867 if (!alc_subsystem_id(codec, ports)) {
868 struct alc_spec *spec = codec->spec;
869 if (spec->init_amp == ALC_INIT_UNDEFINED) {
871 "realtek: Enable default setup for auto mode as fallback\n");
872 spec->init_amp = ALC_INIT_DEFAULT;
880 static void alc_fixup_inv_dmic(struct hda_codec *codec,
881 const struct hda_fixup *fix, int action)
883 struct alc_spec *spec = codec->spec;
885 spec->gen.inv_dmic_split = 1;
889 static int alc_build_controls(struct hda_codec *codec)
893 err = snd_hda_gen_build_controls(codec);
897 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
906 static void alc_pre_init(struct hda_codec *codec)
908 alc_fill_eapd_coef(codec);
911 #define is_s3_resume(codec) \
912 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
913 #define is_s4_resume(codec) \
914 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
916 static int alc_init(struct hda_codec *codec)
918 struct alc_spec *spec = codec->spec;
920 /* hibernation resume needs the full chip initialization */
921 if (is_s4_resume(codec))
925 spec->init_hook(codec);
927 spec->gen.skip_verbs = 1; /* applied in below */
928 snd_hda_gen_init(codec);
930 alc_auto_init_amp(codec, spec->init_amp);
931 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
933 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
938 #define alc_free snd_hda_gen_free
941 static inline void alc_shutup(struct hda_codec *codec)
943 struct alc_spec *spec = codec->spec;
945 if (!snd_hda_get_bool_hint(codec, "shutup"))
946 return; /* disabled explicitly by hints */
948 if (spec && spec->shutup)
951 alc_shutup_pins(codec);
954 static void alc_power_eapd(struct hda_codec *codec)
956 alc_auto_setup_eapd(codec, false);
959 static int alc_suspend(struct hda_codec *codec)
961 struct alc_spec *spec = codec->spec;
963 if (spec && spec->power_hook)
964 spec->power_hook(codec);
968 static int alc_resume(struct hda_codec *codec)
970 struct alc_spec *spec = codec->spec;
972 if (!spec->no_depop_delay)
973 msleep(150); /* to avoid pop noise */
974 codec->patch_ops.init(codec);
975 snd_hda_regmap_sync(codec);
976 hda_call_check_power_status(codec, 0x01);
983 static const struct hda_codec_ops alc_patch_ops = {
984 .build_controls = alc_build_controls,
985 .build_pcms = snd_hda_gen_build_pcms,
988 .unsol_event = snd_hda_jack_unsol_event,
990 .resume = alc_resume,
991 .suspend = alc_suspend,
992 .check_power_status = snd_hda_gen_check_power_status,
997 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
1000 * Rename codecs appropriately from COEF value or subvendor id
1002 struct alc_codec_rename_table {
1003 unsigned int vendor_id;
1004 unsigned short coef_mask;
1005 unsigned short coef_bits;
1009 struct alc_codec_rename_pci_table {
1010 unsigned int codec_vendor_id;
1011 unsigned short pci_subvendor;
1012 unsigned short pci_subdevice;
1016 static const struct alc_codec_rename_table rename_tbl[] = {
1017 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1018 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1019 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1020 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1021 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1022 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1023 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1024 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1025 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1026 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1027 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1028 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1029 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1030 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1031 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1032 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1033 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1034 { } /* terminator */
1037 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1038 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1039 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1040 { 0x10ec0283, 0x1028, 0, "ALC3223" },
1041 { 0x10ec0288, 0x1028, 0, "ALC3263" },
1042 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1043 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1044 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1045 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1046 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1047 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1048 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1049 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1050 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1051 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1052 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1053 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1054 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1055 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1056 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1057 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1058 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1059 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1060 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1061 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1062 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1063 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1064 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1065 { } /* terminator */
1068 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1070 const struct alc_codec_rename_table *p;
1071 const struct alc_codec_rename_pci_table *q;
1073 for (p = rename_tbl; p->vendor_id; p++) {
1074 if (p->vendor_id != codec->core.vendor_id)
1076 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1077 return alc_codec_rename(codec, p->name);
1080 if (!codec->bus->pci)
1082 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1083 if (q->codec_vendor_id != codec->core.vendor_id)
1085 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1087 if (!q->pci_subdevice ||
1088 q->pci_subdevice == codec->bus->pci->subsystem_device)
1089 return alc_codec_rename(codec, q->name);
1097 * Digital-beep handlers
1099 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1101 /* additional beep mixers; private_value will be overwritten */
1102 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1103 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1104 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1107 /* set up and create beep controls */
1108 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1111 struct snd_kcontrol_new *knew;
1112 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1115 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1116 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1117 &alc_beep_mixer[i]);
1120 knew->private_value = beep_amp;
1125 static const struct snd_pci_quirk beep_allow_list[] = {
1126 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1127 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1128 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1129 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1130 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1131 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1132 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1133 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1134 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1135 /* denylist -- no beep available */
1136 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1137 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1141 static inline int has_cdefine_beep(struct hda_codec *codec)
1143 struct alc_spec *spec = codec->spec;
1144 const struct snd_pci_quirk *q;
1145 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1148 return spec->cdefine.enable_pcbeep;
1151 #define set_beep_amp(spec, nid, idx, dir) 0
1152 #define has_cdefine_beep(codec) 0
1155 /* parse the BIOS configuration and set up the alc_spec */
1156 /* return 1 if successful, 0 if the proper config is not found,
1157 * or a negative error code
1159 static int alc_parse_auto_config(struct hda_codec *codec,
1160 const hda_nid_t *ignore_nids,
1161 const hda_nid_t *ssid_nids)
1163 struct alc_spec *spec = codec->spec;
1164 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1167 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1173 alc_ssid_check(codec, ssid_nids);
1175 err = snd_hda_gen_parse_auto_config(codec, cfg);
1182 /* common preparation job for alc_spec */
1183 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1185 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1191 snd_hda_gen_spec_init(&spec->gen);
1192 spec->gen.mixer_nid = mixer_nid;
1193 spec->gen.own_eapd_ctl = 1;
1194 codec->single_adc_amp = 1;
1195 /* FIXME: do we need this for all Realtek codec models? */
1196 codec->spdif_status_reset = 1;
1197 codec->forced_resume = 1;
1198 codec->patch_ops = alc_patch_ops;
1199 mutex_init(&spec->coef_mutex);
1201 err = alc_codec_rename_from_preset(codec);
1209 static int alc880_parse_auto_config(struct hda_codec *codec)
1211 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1212 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1213 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1222 ALC880_FIXUP_MEDION_RIM,
1224 ALC880_FIXUP_LG_LW25,
1226 ALC880_FIXUP_EAPD_COEF,
1227 ALC880_FIXUP_TCL_S700,
1228 ALC880_FIXUP_VOL_KNOB,
1229 ALC880_FIXUP_FUJITSU,
1231 ALC880_FIXUP_UNIWILL,
1232 ALC880_FIXUP_UNIWILL_DIG,
1234 ALC880_FIXUP_ASUS_W5A,
1235 ALC880_FIXUP_3ST_BASE,
1237 ALC880_FIXUP_3ST_DIG,
1238 ALC880_FIXUP_5ST_BASE,
1240 ALC880_FIXUP_5ST_DIG,
1241 ALC880_FIXUP_6ST_BASE,
1243 ALC880_FIXUP_6ST_DIG,
1244 ALC880_FIXUP_6ST_AUTOMUTE,
1247 /* enable the volume-knob widget support on NID 0x21 */
1248 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1249 const struct hda_fixup *fix, int action)
1251 if (action == HDA_FIXUP_ACT_PROBE)
1252 snd_hda_jack_detect_enable_callback(codec, 0x21,
1253 alc_update_knob_master);
1256 static const struct hda_fixup alc880_fixups[] = {
1257 [ALC880_FIXUP_GPIO1] = {
1258 .type = HDA_FIXUP_FUNC,
1259 .v.func = alc_fixup_gpio1,
1261 [ALC880_FIXUP_GPIO2] = {
1262 .type = HDA_FIXUP_FUNC,
1263 .v.func = alc_fixup_gpio2,
1265 [ALC880_FIXUP_MEDION_RIM] = {
1266 .type = HDA_FIXUP_VERBS,
1267 .v.verbs = (const struct hda_verb[]) {
1268 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1269 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1273 .chain_id = ALC880_FIXUP_GPIO2,
1275 [ALC880_FIXUP_LG] = {
1276 .type = HDA_FIXUP_PINS,
1277 .v.pins = (const struct hda_pintbl[]) {
1278 /* disable bogus unused pins */
1279 { 0x16, 0x411111f0 },
1280 { 0x18, 0x411111f0 },
1281 { 0x1a, 0x411111f0 },
1285 [ALC880_FIXUP_LG_LW25] = {
1286 .type = HDA_FIXUP_PINS,
1287 .v.pins = (const struct hda_pintbl[]) {
1288 { 0x1a, 0x0181344f }, /* line-in */
1289 { 0x1b, 0x0321403f }, /* headphone */
1293 [ALC880_FIXUP_W810] = {
1294 .type = HDA_FIXUP_PINS,
1295 .v.pins = (const struct hda_pintbl[]) {
1296 /* disable bogus unused pins */
1297 { 0x17, 0x411111f0 },
1301 .chain_id = ALC880_FIXUP_GPIO2,
1303 [ALC880_FIXUP_EAPD_COEF] = {
1304 .type = HDA_FIXUP_VERBS,
1305 .v.verbs = (const struct hda_verb[]) {
1306 /* change to EAPD mode */
1307 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1308 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1312 [ALC880_FIXUP_TCL_S700] = {
1313 .type = HDA_FIXUP_VERBS,
1314 .v.verbs = (const struct hda_verb[]) {
1315 /* change to EAPD mode */
1316 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1317 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1321 .chain_id = ALC880_FIXUP_GPIO2,
1323 [ALC880_FIXUP_VOL_KNOB] = {
1324 .type = HDA_FIXUP_FUNC,
1325 .v.func = alc880_fixup_vol_knob,
1327 [ALC880_FIXUP_FUJITSU] = {
1328 /* override all pins as BIOS on old Amilo is broken */
1329 .type = HDA_FIXUP_PINS,
1330 .v.pins = (const struct hda_pintbl[]) {
1331 { 0x14, 0x0121401f }, /* HP */
1332 { 0x15, 0x99030120 }, /* speaker */
1333 { 0x16, 0x99030130 }, /* bass speaker */
1334 { 0x17, 0x411111f0 }, /* N/A */
1335 { 0x18, 0x411111f0 }, /* N/A */
1336 { 0x19, 0x01a19950 }, /* mic-in */
1337 { 0x1a, 0x411111f0 }, /* N/A */
1338 { 0x1b, 0x411111f0 }, /* N/A */
1339 { 0x1c, 0x411111f0 }, /* N/A */
1340 { 0x1d, 0x411111f0 }, /* N/A */
1341 { 0x1e, 0x01454140 }, /* SPDIF out */
1345 .chain_id = ALC880_FIXUP_VOL_KNOB,
1347 [ALC880_FIXUP_F1734] = {
1348 /* almost compatible with FUJITSU, but no bass and SPDIF */
1349 .type = HDA_FIXUP_PINS,
1350 .v.pins = (const struct hda_pintbl[]) {
1351 { 0x14, 0x0121401f }, /* HP */
1352 { 0x15, 0x99030120 }, /* speaker */
1353 { 0x16, 0x411111f0 }, /* N/A */
1354 { 0x17, 0x411111f0 }, /* N/A */
1355 { 0x18, 0x411111f0 }, /* N/A */
1356 { 0x19, 0x01a19950 }, /* mic-in */
1357 { 0x1a, 0x411111f0 }, /* N/A */
1358 { 0x1b, 0x411111f0 }, /* N/A */
1359 { 0x1c, 0x411111f0 }, /* N/A */
1360 { 0x1d, 0x411111f0 }, /* N/A */
1361 { 0x1e, 0x411111f0 }, /* N/A */
1365 .chain_id = ALC880_FIXUP_VOL_KNOB,
1367 [ALC880_FIXUP_UNIWILL] = {
1368 /* need to fix HP and speaker pins to be parsed correctly */
1369 .type = HDA_FIXUP_PINS,
1370 .v.pins = (const struct hda_pintbl[]) {
1371 { 0x14, 0x0121411f }, /* HP */
1372 { 0x15, 0x99030120 }, /* speaker */
1373 { 0x16, 0x99030130 }, /* bass speaker */
1377 [ALC880_FIXUP_UNIWILL_DIG] = {
1378 .type = HDA_FIXUP_PINS,
1379 .v.pins = (const struct hda_pintbl[]) {
1380 /* disable bogus unused pins */
1381 { 0x17, 0x411111f0 },
1382 { 0x19, 0x411111f0 },
1383 { 0x1b, 0x411111f0 },
1384 { 0x1f, 0x411111f0 },
1388 [ALC880_FIXUP_Z71V] = {
1389 .type = HDA_FIXUP_PINS,
1390 .v.pins = (const struct hda_pintbl[]) {
1391 /* set up the whole pins as BIOS is utterly broken */
1392 { 0x14, 0x99030120 }, /* speaker */
1393 { 0x15, 0x0121411f }, /* HP */
1394 { 0x16, 0x411111f0 }, /* N/A */
1395 { 0x17, 0x411111f0 }, /* N/A */
1396 { 0x18, 0x01a19950 }, /* mic-in */
1397 { 0x19, 0x411111f0 }, /* N/A */
1398 { 0x1a, 0x01813031 }, /* line-in */
1399 { 0x1b, 0x411111f0 }, /* N/A */
1400 { 0x1c, 0x411111f0 }, /* N/A */
1401 { 0x1d, 0x411111f0 }, /* N/A */
1402 { 0x1e, 0x0144111e }, /* SPDIF */
1406 [ALC880_FIXUP_ASUS_W5A] = {
1407 .type = HDA_FIXUP_PINS,
1408 .v.pins = (const struct hda_pintbl[]) {
1409 /* set up the whole pins as BIOS is utterly broken */
1410 { 0x14, 0x0121411f }, /* HP */
1411 { 0x15, 0x411111f0 }, /* N/A */
1412 { 0x16, 0x411111f0 }, /* N/A */
1413 { 0x17, 0x411111f0 }, /* N/A */
1414 { 0x18, 0x90a60160 }, /* mic */
1415 { 0x19, 0x411111f0 }, /* N/A */
1416 { 0x1a, 0x411111f0 }, /* N/A */
1417 { 0x1b, 0x411111f0 }, /* N/A */
1418 { 0x1c, 0x411111f0 }, /* N/A */
1419 { 0x1d, 0x411111f0 }, /* N/A */
1420 { 0x1e, 0xb743111e }, /* SPDIF out */
1424 .chain_id = ALC880_FIXUP_GPIO1,
1426 [ALC880_FIXUP_3ST_BASE] = {
1427 .type = HDA_FIXUP_PINS,
1428 .v.pins = (const struct hda_pintbl[]) {
1429 { 0x14, 0x01014010 }, /* line-out */
1430 { 0x15, 0x411111f0 }, /* N/A */
1431 { 0x16, 0x411111f0 }, /* N/A */
1432 { 0x17, 0x411111f0 }, /* N/A */
1433 { 0x18, 0x01a19c30 }, /* mic-in */
1434 { 0x19, 0x0121411f }, /* HP */
1435 { 0x1a, 0x01813031 }, /* line-in */
1436 { 0x1b, 0x02a19c40 }, /* front-mic */
1437 { 0x1c, 0x411111f0 }, /* N/A */
1438 { 0x1d, 0x411111f0 }, /* N/A */
1439 /* 0x1e is filled in below */
1440 { 0x1f, 0x411111f0 }, /* N/A */
1444 [ALC880_FIXUP_3ST] = {
1445 .type = HDA_FIXUP_PINS,
1446 .v.pins = (const struct hda_pintbl[]) {
1447 { 0x1e, 0x411111f0 }, /* N/A */
1451 .chain_id = ALC880_FIXUP_3ST_BASE,
1453 [ALC880_FIXUP_3ST_DIG] = {
1454 .type = HDA_FIXUP_PINS,
1455 .v.pins = (const struct hda_pintbl[]) {
1456 { 0x1e, 0x0144111e }, /* SPDIF */
1460 .chain_id = ALC880_FIXUP_3ST_BASE,
1462 [ALC880_FIXUP_5ST_BASE] = {
1463 .type = HDA_FIXUP_PINS,
1464 .v.pins = (const struct hda_pintbl[]) {
1465 { 0x14, 0x01014010 }, /* front */
1466 { 0x15, 0x411111f0 }, /* N/A */
1467 { 0x16, 0x01011411 }, /* CLFE */
1468 { 0x17, 0x01016412 }, /* surr */
1469 { 0x18, 0x01a19c30 }, /* mic-in */
1470 { 0x19, 0x0121411f }, /* HP */
1471 { 0x1a, 0x01813031 }, /* line-in */
1472 { 0x1b, 0x02a19c40 }, /* front-mic */
1473 { 0x1c, 0x411111f0 }, /* N/A */
1474 { 0x1d, 0x411111f0 }, /* N/A */
1475 /* 0x1e is filled in below */
1476 { 0x1f, 0x411111f0 }, /* N/A */
1480 [ALC880_FIXUP_5ST] = {
1481 .type = HDA_FIXUP_PINS,
1482 .v.pins = (const struct hda_pintbl[]) {
1483 { 0x1e, 0x411111f0 }, /* N/A */
1487 .chain_id = ALC880_FIXUP_5ST_BASE,
1489 [ALC880_FIXUP_5ST_DIG] = {
1490 .type = HDA_FIXUP_PINS,
1491 .v.pins = (const struct hda_pintbl[]) {
1492 { 0x1e, 0x0144111e }, /* SPDIF */
1496 .chain_id = ALC880_FIXUP_5ST_BASE,
1498 [ALC880_FIXUP_6ST_BASE] = {
1499 .type = HDA_FIXUP_PINS,
1500 .v.pins = (const struct hda_pintbl[]) {
1501 { 0x14, 0x01014010 }, /* front */
1502 { 0x15, 0x01016412 }, /* surr */
1503 { 0x16, 0x01011411 }, /* CLFE */
1504 { 0x17, 0x01012414 }, /* side */
1505 { 0x18, 0x01a19c30 }, /* mic-in */
1506 { 0x19, 0x02a19c40 }, /* front-mic */
1507 { 0x1a, 0x01813031 }, /* line-in */
1508 { 0x1b, 0x0121411f }, /* HP */
1509 { 0x1c, 0x411111f0 }, /* N/A */
1510 { 0x1d, 0x411111f0 }, /* N/A */
1511 /* 0x1e is filled in below */
1512 { 0x1f, 0x411111f0 }, /* N/A */
1516 [ALC880_FIXUP_6ST] = {
1517 .type = HDA_FIXUP_PINS,
1518 .v.pins = (const struct hda_pintbl[]) {
1519 { 0x1e, 0x411111f0 }, /* N/A */
1523 .chain_id = ALC880_FIXUP_6ST_BASE,
1525 [ALC880_FIXUP_6ST_DIG] = {
1526 .type = HDA_FIXUP_PINS,
1527 .v.pins = (const struct hda_pintbl[]) {
1528 { 0x1e, 0x0144111e }, /* SPDIF */
1532 .chain_id = ALC880_FIXUP_6ST_BASE,
1534 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1535 .type = HDA_FIXUP_PINS,
1536 .v.pins = (const struct hda_pintbl[]) {
1537 { 0x1b, 0x0121401f }, /* HP with jack detect */
1540 .chained_before = true,
1541 .chain_id = ALC880_FIXUP_6ST_BASE,
1545 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1546 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1547 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1548 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1549 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1550 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1551 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1552 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1553 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1554 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1555 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1556 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1557 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1558 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1559 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1560 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1561 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1562 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1563 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1564 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1565 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1566 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1567 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1568 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1570 /* Below is the copied entries from alc880_quirks.c.
1571 * It's not quite sure whether BIOS sets the correct pin-config table
1572 * on these machines, thus they are kept to be compatible with
1573 * the old static quirks. Once when it's confirmed to work without
1574 * these overrides, it'd be better to remove.
1576 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1577 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1578 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1579 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1580 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1581 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1582 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1583 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1584 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1585 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1586 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1587 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1588 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1589 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1590 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1591 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1592 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1593 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1594 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1595 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1596 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1597 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1598 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1599 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1600 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1601 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1602 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1603 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1604 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1605 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1606 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1607 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1608 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1610 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1611 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1612 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1616 static const struct hda_model_fixup alc880_fixup_models[] = {
1617 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1618 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1619 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1620 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1621 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1622 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1623 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1629 * OK, here we have finally the patch for ALC880
1631 static int patch_alc880(struct hda_codec *codec)
1633 struct alc_spec *spec;
1636 err = alc_alloc_spec(codec, 0x0b);
1641 spec->gen.need_dac_fix = 1;
1642 spec->gen.beep_nid = 0x01;
1644 codec->patch_ops.unsol_event = alc880_unsol_event;
1646 alc_pre_init(codec);
1648 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1650 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1652 /* automatic parse from the BIOS config */
1653 err = alc880_parse_auto_config(codec);
1657 if (!spec->gen.no_analog) {
1658 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1663 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1676 static int alc260_parse_auto_config(struct hda_codec *codec)
1678 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1679 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1680 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1687 ALC260_FIXUP_HP_DC5750,
1688 ALC260_FIXUP_HP_PIN_0F,
1691 ALC260_FIXUP_GPIO1_TOGGLE,
1692 ALC260_FIXUP_REPLACER,
1693 ALC260_FIXUP_HP_B1900,
1695 ALC260_FIXUP_FSC_S7020,
1696 ALC260_FIXUP_FSC_S7020_JWSE,
1697 ALC260_FIXUP_VAIO_PINS,
1700 static void alc260_gpio1_automute(struct hda_codec *codec)
1702 struct alc_spec *spec = codec->spec;
1704 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1707 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1708 const struct hda_fixup *fix, int action)
1710 struct alc_spec *spec = codec->spec;
1711 if (action == HDA_FIXUP_ACT_PROBE) {
1712 /* although the machine has only one output pin, we need to
1713 * toggle GPIO1 according to the jack state
1715 spec->gen.automute_hook = alc260_gpio1_automute;
1716 spec->gen.detect_hp = 1;
1717 spec->gen.automute_speaker = 1;
1718 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1719 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1720 snd_hda_gen_hp_automute);
1721 alc_setup_gpio(codec, 0x01);
1725 static void alc260_fixup_kn1(struct hda_codec *codec,
1726 const struct hda_fixup *fix, int action)
1728 struct alc_spec *spec = codec->spec;
1729 static const struct hda_pintbl pincfgs[] = {
1730 { 0x0f, 0x02214000 }, /* HP/speaker */
1731 { 0x12, 0x90a60160 }, /* int mic */
1732 { 0x13, 0x02a19000 }, /* ext mic */
1733 { 0x18, 0x01446000 }, /* SPDIF out */
1734 /* disable bogus I/O pins */
1735 { 0x10, 0x411111f0 },
1736 { 0x11, 0x411111f0 },
1737 { 0x14, 0x411111f0 },
1738 { 0x15, 0x411111f0 },
1739 { 0x16, 0x411111f0 },
1740 { 0x17, 0x411111f0 },
1741 { 0x19, 0x411111f0 },
1746 case HDA_FIXUP_ACT_PRE_PROBE:
1747 snd_hda_apply_pincfgs(codec, pincfgs);
1748 spec->init_amp = ALC_INIT_NONE;
1753 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1754 const struct hda_fixup *fix, int action)
1756 struct alc_spec *spec = codec->spec;
1757 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1758 spec->init_amp = ALC_INIT_NONE;
1761 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1762 const struct hda_fixup *fix, int action)
1764 struct alc_spec *spec = codec->spec;
1765 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1766 spec->gen.add_jack_modes = 1;
1767 spec->gen.hp_mic = 1;
1771 static const struct hda_fixup alc260_fixups[] = {
1772 [ALC260_FIXUP_HP_DC5750] = {
1773 .type = HDA_FIXUP_PINS,
1774 .v.pins = (const struct hda_pintbl[]) {
1775 { 0x11, 0x90130110 }, /* speaker */
1779 [ALC260_FIXUP_HP_PIN_0F] = {
1780 .type = HDA_FIXUP_PINS,
1781 .v.pins = (const struct hda_pintbl[]) {
1782 { 0x0f, 0x01214000 }, /* HP */
1786 [ALC260_FIXUP_COEF] = {
1787 .type = HDA_FIXUP_VERBS,
1788 .v.verbs = (const struct hda_verb[]) {
1789 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1790 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1794 [ALC260_FIXUP_GPIO1] = {
1795 .type = HDA_FIXUP_FUNC,
1796 .v.func = alc_fixup_gpio1,
1798 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1799 .type = HDA_FIXUP_FUNC,
1800 .v.func = alc260_fixup_gpio1_toggle,
1802 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1804 [ALC260_FIXUP_REPLACER] = {
1805 .type = HDA_FIXUP_VERBS,
1806 .v.verbs = (const struct hda_verb[]) {
1807 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1808 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1812 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1814 [ALC260_FIXUP_HP_B1900] = {
1815 .type = HDA_FIXUP_FUNC,
1816 .v.func = alc260_fixup_gpio1_toggle,
1818 .chain_id = ALC260_FIXUP_COEF,
1820 [ALC260_FIXUP_KN1] = {
1821 .type = HDA_FIXUP_FUNC,
1822 .v.func = alc260_fixup_kn1,
1824 [ALC260_FIXUP_FSC_S7020] = {
1825 .type = HDA_FIXUP_FUNC,
1826 .v.func = alc260_fixup_fsc_s7020,
1828 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1829 .type = HDA_FIXUP_FUNC,
1830 .v.func = alc260_fixup_fsc_s7020_jwse,
1832 .chain_id = ALC260_FIXUP_FSC_S7020,
1834 [ALC260_FIXUP_VAIO_PINS] = {
1835 .type = HDA_FIXUP_PINS,
1836 .v.pins = (const struct hda_pintbl[]) {
1837 /* Pin configs are missing completely on some VAIOs */
1838 { 0x0f, 0x01211020 },
1839 { 0x10, 0x0001003f },
1840 { 0x11, 0x411111f0 },
1841 { 0x12, 0x01a15930 },
1842 { 0x13, 0x411111f0 },
1843 { 0x14, 0x411111f0 },
1844 { 0x15, 0x411111f0 },
1845 { 0x16, 0x411111f0 },
1846 { 0x17, 0x411111f0 },
1847 { 0x18, 0x411111f0 },
1848 { 0x19, 0x411111f0 },
1854 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1855 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1856 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1857 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1858 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1859 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1860 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1861 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1862 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1863 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1864 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1865 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1866 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1870 static const struct hda_model_fixup alc260_fixup_models[] = {
1871 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1872 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1873 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1874 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1880 static int patch_alc260(struct hda_codec *codec)
1882 struct alc_spec *spec;
1885 err = alc_alloc_spec(codec, 0x07);
1890 /* as quite a few machines require HP amp for speaker outputs,
1891 * it's easier to enable it unconditionally; even if it's unneeded,
1892 * it's almost harmless.
1894 spec->gen.prefer_hp_amp = 1;
1895 spec->gen.beep_nid = 0x01;
1897 spec->shutup = alc_eapd_shutup;
1899 alc_pre_init(codec);
1901 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1903 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1905 /* automatic parse from the BIOS config */
1906 err = alc260_parse_auto_config(codec);
1910 if (!spec->gen.no_analog) {
1911 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1916 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1927 * ALC882/883/885/888/889 support
1929 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1930 * configuration. Each pin widget can choose any input DACs and a mixer.
1931 * Each ADC is connected from a mixer of all inputs. This makes possible
1932 * 6-channel independent captures.
1934 * In addition, an independent DAC for the multi-playback (not used in this
1942 ALC882_FIXUP_ABIT_AW9D_MAX,
1943 ALC882_FIXUP_LENOVO_Y530,
1944 ALC882_FIXUP_PB_M5210,
1945 ALC882_FIXUP_ACER_ASPIRE_7736,
1946 ALC882_FIXUP_ASUS_W90V,
1948 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1949 ALC889_FIXUP_VAIO_TT,
1950 ALC888_FIXUP_EEE1601,
1954 ALC883_FIXUP_ACER_EAPD,
1959 ALC882_FIXUP_ASUS_W2JC,
1960 ALC882_FIXUP_ACER_ASPIRE_4930G,
1961 ALC882_FIXUP_ACER_ASPIRE_8930G,
1962 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1963 ALC885_FIXUP_MACPRO_GPIO,
1964 ALC889_FIXUP_DAC_ROUTE,
1965 ALC889_FIXUP_MBP_VREF,
1966 ALC889_FIXUP_IMAC91_VREF,
1967 ALC889_FIXUP_MBA11_VREF,
1968 ALC889_FIXUP_MBA21_VREF,
1969 ALC889_FIXUP_MP11_VREF,
1970 ALC889_FIXUP_MP41_VREF,
1971 ALC882_FIXUP_INV_DMIC,
1972 ALC882_FIXUP_NO_PRIMARY_HP,
1973 ALC887_FIXUP_ASUS_BASS,
1974 ALC887_FIXUP_BASS_CHMAP,
1975 ALC1220_FIXUP_GB_DUAL_CODECS,
1976 ALC1220_FIXUP_GB_X570,
1977 ALC1220_FIXUP_CLEVO_P950,
1978 ALC1220_FIXUP_CLEVO_PB51ED,
1979 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1980 ALC887_FIXUP_ASUS_AUDIO,
1981 ALC887_FIXUP_ASUS_HMIC,
1982 ALCS1200A_FIXUP_MIC_VREF,
1985 static void alc889_fixup_coef(struct hda_codec *codec,
1986 const struct hda_fixup *fix, int action)
1988 if (action != HDA_FIXUP_ACT_INIT)
1990 alc_update_coef_idx(codec, 7, 0, 0x2030);
1993 /* set up GPIO at initialization */
1994 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1995 const struct hda_fixup *fix, int action)
1997 struct alc_spec *spec = codec->spec;
1999 spec->gpio_write_delay = true;
2000 alc_fixup_gpio3(codec, fix, action);
2003 /* Fix the connection of some pins for ALC889:
2004 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2005 * work correctly (bko#42740)
2007 static void alc889_fixup_dac_route(struct hda_codec *codec,
2008 const struct hda_fixup *fix, int action)
2010 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2011 /* fake the connections during parsing the tree */
2012 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2013 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2014 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2015 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2016 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2017 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2018 } else if (action == HDA_FIXUP_ACT_PROBE) {
2019 /* restore the connections */
2020 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2021 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2022 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2023 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2024 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2028 /* Set VREF on HP pin */
2029 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2030 const struct hda_fixup *fix, int action)
2032 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2033 struct alc_spec *spec = codec->spec;
2036 if (action != HDA_FIXUP_ACT_INIT)
2038 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2039 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2040 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2042 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2043 val |= AC_PINCTL_VREF_80;
2044 snd_hda_set_pin_ctl(codec, nids[i], val);
2045 spec->gen.keep_vref_in_automute = 1;
2050 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2051 const hda_nid_t *nids, int num_nids)
2053 struct alc_spec *spec = codec->spec;
2056 for (i = 0; i < num_nids; i++) {
2058 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2059 val |= AC_PINCTL_VREF_50;
2060 snd_hda_set_pin_ctl(codec, nids[i], val);
2062 spec->gen.keep_vref_in_automute = 1;
2065 /* Set VREF on speaker pins on imac91 */
2066 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2067 const struct hda_fixup *fix, int action)
2069 static const hda_nid_t nids[] = { 0x18, 0x1a };
2071 if (action == HDA_FIXUP_ACT_INIT)
2072 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2075 /* Set VREF on speaker pins on mba11 */
2076 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2077 const struct hda_fixup *fix, int action)
2079 static const hda_nid_t nids[] = { 0x18 };
2081 if (action == HDA_FIXUP_ACT_INIT)
2082 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2085 /* Set VREF on speaker pins on mba21 */
2086 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2087 const struct hda_fixup *fix, int action)
2089 static const hda_nid_t nids[] = { 0x18, 0x19 };
2091 if (action == HDA_FIXUP_ACT_INIT)
2092 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2095 /* Don't take HP output as primary
2096 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2097 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2099 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2100 const struct hda_fixup *fix, int action)
2102 struct alc_spec *spec = codec->spec;
2103 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2104 spec->gen.no_primary_hp = 1;
2105 spec->gen.no_multi_io = 1;
2109 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2110 const struct hda_fixup *fix, int action);
2112 /* For dual-codec configuration, we need to disable some features to avoid
2113 * conflicts of kctls and PCM streams
2115 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2116 const struct hda_fixup *fix, int action)
2118 struct alc_spec *spec = codec->spec;
2120 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2122 /* disable vmaster */
2123 spec->gen.suppress_vmaster = 1;
2124 /* auto-mute and auto-mic switch don't work with multiple codecs */
2125 spec->gen.suppress_auto_mute = 1;
2126 spec->gen.suppress_auto_mic = 1;
2127 /* disable aamix as well */
2128 spec->gen.mixer_nid = 0;
2129 /* add location prefix to avoid conflicts */
2130 codec->force_pin_prefix = 1;
2133 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2134 const char *newname)
2136 struct snd_kcontrol *kctl;
2138 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2140 strcpy(kctl->id.name, newname);
2143 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2144 const struct hda_fixup *fix,
2147 alc_fixup_dual_codecs(codec, fix, action);
2149 case HDA_FIXUP_ACT_PRE_PROBE:
2150 /* override card longname to provide a unique UCM profile */
2151 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2153 case HDA_FIXUP_ACT_BUILD:
2154 /* rename Capture controls depending on the codec */
2155 rename_ctl(codec, "Capture Volume",
2157 "Rear-Panel Capture Volume" :
2158 "Front-Panel Capture Volume");
2159 rename_ctl(codec, "Capture Switch",
2161 "Rear-Panel Capture Switch" :
2162 "Front-Panel Capture Switch");
2167 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2168 const struct hda_fixup *fix,
2171 static const hda_nid_t conn1[] = { 0x0c };
2172 static const struct coef_fw gb_x570_coefs[] = {
2173 WRITE_COEF(0x07, 0x03c0),
2174 WRITE_COEF(0x1a, 0x01c1),
2175 WRITE_COEF(0x1b, 0x0202),
2176 WRITE_COEF(0x43, 0x3005),
2181 case HDA_FIXUP_ACT_PRE_PROBE:
2182 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2183 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2185 case HDA_FIXUP_ACT_INIT:
2186 alc_process_coef_fw(codec, gb_x570_coefs);
2191 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2192 const struct hda_fixup *fix,
2195 static const hda_nid_t conn1[] = { 0x0c };
2197 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2200 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2201 /* We therefore want to make sure 0x14 (front headphone) and
2202 * 0x1b (speakers) use the stereo DAC 0x02
2204 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2205 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2208 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2209 const struct hda_fixup *fix, int action);
2211 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2212 const struct hda_fixup *fix,
2215 alc1220_fixup_clevo_p950(codec, fix, action);
2216 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2219 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2220 struct hda_jack_callback *jack)
2222 struct alc_spec *spec = codec->spec;
2225 snd_hda_gen_hp_automute(codec, jack);
2227 if (spec->gen.hp_jack_present)
2228 vref = AC_PINCTL_VREF_80;
2230 vref = AC_PINCTL_VREF_HIZ;
2231 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2234 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2235 const struct hda_fixup *fix, int action)
2237 struct alc_spec *spec = codec->spec;
2238 if (action != HDA_FIXUP_ACT_PROBE)
2240 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2241 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2244 static const struct hda_fixup alc882_fixups[] = {
2245 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2246 .type = HDA_FIXUP_PINS,
2247 .v.pins = (const struct hda_pintbl[]) {
2248 { 0x15, 0x01080104 }, /* side */
2249 { 0x16, 0x01011012 }, /* rear */
2250 { 0x17, 0x01016011 }, /* clfe */
2254 [ALC882_FIXUP_LENOVO_Y530] = {
2255 .type = HDA_FIXUP_PINS,
2256 .v.pins = (const struct hda_pintbl[]) {
2257 { 0x15, 0x99130112 }, /* rear int speakers */
2258 { 0x16, 0x99130111 }, /* subwoofer */
2262 [ALC882_FIXUP_PB_M5210] = {
2263 .type = HDA_FIXUP_PINCTLS,
2264 .v.pins = (const struct hda_pintbl[]) {
2265 { 0x19, PIN_VREF50 },
2269 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2270 .type = HDA_FIXUP_FUNC,
2271 .v.func = alc_fixup_sku_ignore,
2273 [ALC882_FIXUP_ASUS_W90V] = {
2274 .type = HDA_FIXUP_PINS,
2275 .v.pins = (const struct hda_pintbl[]) {
2276 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2280 [ALC889_FIXUP_CD] = {
2281 .type = HDA_FIXUP_PINS,
2282 .v.pins = (const struct hda_pintbl[]) {
2283 { 0x1c, 0x993301f0 }, /* CD */
2287 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2288 .type = HDA_FIXUP_PINS,
2289 .v.pins = (const struct hda_pintbl[]) {
2290 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2294 .chain_id = ALC889_FIXUP_CD,
2296 [ALC889_FIXUP_VAIO_TT] = {
2297 .type = HDA_FIXUP_PINS,
2298 .v.pins = (const struct hda_pintbl[]) {
2299 { 0x17, 0x90170111 }, /* hidden surround speaker */
2303 [ALC888_FIXUP_EEE1601] = {
2304 .type = HDA_FIXUP_VERBS,
2305 .v.verbs = (const struct hda_verb[]) {
2306 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2307 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2311 [ALC886_FIXUP_EAPD] = {
2312 .type = HDA_FIXUP_VERBS,
2313 .v.verbs = (const struct hda_verb[]) {
2314 /* change to EAPD mode */
2315 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2316 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2320 [ALC882_FIXUP_EAPD] = {
2321 .type = HDA_FIXUP_VERBS,
2322 .v.verbs = (const struct hda_verb[]) {
2323 /* change to EAPD mode */
2324 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2325 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2329 [ALC883_FIXUP_EAPD] = {
2330 .type = HDA_FIXUP_VERBS,
2331 .v.verbs = (const struct hda_verb[]) {
2332 /* change to EAPD mode */
2333 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2334 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2338 [ALC883_FIXUP_ACER_EAPD] = {
2339 .type = HDA_FIXUP_VERBS,
2340 .v.verbs = (const struct hda_verb[]) {
2341 /* eanable EAPD on Acer laptops */
2342 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2343 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2347 [ALC882_FIXUP_GPIO1] = {
2348 .type = HDA_FIXUP_FUNC,
2349 .v.func = alc_fixup_gpio1,
2351 [ALC882_FIXUP_GPIO2] = {
2352 .type = HDA_FIXUP_FUNC,
2353 .v.func = alc_fixup_gpio2,
2355 [ALC882_FIXUP_GPIO3] = {
2356 .type = HDA_FIXUP_FUNC,
2357 .v.func = alc_fixup_gpio3,
2359 [ALC882_FIXUP_ASUS_W2JC] = {
2360 .type = HDA_FIXUP_FUNC,
2361 .v.func = alc_fixup_gpio1,
2363 .chain_id = ALC882_FIXUP_EAPD,
2365 [ALC889_FIXUP_COEF] = {
2366 .type = HDA_FIXUP_FUNC,
2367 .v.func = alc889_fixup_coef,
2369 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2370 .type = HDA_FIXUP_PINS,
2371 .v.pins = (const struct hda_pintbl[]) {
2372 { 0x16, 0x99130111 }, /* CLFE speaker */
2373 { 0x17, 0x99130112 }, /* surround speaker */
2377 .chain_id = ALC882_FIXUP_GPIO1,
2379 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2380 .type = HDA_FIXUP_PINS,
2381 .v.pins = (const struct hda_pintbl[]) {
2382 { 0x16, 0x99130111 }, /* CLFE speaker */
2383 { 0x1b, 0x99130112 }, /* surround speaker */
2387 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2389 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2390 /* additional init verbs for Acer Aspire 8930G */
2391 .type = HDA_FIXUP_VERBS,
2392 .v.verbs = (const struct hda_verb[]) {
2393 /* Enable all DACs */
2394 /* DAC DISABLE/MUTE 1? */
2395 /* setting bits 1-5 disables DAC nids 0x02-0x06
2396 * apparently. Init=0x38 */
2397 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2398 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2399 /* DAC DISABLE/MUTE 2? */
2400 /* some bit here disables the other DACs.
2402 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2403 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2405 * This laptop has a stereo digital microphone.
2406 * The mics are only 1cm apart which makes the stereo
2407 * useless. However, either the mic or the ALC889
2408 * makes the signal become a difference/sum signal
2409 * instead of standard stereo, which is annoying.
2410 * So instead we flip this bit which makes the
2411 * codec replicate the sum signal to both channels,
2412 * turning it into a normal mono mic.
2414 /* DMIC_CONTROL? Init value = 0x0001 */
2415 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2416 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2417 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2418 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2422 .chain_id = ALC882_FIXUP_GPIO1,
2424 [ALC885_FIXUP_MACPRO_GPIO] = {
2425 .type = HDA_FIXUP_FUNC,
2426 .v.func = alc885_fixup_macpro_gpio,
2428 [ALC889_FIXUP_DAC_ROUTE] = {
2429 .type = HDA_FIXUP_FUNC,
2430 .v.func = alc889_fixup_dac_route,
2432 [ALC889_FIXUP_MBP_VREF] = {
2433 .type = HDA_FIXUP_FUNC,
2434 .v.func = alc889_fixup_mbp_vref,
2436 .chain_id = ALC882_FIXUP_GPIO1,
2438 [ALC889_FIXUP_IMAC91_VREF] = {
2439 .type = HDA_FIXUP_FUNC,
2440 .v.func = alc889_fixup_imac91_vref,
2442 .chain_id = ALC882_FIXUP_GPIO1,
2444 [ALC889_FIXUP_MBA11_VREF] = {
2445 .type = HDA_FIXUP_FUNC,
2446 .v.func = alc889_fixup_mba11_vref,
2448 .chain_id = ALC889_FIXUP_MBP_VREF,
2450 [ALC889_FIXUP_MBA21_VREF] = {
2451 .type = HDA_FIXUP_FUNC,
2452 .v.func = alc889_fixup_mba21_vref,
2454 .chain_id = ALC889_FIXUP_MBP_VREF,
2456 [ALC889_FIXUP_MP11_VREF] = {
2457 .type = HDA_FIXUP_FUNC,
2458 .v.func = alc889_fixup_mba11_vref,
2460 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2462 [ALC889_FIXUP_MP41_VREF] = {
2463 .type = HDA_FIXUP_FUNC,
2464 .v.func = alc889_fixup_mbp_vref,
2466 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2468 [ALC882_FIXUP_INV_DMIC] = {
2469 .type = HDA_FIXUP_FUNC,
2470 .v.func = alc_fixup_inv_dmic,
2472 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2473 .type = HDA_FIXUP_FUNC,
2474 .v.func = alc882_fixup_no_primary_hp,
2476 [ALC887_FIXUP_ASUS_BASS] = {
2477 .type = HDA_FIXUP_PINS,
2478 .v.pins = (const struct hda_pintbl[]) {
2479 {0x16, 0x99130130}, /* bass speaker */
2483 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2485 [ALC887_FIXUP_BASS_CHMAP] = {
2486 .type = HDA_FIXUP_FUNC,
2487 .v.func = alc_fixup_bass_chmap,
2489 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2490 .type = HDA_FIXUP_FUNC,
2491 .v.func = alc1220_fixup_gb_dual_codecs,
2493 [ALC1220_FIXUP_GB_X570] = {
2494 .type = HDA_FIXUP_FUNC,
2495 .v.func = alc1220_fixup_gb_x570,
2497 [ALC1220_FIXUP_CLEVO_P950] = {
2498 .type = HDA_FIXUP_FUNC,
2499 .v.func = alc1220_fixup_clevo_p950,
2501 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2502 .type = HDA_FIXUP_FUNC,
2503 .v.func = alc1220_fixup_clevo_pb51ed,
2505 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2506 .type = HDA_FIXUP_PINS,
2507 .v.pins = (const struct hda_pintbl[]) {
2508 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2512 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2514 [ALC887_FIXUP_ASUS_AUDIO] = {
2515 .type = HDA_FIXUP_PINS,
2516 .v.pins = (const struct hda_pintbl[]) {
2517 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2518 { 0x19, 0x22219420 },
2522 [ALC887_FIXUP_ASUS_HMIC] = {
2523 .type = HDA_FIXUP_FUNC,
2524 .v.func = alc887_fixup_asus_jack,
2526 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2528 [ALCS1200A_FIXUP_MIC_VREF] = {
2529 .type = HDA_FIXUP_PINCTLS,
2530 .v.pins = (const struct hda_pintbl[]) {
2531 { 0x18, PIN_VREF50 }, /* rear mic */
2532 { 0x19, PIN_VREF50 }, /* front mic */
2538 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2539 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2540 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2541 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2542 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2543 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2544 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2545 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2546 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2547 ALC882_FIXUP_ACER_ASPIRE_4930G),
2548 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2549 ALC882_FIXUP_ACER_ASPIRE_4930G),
2550 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2551 ALC882_FIXUP_ACER_ASPIRE_8930G),
2552 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2553 ALC882_FIXUP_ACER_ASPIRE_8930G),
2554 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2555 ALC882_FIXUP_ACER_ASPIRE_4930G),
2556 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2557 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2558 ALC882_FIXUP_ACER_ASPIRE_4930G),
2559 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2560 ALC882_FIXUP_ACER_ASPIRE_4930G),
2561 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2562 ALC882_FIXUP_ACER_ASPIRE_4930G),
2563 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2564 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2565 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2566 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2567 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2568 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2569 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2570 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2571 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2572 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2573 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2574 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2575 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2576 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2577 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2578 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2580 /* All Apple entries are in codec SSIDs */
2581 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2582 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2583 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2584 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2585 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2586 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2587 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2588 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2589 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2590 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2591 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2592 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2593 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2594 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2595 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2596 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2597 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2598 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2599 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2600 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2601 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2602 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2604 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2605 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2606 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2607 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2608 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2609 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2610 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2611 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2612 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2613 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2614 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2615 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2616 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2617 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2618 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2619 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2620 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2621 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2622 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2623 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2624 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2625 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2626 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2627 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2628 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2629 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2630 SND_PCI_QUIRK(0x1558, 0x66a2, "Clevo PE60RNE", 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, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2636 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2637 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2638 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2639 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2640 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2641 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2642 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2643 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2644 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2645 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2646 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2647 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2648 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2649 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2650 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2651 SND_PCI_QUIRK(0x1558, 0xd502, "Clevo PD50SNE", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2652 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2653 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2654 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2655 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2659 static const struct hda_model_fixup alc882_fixup_models[] = {
2660 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2661 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2662 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2663 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2664 {.id = ALC889_FIXUP_CD, .name = "cd"},
2665 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2666 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2667 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2668 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2669 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2670 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2671 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2672 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2673 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2674 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2675 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2676 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2677 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2678 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2679 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2680 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2681 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2682 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2683 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2684 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2685 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2686 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2687 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2688 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2689 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2690 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2691 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2695 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2696 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2704 {0x1e, 0x01456130}),
2705 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2713 {0x1e, 0x01451130}),
2718 * BIOS auto configuration
2720 /* almost identical with ALC880 parser... */
2721 static int alc882_parse_auto_config(struct hda_codec *codec)
2723 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2724 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2725 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2730 static int patch_alc882(struct hda_codec *codec)
2732 struct alc_spec *spec;
2735 err = alc_alloc_spec(codec, 0x0b);
2741 switch (codec->core.vendor_id) {
2749 /* ALC883 and variants */
2750 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2754 alc_pre_init(codec);
2756 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2758 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2759 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2761 alc_auto_parse_customize_define(codec);
2763 if (has_cdefine_beep(codec))
2764 spec->gen.beep_nid = 0x01;
2766 /* automatic parse from the BIOS config */
2767 err = alc882_parse_auto_config(codec);
2771 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2772 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2777 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2790 static int alc262_parse_auto_config(struct hda_codec *codec)
2792 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2793 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2794 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2801 ALC262_FIXUP_FSC_H270,
2802 ALC262_FIXUP_FSC_S7110,
2803 ALC262_FIXUP_HP_Z200,
2805 ALC262_FIXUP_LENOVO_3000,
2807 ALC262_FIXUP_BENQ_T31,
2808 ALC262_FIXUP_INV_DMIC,
2809 ALC262_FIXUP_INTEL_BAYLEYBAY,
2812 static const struct hda_fixup alc262_fixups[] = {
2813 [ALC262_FIXUP_FSC_H270] = {
2814 .type = HDA_FIXUP_PINS,
2815 .v.pins = (const struct hda_pintbl[]) {
2816 { 0x14, 0x99130110 }, /* speaker */
2817 { 0x15, 0x0221142f }, /* front HP */
2818 { 0x1b, 0x0121141f }, /* rear HP */
2822 [ALC262_FIXUP_FSC_S7110] = {
2823 .type = HDA_FIXUP_PINS,
2824 .v.pins = (const struct hda_pintbl[]) {
2825 { 0x15, 0x90170110 }, /* speaker */
2829 .chain_id = ALC262_FIXUP_BENQ,
2831 [ALC262_FIXUP_HP_Z200] = {
2832 .type = HDA_FIXUP_PINS,
2833 .v.pins = (const struct hda_pintbl[]) {
2834 { 0x16, 0x99130120 }, /* internal speaker */
2838 [ALC262_FIXUP_TYAN] = {
2839 .type = HDA_FIXUP_PINS,
2840 .v.pins = (const struct hda_pintbl[]) {
2841 { 0x14, 0x1993e1f0 }, /* int AUX */
2845 [ALC262_FIXUP_LENOVO_3000] = {
2846 .type = HDA_FIXUP_PINCTLS,
2847 .v.pins = (const struct hda_pintbl[]) {
2848 { 0x19, PIN_VREF50 },
2852 .chain_id = ALC262_FIXUP_BENQ,
2854 [ALC262_FIXUP_BENQ] = {
2855 .type = HDA_FIXUP_VERBS,
2856 .v.verbs = (const struct hda_verb[]) {
2857 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2858 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2862 [ALC262_FIXUP_BENQ_T31] = {
2863 .type = HDA_FIXUP_VERBS,
2864 .v.verbs = (const struct hda_verb[]) {
2865 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2866 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2870 [ALC262_FIXUP_INV_DMIC] = {
2871 .type = HDA_FIXUP_FUNC,
2872 .v.func = alc_fixup_inv_dmic,
2874 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2875 .type = HDA_FIXUP_FUNC,
2876 .v.func = alc_fixup_no_depop_delay,
2880 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2881 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2882 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2883 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2884 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2885 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2886 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2887 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2888 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2889 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2890 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2894 static const struct hda_model_fixup alc262_fixup_models[] = {
2895 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2896 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2897 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2898 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2899 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2900 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2901 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2902 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2903 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2909 static int patch_alc262(struct hda_codec *codec)
2911 struct alc_spec *spec;
2914 err = alc_alloc_spec(codec, 0x0b);
2919 spec->gen.shared_mic_vref_pin = 0x18;
2921 spec->shutup = alc_eapd_shutup;
2924 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2927 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2929 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2931 alc_pre_init(codec);
2933 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2935 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2937 alc_auto_parse_customize_define(codec);
2939 if (has_cdefine_beep(codec))
2940 spec->gen.beep_nid = 0x01;
2942 /* automatic parse from the BIOS config */
2943 err = alc262_parse_auto_config(codec);
2947 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2948 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2953 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2965 /* bind Beep switches of both NID 0x0f and 0x10 */
2966 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2967 struct snd_ctl_elem_value *ucontrol)
2969 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2973 mutex_lock(&codec->control_mutex);
2974 pval = kcontrol->private_value;
2975 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2976 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2978 kcontrol->private_value = (pval & ~0xff) | 0x10;
2979 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2981 kcontrol->private_value = pval;
2982 mutex_unlock(&codec->control_mutex);
2986 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2987 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2989 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2990 .name = "Beep Playback Switch",
2991 .subdevice = HDA_SUBDEV_AMP_FLAG,
2992 .info = snd_hda_mixer_amp_switch_info,
2993 .get = snd_hda_mixer_amp_switch_get,
2994 .put = alc268_beep_switch_put,
2995 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2999 /* set PCBEEP vol = 0, mute connections */
3000 static const struct hda_verb alc268_beep_init_verbs[] = {
3001 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
3002 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3003 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3008 ALC268_FIXUP_INV_DMIC,
3009 ALC268_FIXUP_HP_EAPD,
3013 static const struct hda_fixup alc268_fixups[] = {
3014 [ALC268_FIXUP_INV_DMIC] = {
3015 .type = HDA_FIXUP_FUNC,
3016 .v.func = alc_fixup_inv_dmic,
3018 [ALC268_FIXUP_HP_EAPD] = {
3019 .type = HDA_FIXUP_VERBS,
3020 .v.verbs = (const struct hda_verb[]) {
3021 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3025 [ALC268_FIXUP_SPDIF] = {
3026 .type = HDA_FIXUP_PINS,
3027 .v.pins = (const struct hda_pintbl[]) {
3028 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3034 static const struct hda_model_fixup alc268_fixup_models[] = {
3035 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3036 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3037 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3041 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3042 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3043 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3044 /* below is codec SSID since multiple Toshiba laptops have the
3045 * same PCI SSID 1179:ff00
3047 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3052 * BIOS auto configuration
3054 static int alc268_parse_auto_config(struct hda_codec *codec)
3056 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3057 return alc_parse_auto_config(codec, NULL, alc268_ssids);
3062 static int patch_alc268(struct hda_codec *codec)
3064 struct alc_spec *spec;
3067 /* ALC268 has no aa-loopback mixer */
3068 err = alc_alloc_spec(codec, 0);
3073 if (has_cdefine_beep(codec))
3074 spec->gen.beep_nid = 0x01;
3076 spec->shutup = alc_eapd_shutup;
3078 alc_pre_init(codec);
3080 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3081 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3083 /* automatic parse from the BIOS config */
3084 err = alc268_parse_auto_config(codec);
3088 if (err > 0 && !spec->gen.no_analog &&
3089 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3090 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3091 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3092 &alc268_beep_mixer[i])) {
3097 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3098 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3099 /* override the amp caps for beep generator */
3100 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3101 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3102 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3103 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3104 (0 << AC_AMPCAP_MUTE_SHIFT));
3107 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3120 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3121 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3124 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3125 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3128 /* different alc269-variants */
3130 ALC269_TYPE_ALC269VA,
3131 ALC269_TYPE_ALC269VB,
3132 ALC269_TYPE_ALC269VC,
3133 ALC269_TYPE_ALC269VD,
3155 * BIOS auto configuration
3157 static int alc269_parse_auto_config(struct hda_codec *codec)
3159 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3160 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3161 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3162 struct alc_spec *spec = codec->spec;
3163 const hda_nid_t *ssids;
3165 switch (spec->codec_variant) {
3166 case ALC269_TYPE_ALC269VA:
3167 case ALC269_TYPE_ALC269VC:
3168 case ALC269_TYPE_ALC280:
3169 case ALC269_TYPE_ALC284:
3170 case ALC269_TYPE_ALC293:
3171 ssids = alc269va_ssids;
3173 case ALC269_TYPE_ALC269VB:
3174 case ALC269_TYPE_ALC269VD:
3175 case ALC269_TYPE_ALC282:
3176 case ALC269_TYPE_ALC283:
3177 case ALC269_TYPE_ALC286:
3178 case ALC269_TYPE_ALC298:
3179 case ALC269_TYPE_ALC255:
3180 case ALC269_TYPE_ALC256:
3181 case ALC269_TYPE_ALC257:
3182 case ALC269_TYPE_ALC215:
3183 case ALC269_TYPE_ALC225:
3184 case ALC269_TYPE_ALC245:
3185 case ALC269_TYPE_ALC287:
3186 case ALC269_TYPE_ALC294:
3187 case ALC269_TYPE_ALC300:
3188 case ALC269_TYPE_ALC623:
3189 case ALC269_TYPE_ALC700:
3190 ssids = alc269_ssids;
3193 ssids = alc269_ssids;
3197 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3200 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3201 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3202 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3203 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3204 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3208 static void alc_headset_btn_callback(struct hda_codec *codec,
3209 struct hda_jack_callback *jack)
3213 if (jack->unsol_res & (7 << 13))
3214 report |= SND_JACK_BTN_0;
3216 if (jack->unsol_res & (1 << 16 | 3 << 8))
3217 report |= SND_JACK_BTN_1;
3220 if (jack->unsol_res & (7 << 23))
3221 report |= SND_JACK_BTN_2;
3223 /* Volume down key */
3224 if (jack->unsol_res & (7 << 10))
3225 report |= SND_JACK_BTN_3;
3227 snd_hda_jack_set_button_state(codec, jack->nid, report);
3230 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3232 struct alc_spec *spec = codec->spec;
3234 if (!spec->has_hs_key)
3237 switch (codec->core.vendor_id) {
3245 alc_write_coef_idx(codec, 0x48, 0x0);
3246 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3247 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3253 alc_write_coef_idx(codec, 0x48, 0x0);
3254 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3259 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3261 struct alc_spec *spec = codec->spec;
3263 if (!spec->has_hs_key)
3266 switch (codec->core.vendor_id) {
3274 alc_write_coef_idx(codec, 0x48, 0xd011);
3275 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3276 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3282 alc_write_coef_idx(codec, 0x48, 0xd011);
3283 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3288 static void alc_fixup_headset_jack(struct hda_codec *codec,
3289 const struct hda_fixup *fix, int action)
3291 struct alc_spec *spec = codec->spec;
3295 case HDA_FIXUP_ACT_PRE_PROBE:
3296 spec->has_hs_key = 1;
3297 snd_hda_jack_detect_enable_callback(codec, 0x55,
3298 alc_headset_btn_callback);
3300 case HDA_FIXUP_ACT_BUILD:
3301 hp_pin = alc_get_hp_pin(spec);
3302 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3303 alc_headset_btn_keymap,
3305 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3306 false, SND_JACK_HEADSET,
3307 alc_headset_btn_keymap);
3309 alc_enable_headset_jack_key(codec);
3314 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3316 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3319 static void alc269_shutup(struct hda_codec *codec)
3321 struct alc_spec *spec = codec->spec;
3323 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3324 alc269vb_toggle_power_output(codec, 0);
3325 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3326 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3329 alc_shutup_pins(codec);
3332 static const struct coef_fw alc282_coefs[] = {
3333 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3334 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3335 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3336 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3337 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3338 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3339 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3340 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3341 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3342 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3343 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3344 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3345 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3346 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3347 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3348 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3349 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3350 WRITE_COEF(0x63, 0x2902), /* PLL */
3351 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3352 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3353 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3354 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3355 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3356 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3357 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3358 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3359 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3360 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3361 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3365 static void alc282_restore_default_value(struct hda_codec *codec)
3367 alc_process_coef_fw(codec, alc282_coefs);
3370 static void alc282_init(struct hda_codec *codec)
3372 struct alc_spec *spec = codec->spec;
3373 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3377 alc282_restore_default_value(codec);
3381 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3382 coef78 = alc_read_coef_idx(codec, 0x78);
3384 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3385 /* Headphone capless set to high power mode */
3386 alc_write_coef_idx(codec, 0x78, 0x9004);
3391 snd_hda_codec_write(codec, hp_pin, 0,
3392 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3397 snd_hda_codec_write(codec, hp_pin, 0,
3398 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3403 /* Headphone capless set to normal mode */
3404 alc_write_coef_idx(codec, 0x78, coef78);
3407 static void alc282_shutup(struct hda_codec *codec)
3409 struct alc_spec *spec = codec->spec;
3410 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3415 alc269_shutup(codec);
3419 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3420 coef78 = alc_read_coef_idx(codec, 0x78);
3421 alc_write_coef_idx(codec, 0x78, 0x9004);
3426 snd_hda_codec_write(codec, hp_pin, 0,
3427 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3432 if (!spec->no_shutup_pins)
3433 snd_hda_codec_write(codec, hp_pin, 0,
3434 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3439 alc_auto_setup_eapd(codec, false);
3440 alc_shutup_pins(codec);
3441 alc_write_coef_idx(codec, 0x78, coef78);
3444 static const struct coef_fw alc283_coefs[] = {
3445 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3446 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3447 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3448 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3449 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3450 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3451 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3452 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3453 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3454 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3455 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3456 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3457 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3458 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3459 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3460 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3461 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3462 WRITE_COEF(0x2e, 0x2902), /* PLL */
3463 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3464 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3465 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3466 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3467 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3468 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3469 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3470 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3471 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3472 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3473 WRITE_COEF(0x49, 0x0), /* test mode */
3474 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3475 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3476 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3477 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3481 static void alc283_restore_default_value(struct hda_codec *codec)
3483 alc_process_coef_fw(codec, alc283_coefs);
3486 static void alc283_init(struct hda_codec *codec)
3488 struct alc_spec *spec = codec->spec;
3489 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3492 alc283_restore_default_value(codec);
3498 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3500 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3501 /* Headphone capless set to high power mode */
3502 alc_write_coef_idx(codec, 0x43, 0x9004);
3504 snd_hda_codec_write(codec, hp_pin, 0,
3505 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3510 snd_hda_codec_write(codec, hp_pin, 0,
3511 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3515 /* Index 0x46 Combo jack auto switch control 2 */
3516 /* 3k pull low control for Headset jack. */
3517 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3518 /* Headphone capless set to normal mode */
3519 alc_write_coef_idx(codec, 0x43, 0x9614);
3522 static void alc283_shutup(struct hda_codec *codec)
3524 struct alc_spec *spec = codec->spec;
3525 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3529 alc269_shutup(codec);
3533 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3535 alc_write_coef_idx(codec, 0x43, 0x9004);
3537 /*depop hp during suspend*/
3538 alc_write_coef_idx(codec, 0x06, 0x2100);
3540 snd_hda_codec_write(codec, hp_pin, 0,
3541 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3546 if (!spec->no_shutup_pins)
3547 snd_hda_codec_write(codec, hp_pin, 0,
3548 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3550 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3554 alc_auto_setup_eapd(codec, false);
3555 alc_shutup_pins(codec);
3556 alc_write_coef_idx(codec, 0x43, 0x9614);
3559 static void alc256_init(struct hda_codec *codec)
3561 struct alc_spec *spec = codec->spec;
3562 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3565 if (spec->ultra_low_power) {
3566 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3567 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3568 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3569 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3570 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3579 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3584 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3586 snd_hda_codec_write(codec, hp_pin, 0,
3587 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3589 if (hp_pin_sense || spec->ultra_low_power)
3592 snd_hda_codec_write(codec, hp_pin, 0,
3593 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3595 if (hp_pin_sense || spec->ultra_low_power)
3598 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3599 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3600 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3601 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3603 * Expose headphone mic (or possibly Line In on some machines) instead
3604 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3605 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3608 alc_write_coef_idx(codec, 0x36, 0x5757);
3611 static void alc256_shutup(struct hda_codec *codec)
3613 struct alc_spec *spec = codec->spec;
3614 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3620 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3621 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3626 snd_hda_codec_write(codec, hp_pin, 0,
3627 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3629 if (hp_pin_sense || spec->ultra_low_power)
3632 /* 3k pull low control for Headset jack. */
3633 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3634 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3635 * when booting with headset plugged. So skip setting it for the codec alc257
3637 if (spec->en_3kpull_low)
3638 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3640 if (!spec->no_shutup_pins)
3641 snd_hda_codec_write(codec, hp_pin, 0,
3642 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3644 if (hp_pin_sense || spec->ultra_low_power)
3647 alc_auto_setup_eapd(codec, false);
3648 alc_shutup_pins(codec);
3649 if (spec->ultra_low_power) {
3651 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3652 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3653 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3654 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3655 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3660 static void alc285_hp_init(struct hda_codec *codec)
3662 struct alc_spec *spec = codec->spec;
3663 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3665 int coef38, coef0d, coef36;
3667 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3668 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3669 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3670 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3671 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3672 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3674 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3677 snd_hda_codec_write(codec, hp_pin, 0,
3678 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3681 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3682 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3685 snd_hda_codec_write(codec, hp_pin, 0,
3686 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3688 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3689 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3690 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3691 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3693 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3694 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3695 for (i = 0; i < 20 && val & 0x8000; i++) {
3697 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3698 } /* Wait for depop procedure finish */
3700 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3701 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3702 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3703 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3706 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3709 static void alc225_init(struct hda_codec *codec)
3711 struct alc_spec *spec = codec->spec;
3712 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3713 bool hp1_pin_sense, hp2_pin_sense;
3715 if (spec->ultra_low_power) {
3716 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3717 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3718 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3722 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3723 spec->codec_variant != ALC269_TYPE_ALC245)
3724 /* required only at boot or S3 and S4 resume time */
3725 if (!spec->done_hp_init ||
3726 is_s3_resume(codec) ||
3727 is_s4_resume(codec)) {
3728 alc285_hp_init(codec);
3729 spec->done_hp_init = true;
3736 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3737 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3739 if (hp1_pin_sense || hp2_pin_sense)
3742 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3744 if (hp1_pin_sense || spec->ultra_low_power)
3745 snd_hda_codec_write(codec, hp_pin, 0,
3746 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3748 snd_hda_codec_write(codec, 0x16, 0,
3749 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3751 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3754 if (hp1_pin_sense || spec->ultra_low_power)
3755 snd_hda_codec_write(codec, hp_pin, 0,
3756 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3758 snd_hda_codec_write(codec, 0x16, 0,
3759 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3761 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3764 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3765 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3768 static void alc225_shutup(struct hda_codec *codec)
3770 struct alc_spec *spec = codec->spec;
3771 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3772 bool hp1_pin_sense, hp2_pin_sense;
3777 alc_disable_headset_jack_key(codec);
3778 /* 3k pull low control for Headset jack. */
3779 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3781 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3782 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3784 if (hp1_pin_sense || hp2_pin_sense)
3787 if (hp1_pin_sense || spec->ultra_low_power)
3788 snd_hda_codec_write(codec, hp_pin, 0,
3789 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3791 snd_hda_codec_write(codec, 0x16, 0,
3792 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3794 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3797 if (hp1_pin_sense || spec->ultra_low_power)
3798 snd_hda_codec_write(codec, hp_pin, 0,
3799 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3801 snd_hda_codec_write(codec, 0x16, 0,
3802 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3804 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3807 alc_auto_setup_eapd(codec, false);
3808 alc_shutup_pins(codec);
3809 if (spec->ultra_low_power) {
3811 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3812 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3813 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3814 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3818 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3819 alc_enable_headset_jack_key(codec);
3822 static void alc_default_init(struct hda_codec *codec)
3824 struct alc_spec *spec = codec->spec;
3825 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3833 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3838 snd_hda_codec_write(codec, hp_pin, 0,
3839 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3844 snd_hda_codec_write(codec, hp_pin, 0,
3845 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3851 static void alc_default_shutup(struct hda_codec *codec)
3853 struct alc_spec *spec = codec->spec;
3854 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3858 alc269_shutup(codec);
3862 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3867 snd_hda_codec_write(codec, hp_pin, 0,
3868 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3873 if (!spec->no_shutup_pins)
3874 snd_hda_codec_write(codec, hp_pin, 0,
3875 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3880 alc_auto_setup_eapd(codec, false);
3881 alc_shutup_pins(codec);
3884 static void alc294_hp_init(struct hda_codec *codec)
3886 struct alc_spec *spec = codec->spec;
3887 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3893 snd_hda_codec_write(codec, hp_pin, 0,
3894 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3898 if (!spec->no_shutup_pins)
3899 snd_hda_codec_write(codec, hp_pin, 0,
3900 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3902 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3903 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3905 /* Wait for depop procedure finish */
3906 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3907 for (i = 0; i < 20 && val & 0x0080; i++) {
3909 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3911 /* Set HP depop to auto mode */
3912 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3916 static void alc294_init(struct hda_codec *codec)
3918 struct alc_spec *spec = codec->spec;
3920 /* required only at boot or S4 resume time */
3921 if (!spec->done_hp_init ||
3922 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3923 alc294_hp_init(codec);
3924 spec->done_hp_init = true;
3926 alc_default_init(codec);
3929 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3932 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3933 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3934 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3937 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3941 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3942 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3944 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3949 static void alc5505_dsp_halt(struct hda_codec *codec)
3953 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3954 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3955 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3956 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3957 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3958 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3959 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3960 val = alc5505_coef_get(codec, 0x6220);
3961 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3964 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3966 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3967 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3968 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3969 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3970 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3971 alc5505_coef_set(codec, 0x880c, 0x00000004);
3974 static void alc5505_dsp_init(struct hda_codec *codec)
3978 alc5505_dsp_halt(codec);
3979 alc5505_dsp_back_from_halt(codec);
3980 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3981 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3982 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3983 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3984 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3985 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3986 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3987 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3988 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3989 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3990 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3991 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3992 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3994 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3996 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3998 alc5505_coef_set(codec, 0x6220, 0x6002018f);
4000 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
4001 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
4002 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
4003 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4004 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4005 alc5505_coef_set(codec, 0x880c, 0x00000003);
4006 alc5505_coef_set(codec, 0x880c, 0x00000010);
4008 #ifdef HALT_REALTEK_ALC5505
4009 alc5505_dsp_halt(codec);
4013 #ifdef HALT_REALTEK_ALC5505
4014 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4015 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
4017 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4018 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4022 static int alc269_suspend(struct hda_codec *codec)
4024 struct alc_spec *spec = codec->spec;
4026 if (spec->has_alc5505_dsp)
4027 alc5505_dsp_suspend(codec);
4028 return alc_suspend(codec);
4031 static int alc269_resume(struct hda_codec *codec)
4033 struct alc_spec *spec = codec->spec;
4035 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4036 alc269vb_toggle_power_output(codec, 0);
4037 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4038 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
4042 codec->patch_ops.init(codec);
4044 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4045 alc269vb_toggle_power_output(codec, 1);
4046 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4047 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
4051 snd_hda_regmap_sync(codec);
4052 hda_call_check_power_status(codec, 0x01);
4054 /* on some machine, the BIOS will clear the codec gpio data when enter
4055 * suspend, and won't restore the data after resume, so we restore it
4058 if (spec->gpio_data)
4059 alc_write_gpio_data(codec);
4061 if (spec->has_alc5505_dsp)
4062 alc5505_dsp_resume(codec);
4066 #endif /* CONFIG_PM */
4068 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4069 const struct hda_fixup *fix, int action)
4071 struct alc_spec *spec = codec->spec;
4073 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4074 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4077 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4078 const struct hda_fixup *fix,
4081 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4082 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4084 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4085 snd_hda_codec_set_pincfg(codec, 0x19,
4086 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4087 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4090 static void alc269_fixup_hweq(struct hda_codec *codec,
4091 const struct hda_fixup *fix, int action)
4093 if (action == HDA_FIXUP_ACT_INIT)
4094 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4097 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4098 const struct hda_fixup *fix, int action)
4100 struct alc_spec *spec = codec->spec;
4102 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4103 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4106 static void alc271_fixup_dmic(struct hda_codec *codec,
4107 const struct hda_fixup *fix, int action)
4109 static const struct hda_verb verbs[] = {
4110 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4111 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4116 if (strcmp(codec->core.chip_name, "ALC271X") &&
4117 strcmp(codec->core.chip_name, "ALC269VB"))
4119 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4120 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4121 snd_hda_sequence_write(codec, verbs);
4124 /* Fix the speaker amp after resume, etc */
4125 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4126 const struct hda_fixup *fix,
4129 if (action == HDA_FIXUP_ACT_INIT)
4130 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4133 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4134 const struct hda_fixup *fix, int action)
4136 struct alc_spec *spec = codec->spec;
4138 if (action != HDA_FIXUP_ACT_PROBE)
4141 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4142 * fix the sample rate of analog I/O to 44.1kHz
4144 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4145 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4148 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4149 const struct hda_fixup *fix, int action)
4151 /* The digital-mic unit sends PDM (differential signal) instead of
4152 * the standard PCM, thus you can't record a valid mono stream as is.
4153 * Below is a workaround specific to ALC269 to control the dmic
4154 * signal source as mono.
4156 if (action == HDA_FIXUP_ACT_INIT)
4157 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4160 static void alc269_quanta_automute(struct hda_codec *codec)
4162 snd_hda_gen_update_outputs(codec);
4164 alc_write_coef_idx(codec, 0x0c, 0x680);
4165 alc_write_coef_idx(codec, 0x0c, 0x480);
4168 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4169 const struct hda_fixup *fix, int action)
4171 struct alc_spec *spec = codec->spec;
4172 if (action != HDA_FIXUP_ACT_PROBE)
4174 spec->gen.automute_hook = alc269_quanta_automute;
4177 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4178 struct hda_jack_callback *jack)
4180 struct alc_spec *spec = codec->spec;
4183 snd_hda_gen_hp_automute(codec, jack);
4185 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4187 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4190 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4195 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4197 struct hda_alc298_mbxinit {
4198 unsigned char value_0x23;
4199 unsigned char value_0x25;
4202 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4203 const struct hda_alc298_mbxinit *initval,
4206 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4207 alc_write_coef_idx(codec, 0x26, 0xb000);
4210 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4212 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4213 alc_write_coef_idx(codec, 0x26, 0xf000);
4214 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4216 if (initval->value_0x23 != 0x1e)
4217 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4219 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4220 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4223 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4224 const struct hda_fixup *fix,
4227 /* Initialization magic */
4228 static const struct hda_alc298_mbxinit dac_init[] = {
4229 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4230 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4231 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4232 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4233 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4234 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4236 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4237 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4238 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4241 const struct hda_alc298_mbxinit *seq;
4243 if (action != HDA_FIXUP_ACT_INIT)
4247 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4248 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4249 alc_write_coef_idx(codec, 0x26, 0xf000);
4250 alc_write_coef_idx(codec, 0x22, 0x31);
4251 alc_write_coef_idx(codec, 0x23, 0x0b);
4252 alc_write_coef_idx(codec, 0x25, 0x00);
4253 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4254 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4256 for (seq = dac_init; seq->value_0x23; seq++)
4257 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4260 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4261 const struct hda_fixup *fix, int action)
4263 struct alc_spec *spec = codec->spec;
4264 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4265 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4266 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4270 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4271 bool polarity, bool on)
4273 unsigned int pinval;
4279 pinval = snd_hda_codec_get_pin_target(codec, pin);
4280 pinval &= ~AC_PINCTL_VREFEN;
4281 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4282 /* temporarily power up/down for setting VREF */
4283 snd_hda_power_up_pm(codec);
4284 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4285 snd_hda_power_down_pm(codec);
4288 /* update mute-LED according to the speaker mute state via mic VREF pin */
4289 static int vref_mute_led_set(struct led_classdev *led_cdev,
4290 enum led_brightness brightness)
4292 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4293 struct alc_spec *spec = codec->spec;
4295 alc_update_vref_led(codec, spec->mute_led_nid,
4296 spec->mute_led_polarity, brightness);
4300 /* Make sure the led works even in runtime suspend */
4301 static unsigned int led_power_filter(struct hda_codec *codec,
4303 unsigned int power_state)
4305 struct alc_spec *spec = codec->spec;
4307 if (power_state != AC_PWRST_D3 || nid == 0 ||
4308 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4311 /* Set pin ctl again, it might have just been set to 0 */
4312 snd_hda_set_pin_ctl(codec, nid,
4313 snd_hda_codec_get_pin_target(codec, nid));
4315 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4318 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4319 const struct hda_fixup *fix, int action)
4321 struct alc_spec *spec = codec->spec;
4322 const struct dmi_device *dev = NULL;
4324 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4327 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4329 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4331 if (pin < 0x0a || pin >= 0x10)
4333 spec->mute_led_polarity = pol;
4334 spec->mute_led_nid = pin - 0x0a + 0x18;
4335 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4336 codec->power_filter = led_power_filter;
4338 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4339 spec->mute_led_polarity);
4344 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4345 const struct hda_fixup *fix,
4346 int action, hda_nid_t pin)
4348 struct alc_spec *spec = codec->spec;
4350 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4351 spec->mute_led_polarity = 0;
4352 spec->mute_led_nid = pin;
4353 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4354 codec->power_filter = led_power_filter;
4358 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4359 const struct hda_fixup *fix, int action)
4361 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4364 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4365 const struct hda_fixup *fix, int action)
4367 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4370 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4371 const struct hda_fixup *fix, int action)
4373 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4376 /* update LED status via GPIO */
4377 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4378 int polarity, bool enabled)
4382 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4385 /* turn on/off mute LED via GPIO per vmaster hook */
4386 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4387 enum led_brightness brightness)
4389 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4390 struct alc_spec *spec = codec->spec;
4392 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4393 spec->mute_led_polarity, !brightness);
4397 /* turn on/off mic-mute LED via GPIO per capture hook */
4398 static int micmute_led_set(struct led_classdev *led_cdev,
4399 enum led_brightness brightness)
4401 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4402 struct alc_spec *spec = codec->spec;
4404 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4405 spec->micmute_led_polarity, !brightness);
4409 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4410 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4412 unsigned int mute_mask,
4413 unsigned int micmute_mask)
4415 struct alc_spec *spec = codec->spec;
4417 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4419 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4422 spec->gpio_mute_led_mask = mute_mask;
4423 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4426 spec->gpio_mic_led_mask = micmute_mask;
4427 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4431 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4432 const struct hda_fixup *fix, int action)
4434 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4437 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4438 const struct hda_fixup *fix, int action)
4440 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4443 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4444 const struct hda_fixup *fix, int action)
4446 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4449 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4450 const struct hda_fixup *fix, int action)
4452 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4455 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4456 const struct hda_fixup *fix, int action)
4458 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4461 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4462 const struct hda_fixup *fix, int action)
4464 struct alc_spec *spec = codec->spec;
4466 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4467 spec->micmute_led_polarity = 1;
4468 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4471 /* turn on/off mic-mute LED per capture hook via VREF change */
4472 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4473 enum led_brightness brightness)
4475 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4476 struct alc_spec *spec = codec->spec;
4478 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4479 spec->micmute_led_polarity, brightness);
4483 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4484 const struct hda_fixup *fix, int action)
4486 struct alc_spec *spec = codec->spec;
4488 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4489 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4490 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4491 * enable headphone amp
4493 spec->gpio_mask |= 0x10;
4494 spec->gpio_dir |= 0x10;
4495 spec->cap_mute_led_nid = 0x18;
4496 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4497 codec->power_filter = led_power_filter;
4501 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4502 const struct hda_fixup *fix, int action)
4504 struct alc_spec *spec = codec->spec;
4506 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4507 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4508 spec->cap_mute_led_nid = 0x18;
4509 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4510 codec->power_filter = led_power_filter;
4514 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4515 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4517 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4518 const struct hda_fixup *fix, int action)
4520 struct alc_spec *spec = codec->spec;
4523 case HDA_FIXUP_ACT_PRE_PROBE:
4524 spec->gpio_mask |= 0x01;
4525 spec->gpio_dir |= 0x01;
4527 case HDA_FIXUP_ACT_INIT:
4528 /* need to toggle GPIO to enable the amp */
4529 alc_update_gpio_data(codec, 0x01, true);
4531 alc_update_gpio_data(codec, 0x01, false);
4536 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4537 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4538 struct hda_codec *codec,
4539 struct snd_pcm_substream *substream,
4543 case HDA_GEN_PCM_ACT_PREPARE:
4544 alc_update_gpio_data(codec, 0x04, true);
4546 case HDA_GEN_PCM_ACT_CLEANUP:
4547 alc_update_gpio_data(codec, 0x04, false);
4552 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4553 const struct hda_fixup *fix,
4556 struct alc_spec *spec = codec->spec;
4558 if (action == HDA_FIXUP_ACT_PROBE) {
4559 spec->gpio_mask |= 0x04;
4560 spec->gpio_dir |= 0x04;
4561 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4565 static void alc_update_coef_led(struct hda_codec *codec,
4566 struct alc_coef_led *led,
4567 bool polarity, bool on)
4571 /* temporarily power up/down for setting COEF bit */
4572 alc_update_coef_idx(codec, led->idx, led->mask,
4573 on ? led->on : led->off);
4576 /* update mute-LED according to the speaker mute state via COEF bit */
4577 static int coef_mute_led_set(struct led_classdev *led_cdev,
4578 enum led_brightness brightness)
4580 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4581 struct alc_spec *spec = codec->spec;
4583 alc_update_coef_led(codec, &spec->mute_led_coef,
4584 spec->mute_led_polarity, brightness);
4588 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4589 const struct hda_fixup *fix,
4592 struct alc_spec *spec = codec->spec;
4594 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4595 spec->mute_led_polarity = 0;
4596 spec->mute_led_coef.idx = 0x0b;
4597 spec->mute_led_coef.mask = 1 << 3;
4598 spec->mute_led_coef.on = 1 << 3;
4599 spec->mute_led_coef.off = 0;
4600 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4604 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4605 const struct hda_fixup *fix,
4608 struct alc_spec *spec = codec->spec;
4610 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4611 spec->mute_led_polarity = 0;
4612 spec->mute_led_coef.idx = 0x34;
4613 spec->mute_led_coef.mask = 1 << 5;
4614 spec->mute_led_coef.on = 0;
4615 spec->mute_led_coef.off = 1 << 5;
4616 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4620 static void alc236_fixup_hp_mute_led_coefbit2(struct hda_codec *codec,
4621 const struct hda_fixup *fix, int action)
4623 struct alc_spec *spec = codec->spec;
4625 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4626 spec->mute_led_polarity = 0;
4627 spec->mute_led_coef.idx = 0x07;
4628 spec->mute_led_coef.mask = 1;
4629 spec->mute_led_coef.on = 1;
4630 spec->mute_led_coef.off = 0;
4631 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4635 /* turn on/off mic-mute LED per capture hook by coef bit */
4636 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4637 enum led_brightness brightness)
4639 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4640 struct alc_spec *spec = codec->spec;
4642 alc_update_coef_led(codec, &spec->mic_led_coef,
4643 spec->micmute_led_polarity, brightness);
4647 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4648 const struct hda_fixup *fix, int action)
4650 struct alc_spec *spec = codec->spec;
4652 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4653 spec->mic_led_coef.idx = 0x19;
4654 spec->mic_led_coef.mask = 1 << 13;
4655 spec->mic_led_coef.on = 1 << 13;
4656 spec->mic_led_coef.off = 0;
4657 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4661 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4662 const struct hda_fixup *fix, int action)
4664 struct alc_spec *spec = codec->spec;
4666 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4667 spec->micmute_led_polarity = 1;
4668 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4671 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4672 const struct hda_fixup *fix, int action)
4674 struct alc_spec *spec = codec->spec;
4676 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4677 spec->mic_led_coef.idx = 0x35;
4678 spec->mic_led_coef.mask = 3 << 2;
4679 spec->mic_led_coef.on = 2 << 2;
4680 spec->mic_led_coef.off = 1 << 2;
4681 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4685 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4686 const struct hda_fixup *fix, int action)
4688 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4689 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4692 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4693 const struct hda_fixup *fix, int action)
4695 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4696 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4699 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4700 const struct hda_fixup *fix, int action)
4702 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4703 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4706 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4707 const struct hda_fixup *fix, int action)
4709 struct alc_spec *spec = codec->spec;
4711 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4712 spec->cap_mute_led_nid = 0x1a;
4713 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4714 codec->power_filter = led_power_filter;
4718 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4719 const struct hda_fixup *fix, int action)
4721 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4722 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4725 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4726 const unsigned short coefs[2])
4728 alc_write_coef_idx(codec, 0x23, coefs[0]);
4729 alc_write_coef_idx(codec, 0x25, coefs[1]);
4730 alc_write_coef_idx(codec, 0x26, 0xb011);
4733 struct alc298_samsung_amp_desc {
4735 unsigned short init_seq[2][2];
4738 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4739 const struct hda_fixup *fix, int action)
4742 static const unsigned short init_seq[][2] = {
4743 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4744 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4745 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4746 { 0x41, 0x07 }, { 0x400, 0x1 }
4748 static const struct alc298_samsung_amp_desc amps[] = {
4749 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4750 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4753 if (action != HDA_FIXUP_ACT_INIT)
4756 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4757 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4759 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4760 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4762 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4763 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4767 #if IS_REACHABLE(CONFIG_INPUT)
4768 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4769 struct hda_jack_callback *event)
4771 struct alc_spec *spec = codec->spec;
4773 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4774 send both key on and key off event for every interrupt. */
4775 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4776 input_sync(spec->kb_dev);
4777 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4778 input_sync(spec->kb_dev);
4781 static int alc_register_micmute_input_device(struct hda_codec *codec)
4783 struct alc_spec *spec = codec->spec;
4786 spec->kb_dev = input_allocate_device();
4787 if (!spec->kb_dev) {
4788 codec_err(codec, "Out of memory (input_allocate_device)\n");
4792 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4794 spec->kb_dev->name = "Microphone Mute Button";
4795 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4796 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4797 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4798 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4799 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4800 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4802 if (input_register_device(spec->kb_dev)) {
4803 codec_err(codec, "input_register_device failed\n");
4804 input_free_device(spec->kb_dev);
4805 spec->kb_dev = NULL;
4812 /* GPIO1 = set according to SKU external amp
4813 * GPIO2 = mic mute hotkey
4815 * GPIO4 = mic mute LED
4817 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4818 const struct hda_fixup *fix, int action)
4820 struct alc_spec *spec = codec->spec;
4822 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4823 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4824 spec->init_amp = ALC_INIT_DEFAULT;
4825 if (alc_register_micmute_input_device(codec) != 0)
4828 spec->gpio_mask |= 0x06;
4829 spec->gpio_dir |= 0x02;
4830 spec->gpio_data |= 0x02;
4831 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4832 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4833 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4834 gpio2_mic_hotkey_event);
4842 case HDA_FIXUP_ACT_FREE:
4843 input_unregister_device(spec->kb_dev);
4844 spec->kb_dev = NULL;
4848 /* Line2 = mic mute hotkey
4849 * GPIO2 = mic mute LED
4851 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4852 const struct hda_fixup *fix, int action)
4854 struct alc_spec *spec = codec->spec;
4856 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4857 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4858 spec->init_amp = ALC_INIT_DEFAULT;
4859 if (alc_register_micmute_input_device(codec) != 0)
4862 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4863 gpio2_mic_hotkey_event);
4871 case HDA_FIXUP_ACT_FREE:
4872 input_unregister_device(spec->kb_dev);
4873 spec->kb_dev = NULL;
4877 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4878 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4881 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4882 const struct hda_fixup *fix, int action)
4884 struct alc_spec *spec = codec->spec;
4886 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4887 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4888 spec->cap_mute_led_nid = 0x18;
4889 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4893 static const struct coef_fw alc225_pre_hsmode[] = {
4894 UPDATE_COEF(0x4a, 1<<8, 0),
4895 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4896 UPDATE_COEF(0x63, 3<<14, 3<<14),
4897 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4898 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4899 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4900 UPDATE_COEF(0x4a, 3<<10, 0),
4904 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4906 struct alc_spec *spec = codec->spec;
4907 static const struct coef_fw coef0255[] = {
4908 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4909 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4910 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4911 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4912 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4915 static const struct coef_fw coef0256[] = {
4916 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4917 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4918 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4919 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4920 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4923 static const struct coef_fw coef0233[] = {
4924 WRITE_COEF(0x1b, 0x0c0b),
4925 WRITE_COEF(0x45, 0xc429),
4926 UPDATE_COEF(0x35, 0x4000, 0),
4927 WRITE_COEF(0x06, 0x2104),
4928 WRITE_COEF(0x1a, 0x0001),
4929 WRITE_COEF(0x26, 0x0004),
4930 WRITE_COEF(0x32, 0x42a3),
4933 static const struct coef_fw coef0288[] = {
4934 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4935 UPDATE_COEF(0x50, 0x2000, 0x2000),
4936 UPDATE_COEF(0x56, 0x0006, 0x0006),
4937 UPDATE_COEF(0x66, 0x0008, 0),
4938 UPDATE_COEF(0x67, 0x2000, 0),
4941 static const struct coef_fw coef0298[] = {
4942 UPDATE_COEF(0x19, 0x1300, 0x0300),
4945 static const struct coef_fw coef0292[] = {
4946 WRITE_COEF(0x76, 0x000e),
4947 WRITE_COEF(0x6c, 0x2400),
4948 WRITE_COEF(0x18, 0x7308),
4949 WRITE_COEF(0x6b, 0xc429),
4952 static const struct coef_fw coef0293[] = {
4953 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4954 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4955 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4956 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4957 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4958 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4961 static const struct coef_fw coef0668[] = {
4962 WRITE_COEF(0x15, 0x0d40),
4963 WRITE_COEF(0xb7, 0x802b),
4966 static const struct coef_fw coef0225[] = {
4967 UPDATE_COEF(0x63, 3<<14, 0),
4970 static const struct coef_fw coef0274[] = {
4971 UPDATE_COEF(0x4a, 0x0100, 0),
4972 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4973 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4974 UPDATE_COEF(0x4a, 0x0010, 0),
4975 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4976 WRITE_COEF(0x45, 0x5289),
4977 UPDATE_COEF(0x4a, 0x0c00, 0),
4981 if (spec->no_internal_mic_pin) {
4982 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4986 switch (codec->core.vendor_id) {
4988 alc_process_coef_fw(codec, coef0255);
4994 alc_process_coef_fw(codec, coef0256);
4999 alc_process_coef_fw(codec, coef0274);
5003 alc_process_coef_fw(codec, coef0233);
5007 alc_process_coef_fw(codec, coef0288);
5010 alc_process_coef_fw(codec, coef0298);
5011 alc_process_coef_fw(codec, coef0288);
5014 alc_process_coef_fw(codec, coef0292);
5017 alc_process_coef_fw(codec, coef0293);
5020 alc_process_coef_fw(codec, coef0668);
5028 alc_process_coef_fw(codec, alc225_pre_hsmode);
5029 alc_process_coef_fw(codec, coef0225);
5032 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5035 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5039 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5042 static const struct coef_fw coef0255[] = {
5043 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5044 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5047 static const struct coef_fw coef0256[] = {
5048 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5049 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5050 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5053 static const struct coef_fw coef0233[] = {
5054 UPDATE_COEF(0x35, 0, 1<<14),
5055 WRITE_COEF(0x06, 0x2100),
5056 WRITE_COEF(0x1a, 0x0021),
5057 WRITE_COEF(0x26, 0x008c),
5060 static const struct coef_fw coef0288[] = {
5061 UPDATE_COEF(0x4f, 0x00c0, 0),
5062 UPDATE_COEF(0x50, 0x2000, 0),
5063 UPDATE_COEF(0x56, 0x0006, 0),
5064 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5065 UPDATE_COEF(0x66, 0x0008, 0x0008),
5066 UPDATE_COEF(0x67, 0x2000, 0x2000),
5069 static const struct coef_fw coef0292[] = {
5070 WRITE_COEF(0x19, 0xa208),
5071 WRITE_COEF(0x2e, 0xacf0),
5074 static const struct coef_fw coef0293[] = {
5075 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5076 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5077 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5080 static const struct coef_fw coef0688[] = {
5081 WRITE_COEF(0xb7, 0x802b),
5082 WRITE_COEF(0xb5, 0x1040),
5083 UPDATE_COEF(0xc3, 0, 1<<12),
5086 static const struct coef_fw coef0225[] = {
5087 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5088 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5089 UPDATE_COEF(0x63, 3<<14, 0),
5092 static const struct coef_fw coef0274[] = {
5093 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5094 UPDATE_COEF(0x4a, 0x0010, 0),
5095 UPDATE_COEF(0x6b, 0xf000, 0),
5099 switch (codec->core.vendor_id) {
5101 alc_write_coef_idx(codec, 0x45, 0xc489);
5102 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5103 alc_process_coef_fw(codec, coef0255);
5104 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5110 alc_write_coef_idx(codec, 0x45, 0xc489);
5111 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5112 alc_process_coef_fw(codec, coef0256);
5113 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5118 alc_write_coef_idx(codec, 0x45, 0x4689);
5119 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5120 alc_process_coef_fw(codec, coef0274);
5121 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5125 alc_write_coef_idx(codec, 0x45, 0xc429);
5126 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5127 alc_process_coef_fw(codec, coef0233);
5128 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5133 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5134 alc_process_coef_fw(codec, coef0288);
5135 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5138 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5139 alc_process_coef_fw(codec, coef0292);
5142 /* Set to TRS mode */
5143 alc_write_coef_idx(codec, 0x45, 0xc429);
5144 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5145 alc_process_coef_fw(codec, coef0293);
5146 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5149 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5153 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5154 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5157 alc_write_coef_idx(codec, 0x11, 0x0001);
5158 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5159 alc_process_coef_fw(codec, coef0688);
5160 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5168 alc_process_coef_fw(codec, alc225_pre_hsmode);
5169 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5170 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5171 alc_process_coef_fw(codec, coef0225);
5172 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5175 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5178 static void alc_headset_mode_default(struct hda_codec *codec)
5180 static const struct coef_fw coef0225[] = {
5181 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5182 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5183 UPDATE_COEF(0x49, 3<<8, 0<<8),
5184 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5185 UPDATE_COEF(0x63, 3<<14, 0),
5186 UPDATE_COEF(0x67, 0xf000, 0x3000),
5189 static const struct coef_fw coef0255[] = {
5190 WRITE_COEF(0x45, 0xc089),
5191 WRITE_COEF(0x45, 0xc489),
5192 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5193 WRITE_COEF(0x49, 0x0049),
5196 static const struct coef_fw coef0256[] = {
5197 WRITE_COEF(0x45, 0xc489),
5198 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5199 WRITE_COEF(0x49, 0x0049),
5200 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5201 WRITE_COEF(0x06, 0x6100),
5204 static const struct coef_fw coef0233[] = {
5205 WRITE_COEF(0x06, 0x2100),
5206 WRITE_COEF(0x32, 0x4ea3),
5209 static const struct coef_fw coef0288[] = {
5210 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5211 UPDATE_COEF(0x50, 0x2000, 0x2000),
5212 UPDATE_COEF(0x56, 0x0006, 0x0006),
5213 UPDATE_COEF(0x66, 0x0008, 0),
5214 UPDATE_COEF(0x67, 0x2000, 0),
5217 static const struct coef_fw coef0292[] = {
5218 WRITE_COEF(0x76, 0x000e),
5219 WRITE_COEF(0x6c, 0x2400),
5220 WRITE_COEF(0x6b, 0xc429),
5221 WRITE_COEF(0x18, 0x7308),
5224 static const struct coef_fw coef0293[] = {
5225 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5226 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5227 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5230 static const struct coef_fw coef0688[] = {
5231 WRITE_COEF(0x11, 0x0041),
5232 WRITE_COEF(0x15, 0x0d40),
5233 WRITE_COEF(0xb7, 0x802b),
5236 static const struct coef_fw coef0274[] = {
5237 WRITE_COEF(0x45, 0x4289),
5238 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5239 UPDATE_COEF(0x6b, 0x0f00, 0),
5240 UPDATE_COEF(0x49, 0x0300, 0x0300),
5244 switch (codec->core.vendor_id) {
5251 alc_process_coef_fw(codec, alc225_pre_hsmode);
5252 alc_process_coef_fw(codec, coef0225);
5255 alc_process_coef_fw(codec, coef0255);
5261 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5262 alc_write_coef_idx(codec, 0x45, 0xc089);
5264 alc_process_coef_fw(codec, coef0256);
5269 alc_process_coef_fw(codec, coef0274);
5273 alc_process_coef_fw(codec, coef0233);
5278 alc_process_coef_fw(codec, coef0288);
5281 alc_process_coef_fw(codec, coef0292);
5284 alc_process_coef_fw(codec, coef0293);
5287 alc_process_coef_fw(codec, coef0688);
5290 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5293 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5297 static void alc_headset_mode_ctia(struct hda_codec *codec)
5301 static const struct coef_fw coef0255[] = {
5302 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5303 WRITE_COEF(0x1b, 0x0c2b),
5304 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5307 static const struct coef_fw coef0256[] = {
5308 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5309 WRITE_COEF(0x1b, 0x0e6b),
5312 static const struct coef_fw coef0233[] = {
5313 WRITE_COEF(0x45, 0xd429),
5314 WRITE_COEF(0x1b, 0x0c2b),
5315 WRITE_COEF(0x32, 0x4ea3),
5318 static const struct coef_fw coef0288[] = {
5319 UPDATE_COEF(0x50, 0x2000, 0x2000),
5320 UPDATE_COEF(0x56, 0x0006, 0x0006),
5321 UPDATE_COEF(0x66, 0x0008, 0),
5322 UPDATE_COEF(0x67, 0x2000, 0),
5325 static const struct coef_fw coef0292[] = {
5326 WRITE_COEF(0x6b, 0xd429),
5327 WRITE_COEF(0x76, 0x0008),
5328 WRITE_COEF(0x18, 0x7388),
5331 static const struct coef_fw coef0293[] = {
5332 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5333 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5336 static const struct coef_fw coef0688[] = {
5337 WRITE_COEF(0x11, 0x0001),
5338 WRITE_COEF(0x15, 0x0d60),
5339 WRITE_COEF(0xc3, 0x0000),
5342 static const struct coef_fw coef0225_1[] = {
5343 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5344 UPDATE_COEF(0x63, 3<<14, 2<<14),
5347 static const struct coef_fw coef0225_2[] = {
5348 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5349 UPDATE_COEF(0x63, 3<<14, 1<<14),
5353 switch (codec->core.vendor_id) {
5355 alc_process_coef_fw(codec, coef0255);
5361 alc_process_coef_fw(codec, coef0256);
5366 alc_write_coef_idx(codec, 0x45, 0xd689);
5370 alc_process_coef_fw(codec, coef0233);
5373 val = alc_read_coef_idx(codec, 0x50);
5374 if (val & (1 << 12)) {
5375 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5376 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5379 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5380 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5386 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5388 alc_process_coef_fw(codec, coef0288);
5391 alc_process_coef_fw(codec, coef0292);
5394 alc_process_coef_fw(codec, coef0293);
5397 alc_process_coef_fw(codec, coef0688);
5405 val = alc_read_coef_idx(codec, 0x45);
5407 alc_process_coef_fw(codec, coef0225_2);
5409 alc_process_coef_fw(codec, coef0225_1);
5412 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5415 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5419 static void alc_headset_mode_omtp(struct hda_codec *codec)
5421 static const struct coef_fw coef0255[] = {
5422 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5423 WRITE_COEF(0x1b, 0x0c2b),
5424 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5427 static const struct coef_fw coef0256[] = {
5428 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5429 WRITE_COEF(0x1b, 0x0e6b),
5432 static const struct coef_fw coef0233[] = {
5433 WRITE_COEF(0x45, 0xe429),
5434 WRITE_COEF(0x1b, 0x0c2b),
5435 WRITE_COEF(0x32, 0x4ea3),
5438 static const struct coef_fw coef0288[] = {
5439 UPDATE_COEF(0x50, 0x2000, 0x2000),
5440 UPDATE_COEF(0x56, 0x0006, 0x0006),
5441 UPDATE_COEF(0x66, 0x0008, 0),
5442 UPDATE_COEF(0x67, 0x2000, 0),
5445 static const struct coef_fw coef0292[] = {
5446 WRITE_COEF(0x6b, 0xe429),
5447 WRITE_COEF(0x76, 0x0008),
5448 WRITE_COEF(0x18, 0x7388),
5451 static const struct coef_fw coef0293[] = {
5452 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5453 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5456 static const struct coef_fw coef0688[] = {
5457 WRITE_COEF(0x11, 0x0001),
5458 WRITE_COEF(0x15, 0x0d50),
5459 WRITE_COEF(0xc3, 0x0000),
5462 static const struct coef_fw coef0225[] = {
5463 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5464 UPDATE_COEF(0x63, 3<<14, 2<<14),
5468 switch (codec->core.vendor_id) {
5470 alc_process_coef_fw(codec, coef0255);
5476 alc_process_coef_fw(codec, coef0256);
5481 alc_write_coef_idx(codec, 0x45, 0xe689);
5485 alc_process_coef_fw(codec, coef0233);
5488 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5489 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5494 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5496 alc_process_coef_fw(codec, coef0288);
5499 alc_process_coef_fw(codec, coef0292);
5502 alc_process_coef_fw(codec, coef0293);
5505 alc_process_coef_fw(codec, coef0688);
5513 alc_process_coef_fw(codec, coef0225);
5516 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5519 static void alc_determine_headset_type(struct hda_codec *codec)
5522 bool is_ctia = false;
5523 struct alc_spec *spec = codec->spec;
5524 static const struct coef_fw coef0255[] = {
5525 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5526 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5530 static const struct coef_fw coef0288[] = {
5531 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5534 static const struct coef_fw coef0298[] = {
5535 UPDATE_COEF(0x50, 0x2000, 0x2000),
5536 UPDATE_COEF(0x56, 0x0006, 0x0006),
5537 UPDATE_COEF(0x66, 0x0008, 0),
5538 UPDATE_COEF(0x67, 0x2000, 0),
5539 UPDATE_COEF(0x19, 0x1300, 0x1300),
5542 static const struct coef_fw coef0293[] = {
5543 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5544 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5547 static const struct coef_fw coef0688[] = {
5548 WRITE_COEF(0x11, 0x0001),
5549 WRITE_COEF(0xb7, 0x802b),
5550 WRITE_COEF(0x15, 0x0d60),
5551 WRITE_COEF(0xc3, 0x0c00),
5554 static const struct coef_fw coef0274[] = {
5555 UPDATE_COEF(0x4a, 0x0010, 0),
5556 UPDATE_COEF(0x4a, 0x8000, 0),
5557 WRITE_COEF(0x45, 0xd289),
5558 UPDATE_COEF(0x49, 0x0300, 0x0300),
5562 if (spec->no_internal_mic_pin) {
5563 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5567 switch (codec->core.vendor_id) {
5569 alc_process_coef_fw(codec, coef0255);
5571 val = alc_read_coef_idx(codec, 0x46);
5572 is_ctia = (val & 0x0070) == 0x0070;
5578 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5579 alc_write_coef_idx(codec, 0x06, 0x6104);
5580 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5582 snd_hda_codec_write(codec, 0x21, 0,
5583 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5585 snd_hda_codec_write(codec, 0x21, 0,
5586 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5588 alc_process_coef_fw(codec, coef0255);
5590 val = alc_read_coef_idx(codec, 0x46);
5591 is_ctia = (val & 0x0070) == 0x0070;
5593 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5594 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5596 snd_hda_codec_write(codec, 0x21, 0,
5597 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5599 snd_hda_codec_write(codec, 0x21, 0,
5600 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5605 alc_process_coef_fw(codec, coef0274);
5607 val = alc_read_coef_idx(codec, 0x46);
5608 is_ctia = (val & 0x00f0) == 0x00f0;
5612 alc_write_coef_idx(codec, 0x45, 0xd029);
5614 val = alc_read_coef_idx(codec, 0x46);
5615 is_ctia = (val & 0x0070) == 0x0070;
5618 snd_hda_codec_write(codec, 0x21, 0,
5619 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5621 snd_hda_codec_write(codec, 0x21, 0,
5622 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5625 val = alc_read_coef_idx(codec, 0x50);
5626 if (val & (1 << 12)) {
5627 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5628 alc_process_coef_fw(codec, coef0288);
5630 val = alc_read_coef_idx(codec, 0x50);
5631 is_ctia = (val & 0x0070) == 0x0070;
5633 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5634 alc_process_coef_fw(codec, coef0288);
5636 val = alc_read_coef_idx(codec, 0x50);
5637 is_ctia = (val & 0x0070) == 0x0070;
5639 alc_process_coef_fw(codec, coef0298);
5640 snd_hda_codec_write(codec, 0x21, 0,
5641 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5643 snd_hda_codec_write(codec, 0x21, 0,
5644 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5648 alc_process_coef_fw(codec, coef0288);
5650 val = alc_read_coef_idx(codec, 0x50);
5651 is_ctia = (val & 0x0070) == 0x0070;
5654 alc_write_coef_idx(codec, 0x6b, 0xd429);
5656 val = alc_read_coef_idx(codec, 0x6c);
5657 is_ctia = (val & 0x001c) == 0x001c;
5660 alc_process_coef_fw(codec, coef0293);
5662 val = alc_read_coef_idx(codec, 0x46);
5663 is_ctia = (val & 0x0070) == 0x0070;
5666 alc_process_coef_fw(codec, coef0688);
5668 val = alc_read_coef_idx(codec, 0xbe);
5669 is_ctia = (val & 0x1c02) == 0x1c02;
5677 snd_hda_codec_write(codec, 0x21, 0,
5678 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5680 snd_hda_codec_write(codec, 0x21, 0,
5681 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5683 alc_process_coef_fw(codec, alc225_pre_hsmode);
5684 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5685 val = alc_read_coef_idx(codec, 0x45);
5686 if (val & (1 << 9)) {
5687 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5688 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5690 val = alc_read_coef_idx(codec, 0x46);
5691 is_ctia = (val & 0x00f0) == 0x00f0;
5693 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5694 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5696 val = alc_read_coef_idx(codec, 0x46);
5697 is_ctia = (val & 0x00f0) == 0x00f0;
5699 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5700 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5701 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5703 snd_hda_codec_write(codec, 0x21, 0,
5704 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5706 snd_hda_codec_write(codec, 0x21, 0,
5707 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5714 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5715 is_ctia ? "yes" : "no");
5716 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5719 static void alc_update_headset_mode(struct hda_codec *codec)
5721 struct alc_spec *spec = codec->spec;
5723 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5724 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5726 int new_headset_mode;
5728 if (!snd_hda_jack_detect(codec, hp_pin))
5729 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5730 else if (mux_pin == spec->headset_mic_pin)
5731 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5732 else if (mux_pin == spec->headphone_mic_pin)
5733 new_headset_mode = ALC_HEADSET_MODE_MIC;
5735 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5737 if (new_headset_mode == spec->current_headset_mode) {
5738 snd_hda_gen_update_outputs(codec);
5742 switch (new_headset_mode) {
5743 case ALC_HEADSET_MODE_UNPLUGGED:
5744 alc_headset_mode_unplugged(codec);
5745 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5746 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5747 spec->gen.hp_jack_present = false;
5749 case ALC_HEADSET_MODE_HEADSET:
5750 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5751 alc_determine_headset_type(codec);
5752 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5753 alc_headset_mode_ctia(codec);
5754 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5755 alc_headset_mode_omtp(codec);
5756 spec->gen.hp_jack_present = true;
5758 case ALC_HEADSET_MODE_MIC:
5759 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5760 spec->gen.hp_jack_present = false;
5762 case ALC_HEADSET_MODE_HEADPHONE:
5763 alc_headset_mode_default(codec);
5764 spec->gen.hp_jack_present = true;
5767 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5768 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5769 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5770 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5771 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5774 spec->current_headset_mode = new_headset_mode;
5776 snd_hda_gen_update_outputs(codec);
5779 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5780 struct snd_kcontrol *kcontrol,
5781 struct snd_ctl_elem_value *ucontrol)
5783 alc_update_headset_mode(codec);
5786 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5787 struct hda_jack_callback *jack)
5789 snd_hda_gen_hp_automute(codec, jack);
5790 alc_update_headset_mode(codec);
5793 static void alc_probe_headset_mode(struct hda_codec *codec)
5796 struct alc_spec *spec = codec->spec;
5797 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5800 for (i = 0; i < cfg->num_inputs; i++) {
5801 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5802 spec->headset_mic_pin = cfg->inputs[i].pin;
5803 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5804 spec->headphone_mic_pin = cfg->inputs[i].pin;
5807 WARN_ON(spec->gen.cap_sync_hook);
5808 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5809 spec->gen.automute_hook = alc_update_headset_mode;
5810 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5813 static void alc_fixup_headset_mode(struct hda_codec *codec,
5814 const struct hda_fixup *fix, int action)
5816 struct alc_spec *spec = codec->spec;
5819 case HDA_FIXUP_ACT_PRE_PROBE:
5820 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5822 case HDA_FIXUP_ACT_PROBE:
5823 alc_probe_headset_mode(codec);
5825 case HDA_FIXUP_ACT_INIT:
5826 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5827 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5828 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5830 alc_update_headset_mode(codec);
5835 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5836 const struct hda_fixup *fix, int action)
5838 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5839 struct alc_spec *spec = codec->spec;
5840 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5843 alc_fixup_headset_mode(codec, fix, action);
5846 static void alc255_set_default_jack_type(struct hda_codec *codec)
5848 /* Set to iphone type */
5849 static const struct coef_fw alc255fw[] = {
5850 WRITE_COEF(0x1b, 0x880b),
5851 WRITE_COEF(0x45, 0xd089),
5852 WRITE_COEF(0x1b, 0x080b),
5853 WRITE_COEF(0x46, 0x0004),
5854 WRITE_COEF(0x1b, 0x0c0b),
5857 static const struct coef_fw alc256fw[] = {
5858 WRITE_COEF(0x1b, 0x884b),
5859 WRITE_COEF(0x45, 0xd089),
5860 WRITE_COEF(0x1b, 0x084b),
5861 WRITE_COEF(0x46, 0x0004),
5862 WRITE_COEF(0x1b, 0x0c4b),
5865 switch (codec->core.vendor_id) {
5867 alc_process_coef_fw(codec, alc255fw);
5873 alc_process_coef_fw(codec, alc256fw);
5879 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5880 const struct hda_fixup *fix, int action)
5882 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5883 alc255_set_default_jack_type(codec);
5885 alc_fixup_headset_mode(codec, fix, action);
5888 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5889 const struct hda_fixup *fix, int action)
5891 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5892 struct alc_spec *spec = codec->spec;
5893 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5894 alc255_set_default_jack_type(codec);
5897 alc_fixup_headset_mode(codec, fix, action);
5900 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5901 struct hda_jack_callback *jack)
5903 struct alc_spec *spec = codec->spec;
5905 alc_update_headset_jack_cb(codec, jack);
5906 /* Headset Mic enable or disable, only for Dell Dino */
5907 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5910 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5911 const struct hda_fixup *fix, int action)
5913 alc_fixup_headset_mode(codec, fix, action);
5914 if (action == HDA_FIXUP_ACT_PROBE) {
5915 struct alc_spec *spec = codec->spec;
5916 /* toggled via hp_automute_hook */
5917 spec->gpio_mask |= 0x40;
5918 spec->gpio_dir |= 0x40;
5919 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5923 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5924 const struct hda_fixup *fix, int action)
5926 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5927 struct alc_spec *spec = codec->spec;
5928 spec->gen.auto_mute_via_amp = 1;
5932 static void alc_fixup_no_shutup(struct hda_codec *codec,
5933 const struct hda_fixup *fix, int action)
5935 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5936 struct alc_spec *spec = codec->spec;
5937 spec->no_shutup_pins = 1;
5941 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5942 const struct hda_fixup *fix, int action)
5944 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5945 struct alc_spec *spec = codec->spec;
5946 /* Disable AA-loopback as it causes white noise */
5947 spec->gen.mixer_nid = 0;
5951 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5952 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5953 const struct hda_fixup *fix, int action)
5955 static const struct hda_pintbl pincfgs[] = {
5956 { 0x16, 0x21211010 }, /* dock headphone */
5957 { 0x19, 0x21a11010 }, /* dock mic */
5960 struct alc_spec *spec = codec->spec;
5962 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5963 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5964 codec->power_save_node = 0; /* avoid click noises */
5965 snd_hda_apply_pincfgs(codec, pincfgs);
5969 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5970 const struct hda_fixup *fix, int action)
5972 static const struct hda_pintbl pincfgs[] = {
5973 { 0x17, 0x21211010 }, /* dock headphone */
5974 { 0x19, 0x21a11010 }, /* dock mic */
5977 struct alc_spec *spec = codec->spec;
5979 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5980 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5981 snd_hda_apply_pincfgs(codec, pincfgs);
5982 } else if (action == HDA_FIXUP_ACT_INIT) {
5983 /* Enable DOCK device */
5984 snd_hda_codec_write(codec, 0x17, 0,
5985 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5986 /* Enable DOCK device */
5987 snd_hda_codec_write(codec, 0x19, 0,
5988 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5992 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5993 const struct hda_fixup *fix, int action)
5995 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5996 * the speaker output becomes too low by some reason on Thinkpads with
5999 static const hda_nid_t preferred_pairs[] = {
6000 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
6003 struct alc_spec *spec = codec->spec;
6005 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6006 spec->gen.preferred_dacs = preferred_pairs;
6009 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
6010 const struct hda_fixup *fix, int action)
6012 static const hda_nid_t preferred_pairs[] = {
6013 0x17, 0x02, 0x21, 0x03, 0
6015 struct alc_spec *spec = codec->spec;
6017 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6018 spec->gen.preferred_dacs = preferred_pairs;
6021 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6023 struct alc_spec *spec = codec->spec;
6024 int hp_pin = alc_get_hp_pin(spec);
6026 /* Prevent pop noises when headphones are plugged in */
6027 snd_hda_codec_write(codec, hp_pin, 0,
6028 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6032 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6033 const struct hda_fixup *fix, int action)
6035 struct alc_spec *spec = codec->spec;
6036 struct hda_input_mux *imux = &spec->gen.input_mux;
6040 case HDA_FIXUP_ACT_PRE_PROBE:
6041 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6042 * it causes a click noise at start up
6044 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6045 spec->shutup = alc_shutup_dell_xps13;
6047 case HDA_FIXUP_ACT_PROBE:
6048 /* Make the internal mic the default input source. */
6049 for (i = 0; i < imux->num_items; i++) {
6050 if (spec->gen.imux_pins[i] == 0x12) {
6051 spec->gen.cur_mux[0] = i;
6059 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6060 const struct hda_fixup *fix, int action)
6062 struct alc_spec *spec = codec->spec;
6064 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6065 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6066 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6068 /* Disable boost for mic-in permanently. (This code is only called
6069 from quirks that guarantee that the headphone is at NID 0x1b.) */
6070 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6071 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6073 alc_fixup_headset_mode(codec, fix, action);
6076 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6077 const struct hda_fixup *fix, int action)
6079 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6080 alc_write_coef_idx(codec, 0xc4, 0x8000);
6081 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6082 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6084 alc_fixup_headset_mode(codec, fix, action);
6087 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6088 static int find_ext_mic_pin(struct hda_codec *codec)
6090 struct alc_spec *spec = codec->spec;
6091 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6093 unsigned int defcfg;
6096 for (i = 0; i < cfg->num_inputs; i++) {
6097 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6099 nid = cfg->inputs[i].pin;
6100 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6101 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6109 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6110 const struct hda_fixup *fix,
6113 struct alc_spec *spec = codec->spec;
6115 if (action == HDA_FIXUP_ACT_PROBE) {
6116 int mic_pin = find_ext_mic_pin(codec);
6117 int hp_pin = alc_get_hp_pin(spec);
6119 if (snd_BUG_ON(!mic_pin || !hp_pin))
6121 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6125 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6126 const struct hda_fixup *fix,
6129 struct alc_spec *spec = codec->spec;
6130 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6133 /* The mic boosts on level 2 and 3 are too noisy
6134 on the internal mic input.
6135 Therefore limit the boost to 0 or 1. */
6137 if (action != HDA_FIXUP_ACT_PROBE)
6140 for (i = 0; i < cfg->num_inputs; i++) {
6141 hda_nid_t nid = cfg->inputs[i].pin;
6142 unsigned int defcfg;
6143 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6145 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6146 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6149 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6150 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6151 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6152 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6153 (0 << AC_AMPCAP_MUTE_SHIFT));
6157 static void alc283_hp_automute_hook(struct hda_codec *codec,
6158 struct hda_jack_callback *jack)
6160 struct alc_spec *spec = codec->spec;
6164 snd_hda_gen_hp_automute(codec, jack);
6166 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6169 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6173 static void alc283_fixup_chromebook(struct hda_codec *codec,
6174 const struct hda_fixup *fix, int action)
6176 struct alc_spec *spec = codec->spec;
6179 case HDA_FIXUP_ACT_PRE_PROBE:
6180 snd_hda_override_wcaps(codec, 0x03, 0);
6181 /* Disable AA-loopback as it causes white noise */
6182 spec->gen.mixer_nid = 0;
6184 case HDA_FIXUP_ACT_INIT:
6185 /* MIC2-VREF control */
6186 /* Set to manual mode */
6187 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6188 /* Enable Line1 input control by verb */
6189 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6194 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6195 const struct hda_fixup *fix, int action)
6197 struct alc_spec *spec = codec->spec;
6200 case HDA_FIXUP_ACT_PRE_PROBE:
6201 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6203 case HDA_FIXUP_ACT_INIT:
6204 /* MIC2-VREF control */
6205 /* Set to manual mode */
6206 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6211 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6212 static void asus_tx300_automute(struct hda_codec *codec)
6214 struct alc_spec *spec = codec->spec;
6215 snd_hda_gen_update_outputs(codec);
6216 if (snd_hda_jack_detect(codec, 0x1b))
6217 spec->gen.mute_bits |= (1ULL << 0x14);
6220 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6221 const struct hda_fixup *fix, int action)
6223 struct alc_spec *spec = codec->spec;
6224 static const struct hda_pintbl dock_pins[] = {
6225 { 0x1b, 0x21114000 }, /* dock speaker pin */
6230 case HDA_FIXUP_ACT_PRE_PROBE:
6231 spec->init_amp = ALC_INIT_DEFAULT;
6232 /* TX300 needs to set up GPIO2 for the speaker amp */
6233 alc_setup_gpio(codec, 0x04);
6234 snd_hda_apply_pincfgs(codec, dock_pins);
6235 spec->gen.auto_mute_via_amp = 1;
6236 spec->gen.automute_hook = asus_tx300_automute;
6237 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6238 snd_hda_gen_hp_automute);
6240 case HDA_FIXUP_ACT_PROBE:
6241 spec->init_amp = ALC_INIT_DEFAULT;
6243 case HDA_FIXUP_ACT_BUILD:
6244 /* this is a bit tricky; give more sane names for the main
6245 * (tablet) speaker and the dock speaker, respectively
6247 rename_ctl(codec, "Speaker Playback Switch",
6248 "Dock Speaker Playback Switch");
6249 rename_ctl(codec, "Bass Speaker Playback Switch",
6250 "Speaker Playback Switch");
6255 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6256 const struct hda_fixup *fix, int action)
6258 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6259 /* DAC node 0x03 is giving mono output. We therefore want to
6260 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6261 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6262 static const hda_nid_t conn1[] = { 0x0c };
6263 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6264 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6268 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6269 const struct hda_fixup *fix, int action)
6271 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6272 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6273 we can't adjust the speaker's volume since this node does not has
6274 Amp-out capability. we change the speaker's route to:
6275 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6276 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6277 speaker's volume now. */
6279 static const hda_nid_t conn1[] = { 0x0c };
6280 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6284 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6285 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6286 const struct hda_fixup *fix, int action)
6288 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6289 static const hda_nid_t conn[] = { 0x02, 0x03 };
6290 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6294 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6295 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6296 const struct hda_fixup *fix, int action)
6298 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6299 static const hda_nid_t conn[] = { 0x02 };
6300 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6304 /* Hook to update amp GPIO4 for automute */
6305 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6306 struct hda_jack_callback *jack)
6308 struct alc_spec *spec = codec->spec;
6310 snd_hda_gen_hp_automute(codec, jack);
6311 /* mute_led_polarity is set to 0, so we pass inverted value here */
6312 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6313 !spec->gen.hp_jack_present);
6316 /* Manage GPIOs for HP EliteBook Folio 9480m.
6318 * GPIO4 is the headphone amplifier power control
6319 * GPIO3 is the audio output mute indicator LED
6322 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6323 const struct hda_fixup *fix,
6326 struct alc_spec *spec = codec->spec;
6328 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6329 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6330 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6331 spec->gpio_mask |= 0x10;
6332 spec->gpio_dir |= 0x10;
6333 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6337 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6338 const struct hda_fixup *fix,
6341 struct alc_spec *spec = codec->spec;
6343 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6344 spec->gpio_mask |= 0x04;
6345 spec->gpio_dir |= 0x04;
6346 /* set data bit low */
6350 /* Quirk for Thinkpad X1 7th and 8th Gen
6351 * The following fixed routing needed
6352 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6353 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6354 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6356 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6357 const struct hda_fixup *fix, int action)
6359 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6360 static const hda_nid_t preferred_pairs[] = {
6361 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6363 struct alc_spec *spec = codec->spec;
6366 case HDA_FIXUP_ACT_PRE_PROBE:
6367 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6368 spec->gen.preferred_dacs = preferred_pairs;
6370 case HDA_FIXUP_ACT_BUILD:
6371 /* The generic parser creates somewhat unintuitive volume ctls
6372 * with the fixed routing above, and the shared DAC2 may be
6374 * Rename those to unique names so that PA doesn't touch them
6375 * and use only Master volume.
6377 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6378 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6383 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6384 const struct hda_fixup *fix,
6387 alc_fixup_dual_codecs(codec, fix, action);
6389 case HDA_FIXUP_ACT_PRE_PROBE:
6390 /* override card longname to provide a unique UCM profile */
6391 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6393 case HDA_FIXUP_ACT_BUILD:
6394 /* rename Capture controls depending on the codec */
6395 rename_ctl(codec, "Capture Volume",
6397 "Rear-Panel Capture Volume" :
6398 "Front-Panel Capture Volume");
6399 rename_ctl(codec, "Capture Switch",
6401 "Rear-Panel Capture Switch" :
6402 "Front-Panel Capture Switch");
6407 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6408 const struct hda_fixup *fix, int action)
6410 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6413 codec->power_save_node = 1;
6416 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6417 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6418 const struct hda_fixup *fix, int action)
6420 struct alc_spec *spec = codec->spec;
6421 static const hda_nid_t preferred_pairs[] = {
6422 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6426 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6429 spec->gen.preferred_dacs = preferred_pairs;
6430 spec->gen.auto_mute_via_amp = 1;
6431 codec->power_save_node = 0;
6434 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6435 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6436 const struct hda_fixup *fix, int action)
6438 static const hda_nid_t preferred_pairs[] = {
6439 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6441 struct alc_spec *spec = codec->spec;
6443 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6444 spec->gen.preferred_dacs = preferred_pairs;
6445 spec->gen.obey_preferred_dacs = 1;
6449 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6450 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6451 const struct hda_fixup *fix, int action)
6453 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6456 snd_hda_override_wcaps(codec, 0x03, 0);
6459 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6461 switch (codec->core.vendor_id) {
6467 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6468 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6476 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6477 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6482 static void alc295_fixup_chromebook(struct hda_codec *codec,
6483 const struct hda_fixup *fix, int action)
6485 struct alc_spec *spec = codec->spec;
6488 case HDA_FIXUP_ACT_PRE_PROBE:
6489 spec->ultra_low_power = true;
6491 case HDA_FIXUP_ACT_INIT:
6492 alc_combo_jack_hp_jd_restart(codec);
6497 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6498 const struct hda_fixup *fix, int action)
6500 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6501 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6505 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6506 struct hda_jack_callback *cb)
6508 /* The Windows driver sets the codec up in a very different way where
6509 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6511 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6512 alc_write_coef_idx(codec, 0x10, 0x8a20);
6514 alc_write_coef_idx(codec, 0x10, 0x0a20);
6517 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6518 const struct hda_fixup *fix, int action)
6520 /* Pin 0x21: headphones/headset mic */
6521 if (!is_jack_detectable(codec, 0x21))
6525 case HDA_FIXUP_ACT_PRE_PROBE:
6526 snd_hda_jack_detect_enable_callback(codec, 0x21,
6527 alc294_gx502_toggle_output);
6529 case HDA_FIXUP_ACT_INIT:
6530 /* Make sure to start in a correct state, i.e. if
6531 * headphones have been plugged in before powering up the system
6533 alc294_gx502_toggle_output(codec, NULL);
6538 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6539 struct hda_jack_callback *cb)
6541 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6542 * responsible from changes between speakers and headphones
6544 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6545 alc_write_coef_idx(codec, 0x10, 0x8420);
6547 alc_write_coef_idx(codec, 0x10, 0x0a20);
6550 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6551 const struct hda_fixup *fix, int action)
6553 if (!is_jack_detectable(codec, 0x21))
6557 case HDA_FIXUP_ACT_PRE_PROBE:
6558 snd_hda_jack_detect_enable_callback(codec, 0x21,
6559 alc294_gu502_toggle_output);
6561 case HDA_FIXUP_ACT_INIT:
6562 alc294_gu502_toggle_output(codec, NULL);
6567 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6568 const struct hda_fixup *fix, int action)
6570 if (action != HDA_FIXUP_ACT_INIT)
6574 alc_write_coef_idx(codec, 0x65, 0x0);
6577 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6578 const struct hda_fixup *fix, int action)
6581 case HDA_FIXUP_ACT_INIT:
6582 alc_combo_jack_hp_jd_restart(codec);
6587 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6588 const struct hda_fixup *fix, int action)
6590 struct alc_spec *spec = codec->spec;
6593 case HDA_FIXUP_ACT_PRE_PROBE:
6594 /* Mic RING SLEEVE swap for combo jack */
6595 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6596 spec->no_internal_mic_pin = true;
6598 case HDA_FIXUP_ACT_INIT:
6599 alc_combo_jack_hp_jd_restart(codec);
6604 /* GPIO1 = amplifier on/off
6605 * GPIO3 = mic mute LED
6607 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6608 const struct hda_fixup *fix, int action)
6610 static const hda_nid_t conn[] = { 0x02 };
6612 struct alc_spec *spec = codec->spec;
6613 static const struct hda_pintbl pincfgs[] = {
6614 { 0x14, 0x90170110 }, /* front/high speakers */
6615 { 0x17, 0x90170130 }, /* back/bass speakers */
6619 //enable micmute led
6620 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6623 case HDA_FIXUP_ACT_PRE_PROBE:
6624 spec->micmute_led_polarity = 1;
6625 /* needed for amp of back speakers */
6626 spec->gpio_mask |= 0x01;
6627 spec->gpio_dir |= 0x01;
6628 snd_hda_apply_pincfgs(codec, pincfgs);
6629 /* share DAC to have unified volume control */
6630 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6631 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6633 case HDA_FIXUP_ACT_INIT:
6634 /* need to toggle GPIO to enable the amp of back speakers */
6635 alc_update_gpio_data(codec, 0x01, true);
6637 alc_update_gpio_data(codec, 0x01, false);
6642 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6643 const struct hda_fixup *fix, int action)
6645 static const hda_nid_t conn[] = { 0x02 };
6646 static const struct hda_pintbl pincfgs[] = {
6647 { 0x14, 0x90170110 }, /* rear speaker */
6652 case HDA_FIXUP_ACT_PRE_PROBE:
6653 snd_hda_apply_pincfgs(codec, pincfgs);
6654 /* force front speaker to DAC1 */
6655 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6660 /* for hda_fixup_thinkpad_acpi() */
6661 #include "thinkpad_helper.c"
6663 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6664 const struct hda_fixup *fix, int action)
6666 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6667 hda_fixup_thinkpad_acpi(codec, fix, action);
6670 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6671 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6672 const struct hda_fixup *fix,
6675 struct alc_spec *spec = codec->spec;
6678 case HDA_FIXUP_ACT_PRE_PROBE:
6679 spec->gen.suppress_auto_mute = 1;
6684 /* for alc295_fixup_hp_top_speakers */
6685 #include "hp_x360_helper.c"
6687 /* for alc285_fixup_ideapad_s740_coef() */
6688 #include "ideapad_s740_helper.c"
6690 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6691 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6692 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6693 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6697 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6698 const struct hda_fixup *fix,
6702 * A certain other OS sets these coeffs to different values. On at least
6703 * one TongFang barebone these settings might survive even a cold
6704 * reboot. So to restore a clean slate the values are explicitly reset
6705 * to default here. Without this, the external microphone is always in a
6706 * plugged-in state, while the internal microphone is always in an
6707 * unplugged state, breaking the ability to use the internal microphone.
6709 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6712 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6713 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6714 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6715 WRITE_COEF(0x49, 0x0149),
6719 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6720 const struct hda_fixup *fix,
6724 * The audio jack input and output is not detected on the ASRock NUC Box
6725 * 1100 series when cold booting without this fix. Warm rebooting from a
6726 * certain other OS makes the audio functional, as COEF settings are
6727 * preserved in this case. This fix sets these altered COEF values as
6730 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6733 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6734 const struct hda_fixup *fix,
6738 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6739 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6740 * needs an additional quirk for sound working after suspend and resume.
6742 if (codec->core.vendor_id == 0x10ec0256) {
6743 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6744 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6746 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6750 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
6751 const struct hda_fixup *fix, int action)
6753 static const struct hda_pintbl pincfgs[] = {
6754 { 0x14, 0x90170151 },
6755 { 0x17, 0x90170150 },
6758 static const hda_nid_t conn[] = { 0x02, 0x03 };
6759 static const hda_nid_t preferred_pairs[] = {
6765 struct alc_spec *spec = codec->spec;
6767 alc_fixup_no_shutup(codec, fix, action);
6770 case HDA_FIXUP_ACT_PRE_PROBE:
6771 snd_hda_apply_pincfgs(codec, pincfgs);
6772 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6773 spec->gen.preferred_dacs = preferred_pairs;
6780 ALC269_FIXUP_SONY_VAIO,
6781 ALC275_FIXUP_SONY_VAIO_GPIO2,
6782 ALC269_FIXUP_DELL_M101Z,
6783 ALC269_FIXUP_SKU_IGNORE,
6784 ALC269_FIXUP_ASUS_G73JW,
6785 ALC269_FIXUP_LENOVO_EAPD,
6786 ALC275_FIXUP_SONY_HWEQ,
6787 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6789 ALC269_FIXUP_PCM_44K,
6790 ALC269_FIXUP_STEREO_DMIC,
6791 ALC269_FIXUP_HEADSET_MIC,
6792 ALC269_FIXUP_QUANTA_MUTE,
6793 ALC269_FIXUP_LIFEBOOK,
6794 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6795 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6796 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6797 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6800 ALC269VB_FIXUP_AMIC,
6801 ALC269VB_FIXUP_DMIC,
6802 ALC269_FIXUP_HP_MUTE_LED,
6803 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6804 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6805 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6806 ALC269_FIXUP_HP_GPIO_LED,
6807 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6808 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6809 ALC269_FIXUP_INV_DMIC,
6810 ALC269_FIXUP_LENOVO_DOCK,
6811 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6812 ALC269_FIXUP_NO_SHUTUP,
6813 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6814 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6815 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6816 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6817 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6818 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
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 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
6833 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6834 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6835 ALC283_FIXUP_CHROME_BOOK,
6836 ALC283_FIXUP_SENSE_COMBO_JACK,
6837 ALC282_FIXUP_ASUS_TX300,
6838 ALC283_FIXUP_INT_MIC,
6839 ALC290_FIXUP_MONO_SPEAKERS,
6840 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6841 ALC290_FIXUP_SUBWOOFER,
6842 ALC290_FIXUP_SUBWOOFER_HSJACK,
6843 ALC269_FIXUP_THINKPAD_ACPI,
6844 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6845 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6846 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6847 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6848 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6849 ALC255_FIXUP_HEADSET_MODE,
6850 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6851 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6852 ALC292_FIXUP_TPT440_DOCK,
6853 ALC292_FIXUP_TPT440,
6854 ALC283_FIXUP_HEADSET_MIC,
6855 ALC255_FIXUP_MIC_MUTE_LED,
6856 ALC282_FIXUP_ASPIRE_V5_PINS,
6857 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6858 ALC280_FIXUP_HP_GPIO4,
6859 ALC286_FIXUP_HP_GPIO_LED,
6860 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6861 ALC280_FIXUP_HP_DOCK_PINS,
6862 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6863 ALC280_FIXUP_HP_9480M,
6864 ALC245_FIXUP_HP_X360_AMP,
6865 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
6866 ALC288_FIXUP_DELL_HEADSET_MODE,
6867 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6868 ALC288_FIXUP_DELL_XPS_13,
6869 ALC288_FIXUP_DISABLE_AAMIX,
6870 ALC292_FIXUP_DELL_E7X_AAMIX,
6871 ALC292_FIXUP_DELL_E7X,
6872 ALC292_FIXUP_DISABLE_AAMIX,
6873 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6874 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6875 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6876 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6877 ALC275_FIXUP_DELL_XPS,
6878 ALC293_FIXUP_LENOVO_SPK_NOISE,
6879 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6880 ALC255_FIXUP_DELL_SPK_NOISE,
6881 ALC225_FIXUP_DISABLE_MIC_VREF,
6882 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6883 ALC295_FIXUP_DISABLE_DAC3,
6884 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6885 ALC280_FIXUP_HP_HEADSET_MIC,
6886 ALC221_FIXUP_HP_FRONT_MIC,
6887 ALC292_FIXUP_TPT460,
6888 ALC298_FIXUP_SPK_VOLUME,
6889 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6890 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6891 ALC269_FIXUP_ATIV_BOOK_8,
6892 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
6893 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6894 ALC256_FIXUP_ASUS_HEADSET_MODE,
6895 ALC256_FIXUP_ASUS_MIC,
6896 ALC256_FIXUP_ASUS_AIO_GPIO2,
6897 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6898 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6899 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6900 ALC233_FIXUP_ACER_HEADSET_MIC,
6901 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6902 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6903 ALC225_FIXUP_S3_POP_NOISE,
6904 ALC700_FIXUP_INTEL_REFERENCE,
6905 ALC274_FIXUP_DELL_BIND_DACS,
6906 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6907 ALC298_FIXUP_TPT470_DOCK_FIX,
6908 ALC298_FIXUP_TPT470_DOCK,
6909 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6910 ALC255_FIXUP_DELL_HEADSET_MIC,
6911 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6912 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6913 ALC295_FIXUP_HP_X360,
6914 ALC221_FIXUP_HP_HEADSET_MIC,
6915 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6916 ALC295_FIXUP_HP_AUTO_MUTE,
6917 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6918 ALC294_FIXUP_ASUS_MIC,
6919 ALC294_FIXUP_ASUS_HEADSET_MIC,
6920 ALC294_FIXUP_ASUS_SPK,
6921 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6922 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6923 ALC255_FIXUP_ACER_HEADSET_MIC,
6924 ALC295_FIXUP_CHROME_BOOK,
6925 ALC225_FIXUP_HEADSET_JACK,
6926 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6927 ALC225_FIXUP_WYSE_AUTO_MUTE,
6928 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6929 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6930 ALC256_FIXUP_ASUS_HEADSET_MIC,
6931 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6932 ALC299_FIXUP_PREDATOR_SPK,
6933 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6934 ALC289_FIXUP_DELL_SPK2,
6935 ALC289_FIXUP_DUAL_SPK,
6936 ALC294_FIXUP_SPK2_TO_DAC1,
6937 ALC294_FIXUP_ASUS_DUAL_SPK,
6938 ALC285_FIXUP_THINKPAD_X1_GEN7,
6939 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6940 ALC294_FIXUP_ASUS_HPE,
6941 ALC294_FIXUP_ASUS_COEF_1B,
6942 ALC294_FIXUP_ASUS_GX502_HP,
6943 ALC294_FIXUP_ASUS_GX502_PINS,
6944 ALC294_FIXUP_ASUS_GX502_VERBS,
6945 ALC294_FIXUP_ASUS_GU502_HP,
6946 ALC294_FIXUP_ASUS_GU502_PINS,
6947 ALC294_FIXUP_ASUS_GU502_VERBS,
6948 ALC294_FIXUP_ASUS_G513_PINS,
6949 ALC285_FIXUP_ASUS_G533Z_PINS,
6950 ALC285_FIXUP_HP_GPIO_LED,
6951 ALC285_FIXUP_HP_MUTE_LED,
6952 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
6953 ALC236_FIXUP_HP_MUTE_LED_COEFBIT2,
6954 ALC236_FIXUP_HP_GPIO_LED,
6955 ALC236_FIXUP_HP_MUTE_LED,
6956 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6957 ALC298_FIXUP_SAMSUNG_AMP,
6958 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6959 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6960 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6961 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6962 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6963 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6964 ALC289_FIXUP_ASUS_GA401,
6965 ALC289_FIXUP_ASUS_GA502,
6966 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6967 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6968 ALC269_FIXUP_CZC_B20,
6969 ALC269_FIXUP_CZC_TMI,
6970 ALC269_FIXUP_CZC_L101,
6971 ALC269_FIXUP_LEMOTE_A1802,
6972 ALC269_FIXUP_LEMOTE_A190X,
6973 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6974 ALC233_FIXUP_INTEL_NUC8_DMIC,
6975 ALC233_FIXUP_INTEL_NUC8_BOOST,
6976 ALC256_FIXUP_INTEL_NUC10,
6977 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6978 ALC274_FIXUP_HP_MIC,
6979 ALC274_FIXUP_HP_HEADSET_MIC,
6980 ALC274_FIXUP_HP_ENVY_GPIO,
6981 ALC256_FIXUP_ASUS_HPE,
6982 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6983 ALC287_FIXUP_HP_GPIO_LED,
6984 ALC256_FIXUP_HP_HEADSET_MIC,
6985 ALC245_FIXUP_HP_GPIO_LED,
6986 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6987 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6988 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6989 ALC256_FIXUP_ACER_HEADSET_MIC,
6990 ALC285_FIXUP_IDEAPAD_S740_COEF,
6991 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6992 ALC295_FIXUP_ASUS_DACS,
6993 ALC295_FIXUP_HP_OMEN,
6994 ALC285_FIXUP_HP_SPECTRE_X360,
6995 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6996 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6997 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6998 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6999 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
7000 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
7001 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
7002 ALC298_FIXUP_LENOVO_C940_DUET7,
7003 ALC287_FIXUP_13S_GEN2_SPEAKERS,
7004 ALC256_FIXUP_SET_COEF_DEFAULTS,
7005 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
7006 ALC233_FIXUP_NO_AUDIO_JACK,
7007 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
7008 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
7009 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
7010 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
7011 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
7012 ALC236_FIXUP_DELL_DUAL_CODECS,
7015 /* A special fixup for Lenovo C940 and Yoga Duet 7;
7016 * both have the very same PCI SSID, and we need to apply different fixups
7017 * depending on the codec ID
7019 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7020 const struct hda_fixup *fix,
7025 if (codec->core.vendor_id == 0x10ec0298)
7026 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7028 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7029 __snd_hda_apply_fixup(codec, id, action, 0);
7032 static const struct hda_fixup alc269_fixups[] = {
7033 [ALC269_FIXUP_GPIO2] = {
7034 .type = HDA_FIXUP_FUNC,
7035 .v.func = alc_fixup_gpio2,
7037 [ALC269_FIXUP_SONY_VAIO] = {
7038 .type = HDA_FIXUP_PINCTLS,
7039 .v.pins = (const struct hda_pintbl[]) {
7040 {0x19, PIN_VREFGRD},
7044 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7045 .type = HDA_FIXUP_FUNC,
7046 .v.func = alc275_fixup_gpio4_off,
7048 .chain_id = ALC269_FIXUP_SONY_VAIO
7050 [ALC269_FIXUP_DELL_M101Z] = {
7051 .type = HDA_FIXUP_VERBS,
7052 .v.verbs = (const struct hda_verb[]) {
7053 /* Enables internal speaker */
7054 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7055 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7059 [ALC269_FIXUP_SKU_IGNORE] = {
7060 .type = HDA_FIXUP_FUNC,
7061 .v.func = alc_fixup_sku_ignore,
7063 [ALC269_FIXUP_ASUS_G73JW] = {
7064 .type = HDA_FIXUP_PINS,
7065 .v.pins = (const struct hda_pintbl[]) {
7066 { 0x17, 0x99130111 }, /* subwoofer */
7070 [ALC269_FIXUP_LENOVO_EAPD] = {
7071 .type = HDA_FIXUP_VERBS,
7072 .v.verbs = (const struct hda_verb[]) {
7073 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7077 [ALC275_FIXUP_SONY_HWEQ] = {
7078 .type = HDA_FIXUP_FUNC,
7079 .v.func = alc269_fixup_hweq,
7081 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7083 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7084 .type = HDA_FIXUP_FUNC,
7085 .v.func = alc_fixup_disable_aamix,
7087 .chain_id = ALC269_FIXUP_SONY_VAIO
7089 [ALC271_FIXUP_DMIC] = {
7090 .type = HDA_FIXUP_FUNC,
7091 .v.func = alc271_fixup_dmic,
7093 [ALC269_FIXUP_PCM_44K] = {
7094 .type = HDA_FIXUP_FUNC,
7095 .v.func = alc269_fixup_pcm_44k,
7097 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7099 [ALC269_FIXUP_STEREO_DMIC] = {
7100 .type = HDA_FIXUP_FUNC,
7101 .v.func = alc269_fixup_stereo_dmic,
7103 [ALC269_FIXUP_HEADSET_MIC] = {
7104 .type = HDA_FIXUP_FUNC,
7105 .v.func = alc269_fixup_headset_mic,
7107 [ALC269_FIXUP_QUANTA_MUTE] = {
7108 .type = HDA_FIXUP_FUNC,
7109 .v.func = alc269_fixup_quanta_mute,
7111 [ALC269_FIXUP_LIFEBOOK] = {
7112 .type = HDA_FIXUP_PINS,
7113 .v.pins = (const struct hda_pintbl[]) {
7114 { 0x1a, 0x2101103f }, /* dock line-out */
7115 { 0x1b, 0x23a11040 }, /* dock mic-in */
7119 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7121 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7122 .type = HDA_FIXUP_PINS,
7123 .v.pins = (const struct hda_pintbl[]) {
7124 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7128 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7129 .type = HDA_FIXUP_PINS,
7130 .v.pins = (const struct hda_pintbl[]) {
7131 { 0x21, 0x0221102f }, /* HP out */
7135 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7136 .type = HDA_FIXUP_FUNC,
7137 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7139 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7140 .type = HDA_FIXUP_FUNC,
7141 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7143 [ALC269_FIXUP_AMIC] = {
7144 .type = HDA_FIXUP_PINS,
7145 .v.pins = (const struct hda_pintbl[]) {
7146 { 0x14, 0x99130110 }, /* speaker */
7147 { 0x15, 0x0121401f }, /* HP out */
7148 { 0x18, 0x01a19c20 }, /* mic */
7149 { 0x19, 0x99a3092f }, /* int-mic */
7153 [ALC269_FIXUP_DMIC] = {
7154 .type = HDA_FIXUP_PINS,
7155 .v.pins = (const struct hda_pintbl[]) {
7156 { 0x12, 0x99a3092f }, /* int-mic */
7157 { 0x14, 0x99130110 }, /* speaker */
7158 { 0x15, 0x0121401f }, /* HP out */
7159 { 0x18, 0x01a19c20 }, /* mic */
7163 [ALC269VB_FIXUP_AMIC] = {
7164 .type = HDA_FIXUP_PINS,
7165 .v.pins = (const struct hda_pintbl[]) {
7166 { 0x14, 0x99130110 }, /* speaker */
7167 { 0x18, 0x01a19c20 }, /* mic */
7168 { 0x19, 0x99a3092f }, /* int-mic */
7169 { 0x21, 0x0121401f }, /* HP out */
7173 [ALC269VB_FIXUP_DMIC] = {
7174 .type = HDA_FIXUP_PINS,
7175 .v.pins = (const struct hda_pintbl[]) {
7176 { 0x12, 0x99a3092f }, /* int-mic */
7177 { 0x14, 0x99130110 }, /* speaker */
7178 { 0x18, 0x01a19c20 }, /* mic */
7179 { 0x21, 0x0121401f }, /* HP out */
7183 [ALC269_FIXUP_HP_MUTE_LED] = {
7184 .type = HDA_FIXUP_FUNC,
7185 .v.func = alc269_fixup_hp_mute_led,
7187 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7188 .type = HDA_FIXUP_FUNC,
7189 .v.func = alc269_fixup_hp_mute_led_mic1,
7191 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7192 .type = HDA_FIXUP_FUNC,
7193 .v.func = alc269_fixup_hp_mute_led_mic2,
7195 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7196 .type = HDA_FIXUP_FUNC,
7197 .v.func = alc269_fixup_hp_mute_led_mic3,
7199 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7201 [ALC269_FIXUP_HP_GPIO_LED] = {
7202 .type = HDA_FIXUP_FUNC,
7203 .v.func = alc269_fixup_hp_gpio_led,
7205 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7206 .type = HDA_FIXUP_FUNC,
7207 .v.func = alc269_fixup_hp_gpio_mic1_led,
7209 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7210 .type = HDA_FIXUP_FUNC,
7211 .v.func = alc269_fixup_hp_line1_mic1_led,
7213 [ALC269_FIXUP_INV_DMIC] = {
7214 .type = HDA_FIXUP_FUNC,
7215 .v.func = alc_fixup_inv_dmic,
7217 [ALC269_FIXUP_NO_SHUTUP] = {
7218 .type = HDA_FIXUP_FUNC,
7219 .v.func = alc_fixup_no_shutup,
7221 [ALC269_FIXUP_LENOVO_DOCK] = {
7222 .type = HDA_FIXUP_PINS,
7223 .v.pins = (const struct hda_pintbl[]) {
7224 { 0x19, 0x23a11040 }, /* dock mic */
7225 { 0x1b, 0x2121103f }, /* dock headphone */
7229 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7231 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7232 .type = HDA_FIXUP_FUNC,
7233 .v.func = alc269_fixup_limit_int_mic_boost,
7235 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7237 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7238 .type = HDA_FIXUP_FUNC,
7239 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7241 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7243 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7244 .type = HDA_FIXUP_PINS,
7245 .v.pins = (const struct hda_pintbl[]) {
7246 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7247 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7251 .chain_id = ALC269_FIXUP_HEADSET_MODE
7253 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7254 .type = HDA_FIXUP_PINS,
7255 .v.pins = (const struct hda_pintbl[]) {
7256 { 0x16, 0x21014020 }, /* dock line out */
7257 { 0x19, 0x21a19030 }, /* dock mic */
7258 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7262 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7264 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7265 .type = HDA_FIXUP_PINS,
7266 .v.pins = (const struct hda_pintbl[]) {
7267 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7271 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7273 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7274 .type = HDA_FIXUP_PINS,
7275 .v.pins = (const struct hda_pintbl[]) {
7276 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7277 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7281 .chain_id = ALC269_FIXUP_HEADSET_MODE
7283 [ALC269_FIXUP_HEADSET_MODE] = {
7284 .type = HDA_FIXUP_FUNC,
7285 .v.func = alc_fixup_headset_mode,
7287 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7289 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7290 .type = HDA_FIXUP_FUNC,
7291 .v.func = alc_fixup_headset_mode_no_hp_mic,
7293 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7294 .type = HDA_FIXUP_PINS,
7295 .v.pins = (const struct hda_pintbl[]) {
7296 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7300 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7302 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7303 .type = HDA_FIXUP_PINS,
7304 .v.pins = (const struct hda_pintbl[]) {
7305 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7309 .chain_id = ALC269_FIXUP_HEADSET_MIC
7311 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7312 .type = HDA_FIXUP_PINS,
7313 .v.pins = (const struct hda_pintbl[]) {
7327 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7329 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7330 .type = HDA_FIXUP_FUNC,
7331 .v.func = alc298_fixup_huawei_mbx_stereo,
7333 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7335 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7336 .type = HDA_FIXUP_FUNC,
7337 .v.func = alc269_fixup_x101_headset_mic,
7339 [ALC269_FIXUP_ASUS_X101_VERB] = {
7340 .type = HDA_FIXUP_VERBS,
7341 .v.verbs = (const struct hda_verb[]) {
7342 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7343 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7344 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7348 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7350 [ALC269_FIXUP_ASUS_X101] = {
7351 .type = HDA_FIXUP_PINS,
7352 .v.pins = (const struct hda_pintbl[]) {
7353 { 0x18, 0x04a1182c }, /* Headset mic */
7357 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7359 [ALC271_FIXUP_AMIC_MIC2] = {
7360 .type = HDA_FIXUP_PINS,
7361 .v.pins = (const struct hda_pintbl[]) {
7362 { 0x14, 0x99130110 }, /* speaker */
7363 { 0x19, 0x01a19c20 }, /* mic */
7364 { 0x1b, 0x99a7012f }, /* int-mic */
7365 { 0x21, 0x0121401f }, /* HP out */
7369 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7370 .type = HDA_FIXUP_FUNC,
7371 .v.func = alc271_hp_gate_mic_jack,
7373 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7375 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7376 .type = HDA_FIXUP_FUNC,
7377 .v.func = alc269_fixup_limit_int_mic_boost,
7379 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7381 [ALC269_FIXUP_ACER_AC700] = {
7382 .type = HDA_FIXUP_PINS,
7383 .v.pins = (const struct hda_pintbl[]) {
7384 { 0x12, 0x99a3092f }, /* int-mic */
7385 { 0x14, 0x99130110 }, /* speaker */
7386 { 0x18, 0x03a11c20 }, /* mic */
7387 { 0x1e, 0x0346101e }, /* SPDIF1 */
7388 { 0x21, 0x0321101f }, /* HP out */
7392 .chain_id = ALC271_FIXUP_DMIC,
7394 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7395 .type = HDA_FIXUP_FUNC,
7396 .v.func = alc269_fixup_limit_int_mic_boost,
7398 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7400 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7401 .type = HDA_FIXUP_FUNC,
7402 .v.func = alc269_fixup_limit_int_mic_boost,
7404 .chain_id = ALC269VB_FIXUP_DMIC,
7406 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7407 .type = HDA_FIXUP_VERBS,
7408 .v.verbs = (const struct hda_verb[]) {
7409 /* class-D output amp +5dB */
7410 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7411 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7415 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7417 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7418 .type = HDA_FIXUP_PINS,
7419 .v.pins = (const struct hda_pintbl[]) {
7420 { 0x18, 0x01a110f0 }, /* use as headset mic */
7424 .chain_id = ALC269_FIXUP_HEADSET_MIC
7426 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7427 .type = HDA_FIXUP_FUNC,
7428 .v.func = alc269_fixup_limit_int_mic_boost,
7430 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7432 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7433 .type = HDA_FIXUP_PINS,
7434 .v.pins = (const struct hda_pintbl[]) {
7435 { 0x12, 0x99a3092f }, /* int-mic */
7436 { 0x18, 0x03a11d20 }, /* mic */
7437 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7441 [ALC283_FIXUP_CHROME_BOOK] = {
7442 .type = HDA_FIXUP_FUNC,
7443 .v.func = alc283_fixup_chromebook,
7445 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7446 .type = HDA_FIXUP_FUNC,
7447 .v.func = alc283_fixup_sense_combo_jack,
7449 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7451 [ALC282_FIXUP_ASUS_TX300] = {
7452 .type = HDA_FIXUP_FUNC,
7453 .v.func = alc282_fixup_asus_tx300,
7455 [ALC283_FIXUP_INT_MIC] = {
7456 .type = HDA_FIXUP_VERBS,
7457 .v.verbs = (const struct hda_verb[]) {
7458 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7459 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7463 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7465 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7466 .type = HDA_FIXUP_PINS,
7467 .v.pins = (const struct hda_pintbl[]) {
7468 { 0x17, 0x90170112 }, /* subwoofer */
7472 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7474 [ALC290_FIXUP_SUBWOOFER] = {
7475 .type = HDA_FIXUP_PINS,
7476 .v.pins = (const struct hda_pintbl[]) {
7477 { 0x17, 0x90170112 }, /* subwoofer */
7481 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7483 [ALC290_FIXUP_MONO_SPEAKERS] = {
7484 .type = HDA_FIXUP_FUNC,
7485 .v.func = alc290_fixup_mono_speakers,
7487 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7488 .type = HDA_FIXUP_FUNC,
7489 .v.func = alc290_fixup_mono_speakers,
7491 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7493 [ALC269_FIXUP_THINKPAD_ACPI] = {
7494 .type = HDA_FIXUP_FUNC,
7495 .v.func = alc_fixup_thinkpad_acpi,
7497 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7499 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7500 .type = HDA_FIXUP_FUNC,
7501 .v.func = alc_fixup_inv_dmic,
7503 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7505 [ALC255_FIXUP_ACER_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
7514 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7515 .type = HDA_FIXUP_PINS,
7516 .v.pins = (const struct hda_pintbl[]) {
7517 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7521 .chain_id = ALC255_FIXUP_HEADSET_MODE
7523 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7524 .type = HDA_FIXUP_PINS,
7525 .v.pins = (const struct hda_pintbl[]) {
7526 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7527 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7531 .chain_id = ALC255_FIXUP_HEADSET_MODE
7533 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7534 .type = HDA_FIXUP_PINS,
7535 .v.pins = (const struct hda_pintbl[]) {
7536 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7540 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7542 [ALC255_FIXUP_HEADSET_MODE] = {
7543 .type = HDA_FIXUP_FUNC,
7544 .v.func = alc_fixup_headset_mode_alc255,
7546 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7548 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7549 .type = HDA_FIXUP_FUNC,
7550 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7552 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7553 .type = HDA_FIXUP_PINS,
7554 .v.pins = (const struct hda_pintbl[]) {
7555 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7556 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7560 .chain_id = ALC269_FIXUP_HEADSET_MODE
7562 [ALC292_FIXUP_TPT440_DOCK] = {
7563 .type = HDA_FIXUP_FUNC,
7564 .v.func = alc_fixup_tpt440_dock,
7566 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7568 [ALC292_FIXUP_TPT440] = {
7569 .type = HDA_FIXUP_FUNC,
7570 .v.func = alc_fixup_disable_aamix,
7572 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7574 [ALC283_FIXUP_HEADSET_MIC] = {
7575 .type = HDA_FIXUP_PINS,
7576 .v.pins = (const struct hda_pintbl[]) {
7577 { 0x19, 0x04a110f0 },
7581 [ALC255_FIXUP_MIC_MUTE_LED] = {
7582 .type = HDA_FIXUP_FUNC,
7583 .v.func = alc_fixup_micmute_led,
7585 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7586 .type = HDA_FIXUP_PINS,
7587 .v.pins = (const struct hda_pintbl[]) {
7588 { 0x12, 0x90a60130 },
7589 { 0x14, 0x90170110 },
7590 { 0x17, 0x40000008 },
7591 { 0x18, 0x411111f0 },
7592 { 0x19, 0x01a1913c },
7593 { 0x1a, 0x411111f0 },
7594 { 0x1b, 0x411111f0 },
7595 { 0x1d, 0x40f89b2d },
7596 { 0x1e, 0x411111f0 },
7597 { 0x21, 0x0321101f },
7601 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7602 .type = HDA_FIXUP_FUNC,
7603 .v.func = alc269vb_fixup_aspire_e1_coef,
7605 [ALC280_FIXUP_HP_GPIO4] = {
7606 .type = HDA_FIXUP_FUNC,
7607 .v.func = alc280_fixup_hp_gpio4,
7609 [ALC286_FIXUP_HP_GPIO_LED] = {
7610 .type = HDA_FIXUP_FUNC,
7611 .v.func = alc286_fixup_hp_gpio_led,
7613 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7614 .type = HDA_FIXUP_FUNC,
7615 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7617 [ALC280_FIXUP_HP_DOCK_PINS] = {
7618 .type = HDA_FIXUP_PINS,
7619 .v.pins = (const struct hda_pintbl[]) {
7620 { 0x1b, 0x21011020 }, /* line-out */
7621 { 0x1a, 0x01a1903c }, /* headset mic */
7622 { 0x18, 0x2181103f }, /* line-in */
7626 .chain_id = ALC280_FIXUP_HP_GPIO4
7628 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7629 .type = HDA_FIXUP_PINS,
7630 .v.pins = (const struct hda_pintbl[]) {
7631 { 0x1b, 0x21011020 }, /* line-out */
7632 { 0x18, 0x2181103f }, /* line-in */
7636 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7638 [ALC280_FIXUP_HP_9480M] = {
7639 .type = HDA_FIXUP_FUNC,
7640 .v.func = alc280_fixup_hp_9480m,
7642 [ALC245_FIXUP_HP_X360_AMP] = {
7643 .type = HDA_FIXUP_FUNC,
7644 .v.func = alc245_fixup_hp_x360_amp,
7646 .chain_id = ALC245_FIXUP_HP_GPIO_LED
7648 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7649 .type = HDA_FIXUP_FUNC,
7650 .v.func = alc_fixup_headset_mode_dell_alc288,
7652 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7654 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7655 .type = HDA_FIXUP_PINS,
7656 .v.pins = (const struct hda_pintbl[]) {
7657 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7658 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7662 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7664 [ALC288_FIXUP_DISABLE_AAMIX] = {
7665 .type = HDA_FIXUP_FUNC,
7666 .v.func = alc_fixup_disable_aamix,
7668 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7670 [ALC288_FIXUP_DELL_XPS_13] = {
7671 .type = HDA_FIXUP_FUNC,
7672 .v.func = alc_fixup_dell_xps13,
7674 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7676 [ALC292_FIXUP_DISABLE_AAMIX] = {
7677 .type = HDA_FIXUP_FUNC,
7678 .v.func = alc_fixup_disable_aamix,
7680 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7682 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7683 .type = HDA_FIXUP_FUNC,
7684 .v.func = alc_fixup_disable_aamix,
7686 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7688 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7689 .type = HDA_FIXUP_FUNC,
7690 .v.func = alc_fixup_dell_xps13,
7692 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7694 [ALC292_FIXUP_DELL_E7X] = {
7695 .type = HDA_FIXUP_FUNC,
7696 .v.func = alc_fixup_micmute_led,
7697 /* micmute fixup must be applied at last */
7698 .chained_before = true,
7699 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7701 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7702 .type = HDA_FIXUP_PINS,
7703 .v.pins = (const struct hda_pintbl[]) {
7704 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7707 .chained_before = true,
7708 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7710 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7711 .type = HDA_FIXUP_PINS,
7712 .v.pins = (const struct hda_pintbl[]) {
7713 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7714 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7718 .chain_id = ALC269_FIXUP_HEADSET_MODE
7720 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7721 .type = HDA_FIXUP_PINS,
7722 .v.pins = (const struct hda_pintbl[]) {
7723 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7727 .chain_id = ALC269_FIXUP_HEADSET_MODE
7729 [ALC275_FIXUP_DELL_XPS] = {
7730 .type = HDA_FIXUP_VERBS,
7731 .v.verbs = (const struct hda_verb[]) {
7732 /* Enables internal speaker */
7733 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7734 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7735 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7736 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7740 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7741 .type = HDA_FIXUP_FUNC,
7742 .v.func = alc_fixup_disable_aamix,
7744 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7746 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7747 .type = HDA_FIXUP_FUNC,
7748 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7750 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7751 .type = HDA_FIXUP_FUNC,
7752 .v.func = alc_fixup_inv_dmic,
7754 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7756 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7757 .type = HDA_FIXUP_FUNC,
7758 .v.func = alc269_fixup_limit_int_mic_boost
7760 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7761 .type = HDA_FIXUP_FUNC,
7762 .v.func = alc_fixup_disable_aamix,
7764 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7766 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7767 .type = HDA_FIXUP_FUNC,
7768 .v.func = alc_fixup_disable_mic_vref,
7770 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7772 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7773 .type = HDA_FIXUP_VERBS,
7774 .v.verbs = (const struct hda_verb[]) {
7775 /* Disable pass-through path for FRONT 14h */
7776 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7777 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7781 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7783 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7784 .type = HDA_FIXUP_FUNC,
7785 .v.func = alc_fixup_disable_aamix,
7787 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7789 [ALC221_FIXUP_HP_FRONT_MIC] = {
7790 .type = HDA_FIXUP_PINS,
7791 .v.pins = (const struct hda_pintbl[]) {
7792 { 0x19, 0x02a19020 }, /* Front Mic */
7796 [ALC292_FIXUP_TPT460] = {
7797 .type = HDA_FIXUP_FUNC,
7798 .v.func = alc_fixup_tpt440_dock,
7800 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7802 [ALC298_FIXUP_SPK_VOLUME] = {
7803 .type = HDA_FIXUP_FUNC,
7804 .v.func = alc298_fixup_speaker_volume,
7806 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7808 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7809 .type = HDA_FIXUP_FUNC,
7810 .v.func = alc298_fixup_speaker_volume,
7812 [ALC295_FIXUP_DISABLE_DAC3] = {
7813 .type = HDA_FIXUP_FUNC,
7814 .v.func = alc295_fixup_disable_dac3,
7816 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7817 .type = HDA_FIXUP_FUNC,
7818 .v.func = alc285_fixup_speaker2_to_dac1,
7820 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7822 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7823 .type = HDA_FIXUP_PINS,
7824 .v.pins = (const struct hda_pintbl[]) {
7825 { 0x1b, 0x90170151 },
7829 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7831 [ALC269_FIXUP_ATIV_BOOK_8] = {
7832 .type = HDA_FIXUP_FUNC,
7833 .v.func = alc_fixup_auto_mute_via_amp,
7835 .chain_id = ALC269_FIXUP_NO_SHUTUP
7837 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
7838 .type = HDA_FIXUP_PINS,
7839 .v.pins = (const struct hda_pintbl[]) {
7840 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7841 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
7845 .chain_id = ALC269_FIXUP_HEADSET_MODE
7847 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7848 .type = HDA_FIXUP_PINS,
7849 .v.pins = (const struct hda_pintbl[]) {
7850 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7851 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7855 .chain_id = ALC269_FIXUP_HEADSET_MODE
7857 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7858 .type = HDA_FIXUP_FUNC,
7859 .v.func = alc_fixup_headset_mode,
7861 [ALC256_FIXUP_ASUS_MIC] = {
7862 .type = HDA_FIXUP_PINS,
7863 .v.pins = (const struct hda_pintbl[]) {
7864 { 0x13, 0x90a60160 }, /* use as internal mic */
7865 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7869 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7871 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7872 .type = HDA_FIXUP_FUNC,
7873 /* Set up GPIO2 for the speaker amp */
7874 .v.func = alc_fixup_gpio4,
7876 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7877 .type = HDA_FIXUP_PINS,
7878 .v.pins = (const struct hda_pintbl[]) {
7879 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7883 .chain_id = ALC269_FIXUP_HEADSET_MIC
7885 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7886 .type = HDA_FIXUP_VERBS,
7887 .v.verbs = (const struct hda_verb[]) {
7888 /* Enables internal speaker */
7889 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7890 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7894 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7896 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7897 .type = HDA_FIXUP_FUNC,
7898 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7900 .chain_id = ALC269_FIXUP_GPIO2
7902 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7903 .type = HDA_FIXUP_VERBS,
7904 .v.verbs = (const struct hda_verb[]) {
7905 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7906 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7910 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7912 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7913 .type = HDA_FIXUP_PINS,
7914 .v.pins = (const struct hda_pintbl[]) {
7915 /* Change the mic location from front to right, otherwise there are
7916 two front mics with the same name, pulseaudio can't handle them.
7917 This is just a temporary workaround, after applying this fixup,
7918 there will be one "Front Mic" and one "Mic" in this machine.
7920 { 0x1a, 0x04a19040 },
7924 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7925 .type = HDA_FIXUP_PINS,
7926 .v.pins = (const struct hda_pintbl[]) {
7927 { 0x16, 0x0101102f }, /* Rear Headset HP */
7928 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7929 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7930 { 0x1b, 0x02011020 },
7934 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7936 [ALC225_FIXUP_S3_POP_NOISE] = {
7937 .type = HDA_FIXUP_FUNC,
7938 .v.func = alc225_fixup_s3_pop_noise,
7940 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7942 [ALC700_FIXUP_INTEL_REFERENCE] = {
7943 .type = HDA_FIXUP_VERBS,
7944 .v.verbs = (const struct hda_verb[]) {
7945 /* Enables internal speaker */
7946 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7947 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7948 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7949 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7950 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7951 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7952 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7953 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7957 [ALC274_FIXUP_DELL_BIND_DACS] = {
7958 .type = HDA_FIXUP_FUNC,
7959 .v.func = alc274_fixup_bind_dacs,
7961 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7963 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7964 .type = HDA_FIXUP_PINS,
7965 .v.pins = (const struct hda_pintbl[]) {
7966 { 0x1b, 0x0401102f },
7970 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7972 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7973 .type = HDA_FIXUP_FUNC,
7974 .v.func = alc_fixup_tpt470_dock,
7976 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7978 [ALC298_FIXUP_TPT470_DOCK] = {
7979 .type = HDA_FIXUP_FUNC,
7980 .v.func = alc_fixup_tpt470_dacs,
7982 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7984 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7985 .type = HDA_FIXUP_PINS,
7986 .v.pins = (const struct hda_pintbl[]) {
7987 { 0x14, 0x0201101f },
7991 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7993 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7994 .type = HDA_FIXUP_PINS,
7995 .v.pins = (const struct hda_pintbl[]) {
7996 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8000 .chain_id = ALC269_FIXUP_HEADSET_MIC
8002 [ALC295_FIXUP_HP_X360] = {
8003 .type = HDA_FIXUP_FUNC,
8004 .v.func = alc295_fixup_hp_top_speakers,
8006 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
8008 [ALC221_FIXUP_HP_HEADSET_MIC] = {
8009 .type = HDA_FIXUP_PINS,
8010 .v.pins = (const struct hda_pintbl[]) {
8011 { 0x19, 0x0181313f},
8015 .chain_id = ALC269_FIXUP_HEADSET_MIC
8017 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
8018 .type = HDA_FIXUP_FUNC,
8019 .v.func = alc285_fixup_invalidate_dacs,
8021 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8023 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8024 .type = HDA_FIXUP_FUNC,
8025 .v.func = alc_fixup_auto_mute_via_amp,
8027 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8028 .type = HDA_FIXUP_PINS,
8029 .v.pins = (const struct hda_pintbl[]) {
8030 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8034 .chain_id = ALC269_FIXUP_HEADSET_MIC
8036 [ALC294_FIXUP_ASUS_MIC] = {
8037 .type = HDA_FIXUP_PINS,
8038 .v.pins = (const struct hda_pintbl[]) {
8039 { 0x13, 0x90a60160 }, /* use as internal mic */
8040 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8044 .chain_id = ALC269_FIXUP_HEADSET_MIC
8046 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8047 .type = HDA_FIXUP_PINS,
8048 .v.pins = (const struct hda_pintbl[]) {
8049 { 0x19, 0x01a1103c }, /* use as headset mic */
8053 .chain_id = ALC269_FIXUP_HEADSET_MIC
8055 [ALC294_FIXUP_ASUS_SPK] = {
8056 .type = HDA_FIXUP_VERBS,
8057 .v.verbs = (const struct hda_verb[]) {
8059 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8060 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8061 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8062 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8066 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8068 [ALC295_FIXUP_CHROME_BOOK] = {
8069 .type = HDA_FIXUP_FUNC,
8070 .v.func = alc295_fixup_chromebook,
8072 .chain_id = ALC225_FIXUP_HEADSET_JACK
8074 [ALC225_FIXUP_HEADSET_JACK] = {
8075 .type = HDA_FIXUP_FUNC,
8076 .v.func = alc_fixup_headset_jack,
8078 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8079 .type = HDA_FIXUP_PINS,
8080 .v.pins = (const struct hda_pintbl[]) {
8081 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8085 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8087 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8088 .type = HDA_FIXUP_VERBS,
8089 .v.verbs = (const struct hda_verb[]) {
8090 /* Disable PCBEEP-IN passthrough */
8091 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8092 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8096 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8098 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8099 .type = HDA_FIXUP_PINS,
8100 .v.pins = (const struct hda_pintbl[]) {
8101 { 0x19, 0x03a11130 },
8102 { 0x1a, 0x90a60140 }, /* use as internal mic */
8106 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8108 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8109 .type = HDA_FIXUP_PINS,
8110 .v.pins = (const struct hda_pintbl[]) {
8111 { 0x16, 0x01011020 }, /* Rear Line out */
8112 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8116 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8118 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8119 .type = HDA_FIXUP_FUNC,
8120 .v.func = alc_fixup_auto_mute_via_amp,
8122 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8124 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8125 .type = HDA_FIXUP_FUNC,
8126 .v.func = alc_fixup_disable_mic_vref,
8128 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8130 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8131 .type = HDA_FIXUP_VERBS,
8132 .v.verbs = (const struct hda_verb[]) {
8133 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8134 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8138 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8140 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8141 .type = HDA_FIXUP_PINS,
8142 .v.pins = (const struct hda_pintbl[]) {
8143 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8147 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8149 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8150 .type = HDA_FIXUP_PINS,
8151 .v.pins = (const struct hda_pintbl[]) {
8152 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8156 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8158 [ALC299_FIXUP_PREDATOR_SPK] = {
8159 .type = HDA_FIXUP_PINS,
8160 .v.pins = (const struct hda_pintbl[]) {
8161 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8165 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8166 .type = HDA_FIXUP_PINS,
8167 .v.pins = (const struct hda_pintbl[]) {
8168 { 0x19, 0x04a11040 },
8169 { 0x21, 0x04211020 },
8173 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8175 [ALC289_FIXUP_DELL_SPK2] = {
8176 .type = HDA_FIXUP_PINS,
8177 .v.pins = (const struct hda_pintbl[]) {
8178 { 0x17, 0x90170130 }, /* bass spk */
8182 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8184 [ALC289_FIXUP_DUAL_SPK] = {
8185 .type = HDA_FIXUP_FUNC,
8186 .v.func = alc285_fixup_speaker2_to_dac1,
8188 .chain_id = ALC289_FIXUP_DELL_SPK2
8190 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8191 .type = HDA_FIXUP_FUNC,
8192 .v.func = alc285_fixup_speaker2_to_dac1,
8194 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8196 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
8197 .type = HDA_FIXUP_FUNC,
8198 /* The GPIO must be pulled to initialize the AMP */
8199 .v.func = alc_fixup_gpio4,
8201 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8203 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8204 .type = HDA_FIXUP_FUNC,
8205 .v.func = alc285_fixup_thinkpad_x1_gen7,
8207 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8209 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8210 .type = HDA_FIXUP_FUNC,
8211 .v.func = alc_fixup_headset_jack,
8213 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8215 [ALC294_FIXUP_ASUS_HPE] = {
8216 .type = HDA_FIXUP_VERBS,
8217 .v.verbs = (const struct hda_verb[]) {
8219 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8220 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8224 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8226 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8227 .type = HDA_FIXUP_PINS,
8228 .v.pins = (const struct hda_pintbl[]) {
8229 { 0x19, 0x03a11050 }, /* front HP mic */
8230 { 0x1a, 0x01a11830 }, /* rear external mic */
8231 { 0x21, 0x03211020 }, /* front HP out */
8235 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8237 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8238 .type = HDA_FIXUP_VERBS,
8239 .v.verbs = (const struct hda_verb[]) {
8240 /* set 0x15 to HP-OUT ctrl */
8241 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8242 /* unmute the 0x15 amp */
8243 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8247 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8249 [ALC294_FIXUP_ASUS_GX502_HP] = {
8250 .type = HDA_FIXUP_FUNC,
8251 .v.func = alc294_fixup_gx502_hp,
8253 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8254 .type = HDA_FIXUP_PINS,
8255 .v.pins = (const struct hda_pintbl[]) {
8256 { 0x19, 0x01a11050 }, /* rear HP mic */
8257 { 0x1a, 0x01a11830 }, /* rear external mic */
8258 { 0x21, 0x012110f0 }, /* rear HP out */
8262 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8264 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8265 .type = HDA_FIXUP_VERBS,
8266 .v.verbs = (const struct hda_verb[]) {
8267 /* set 0x15 to HP-OUT ctrl */
8268 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8269 /* unmute the 0x15 amp */
8270 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8271 /* set 0x1b to HP-OUT */
8272 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8276 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8278 [ALC294_FIXUP_ASUS_GU502_HP] = {
8279 .type = HDA_FIXUP_FUNC,
8280 .v.func = alc294_fixup_gu502_hp,
8282 [ALC294_FIXUP_ASUS_G513_PINS] = {
8283 .type = HDA_FIXUP_PINS,
8284 .v.pins = (const struct hda_pintbl[]) {
8285 { 0x19, 0x03a11050 }, /* front HP mic */
8286 { 0x1a, 0x03a11c30 }, /* rear external mic */
8287 { 0x21, 0x03211420 }, /* front HP out */
8291 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8292 .type = HDA_FIXUP_PINS,
8293 .v.pins = (const struct hda_pintbl[]) {
8294 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8295 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8296 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8297 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8298 { 0x21, 0x03211420 },
8302 [ALC294_FIXUP_ASUS_COEF_1B] = {
8303 .type = HDA_FIXUP_VERBS,
8304 .v.verbs = (const struct hda_verb[]) {
8305 /* Set bit 10 to correct noisy output after reboot from
8306 * Windows 10 (due to pop noise reduction?)
8308 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8309 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8313 .chain_id = ALC289_FIXUP_ASUS_GA401,
8315 [ALC285_FIXUP_HP_GPIO_LED] = {
8316 .type = HDA_FIXUP_FUNC,
8317 .v.func = alc285_fixup_hp_gpio_led,
8319 [ALC285_FIXUP_HP_MUTE_LED] = {
8320 .type = HDA_FIXUP_FUNC,
8321 .v.func = alc285_fixup_hp_mute_led,
8323 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8324 .type = HDA_FIXUP_FUNC,
8325 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
8327 [ALC236_FIXUP_HP_MUTE_LED_COEFBIT2] = {
8328 .type = HDA_FIXUP_FUNC,
8329 .v.func = alc236_fixup_hp_mute_led_coefbit2,
8331 [ALC236_FIXUP_HP_GPIO_LED] = {
8332 .type = HDA_FIXUP_FUNC,
8333 .v.func = alc236_fixup_hp_gpio_led,
8335 [ALC236_FIXUP_HP_MUTE_LED] = {
8336 .type = HDA_FIXUP_FUNC,
8337 .v.func = alc236_fixup_hp_mute_led,
8339 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8340 .type = HDA_FIXUP_FUNC,
8341 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8343 [ALC298_FIXUP_SAMSUNG_AMP] = {
8344 .type = HDA_FIXUP_FUNC,
8345 .v.func = alc298_fixup_samsung_amp,
8347 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8349 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8350 .type = HDA_FIXUP_VERBS,
8351 .v.verbs = (const struct hda_verb[]) {
8352 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8356 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8357 .type = HDA_FIXUP_VERBS,
8358 .v.verbs = (const struct hda_verb[]) {
8359 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8360 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8364 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8365 .type = HDA_FIXUP_PINS,
8366 .v.pins = (const struct hda_pintbl[]) {
8367 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8371 .chain_id = ALC269_FIXUP_HEADSET_MODE
8373 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8374 .type = HDA_FIXUP_PINS,
8375 .v.pins = (const struct hda_pintbl[]) {
8376 { 0x14, 0x90100120 }, /* use as internal speaker */
8377 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8378 { 0x1a, 0x01011020 }, /* use as line out */
8382 .chain_id = ALC269_FIXUP_HEADSET_MIC
8384 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8385 .type = HDA_FIXUP_PINS,
8386 .v.pins = (const struct hda_pintbl[]) {
8387 { 0x18, 0x02a11030 }, /* use as headset mic */
8391 .chain_id = ALC269_FIXUP_HEADSET_MIC
8393 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8394 .type = HDA_FIXUP_PINS,
8395 .v.pins = (const struct hda_pintbl[]) {
8396 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8400 .chain_id = ALC269_FIXUP_HEADSET_MIC
8402 [ALC289_FIXUP_ASUS_GA401] = {
8403 .type = HDA_FIXUP_FUNC,
8404 .v.func = alc289_fixup_asus_ga401,
8406 .chain_id = ALC289_FIXUP_ASUS_GA502,
8408 [ALC289_FIXUP_ASUS_GA502] = {
8409 .type = HDA_FIXUP_PINS,
8410 .v.pins = (const struct hda_pintbl[]) {
8411 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8415 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8416 .type = HDA_FIXUP_PINS,
8417 .v.pins = (const struct hda_pintbl[]) {
8418 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8422 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8424 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8425 .type = HDA_FIXUP_FUNC,
8426 .v.func = alc285_fixup_hp_gpio_amp_init,
8428 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8430 [ALC269_FIXUP_CZC_B20] = {
8431 .type = HDA_FIXUP_PINS,
8432 .v.pins = (const struct hda_pintbl[]) {
8433 { 0x12, 0x411111f0 },
8434 { 0x14, 0x90170110 }, /* speaker */
8435 { 0x15, 0x032f1020 }, /* HP out */
8436 { 0x17, 0x411111f0 },
8437 { 0x18, 0x03ab1040 }, /* mic */
8438 { 0x19, 0xb7a7013f },
8439 { 0x1a, 0x0181305f },
8440 { 0x1b, 0x411111f0 },
8441 { 0x1d, 0x411111f0 },
8442 { 0x1e, 0x411111f0 },
8445 .chain_id = ALC269_FIXUP_DMIC,
8447 [ALC269_FIXUP_CZC_TMI] = {
8448 .type = HDA_FIXUP_PINS,
8449 .v.pins = (const struct hda_pintbl[]) {
8450 { 0x12, 0x4000c000 },
8451 { 0x14, 0x90170110 }, /* speaker */
8452 { 0x15, 0x0421401f }, /* HP out */
8453 { 0x17, 0x411111f0 },
8454 { 0x18, 0x04a19020 }, /* mic */
8455 { 0x19, 0x411111f0 },
8456 { 0x1a, 0x411111f0 },
8457 { 0x1b, 0x411111f0 },
8458 { 0x1d, 0x40448505 },
8459 { 0x1e, 0x411111f0 },
8460 { 0x20, 0x8000ffff },
8463 .chain_id = ALC269_FIXUP_DMIC,
8465 [ALC269_FIXUP_CZC_L101] = {
8466 .type = HDA_FIXUP_PINS,
8467 .v.pins = (const struct hda_pintbl[]) {
8468 { 0x12, 0x40000000 },
8469 { 0x14, 0x01014010 }, /* speaker */
8470 { 0x15, 0x411111f0 }, /* HP out */
8471 { 0x16, 0x411111f0 },
8472 { 0x18, 0x01a19020 }, /* mic */
8473 { 0x19, 0x02a19021 },
8474 { 0x1a, 0x0181302f },
8475 { 0x1b, 0x0221401f },
8476 { 0x1c, 0x411111f0 },
8477 { 0x1d, 0x4044c601 },
8478 { 0x1e, 0x411111f0 },
8481 .chain_id = ALC269_FIXUP_DMIC,
8483 [ALC269_FIXUP_LEMOTE_A1802] = {
8484 .type = HDA_FIXUP_PINS,
8485 .v.pins = (const struct hda_pintbl[]) {
8486 { 0x12, 0x40000000 },
8487 { 0x14, 0x90170110 }, /* speaker */
8488 { 0x17, 0x411111f0 },
8489 { 0x18, 0x03a19040 }, /* mic1 */
8490 { 0x19, 0x90a70130 }, /* mic2 */
8491 { 0x1a, 0x411111f0 },
8492 { 0x1b, 0x411111f0 },
8493 { 0x1d, 0x40489d2d },
8494 { 0x1e, 0x411111f0 },
8495 { 0x20, 0x0003ffff },
8496 { 0x21, 0x03214020 },
8499 .chain_id = ALC269_FIXUP_DMIC,
8501 [ALC269_FIXUP_LEMOTE_A190X] = {
8502 .type = HDA_FIXUP_PINS,
8503 .v.pins = (const struct hda_pintbl[]) {
8504 { 0x14, 0x99130110 }, /* speaker */
8505 { 0x15, 0x0121401f }, /* HP out */
8506 { 0x18, 0x01a19c20 }, /* rear mic */
8507 { 0x19, 0x99a3092f }, /* front mic */
8508 { 0x1b, 0x0201401f }, /* front lineout */
8511 .chain_id = ALC269_FIXUP_DMIC,
8513 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8514 .type = HDA_FIXUP_PINS,
8515 .v.pins = (const struct hda_pintbl[]) {
8516 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8520 .chain_id = ALC269_FIXUP_HEADSET_MODE
8522 [ALC256_FIXUP_INTEL_NUC10] = {
8523 .type = HDA_FIXUP_PINS,
8524 .v.pins = (const struct hda_pintbl[]) {
8525 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8529 .chain_id = ALC269_FIXUP_HEADSET_MODE
8531 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8532 .type = HDA_FIXUP_VERBS,
8533 .v.verbs = (const struct hda_verb[]) {
8534 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8535 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8539 .chain_id = ALC289_FIXUP_ASUS_GA502
8541 [ALC274_FIXUP_HP_MIC] = {
8542 .type = HDA_FIXUP_VERBS,
8543 .v.verbs = (const struct hda_verb[]) {
8544 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8545 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8549 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8550 .type = HDA_FIXUP_FUNC,
8551 .v.func = alc274_fixup_hp_headset_mic,
8553 .chain_id = ALC274_FIXUP_HP_MIC
8555 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8556 .type = HDA_FIXUP_FUNC,
8557 .v.func = alc274_fixup_hp_envy_gpio,
8559 [ALC256_FIXUP_ASUS_HPE] = {
8560 .type = HDA_FIXUP_VERBS,
8561 .v.verbs = (const struct hda_verb[]) {
8563 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8564 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8568 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8570 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8571 .type = HDA_FIXUP_FUNC,
8572 .v.func = alc_fixup_headset_jack,
8574 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8576 [ALC287_FIXUP_HP_GPIO_LED] = {
8577 .type = HDA_FIXUP_FUNC,
8578 .v.func = alc287_fixup_hp_gpio_led,
8580 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8581 .type = HDA_FIXUP_FUNC,
8582 .v.func = alc274_fixup_hp_headset_mic,
8584 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8585 .type = HDA_FIXUP_FUNC,
8586 .v.func = alc_fixup_no_int_mic,
8588 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8590 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8591 .type = HDA_FIXUP_PINS,
8592 .v.pins = (const struct hda_pintbl[]) {
8593 { 0x1b, 0x411111f0 },
8594 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8598 .chain_id = ALC269_FIXUP_HEADSET_MODE
8600 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8601 .type = HDA_FIXUP_FUNC,
8602 .v.func = alc269_fixup_limit_int_mic_boost,
8604 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8606 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8607 .type = HDA_FIXUP_PINS,
8608 .v.pins = (const struct hda_pintbl[]) {
8609 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8610 { 0x1a, 0x90a1092f }, /* use as internal mic */
8614 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8616 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8617 .type = HDA_FIXUP_FUNC,
8618 .v.func = alc285_fixup_ideapad_s740_coef,
8620 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8622 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8623 .type = HDA_FIXUP_FUNC,
8624 .v.func = alc269_fixup_limit_int_mic_boost,
8626 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8628 [ALC295_FIXUP_ASUS_DACS] = {
8629 .type = HDA_FIXUP_FUNC,
8630 .v.func = alc295_fixup_asus_dacs,
8632 [ALC295_FIXUP_HP_OMEN] = {
8633 .type = HDA_FIXUP_PINS,
8634 .v.pins = (const struct hda_pintbl[]) {
8635 { 0x12, 0xb7a60130 },
8636 { 0x13, 0x40000000 },
8637 { 0x14, 0x411111f0 },
8638 { 0x16, 0x411111f0 },
8639 { 0x17, 0x90170110 },
8640 { 0x18, 0x411111f0 },
8641 { 0x19, 0x02a11030 },
8642 { 0x1a, 0x411111f0 },
8643 { 0x1b, 0x04a19030 },
8644 { 0x1d, 0x40600001 },
8645 { 0x1e, 0x411111f0 },
8646 { 0x21, 0x03211020 },
8650 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8652 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8653 .type = HDA_FIXUP_FUNC,
8654 .v.func = alc285_fixup_hp_spectre_x360,
8656 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8657 .type = HDA_FIXUP_FUNC,
8658 .v.func = alc285_fixup_hp_spectre_x360_eb1
8660 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8661 .type = HDA_FIXUP_FUNC,
8662 .v.func = alc285_fixup_ideapad_s740_coef,
8664 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8666 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8667 .type = HDA_FIXUP_FUNC,
8668 .v.func = alc_fixup_no_shutup,
8670 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8672 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8673 .type = HDA_FIXUP_PINS,
8674 .v.pins = (const struct hda_pintbl[]) {
8675 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8679 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8681 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8682 .type = HDA_FIXUP_FUNC,
8683 .v.func = alc269_fixup_limit_int_mic_boost,
8685 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8687 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8688 .type = HDA_FIXUP_FUNC,
8689 .v.func = alc285_fixup_ideapad_s740_coef,
8691 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8693 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8694 .type = HDA_FIXUP_FUNC,
8695 .v.func = alc287_fixup_legion_15imhg05_speakers,
8697 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8699 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8700 .type = HDA_FIXUP_VERBS,
8701 //.v.verbs = legion_15imhg05_coefs,
8702 .v.verbs = (const struct hda_verb[]) {
8703 // set left speaker Legion 7i.
8704 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8705 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8707 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8708 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8709 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8710 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8711 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8713 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8714 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8715 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8716 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8717 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8719 // set right speaker Legion 7i.
8720 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8721 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8723 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8724 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8725 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8726 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8727 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8729 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8730 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8731 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8732 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8733 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8737 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8739 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8740 .type = HDA_FIXUP_FUNC,
8741 .v.func = alc287_fixup_legion_15imhg05_speakers,
8743 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8745 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8746 .type = HDA_FIXUP_VERBS,
8747 .v.verbs = (const struct hda_verb[]) {
8748 // set left speaker Yoga 7i.
8749 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8750 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8752 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8753 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8754 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8755 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8756 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8758 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8759 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8760 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8761 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8762 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8764 // set right speaker Yoga 7i.
8765 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8766 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8768 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8769 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8770 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8771 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8772 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8774 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8775 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8776 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8777 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8778 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8782 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8784 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
8785 .type = HDA_FIXUP_FUNC,
8786 .v.func = alc298_fixup_lenovo_c940_duet7,
8788 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8789 .type = HDA_FIXUP_VERBS,
8790 .v.verbs = (const struct hda_verb[]) {
8791 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8792 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8793 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8794 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8795 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8796 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8797 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8798 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8799 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8800 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8801 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8802 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8803 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8804 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8808 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8810 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
8811 .type = HDA_FIXUP_FUNC,
8812 .v.func = alc256_fixup_set_coef_defaults,
8814 [ALC245_FIXUP_HP_GPIO_LED] = {
8815 .type = HDA_FIXUP_FUNC,
8816 .v.func = alc245_fixup_hp_gpio_led,
8818 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8819 .type = HDA_FIXUP_PINS,
8820 .v.pins = (const struct hda_pintbl[]) {
8821 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8825 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8827 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8828 .type = HDA_FIXUP_FUNC,
8829 .v.func = alc233_fixup_no_audio_jack,
8831 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8832 .type = HDA_FIXUP_FUNC,
8833 .v.func = alc256_fixup_mic_no_presence_and_resume,
8835 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8837 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
8838 .type = HDA_FIXUP_VERBS,
8839 .v.verbs = (const struct hda_verb[]) {
8840 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
8841 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
8845 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8847 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
8848 .type = HDA_FIXUP_FUNC,
8849 .v.func = alc295_fixup_dell_inspiron_top_speakers,
8851 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8853 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
8854 .type = HDA_FIXUP_PINS,
8855 .v.func = alc1220_fixup_gb_dual_codecs,
8857 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8861 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8862 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8863 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8864 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8865 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8866 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8867 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8868 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8869 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8870 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8871 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8872 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8873 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8874 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8875 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8876 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8877 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8878 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8879 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8880 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8881 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8882 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8883 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8884 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8885 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8886 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8887 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8888 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8889 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8890 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8891 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8892 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8893 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8894 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8895 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8896 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8897 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8898 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8899 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8900 SND_PCI_QUIRK(0x1025, 0x1534, "Acer Predator PH315-54", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8901 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8902 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
8903 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8904 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8905 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8906 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8907 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8908 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8909 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8910 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8911 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8912 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8913 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8914 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8915 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8916 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8917 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8918 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8919 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8920 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8921 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8922 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8923 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8924 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8925 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8926 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8927 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8928 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8929 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8930 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8931 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8932 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8933 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8934 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8935 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8936 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8937 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8938 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8939 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8940 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8941 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8942 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8943 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8944 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8945 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8946 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8947 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8948 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8949 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8950 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8951 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8952 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8953 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8954 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
8955 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8956 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8957 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
8958 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
8959 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
8960 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
8961 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8962 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
8963 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
8964 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
8965 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
8966 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
8967 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
8968 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8969 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8970 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8971 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8972 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8973 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8974 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8975 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8976 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8977 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8978 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8979 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8980 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8981 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8982 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8983 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8984 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8985 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8986 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8987 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8988 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8989 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8990 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8991 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8992 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8993 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8994 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8995 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8996 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8997 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8998 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8999 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9000 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9001 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
9002 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9003 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9004 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9005 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
9006 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9007 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9008 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9009 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9010 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9011 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9012 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9013 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9014 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9015 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9016 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9017 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9018 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9019 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9020 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
9021 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9022 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
9023 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9024 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9025 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9026 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9027 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
9028 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9029 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9030 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9031 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9032 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC295_FIXUP_HP_X360),
9033 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
9034 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
9035 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9036 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9037 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9038 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9039 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9040 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9041 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
9042 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9043 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
9044 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9045 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9046 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9047 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
9048 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9049 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9050 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
9051 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9052 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9053 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
9054 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
9055 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
9056 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9057 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9058 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9059 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
9060 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
9061 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9062 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9063 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9064 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9065 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9066 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9067 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9068 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9069 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
9070 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9071 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9072 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9073 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9074 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9075 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
9076 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9077 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9078 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9079 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9080 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9081 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9082 SND_PCI_QUIRK(0x103c, 0x881d, "HP 250 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9083 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9084 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9085 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9086 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9087 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9088 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9089 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9090 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9091 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9092 SND_PCI_QUIRK(0x103c, 0x887a, "HP Laptop 15s-eq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
9093 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
9094 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
9095 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
9096 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9097 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
9098 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
9099 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
9100 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9101 SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9102 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9103 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9104 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9105 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9106 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
9107 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9108 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9109 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED),
9110 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9111 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9112 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9113 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
9114 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9115 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9116 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9117 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9118 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9119 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9120 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9121 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9122 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
9123 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
9124 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
9125 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
9126 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
9127 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
9128 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9129 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9130 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
9131 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
9132 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
9133 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
9134 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
9135 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
9136 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
9137 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
9138 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
9139 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
9140 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
9141 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
9142 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
9143 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
9144 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
9145 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9146 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9147 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9148 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
9149 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
9150 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
9151 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
9152 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
9153 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
9154 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
9155 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
9156 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
9157 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
9158 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
9159 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
9160 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9161 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9162 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9163 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9164 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
9165 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9166 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9167 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9168 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
9169 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9170 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9171 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
9172 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
9173 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9174 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
9175 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9176 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
9177 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
9178 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
9179 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9180 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9181 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9182 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9183 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
9184 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
9185 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9186 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
9187 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
9188 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9189 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
9190 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
9191 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
9192 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
9193 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
9194 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9195 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP),
9196 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP),
9197 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9198 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
9199 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
9200 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
9201 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9202 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9203 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9204 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9205 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9206 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9207 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9208 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9209 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9210 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9211 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9212 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9213 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9214 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9215 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9216 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9217 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9218 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9219 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9220 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9221 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9222 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9223 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9224 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9225 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9226 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9227 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9228 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9229 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9230 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9231 SND_PCI_QUIRK(0x1558, 0x51b1, "Clevo NS50AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9232 SND_PCI_QUIRK(0x1558, 0x51b3, "Clevo NS70AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9233 SND_PCI_QUIRK(0x1558, 0x5630, "Clevo NP50RNJS", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9234 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9235 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9236 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9237 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9238 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9239 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9240 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9241 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9242 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9243 SND_PCI_QUIRK(0x1558, 0x7724, "Clevo L140AU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9244 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9245 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9246 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9247 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9248 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9249 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9250 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9251 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9252 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9253 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
9254 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9255 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9256 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9257 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9258 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9259 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
9260 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9261 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9262 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9263 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9264 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9265 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9266 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9267 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9268 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9269 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9270 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9271 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9272 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9273 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9274 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9275 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9276 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9277 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
9278 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9279 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9280 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9281 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9282 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9283 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
9284 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
9285 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
9286 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
9287 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
9288 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
9289 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9290 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
9291 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
9292 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
9293 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
9294 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
9295 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
9296 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9297 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
9298 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
9299 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
9300 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9301 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9302 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
9303 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
9304 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9305 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9306 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9307 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
9308 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9309 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9310 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9311 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9312 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9313 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9314 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9315 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9316 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9317 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9318 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9319 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9320 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9321 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9322 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9323 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9324 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9325 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9326 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9327 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9328 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9329 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
9330 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
9331 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9332 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9333 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
9334 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9335 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9336 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
9337 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9338 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9339 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9340 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9341 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
9342 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9343 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
9344 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9345 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
9346 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
9347 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9348 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
9349 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
9350 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
9351 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
9352 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
9353 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9354 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
9355 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
9356 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9357 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9358 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9359 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9360 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9361 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9362 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9363 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
9364 SND_PCI_QUIRK(0x17aa, 0x9e56, "Lenovo ZhaoYang CF4620Z", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9365 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
9366 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
9367 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
9368 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9369 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9370 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9371 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
9372 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
9373 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9374 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
9375 SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE),
9376 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
9377 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9378 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9379 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9380 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9381 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9382 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9383 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9384 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
9385 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9386 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
9387 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9388 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
9389 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9390 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
9391 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
9392 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9395 /* Below is a quirk table taken from the old code.
9396 * Basically the device should work as is without the fixup table.
9397 * If BIOS doesn't give a proper info, enable the corresponding
9400 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9402 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9403 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9404 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9405 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9406 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9407 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9408 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9409 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9410 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9411 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9412 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9413 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9414 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9415 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9416 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9417 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9418 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9419 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9420 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9421 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9422 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9423 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9424 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9425 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9426 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9427 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9428 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9429 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9430 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9431 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9432 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9433 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9434 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9435 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9436 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9437 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9438 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9439 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9440 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9445 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9446 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9447 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9448 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9449 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9450 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9454 static const struct hda_model_fixup alc269_fixup_models[] = {
9455 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9456 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9457 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9458 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9459 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9460 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9461 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9462 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9463 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9464 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9465 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9466 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9467 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9468 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9469 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9470 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9471 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9472 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9473 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9474 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9475 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9476 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9477 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9478 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9479 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9480 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9481 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9482 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9483 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9484 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9485 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9486 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9487 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9488 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9489 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9490 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9491 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9492 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9493 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9494 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9495 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9496 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9497 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9498 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9499 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9500 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9501 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9502 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9503 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9504 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9505 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9506 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9507 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9508 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9509 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9510 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9511 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9512 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9513 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9514 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9515 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9516 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9517 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9518 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9519 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
9520 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
9521 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
9522 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
9523 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9524 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9525 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9526 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9527 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9528 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9529 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9530 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9531 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9532 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9533 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9534 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9535 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9536 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
9537 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9538 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9539 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
9540 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
9541 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
9542 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
9543 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9544 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9545 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9546 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9547 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9548 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9549 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9550 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9551 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9552 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9553 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9554 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9555 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9556 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9557 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9558 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9559 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
9560 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9561 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
9562 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
9563 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
9564 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
9565 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
9566 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
9567 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
9568 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
9569 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
9570 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
9571 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
9572 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9573 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
9574 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
9575 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9576 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
9579 #define ALC225_STANDARD_PINS \
9582 #define ALC256_STANDARD_PINS \
9583 {0x12, 0x90a60140}, \
9584 {0x14, 0x90170110}, \
9587 #define ALC282_STANDARD_PINS \
9590 #define ALC290_STANDARD_PINS \
9593 #define ALC292_STANDARD_PINS \
9594 {0x14, 0x90170110}, \
9597 #define ALC295_STANDARD_PINS \
9598 {0x12, 0xb7a60130}, \
9599 {0x14, 0x90170110}, \
9602 #define ALC298_STANDARD_PINS \
9603 {0x12, 0x90a60130}, \
9606 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
9607 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9612 {0x21, 0x0221102f}),
9613 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9616 {0x21, 0x02211030}),
9617 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9620 {0x21, 0x03211020}),
9621 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9624 {0x21, 0x03211020}),
9625 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9626 ALC225_STANDARD_PINS,
9628 {0x14, 0x901701a0}),
9629 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9630 ALC225_STANDARD_PINS,
9632 {0x14, 0x901701b0}),
9633 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9634 ALC225_STANDARD_PINS,
9636 {0x14, 0x901701a0}),
9637 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9638 ALC225_STANDARD_PINS,
9640 {0x14, 0x901701b0}),
9641 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9642 ALC225_STANDARD_PINS,
9644 {0x1b, 0x90170110}),
9645 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9648 {0x21, 0x02211020}),
9649 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9653 {0x21, 0x02211020}),
9654 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9659 {0x21, 0x0221101f}),
9660 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9665 {0x21, 0x0221101f}),
9666 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9670 {0x21, 0x0221101f}),
9671 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9672 {0x21, 0x02211010}),
9673 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9676 {0x21, 0x02211030}),
9677 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9679 {0x21, 0x02211020}),
9680 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9682 {0x21, 0x02211040}),
9683 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9686 {0x21, 0x02211020}),
9687 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9690 {0x21, 0x02211030}),
9691 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9694 {0x21, 0x0221101f}),
9695 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9698 {0x21, 0x0221101f}),
9699 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9702 {0x21, 0x0221103f}),
9703 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9706 {0x21, 0x0221103f}),
9707 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9710 {0x21, 0x0221103f}),
9711 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9714 {0x21, 0x0221105f}),
9715 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9718 {0x21, 0x0221101f}),
9719 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9723 {0x21, 0x0321102f}),
9724 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9727 {0x21, 0x02211040}),
9728 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9731 {0x21, 0x02211050}),
9732 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9735 {0x21, 0x02211030}),
9736 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9739 {0x21, 0x02211040}),
9740 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9743 {0x21, 0x02211040}),
9744 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9747 {0x21, 0x02211050}),
9748 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9751 {0x21, 0x02211040}),
9752 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9755 {0x21, 0x02211030}),
9756 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9758 {0x21, 0x02211010}),
9759 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9762 {0x21, 0x04211020}),
9763 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9766 {0x21, 0x03211020}),
9767 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9770 {0x21, 0x03211020}),
9771 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9774 {0x21, 0x04211020}),
9775 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9778 {0x21, 0x03211020}),
9779 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9782 {0x21, 0x0221101f}),
9783 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9786 {0x21, 0x03211020}),
9787 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9791 {0x1a, 0x04a11020}),
9792 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9798 {0x1b, 0x02011020}),
9799 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9800 ALC282_STANDARD_PINS,
9803 {0x21, 0x0321101f}),
9804 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9805 ALC282_STANDARD_PINS,
9808 {0x21, 0x03211040}),
9809 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9810 ALC282_STANDARD_PINS,
9813 {0x21, 0x03211020}),
9814 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9815 ALC282_STANDARD_PINS,
9818 {0x21, 0x0421101f}),
9819 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9820 ALC282_STANDARD_PINS,
9823 {0x21, 0x04211020}),
9824 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9825 ALC282_STANDARD_PINS,
9831 {0x21, 0x0321101f}),
9832 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9833 ALC282_STANDARD_PINS,
9839 {0x21, 0x0321101f}),
9840 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9841 ALC282_STANDARD_PINS,
9843 {0x21, 0x0321101f}),
9844 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9847 {0x21, 0x02211030}),
9848 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9849 ALC282_STANDARD_PINS,
9852 {0x21, 0x0321101f}),
9853 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9857 {0x21, 0x04211020}),
9858 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9862 {0x21, 0x04211020}),
9863 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9866 {0x21, 0x04211020}),
9867 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9871 {0x21, 0x03211020}),
9872 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9875 {0x21, 0x02211020}),
9876 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9879 {0x21, 0x0321101f}),
9880 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9881 ALC290_STANDARD_PINS,
9884 {0x1a, 0x04a11020}),
9885 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9886 ALC290_STANDARD_PINS,
9889 {0x1a, 0x04a11020}),
9890 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9891 ALC290_STANDARD_PINS,
9893 {0x1a, 0x04a11020}),
9894 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9895 ALC290_STANDARD_PINS,
9897 {0x1a, 0x04a11040}),
9898 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9899 ALC290_STANDARD_PINS,
9902 {0x1a, 0x04a11040}),
9903 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9904 ALC290_STANDARD_PINS,
9907 {0x1a, 0x04a11020}),
9908 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9909 ALC290_STANDARD_PINS,
9912 {0x1a, 0x04a11020}),
9913 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9914 ALC292_STANDARD_PINS,
9917 {0x19, 0x01a19030}),
9918 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9919 ALC292_STANDARD_PINS,
9923 {0x19, 0x01a1903e}),
9924 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9925 ALC292_STANDARD_PINS,
9926 {0x12, 0x90a60140}),
9927 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9928 ALC292_STANDARD_PINS,
9931 {0x19, 0x21a19030}),
9932 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9933 ALC292_STANDARD_PINS,
9934 {0x13, 0x90a60140}),
9935 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9937 {0x21, 0x04211020}),
9938 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9941 {0x21, 0x04211020}),
9942 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9945 {0x21, 0x03211020}),
9946 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9949 {0x21, 0x04211020}),
9950 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9953 {0x21, 0x03211020}),
9954 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9957 {0x21, 0x04211030}),
9958 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9961 {0x21, 0x03211020}),
9962 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9965 {0x21, 0x03211020}),
9966 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9968 {0x21, 0x04211020}),
9969 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9971 {0x21, 0x04211030}),
9972 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9973 ALC295_STANDARD_PINS,
9975 {0x18, 0x21a19030}),
9976 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9977 ALC295_STANDARD_PINS,
9979 {0x18, 0x21a19050}),
9980 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9981 ALC295_STANDARD_PINS),
9982 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9983 ALC298_STANDARD_PINS,
9984 {0x17, 0x90170110}),
9985 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9986 ALC298_STANDARD_PINS,
9987 {0x17, 0x90170140}),
9988 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9989 ALC298_STANDARD_PINS,
9990 {0x17, 0x90170150}),
9991 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9996 {0x21, 0x03211030}),
9997 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
10000 {0x1a, 0x03a11030},
10001 {0x21, 0x03211020}),
10002 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10003 ALC225_STANDARD_PINS,
10004 {0x12, 0xb7a60130},
10005 {0x17, 0x90170110}),
10006 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
10007 {0x14, 0x01014010},
10008 {0x17, 0x90170120},
10009 {0x18, 0x02a11030},
10010 {0x19, 0x02a1103f},
10011 {0x21, 0x0221101f}),
10015 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
10016 * more machines, don't need to match all valid pins, just need to match
10017 * all the pins defined in the tbl. Just because of this reason, it is possible
10018 * that a single machine matches multiple tbls, so there is one limitation:
10019 * at most one tbl is allowed to define for the same vendor and same codec
10021 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
10022 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
10023 {0x19, 0x40000000},
10024 {0x1b, 0x40000000}),
10025 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10026 {0x19, 0x40000000},
10027 {0x1a, 0x40000000}),
10028 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
10029 {0x19, 0x40000000},
10030 {0x1a, 0x40000000}),
10031 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
10032 {0x19, 0x40000000},
10033 {0x1a, 0x40000000}),
10037 static void alc269_fill_coef(struct hda_codec *codec)
10039 struct alc_spec *spec = codec->spec;
10042 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
10045 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
10046 alc_write_coef_idx(codec, 0xf, 0x960b);
10047 alc_write_coef_idx(codec, 0xe, 0x8817);
10050 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
10051 alc_write_coef_idx(codec, 0xf, 0x960b);
10052 alc_write_coef_idx(codec, 0xe, 0x8814);
10055 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
10056 /* Power up output pin */
10057 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
10060 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
10061 val = alc_read_coef_idx(codec, 0xd);
10062 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
10063 /* Capless ramp up clock control */
10064 alc_write_coef_idx(codec, 0xd, val | (1<<10));
10066 val = alc_read_coef_idx(codec, 0x17);
10067 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
10068 /* Class D power on reset */
10069 alc_write_coef_idx(codec, 0x17, val | (1<<7));
10074 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
10079 static int patch_alc269(struct hda_codec *codec)
10081 struct alc_spec *spec;
10084 err = alc_alloc_spec(codec, 0x0b);
10088 spec = codec->spec;
10089 spec->gen.shared_mic_vref_pin = 0x18;
10090 codec->power_save_node = 0;
10091 spec->en_3kpull_low = true;
10094 codec->patch_ops.suspend = alc269_suspend;
10095 codec->patch_ops.resume = alc269_resume;
10097 spec->shutup = alc_default_shutup;
10098 spec->init_hook = alc_default_init;
10100 switch (codec->core.vendor_id) {
10102 spec->codec_variant = ALC269_TYPE_ALC269VA;
10103 switch (alc_get_coef0(codec) & 0x00f0) {
10105 if (codec->bus->pci &&
10106 codec->bus->pci->subsystem_vendor == 0x1025 &&
10107 spec->cdefine.platform_type == 1)
10108 err = alc_codec_rename(codec, "ALC271X");
10109 spec->codec_variant = ALC269_TYPE_ALC269VB;
10112 if (codec->bus->pci &&
10113 codec->bus->pci->subsystem_vendor == 0x17aa &&
10114 codec->bus->pci->subsystem_device == 0x21f3)
10115 err = alc_codec_rename(codec, "ALC3202");
10116 spec->codec_variant = ALC269_TYPE_ALC269VC;
10119 spec->codec_variant = ALC269_TYPE_ALC269VD;
10122 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10126 spec->shutup = alc269_shutup;
10127 spec->init_hook = alc269_fill_coef;
10128 alc269_fill_coef(codec);
10133 spec->codec_variant = ALC269_TYPE_ALC280;
10136 spec->codec_variant = ALC269_TYPE_ALC282;
10137 spec->shutup = alc282_shutup;
10138 spec->init_hook = alc282_init;
10142 spec->codec_variant = ALC269_TYPE_ALC283;
10143 spec->shutup = alc283_shutup;
10144 spec->init_hook = alc283_init;
10148 spec->codec_variant = ALC269_TYPE_ALC284;
10151 spec->codec_variant = ALC269_TYPE_ALC293;
10155 spec->codec_variant = ALC269_TYPE_ALC286;
10158 spec->codec_variant = ALC269_TYPE_ALC298;
10162 spec->codec_variant = ALC269_TYPE_ALC255;
10163 spec->shutup = alc256_shutup;
10164 spec->init_hook = alc256_init;
10170 spec->codec_variant = ALC269_TYPE_ALC256;
10171 spec->shutup = alc256_shutup;
10172 spec->init_hook = alc256_init;
10173 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
10174 if (codec->core.vendor_id == 0x10ec0236 &&
10175 codec->bus->pci->vendor != PCI_VENDOR_ID_AMD)
10176 spec->en_3kpull_low = false;
10179 spec->codec_variant = ALC269_TYPE_ALC257;
10180 spec->shutup = alc256_shutup;
10181 spec->init_hook = alc256_init;
10182 spec->gen.mixer_nid = 0;
10183 spec->en_3kpull_low = false;
10189 if (alc_get_coef0(codec) & 0x0010)
10190 spec->codec_variant = ALC269_TYPE_ALC245;
10192 spec->codec_variant = ALC269_TYPE_ALC215;
10193 spec->shutup = alc225_shutup;
10194 spec->init_hook = alc225_init;
10195 spec->gen.mixer_nid = 0;
10200 spec->codec_variant = ALC269_TYPE_ALC225;
10201 spec->shutup = alc225_shutup;
10202 spec->init_hook = alc225_init;
10203 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
10206 spec->codec_variant = ALC269_TYPE_ALC287;
10207 spec->shutup = alc225_shutup;
10208 spec->init_hook = alc225_init;
10209 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10214 spec->codec_variant = ALC269_TYPE_ALC294;
10215 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
10216 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
10217 spec->init_hook = alc294_init;
10220 spec->codec_variant = ALC269_TYPE_ALC300;
10221 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
10224 spec->codec_variant = ALC269_TYPE_ALC623;
10230 spec->codec_variant = ALC269_TYPE_ALC700;
10231 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
10232 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
10233 spec->init_hook = alc294_init;
10238 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
10239 spec->has_alc5505_dsp = 1;
10240 spec->init_hook = alc5505_dsp_init;
10243 alc_pre_init(codec);
10245 snd_hda_pick_fixup(codec, alc269_fixup_models,
10246 alc269_fixup_tbl, alc269_fixups);
10247 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10248 * the quirk breaks the latter (bko#214101).
10249 * Clear the wrong entry.
10251 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10252 codec->core.vendor_id == 0x10ec0294) {
10253 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10254 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10257 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
10258 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
10259 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10261 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10263 alc_auto_parse_customize_define(codec);
10265 if (has_cdefine_beep(codec))
10266 spec->gen.beep_nid = 0x01;
10268 /* automatic parse from the BIOS config */
10269 err = alc269_parse_auto_config(codec);
10273 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10274 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10279 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10292 static int alc861_parse_auto_config(struct hda_codec *codec)
10294 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
10295 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10296 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
10299 /* Pin config fixes */
10301 ALC861_FIXUP_FSC_AMILO_PI1505,
10302 ALC861_FIXUP_AMP_VREF_0F,
10303 ALC861_FIXUP_NO_JACK_DETECT,
10304 ALC861_FIXUP_ASUS_A6RP,
10305 ALC660_FIXUP_ASUS_W7J,
10308 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10309 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
10310 const struct hda_fixup *fix, int action)
10312 struct alc_spec *spec = codec->spec;
10315 if (action != HDA_FIXUP_ACT_INIT)
10317 val = snd_hda_codec_get_pin_target(codec, 0x0f);
10318 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10319 val |= AC_PINCTL_IN_EN;
10320 val |= AC_PINCTL_VREF_50;
10321 snd_hda_set_pin_ctl(codec, 0x0f, val);
10322 spec->gen.keep_vref_in_automute = 1;
10325 /* suppress the jack-detection */
10326 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
10327 const struct hda_fixup *fix, int action)
10329 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10330 codec->no_jack_detect = 1;
10333 static const struct hda_fixup alc861_fixups[] = {
10334 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
10335 .type = HDA_FIXUP_PINS,
10336 .v.pins = (const struct hda_pintbl[]) {
10337 { 0x0b, 0x0221101f }, /* HP */
10338 { 0x0f, 0x90170310 }, /* speaker */
10342 [ALC861_FIXUP_AMP_VREF_0F] = {
10343 .type = HDA_FIXUP_FUNC,
10344 .v.func = alc861_fixup_asus_amp_vref_0f,
10346 [ALC861_FIXUP_NO_JACK_DETECT] = {
10347 .type = HDA_FIXUP_FUNC,
10348 .v.func = alc_fixup_no_jack_detect,
10350 [ALC861_FIXUP_ASUS_A6RP] = {
10351 .type = HDA_FIXUP_FUNC,
10352 .v.func = alc861_fixup_asus_amp_vref_0f,
10354 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
10356 [ALC660_FIXUP_ASUS_W7J] = {
10357 .type = HDA_FIXUP_VERBS,
10358 .v.verbs = (const struct hda_verb[]) {
10359 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10360 * for enabling outputs
10362 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10368 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
10369 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
10370 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
10371 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10372 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10373 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
10374 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
10375 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
10381 static int patch_alc861(struct hda_codec *codec)
10383 struct alc_spec *spec;
10386 err = alc_alloc_spec(codec, 0x15);
10390 spec = codec->spec;
10391 if (has_cdefine_beep(codec))
10392 spec->gen.beep_nid = 0x23;
10395 spec->power_hook = alc_power_eapd;
10398 alc_pre_init(codec);
10400 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10401 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10403 /* automatic parse from the BIOS config */
10404 err = alc861_parse_auto_config(codec);
10408 if (!spec->gen.no_analog) {
10409 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10414 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10424 * ALC861-VD support
10428 * In addition, an independent DAC
10430 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10432 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10433 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10434 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10438 ALC660VD_FIX_ASUS_GPIO1,
10439 ALC861VD_FIX_DALLAS,
10442 /* exclude VREF80 */
10443 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10444 const struct hda_fixup *fix, int action)
10446 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10447 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10448 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10453 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10454 const struct hda_fixup *fix, int action)
10456 struct alc_spec *spec = codec->spec;
10458 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10459 spec->gpio_mask |= 0x02;
10460 alc_fixup_gpio(codec, action, 0x01);
10463 static const struct hda_fixup alc861vd_fixups[] = {
10464 [ALC660VD_FIX_ASUS_GPIO1] = {
10465 .type = HDA_FIXUP_FUNC,
10466 .v.func = alc660vd_fixup_asus_gpio1,
10468 [ALC861VD_FIX_DALLAS] = {
10469 .type = HDA_FIXUP_FUNC,
10470 .v.func = alc861vd_fixup_dallas,
10474 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10475 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10476 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10477 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10483 static int patch_alc861vd(struct hda_codec *codec)
10485 struct alc_spec *spec;
10488 err = alc_alloc_spec(codec, 0x0b);
10492 spec = codec->spec;
10493 if (has_cdefine_beep(codec))
10494 spec->gen.beep_nid = 0x23;
10496 spec->shutup = alc_eapd_shutup;
10498 alc_pre_init(codec);
10500 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10501 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10503 /* automatic parse from the BIOS config */
10504 err = alc861vd_parse_auto_config(codec);
10508 if (!spec->gen.no_analog) {
10509 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10514 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10526 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10527 * configuration. Each pin widget can choose any input DACs and a mixer.
10528 * Each ADC is connected from a mixer of all inputs. This makes possible
10529 * 6-channel independent captures.
10531 * In addition, an independent DAC for the multi-playback (not used in this
10536 * BIOS auto configuration
10539 static int alc662_parse_auto_config(struct hda_codec *codec)
10541 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
10542 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10543 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10544 const hda_nid_t *ssids;
10546 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10547 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10548 codec->core.vendor_id == 0x10ec0671)
10549 ssids = alc663_ssids;
10551 ssids = alc662_ssids;
10552 return alc_parse_auto_config(codec, alc662_ignore, ssids);
10555 static void alc272_fixup_mario(struct hda_codec *codec,
10556 const struct hda_fixup *fix, int action)
10558 if (action != HDA_FIXUP_ACT_PRE_PROBE)
10560 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10561 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10562 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10563 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10564 (0 << AC_AMPCAP_MUTE_SHIFT)))
10565 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
10568 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10570 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10572 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10573 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10577 /* override the 2.1 chmap */
10578 static void alc_fixup_bass_chmap(struct hda_codec *codec,
10579 const struct hda_fixup *fix, int action)
10581 if (action == HDA_FIXUP_ACT_BUILD) {
10582 struct alc_spec *spec = codec->spec;
10583 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
10587 /* avoid D3 for keeping GPIO up */
10588 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10590 unsigned int power_state)
10592 struct alc_spec *spec = codec->spec;
10593 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
10594 return AC_PWRST_D0;
10595 return power_state;
10598 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10599 const struct hda_fixup *fix, int action)
10601 struct alc_spec *spec = codec->spec;
10603 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
10604 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10605 spec->mute_led_polarity = 1;
10606 codec->power_filter = gpio_led_power_filter;
10610 static void alc662_usi_automute_hook(struct hda_codec *codec,
10611 struct hda_jack_callback *jack)
10613 struct alc_spec *spec = codec->spec;
10616 snd_hda_gen_hp_automute(codec, jack);
10618 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10620 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10624 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10625 const struct hda_fixup *fix, int action)
10627 struct alc_spec *spec = codec->spec;
10628 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10629 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10630 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10634 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10635 struct hda_jack_callback *cb)
10637 /* surround speakers at 0x1b already get muted automatically when
10638 * headphones are plugged in, but we have to mute/unmute the remaining
10639 * channels manually:
10640 * 0x15 - front left/front right
10641 * 0x18 - front center/ LFE
10643 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10644 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10645 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10647 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10648 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10652 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10653 const struct hda_fixup *fix, int action)
10655 /* Pin 0x1b: shared headphones jack and surround speakers */
10656 if (!is_jack_detectable(codec, 0x1b))
10660 case HDA_FIXUP_ACT_PRE_PROBE:
10661 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10662 alc662_aspire_ethos_mute_speakers);
10663 /* subwoofer needs an extra GPIO setting to become audible */
10664 alc_setup_gpio(codec, 0x02);
10666 case HDA_FIXUP_ACT_INIT:
10667 /* Make sure to start in a correct state, i.e. if
10668 * headphones have been plugged in before powering up the system
10670 alc662_aspire_ethos_mute_speakers(codec, NULL);
10675 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10676 const struct hda_fixup *fix, int action)
10678 struct alc_spec *spec = codec->spec;
10680 static const struct hda_pintbl pincfgs[] = {
10681 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10682 { 0x1b, 0x0181304f },
10687 case HDA_FIXUP_ACT_PRE_PROBE:
10688 spec->gen.mixer_nid = 0;
10689 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10690 snd_hda_apply_pincfgs(codec, pincfgs);
10692 case HDA_FIXUP_ACT_INIT:
10693 alc_write_coef_idx(codec, 0x19, 0xa054);
10698 static void alc897_hp_automute_hook(struct hda_codec *codec,
10699 struct hda_jack_callback *jack)
10701 struct alc_spec *spec = codec->spec;
10704 snd_hda_gen_hp_automute(codec, jack);
10705 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10706 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10710 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10711 const struct hda_fixup *fix, int action)
10713 struct alc_spec *spec = codec->spec;
10714 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10715 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10719 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
10720 const struct hda_fixup *fix, int action)
10722 struct alc_spec *spec = codec->spec;
10724 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10725 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10726 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10730 static const struct coef_fw alc668_coefs[] = {
10731 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10732 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10733 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10734 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10735 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10736 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10737 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10738 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10739 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10740 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10741 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10742 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10743 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10744 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10745 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10746 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10747 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10748 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10749 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10750 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10754 static void alc668_restore_default_value(struct hda_codec *codec)
10756 alc_process_coef_fw(codec, alc668_coefs);
10760 ALC662_FIXUP_ASPIRE,
10761 ALC662_FIXUP_LED_GPIO1,
10762 ALC662_FIXUP_IDEAPAD,
10763 ALC272_FIXUP_MARIO,
10764 ALC662_FIXUP_CZC_ET26,
10765 ALC662_FIXUP_CZC_P10T,
10766 ALC662_FIXUP_SKU_IGNORE,
10767 ALC662_FIXUP_HP_RP5800,
10768 ALC662_FIXUP_ASUS_MODE1,
10769 ALC662_FIXUP_ASUS_MODE2,
10770 ALC662_FIXUP_ASUS_MODE3,
10771 ALC662_FIXUP_ASUS_MODE4,
10772 ALC662_FIXUP_ASUS_MODE5,
10773 ALC662_FIXUP_ASUS_MODE6,
10774 ALC662_FIXUP_ASUS_MODE7,
10775 ALC662_FIXUP_ASUS_MODE8,
10776 ALC662_FIXUP_NO_JACK_DETECT,
10777 ALC662_FIXUP_ZOTAC_Z68,
10778 ALC662_FIXUP_INV_DMIC,
10779 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10780 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10781 ALC662_FIXUP_HEADSET_MODE,
10782 ALC668_FIXUP_HEADSET_MODE,
10783 ALC662_FIXUP_BASS_MODE4_CHMAP,
10784 ALC662_FIXUP_BASS_16,
10785 ALC662_FIXUP_BASS_1A,
10786 ALC662_FIXUP_BASS_CHMAP,
10787 ALC668_FIXUP_AUTO_MUTE,
10788 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10789 ALC668_FIXUP_DELL_XPS13,
10790 ALC662_FIXUP_ASUS_Nx50,
10791 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10792 ALC668_FIXUP_ASUS_Nx51,
10793 ALC668_FIXUP_MIC_COEF,
10794 ALC668_FIXUP_ASUS_G751,
10795 ALC891_FIXUP_HEADSET_MODE,
10796 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10797 ALC662_FIXUP_ACER_VERITON,
10798 ALC892_FIXUP_ASROCK_MOBO,
10799 ALC662_FIXUP_USI_FUNC,
10800 ALC662_FIXUP_USI_HEADSET_MODE,
10801 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10802 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10803 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10804 ALC671_FIXUP_HP_HEADSET_MIC2,
10805 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10806 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10807 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10808 ALC668_FIXUP_HEADSET_MIC,
10809 ALC668_FIXUP_MIC_DET_COEF,
10810 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10811 ALC897_FIXUP_HEADSET_MIC_PIN,
10812 ALC897_FIXUP_HP_HSMIC_VERB,
10813 ALC897_FIXUP_LENOVO_HEADSET_MODE,
10814 ALC897_FIXUP_HEADSET_MIC_PIN2,
10815 ALC897_FIXUP_UNIS_H3C_X500S,
10818 static const struct hda_fixup alc662_fixups[] = {
10819 [ALC662_FIXUP_ASPIRE] = {
10820 .type = HDA_FIXUP_PINS,
10821 .v.pins = (const struct hda_pintbl[]) {
10822 { 0x15, 0x99130112 }, /* subwoofer */
10826 [ALC662_FIXUP_LED_GPIO1] = {
10827 .type = HDA_FIXUP_FUNC,
10828 .v.func = alc662_fixup_led_gpio1,
10830 [ALC662_FIXUP_IDEAPAD] = {
10831 .type = HDA_FIXUP_PINS,
10832 .v.pins = (const struct hda_pintbl[]) {
10833 { 0x17, 0x99130112 }, /* subwoofer */
10837 .chain_id = ALC662_FIXUP_LED_GPIO1,
10839 [ALC272_FIXUP_MARIO] = {
10840 .type = HDA_FIXUP_FUNC,
10841 .v.func = alc272_fixup_mario,
10843 [ALC662_FIXUP_CZC_ET26] = {
10844 .type = HDA_FIXUP_PINS,
10845 .v.pins = (const struct hda_pintbl[]) {
10846 {0x12, 0x403cc000},
10847 {0x14, 0x90170110}, /* speaker */
10848 {0x15, 0x411111f0},
10849 {0x16, 0x411111f0},
10850 {0x18, 0x01a19030}, /* mic */
10851 {0x19, 0x90a7013f}, /* int-mic */
10852 {0x1a, 0x01014020},
10853 {0x1b, 0x0121401f},
10854 {0x1c, 0x411111f0},
10855 {0x1d, 0x411111f0},
10856 {0x1e, 0x40478e35},
10860 .chain_id = ALC662_FIXUP_SKU_IGNORE
10862 [ALC662_FIXUP_CZC_P10T] = {
10863 .type = HDA_FIXUP_VERBS,
10864 .v.verbs = (const struct hda_verb[]) {
10865 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10869 [ALC662_FIXUP_SKU_IGNORE] = {
10870 .type = HDA_FIXUP_FUNC,
10871 .v.func = alc_fixup_sku_ignore,
10873 [ALC662_FIXUP_HP_RP5800] = {
10874 .type = HDA_FIXUP_PINS,
10875 .v.pins = (const struct hda_pintbl[]) {
10876 { 0x14, 0x0221201f }, /* HP out */
10880 .chain_id = ALC662_FIXUP_SKU_IGNORE
10882 [ALC662_FIXUP_ASUS_MODE1] = {
10883 .type = HDA_FIXUP_PINS,
10884 .v.pins = (const struct hda_pintbl[]) {
10885 { 0x14, 0x99130110 }, /* speaker */
10886 { 0x18, 0x01a19c20 }, /* mic */
10887 { 0x19, 0x99a3092f }, /* int-mic */
10888 { 0x21, 0x0121401f }, /* HP out */
10892 .chain_id = ALC662_FIXUP_SKU_IGNORE
10894 [ALC662_FIXUP_ASUS_MODE2] = {
10895 .type = HDA_FIXUP_PINS,
10896 .v.pins = (const struct hda_pintbl[]) {
10897 { 0x14, 0x99130110 }, /* speaker */
10898 { 0x18, 0x01a19820 }, /* mic */
10899 { 0x19, 0x99a3092f }, /* int-mic */
10900 { 0x1b, 0x0121401f }, /* HP out */
10904 .chain_id = ALC662_FIXUP_SKU_IGNORE
10906 [ALC662_FIXUP_ASUS_MODE3] = {
10907 .type = HDA_FIXUP_PINS,
10908 .v.pins = (const struct hda_pintbl[]) {
10909 { 0x14, 0x99130110 }, /* speaker */
10910 { 0x15, 0x0121441f }, /* HP */
10911 { 0x18, 0x01a19840 }, /* mic */
10912 { 0x19, 0x99a3094f }, /* int-mic */
10913 { 0x21, 0x01211420 }, /* HP2 */
10917 .chain_id = ALC662_FIXUP_SKU_IGNORE
10919 [ALC662_FIXUP_ASUS_MODE4] = {
10920 .type = HDA_FIXUP_PINS,
10921 .v.pins = (const struct hda_pintbl[]) {
10922 { 0x14, 0x99130110 }, /* speaker */
10923 { 0x16, 0x99130111 }, /* speaker */
10924 { 0x18, 0x01a19840 }, /* mic */
10925 { 0x19, 0x99a3094f }, /* int-mic */
10926 { 0x21, 0x0121441f }, /* HP */
10930 .chain_id = ALC662_FIXUP_SKU_IGNORE
10932 [ALC662_FIXUP_ASUS_MODE5] = {
10933 .type = HDA_FIXUP_PINS,
10934 .v.pins = (const struct hda_pintbl[]) {
10935 { 0x14, 0x99130110 }, /* speaker */
10936 { 0x15, 0x0121441f }, /* HP */
10937 { 0x16, 0x99130111 }, /* speaker */
10938 { 0x18, 0x01a19840 }, /* mic */
10939 { 0x19, 0x99a3094f }, /* int-mic */
10943 .chain_id = ALC662_FIXUP_SKU_IGNORE
10945 [ALC662_FIXUP_ASUS_MODE6] = {
10946 .type = HDA_FIXUP_PINS,
10947 .v.pins = (const struct hda_pintbl[]) {
10948 { 0x14, 0x99130110 }, /* speaker */
10949 { 0x15, 0x01211420 }, /* HP2 */
10950 { 0x18, 0x01a19840 }, /* mic */
10951 { 0x19, 0x99a3094f }, /* int-mic */
10952 { 0x1b, 0x0121441f }, /* HP */
10956 .chain_id = ALC662_FIXUP_SKU_IGNORE
10958 [ALC662_FIXUP_ASUS_MODE7] = {
10959 .type = HDA_FIXUP_PINS,
10960 .v.pins = (const struct hda_pintbl[]) {
10961 { 0x14, 0x99130110 }, /* speaker */
10962 { 0x17, 0x99130111 }, /* speaker */
10963 { 0x18, 0x01a19840 }, /* mic */
10964 { 0x19, 0x99a3094f }, /* int-mic */
10965 { 0x1b, 0x01214020 }, /* HP */
10966 { 0x21, 0x0121401f }, /* HP */
10970 .chain_id = ALC662_FIXUP_SKU_IGNORE
10972 [ALC662_FIXUP_ASUS_MODE8] = {
10973 .type = HDA_FIXUP_PINS,
10974 .v.pins = (const struct hda_pintbl[]) {
10975 { 0x14, 0x99130110 }, /* speaker */
10976 { 0x12, 0x99a30970 }, /* int-mic */
10977 { 0x15, 0x01214020 }, /* HP */
10978 { 0x17, 0x99130111 }, /* speaker */
10979 { 0x18, 0x01a19840 }, /* mic */
10980 { 0x21, 0x0121401f }, /* HP */
10984 .chain_id = ALC662_FIXUP_SKU_IGNORE
10986 [ALC662_FIXUP_NO_JACK_DETECT] = {
10987 .type = HDA_FIXUP_FUNC,
10988 .v.func = alc_fixup_no_jack_detect,
10990 [ALC662_FIXUP_ZOTAC_Z68] = {
10991 .type = HDA_FIXUP_PINS,
10992 .v.pins = (const struct hda_pintbl[]) {
10993 { 0x1b, 0x02214020 }, /* Front HP */
10997 [ALC662_FIXUP_INV_DMIC] = {
10998 .type = HDA_FIXUP_FUNC,
10999 .v.func = alc_fixup_inv_dmic,
11001 [ALC668_FIXUP_DELL_XPS13] = {
11002 .type = HDA_FIXUP_FUNC,
11003 .v.func = alc_fixup_dell_xps13,
11005 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
11007 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
11008 .type = HDA_FIXUP_FUNC,
11009 .v.func = alc_fixup_disable_aamix,
11011 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11013 [ALC668_FIXUP_AUTO_MUTE] = {
11014 .type = HDA_FIXUP_FUNC,
11015 .v.func = alc_fixup_auto_mute_via_amp,
11017 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
11019 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
11020 .type = HDA_FIXUP_PINS,
11021 .v.pins = (const struct hda_pintbl[]) {
11022 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11023 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
11027 .chain_id = ALC662_FIXUP_HEADSET_MODE
11029 [ALC662_FIXUP_HEADSET_MODE] = {
11030 .type = HDA_FIXUP_FUNC,
11031 .v.func = alc_fixup_headset_mode_alc662,
11033 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
11034 .type = HDA_FIXUP_PINS,
11035 .v.pins = (const struct hda_pintbl[]) {
11036 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11037 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11041 .chain_id = ALC668_FIXUP_HEADSET_MODE
11043 [ALC668_FIXUP_HEADSET_MODE] = {
11044 .type = HDA_FIXUP_FUNC,
11045 .v.func = alc_fixup_headset_mode_alc668,
11047 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
11048 .type = HDA_FIXUP_FUNC,
11049 .v.func = alc_fixup_bass_chmap,
11051 .chain_id = ALC662_FIXUP_ASUS_MODE4
11053 [ALC662_FIXUP_BASS_16] = {
11054 .type = HDA_FIXUP_PINS,
11055 .v.pins = (const struct hda_pintbl[]) {
11056 {0x16, 0x80106111}, /* bass speaker */
11060 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11062 [ALC662_FIXUP_BASS_1A] = {
11063 .type = HDA_FIXUP_PINS,
11064 .v.pins = (const struct hda_pintbl[]) {
11065 {0x1a, 0x80106111}, /* bass speaker */
11069 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11071 [ALC662_FIXUP_BASS_CHMAP] = {
11072 .type = HDA_FIXUP_FUNC,
11073 .v.func = alc_fixup_bass_chmap,
11075 [ALC662_FIXUP_ASUS_Nx50] = {
11076 .type = HDA_FIXUP_FUNC,
11077 .v.func = alc_fixup_auto_mute_via_amp,
11079 .chain_id = ALC662_FIXUP_BASS_1A
11081 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
11082 .type = HDA_FIXUP_FUNC,
11083 .v.func = alc_fixup_headset_mode_alc668,
11084 .chain_id = ALC662_FIXUP_BASS_CHMAP
11086 [ALC668_FIXUP_ASUS_Nx51] = {
11087 .type = HDA_FIXUP_PINS,
11088 .v.pins = (const struct hda_pintbl[]) {
11089 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11090 { 0x1a, 0x90170151 }, /* bass speaker */
11091 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11095 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11097 [ALC668_FIXUP_MIC_COEF] = {
11098 .type = HDA_FIXUP_VERBS,
11099 .v.verbs = (const struct hda_verb[]) {
11100 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
11101 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
11105 [ALC668_FIXUP_ASUS_G751] = {
11106 .type = HDA_FIXUP_PINS,
11107 .v.pins = (const struct hda_pintbl[]) {
11108 { 0x16, 0x0421101f }, /* HP */
11112 .chain_id = ALC668_FIXUP_MIC_COEF
11114 [ALC891_FIXUP_HEADSET_MODE] = {
11115 .type = HDA_FIXUP_FUNC,
11116 .v.func = alc_fixup_headset_mode,
11118 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
11119 .type = HDA_FIXUP_PINS,
11120 .v.pins = (const struct hda_pintbl[]) {
11121 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11122 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11126 .chain_id = ALC891_FIXUP_HEADSET_MODE
11128 [ALC662_FIXUP_ACER_VERITON] = {
11129 .type = HDA_FIXUP_PINS,
11130 .v.pins = (const struct hda_pintbl[]) {
11131 { 0x15, 0x50170120 }, /* no internal speaker */
11135 [ALC892_FIXUP_ASROCK_MOBO] = {
11136 .type = HDA_FIXUP_PINS,
11137 .v.pins = (const struct hda_pintbl[]) {
11138 { 0x15, 0x40f000f0 }, /* disabled */
11139 { 0x16, 0x40f000f0 }, /* disabled */
11143 [ALC662_FIXUP_USI_FUNC] = {
11144 .type = HDA_FIXUP_FUNC,
11145 .v.func = alc662_fixup_usi_headset_mic,
11147 [ALC662_FIXUP_USI_HEADSET_MODE] = {
11148 .type = HDA_FIXUP_PINS,
11149 .v.pins = (const struct hda_pintbl[]) {
11150 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11151 { 0x18, 0x01a1903d },
11155 .chain_id = ALC662_FIXUP_USI_FUNC
11157 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11158 .type = HDA_FIXUP_FUNC,
11159 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11161 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11162 .type = HDA_FIXUP_FUNC,
11163 .v.func = alc662_fixup_aspire_ethos_hp,
11165 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11166 .type = HDA_FIXUP_PINS,
11167 .v.pins = (const struct hda_pintbl[]) {
11168 { 0x15, 0x92130110 }, /* front speakers */
11169 { 0x18, 0x99130111 }, /* center/subwoofer */
11170 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
11174 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
11176 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
11177 .type = HDA_FIXUP_FUNC,
11178 .v.func = alc671_fixup_hp_headset_mic2,
11180 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11181 .type = HDA_FIXUP_PINS,
11182 .v.pins = (const struct hda_pintbl[]) {
11183 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11187 .chain_id = ALC662_FIXUP_USI_FUNC
11189 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11190 .type = HDA_FIXUP_PINS,
11191 .v.pins = (const struct hda_pintbl[]) {
11192 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11193 { 0x1b, 0x0221144f },
11197 .chain_id = ALC662_FIXUP_USI_FUNC
11199 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11200 .type = HDA_FIXUP_PINS,
11201 .v.pins = (const struct hda_pintbl[]) {
11202 { 0x1b, 0x04a1112c },
11206 .chain_id = ALC668_FIXUP_HEADSET_MIC
11208 [ALC668_FIXUP_HEADSET_MIC] = {
11209 .type = HDA_FIXUP_FUNC,
11210 .v.func = alc269_fixup_headset_mic,
11212 .chain_id = ALC668_FIXUP_MIC_DET_COEF
11214 [ALC668_FIXUP_MIC_DET_COEF] = {
11215 .type = HDA_FIXUP_VERBS,
11216 .v.verbs = (const struct hda_verb[]) {
11217 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11218 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11222 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11223 .type = HDA_FIXUP_FUNC,
11224 .v.func = alc897_fixup_lenovo_headset_mic,
11226 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
11227 .type = HDA_FIXUP_PINS,
11228 .v.pins = (const struct hda_pintbl[]) {
11229 { 0x1a, 0x03a11050 },
11233 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11235 [ALC897_FIXUP_HP_HSMIC_VERB] = {
11236 .type = HDA_FIXUP_PINS,
11237 .v.pins = (const struct hda_pintbl[]) {
11238 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11242 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
11243 .type = HDA_FIXUP_FUNC,
11244 .v.func = alc897_fixup_lenovo_headset_mode,
11246 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
11247 .type = HDA_FIXUP_PINS,
11248 .v.pins = (const struct hda_pintbl[]) {
11249 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11253 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
11255 [ALC897_FIXUP_UNIS_H3C_X500S] = {
11256 .type = HDA_FIXUP_VERBS,
11257 .v.verbs = (const struct hda_verb[]) {
11258 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
11264 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
11265 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
11266 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
11267 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
11268 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
11269 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
11270 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
11271 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
11272 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
11273 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
11274 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
11275 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
11276 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11277 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11278 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
11279 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
11280 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
11281 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11282 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11283 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11284 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11285 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11286 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11287 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11288 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11289 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11290 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
11291 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
11292 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
11293 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
11294 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
11295 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
11296 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11297 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
11298 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
11299 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11300 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
11301 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11302 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
11303 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
11304 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
11305 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
11306 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11307 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
11308 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
11309 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
11310 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
11311 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
11312 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
11313 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
11314 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11315 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11316 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11317 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
11318 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
11319 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
11320 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
11321 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
11322 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
11323 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
11324 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
11325 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
11326 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
11327 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11328 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
11331 /* Below is a quirk table taken from the old code.
11332 * Basically the device should work as is without the fixup table.
11333 * If BIOS doesn't give a proper info, enable the corresponding
11336 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11337 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11338 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11339 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11340 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11341 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11342 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11343 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11344 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11345 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11346 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11347 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11348 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11349 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11350 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11351 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11352 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11353 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11354 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11355 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11356 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11357 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11358 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11359 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11360 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11361 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11362 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11363 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11364 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11365 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11366 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11367 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11368 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11369 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11370 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11371 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11372 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11373 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11374 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11375 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11376 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11377 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11378 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11379 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11380 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11381 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11382 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11383 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11384 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11385 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11390 static const struct hda_model_fixup alc662_fixup_models[] = {
11391 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11392 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
11393 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
11394 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
11395 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11396 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11397 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11398 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11399 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11400 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11401 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11402 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
11403 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
11404 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
11405 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
11406 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11407 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11408 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11409 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11410 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11411 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11412 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11413 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11414 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
11415 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
11416 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11417 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11418 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11419 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11420 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
11421 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11422 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
11423 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
11427 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
11428 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11429 {0x17, 0x02211010},
11430 {0x18, 0x01a19030},
11431 {0x1a, 0x01813040},
11432 {0x21, 0x01014020}),
11433 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11434 {0x16, 0x01813030},
11435 {0x17, 0x02211010},
11436 {0x18, 0x01a19040},
11437 {0x21, 0x01014020}),
11438 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11439 {0x14, 0x01014010},
11440 {0x18, 0x01a19020},
11441 {0x1a, 0x0181302f},
11442 {0x1b, 0x0221401f}),
11443 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11444 {0x12, 0x99a30130},
11445 {0x14, 0x90170110},
11446 {0x15, 0x0321101f},
11447 {0x16, 0x03011020}),
11448 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11449 {0x12, 0x99a30140},
11450 {0x14, 0x90170110},
11451 {0x15, 0x0321101f},
11452 {0x16, 0x03011020}),
11453 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11454 {0x12, 0x99a30150},
11455 {0x14, 0x90170110},
11456 {0x15, 0x0321101f},
11457 {0x16, 0x03011020}),
11458 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11459 {0x14, 0x90170110},
11460 {0x15, 0x0321101f},
11461 {0x16, 0x03011020}),
11462 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11463 {0x12, 0x90a60130},
11464 {0x14, 0x90170110},
11465 {0x15, 0x0321101f}),
11466 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11467 {0x14, 0x01014010},
11468 {0x17, 0x90170150},
11469 {0x19, 0x02a11060},
11470 {0x1b, 0x01813030},
11471 {0x21, 0x02211020}),
11472 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11473 {0x14, 0x01014010},
11474 {0x18, 0x01a19040},
11475 {0x1b, 0x01813030},
11476 {0x21, 0x02211020}),
11477 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11478 {0x14, 0x01014020},
11479 {0x17, 0x90170110},
11480 {0x18, 0x01a19050},
11481 {0x1b, 0x01813040},
11482 {0x21, 0x02211030}),
11488 static int patch_alc662(struct hda_codec *codec)
11490 struct alc_spec *spec;
11493 err = alc_alloc_spec(codec, 0x0b);
11497 spec = codec->spec;
11499 spec->shutup = alc_eapd_shutup;
11501 /* handle multiple HPs as is */
11502 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11504 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11506 switch (codec->core.vendor_id) {
11508 spec->init_hook = alc668_restore_default_value;
11512 alc_pre_init(codec);
11514 snd_hda_pick_fixup(codec, alc662_fixup_models,
11515 alc662_fixup_tbl, alc662_fixups);
11516 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
11517 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11519 alc_auto_parse_customize_define(codec);
11521 if (has_cdefine_beep(codec))
11522 spec->gen.beep_nid = 0x01;
11524 if ((alc_get_coef0(codec) & (1 << 14)) &&
11525 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
11526 spec->cdefine.platform_type == 1) {
11527 err = alc_codec_rename(codec, "ALC272X");
11532 /* automatic parse from the BIOS config */
11533 err = alc662_parse_auto_config(codec);
11537 if (!spec->gen.no_analog && spec->gen.beep_nid) {
11538 switch (codec->core.vendor_id) {
11540 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11546 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
11549 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
11556 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11569 static int alc680_parse_auto_config(struct hda_codec *codec)
11571 return alc_parse_auto_config(codec, NULL, NULL);
11576 static int patch_alc680(struct hda_codec *codec)
11580 /* ALC680 has no aa-loopback mixer */
11581 err = alc_alloc_spec(codec, 0);
11585 /* automatic parse from the BIOS config */
11586 err = alc680_parse_auto_config(codec);
11598 static const struct hda_device_id snd_hda_id_realtek[] = {
11599 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
11600 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
11601 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
11602 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
11603 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
11604 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11605 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
11606 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
11607 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
11608 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
11609 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
11610 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11611 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
11612 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
11613 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11614 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11615 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11616 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11617 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11618 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11619 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
11620 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
11621 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11622 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11623 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11624 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11625 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11626 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
11627 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
11628 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
11629 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
11630 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
11631 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
11632 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11633 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11634 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
11635 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
11636 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
11637 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
11638 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
11639 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
11640 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
11641 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11642 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11643 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11644 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11645 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11646 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11647 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11648 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11649 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11650 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11651 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11652 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11653 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11654 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
11655 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11656 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11657 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
11658 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
11659 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
11660 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11661 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11662 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11663 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11664 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11665 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11666 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11667 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11668 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11669 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11670 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
11671 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
11672 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11673 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
11674 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
11675 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
11676 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
11677 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
11678 {} /* terminator */
11680 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
11682 MODULE_LICENSE("GPL");
11683 MODULE_DESCRIPTION("Realtek HD-audio codec");
11685 static struct hda_codec_driver realtek_driver = {
11686 .id = snd_hda_id_realtek,
11689 module_hda_codec_driver(realtek_driver);