1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
28 #include "hda_component.h"
30 /* keep halting ALC5505 DSP, for power saving */
31 #define HALT_REALTEK_ALC5505
33 /* extra amp-initialization sequence types */
41 ALC_HEADSET_MODE_UNKNOWN,
42 ALC_HEADSET_MODE_UNPLUGGED,
43 ALC_HEADSET_MODE_HEADSET,
45 ALC_HEADSET_MODE_HEADPHONE,
49 ALC_HEADSET_TYPE_UNKNOWN,
50 ALC_HEADSET_TYPE_CTIA,
51 ALC_HEADSET_TYPE_OMTP,
55 ALC_KEY_MICMUTE_INDEX,
58 struct alc_customize_define {
60 unsigned char port_connectivity;
61 unsigned char check_sum;
62 unsigned char customization;
63 unsigned char external_amp;
64 unsigned int enable_pcbeep:1;
65 unsigned int platform_type:1;
67 unsigned int override:1;
68 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
79 struct hda_gen_spec gen; /* must be at head */
81 /* codec parameterization */
82 struct alc_customize_define cdefine;
83 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
86 unsigned int gpio_mask;
87 unsigned int gpio_dir;
88 unsigned int gpio_data;
89 bool gpio_write_delay; /* add a delay before writing gpio_data */
91 /* mute LED for HP laptops, see vref_mute_led_set() */
92 int mute_led_polarity;
93 int micmute_led_polarity;
94 hda_nid_t mute_led_nid;
95 hda_nid_t cap_mute_led_nid;
97 unsigned int gpio_mute_led_mask;
98 unsigned int gpio_mic_led_mask;
99 struct alc_coef_led mute_led_coef;
100 struct alc_coef_led mic_led_coef;
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;
126 unsigned int pll_coef_idx, pll_coef_bit;
128 struct input_dev *kb_dev;
129 u8 alc_mute_keycode_map[1];
131 /* component binding */
132 struct component_match *match;
133 struct hda_component comps[HDA_MAX_COMPONENTS];
137 * COEF access helper functions
140 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
141 unsigned int coef_idx)
145 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
146 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
150 #define alc_read_coef_idx(codec, coef_idx) \
151 alc_read_coefex_idx(codec, 0x20, coef_idx)
153 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
154 unsigned int coef_idx, unsigned int coef_val)
156 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
157 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
160 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
161 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
163 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
164 unsigned int coef_idx, unsigned int mask,
165 unsigned int bits_set)
167 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
170 alc_write_coefex_idx(codec, nid, coef_idx,
171 (val & ~mask) | bits_set);
174 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
175 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
177 /* a special bypass for COEF 0; read the cached value at the second time */
178 static unsigned int alc_get_coef0(struct hda_codec *codec)
180 struct alc_spec *spec = codec->spec;
183 spec->coef0 = alc_read_coef_idx(codec, 0);
187 /* coef writes/updates batch */
195 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
196 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
197 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
198 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
199 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
201 static void alc_process_coef_fw(struct hda_codec *codec,
202 const struct coef_fw *fw)
204 for (; fw->nid; fw++) {
205 if (fw->mask == (unsigned short)-1)
206 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
208 alc_update_coefex_idx(codec, fw->nid, fw->idx,
214 * GPIO setup tables, used in initialization
217 /* Enable GPIO mask and set output */
218 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
220 struct alc_spec *spec = codec->spec;
222 spec->gpio_mask |= mask;
223 spec->gpio_dir |= mask;
224 spec->gpio_data |= mask;
227 static void alc_write_gpio_data(struct hda_codec *codec)
229 struct alc_spec *spec = codec->spec;
231 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
235 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
238 struct alc_spec *spec = codec->spec;
239 unsigned int oldval = spec->gpio_data;
242 spec->gpio_data |= mask;
244 spec->gpio_data &= ~mask;
245 if (oldval != spec->gpio_data)
246 alc_write_gpio_data(codec);
249 static void alc_write_gpio(struct hda_codec *codec)
251 struct alc_spec *spec = codec->spec;
253 if (!spec->gpio_mask)
256 snd_hda_codec_write(codec, codec->core.afg, 0,
257 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
258 snd_hda_codec_write(codec, codec->core.afg, 0,
259 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
260 if (spec->gpio_write_delay)
262 alc_write_gpio_data(codec);
265 static void alc_fixup_gpio(struct hda_codec *codec, int action,
268 if (action == HDA_FIXUP_ACT_PRE_PROBE)
269 alc_setup_gpio(codec, mask);
272 static void alc_fixup_gpio1(struct hda_codec *codec,
273 const struct hda_fixup *fix, int action)
275 alc_fixup_gpio(codec, action, 0x01);
278 static void alc_fixup_gpio2(struct hda_codec *codec,
279 const struct hda_fixup *fix, int action)
281 alc_fixup_gpio(codec, action, 0x02);
284 static void alc_fixup_gpio3(struct hda_codec *codec,
285 const struct hda_fixup *fix, int action)
287 alc_fixup_gpio(codec, action, 0x03);
290 static void alc_fixup_gpio4(struct hda_codec *codec,
291 const struct hda_fixup *fix, int action)
293 alc_fixup_gpio(codec, action, 0x04);
296 static void alc_fixup_micmute_led(struct hda_codec *codec,
297 const struct hda_fixup *fix, int action)
299 if (action == HDA_FIXUP_ACT_PRE_PROBE)
300 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
304 * Fix hardware PLL issue
305 * On some codecs, the analog PLL gating control must be off while
306 * the default value is 1.
308 static void alc_fix_pll(struct hda_codec *codec)
310 struct alc_spec *spec = codec->spec;
313 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
314 1 << spec->pll_coef_bit, 0);
317 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
318 unsigned int coef_idx, unsigned int coef_bit)
320 struct alc_spec *spec = codec->spec;
322 spec->pll_coef_idx = coef_idx;
323 spec->pll_coef_bit = coef_bit;
327 /* update the master volume per volume-knob's unsol event */
328 static void alc_update_knob_master(struct hda_codec *codec,
329 struct hda_jack_callback *jack)
332 struct snd_kcontrol *kctl;
333 struct snd_ctl_elem_value *uctl;
335 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
338 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
341 val = snd_hda_codec_read(codec, jack->nid, 0,
342 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
343 val &= HDA_AMP_VOLMASK;
344 uctl->value.integer.value[0] = val;
345 uctl->value.integer.value[1] = val;
346 kctl->put(kctl, uctl);
350 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
352 /* For some reason, the res given from ALC880 is broken.
353 Here we adjust it properly. */
354 snd_hda_jack_unsol_event(codec, res >> 2);
357 /* Change EAPD to verb control */
358 static void alc_fill_eapd_coef(struct hda_codec *codec)
362 coef = alc_get_coef0(codec);
364 switch (codec->core.vendor_id) {
366 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
370 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
373 if ((coef & 0x00f0) == 0x0010)
374 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
375 if ((coef & 0x00f0) == 0x0020)
376 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
377 if ((coef & 0x00f0) == 0x0030)
378 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
384 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
389 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
408 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
411 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
414 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
415 alc_write_coef_idx(codec, 0x8, 0x4ab7);
418 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
427 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
430 if ((coef & 0x00f0) == 0x0030)
431 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
440 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
444 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
447 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
450 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
453 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
454 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
458 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
465 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
470 /* additional initialization for ALC888 variants */
471 static void alc888_coef_init(struct hda_codec *codec)
473 switch (alc_get_coef0(codec) & 0x00f0) {
478 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
483 /* turn on/off EAPD control (only if available) */
484 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
486 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
488 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
489 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
493 /* turn on/off EAPD controls of the codec */
494 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
496 /* We currently only handle front, HP */
497 static const hda_nid_t pins[] = {
498 0x0f, 0x10, 0x14, 0x15, 0x17, 0
501 for (p = pins; *p; p++)
502 set_eapd(codec, *p, on);
505 static int find_ext_mic_pin(struct hda_codec *codec);
507 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
509 const struct hda_pincfg *pin;
510 int mic_pin = find_ext_mic_pin(codec);
513 /* don't shut up pins when unloading the driver; otherwise it breaks
514 * the default pin setup at the next load of the driver
516 if (codec->bus->shutdown)
519 snd_array_for_each(&codec->init_pins, i, pin) {
520 /* use read here for syncing after issuing each verb */
521 if (pin->nid != mic_pin)
522 snd_hda_codec_read(codec, pin->nid, 0,
523 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
526 codec->pins_shutup = 1;
529 static void alc_shutup_pins(struct hda_codec *codec)
531 struct alc_spec *spec = codec->spec;
533 switch (codec->core.vendor_id) {
540 alc_headset_mic_no_shutup(codec);
543 if (!spec->no_shutup_pins)
544 snd_hda_shutup_pins(codec);
549 /* generic shutup callback;
550 * just turning off EAPD and a little pause for avoiding pop-noise
552 static void alc_eapd_shutup(struct hda_codec *codec)
554 struct alc_spec *spec = codec->spec;
556 alc_auto_setup_eapd(codec, false);
557 if (!spec->no_depop_delay)
559 alc_shutup_pins(codec);
562 /* generic EAPD initialization */
563 static void alc_auto_init_amp(struct hda_codec *codec, int type)
565 alc_auto_setup_eapd(codec, true);
566 alc_write_gpio(codec);
568 case ALC_INIT_DEFAULT:
569 switch (codec->core.vendor_id) {
571 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
577 alc_update_coef_idx(codec, 7, 0, 0x2030);
580 alc888_coef_init(codec);
587 /* get a primary headphone pin if available */
588 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
590 if (spec->gen.autocfg.hp_pins[0])
591 return spec->gen.autocfg.hp_pins[0];
592 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
593 return spec->gen.autocfg.line_out_pins[0];
598 * Realtek SSID verification
601 /* Could be any non-zero and even value. When used as fixup, tells
602 * the driver to ignore any present sku defines.
604 #define ALC_FIXUP_SKU_IGNORE (2)
606 static void alc_fixup_sku_ignore(struct hda_codec *codec,
607 const struct hda_fixup *fix, int action)
609 struct alc_spec *spec = codec->spec;
610 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
611 spec->cdefine.fixup = 1;
612 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
616 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
617 const struct hda_fixup *fix, int action)
619 struct alc_spec *spec = codec->spec;
621 if (action == HDA_FIXUP_ACT_PROBE) {
622 spec->no_depop_delay = 1;
623 codec->depop_delay = 0;
627 static int alc_auto_parse_customize_define(struct hda_codec *codec)
629 unsigned int ass, tmp, i;
631 struct alc_spec *spec = codec->spec;
633 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
635 if (spec->cdefine.fixup) {
636 ass = spec->cdefine.sku_cfg;
637 if (ass == ALC_FIXUP_SKU_IGNORE)
642 if (!codec->bus->pci)
644 ass = codec->core.subsystem_id & 0xffff;
645 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
649 if (codec->core.vendor_id == 0x10ec0260)
651 ass = snd_hda_codec_get_pincfg(codec, nid);
654 codec_info(codec, "%s: SKU not ready 0x%08x\n",
655 codec->core.chip_name, ass);
661 for (i = 1; i < 16; i++) {
665 if (((ass >> 16) & 0xf) != tmp)
668 spec->cdefine.port_connectivity = ass >> 30;
669 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
670 spec->cdefine.check_sum = (ass >> 16) & 0xf;
671 spec->cdefine.customization = ass >> 8;
673 spec->cdefine.sku_cfg = ass;
674 spec->cdefine.external_amp = (ass & 0x38) >> 3;
675 spec->cdefine.platform_type = (ass & 0x4) >> 2;
676 spec->cdefine.swap = (ass & 0x2) >> 1;
677 spec->cdefine.override = ass & 0x1;
679 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
680 nid, spec->cdefine.sku_cfg);
681 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
682 spec->cdefine.port_connectivity);
683 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
684 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
685 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
686 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
687 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
688 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
689 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
694 /* return the position of NID in the list, or -1 if not found */
695 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
698 for (i = 0; i < nums; i++)
703 /* return true if the given NID is found in the list */
704 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
706 return find_idx_in_nid_list(nid, list, nums) >= 0;
709 /* check subsystem ID and set up device-specific initialization;
710 * return 1 if initialized, 0 if invalid SSID
712 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
713 * 31 ~ 16 : Manufacture ID
715 * 7 ~ 0 : Assembly ID
716 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
718 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
720 unsigned int ass, tmp, i;
722 struct alc_spec *spec = codec->spec;
724 if (spec->cdefine.fixup) {
725 ass = spec->cdefine.sku_cfg;
726 if (ass == ALC_FIXUP_SKU_IGNORE)
731 ass = codec->core.subsystem_id & 0xffff;
732 if (codec->bus->pci &&
733 ass != codec->bus->pci->subsystem_device && (ass & 1))
736 /* invalid SSID, check the special NID pin defcfg instead */
738 * 31~30 : port connectivity
741 * 19~16 : Check sum (15:1)
746 if (codec->core.vendor_id == 0x10ec0260)
748 ass = snd_hda_codec_get_pincfg(codec, nid);
750 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
754 if ((ass >> 30) != 1) /* no physical connection */
759 for (i = 1; i < 16; i++) {
763 if (((ass >> 16) & 0xf) != tmp)
766 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
767 ass & 0xffff, codec->core.vendor_id);
771 * 2 : 0 --> Desktop, 1 --> Laptop
772 * 3~5 : External Amplifier control
775 tmp = (ass & 0x38) >> 3; /* external Amp control */
776 if (spec->init_amp == ALC_INIT_UNDEFINED) {
779 alc_setup_gpio(codec, 0x01);
782 alc_setup_gpio(codec, 0x02);
785 alc_setup_gpio(codec, 0x03);
789 spec->init_amp = ALC_INIT_DEFAULT;
794 /* is laptop or Desktop and enable the function "Mute internal speaker
795 * when the external headphone out jack is plugged"
800 * 10~8 : Jack location
801 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
803 * 15 : 1 --> enable the function "Mute internal speaker
804 * when the external headphone out jack is plugged"
806 if (!alc_get_hp_pin(spec)) {
808 tmp = (ass >> 11) & 0x3; /* HP to chassis */
810 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
811 spec->gen.autocfg.line_outs))
813 spec->gen.autocfg.hp_pins[0] = nid;
818 /* Check the validity of ALC subsystem-id
819 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
820 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
822 if (!alc_subsystem_id(codec, ports)) {
823 struct alc_spec *spec = codec->spec;
824 if (spec->init_amp == ALC_INIT_UNDEFINED) {
826 "realtek: Enable default setup for auto mode as fallback\n");
827 spec->init_amp = ALC_INIT_DEFAULT;
835 static void alc_fixup_inv_dmic(struct hda_codec *codec,
836 const struct hda_fixup *fix, int action)
838 struct alc_spec *spec = codec->spec;
840 spec->gen.inv_dmic_split = 1;
844 static int alc_build_controls(struct hda_codec *codec)
848 err = snd_hda_gen_build_controls(codec);
852 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
861 static void alc_pre_init(struct hda_codec *codec)
863 alc_fill_eapd_coef(codec);
866 #define is_s3_resume(codec) \
867 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
868 #define is_s4_resume(codec) \
869 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
871 static int alc_init(struct hda_codec *codec)
873 struct alc_spec *spec = codec->spec;
875 /* hibernation resume needs the full chip initialization */
876 if (is_s4_resume(codec))
880 spec->init_hook(codec);
882 spec->gen.skip_verbs = 1; /* applied in below */
883 snd_hda_gen_init(codec);
885 alc_auto_init_amp(codec, spec->init_amp);
886 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
888 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
893 static inline void alc_shutup(struct hda_codec *codec)
895 struct alc_spec *spec = codec->spec;
897 if (!snd_hda_get_bool_hint(codec, "shutup"))
898 return; /* disabled explicitly by hints */
900 if (spec && spec->shutup)
903 alc_shutup_pins(codec);
906 #define alc_free snd_hda_gen_free
909 static void alc_power_eapd(struct hda_codec *codec)
911 alc_auto_setup_eapd(codec, false);
914 static int alc_suspend(struct hda_codec *codec)
916 struct alc_spec *spec = codec->spec;
918 if (spec && spec->power_hook)
919 spec->power_hook(codec);
925 static int alc_resume(struct hda_codec *codec)
927 struct alc_spec *spec = codec->spec;
929 if (!spec->no_depop_delay)
930 msleep(150); /* to avoid pop noise */
931 codec->patch_ops.init(codec);
932 snd_hda_regmap_sync(codec);
933 hda_call_check_power_status(codec, 0x01);
940 static const struct hda_codec_ops alc_patch_ops = {
941 .build_controls = alc_build_controls,
942 .build_pcms = snd_hda_gen_build_pcms,
945 .unsol_event = snd_hda_jack_unsol_event,
947 .resume = alc_resume,
948 .suspend = alc_suspend,
949 .check_power_status = snd_hda_gen_check_power_status,
954 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
957 * Rename codecs appropriately from COEF value or subvendor id
959 struct alc_codec_rename_table {
960 unsigned int vendor_id;
961 unsigned short coef_mask;
962 unsigned short coef_bits;
966 struct alc_codec_rename_pci_table {
967 unsigned int codec_vendor_id;
968 unsigned short pci_subvendor;
969 unsigned short pci_subdevice;
973 static const struct alc_codec_rename_table rename_tbl[] = {
974 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
975 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
976 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
977 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
978 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
979 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
980 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
981 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
982 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
983 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
984 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
985 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
986 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
987 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
988 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
989 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
990 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
994 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
995 { 0x10ec0280, 0x1028, 0, "ALC3220" },
996 { 0x10ec0282, 0x1028, 0, "ALC3221" },
997 { 0x10ec0283, 0x1028, 0, "ALC3223" },
998 { 0x10ec0288, 0x1028, 0, "ALC3263" },
999 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1000 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1001 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1002 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1003 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1004 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1005 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1006 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1007 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1008 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1009 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1010 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1011 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1012 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1013 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1014 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1015 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1016 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1017 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1018 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1019 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1020 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1021 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1022 { } /* terminator */
1025 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1027 const struct alc_codec_rename_table *p;
1028 const struct alc_codec_rename_pci_table *q;
1030 for (p = rename_tbl; p->vendor_id; p++) {
1031 if (p->vendor_id != codec->core.vendor_id)
1033 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1034 return alc_codec_rename(codec, p->name);
1037 if (!codec->bus->pci)
1039 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1040 if (q->codec_vendor_id != codec->core.vendor_id)
1042 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1044 if (!q->pci_subdevice ||
1045 q->pci_subdevice == codec->bus->pci->subsystem_device)
1046 return alc_codec_rename(codec, q->name);
1054 * Digital-beep handlers
1056 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1058 /* additional beep mixers; private_value will be overwritten */
1059 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1060 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1061 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1064 /* set up and create beep controls */
1065 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1068 struct snd_kcontrol_new *knew;
1069 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1072 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1073 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1074 &alc_beep_mixer[i]);
1077 knew->private_value = beep_amp;
1082 static const struct snd_pci_quirk beep_allow_list[] = {
1083 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1084 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1085 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1086 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1087 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1088 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1089 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1090 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1091 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1092 /* denylist -- no beep available */
1093 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1094 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1098 static inline int has_cdefine_beep(struct hda_codec *codec)
1100 struct alc_spec *spec = codec->spec;
1101 const struct snd_pci_quirk *q;
1102 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1105 return spec->cdefine.enable_pcbeep;
1108 #define set_beep_amp(spec, nid, idx, dir) 0
1109 #define has_cdefine_beep(codec) 0
1112 /* parse the BIOS configuration and set up the alc_spec */
1113 /* return 1 if successful, 0 if the proper config is not found,
1114 * or a negative error code
1116 static int alc_parse_auto_config(struct hda_codec *codec,
1117 const hda_nid_t *ignore_nids,
1118 const hda_nid_t *ssid_nids)
1120 struct alc_spec *spec = codec->spec;
1121 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1124 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1130 alc_ssid_check(codec, ssid_nids);
1132 err = snd_hda_gen_parse_auto_config(codec, cfg);
1139 /* common preparation job for alc_spec */
1140 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1142 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1148 snd_hda_gen_spec_init(&spec->gen);
1149 spec->gen.mixer_nid = mixer_nid;
1150 spec->gen.own_eapd_ctl = 1;
1151 codec->single_adc_amp = 1;
1152 /* FIXME: do we need this for all Realtek codec models? */
1153 codec->spdif_status_reset = 1;
1154 codec->forced_resume = 1;
1155 codec->patch_ops = alc_patch_ops;
1157 err = alc_codec_rename_from_preset(codec);
1165 static int alc880_parse_auto_config(struct hda_codec *codec)
1167 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1168 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1169 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1178 ALC880_FIXUP_MEDION_RIM,
1180 ALC880_FIXUP_LG_LW25,
1182 ALC880_FIXUP_EAPD_COEF,
1183 ALC880_FIXUP_TCL_S700,
1184 ALC880_FIXUP_VOL_KNOB,
1185 ALC880_FIXUP_FUJITSU,
1187 ALC880_FIXUP_UNIWILL,
1188 ALC880_FIXUP_UNIWILL_DIG,
1190 ALC880_FIXUP_ASUS_W5A,
1191 ALC880_FIXUP_3ST_BASE,
1193 ALC880_FIXUP_3ST_DIG,
1194 ALC880_FIXUP_5ST_BASE,
1196 ALC880_FIXUP_5ST_DIG,
1197 ALC880_FIXUP_6ST_BASE,
1199 ALC880_FIXUP_6ST_DIG,
1200 ALC880_FIXUP_6ST_AUTOMUTE,
1203 /* enable the volume-knob widget support on NID 0x21 */
1204 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1205 const struct hda_fixup *fix, int action)
1207 if (action == HDA_FIXUP_ACT_PROBE)
1208 snd_hda_jack_detect_enable_callback(codec, 0x21,
1209 alc_update_knob_master);
1212 static const struct hda_fixup alc880_fixups[] = {
1213 [ALC880_FIXUP_GPIO1] = {
1214 .type = HDA_FIXUP_FUNC,
1215 .v.func = alc_fixup_gpio1,
1217 [ALC880_FIXUP_GPIO2] = {
1218 .type = HDA_FIXUP_FUNC,
1219 .v.func = alc_fixup_gpio2,
1221 [ALC880_FIXUP_MEDION_RIM] = {
1222 .type = HDA_FIXUP_VERBS,
1223 .v.verbs = (const struct hda_verb[]) {
1224 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1225 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1229 .chain_id = ALC880_FIXUP_GPIO2,
1231 [ALC880_FIXUP_LG] = {
1232 .type = HDA_FIXUP_PINS,
1233 .v.pins = (const struct hda_pintbl[]) {
1234 /* disable bogus unused pins */
1235 { 0x16, 0x411111f0 },
1236 { 0x18, 0x411111f0 },
1237 { 0x1a, 0x411111f0 },
1241 [ALC880_FIXUP_LG_LW25] = {
1242 .type = HDA_FIXUP_PINS,
1243 .v.pins = (const struct hda_pintbl[]) {
1244 { 0x1a, 0x0181344f }, /* line-in */
1245 { 0x1b, 0x0321403f }, /* headphone */
1249 [ALC880_FIXUP_W810] = {
1250 .type = HDA_FIXUP_PINS,
1251 .v.pins = (const struct hda_pintbl[]) {
1252 /* disable bogus unused pins */
1253 { 0x17, 0x411111f0 },
1257 .chain_id = ALC880_FIXUP_GPIO2,
1259 [ALC880_FIXUP_EAPD_COEF] = {
1260 .type = HDA_FIXUP_VERBS,
1261 .v.verbs = (const struct hda_verb[]) {
1262 /* change to EAPD mode */
1263 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1264 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1268 [ALC880_FIXUP_TCL_S700] = {
1269 .type = HDA_FIXUP_VERBS,
1270 .v.verbs = (const struct hda_verb[]) {
1271 /* change to EAPD mode */
1272 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1273 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1277 .chain_id = ALC880_FIXUP_GPIO2,
1279 [ALC880_FIXUP_VOL_KNOB] = {
1280 .type = HDA_FIXUP_FUNC,
1281 .v.func = alc880_fixup_vol_knob,
1283 [ALC880_FIXUP_FUJITSU] = {
1284 /* override all pins as BIOS on old Amilo is broken */
1285 .type = HDA_FIXUP_PINS,
1286 .v.pins = (const struct hda_pintbl[]) {
1287 { 0x14, 0x0121401f }, /* HP */
1288 { 0x15, 0x99030120 }, /* speaker */
1289 { 0x16, 0x99030130 }, /* bass speaker */
1290 { 0x17, 0x411111f0 }, /* N/A */
1291 { 0x18, 0x411111f0 }, /* N/A */
1292 { 0x19, 0x01a19950 }, /* mic-in */
1293 { 0x1a, 0x411111f0 }, /* N/A */
1294 { 0x1b, 0x411111f0 }, /* N/A */
1295 { 0x1c, 0x411111f0 }, /* N/A */
1296 { 0x1d, 0x411111f0 }, /* N/A */
1297 { 0x1e, 0x01454140 }, /* SPDIF out */
1301 .chain_id = ALC880_FIXUP_VOL_KNOB,
1303 [ALC880_FIXUP_F1734] = {
1304 /* almost compatible with FUJITSU, but no bass and SPDIF */
1305 .type = HDA_FIXUP_PINS,
1306 .v.pins = (const struct hda_pintbl[]) {
1307 { 0x14, 0x0121401f }, /* HP */
1308 { 0x15, 0x99030120 }, /* speaker */
1309 { 0x16, 0x411111f0 }, /* N/A */
1310 { 0x17, 0x411111f0 }, /* N/A */
1311 { 0x18, 0x411111f0 }, /* N/A */
1312 { 0x19, 0x01a19950 }, /* mic-in */
1313 { 0x1a, 0x411111f0 }, /* N/A */
1314 { 0x1b, 0x411111f0 }, /* N/A */
1315 { 0x1c, 0x411111f0 }, /* N/A */
1316 { 0x1d, 0x411111f0 }, /* N/A */
1317 { 0x1e, 0x411111f0 }, /* N/A */
1321 .chain_id = ALC880_FIXUP_VOL_KNOB,
1323 [ALC880_FIXUP_UNIWILL] = {
1324 /* need to fix HP and speaker pins to be parsed correctly */
1325 .type = HDA_FIXUP_PINS,
1326 .v.pins = (const struct hda_pintbl[]) {
1327 { 0x14, 0x0121411f }, /* HP */
1328 { 0x15, 0x99030120 }, /* speaker */
1329 { 0x16, 0x99030130 }, /* bass speaker */
1333 [ALC880_FIXUP_UNIWILL_DIG] = {
1334 .type = HDA_FIXUP_PINS,
1335 .v.pins = (const struct hda_pintbl[]) {
1336 /* disable bogus unused pins */
1337 { 0x17, 0x411111f0 },
1338 { 0x19, 0x411111f0 },
1339 { 0x1b, 0x411111f0 },
1340 { 0x1f, 0x411111f0 },
1344 [ALC880_FIXUP_Z71V] = {
1345 .type = HDA_FIXUP_PINS,
1346 .v.pins = (const struct hda_pintbl[]) {
1347 /* set up the whole pins as BIOS is utterly broken */
1348 { 0x14, 0x99030120 }, /* speaker */
1349 { 0x15, 0x0121411f }, /* HP */
1350 { 0x16, 0x411111f0 }, /* N/A */
1351 { 0x17, 0x411111f0 }, /* N/A */
1352 { 0x18, 0x01a19950 }, /* mic-in */
1353 { 0x19, 0x411111f0 }, /* N/A */
1354 { 0x1a, 0x01813031 }, /* line-in */
1355 { 0x1b, 0x411111f0 }, /* N/A */
1356 { 0x1c, 0x411111f0 }, /* N/A */
1357 { 0x1d, 0x411111f0 }, /* N/A */
1358 { 0x1e, 0x0144111e }, /* SPDIF */
1362 [ALC880_FIXUP_ASUS_W5A] = {
1363 .type = HDA_FIXUP_PINS,
1364 .v.pins = (const struct hda_pintbl[]) {
1365 /* set up the whole pins as BIOS is utterly broken */
1366 { 0x14, 0x0121411f }, /* HP */
1367 { 0x15, 0x411111f0 }, /* N/A */
1368 { 0x16, 0x411111f0 }, /* N/A */
1369 { 0x17, 0x411111f0 }, /* N/A */
1370 { 0x18, 0x90a60160 }, /* mic */
1371 { 0x19, 0x411111f0 }, /* N/A */
1372 { 0x1a, 0x411111f0 }, /* N/A */
1373 { 0x1b, 0x411111f0 }, /* N/A */
1374 { 0x1c, 0x411111f0 }, /* N/A */
1375 { 0x1d, 0x411111f0 }, /* N/A */
1376 { 0x1e, 0xb743111e }, /* SPDIF out */
1380 .chain_id = ALC880_FIXUP_GPIO1,
1382 [ALC880_FIXUP_3ST_BASE] = {
1383 .type = HDA_FIXUP_PINS,
1384 .v.pins = (const struct hda_pintbl[]) {
1385 { 0x14, 0x01014010 }, /* line-out */
1386 { 0x15, 0x411111f0 }, /* N/A */
1387 { 0x16, 0x411111f0 }, /* N/A */
1388 { 0x17, 0x411111f0 }, /* N/A */
1389 { 0x18, 0x01a19c30 }, /* mic-in */
1390 { 0x19, 0x0121411f }, /* HP */
1391 { 0x1a, 0x01813031 }, /* line-in */
1392 { 0x1b, 0x02a19c40 }, /* front-mic */
1393 { 0x1c, 0x411111f0 }, /* N/A */
1394 { 0x1d, 0x411111f0 }, /* N/A */
1395 /* 0x1e is filled in below */
1396 { 0x1f, 0x411111f0 }, /* N/A */
1400 [ALC880_FIXUP_3ST] = {
1401 .type = HDA_FIXUP_PINS,
1402 .v.pins = (const struct hda_pintbl[]) {
1403 { 0x1e, 0x411111f0 }, /* N/A */
1407 .chain_id = ALC880_FIXUP_3ST_BASE,
1409 [ALC880_FIXUP_3ST_DIG] = {
1410 .type = HDA_FIXUP_PINS,
1411 .v.pins = (const struct hda_pintbl[]) {
1412 { 0x1e, 0x0144111e }, /* SPDIF */
1416 .chain_id = ALC880_FIXUP_3ST_BASE,
1418 [ALC880_FIXUP_5ST_BASE] = {
1419 .type = HDA_FIXUP_PINS,
1420 .v.pins = (const struct hda_pintbl[]) {
1421 { 0x14, 0x01014010 }, /* front */
1422 { 0x15, 0x411111f0 }, /* N/A */
1423 { 0x16, 0x01011411 }, /* CLFE */
1424 { 0x17, 0x01016412 }, /* surr */
1425 { 0x18, 0x01a19c30 }, /* mic-in */
1426 { 0x19, 0x0121411f }, /* HP */
1427 { 0x1a, 0x01813031 }, /* line-in */
1428 { 0x1b, 0x02a19c40 }, /* front-mic */
1429 { 0x1c, 0x411111f0 }, /* N/A */
1430 { 0x1d, 0x411111f0 }, /* N/A */
1431 /* 0x1e is filled in below */
1432 { 0x1f, 0x411111f0 }, /* N/A */
1436 [ALC880_FIXUP_5ST] = {
1437 .type = HDA_FIXUP_PINS,
1438 .v.pins = (const struct hda_pintbl[]) {
1439 { 0x1e, 0x411111f0 }, /* N/A */
1443 .chain_id = ALC880_FIXUP_5ST_BASE,
1445 [ALC880_FIXUP_5ST_DIG] = {
1446 .type = HDA_FIXUP_PINS,
1447 .v.pins = (const struct hda_pintbl[]) {
1448 { 0x1e, 0x0144111e }, /* SPDIF */
1452 .chain_id = ALC880_FIXUP_5ST_BASE,
1454 [ALC880_FIXUP_6ST_BASE] = {
1455 .type = HDA_FIXUP_PINS,
1456 .v.pins = (const struct hda_pintbl[]) {
1457 { 0x14, 0x01014010 }, /* front */
1458 { 0x15, 0x01016412 }, /* surr */
1459 { 0x16, 0x01011411 }, /* CLFE */
1460 { 0x17, 0x01012414 }, /* side */
1461 { 0x18, 0x01a19c30 }, /* mic-in */
1462 { 0x19, 0x02a19c40 }, /* front-mic */
1463 { 0x1a, 0x01813031 }, /* line-in */
1464 { 0x1b, 0x0121411f }, /* HP */
1465 { 0x1c, 0x411111f0 }, /* N/A */
1466 { 0x1d, 0x411111f0 }, /* N/A */
1467 /* 0x1e is filled in below */
1468 { 0x1f, 0x411111f0 }, /* N/A */
1472 [ALC880_FIXUP_6ST] = {
1473 .type = HDA_FIXUP_PINS,
1474 .v.pins = (const struct hda_pintbl[]) {
1475 { 0x1e, 0x411111f0 }, /* N/A */
1479 .chain_id = ALC880_FIXUP_6ST_BASE,
1481 [ALC880_FIXUP_6ST_DIG] = {
1482 .type = HDA_FIXUP_PINS,
1483 .v.pins = (const struct hda_pintbl[]) {
1484 { 0x1e, 0x0144111e }, /* SPDIF */
1488 .chain_id = ALC880_FIXUP_6ST_BASE,
1490 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1491 .type = HDA_FIXUP_PINS,
1492 .v.pins = (const struct hda_pintbl[]) {
1493 { 0x1b, 0x0121401f }, /* HP with jack detect */
1496 .chained_before = true,
1497 .chain_id = ALC880_FIXUP_6ST_BASE,
1501 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1502 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1503 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1504 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1505 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1506 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1507 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1508 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1509 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1510 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1511 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1512 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1513 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1514 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1515 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1516 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1517 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1518 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1519 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1520 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1521 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1522 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1523 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1524 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1526 /* Below is the copied entries from alc880_quirks.c.
1527 * It's not quite sure whether BIOS sets the correct pin-config table
1528 * on these machines, thus they are kept to be compatible with
1529 * the old static quirks. Once when it's confirmed to work without
1530 * these overrides, it'd be better to remove.
1532 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1533 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1534 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1535 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1536 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1537 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1538 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1539 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1540 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1541 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1542 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1543 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1544 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1545 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1546 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1547 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1548 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1549 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1550 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1551 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1552 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1553 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1554 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1555 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1556 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1557 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1558 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1559 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1560 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1561 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1562 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1563 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1564 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1566 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1567 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1568 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1572 static const struct hda_model_fixup alc880_fixup_models[] = {
1573 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1574 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1575 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1576 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1577 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1578 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1579 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1585 * OK, here we have finally the patch for ALC880
1587 static int patch_alc880(struct hda_codec *codec)
1589 struct alc_spec *spec;
1592 err = alc_alloc_spec(codec, 0x0b);
1597 spec->gen.need_dac_fix = 1;
1598 spec->gen.beep_nid = 0x01;
1600 codec->patch_ops.unsol_event = alc880_unsol_event;
1602 alc_pre_init(codec);
1604 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1606 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1608 /* automatic parse from the BIOS config */
1609 err = alc880_parse_auto_config(codec);
1613 if (!spec->gen.no_analog) {
1614 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1619 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1632 static int alc260_parse_auto_config(struct hda_codec *codec)
1634 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1635 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1636 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1643 ALC260_FIXUP_HP_DC5750,
1644 ALC260_FIXUP_HP_PIN_0F,
1647 ALC260_FIXUP_GPIO1_TOGGLE,
1648 ALC260_FIXUP_REPLACER,
1649 ALC260_FIXUP_HP_B1900,
1651 ALC260_FIXUP_FSC_S7020,
1652 ALC260_FIXUP_FSC_S7020_JWSE,
1653 ALC260_FIXUP_VAIO_PINS,
1656 static void alc260_gpio1_automute(struct hda_codec *codec)
1658 struct alc_spec *spec = codec->spec;
1660 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1663 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1664 const struct hda_fixup *fix, int action)
1666 struct alc_spec *spec = codec->spec;
1667 if (action == HDA_FIXUP_ACT_PROBE) {
1668 /* although the machine has only one output pin, we need to
1669 * toggle GPIO1 according to the jack state
1671 spec->gen.automute_hook = alc260_gpio1_automute;
1672 spec->gen.detect_hp = 1;
1673 spec->gen.automute_speaker = 1;
1674 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1675 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1676 snd_hda_gen_hp_automute);
1677 alc_setup_gpio(codec, 0x01);
1681 static void alc260_fixup_kn1(struct hda_codec *codec,
1682 const struct hda_fixup *fix, int action)
1684 struct alc_spec *spec = codec->spec;
1685 static const struct hda_pintbl pincfgs[] = {
1686 { 0x0f, 0x02214000 }, /* HP/speaker */
1687 { 0x12, 0x90a60160 }, /* int mic */
1688 { 0x13, 0x02a19000 }, /* ext mic */
1689 { 0x18, 0x01446000 }, /* SPDIF out */
1690 /* disable bogus I/O pins */
1691 { 0x10, 0x411111f0 },
1692 { 0x11, 0x411111f0 },
1693 { 0x14, 0x411111f0 },
1694 { 0x15, 0x411111f0 },
1695 { 0x16, 0x411111f0 },
1696 { 0x17, 0x411111f0 },
1697 { 0x19, 0x411111f0 },
1702 case HDA_FIXUP_ACT_PRE_PROBE:
1703 snd_hda_apply_pincfgs(codec, pincfgs);
1704 spec->init_amp = ALC_INIT_NONE;
1709 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1710 const struct hda_fixup *fix, int action)
1712 struct alc_spec *spec = codec->spec;
1713 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1714 spec->init_amp = ALC_INIT_NONE;
1717 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1718 const struct hda_fixup *fix, int action)
1720 struct alc_spec *spec = codec->spec;
1721 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1722 spec->gen.add_jack_modes = 1;
1723 spec->gen.hp_mic = 1;
1727 static const struct hda_fixup alc260_fixups[] = {
1728 [ALC260_FIXUP_HP_DC5750] = {
1729 .type = HDA_FIXUP_PINS,
1730 .v.pins = (const struct hda_pintbl[]) {
1731 { 0x11, 0x90130110 }, /* speaker */
1735 [ALC260_FIXUP_HP_PIN_0F] = {
1736 .type = HDA_FIXUP_PINS,
1737 .v.pins = (const struct hda_pintbl[]) {
1738 { 0x0f, 0x01214000 }, /* HP */
1742 [ALC260_FIXUP_COEF] = {
1743 .type = HDA_FIXUP_VERBS,
1744 .v.verbs = (const struct hda_verb[]) {
1745 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1746 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1750 [ALC260_FIXUP_GPIO1] = {
1751 .type = HDA_FIXUP_FUNC,
1752 .v.func = alc_fixup_gpio1,
1754 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1755 .type = HDA_FIXUP_FUNC,
1756 .v.func = alc260_fixup_gpio1_toggle,
1758 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1760 [ALC260_FIXUP_REPLACER] = {
1761 .type = HDA_FIXUP_VERBS,
1762 .v.verbs = (const struct hda_verb[]) {
1763 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1764 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1768 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1770 [ALC260_FIXUP_HP_B1900] = {
1771 .type = HDA_FIXUP_FUNC,
1772 .v.func = alc260_fixup_gpio1_toggle,
1774 .chain_id = ALC260_FIXUP_COEF,
1776 [ALC260_FIXUP_KN1] = {
1777 .type = HDA_FIXUP_FUNC,
1778 .v.func = alc260_fixup_kn1,
1780 [ALC260_FIXUP_FSC_S7020] = {
1781 .type = HDA_FIXUP_FUNC,
1782 .v.func = alc260_fixup_fsc_s7020,
1784 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1785 .type = HDA_FIXUP_FUNC,
1786 .v.func = alc260_fixup_fsc_s7020_jwse,
1788 .chain_id = ALC260_FIXUP_FSC_S7020,
1790 [ALC260_FIXUP_VAIO_PINS] = {
1791 .type = HDA_FIXUP_PINS,
1792 .v.pins = (const struct hda_pintbl[]) {
1793 /* Pin configs are missing completely on some VAIOs */
1794 { 0x0f, 0x01211020 },
1795 { 0x10, 0x0001003f },
1796 { 0x11, 0x411111f0 },
1797 { 0x12, 0x01a15930 },
1798 { 0x13, 0x411111f0 },
1799 { 0x14, 0x411111f0 },
1800 { 0x15, 0x411111f0 },
1801 { 0x16, 0x411111f0 },
1802 { 0x17, 0x411111f0 },
1803 { 0x18, 0x411111f0 },
1804 { 0x19, 0x411111f0 },
1810 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1811 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1812 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1813 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1814 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1815 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1816 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1817 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1818 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1819 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1820 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1821 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1822 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1826 static const struct hda_model_fixup alc260_fixup_models[] = {
1827 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1828 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1829 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1830 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1836 static int patch_alc260(struct hda_codec *codec)
1838 struct alc_spec *spec;
1841 err = alc_alloc_spec(codec, 0x07);
1846 /* as quite a few machines require HP amp for speaker outputs,
1847 * it's easier to enable it unconditionally; even if it's unneeded,
1848 * it's almost harmless.
1850 spec->gen.prefer_hp_amp = 1;
1851 spec->gen.beep_nid = 0x01;
1853 spec->shutup = alc_eapd_shutup;
1855 alc_pre_init(codec);
1857 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1859 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1861 /* automatic parse from the BIOS config */
1862 err = alc260_parse_auto_config(codec);
1866 if (!spec->gen.no_analog) {
1867 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1872 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1883 * ALC882/883/885/888/889 support
1885 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1886 * configuration. Each pin widget can choose any input DACs and a mixer.
1887 * Each ADC is connected from a mixer of all inputs. This makes possible
1888 * 6-channel independent captures.
1890 * In addition, an independent DAC for the multi-playback (not used in this
1898 ALC882_FIXUP_ABIT_AW9D_MAX,
1899 ALC882_FIXUP_LENOVO_Y530,
1900 ALC882_FIXUP_PB_M5210,
1901 ALC882_FIXUP_ACER_ASPIRE_7736,
1902 ALC882_FIXUP_ASUS_W90V,
1904 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1905 ALC889_FIXUP_VAIO_TT,
1906 ALC888_FIXUP_EEE1601,
1910 ALC883_FIXUP_ACER_EAPD,
1915 ALC882_FIXUP_ASUS_W2JC,
1916 ALC882_FIXUP_ACER_ASPIRE_4930G,
1917 ALC882_FIXUP_ACER_ASPIRE_8930G,
1918 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1919 ALC885_FIXUP_MACPRO_GPIO,
1920 ALC889_FIXUP_DAC_ROUTE,
1921 ALC889_FIXUP_MBP_VREF,
1922 ALC889_FIXUP_IMAC91_VREF,
1923 ALC889_FIXUP_MBA11_VREF,
1924 ALC889_FIXUP_MBA21_VREF,
1925 ALC889_FIXUP_MP11_VREF,
1926 ALC889_FIXUP_MP41_VREF,
1927 ALC882_FIXUP_INV_DMIC,
1928 ALC882_FIXUP_NO_PRIMARY_HP,
1929 ALC887_FIXUP_ASUS_BASS,
1930 ALC887_FIXUP_BASS_CHMAP,
1931 ALC1220_FIXUP_GB_DUAL_CODECS,
1932 ALC1220_FIXUP_GB_X570,
1933 ALC1220_FIXUP_CLEVO_P950,
1934 ALC1220_FIXUP_CLEVO_PB51ED,
1935 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1936 ALC887_FIXUP_ASUS_AUDIO,
1937 ALC887_FIXUP_ASUS_HMIC,
1940 static void alc889_fixup_coef(struct hda_codec *codec,
1941 const struct hda_fixup *fix, int action)
1943 if (action != HDA_FIXUP_ACT_INIT)
1945 alc_update_coef_idx(codec, 7, 0, 0x2030);
1948 /* set up GPIO at initialization */
1949 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1950 const struct hda_fixup *fix, int action)
1952 struct alc_spec *spec = codec->spec;
1954 spec->gpio_write_delay = true;
1955 alc_fixup_gpio3(codec, fix, action);
1958 /* Fix the connection of some pins for ALC889:
1959 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1960 * work correctly (bko#42740)
1962 static void alc889_fixup_dac_route(struct hda_codec *codec,
1963 const struct hda_fixup *fix, int action)
1965 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1966 /* fake the connections during parsing the tree */
1967 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1968 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1969 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1970 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1971 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1972 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1973 } else if (action == HDA_FIXUP_ACT_PROBE) {
1974 /* restore the connections */
1975 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1976 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1977 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1978 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1979 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1983 /* Set VREF on HP pin */
1984 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1985 const struct hda_fixup *fix, int action)
1987 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1988 struct alc_spec *spec = codec->spec;
1991 if (action != HDA_FIXUP_ACT_INIT)
1993 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1994 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1995 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1997 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1998 val |= AC_PINCTL_VREF_80;
1999 snd_hda_set_pin_ctl(codec, nids[i], val);
2000 spec->gen.keep_vref_in_automute = 1;
2005 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2006 const hda_nid_t *nids, int num_nids)
2008 struct alc_spec *spec = codec->spec;
2011 for (i = 0; i < num_nids; i++) {
2013 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2014 val |= AC_PINCTL_VREF_50;
2015 snd_hda_set_pin_ctl(codec, nids[i], val);
2017 spec->gen.keep_vref_in_automute = 1;
2020 /* Set VREF on speaker pins on imac91 */
2021 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2022 const struct hda_fixup *fix, int action)
2024 static const hda_nid_t nids[] = { 0x18, 0x1a };
2026 if (action == HDA_FIXUP_ACT_INIT)
2027 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2030 /* Set VREF on speaker pins on mba11 */
2031 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2032 const struct hda_fixup *fix, int action)
2034 static const hda_nid_t nids[] = { 0x18 };
2036 if (action == HDA_FIXUP_ACT_INIT)
2037 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2040 /* Set VREF on speaker pins on mba21 */
2041 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2042 const struct hda_fixup *fix, int action)
2044 static const hda_nid_t nids[] = { 0x18, 0x19 };
2046 if (action == HDA_FIXUP_ACT_INIT)
2047 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2050 /* Don't take HP output as primary
2051 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2052 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2054 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2055 const struct hda_fixup *fix, int action)
2057 struct alc_spec *spec = codec->spec;
2058 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2059 spec->gen.no_primary_hp = 1;
2060 spec->gen.no_multi_io = 1;
2064 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2065 const struct hda_fixup *fix, int action);
2067 /* For dual-codec configuration, we need to disable some features to avoid
2068 * conflicts of kctls and PCM streams
2070 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2071 const struct hda_fixup *fix, int action)
2073 struct alc_spec *spec = codec->spec;
2075 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2077 /* disable vmaster */
2078 spec->gen.suppress_vmaster = 1;
2079 /* auto-mute and auto-mic switch don't work with multiple codecs */
2080 spec->gen.suppress_auto_mute = 1;
2081 spec->gen.suppress_auto_mic = 1;
2082 /* disable aamix as well */
2083 spec->gen.mixer_nid = 0;
2084 /* add location prefix to avoid conflicts */
2085 codec->force_pin_prefix = 1;
2088 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2089 const char *newname)
2091 struct snd_kcontrol *kctl;
2093 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2095 strcpy(kctl->id.name, newname);
2098 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2099 const struct hda_fixup *fix,
2102 alc_fixup_dual_codecs(codec, fix, action);
2104 case HDA_FIXUP_ACT_PRE_PROBE:
2105 /* override card longname to provide a unique UCM profile */
2106 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2108 case HDA_FIXUP_ACT_BUILD:
2109 /* rename Capture controls depending on the codec */
2110 rename_ctl(codec, "Capture Volume",
2112 "Rear-Panel Capture Volume" :
2113 "Front-Panel Capture Volume");
2114 rename_ctl(codec, "Capture Switch",
2116 "Rear-Panel Capture Switch" :
2117 "Front-Panel Capture Switch");
2122 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2123 const struct hda_fixup *fix,
2126 static const hda_nid_t conn1[] = { 0x0c };
2127 static const struct coef_fw gb_x570_coefs[] = {
2128 WRITE_COEF(0x1a, 0x01c1),
2129 WRITE_COEF(0x1b, 0x0202),
2130 WRITE_COEF(0x43, 0x3005),
2135 case HDA_FIXUP_ACT_PRE_PROBE:
2136 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2137 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2139 case HDA_FIXUP_ACT_INIT:
2140 alc_process_coef_fw(codec, gb_x570_coefs);
2145 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2146 const struct hda_fixup *fix,
2149 static const hda_nid_t conn1[] = { 0x0c };
2151 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2154 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2155 /* We therefore want to make sure 0x14 (front headphone) and
2156 * 0x1b (speakers) use the stereo DAC 0x02
2158 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2159 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2162 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2163 const struct hda_fixup *fix, int action);
2165 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2166 const struct hda_fixup *fix,
2169 alc1220_fixup_clevo_p950(codec, fix, action);
2170 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2173 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2174 struct hda_jack_callback *jack)
2176 struct alc_spec *spec = codec->spec;
2179 snd_hda_gen_hp_automute(codec, jack);
2181 if (spec->gen.hp_jack_present)
2182 vref = AC_PINCTL_VREF_80;
2184 vref = AC_PINCTL_VREF_HIZ;
2185 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2188 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2189 const struct hda_fixup *fix, int action)
2191 struct alc_spec *spec = codec->spec;
2192 if (action != HDA_FIXUP_ACT_PROBE)
2194 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2195 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2198 static const struct hda_fixup alc882_fixups[] = {
2199 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2200 .type = HDA_FIXUP_PINS,
2201 .v.pins = (const struct hda_pintbl[]) {
2202 { 0x15, 0x01080104 }, /* side */
2203 { 0x16, 0x01011012 }, /* rear */
2204 { 0x17, 0x01016011 }, /* clfe */
2208 [ALC882_FIXUP_LENOVO_Y530] = {
2209 .type = HDA_FIXUP_PINS,
2210 .v.pins = (const struct hda_pintbl[]) {
2211 { 0x15, 0x99130112 }, /* rear int speakers */
2212 { 0x16, 0x99130111 }, /* subwoofer */
2216 [ALC882_FIXUP_PB_M5210] = {
2217 .type = HDA_FIXUP_PINCTLS,
2218 .v.pins = (const struct hda_pintbl[]) {
2219 { 0x19, PIN_VREF50 },
2223 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2224 .type = HDA_FIXUP_FUNC,
2225 .v.func = alc_fixup_sku_ignore,
2227 [ALC882_FIXUP_ASUS_W90V] = {
2228 .type = HDA_FIXUP_PINS,
2229 .v.pins = (const struct hda_pintbl[]) {
2230 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2234 [ALC889_FIXUP_CD] = {
2235 .type = HDA_FIXUP_PINS,
2236 .v.pins = (const struct hda_pintbl[]) {
2237 { 0x1c, 0x993301f0 }, /* CD */
2241 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2242 .type = HDA_FIXUP_PINS,
2243 .v.pins = (const struct hda_pintbl[]) {
2244 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2248 .chain_id = ALC889_FIXUP_CD,
2250 [ALC889_FIXUP_VAIO_TT] = {
2251 .type = HDA_FIXUP_PINS,
2252 .v.pins = (const struct hda_pintbl[]) {
2253 { 0x17, 0x90170111 }, /* hidden surround speaker */
2257 [ALC888_FIXUP_EEE1601] = {
2258 .type = HDA_FIXUP_VERBS,
2259 .v.verbs = (const struct hda_verb[]) {
2260 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2261 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2265 [ALC886_FIXUP_EAPD] = {
2266 .type = HDA_FIXUP_VERBS,
2267 .v.verbs = (const struct hda_verb[]) {
2268 /* change to EAPD mode */
2269 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2270 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2274 [ALC882_FIXUP_EAPD] = {
2275 .type = HDA_FIXUP_VERBS,
2276 .v.verbs = (const struct hda_verb[]) {
2277 /* change to EAPD mode */
2278 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2279 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2283 [ALC883_FIXUP_EAPD] = {
2284 .type = HDA_FIXUP_VERBS,
2285 .v.verbs = (const struct hda_verb[]) {
2286 /* change to EAPD mode */
2287 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2288 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2292 [ALC883_FIXUP_ACER_EAPD] = {
2293 .type = HDA_FIXUP_VERBS,
2294 .v.verbs = (const struct hda_verb[]) {
2295 /* eanable EAPD on Acer laptops */
2296 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2297 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2301 [ALC882_FIXUP_GPIO1] = {
2302 .type = HDA_FIXUP_FUNC,
2303 .v.func = alc_fixup_gpio1,
2305 [ALC882_FIXUP_GPIO2] = {
2306 .type = HDA_FIXUP_FUNC,
2307 .v.func = alc_fixup_gpio2,
2309 [ALC882_FIXUP_GPIO3] = {
2310 .type = HDA_FIXUP_FUNC,
2311 .v.func = alc_fixup_gpio3,
2313 [ALC882_FIXUP_ASUS_W2JC] = {
2314 .type = HDA_FIXUP_FUNC,
2315 .v.func = alc_fixup_gpio1,
2317 .chain_id = ALC882_FIXUP_EAPD,
2319 [ALC889_FIXUP_COEF] = {
2320 .type = HDA_FIXUP_FUNC,
2321 .v.func = alc889_fixup_coef,
2323 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2324 .type = HDA_FIXUP_PINS,
2325 .v.pins = (const struct hda_pintbl[]) {
2326 { 0x16, 0x99130111 }, /* CLFE speaker */
2327 { 0x17, 0x99130112 }, /* surround speaker */
2331 .chain_id = ALC882_FIXUP_GPIO1,
2333 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2334 .type = HDA_FIXUP_PINS,
2335 .v.pins = (const struct hda_pintbl[]) {
2336 { 0x16, 0x99130111 }, /* CLFE speaker */
2337 { 0x1b, 0x99130112 }, /* surround speaker */
2341 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2343 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2344 /* additional init verbs for Acer Aspire 8930G */
2345 .type = HDA_FIXUP_VERBS,
2346 .v.verbs = (const struct hda_verb[]) {
2347 /* Enable all DACs */
2348 /* DAC DISABLE/MUTE 1? */
2349 /* setting bits 1-5 disables DAC nids 0x02-0x06
2350 * apparently. Init=0x38 */
2351 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2352 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2353 /* DAC DISABLE/MUTE 2? */
2354 /* some bit here disables the other DACs.
2356 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2357 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2359 * This laptop has a stereo digital microphone.
2360 * The mics are only 1cm apart which makes the stereo
2361 * useless. However, either the mic or the ALC889
2362 * makes the signal become a difference/sum signal
2363 * instead of standard stereo, which is annoying.
2364 * So instead we flip this bit which makes the
2365 * codec replicate the sum signal to both channels,
2366 * turning it into a normal mono mic.
2368 /* DMIC_CONTROL? Init value = 0x0001 */
2369 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2370 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2371 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2372 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2376 .chain_id = ALC882_FIXUP_GPIO1,
2378 [ALC885_FIXUP_MACPRO_GPIO] = {
2379 .type = HDA_FIXUP_FUNC,
2380 .v.func = alc885_fixup_macpro_gpio,
2382 [ALC889_FIXUP_DAC_ROUTE] = {
2383 .type = HDA_FIXUP_FUNC,
2384 .v.func = alc889_fixup_dac_route,
2386 [ALC889_FIXUP_MBP_VREF] = {
2387 .type = HDA_FIXUP_FUNC,
2388 .v.func = alc889_fixup_mbp_vref,
2390 .chain_id = ALC882_FIXUP_GPIO1,
2392 [ALC889_FIXUP_IMAC91_VREF] = {
2393 .type = HDA_FIXUP_FUNC,
2394 .v.func = alc889_fixup_imac91_vref,
2396 .chain_id = ALC882_FIXUP_GPIO1,
2398 [ALC889_FIXUP_MBA11_VREF] = {
2399 .type = HDA_FIXUP_FUNC,
2400 .v.func = alc889_fixup_mba11_vref,
2402 .chain_id = ALC889_FIXUP_MBP_VREF,
2404 [ALC889_FIXUP_MBA21_VREF] = {
2405 .type = HDA_FIXUP_FUNC,
2406 .v.func = alc889_fixup_mba21_vref,
2408 .chain_id = ALC889_FIXUP_MBP_VREF,
2410 [ALC889_FIXUP_MP11_VREF] = {
2411 .type = HDA_FIXUP_FUNC,
2412 .v.func = alc889_fixup_mba11_vref,
2414 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2416 [ALC889_FIXUP_MP41_VREF] = {
2417 .type = HDA_FIXUP_FUNC,
2418 .v.func = alc889_fixup_mbp_vref,
2420 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2422 [ALC882_FIXUP_INV_DMIC] = {
2423 .type = HDA_FIXUP_FUNC,
2424 .v.func = alc_fixup_inv_dmic,
2426 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2427 .type = HDA_FIXUP_FUNC,
2428 .v.func = alc882_fixup_no_primary_hp,
2430 [ALC887_FIXUP_ASUS_BASS] = {
2431 .type = HDA_FIXUP_PINS,
2432 .v.pins = (const struct hda_pintbl[]) {
2433 {0x16, 0x99130130}, /* bass speaker */
2437 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2439 [ALC887_FIXUP_BASS_CHMAP] = {
2440 .type = HDA_FIXUP_FUNC,
2441 .v.func = alc_fixup_bass_chmap,
2443 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2444 .type = HDA_FIXUP_FUNC,
2445 .v.func = alc1220_fixup_gb_dual_codecs,
2447 [ALC1220_FIXUP_GB_X570] = {
2448 .type = HDA_FIXUP_FUNC,
2449 .v.func = alc1220_fixup_gb_x570,
2451 [ALC1220_FIXUP_CLEVO_P950] = {
2452 .type = HDA_FIXUP_FUNC,
2453 .v.func = alc1220_fixup_clevo_p950,
2455 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2456 .type = HDA_FIXUP_FUNC,
2457 .v.func = alc1220_fixup_clevo_pb51ed,
2459 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2460 .type = HDA_FIXUP_PINS,
2461 .v.pins = (const struct hda_pintbl[]) {
2462 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2466 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2468 [ALC887_FIXUP_ASUS_AUDIO] = {
2469 .type = HDA_FIXUP_PINS,
2470 .v.pins = (const struct hda_pintbl[]) {
2471 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2472 { 0x19, 0x22219420 },
2476 [ALC887_FIXUP_ASUS_HMIC] = {
2477 .type = HDA_FIXUP_FUNC,
2478 .v.func = alc887_fixup_asus_jack,
2480 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2484 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2485 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2486 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2487 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2488 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2489 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2490 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2491 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2492 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2493 ALC882_FIXUP_ACER_ASPIRE_4930G),
2494 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2495 ALC882_FIXUP_ACER_ASPIRE_4930G),
2496 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2497 ALC882_FIXUP_ACER_ASPIRE_8930G),
2498 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2499 ALC882_FIXUP_ACER_ASPIRE_8930G),
2500 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2501 ALC882_FIXUP_ACER_ASPIRE_4930G),
2502 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2503 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2504 ALC882_FIXUP_ACER_ASPIRE_4930G),
2505 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2506 ALC882_FIXUP_ACER_ASPIRE_4930G),
2507 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2508 ALC882_FIXUP_ACER_ASPIRE_4930G),
2509 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2510 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2511 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2512 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2513 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2514 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2515 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2516 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2517 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2518 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2519 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2520 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2521 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2522 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2523 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2525 /* All Apple entries are in codec SSIDs */
2526 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2527 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2528 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2529 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2530 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2531 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2532 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2533 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2534 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2535 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2536 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2537 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2538 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2539 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2540 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2541 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2542 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2543 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2544 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2545 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2546 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2547 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2549 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2550 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2551 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2552 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2553 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2554 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
2555 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2556 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2557 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2558 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2559 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2560 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2561 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2562 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2563 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2564 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2565 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2566 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2567 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2568 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2569 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2570 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2571 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2572 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2573 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2574 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2575 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2576 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2577 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2578 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2579 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2580 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2581 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2582 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2583 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2584 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2585 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2586 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2587 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2588 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2589 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2590 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2591 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2592 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2593 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2594 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2598 static const struct hda_model_fixup alc882_fixup_models[] = {
2599 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2600 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2601 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2602 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2603 {.id = ALC889_FIXUP_CD, .name = "cd"},
2604 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2605 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2606 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2607 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2608 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2609 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2610 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2611 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2612 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2613 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2614 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2615 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2616 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2617 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2618 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2619 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2620 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2621 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2622 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2623 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2624 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2625 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2626 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2627 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2628 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2629 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2633 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2634 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2642 {0x1e, 0x01456130}),
2643 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2651 {0x1e, 0x01451130}),
2656 * BIOS auto configuration
2658 /* almost identical with ALC880 parser... */
2659 static int alc882_parse_auto_config(struct hda_codec *codec)
2661 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2662 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2663 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2668 static int patch_alc882(struct hda_codec *codec)
2670 struct alc_spec *spec;
2673 err = alc_alloc_spec(codec, 0x0b);
2679 switch (codec->core.vendor_id) {
2687 /* ALC883 and variants */
2688 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2692 alc_pre_init(codec);
2694 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2696 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2697 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2699 alc_auto_parse_customize_define(codec);
2701 if (has_cdefine_beep(codec))
2702 spec->gen.beep_nid = 0x01;
2704 /* automatic parse from the BIOS config */
2705 err = alc882_parse_auto_config(codec);
2709 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2710 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2715 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2728 static int alc262_parse_auto_config(struct hda_codec *codec)
2730 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2731 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2732 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2739 ALC262_FIXUP_FSC_H270,
2740 ALC262_FIXUP_FSC_S7110,
2741 ALC262_FIXUP_HP_Z200,
2743 ALC262_FIXUP_LENOVO_3000,
2745 ALC262_FIXUP_BENQ_T31,
2746 ALC262_FIXUP_INV_DMIC,
2747 ALC262_FIXUP_INTEL_BAYLEYBAY,
2750 static const struct hda_fixup alc262_fixups[] = {
2751 [ALC262_FIXUP_FSC_H270] = {
2752 .type = HDA_FIXUP_PINS,
2753 .v.pins = (const struct hda_pintbl[]) {
2754 { 0x14, 0x99130110 }, /* speaker */
2755 { 0x15, 0x0221142f }, /* front HP */
2756 { 0x1b, 0x0121141f }, /* rear HP */
2760 [ALC262_FIXUP_FSC_S7110] = {
2761 .type = HDA_FIXUP_PINS,
2762 .v.pins = (const struct hda_pintbl[]) {
2763 { 0x15, 0x90170110 }, /* speaker */
2767 .chain_id = ALC262_FIXUP_BENQ,
2769 [ALC262_FIXUP_HP_Z200] = {
2770 .type = HDA_FIXUP_PINS,
2771 .v.pins = (const struct hda_pintbl[]) {
2772 { 0x16, 0x99130120 }, /* internal speaker */
2776 [ALC262_FIXUP_TYAN] = {
2777 .type = HDA_FIXUP_PINS,
2778 .v.pins = (const struct hda_pintbl[]) {
2779 { 0x14, 0x1993e1f0 }, /* int AUX */
2783 [ALC262_FIXUP_LENOVO_3000] = {
2784 .type = HDA_FIXUP_PINCTLS,
2785 .v.pins = (const struct hda_pintbl[]) {
2786 { 0x19, PIN_VREF50 },
2790 .chain_id = ALC262_FIXUP_BENQ,
2792 [ALC262_FIXUP_BENQ] = {
2793 .type = HDA_FIXUP_VERBS,
2794 .v.verbs = (const struct hda_verb[]) {
2795 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2796 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2800 [ALC262_FIXUP_BENQ_T31] = {
2801 .type = HDA_FIXUP_VERBS,
2802 .v.verbs = (const struct hda_verb[]) {
2803 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2804 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2808 [ALC262_FIXUP_INV_DMIC] = {
2809 .type = HDA_FIXUP_FUNC,
2810 .v.func = alc_fixup_inv_dmic,
2812 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2813 .type = HDA_FIXUP_FUNC,
2814 .v.func = alc_fixup_no_depop_delay,
2818 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2819 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2820 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2821 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2822 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2823 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2824 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2825 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2826 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2827 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2828 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2832 static const struct hda_model_fixup alc262_fixup_models[] = {
2833 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2834 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2835 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2836 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2837 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2838 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2839 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2840 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2841 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2847 static int patch_alc262(struct hda_codec *codec)
2849 struct alc_spec *spec;
2852 err = alc_alloc_spec(codec, 0x0b);
2857 spec->gen.shared_mic_vref_pin = 0x18;
2859 spec->shutup = alc_eapd_shutup;
2862 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2865 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2867 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2869 alc_pre_init(codec);
2871 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2873 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2875 alc_auto_parse_customize_define(codec);
2877 if (has_cdefine_beep(codec))
2878 spec->gen.beep_nid = 0x01;
2880 /* automatic parse from the BIOS config */
2881 err = alc262_parse_auto_config(codec);
2885 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2886 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2891 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2903 /* bind Beep switches of both NID 0x0f and 0x10 */
2904 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2905 struct snd_ctl_elem_value *ucontrol)
2907 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2911 mutex_lock(&codec->control_mutex);
2912 pval = kcontrol->private_value;
2913 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2914 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2916 kcontrol->private_value = (pval & ~0xff) | 0x10;
2917 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2919 kcontrol->private_value = pval;
2920 mutex_unlock(&codec->control_mutex);
2924 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2925 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2927 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2928 .name = "Beep Playback Switch",
2929 .subdevice = HDA_SUBDEV_AMP_FLAG,
2930 .info = snd_hda_mixer_amp_switch_info,
2931 .get = snd_hda_mixer_amp_switch_get,
2932 .put = alc268_beep_switch_put,
2933 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2937 /* set PCBEEP vol = 0, mute connections */
2938 static const struct hda_verb alc268_beep_init_verbs[] = {
2939 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2940 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2941 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2946 ALC268_FIXUP_INV_DMIC,
2947 ALC268_FIXUP_HP_EAPD,
2951 static const struct hda_fixup alc268_fixups[] = {
2952 [ALC268_FIXUP_INV_DMIC] = {
2953 .type = HDA_FIXUP_FUNC,
2954 .v.func = alc_fixup_inv_dmic,
2956 [ALC268_FIXUP_HP_EAPD] = {
2957 .type = HDA_FIXUP_VERBS,
2958 .v.verbs = (const struct hda_verb[]) {
2959 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2963 [ALC268_FIXUP_SPDIF] = {
2964 .type = HDA_FIXUP_PINS,
2965 .v.pins = (const struct hda_pintbl[]) {
2966 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2972 static const struct hda_model_fixup alc268_fixup_models[] = {
2973 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2974 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2975 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2979 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2980 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2981 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2982 /* below is codec SSID since multiple Toshiba laptops have the
2983 * same PCI SSID 1179:ff00
2985 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2990 * BIOS auto configuration
2992 static int alc268_parse_auto_config(struct hda_codec *codec)
2994 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2995 return alc_parse_auto_config(codec, NULL, alc268_ssids);
3000 static int patch_alc268(struct hda_codec *codec)
3002 struct alc_spec *spec;
3005 /* ALC268 has no aa-loopback mixer */
3006 err = alc_alloc_spec(codec, 0);
3011 if (has_cdefine_beep(codec))
3012 spec->gen.beep_nid = 0x01;
3014 spec->shutup = alc_eapd_shutup;
3016 alc_pre_init(codec);
3018 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3019 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3021 /* automatic parse from the BIOS config */
3022 err = alc268_parse_auto_config(codec);
3026 if (err > 0 && !spec->gen.no_analog &&
3027 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3028 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3029 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3030 &alc268_beep_mixer[i])) {
3035 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3036 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3037 /* override the amp caps for beep generator */
3038 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3039 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3040 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3041 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3042 (0 << AC_AMPCAP_MUTE_SHIFT));
3045 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3058 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3059 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3062 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3063 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3066 /* different alc269-variants */
3068 ALC269_TYPE_ALC269VA,
3069 ALC269_TYPE_ALC269VB,
3070 ALC269_TYPE_ALC269VC,
3071 ALC269_TYPE_ALC269VD,
3092 * BIOS auto configuration
3094 static int alc269_parse_auto_config(struct hda_codec *codec)
3096 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3097 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3098 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3099 struct alc_spec *spec = codec->spec;
3100 const hda_nid_t *ssids;
3102 switch (spec->codec_variant) {
3103 case ALC269_TYPE_ALC269VA:
3104 case ALC269_TYPE_ALC269VC:
3105 case ALC269_TYPE_ALC280:
3106 case ALC269_TYPE_ALC284:
3107 case ALC269_TYPE_ALC293:
3108 ssids = alc269va_ssids;
3110 case ALC269_TYPE_ALC269VB:
3111 case ALC269_TYPE_ALC269VD:
3112 case ALC269_TYPE_ALC282:
3113 case ALC269_TYPE_ALC283:
3114 case ALC269_TYPE_ALC286:
3115 case ALC269_TYPE_ALC298:
3116 case ALC269_TYPE_ALC255:
3117 case ALC269_TYPE_ALC256:
3118 case ALC269_TYPE_ALC257:
3119 case ALC269_TYPE_ALC215:
3120 case ALC269_TYPE_ALC225:
3121 case ALC269_TYPE_ALC287:
3122 case ALC269_TYPE_ALC294:
3123 case ALC269_TYPE_ALC300:
3124 case ALC269_TYPE_ALC623:
3125 case ALC269_TYPE_ALC700:
3126 ssids = alc269_ssids;
3129 ssids = alc269_ssids;
3133 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3136 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3137 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3138 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3139 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3140 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3144 static void alc_headset_btn_callback(struct hda_codec *codec,
3145 struct hda_jack_callback *jack)
3149 if (jack->unsol_res & (7 << 13))
3150 report |= SND_JACK_BTN_0;
3152 if (jack->unsol_res & (1 << 16 | 3 << 8))
3153 report |= SND_JACK_BTN_1;
3156 if (jack->unsol_res & (7 << 23))
3157 report |= SND_JACK_BTN_2;
3159 /* Volume down key */
3160 if (jack->unsol_res & (7 << 10))
3161 report |= SND_JACK_BTN_3;
3163 snd_hda_jack_set_button_state(codec, jack->nid, report);
3166 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3168 struct alc_spec *spec = codec->spec;
3170 if (!spec->has_hs_key)
3173 switch (codec->core.vendor_id) {
3181 alc_write_coef_idx(codec, 0x48, 0x0);
3182 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3183 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3188 alc_write_coef_idx(codec, 0x48, 0x0);
3189 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3194 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3196 struct alc_spec *spec = codec->spec;
3198 if (!spec->has_hs_key)
3201 switch (codec->core.vendor_id) {
3209 alc_write_coef_idx(codec, 0x48, 0xd011);
3210 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3211 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3216 alc_write_coef_idx(codec, 0x48, 0xd011);
3217 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3222 static void alc_fixup_headset_jack(struct hda_codec *codec,
3223 const struct hda_fixup *fix, int action)
3225 struct alc_spec *spec = codec->spec;
3229 case HDA_FIXUP_ACT_PRE_PROBE:
3230 spec->has_hs_key = 1;
3231 snd_hda_jack_detect_enable_callback(codec, 0x55,
3232 alc_headset_btn_callback);
3234 case HDA_FIXUP_ACT_BUILD:
3235 hp_pin = alc_get_hp_pin(spec);
3236 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3237 alc_headset_btn_keymap,
3239 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3240 false, SND_JACK_HEADSET,
3241 alc_headset_btn_keymap);
3243 alc_enable_headset_jack_key(codec);
3248 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3250 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3253 static void alc269_shutup(struct hda_codec *codec)
3255 struct alc_spec *spec = codec->spec;
3257 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3258 alc269vb_toggle_power_output(codec, 0);
3259 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3260 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3263 alc_shutup_pins(codec);
3266 static const struct coef_fw alc282_coefs[] = {
3267 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3268 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3269 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3270 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3271 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3272 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3273 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3274 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3275 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3276 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3277 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3278 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3279 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3280 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3281 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3282 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3283 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3284 WRITE_COEF(0x63, 0x2902), /* PLL */
3285 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3286 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3287 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3288 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3289 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3290 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3291 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3292 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3293 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3294 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3295 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3299 static void alc282_restore_default_value(struct hda_codec *codec)
3301 alc_process_coef_fw(codec, alc282_coefs);
3304 static void alc282_init(struct hda_codec *codec)
3306 struct alc_spec *spec = codec->spec;
3307 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3311 alc282_restore_default_value(codec);
3315 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3316 coef78 = alc_read_coef_idx(codec, 0x78);
3318 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3319 /* Headphone capless set to high power mode */
3320 alc_write_coef_idx(codec, 0x78, 0x9004);
3325 snd_hda_codec_write(codec, hp_pin, 0,
3326 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3331 snd_hda_codec_write(codec, hp_pin, 0,
3332 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3337 /* Headphone capless set to normal mode */
3338 alc_write_coef_idx(codec, 0x78, coef78);
3341 static void alc282_shutup(struct hda_codec *codec)
3343 struct alc_spec *spec = codec->spec;
3344 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3349 alc269_shutup(codec);
3353 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3354 coef78 = alc_read_coef_idx(codec, 0x78);
3355 alc_write_coef_idx(codec, 0x78, 0x9004);
3360 snd_hda_codec_write(codec, hp_pin, 0,
3361 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3366 if (!spec->no_shutup_pins)
3367 snd_hda_codec_write(codec, hp_pin, 0,
3368 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3373 alc_auto_setup_eapd(codec, false);
3374 alc_shutup_pins(codec);
3375 alc_write_coef_idx(codec, 0x78, coef78);
3378 static const struct coef_fw alc283_coefs[] = {
3379 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3380 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3381 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3382 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3383 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3384 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3385 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3386 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3387 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3388 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3389 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3390 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3391 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3392 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3393 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3394 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3395 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3396 WRITE_COEF(0x2e, 0x2902), /* PLL */
3397 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3398 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3399 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3400 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3401 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3402 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3403 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3404 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3405 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3406 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3407 WRITE_COEF(0x49, 0x0), /* test mode */
3408 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3409 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3410 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3411 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3415 static void alc283_restore_default_value(struct hda_codec *codec)
3417 alc_process_coef_fw(codec, alc283_coefs);
3420 static void alc283_init(struct hda_codec *codec)
3422 struct alc_spec *spec = codec->spec;
3423 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3426 alc283_restore_default_value(codec);
3432 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3434 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3435 /* Headphone capless set to high power mode */
3436 alc_write_coef_idx(codec, 0x43, 0x9004);
3438 snd_hda_codec_write(codec, hp_pin, 0,
3439 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3444 snd_hda_codec_write(codec, hp_pin, 0,
3445 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3449 /* Index 0x46 Combo jack auto switch control 2 */
3450 /* 3k pull low control for Headset jack. */
3451 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3452 /* Headphone capless set to normal mode */
3453 alc_write_coef_idx(codec, 0x43, 0x9614);
3456 static void alc283_shutup(struct hda_codec *codec)
3458 struct alc_spec *spec = codec->spec;
3459 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3463 alc269_shutup(codec);
3467 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3469 alc_write_coef_idx(codec, 0x43, 0x9004);
3471 /*depop hp during suspend*/
3472 alc_write_coef_idx(codec, 0x06, 0x2100);
3474 snd_hda_codec_write(codec, hp_pin, 0,
3475 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3480 if (!spec->no_shutup_pins)
3481 snd_hda_codec_write(codec, hp_pin, 0,
3482 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3484 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3488 alc_auto_setup_eapd(codec, false);
3489 alc_shutup_pins(codec);
3490 alc_write_coef_idx(codec, 0x43, 0x9614);
3493 static void alc256_init(struct hda_codec *codec)
3495 struct alc_spec *spec = codec->spec;
3496 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3504 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3509 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3510 if (spec->ultra_low_power) {
3511 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3512 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3513 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3514 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3515 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3519 snd_hda_codec_write(codec, hp_pin, 0,
3520 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3522 if (hp_pin_sense || spec->ultra_low_power)
3525 snd_hda_codec_write(codec, hp_pin, 0,
3526 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3528 if (hp_pin_sense || spec->ultra_low_power)
3531 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3532 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3533 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3534 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3536 * Expose headphone mic (or possibly Line In on some machines) instead
3537 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3538 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3541 alc_write_coef_idx(codec, 0x36, 0x5757);
3544 static void alc256_shutup(struct hda_codec *codec)
3546 struct alc_spec *spec = codec->spec;
3547 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3553 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3558 snd_hda_codec_write(codec, hp_pin, 0,
3559 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3561 if (hp_pin_sense || spec->ultra_low_power)
3564 /* 3k pull low control for Headset jack. */
3565 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3566 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3567 * when booting with headset plugged. So skip setting it for the codec alc257
3569 if (spec->codec_variant != ALC269_TYPE_ALC257 &&
3570 spec->codec_variant != ALC269_TYPE_ALC256)
3571 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3573 if (!spec->no_shutup_pins)
3574 snd_hda_codec_write(codec, hp_pin, 0,
3575 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3577 if (hp_pin_sense || spec->ultra_low_power)
3580 alc_auto_setup_eapd(codec, false);
3581 alc_shutup_pins(codec);
3582 if (spec->ultra_low_power) {
3584 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3585 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3586 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3587 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3588 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3593 static void alc285_hp_init(struct hda_codec *codec)
3595 struct alc_spec *spec = codec->spec;
3596 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3598 int coef38, coef0d, coef36;
3600 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3601 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3602 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3603 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3604 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3605 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3607 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3610 snd_hda_codec_write(codec, hp_pin, 0,
3611 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3614 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3615 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3618 snd_hda_codec_write(codec, hp_pin, 0,
3619 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3621 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3622 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3623 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3624 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3626 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3627 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3628 for (i = 0; i < 20 && val & 0x8000; i++) {
3630 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3631 } /* Wait for depop procedure finish */
3633 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3634 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3635 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3636 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3639 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3642 static void alc225_init(struct hda_codec *codec)
3644 struct alc_spec *spec = codec->spec;
3645 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3646 bool hp1_pin_sense, hp2_pin_sense;
3648 if (spec->codec_variant != ALC269_TYPE_ALC287)
3649 /* required only at boot or S3 and S4 resume time */
3650 if (!spec->done_hp_init ||
3651 is_s3_resume(codec) ||
3652 is_s4_resume(codec)) {
3653 alc285_hp_init(codec);
3654 spec->done_hp_init = true;
3661 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3662 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3664 if (hp1_pin_sense || hp2_pin_sense)
3667 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3668 if (spec->ultra_low_power) {
3669 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3670 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3671 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3675 if (hp1_pin_sense || spec->ultra_low_power)
3676 snd_hda_codec_write(codec, hp_pin, 0,
3677 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3679 snd_hda_codec_write(codec, 0x16, 0,
3680 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3682 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3685 if (hp1_pin_sense || spec->ultra_low_power)
3686 snd_hda_codec_write(codec, hp_pin, 0,
3687 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3689 snd_hda_codec_write(codec, 0x16, 0,
3690 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3692 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3695 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3696 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3699 static void alc225_shutup(struct hda_codec *codec)
3701 struct alc_spec *spec = codec->spec;
3702 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3703 bool hp1_pin_sense, hp2_pin_sense;
3708 alc_disable_headset_jack_key(codec);
3709 /* 3k pull low control for Headset jack. */
3710 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3712 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3713 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3715 if (hp1_pin_sense || hp2_pin_sense)
3718 if (hp1_pin_sense || spec->ultra_low_power)
3719 snd_hda_codec_write(codec, hp_pin, 0,
3720 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3722 snd_hda_codec_write(codec, 0x16, 0,
3723 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3725 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3728 if (hp1_pin_sense || spec->ultra_low_power)
3729 snd_hda_codec_write(codec, hp_pin, 0,
3730 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3732 snd_hda_codec_write(codec, 0x16, 0,
3733 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3735 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3738 alc_auto_setup_eapd(codec, false);
3739 alc_shutup_pins(codec);
3740 if (spec->ultra_low_power) {
3742 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3743 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3744 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3745 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3749 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3750 alc_enable_headset_jack_key(codec);
3753 static void alc_default_init(struct hda_codec *codec)
3755 struct alc_spec *spec = codec->spec;
3756 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3764 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3769 snd_hda_codec_write(codec, hp_pin, 0,
3770 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3775 snd_hda_codec_write(codec, hp_pin, 0,
3776 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3782 static void alc_default_shutup(struct hda_codec *codec)
3784 struct alc_spec *spec = codec->spec;
3785 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3789 alc269_shutup(codec);
3793 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3798 snd_hda_codec_write(codec, hp_pin, 0,
3799 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3804 if (!spec->no_shutup_pins)
3805 snd_hda_codec_write(codec, hp_pin, 0,
3806 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3811 alc_auto_setup_eapd(codec, false);
3812 alc_shutup_pins(codec);
3815 static void alc294_hp_init(struct hda_codec *codec)
3817 struct alc_spec *spec = codec->spec;
3818 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3824 snd_hda_codec_write(codec, hp_pin, 0,
3825 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3829 if (!spec->no_shutup_pins)
3830 snd_hda_codec_write(codec, hp_pin, 0,
3831 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3833 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3834 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3836 /* Wait for depop procedure finish */
3837 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3838 for (i = 0; i < 20 && val & 0x0080; i++) {
3840 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3842 /* Set HP depop to auto mode */
3843 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3847 static void alc294_init(struct hda_codec *codec)
3849 struct alc_spec *spec = codec->spec;
3851 /* required only at boot or S4 resume time */
3852 if (!spec->done_hp_init ||
3853 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3854 alc294_hp_init(codec);
3855 spec->done_hp_init = true;
3857 alc_default_init(codec);
3860 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3863 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3864 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3865 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3868 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3872 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3873 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3875 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3880 static void alc5505_dsp_halt(struct hda_codec *codec)
3884 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3885 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3886 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3887 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3888 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3889 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3890 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3891 val = alc5505_coef_get(codec, 0x6220);
3892 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3895 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3897 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3898 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3899 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3900 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3901 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3902 alc5505_coef_set(codec, 0x880c, 0x00000004);
3905 static void alc5505_dsp_init(struct hda_codec *codec)
3909 alc5505_dsp_halt(codec);
3910 alc5505_dsp_back_from_halt(codec);
3911 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3912 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3913 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3914 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3915 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3916 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3917 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3918 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3919 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3920 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3921 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3922 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3923 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3925 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3927 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3929 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3931 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3932 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3933 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3934 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3935 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3936 alc5505_coef_set(codec, 0x880c, 0x00000003);
3937 alc5505_coef_set(codec, 0x880c, 0x00000010);
3939 #ifdef HALT_REALTEK_ALC5505
3940 alc5505_dsp_halt(codec);
3944 #ifdef HALT_REALTEK_ALC5505
3945 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3946 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3948 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3949 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3953 static int alc269_suspend(struct hda_codec *codec)
3955 struct alc_spec *spec = codec->spec;
3957 if (spec->has_alc5505_dsp)
3958 alc5505_dsp_suspend(codec);
3959 return alc_suspend(codec);
3962 static int alc269_resume(struct hda_codec *codec)
3964 struct alc_spec *spec = codec->spec;
3966 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3967 alc269vb_toggle_power_output(codec, 0);
3968 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3969 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3973 codec->patch_ops.init(codec);
3975 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3976 alc269vb_toggle_power_output(codec, 1);
3977 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3978 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3982 snd_hda_regmap_sync(codec);
3983 hda_call_check_power_status(codec, 0x01);
3985 /* on some machine, the BIOS will clear the codec gpio data when enter
3986 * suspend, and won't restore the data after resume, so we restore it
3989 if (spec->gpio_data)
3990 alc_write_gpio_data(codec);
3992 if (spec->has_alc5505_dsp)
3993 alc5505_dsp_resume(codec);
3997 #endif /* CONFIG_PM */
3999 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4000 const struct hda_fixup *fix, int action)
4002 struct alc_spec *spec = codec->spec;
4004 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4005 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4008 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4009 const struct hda_fixup *fix,
4012 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4013 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4015 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4016 snd_hda_codec_set_pincfg(codec, 0x19,
4017 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4018 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4021 static void alc269_fixup_hweq(struct hda_codec *codec,
4022 const struct hda_fixup *fix, int action)
4024 if (action == HDA_FIXUP_ACT_INIT)
4025 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4028 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4029 const struct hda_fixup *fix, int action)
4031 struct alc_spec *spec = codec->spec;
4033 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4034 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4037 static void alc271_fixup_dmic(struct hda_codec *codec,
4038 const struct hda_fixup *fix, int action)
4040 static const struct hda_verb verbs[] = {
4041 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4042 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4047 if (strcmp(codec->core.chip_name, "ALC271X") &&
4048 strcmp(codec->core.chip_name, "ALC269VB"))
4050 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4051 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4052 snd_hda_sequence_write(codec, verbs);
4055 /* Fix the speaker amp after resume, etc */
4056 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4057 const struct hda_fixup *fix,
4060 if (action == HDA_FIXUP_ACT_INIT)
4061 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4064 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4065 const struct hda_fixup *fix, int action)
4067 struct alc_spec *spec = codec->spec;
4069 if (action != HDA_FIXUP_ACT_PROBE)
4072 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4073 * fix the sample rate of analog I/O to 44.1kHz
4075 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4076 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4079 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4080 const struct hda_fixup *fix, int action)
4082 /* The digital-mic unit sends PDM (differential signal) instead of
4083 * the standard PCM, thus you can't record a valid mono stream as is.
4084 * Below is a workaround specific to ALC269 to control the dmic
4085 * signal source as mono.
4087 if (action == HDA_FIXUP_ACT_INIT)
4088 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4091 static void alc269_quanta_automute(struct hda_codec *codec)
4093 snd_hda_gen_update_outputs(codec);
4095 alc_write_coef_idx(codec, 0x0c, 0x680);
4096 alc_write_coef_idx(codec, 0x0c, 0x480);
4099 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4100 const struct hda_fixup *fix, int action)
4102 struct alc_spec *spec = codec->spec;
4103 if (action != HDA_FIXUP_ACT_PROBE)
4105 spec->gen.automute_hook = alc269_quanta_automute;
4108 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4109 struct hda_jack_callback *jack)
4111 struct alc_spec *spec = codec->spec;
4114 snd_hda_gen_hp_automute(codec, jack);
4116 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4118 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4121 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4126 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4128 struct hda_alc298_mbxinit {
4129 unsigned char value_0x23;
4130 unsigned char value_0x25;
4133 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4134 const struct hda_alc298_mbxinit *initval,
4137 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4138 alc_write_coef_idx(codec, 0x26, 0xb000);
4141 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4143 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4144 alc_write_coef_idx(codec, 0x26, 0xf000);
4145 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4147 if (initval->value_0x23 != 0x1e)
4148 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4150 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4151 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4154 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4155 const struct hda_fixup *fix,
4158 /* Initialization magic */
4159 static const struct hda_alc298_mbxinit dac_init[] = {
4160 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4161 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4162 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4163 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4164 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4165 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4167 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4168 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4169 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4172 const struct hda_alc298_mbxinit *seq;
4174 if (action != HDA_FIXUP_ACT_INIT)
4178 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4179 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4180 alc_write_coef_idx(codec, 0x26, 0xf000);
4181 alc_write_coef_idx(codec, 0x22, 0x31);
4182 alc_write_coef_idx(codec, 0x23, 0x0b);
4183 alc_write_coef_idx(codec, 0x25, 0x00);
4184 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4185 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4187 for (seq = dac_init; seq->value_0x23; seq++)
4188 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4191 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4192 const struct hda_fixup *fix, int action)
4194 struct alc_spec *spec = codec->spec;
4195 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4196 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4197 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4201 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4202 bool polarity, bool on)
4204 unsigned int pinval;
4210 pinval = snd_hda_codec_get_pin_target(codec, pin);
4211 pinval &= ~AC_PINCTL_VREFEN;
4212 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4213 /* temporarily power up/down for setting VREF */
4214 snd_hda_power_up_pm(codec);
4215 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4216 snd_hda_power_down_pm(codec);
4219 /* update mute-LED according to the speaker mute state via mic VREF pin */
4220 static int vref_mute_led_set(struct led_classdev *led_cdev,
4221 enum led_brightness brightness)
4223 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4224 struct alc_spec *spec = codec->spec;
4226 alc_update_vref_led(codec, spec->mute_led_nid,
4227 spec->mute_led_polarity, brightness);
4231 /* Make sure the led works even in runtime suspend */
4232 static unsigned int led_power_filter(struct hda_codec *codec,
4234 unsigned int power_state)
4236 struct alc_spec *spec = codec->spec;
4238 if (power_state != AC_PWRST_D3 || nid == 0 ||
4239 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4242 /* Set pin ctl again, it might have just been set to 0 */
4243 snd_hda_set_pin_ctl(codec, nid,
4244 snd_hda_codec_get_pin_target(codec, nid));
4246 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4249 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4250 const struct hda_fixup *fix, int action)
4252 struct alc_spec *spec = codec->spec;
4253 const struct dmi_device *dev = NULL;
4255 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4258 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4260 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4262 if (pin < 0x0a || pin >= 0x10)
4264 spec->mute_led_polarity = pol;
4265 spec->mute_led_nid = pin - 0x0a + 0x18;
4266 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4267 codec->power_filter = led_power_filter;
4269 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4270 spec->mute_led_polarity);
4275 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4276 const struct hda_fixup *fix,
4277 int action, hda_nid_t pin)
4279 struct alc_spec *spec = codec->spec;
4281 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4282 spec->mute_led_polarity = 0;
4283 spec->mute_led_nid = pin;
4284 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4285 codec->power_filter = led_power_filter;
4289 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4290 const struct hda_fixup *fix, int action)
4292 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4295 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4296 const struct hda_fixup *fix, int action)
4298 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4301 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4302 const struct hda_fixup *fix, int action)
4304 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4307 /* update LED status via GPIO */
4308 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4309 int polarity, bool enabled)
4313 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4316 /* turn on/off mute LED via GPIO per vmaster hook */
4317 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4318 enum led_brightness brightness)
4320 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4321 struct alc_spec *spec = codec->spec;
4323 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4324 spec->mute_led_polarity, !brightness);
4328 /* turn on/off mic-mute LED via GPIO per capture hook */
4329 static int micmute_led_set(struct led_classdev *led_cdev,
4330 enum led_brightness brightness)
4332 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4333 struct alc_spec *spec = codec->spec;
4335 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4336 spec->micmute_led_polarity, !brightness);
4340 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4341 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4343 unsigned int mute_mask,
4344 unsigned int micmute_mask)
4346 struct alc_spec *spec = codec->spec;
4348 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4350 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4353 spec->gpio_mute_led_mask = mute_mask;
4354 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4357 spec->gpio_mic_led_mask = micmute_mask;
4358 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4362 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4363 const struct hda_fixup *fix, int action)
4365 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4368 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4369 const struct hda_fixup *fix, int action)
4371 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4374 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4375 const struct hda_fixup *fix, int action)
4377 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4380 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4381 const struct hda_fixup *fix, int action)
4383 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4386 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4387 const struct hda_fixup *fix, int action)
4389 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4392 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4393 const struct hda_fixup *fix, int action)
4395 struct alc_spec *spec = codec->spec;
4397 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4398 spec->micmute_led_polarity = 1;
4399 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4402 /* turn on/off mic-mute LED per capture hook via VREF change */
4403 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4404 enum led_brightness brightness)
4406 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4407 struct alc_spec *spec = codec->spec;
4409 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4410 spec->micmute_led_polarity, brightness);
4414 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4415 const struct hda_fixup *fix, int action)
4417 struct alc_spec *spec = codec->spec;
4419 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4420 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4421 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4422 * enable headphone amp
4424 spec->gpio_mask |= 0x10;
4425 spec->gpio_dir |= 0x10;
4426 spec->cap_mute_led_nid = 0x18;
4427 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4428 codec->power_filter = led_power_filter;
4432 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4433 const struct hda_fixup *fix, int action)
4435 struct alc_spec *spec = codec->spec;
4437 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4438 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4439 spec->cap_mute_led_nid = 0x18;
4440 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4441 codec->power_filter = led_power_filter;
4445 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4446 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4448 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4449 const struct hda_fixup *fix, int action)
4451 struct alc_spec *spec = codec->spec;
4454 case HDA_FIXUP_ACT_PRE_PROBE:
4455 spec->gpio_mask |= 0x01;
4456 spec->gpio_dir |= 0x01;
4458 case HDA_FIXUP_ACT_INIT:
4459 /* need to toggle GPIO to enable the amp */
4460 alc_update_gpio_data(codec, 0x01, true);
4462 alc_update_gpio_data(codec, 0x01, false);
4467 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4468 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4469 struct hda_codec *codec,
4470 struct snd_pcm_substream *substream,
4474 case HDA_GEN_PCM_ACT_PREPARE:
4475 alc_update_gpio_data(codec, 0x04, true);
4477 case HDA_GEN_PCM_ACT_CLEANUP:
4478 alc_update_gpio_data(codec, 0x04, false);
4483 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4484 const struct hda_fixup *fix,
4487 struct alc_spec *spec = codec->spec;
4489 if (action == HDA_FIXUP_ACT_PROBE) {
4490 spec->gpio_mask |= 0x04;
4491 spec->gpio_dir |= 0x04;
4492 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4496 static void alc_update_coef_led(struct hda_codec *codec,
4497 struct alc_coef_led *led,
4498 bool polarity, bool on)
4502 /* temporarily power up/down for setting COEF bit */
4503 alc_update_coef_idx(codec, led->idx, led->mask,
4504 on ? led->on : led->off);
4507 /* update mute-LED according to the speaker mute state via COEF bit */
4508 static int coef_mute_led_set(struct led_classdev *led_cdev,
4509 enum led_brightness brightness)
4511 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4512 struct alc_spec *spec = codec->spec;
4514 alc_update_coef_led(codec, &spec->mute_led_coef,
4515 spec->mute_led_polarity, brightness);
4519 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4520 const struct hda_fixup *fix,
4523 struct alc_spec *spec = codec->spec;
4525 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4526 spec->mute_led_polarity = 0;
4527 spec->mute_led_coef.idx = 0x0b;
4528 spec->mute_led_coef.mask = 1 << 3;
4529 spec->mute_led_coef.on = 1 << 3;
4530 spec->mute_led_coef.off = 0;
4531 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4535 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4536 const struct hda_fixup *fix,
4539 struct alc_spec *spec = codec->spec;
4541 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4542 spec->mute_led_polarity = 0;
4543 spec->mute_led_coef.idx = 0x34;
4544 spec->mute_led_coef.mask = 1 << 5;
4545 spec->mute_led_coef.on = 0;
4546 spec->mute_led_coef.off = 1 << 5;
4547 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4551 /* turn on/off mic-mute LED per capture hook by coef bit */
4552 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4553 enum led_brightness brightness)
4555 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4556 struct alc_spec *spec = codec->spec;
4558 alc_update_coef_led(codec, &spec->mic_led_coef,
4559 spec->micmute_led_polarity, brightness);
4563 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4564 const struct hda_fixup *fix, int action)
4566 struct alc_spec *spec = codec->spec;
4568 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4569 spec->mic_led_coef.idx = 0x19;
4570 spec->mic_led_coef.mask = 1 << 13;
4571 spec->mic_led_coef.on = 1 << 13;
4572 spec->mic_led_coef.off = 0;
4573 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4577 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4578 const struct hda_fixup *fix, int action)
4580 struct alc_spec *spec = codec->spec;
4582 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4583 spec->mic_led_coef.idx = 0x35;
4584 spec->mic_led_coef.mask = 3 << 2;
4585 spec->mic_led_coef.on = 2 << 2;
4586 spec->mic_led_coef.off = 1 << 2;
4587 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4591 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4592 const struct hda_fixup *fix, int action)
4594 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4595 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4598 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4599 const struct hda_fixup *fix, int action)
4601 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4602 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4605 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4606 const struct hda_fixup *fix, int action)
4608 struct alc_spec *spec = codec->spec;
4610 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4611 spec->cap_mute_led_nid = 0x1a;
4612 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4613 codec->power_filter = led_power_filter;
4617 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4618 const struct hda_fixup *fix, int action)
4620 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4621 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4624 #if IS_REACHABLE(CONFIG_INPUT)
4625 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4626 struct hda_jack_callback *event)
4628 struct alc_spec *spec = codec->spec;
4630 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4631 send both key on and key off event for every interrupt. */
4632 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4633 input_sync(spec->kb_dev);
4634 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4635 input_sync(spec->kb_dev);
4638 static int alc_register_micmute_input_device(struct hda_codec *codec)
4640 struct alc_spec *spec = codec->spec;
4643 spec->kb_dev = input_allocate_device();
4644 if (!spec->kb_dev) {
4645 codec_err(codec, "Out of memory (input_allocate_device)\n");
4649 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4651 spec->kb_dev->name = "Microphone Mute Button";
4652 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4653 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4654 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4655 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4656 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4657 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4659 if (input_register_device(spec->kb_dev)) {
4660 codec_err(codec, "input_register_device failed\n");
4661 input_free_device(spec->kb_dev);
4662 spec->kb_dev = NULL;
4669 /* GPIO1 = set according to SKU external amp
4670 * GPIO2 = mic mute hotkey
4672 * GPIO4 = mic mute LED
4674 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4675 const struct hda_fixup *fix, int action)
4677 struct alc_spec *spec = codec->spec;
4679 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4680 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4681 spec->init_amp = ALC_INIT_DEFAULT;
4682 if (alc_register_micmute_input_device(codec) != 0)
4685 spec->gpio_mask |= 0x06;
4686 spec->gpio_dir |= 0x02;
4687 spec->gpio_data |= 0x02;
4688 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4689 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4690 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4691 gpio2_mic_hotkey_event);
4699 case HDA_FIXUP_ACT_FREE:
4700 input_unregister_device(spec->kb_dev);
4701 spec->kb_dev = NULL;
4705 /* Line2 = mic mute hotkey
4706 * GPIO2 = mic mute LED
4708 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4709 const struct hda_fixup *fix, int action)
4711 struct alc_spec *spec = codec->spec;
4713 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4714 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4715 spec->init_amp = ALC_INIT_DEFAULT;
4716 if (alc_register_micmute_input_device(codec) != 0)
4719 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4720 gpio2_mic_hotkey_event);
4728 case HDA_FIXUP_ACT_FREE:
4729 input_unregister_device(spec->kb_dev);
4730 spec->kb_dev = NULL;
4734 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4735 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4738 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4739 const struct hda_fixup *fix, int action)
4741 struct alc_spec *spec = codec->spec;
4743 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4744 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4745 spec->cap_mute_led_nid = 0x18;
4746 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4750 static const struct coef_fw alc225_pre_hsmode[] = {
4751 UPDATE_COEF(0x4a, 1<<8, 0),
4752 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4753 UPDATE_COEF(0x63, 3<<14, 3<<14),
4754 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4755 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4756 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4757 UPDATE_COEF(0x4a, 3<<10, 0),
4761 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4763 struct alc_spec *spec = codec->spec;
4764 static const struct coef_fw coef0255[] = {
4765 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4766 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4767 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4768 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4769 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4772 static const struct coef_fw coef0256[] = {
4773 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4774 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4775 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4776 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4777 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4780 static const struct coef_fw coef0233[] = {
4781 WRITE_COEF(0x1b, 0x0c0b),
4782 WRITE_COEF(0x45, 0xc429),
4783 UPDATE_COEF(0x35, 0x4000, 0),
4784 WRITE_COEF(0x06, 0x2104),
4785 WRITE_COEF(0x1a, 0x0001),
4786 WRITE_COEF(0x26, 0x0004),
4787 WRITE_COEF(0x32, 0x42a3),
4790 static const struct coef_fw coef0288[] = {
4791 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4792 UPDATE_COEF(0x50, 0x2000, 0x2000),
4793 UPDATE_COEF(0x56, 0x0006, 0x0006),
4794 UPDATE_COEF(0x66, 0x0008, 0),
4795 UPDATE_COEF(0x67, 0x2000, 0),
4798 static const struct coef_fw coef0298[] = {
4799 UPDATE_COEF(0x19, 0x1300, 0x0300),
4802 static const struct coef_fw coef0292[] = {
4803 WRITE_COEF(0x76, 0x000e),
4804 WRITE_COEF(0x6c, 0x2400),
4805 WRITE_COEF(0x18, 0x7308),
4806 WRITE_COEF(0x6b, 0xc429),
4809 static const struct coef_fw coef0293[] = {
4810 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4811 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4812 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4813 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4814 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4815 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4818 static const struct coef_fw coef0668[] = {
4819 WRITE_COEF(0x15, 0x0d40),
4820 WRITE_COEF(0xb7, 0x802b),
4823 static const struct coef_fw coef0225[] = {
4824 UPDATE_COEF(0x63, 3<<14, 0),
4827 static const struct coef_fw coef0274[] = {
4828 UPDATE_COEF(0x4a, 0x0100, 0),
4829 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4830 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4831 UPDATE_COEF(0x4a, 0x0010, 0),
4832 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4833 WRITE_COEF(0x45, 0x5289),
4834 UPDATE_COEF(0x4a, 0x0c00, 0),
4838 if (spec->no_internal_mic_pin) {
4839 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4843 switch (codec->core.vendor_id) {
4845 alc_process_coef_fw(codec, coef0255);
4850 alc_process_coef_fw(codec, coef0256);
4855 alc_process_coef_fw(codec, coef0274);
4859 alc_process_coef_fw(codec, coef0233);
4863 alc_process_coef_fw(codec, coef0288);
4866 alc_process_coef_fw(codec, coef0298);
4867 alc_process_coef_fw(codec, coef0288);
4870 alc_process_coef_fw(codec, coef0292);
4873 alc_process_coef_fw(codec, coef0293);
4876 alc_process_coef_fw(codec, coef0668);
4884 alc_process_coef_fw(codec, alc225_pre_hsmode);
4885 alc_process_coef_fw(codec, coef0225);
4888 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4891 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4895 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4898 static const struct coef_fw coef0255[] = {
4899 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4900 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4903 static const struct coef_fw coef0256[] = {
4904 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4905 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4906 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4909 static const struct coef_fw coef0233[] = {
4910 UPDATE_COEF(0x35, 0, 1<<14),
4911 WRITE_COEF(0x06, 0x2100),
4912 WRITE_COEF(0x1a, 0x0021),
4913 WRITE_COEF(0x26, 0x008c),
4916 static const struct coef_fw coef0288[] = {
4917 UPDATE_COEF(0x4f, 0x00c0, 0),
4918 UPDATE_COEF(0x50, 0x2000, 0),
4919 UPDATE_COEF(0x56, 0x0006, 0),
4920 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4921 UPDATE_COEF(0x66, 0x0008, 0x0008),
4922 UPDATE_COEF(0x67, 0x2000, 0x2000),
4925 static const struct coef_fw coef0292[] = {
4926 WRITE_COEF(0x19, 0xa208),
4927 WRITE_COEF(0x2e, 0xacf0),
4930 static const struct coef_fw coef0293[] = {
4931 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4932 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4933 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4936 static const struct coef_fw coef0688[] = {
4937 WRITE_COEF(0xb7, 0x802b),
4938 WRITE_COEF(0xb5, 0x1040),
4939 UPDATE_COEF(0xc3, 0, 1<<12),
4942 static const struct coef_fw coef0225[] = {
4943 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4944 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4945 UPDATE_COEF(0x63, 3<<14, 0),
4948 static const struct coef_fw coef0274[] = {
4949 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4950 UPDATE_COEF(0x4a, 0x0010, 0),
4951 UPDATE_COEF(0x6b, 0xf000, 0),
4955 switch (codec->core.vendor_id) {
4957 alc_write_coef_idx(codec, 0x45, 0xc489);
4958 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4959 alc_process_coef_fw(codec, coef0255);
4960 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4965 alc_write_coef_idx(codec, 0x45, 0xc489);
4966 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4967 alc_process_coef_fw(codec, coef0256);
4968 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4973 alc_write_coef_idx(codec, 0x45, 0x4689);
4974 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4975 alc_process_coef_fw(codec, coef0274);
4976 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4980 alc_write_coef_idx(codec, 0x45, 0xc429);
4981 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4982 alc_process_coef_fw(codec, coef0233);
4983 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4988 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4989 alc_process_coef_fw(codec, coef0288);
4990 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4993 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4994 alc_process_coef_fw(codec, coef0292);
4997 /* Set to TRS mode */
4998 alc_write_coef_idx(codec, 0x45, 0xc429);
4999 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5000 alc_process_coef_fw(codec, coef0293);
5001 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5004 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5008 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5009 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5012 alc_write_coef_idx(codec, 0x11, 0x0001);
5013 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5014 alc_process_coef_fw(codec, coef0688);
5015 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5023 alc_process_coef_fw(codec, alc225_pre_hsmode);
5024 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5025 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5026 alc_process_coef_fw(codec, coef0225);
5027 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5030 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5033 static void alc_headset_mode_default(struct hda_codec *codec)
5035 static const struct coef_fw coef0225[] = {
5036 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5037 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5038 UPDATE_COEF(0x49, 3<<8, 0<<8),
5039 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5040 UPDATE_COEF(0x63, 3<<14, 0),
5041 UPDATE_COEF(0x67, 0xf000, 0x3000),
5044 static const struct coef_fw coef0255[] = {
5045 WRITE_COEF(0x45, 0xc089),
5046 WRITE_COEF(0x45, 0xc489),
5047 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5048 WRITE_COEF(0x49, 0x0049),
5051 static const struct coef_fw coef0256[] = {
5052 WRITE_COEF(0x45, 0xc489),
5053 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5054 WRITE_COEF(0x49, 0x0049),
5055 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5056 WRITE_COEF(0x06, 0x6100),
5059 static const struct coef_fw coef0233[] = {
5060 WRITE_COEF(0x06, 0x2100),
5061 WRITE_COEF(0x32, 0x4ea3),
5064 static const struct coef_fw coef0288[] = {
5065 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5066 UPDATE_COEF(0x50, 0x2000, 0x2000),
5067 UPDATE_COEF(0x56, 0x0006, 0x0006),
5068 UPDATE_COEF(0x66, 0x0008, 0),
5069 UPDATE_COEF(0x67, 0x2000, 0),
5072 static const struct coef_fw coef0292[] = {
5073 WRITE_COEF(0x76, 0x000e),
5074 WRITE_COEF(0x6c, 0x2400),
5075 WRITE_COEF(0x6b, 0xc429),
5076 WRITE_COEF(0x18, 0x7308),
5079 static const struct coef_fw coef0293[] = {
5080 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5081 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5082 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5085 static const struct coef_fw coef0688[] = {
5086 WRITE_COEF(0x11, 0x0041),
5087 WRITE_COEF(0x15, 0x0d40),
5088 WRITE_COEF(0xb7, 0x802b),
5091 static const struct coef_fw coef0274[] = {
5092 WRITE_COEF(0x45, 0x4289),
5093 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5094 UPDATE_COEF(0x6b, 0x0f00, 0),
5095 UPDATE_COEF(0x49, 0x0300, 0x0300),
5099 switch (codec->core.vendor_id) {
5106 alc_process_coef_fw(codec, alc225_pre_hsmode);
5107 alc_process_coef_fw(codec, coef0225);
5110 alc_process_coef_fw(codec, coef0255);
5115 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5116 alc_write_coef_idx(codec, 0x45, 0xc089);
5118 alc_process_coef_fw(codec, coef0256);
5123 alc_process_coef_fw(codec, coef0274);
5127 alc_process_coef_fw(codec, coef0233);
5132 alc_process_coef_fw(codec, coef0288);
5135 alc_process_coef_fw(codec, coef0292);
5138 alc_process_coef_fw(codec, coef0293);
5141 alc_process_coef_fw(codec, coef0688);
5144 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5147 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5151 static void alc_headset_mode_ctia(struct hda_codec *codec)
5155 static const struct coef_fw coef0255[] = {
5156 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5157 WRITE_COEF(0x1b, 0x0c2b),
5158 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5161 static const struct coef_fw coef0256[] = {
5162 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5163 WRITE_COEF(0x1b, 0x0e6b),
5166 static const struct coef_fw coef0233[] = {
5167 WRITE_COEF(0x45, 0xd429),
5168 WRITE_COEF(0x1b, 0x0c2b),
5169 WRITE_COEF(0x32, 0x4ea3),
5172 static const struct coef_fw coef0288[] = {
5173 UPDATE_COEF(0x50, 0x2000, 0x2000),
5174 UPDATE_COEF(0x56, 0x0006, 0x0006),
5175 UPDATE_COEF(0x66, 0x0008, 0),
5176 UPDATE_COEF(0x67, 0x2000, 0),
5179 static const struct coef_fw coef0292[] = {
5180 WRITE_COEF(0x6b, 0xd429),
5181 WRITE_COEF(0x76, 0x0008),
5182 WRITE_COEF(0x18, 0x7388),
5185 static const struct coef_fw coef0293[] = {
5186 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5187 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5190 static const struct coef_fw coef0688[] = {
5191 WRITE_COEF(0x11, 0x0001),
5192 WRITE_COEF(0x15, 0x0d60),
5193 WRITE_COEF(0xc3, 0x0000),
5196 static const struct coef_fw coef0225_1[] = {
5197 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5198 UPDATE_COEF(0x63, 3<<14, 2<<14),
5201 static const struct coef_fw coef0225_2[] = {
5202 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5203 UPDATE_COEF(0x63, 3<<14, 1<<14),
5207 switch (codec->core.vendor_id) {
5209 alc_process_coef_fw(codec, coef0255);
5214 alc_process_coef_fw(codec, coef0256);
5219 alc_write_coef_idx(codec, 0x45, 0xd689);
5223 alc_process_coef_fw(codec, coef0233);
5226 val = alc_read_coef_idx(codec, 0x50);
5227 if (val & (1 << 12)) {
5228 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5229 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5232 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5233 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5239 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5241 alc_process_coef_fw(codec, coef0288);
5244 alc_process_coef_fw(codec, coef0292);
5247 alc_process_coef_fw(codec, coef0293);
5250 alc_process_coef_fw(codec, coef0688);
5258 val = alc_read_coef_idx(codec, 0x45);
5260 alc_process_coef_fw(codec, coef0225_2);
5262 alc_process_coef_fw(codec, coef0225_1);
5265 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5268 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5272 static void alc_headset_mode_omtp(struct hda_codec *codec)
5274 static const struct coef_fw coef0255[] = {
5275 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5276 WRITE_COEF(0x1b, 0x0c2b),
5277 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5280 static const struct coef_fw coef0256[] = {
5281 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5282 WRITE_COEF(0x1b, 0x0e6b),
5285 static const struct coef_fw coef0233[] = {
5286 WRITE_COEF(0x45, 0xe429),
5287 WRITE_COEF(0x1b, 0x0c2b),
5288 WRITE_COEF(0x32, 0x4ea3),
5291 static const struct coef_fw coef0288[] = {
5292 UPDATE_COEF(0x50, 0x2000, 0x2000),
5293 UPDATE_COEF(0x56, 0x0006, 0x0006),
5294 UPDATE_COEF(0x66, 0x0008, 0),
5295 UPDATE_COEF(0x67, 0x2000, 0),
5298 static const struct coef_fw coef0292[] = {
5299 WRITE_COEF(0x6b, 0xe429),
5300 WRITE_COEF(0x76, 0x0008),
5301 WRITE_COEF(0x18, 0x7388),
5304 static const struct coef_fw coef0293[] = {
5305 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5306 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5309 static const struct coef_fw coef0688[] = {
5310 WRITE_COEF(0x11, 0x0001),
5311 WRITE_COEF(0x15, 0x0d50),
5312 WRITE_COEF(0xc3, 0x0000),
5315 static const struct coef_fw coef0225[] = {
5316 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5317 UPDATE_COEF(0x63, 3<<14, 2<<14),
5321 switch (codec->core.vendor_id) {
5323 alc_process_coef_fw(codec, coef0255);
5328 alc_process_coef_fw(codec, coef0256);
5333 alc_write_coef_idx(codec, 0x45, 0xe689);
5337 alc_process_coef_fw(codec, coef0233);
5340 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5341 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5346 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5348 alc_process_coef_fw(codec, coef0288);
5351 alc_process_coef_fw(codec, coef0292);
5354 alc_process_coef_fw(codec, coef0293);
5357 alc_process_coef_fw(codec, coef0688);
5365 alc_process_coef_fw(codec, coef0225);
5368 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5371 static void alc_determine_headset_type(struct hda_codec *codec)
5374 bool is_ctia = false;
5375 struct alc_spec *spec = codec->spec;
5376 static const struct coef_fw coef0255[] = {
5377 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5378 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5382 static const struct coef_fw coef0288[] = {
5383 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5386 static const struct coef_fw coef0298[] = {
5387 UPDATE_COEF(0x50, 0x2000, 0x2000),
5388 UPDATE_COEF(0x56, 0x0006, 0x0006),
5389 UPDATE_COEF(0x66, 0x0008, 0),
5390 UPDATE_COEF(0x67, 0x2000, 0),
5391 UPDATE_COEF(0x19, 0x1300, 0x1300),
5394 static const struct coef_fw coef0293[] = {
5395 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5396 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5399 static const struct coef_fw coef0688[] = {
5400 WRITE_COEF(0x11, 0x0001),
5401 WRITE_COEF(0xb7, 0x802b),
5402 WRITE_COEF(0x15, 0x0d60),
5403 WRITE_COEF(0xc3, 0x0c00),
5406 static const struct coef_fw coef0274[] = {
5407 UPDATE_COEF(0x4a, 0x0010, 0),
5408 UPDATE_COEF(0x4a, 0x8000, 0),
5409 WRITE_COEF(0x45, 0xd289),
5410 UPDATE_COEF(0x49, 0x0300, 0x0300),
5414 if (spec->no_internal_mic_pin) {
5415 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5419 switch (codec->core.vendor_id) {
5421 alc_process_coef_fw(codec, coef0255);
5423 val = alc_read_coef_idx(codec, 0x46);
5424 is_ctia = (val & 0x0070) == 0x0070;
5429 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5430 alc_write_coef_idx(codec, 0x06, 0x6104);
5431 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5433 snd_hda_codec_write(codec, 0x21, 0,
5434 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5436 snd_hda_codec_write(codec, 0x21, 0,
5437 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5439 alc_process_coef_fw(codec, coef0255);
5441 val = alc_read_coef_idx(codec, 0x46);
5442 is_ctia = (val & 0x0070) == 0x0070;
5444 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5445 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5447 snd_hda_codec_write(codec, 0x21, 0,
5448 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5450 snd_hda_codec_write(codec, 0x21, 0,
5451 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5456 alc_process_coef_fw(codec, coef0274);
5458 val = alc_read_coef_idx(codec, 0x46);
5459 is_ctia = (val & 0x00f0) == 0x00f0;
5463 alc_write_coef_idx(codec, 0x45, 0xd029);
5465 val = alc_read_coef_idx(codec, 0x46);
5466 is_ctia = (val & 0x0070) == 0x0070;
5469 snd_hda_codec_write(codec, 0x21, 0,
5470 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5472 snd_hda_codec_write(codec, 0x21, 0,
5473 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5476 val = alc_read_coef_idx(codec, 0x50);
5477 if (val & (1 << 12)) {
5478 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5479 alc_process_coef_fw(codec, coef0288);
5481 val = alc_read_coef_idx(codec, 0x50);
5482 is_ctia = (val & 0x0070) == 0x0070;
5484 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5485 alc_process_coef_fw(codec, coef0288);
5487 val = alc_read_coef_idx(codec, 0x50);
5488 is_ctia = (val & 0x0070) == 0x0070;
5490 alc_process_coef_fw(codec, coef0298);
5491 snd_hda_codec_write(codec, 0x21, 0,
5492 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5494 snd_hda_codec_write(codec, 0x21, 0,
5495 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5499 alc_process_coef_fw(codec, coef0288);
5501 val = alc_read_coef_idx(codec, 0x50);
5502 is_ctia = (val & 0x0070) == 0x0070;
5505 alc_write_coef_idx(codec, 0x6b, 0xd429);
5507 val = alc_read_coef_idx(codec, 0x6c);
5508 is_ctia = (val & 0x001c) == 0x001c;
5511 alc_process_coef_fw(codec, coef0293);
5513 val = alc_read_coef_idx(codec, 0x46);
5514 is_ctia = (val & 0x0070) == 0x0070;
5517 alc_process_coef_fw(codec, coef0688);
5519 val = alc_read_coef_idx(codec, 0xbe);
5520 is_ctia = (val & 0x1c02) == 0x1c02;
5528 snd_hda_codec_write(codec, 0x21, 0,
5529 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5531 snd_hda_codec_write(codec, 0x21, 0,
5532 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5534 alc_process_coef_fw(codec, alc225_pre_hsmode);
5535 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5536 val = alc_read_coef_idx(codec, 0x45);
5537 if (val & (1 << 9)) {
5538 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5539 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5541 val = alc_read_coef_idx(codec, 0x46);
5542 is_ctia = (val & 0x00f0) == 0x00f0;
5544 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5545 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5547 val = alc_read_coef_idx(codec, 0x46);
5548 is_ctia = (val & 0x00f0) == 0x00f0;
5550 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5551 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5552 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5554 snd_hda_codec_write(codec, 0x21, 0,
5555 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5557 snd_hda_codec_write(codec, 0x21, 0,
5558 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5565 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5566 is_ctia ? "yes" : "no");
5567 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5570 static void alc_update_headset_mode(struct hda_codec *codec)
5572 struct alc_spec *spec = codec->spec;
5574 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5575 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5577 int new_headset_mode;
5579 if (!snd_hda_jack_detect(codec, hp_pin))
5580 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5581 else if (mux_pin == spec->headset_mic_pin)
5582 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5583 else if (mux_pin == spec->headphone_mic_pin)
5584 new_headset_mode = ALC_HEADSET_MODE_MIC;
5586 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5588 if (new_headset_mode == spec->current_headset_mode) {
5589 snd_hda_gen_update_outputs(codec);
5593 switch (new_headset_mode) {
5594 case ALC_HEADSET_MODE_UNPLUGGED:
5595 alc_headset_mode_unplugged(codec);
5596 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5597 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5598 spec->gen.hp_jack_present = false;
5600 case ALC_HEADSET_MODE_HEADSET:
5601 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5602 alc_determine_headset_type(codec);
5603 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5604 alc_headset_mode_ctia(codec);
5605 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5606 alc_headset_mode_omtp(codec);
5607 spec->gen.hp_jack_present = true;
5609 case ALC_HEADSET_MODE_MIC:
5610 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5611 spec->gen.hp_jack_present = false;
5613 case ALC_HEADSET_MODE_HEADPHONE:
5614 alc_headset_mode_default(codec);
5615 spec->gen.hp_jack_present = true;
5618 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5619 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5620 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5621 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5622 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5625 spec->current_headset_mode = new_headset_mode;
5627 snd_hda_gen_update_outputs(codec);
5630 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5631 struct snd_kcontrol *kcontrol,
5632 struct snd_ctl_elem_value *ucontrol)
5634 alc_update_headset_mode(codec);
5637 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5638 struct hda_jack_callback *jack)
5640 snd_hda_gen_hp_automute(codec, jack);
5641 alc_update_headset_mode(codec);
5644 static void alc_probe_headset_mode(struct hda_codec *codec)
5647 struct alc_spec *spec = codec->spec;
5648 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5651 for (i = 0; i < cfg->num_inputs; i++) {
5652 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5653 spec->headset_mic_pin = cfg->inputs[i].pin;
5654 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5655 spec->headphone_mic_pin = cfg->inputs[i].pin;
5658 WARN_ON(spec->gen.cap_sync_hook);
5659 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5660 spec->gen.automute_hook = alc_update_headset_mode;
5661 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5664 static void alc_fixup_headset_mode(struct hda_codec *codec,
5665 const struct hda_fixup *fix, int action)
5667 struct alc_spec *spec = codec->spec;
5670 case HDA_FIXUP_ACT_PRE_PROBE:
5671 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5673 case HDA_FIXUP_ACT_PROBE:
5674 alc_probe_headset_mode(codec);
5676 case HDA_FIXUP_ACT_INIT:
5677 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5678 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5679 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5681 alc_update_headset_mode(codec);
5686 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5687 const struct hda_fixup *fix, int action)
5689 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5690 struct alc_spec *spec = codec->spec;
5691 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5694 alc_fixup_headset_mode(codec, fix, action);
5697 static void alc255_set_default_jack_type(struct hda_codec *codec)
5699 /* Set to iphone type */
5700 static const struct coef_fw alc255fw[] = {
5701 WRITE_COEF(0x1b, 0x880b),
5702 WRITE_COEF(0x45, 0xd089),
5703 WRITE_COEF(0x1b, 0x080b),
5704 WRITE_COEF(0x46, 0x0004),
5705 WRITE_COEF(0x1b, 0x0c0b),
5708 static const struct coef_fw alc256fw[] = {
5709 WRITE_COEF(0x1b, 0x884b),
5710 WRITE_COEF(0x45, 0xd089),
5711 WRITE_COEF(0x1b, 0x084b),
5712 WRITE_COEF(0x46, 0x0004),
5713 WRITE_COEF(0x1b, 0x0c4b),
5716 switch (codec->core.vendor_id) {
5718 alc_process_coef_fw(codec, alc255fw);
5723 alc_process_coef_fw(codec, alc256fw);
5729 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5730 const struct hda_fixup *fix, int action)
5732 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5733 alc255_set_default_jack_type(codec);
5735 alc_fixup_headset_mode(codec, fix, action);
5738 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5739 const struct hda_fixup *fix, int action)
5741 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5742 struct alc_spec *spec = codec->spec;
5743 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5744 alc255_set_default_jack_type(codec);
5747 alc_fixup_headset_mode(codec, fix, action);
5750 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5751 struct hda_jack_callback *jack)
5753 struct alc_spec *spec = codec->spec;
5755 alc_update_headset_jack_cb(codec, jack);
5756 /* Headset Mic enable or disable, only for Dell Dino */
5757 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5760 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5761 const struct hda_fixup *fix, int action)
5763 alc_fixup_headset_mode(codec, fix, action);
5764 if (action == HDA_FIXUP_ACT_PROBE) {
5765 struct alc_spec *spec = codec->spec;
5766 /* toggled via hp_automute_hook */
5767 spec->gpio_mask |= 0x40;
5768 spec->gpio_dir |= 0x40;
5769 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5773 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5774 const struct hda_fixup *fix, int action)
5776 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5777 struct alc_spec *spec = codec->spec;
5778 spec->gen.auto_mute_via_amp = 1;
5782 static void alc_fixup_no_shutup(struct hda_codec *codec,
5783 const struct hda_fixup *fix, int action)
5785 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5786 struct alc_spec *spec = codec->spec;
5787 spec->no_shutup_pins = 1;
5791 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5792 const struct hda_fixup *fix, int action)
5794 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5795 struct alc_spec *spec = codec->spec;
5796 /* Disable AA-loopback as it causes white noise */
5797 spec->gen.mixer_nid = 0;
5801 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5802 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5803 const struct hda_fixup *fix, int action)
5805 static const struct hda_pintbl pincfgs[] = {
5806 { 0x16, 0x21211010 }, /* dock headphone */
5807 { 0x19, 0x21a11010 }, /* dock mic */
5810 struct alc_spec *spec = codec->spec;
5812 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5813 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5814 codec->power_save_node = 0; /* avoid click noises */
5815 snd_hda_apply_pincfgs(codec, pincfgs);
5819 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5820 const struct hda_fixup *fix, int action)
5822 static const struct hda_pintbl pincfgs[] = {
5823 { 0x17, 0x21211010 }, /* dock headphone */
5824 { 0x19, 0x21a11010 }, /* dock mic */
5827 struct alc_spec *spec = codec->spec;
5829 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5830 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5831 snd_hda_apply_pincfgs(codec, pincfgs);
5832 } else if (action == HDA_FIXUP_ACT_INIT) {
5833 /* Enable DOCK device */
5834 snd_hda_codec_write(codec, 0x17, 0,
5835 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5836 /* Enable DOCK device */
5837 snd_hda_codec_write(codec, 0x19, 0,
5838 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5842 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5843 const struct hda_fixup *fix, int action)
5845 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5846 * the speaker output becomes too low by some reason on Thinkpads with
5849 static const hda_nid_t preferred_pairs[] = {
5850 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5853 struct alc_spec *spec = codec->spec;
5855 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5856 spec->gen.preferred_dacs = preferred_pairs;
5859 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5860 const struct hda_fixup *fix, int action)
5862 static const hda_nid_t preferred_pairs[] = {
5863 0x17, 0x02, 0x21, 0x03, 0
5865 struct alc_spec *spec = codec->spec;
5867 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5868 spec->gen.preferred_dacs = preferred_pairs;
5871 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5873 struct alc_spec *spec = codec->spec;
5874 int hp_pin = alc_get_hp_pin(spec);
5876 /* Prevent pop noises when headphones are plugged in */
5877 snd_hda_codec_write(codec, hp_pin, 0,
5878 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5882 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5883 const struct hda_fixup *fix, int action)
5885 struct alc_spec *spec = codec->spec;
5886 struct hda_input_mux *imux = &spec->gen.input_mux;
5890 case HDA_FIXUP_ACT_PRE_PROBE:
5891 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5892 * it causes a click noise at start up
5894 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5895 spec->shutup = alc_shutup_dell_xps13;
5897 case HDA_FIXUP_ACT_PROBE:
5898 /* Make the internal mic the default input source. */
5899 for (i = 0; i < imux->num_items; i++) {
5900 if (spec->gen.imux_pins[i] == 0x12) {
5901 spec->gen.cur_mux[0] = i;
5909 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5910 const struct hda_fixup *fix, int action)
5912 struct alc_spec *spec = codec->spec;
5914 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5915 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5916 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5918 /* Disable boost for mic-in permanently. (This code is only called
5919 from quirks that guarantee that the headphone is at NID 0x1b.) */
5920 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5921 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5923 alc_fixup_headset_mode(codec, fix, action);
5926 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5927 const struct hda_fixup *fix, int action)
5929 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5930 alc_write_coef_idx(codec, 0xc4, 0x8000);
5931 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5932 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5934 alc_fixup_headset_mode(codec, fix, action);
5937 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5938 static int find_ext_mic_pin(struct hda_codec *codec)
5940 struct alc_spec *spec = codec->spec;
5941 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5943 unsigned int defcfg;
5946 for (i = 0; i < cfg->num_inputs; i++) {
5947 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5949 nid = cfg->inputs[i].pin;
5950 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5951 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5959 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5960 const struct hda_fixup *fix,
5963 struct alc_spec *spec = codec->spec;
5965 if (action == HDA_FIXUP_ACT_PROBE) {
5966 int mic_pin = find_ext_mic_pin(codec);
5967 int hp_pin = alc_get_hp_pin(spec);
5969 if (snd_BUG_ON(!mic_pin || !hp_pin))
5971 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5975 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5976 const struct hda_fixup *fix,
5979 struct alc_spec *spec = codec->spec;
5980 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5983 /* The mic boosts on level 2 and 3 are too noisy
5984 on the internal mic input.
5985 Therefore limit the boost to 0 or 1. */
5987 if (action != HDA_FIXUP_ACT_PROBE)
5990 for (i = 0; i < cfg->num_inputs; i++) {
5991 hda_nid_t nid = cfg->inputs[i].pin;
5992 unsigned int defcfg;
5993 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5995 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5996 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5999 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6000 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6001 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6002 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6003 (0 << AC_AMPCAP_MUTE_SHIFT));
6007 static void alc283_hp_automute_hook(struct hda_codec *codec,
6008 struct hda_jack_callback *jack)
6010 struct alc_spec *spec = codec->spec;
6014 snd_hda_gen_hp_automute(codec, jack);
6016 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6019 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6023 static void alc283_fixup_chromebook(struct hda_codec *codec,
6024 const struct hda_fixup *fix, int action)
6026 struct alc_spec *spec = codec->spec;
6029 case HDA_FIXUP_ACT_PRE_PROBE:
6030 snd_hda_override_wcaps(codec, 0x03, 0);
6031 /* Disable AA-loopback as it causes white noise */
6032 spec->gen.mixer_nid = 0;
6034 case HDA_FIXUP_ACT_INIT:
6035 /* MIC2-VREF control */
6036 /* Set to manual mode */
6037 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6038 /* Enable Line1 input control by verb */
6039 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6044 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6045 const struct hda_fixup *fix, int action)
6047 struct alc_spec *spec = codec->spec;
6050 case HDA_FIXUP_ACT_PRE_PROBE:
6051 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6053 case HDA_FIXUP_ACT_INIT:
6054 /* MIC2-VREF control */
6055 /* Set to manual mode */
6056 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6061 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6062 static void asus_tx300_automute(struct hda_codec *codec)
6064 struct alc_spec *spec = codec->spec;
6065 snd_hda_gen_update_outputs(codec);
6066 if (snd_hda_jack_detect(codec, 0x1b))
6067 spec->gen.mute_bits |= (1ULL << 0x14);
6070 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6071 const struct hda_fixup *fix, int action)
6073 struct alc_spec *spec = codec->spec;
6074 static const struct hda_pintbl dock_pins[] = {
6075 { 0x1b, 0x21114000 }, /* dock speaker pin */
6080 case HDA_FIXUP_ACT_PRE_PROBE:
6081 spec->init_amp = ALC_INIT_DEFAULT;
6082 /* TX300 needs to set up GPIO2 for the speaker amp */
6083 alc_setup_gpio(codec, 0x04);
6084 snd_hda_apply_pincfgs(codec, dock_pins);
6085 spec->gen.auto_mute_via_amp = 1;
6086 spec->gen.automute_hook = asus_tx300_automute;
6087 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6088 snd_hda_gen_hp_automute);
6090 case HDA_FIXUP_ACT_PROBE:
6091 spec->init_amp = ALC_INIT_DEFAULT;
6093 case HDA_FIXUP_ACT_BUILD:
6094 /* this is a bit tricky; give more sane names for the main
6095 * (tablet) speaker and the dock speaker, respectively
6097 rename_ctl(codec, "Speaker Playback Switch",
6098 "Dock Speaker Playback Switch");
6099 rename_ctl(codec, "Bass Speaker Playback Switch",
6100 "Speaker Playback Switch");
6105 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6106 const struct hda_fixup *fix, int action)
6108 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6109 /* DAC node 0x03 is giving mono output. We therefore want to
6110 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6111 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6112 static const hda_nid_t conn1[] = { 0x0c };
6113 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6114 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6118 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6119 const struct hda_fixup *fix, int action)
6121 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6122 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6123 we can't adjust the speaker's volume since this node does not has
6124 Amp-out capability. we change the speaker's route to:
6125 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6126 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6127 speaker's volume now. */
6129 static const hda_nid_t conn1[] = { 0x0c };
6130 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6134 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6135 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6136 const struct hda_fixup *fix, int action)
6138 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6139 static const hda_nid_t conn[] = { 0x02, 0x03 };
6140 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6144 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6145 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6146 const struct hda_fixup *fix, int action)
6148 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6149 static const hda_nid_t conn[] = { 0x02 };
6150 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6154 /* Hook to update amp GPIO4 for automute */
6155 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6156 struct hda_jack_callback *jack)
6158 struct alc_spec *spec = codec->spec;
6160 snd_hda_gen_hp_automute(codec, jack);
6161 /* mute_led_polarity is set to 0, so we pass inverted value here */
6162 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6163 !spec->gen.hp_jack_present);
6166 /* Manage GPIOs for HP EliteBook Folio 9480m.
6168 * GPIO4 is the headphone amplifier power control
6169 * GPIO3 is the audio output mute indicator LED
6172 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6173 const struct hda_fixup *fix,
6176 struct alc_spec *spec = codec->spec;
6178 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6179 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6180 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6181 spec->gpio_mask |= 0x10;
6182 spec->gpio_dir |= 0x10;
6183 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6187 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6188 const struct hda_fixup *fix,
6191 struct alc_spec *spec = codec->spec;
6193 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6194 spec->gpio_mask |= 0x04;
6195 spec->gpio_dir |= 0x04;
6196 /* set data bit low */
6200 /* Quirk for Thinkpad X1 7th and 8th Gen
6201 * The following fixed routing needed
6202 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6203 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6204 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6206 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6207 const struct hda_fixup *fix, int action)
6209 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6210 static const hda_nid_t preferred_pairs[] = {
6211 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6213 struct alc_spec *spec = codec->spec;
6216 case HDA_FIXUP_ACT_PRE_PROBE:
6217 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6218 spec->gen.preferred_dacs = preferred_pairs;
6220 case HDA_FIXUP_ACT_BUILD:
6221 /* The generic parser creates somewhat unintuitive volume ctls
6222 * with the fixed routing above, and the shared DAC2 may be
6224 * Rename those to unique names so that PA doesn't touch them
6225 * and use only Master volume.
6227 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6228 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6233 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6234 const struct hda_fixup *fix,
6237 alc_fixup_dual_codecs(codec, fix, action);
6239 case HDA_FIXUP_ACT_PRE_PROBE:
6240 /* override card longname to provide a unique UCM profile */
6241 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6243 case HDA_FIXUP_ACT_BUILD:
6244 /* rename Capture controls depending on the codec */
6245 rename_ctl(codec, "Capture Volume",
6247 "Rear-Panel Capture Volume" :
6248 "Front-Panel Capture Volume");
6249 rename_ctl(codec, "Capture Switch",
6251 "Rear-Panel Capture Switch" :
6252 "Front-Panel Capture Switch");
6257 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6258 const struct hda_fixup *fix, int action)
6260 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6263 codec->power_save_node = 1;
6266 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6267 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6268 const struct hda_fixup *fix, int action)
6270 struct alc_spec *spec = codec->spec;
6271 static const hda_nid_t preferred_pairs[] = {
6272 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6276 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6279 spec->gen.preferred_dacs = preferred_pairs;
6280 spec->gen.auto_mute_via_amp = 1;
6281 codec->power_save_node = 0;
6284 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6285 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6286 const struct hda_fixup *fix, int action)
6288 static const hda_nid_t preferred_pairs[] = {
6289 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6291 struct alc_spec *spec = codec->spec;
6293 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6294 spec->gen.preferred_dacs = preferred_pairs;
6295 spec->gen.obey_preferred_dacs = 1;
6299 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6300 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6301 const struct hda_fixup *fix, int action)
6303 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6306 snd_hda_override_wcaps(codec, 0x03, 0);
6309 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6311 switch (codec->core.vendor_id) {
6317 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6318 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6325 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6326 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6331 static void alc295_fixup_chromebook(struct hda_codec *codec,
6332 const struct hda_fixup *fix, int action)
6334 struct alc_spec *spec = codec->spec;
6337 case HDA_FIXUP_ACT_PRE_PROBE:
6338 spec->ultra_low_power = true;
6340 case HDA_FIXUP_ACT_INIT:
6341 alc_combo_jack_hp_jd_restart(codec);
6346 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6347 const struct hda_fixup *fix, int action)
6349 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6350 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6354 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6355 struct hda_jack_callback *cb)
6357 /* The Windows driver sets the codec up in a very different way where
6358 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6360 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6361 alc_write_coef_idx(codec, 0x10, 0x8a20);
6363 alc_write_coef_idx(codec, 0x10, 0x0a20);
6366 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6367 const struct hda_fixup *fix, int action)
6369 /* Pin 0x21: headphones/headset mic */
6370 if (!is_jack_detectable(codec, 0x21))
6374 case HDA_FIXUP_ACT_PRE_PROBE:
6375 snd_hda_jack_detect_enable_callback(codec, 0x21,
6376 alc294_gx502_toggle_output);
6378 case HDA_FIXUP_ACT_INIT:
6379 /* Make sure to start in a correct state, i.e. if
6380 * headphones have been plugged in before powering up the system
6382 alc294_gx502_toggle_output(codec, NULL);
6387 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6388 struct hda_jack_callback *cb)
6390 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6391 * responsible from changes between speakers and headphones
6393 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6394 alc_write_coef_idx(codec, 0x10, 0x8420);
6396 alc_write_coef_idx(codec, 0x10, 0x0a20);
6399 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6400 const struct hda_fixup *fix, int action)
6402 if (!is_jack_detectable(codec, 0x21))
6406 case HDA_FIXUP_ACT_PRE_PROBE:
6407 snd_hda_jack_detect_enable_callback(codec, 0x21,
6408 alc294_gu502_toggle_output);
6410 case HDA_FIXUP_ACT_INIT:
6411 alc294_gu502_toggle_output(codec, NULL);
6416 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6417 const struct hda_fixup *fix, int action)
6419 if (action != HDA_FIXUP_ACT_INIT)
6423 alc_write_coef_idx(codec, 0x65, 0x0);
6426 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6427 const struct hda_fixup *fix, int action)
6430 case HDA_FIXUP_ACT_INIT:
6431 alc_combo_jack_hp_jd_restart(codec);
6436 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6437 const struct hda_fixup *fix, int action)
6439 struct alc_spec *spec = codec->spec;
6442 case HDA_FIXUP_ACT_PRE_PROBE:
6443 /* Mic RING SLEEVE swap for combo jack */
6444 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6445 spec->no_internal_mic_pin = true;
6447 case HDA_FIXUP_ACT_INIT:
6448 alc_combo_jack_hp_jd_restart(codec);
6453 /* GPIO1 = amplifier on/off
6454 * GPIO3 = mic mute LED
6456 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6457 const struct hda_fixup *fix, int action)
6459 static const hda_nid_t conn[] = { 0x02 };
6461 struct alc_spec *spec = codec->spec;
6462 static const struct hda_pintbl pincfgs[] = {
6463 { 0x14, 0x90170110 }, /* front/high speakers */
6464 { 0x17, 0x90170130 }, /* back/bass speakers */
6468 //enable micmute led
6469 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6472 case HDA_FIXUP_ACT_PRE_PROBE:
6473 spec->micmute_led_polarity = 1;
6474 /* needed for amp of back speakers */
6475 spec->gpio_mask |= 0x01;
6476 spec->gpio_dir |= 0x01;
6477 snd_hda_apply_pincfgs(codec, pincfgs);
6478 /* share DAC to have unified volume control */
6479 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6480 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6482 case HDA_FIXUP_ACT_INIT:
6483 /* need to toggle GPIO to enable the amp of back speakers */
6484 alc_update_gpio_data(codec, 0x01, true);
6486 alc_update_gpio_data(codec, 0x01, false);
6491 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6492 const struct hda_fixup *fix, int action)
6494 static const hda_nid_t conn[] = { 0x02 };
6495 static const struct hda_pintbl pincfgs[] = {
6496 { 0x14, 0x90170110 }, /* rear speaker */
6501 case HDA_FIXUP_ACT_PRE_PROBE:
6502 snd_hda_apply_pincfgs(codec, pincfgs);
6503 /* force front speaker to DAC1 */
6504 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6509 /* for hda_fixup_thinkpad_acpi() */
6510 #include "thinkpad_helper.c"
6512 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6513 const struct hda_fixup *fix, int action)
6515 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6516 hda_fixup_thinkpad_acpi(codec, fix, action);
6519 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6520 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6521 const struct hda_fixup *fix,
6524 struct alc_spec *spec = codec->spec;
6527 case HDA_FIXUP_ACT_PRE_PROBE:
6528 spec->gen.suppress_auto_mute = 1;
6533 static int comp_match_dev_name(struct device *dev, void *data)
6535 return strcmp(dev_name(dev), data) == 0;
6538 static int find_comp_by_dev_name(struct alc_spec *spec, const char *name)
6542 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6543 if (strcmp(spec->comps[i].name, name) == 0)
6550 static int comp_bind(struct device *dev)
6552 struct hda_codec *cdc = dev_to_hda_codec(dev);
6553 struct alc_spec *spec = cdc->spec;
6555 return component_bind_all(dev, spec->comps);
6558 static void comp_unbind(struct device *dev)
6560 struct hda_codec *cdc = dev_to_hda_codec(dev);
6561 struct alc_spec *spec = cdc->spec;
6563 component_unbind_all(dev, spec->comps);
6566 static const struct component_master_ops comp_master_ops = {
6568 .unbind = comp_unbind,
6571 static void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6572 struct snd_pcm_substream *sub, int action)
6574 struct alc_spec *spec = cdc->spec;
6577 for (i = 0; i < HDA_MAX_COMPONENTS; i++) {
6578 if (spec->comps[i].dev)
6579 spec->comps[i].playback_hook(spec->comps[i].dev, action);
6583 static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char *bus,
6584 const char *hid, int count)
6586 struct device *dev = hda_codec_dev(cdc);
6587 struct alc_spec *spec = cdc->spec;
6592 case HDA_FIXUP_ACT_PRE_PROBE:
6593 for (i = 0; i < count; i++) {
6594 name = devm_kasprintf(dev, GFP_KERNEL,
6595 "%s-%s:00-cs35l41-hda.%d", bus, hid, i);
6598 component_match_add(dev, &spec->match, comp_match_dev_name, name);
6600 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6602 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6604 spec->gen.pcm_playback_hook = comp_generic_playback_hook;
6609 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
6611 cs35l41_generic_fixup(cdc, action, "i2c", "CSC3551", 2);
6614 static void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *cdc,
6615 struct snd_pcm_substream *sub, int action)
6617 struct alc_spec *spec = cdc->spec;
6618 unsigned int rx_slot;
6622 case HDA_GEN_PCM_ACT_PREPARE:
6624 i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.0");
6626 spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
6629 i = find_comp_by_dev_name(spec, "i2c-CLSA0100:00-cs35l41-hda.1");
6631 spec->comps[i].set_channel_map(spec->comps[i].dev, 0, NULL, 1, &rx_slot);
6635 comp_generic_playback_hook(hinfo, cdc, sub, action);
6638 static void alc287_fixup_legion_16achg6_speakers(struct hda_codec *cdc, const struct hda_fixup *fix,
6641 struct device *dev = hda_codec_dev(cdc);
6642 struct alc_spec *spec = cdc->spec;
6646 case HDA_FIXUP_ACT_PRE_PROBE:
6647 component_match_add(dev, &spec->match, comp_match_dev_name,
6648 "i2c-CLSA0100:00-cs35l41-hda.0");
6649 component_match_add(dev, &spec->match, comp_match_dev_name,
6650 "i2c-CLSA0100:00-cs35l41-hda.1");
6651 ret = component_master_add_with_match(dev, &comp_master_ops, spec->match);
6653 codec_err(cdc, "Fail to register component aggregator %d\n", ret);
6655 spec->gen.pcm_playback_hook = alc287_legion_16achg6_playback_hook;
6660 /* for alc295_fixup_hp_top_speakers */
6661 #include "hp_x360_helper.c"
6663 /* for alc285_fixup_ideapad_s740_coef() */
6664 #include "ideapad_s740_helper.c"
6666 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6667 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6668 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6669 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6673 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6674 const struct hda_fixup *fix,
6678 * A certain other OS sets these coeffs to different values. On at least
6679 * one TongFang barebone these settings might survive even a cold
6680 * reboot. So to restore a clean slate the values are explicitly reset
6681 * to default here. Without this, the external microphone is always in a
6682 * plugged-in state, while the internal microphone is always in an
6683 * unplugged state, breaking the ability to use the internal microphone.
6685 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6688 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6689 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6690 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6691 WRITE_COEF(0x49, 0x0149),
6695 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6696 const struct hda_fixup *fix,
6700 * The audio jack input and output is not detected on the ASRock NUC Box
6701 * 1100 series when cold booting without this fix. Warm rebooting from a
6702 * certain other OS makes the audio functional, as COEF settings are
6703 * preserved in this case. This fix sets these altered COEF values as
6706 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6709 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6710 const struct hda_fixup *fix,
6714 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6715 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6716 * needs an additional quirk for sound working after suspend and resume.
6718 if (codec->core.vendor_id == 0x10ec0256) {
6719 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6720 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6722 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6728 ALC269_FIXUP_SONY_VAIO,
6729 ALC275_FIXUP_SONY_VAIO_GPIO2,
6730 ALC269_FIXUP_DELL_M101Z,
6731 ALC269_FIXUP_SKU_IGNORE,
6732 ALC269_FIXUP_ASUS_G73JW,
6733 ALC269_FIXUP_LENOVO_EAPD,
6734 ALC275_FIXUP_SONY_HWEQ,
6735 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6737 ALC269_FIXUP_PCM_44K,
6738 ALC269_FIXUP_STEREO_DMIC,
6739 ALC269_FIXUP_HEADSET_MIC,
6740 ALC269_FIXUP_QUANTA_MUTE,
6741 ALC269_FIXUP_LIFEBOOK,
6742 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6743 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6744 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6745 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6748 ALC269VB_FIXUP_AMIC,
6749 ALC269VB_FIXUP_DMIC,
6750 ALC269_FIXUP_HP_MUTE_LED,
6751 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6752 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6753 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6754 ALC269_FIXUP_HP_GPIO_LED,
6755 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6756 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6757 ALC269_FIXUP_INV_DMIC,
6758 ALC269_FIXUP_LENOVO_DOCK,
6759 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6760 ALC269_FIXUP_NO_SHUTUP,
6761 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6762 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6763 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6764 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6765 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6766 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6767 ALC269_FIXUP_HEADSET_MODE,
6768 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6769 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6770 ALC269_FIXUP_ASUS_X101_FUNC,
6771 ALC269_FIXUP_ASUS_X101_VERB,
6772 ALC269_FIXUP_ASUS_X101,
6773 ALC271_FIXUP_AMIC_MIC2,
6774 ALC271_FIXUP_HP_GATE_MIC_JACK,
6775 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6776 ALC269_FIXUP_ACER_AC700,
6777 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6778 ALC269VB_FIXUP_ASUS_ZENBOOK,
6779 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6780 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6781 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6782 ALC283_FIXUP_CHROME_BOOK,
6783 ALC283_FIXUP_SENSE_COMBO_JACK,
6784 ALC282_FIXUP_ASUS_TX300,
6785 ALC283_FIXUP_INT_MIC,
6786 ALC290_FIXUP_MONO_SPEAKERS,
6787 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6788 ALC290_FIXUP_SUBWOOFER,
6789 ALC290_FIXUP_SUBWOOFER_HSJACK,
6790 ALC269_FIXUP_THINKPAD_ACPI,
6791 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6792 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6793 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6794 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6795 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6796 ALC255_FIXUP_HEADSET_MODE,
6797 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6798 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6799 ALC292_FIXUP_TPT440_DOCK,
6800 ALC292_FIXUP_TPT440,
6801 ALC283_FIXUP_HEADSET_MIC,
6802 ALC255_FIXUP_MIC_MUTE_LED,
6803 ALC282_FIXUP_ASPIRE_V5_PINS,
6804 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6805 ALC280_FIXUP_HP_GPIO4,
6806 ALC286_FIXUP_HP_GPIO_LED,
6807 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6808 ALC280_FIXUP_HP_DOCK_PINS,
6809 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6810 ALC280_FIXUP_HP_9480M,
6811 ALC245_FIXUP_HP_X360_AMP,
6812 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
6813 ALC288_FIXUP_DELL_HEADSET_MODE,
6814 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6815 ALC288_FIXUP_DELL_XPS_13,
6816 ALC288_FIXUP_DISABLE_AAMIX,
6817 ALC292_FIXUP_DELL_E7X_AAMIX,
6818 ALC292_FIXUP_DELL_E7X,
6819 ALC292_FIXUP_DISABLE_AAMIX,
6820 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6821 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6822 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6823 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6824 ALC275_FIXUP_DELL_XPS,
6825 ALC293_FIXUP_LENOVO_SPK_NOISE,
6826 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6827 ALC255_FIXUP_DELL_SPK_NOISE,
6828 ALC225_FIXUP_DISABLE_MIC_VREF,
6829 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6830 ALC295_FIXUP_DISABLE_DAC3,
6831 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6832 ALC280_FIXUP_HP_HEADSET_MIC,
6833 ALC221_FIXUP_HP_FRONT_MIC,
6834 ALC292_FIXUP_TPT460,
6835 ALC298_FIXUP_SPK_VOLUME,
6836 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6837 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6838 ALC269_FIXUP_ATIV_BOOK_8,
6839 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6840 ALC256_FIXUP_ASUS_HEADSET_MODE,
6841 ALC256_FIXUP_ASUS_MIC,
6842 ALC256_FIXUP_ASUS_AIO_GPIO2,
6843 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6844 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6845 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6846 ALC233_FIXUP_ACER_HEADSET_MIC,
6847 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6848 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6849 ALC225_FIXUP_S3_POP_NOISE,
6850 ALC700_FIXUP_INTEL_REFERENCE,
6851 ALC274_FIXUP_DELL_BIND_DACS,
6852 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6853 ALC298_FIXUP_TPT470_DOCK_FIX,
6854 ALC298_FIXUP_TPT470_DOCK,
6855 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6856 ALC255_FIXUP_DELL_HEADSET_MIC,
6857 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6858 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6859 ALC295_FIXUP_HP_X360,
6860 ALC221_FIXUP_HP_HEADSET_MIC,
6861 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6862 ALC295_FIXUP_HP_AUTO_MUTE,
6863 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6864 ALC294_FIXUP_ASUS_MIC,
6865 ALC294_FIXUP_ASUS_HEADSET_MIC,
6866 ALC294_FIXUP_ASUS_SPK,
6867 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6868 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6869 ALC255_FIXUP_ACER_HEADSET_MIC,
6870 ALC295_FIXUP_CHROME_BOOK,
6871 ALC225_FIXUP_HEADSET_JACK,
6872 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6873 ALC225_FIXUP_WYSE_AUTO_MUTE,
6874 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6875 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6876 ALC256_FIXUP_ASUS_HEADSET_MIC,
6877 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6878 ALC299_FIXUP_PREDATOR_SPK,
6879 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6880 ALC289_FIXUP_DELL_SPK2,
6881 ALC289_FIXUP_DUAL_SPK,
6882 ALC294_FIXUP_SPK2_TO_DAC1,
6883 ALC294_FIXUP_ASUS_DUAL_SPK,
6884 ALC285_FIXUP_THINKPAD_X1_GEN7,
6885 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6886 ALC294_FIXUP_ASUS_HPE,
6887 ALC294_FIXUP_ASUS_COEF_1B,
6888 ALC294_FIXUP_ASUS_GX502_HP,
6889 ALC294_FIXUP_ASUS_GX502_PINS,
6890 ALC294_FIXUP_ASUS_GX502_VERBS,
6891 ALC294_FIXUP_ASUS_GU502_HP,
6892 ALC294_FIXUP_ASUS_GU502_PINS,
6893 ALC294_FIXUP_ASUS_GU502_VERBS,
6894 ALC285_FIXUP_HP_GPIO_LED,
6895 ALC285_FIXUP_HP_MUTE_LED,
6896 ALC236_FIXUP_HP_GPIO_LED,
6897 ALC236_FIXUP_HP_MUTE_LED,
6898 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6899 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6900 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6901 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6902 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6903 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6904 ALC289_FIXUP_ASUS_GA401,
6905 ALC289_FIXUP_ASUS_GA502,
6906 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6907 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6908 ALC269_FIXUP_CZC_B20,
6909 ALC269_FIXUP_CZC_TMI,
6910 ALC269_FIXUP_CZC_L101,
6911 ALC269_FIXUP_LEMOTE_A1802,
6912 ALC269_FIXUP_LEMOTE_A190X,
6913 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6914 ALC233_FIXUP_INTEL_NUC8_DMIC,
6915 ALC233_FIXUP_INTEL_NUC8_BOOST,
6916 ALC256_FIXUP_INTEL_NUC10,
6917 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6918 ALC274_FIXUP_HP_MIC,
6919 ALC274_FIXUP_HP_HEADSET_MIC,
6920 ALC274_FIXUP_HP_ENVY_GPIO,
6921 ALC256_FIXUP_ASUS_HPE,
6922 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6923 ALC287_FIXUP_HP_GPIO_LED,
6924 ALC256_FIXUP_HP_HEADSET_MIC,
6925 ALC245_FIXUP_HP_GPIO_LED,
6926 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6927 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6928 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6929 ALC256_FIXUP_ACER_HEADSET_MIC,
6930 ALC285_FIXUP_IDEAPAD_S740_COEF,
6931 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6932 ALC295_FIXUP_ASUS_DACS,
6933 ALC295_FIXUP_HP_OMEN,
6934 ALC285_FIXUP_HP_SPECTRE_X360,
6935 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6936 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6937 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6938 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6939 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6940 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6941 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
6942 ALC287_FIXUP_13S_GEN2_SPEAKERS,
6943 ALC256_FIXUP_SET_COEF_DEFAULTS,
6944 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6945 ALC233_FIXUP_NO_AUDIO_JACK,
6946 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
6947 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
6948 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
6949 ALC287_FIXUP_LEGION_16ACHG6,
6950 ALC287_FIXUP_CS35L41_I2C_2,
6951 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
6954 static const struct hda_fixup alc269_fixups[] = {
6955 [ALC269_FIXUP_GPIO2] = {
6956 .type = HDA_FIXUP_FUNC,
6957 .v.func = alc_fixup_gpio2,
6959 [ALC269_FIXUP_SONY_VAIO] = {
6960 .type = HDA_FIXUP_PINCTLS,
6961 .v.pins = (const struct hda_pintbl[]) {
6962 {0x19, PIN_VREFGRD},
6966 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6967 .type = HDA_FIXUP_FUNC,
6968 .v.func = alc275_fixup_gpio4_off,
6970 .chain_id = ALC269_FIXUP_SONY_VAIO
6972 [ALC269_FIXUP_DELL_M101Z] = {
6973 .type = HDA_FIXUP_VERBS,
6974 .v.verbs = (const struct hda_verb[]) {
6975 /* Enables internal speaker */
6976 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6977 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6981 [ALC269_FIXUP_SKU_IGNORE] = {
6982 .type = HDA_FIXUP_FUNC,
6983 .v.func = alc_fixup_sku_ignore,
6985 [ALC269_FIXUP_ASUS_G73JW] = {
6986 .type = HDA_FIXUP_PINS,
6987 .v.pins = (const struct hda_pintbl[]) {
6988 { 0x17, 0x99130111 }, /* subwoofer */
6992 [ALC269_FIXUP_LENOVO_EAPD] = {
6993 .type = HDA_FIXUP_VERBS,
6994 .v.verbs = (const struct hda_verb[]) {
6995 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6999 [ALC275_FIXUP_SONY_HWEQ] = {
7000 .type = HDA_FIXUP_FUNC,
7001 .v.func = alc269_fixup_hweq,
7003 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7005 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7006 .type = HDA_FIXUP_FUNC,
7007 .v.func = alc_fixup_disable_aamix,
7009 .chain_id = ALC269_FIXUP_SONY_VAIO
7011 [ALC271_FIXUP_DMIC] = {
7012 .type = HDA_FIXUP_FUNC,
7013 .v.func = alc271_fixup_dmic,
7015 [ALC269_FIXUP_PCM_44K] = {
7016 .type = HDA_FIXUP_FUNC,
7017 .v.func = alc269_fixup_pcm_44k,
7019 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7021 [ALC269_FIXUP_STEREO_DMIC] = {
7022 .type = HDA_FIXUP_FUNC,
7023 .v.func = alc269_fixup_stereo_dmic,
7025 [ALC269_FIXUP_HEADSET_MIC] = {
7026 .type = HDA_FIXUP_FUNC,
7027 .v.func = alc269_fixup_headset_mic,
7029 [ALC269_FIXUP_QUANTA_MUTE] = {
7030 .type = HDA_FIXUP_FUNC,
7031 .v.func = alc269_fixup_quanta_mute,
7033 [ALC269_FIXUP_LIFEBOOK] = {
7034 .type = HDA_FIXUP_PINS,
7035 .v.pins = (const struct hda_pintbl[]) {
7036 { 0x1a, 0x2101103f }, /* dock line-out */
7037 { 0x1b, 0x23a11040 }, /* dock mic-in */
7041 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7043 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7044 .type = HDA_FIXUP_PINS,
7045 .v.pins = (const struct hda_pintbl[]) {
7046 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7050 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7051 .type = HDA_FIXUP_PINS,
7052 .v.pins = (const struct hda_pintbl[]) {
7053 { 0x21, 0x0221102f }, /* HP out */
7057 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7058 .type = HDA_FIXUP_FUNC,
7059 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7061 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7062 .type = HDA_FIXUP_FUNC,
7063 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7065 [ALC269_FIXUP_AMIC] = {
7066 .type = HDA_FIXUP_PINS,
7067 .v.pins = (const struct hda_pintbl[]) {
7068 { 0x14, 0x99130110 }, /* speaker */
7069 { 0x15, 0x0121401f }, /* HP out */
7070 { 0x18, 0x01a19c20 }, /* mic */
7071 { 0x19, 0x99a3092f }, /* int-mic */
7075 [ALC269_FIXUP_DMIC] = {
7076 .type = HDA_FIXUP_PINS,
7077 .v.pins = (const struct hda_pintbl[]) {
7078 { 0x12, 0x99a3092f }, /* int-mic */
7079 { 0x14, 0x99130110 }, /* speaker */
7080 { 0x15, 0x0121401f }, /* HP out */
7081 { 0x18, 0x01a19c20 }, /* mic */
7085 [ALC269VB_FIXUP_AMIC] = {
7086 .type = HDA_FIXUP_PINS,
7087 .v.pins = (const struct hda_pintbl[]) {
7088 { 0x14, 0x99130110 }, /* speaker */
7089 { 0x18, 0x01a19c20 }, /* mic */
7090 { 0x19, 0x99a3092f }, /* int-mic */
7091 { 0x21, 0x0121401f }, /* HP out */
7095 [ALC269VB_FIXUP_DMIC] = {
7096 .type = HDA_FIXUP_PINS,
7097 .v.pins = (const struct hda_pintbl[]) {
7098 { 0x12, 0x99a3092f }, /* int-mic */
7099 { 0x14, 0x99130110 }, /* speaker */
7100 { 0x18, 0x01a19c20 }, /* mic */
7101 { 0x21, 0x0121401f }, /* HP out */
7105 [ALC269_FIXUP_HP_MUTE_LED] = {
7106 .type = HDA_FIXUP_FUNC,
7107 .v.func = alc269_fixup_hp_mute_led,
7109 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7110 .type = HDA_FIXUP_FUNC,
7111 .v.func = alc269_fixup_hp_mute_led_mic1,
7113 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7114 .type = HDA_FIXUP_FUNC,
7115 .v.func = alc269_fixup_hp_mute_led_mic2,
7117 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7118 .type = HDA_FIXUP_FUNC,
7119 .v.func = alc269_fixup_hp_mute_led_mic3,
7121 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7123 [ALC269_FIXUP_HP_GPIO_LED] = {
7124 .type = HDA_FIXUP_FUNC,
7125 .v.func = alc269_fixup_hp_gpio_led,
7127 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7128 .type = HDA_FIXUP_FUNC,
7129 .v.func = alc269_fixup_hp_gpio_mic1_led,
7131 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7132 .type = HDA_FIXUP_FUNC,
7133 .v.func = alc269_fixup_hp_line1_mic1_led,
7135 [ALC269_FIXUP_INV_DMIC] = {
7136 .type = HDA_FIXUP_FUNC,
7137 .v.func = alc_fixup_inv_dmic,
7139 [ALC269_FIXUP_NO_SHUTUP] = {
7140 .type = HDA_FIXUP_FUNC,
7141 .v.func = alc_fixup_no_shutup,
7143 [ALC269_FIXUP_LENOVO_DOCK] = {
7144 .type = HDA_FIXUP_PINS,
7145 .v.pins = (const struct hda_pintbl[]) {
7146 { 0x19, 0x23a11040 }, /* dock mic */
7147 { 0x1b, 0x2121103f }, /* dock headphone */
7151 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7153 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7154 .type = HDA_FIXUP_FUNC,
7155 .v.func = alc269_fixup_limit_int_mic_boost,
7157 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7159 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7160 .type = HDA_FIXUP_FUNC,
7161 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7163 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7165 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7166 .type = HDA_FIXUP_PINS,
7167 .v.pins = (const struct hda_pintbl[]) {
7168 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7169 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7173 .chain_id = ALC269_FIXUP_HEADSET_MODE
7175 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7176 .type = HDA_FIXUP_PINS,
7177 .v.pins = (const struct hda_pintbl[]) {
7178 { 0x16, 0x21014020 }, /* dock line out */
7179 { 0x19, 0x21a19030 }, /* dock mic */
7180 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7184 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7186 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7187 .type = HDA_FIXUP_PINS,
7188 .v.pins = (const struct hda_pintbl[]) {
7189 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7193 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7195 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7196 .type = HDA_FIXUP_PINS,
7197 .v.pins = (const struct hda_pintbl[]) {
7198 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7199 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7203 .chain_id = ALC269_FIXUP_HEADSET_MODE
7205 [ALC269_FIXUP_HEADSET_MODE] = {
7206 .type = HDA_FIXUP_FUNC,
7207 .v.func = alc_fixup_headset_mode,
7209 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7211 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7212 .type = HDA_FIXUP_FUNC,
7213 .v.func = alc_fixup_headset_mode_no_hp_mic,
7215 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7216 .type = HDA_FIXUP_PINS,
7217 .v.pins = (const struct hda_pintbl[]) {
7218 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7222 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7224 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7225 .type = HDA_FIXUP_PINS,
7226 .v.pins = (const struct hda_pintbl[]) {
7227 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7231 .chain_id = ALC269_FIXUP_HEADSET_MIC
7233 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7234 .type = HDA_FIXUP_PINS,
7235 .v.pins = (const struct hda_pintbl[]) {
7249 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7251 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7252 .type = HDA_FIXUP_FUNC,
7253 .v.func = alc298_fixup_huawei_mbx_stereo,
7255 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7257 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7258 .type = HDA_FIXUP_FUNC,
7259 .v.func = alc269_fixup_x101_headset_mic,
7261 [ALC269_FIXUP_ASUS_X101_VERB] = {
7262 .type = HDA_FIXUP_VERBS,
7263 .v.verbs = (const struct hda_verb[]) {
7264 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7265 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7266 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7270 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7272 [ALC269_FIXUP_ASUS_X101] = {
7273 .type = HDA_FIXUP_PINS,
7274 .v.pins = (const struct hda_pintbl[]) {
7275 { 0x18, 0x04a1182c }, /* Headset mic */
7279 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7281 [ALC271_FIXUP_AMIC_MIC2] = {
7282 .type = HDA_FIXUP_PINS,
7283 .v.pins = (const struct hda_pintbl[]) {
7284 { 0x14, 0x99130110 }, /* speaker */
7285 { 0x19, 0x01a19c20 }, /* mic */
7286 { 0x1b, 0x99a7012f }, /* int-mic */
7287 { 0x21, 0x0121401f }, /* HP out */
7291 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7292 .type = HDA_FIXUP_FUNC,
7293 .v.func = alc271_hp_gate_mic_jack,
7295 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7297 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7298 .type = HDA_FIXUP_FUNC,
7299 .v.func = alc269_fixup_limit_int_mic_boost,
7301 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7303 [ALC269_FIXUP_ACER_AC700] = {
7304 .type = HDA_FIXUP_PINS,
7305 .v.pins = (const struct hda_pintbl[]) {
7306 { 0x12, 0x99a3092f }, /* int-mic */
7307 { 0x14, 0x99130110 }, /* speaker */
7308 { 0x18, 0x03a11c20 }, /* mic */
7309 { 0x1e, 0x0346101e }, /* SPDIF1 */
7310 { 0x21, 0x0321101f }, /* HP out */
7314 .chain_id = ALC271_FIXUP_DMIC,
7316 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7317 .type = HDA_FIXUP_FUNC,
7318 .v.func = alc269_fixup_limit_int_mic_boost,
7320 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7322 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7323 .type = HDA_FIXUP_FUNC,
7324 .v.func = alc269_fixup_limit_int_mic_boost,
7326 .chain_id = ALC269VB_FIXUP_DMIC,
7328 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7329 .type = HDA_FIXUP_VERBS,
7330 .v.verbs = (const struct hda_verb[]) {
7331 /* class-D output amp +5dB */
7332 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7333 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7337 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7339 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7340 .type = HDA_FIXUP_FUNC,
7341 .v.func = alc269_fixup_limit_int_mic_boost,
7343 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7345 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7346 .type = HDA_FIXUP_PINS,
7347 .v.pins = (const struct hda_pintbl[]) {
7348 { 0x12, 0x99a3092f }, /* int-mic */
7349 { 0x18, 0x03a11d20 }, /* mic */
7350 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7354 [ALC283_FIXUP_CHROME_BOOK] = {
7355 .type = HDA_FIXUP_FUNC,
7356 .v.func = alc283_fixup_chromebook,
7358 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7359 .type = HDA_FIXUP_FUNC,
7360 .v.func = alc283_fixup_sense_combo_jack,
7362 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7364 [ALC282_FIXUP_ASUS_TX300] = {
7365 .type = HDA_FIXUP_FUNC,
7366 .v.func = alc282_fixup_asus_tx300,
7368 [ALC283_FIXUP_INT_MIC] = {
7369 .type = HDA_FIXUP_VERBS,
7370 .v.verbs = (const struct hda_verb[]) {
7371 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7372 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7376 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7378 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7379 .type = HDA_FIXUP_PINS,
7380 .v.pins = (const struct hda_pintbl[]) {
7381 { 0x17, 0x90170112 }, /* subwoofer */
7385 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7387 [ALC290_FIXUP_SUBWOOFER] = {
7388 .type = HDA_FIXUP_PINS,
7389 .v.pins = (const struct hda_pintbl[]) {
7390 { 0x17, 0x90170112 }, /* subwoofer */
7394 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7396 [ALC290_FIXUP_MONO_SPEAKERS] = {
7397 .type = HDA_FIXUP_FUNC,
7398 .v.func = alc290_fixup_mono_speakers,
7400 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7401 .type = HDA_FIXUP_FUNC,
7402 .v.func = alc290_fixup_mono_speakers,
7404 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7406 [ALC269_FIXUP_THINKPAD_ACPI] = {
7407 .type = HDA_FIXUP_FUNC,
7408 .v.func = alc_fixup_thinkpad_acpi,
7410 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7412 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7413 .type = HDA_FIXUP_FUNC,
7414 .v.func = alc_fixup_inv_dmic,
7416 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7418 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7419 .type = HDA_FIXUP_PINS,
7420 .v.pins = (const struct hda_pintbl[]) {
7421 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7425 .chain_id = ALC255_FIXUP_HEADSET_MODE
7427 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7428 .type = HDA_FIXUP_PINS,
7429 .v.pins = (const struct hda_pintbl[]) {
7430 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7434 .chain_id = ALC255_FIXUP_HEADSET_MODE
7436 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7437 .type = HDA_FIXUP_PINS,
7438 .v.pins = (const struct hda_pintbl[]) {
7439 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7440 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7444 .chain_id = ALC255_FIXUP_HEADSET_MODE
7446 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7447 .type = HDA_FIXUP_PINS,
7448 .v.pins = (const struct hda_pintbl[]) {
7449 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7453 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7455 [ALC255_FIXUP_HEADSET_MODE] = {
7456 .type = HDA_FIXUP_FUNC,
7457 .v.func = alc_fixup_headset_mode_alc255,
7459 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7461 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7462 .type = HDA_FIXUP_FUNC,
7463 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7465 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7466 .type = HDA_FIXUP_PINS,
7467 .v.pins = (const struct hda_pintbl[]) {
7468 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7469 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7473 .chain_id = ALC269_FIXUP_HEADSET_MODE
7475 [ALC292_FIXUP_TPT440_DOCK] = {
7476 .type = HDA_FIXUP_FUNC,
7477 .v.func = alc_fixup_tpt440_dock,
7479 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7481 [ALC292_FIXUP_TPT440] = {
7482 .type = HDA_FIXUP_FUNC,
7483 .v.func = alc_fixup_disable_aamix,
7485 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7487 [ALC283_FIXUP_HEADSET_MIC] = {
7488 .type = HDA_FIXUP_PINS,
7489 .v.pins = (const struct hda_pintbl[]) {
7490 { 0x19, 0x04a110f0 },
7494 [ALC255_FIXUP_MIC_MUTE_LED] = {
7495 .type = HDA_FIXUP_FUNC,
7496 .v.func = alc_fixup_micmute_led,
7498 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7499 .type = HDA_FIXUP_PINS,
7500 .v.pins = (const struct hda_pintbl[]) {
7501 { 0x12, 0x90a60130 },
7502 { 0x14, 0x90170110 },
7503 { 0x17, 0x40000008 },
7504 { 0x18, 0x411111f0 },
7505 { 0x19, 0x01a1913c },
7506 { 0x1a, 0x411111f0 },
7507 { 0x1b, 0x411111f0 },
7508 { 0x1d, 0x40f89b2d },
7509 { 0x1e, 0x411111f0 },
7510 { 0x21, 0x0321101f },
7514 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7515 .type = HDA_FIXUP_FUNC,
7516 .v.func = alc269vb_fixup_aspire_e1_coef,
7518 [ALC280_FIXUP_HP_GPIO4] = {
7519 .type = HDA_FIXUP_FUNC,
7520 .v.func = alc280_fixup_hp_gpio4,
7522 [ALC286_FIXUP_HP_GPIO_LED] = {
7523 .type = HDA_FIXUP_FUNC,
7524 .v.func = alc286_fixup_hp_gpio_led,
7526 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7527 .type = HDA_FIXUP_FUNC,
7528 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7530 [ALC280_FIXUP_HP_DOCK_PINS] = {
7531 .type = HDA_FIXUP_PINS,
7532 .v.pins = (const struct hda_pintbl[]) {
7533 { 0x1b, 0x21011020 }, /* line-out */
7534 { 0x1a, 0x01a1903c }, /* headset mic */
7535 { 0x18, 0x2181103f }, /* line-in */
7539 .chain_id = ALC280_FIXUP_HP_GPIO4
7541 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7542 .type = HDA_FIXUP_PINS,
7543 .v.pins = (const struct hda_pintbl[]) {
7544 { 0x1b, 0x21011020 }, /* line-out */
7545 { 0x18, 0x2181103f }, /* line-in */
7549 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7551 [ALC280_FIXUP_HP_9480M] = {
7552 .type = HDA_FIXUP_FUNC,
7553 .v.func = alc280_fixup_hp_9480m,
7555 [ALC245_FIXUP_HP_X360_AMP] = {
7556 .type = HDA_FIXUP_FUNC,
7557 .v.func = alc245_fixup_hp_x360_amp,
7559 .chain_id = ALC245_FIXUP_HP_GPIO_LED
7561 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7562 .type = HDA_FIXUP_FUNC,
7563 .v.func = alc_fixup_headset_mode_dell_alc288,
7565 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7567 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7568 .type = HDA_FIXUP_PINS,
7569 .v.pins = (const struct hda_pintbl[]) {
7570 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7571 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7575 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7577 [ALC288_FIXUP_DISABLE_AAMIX] = {
7578 .type = HDA_FIXUP_FUNC,
7579 .v.func = alc_fixup_disable_aamix,
7581 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7583 [ALC288_FIXUP_DELL_XPS_13] = {
7584 .type = HDA_FIXUP_FUNC,
7585 .v.func = alc_fixup_dell_xps13,
7587 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7589 [ALC292_FIXUP_DISABLE_AAMIX] = {
7590 .type = HDA_FIXUP_FUNC,
7591 .v.func = alc_fixup_disable_aamix,
7593 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7595 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7596 .type = HDA_FIXUP_FUNC,
7597 .v.func = alc_fixup_disable_aamix,
7599 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7601 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7602 .type = HDA_FIXUP_FUNC,
7603 .v.func = alc_fixup_dell_xps13,
7605 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7607 [ALC292_FIXUP_DELL_E7X] = {
7608 .type = HDA_FIXUP_FUNC,
7609 .v.func = alc_fixup_micmute_led,
7610 /* micmute fixup must be applied at last */
7611 .chained_before = true,
7612 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7614 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7615 .type = HDA_FIXUP_PINS,
7616 .v.pins = (const struct hda_pintbl[]) {
7617 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7620 .chained_before = true,
7621 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7623 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7624 .type = HDA_FIXUP_PINS,
7625 .v.pins = (const struct hda_pintbl[]) {
7626 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7627 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7631 .chain_id = ALC269_FIXUP_HEADSET_MODE
7633 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7634 .type = HDA_FIXUP_PINS,
7635 .v.pins = (const struct hda_pintbl[]) {
7636 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7640 .chain_id = ALC269_FIXUP_HEADSET_MODE
7642 [ALC275_FIXUP_DELL_XPS] = {
7643 .type = HDA_FIXUP_VERBS,
7644 .v.verbs = (const struct hda_verb[]) {
7645 /* Enables internal speaker */
7646 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7647 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7648 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7649 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7653 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7654 .type = HDA_FIXUP_FUNC,
7655 .v.func = alc_fixup_disable_aamix,
7657 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7659 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7660 .type = HDA_FIXUP_FUNC,
7661 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7663 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7664 .type = HDA_FIXUP_FUNC,
7665 .v.func = alc_fixup_inv_dmic,
7667 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7669 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7670 .type = HDA_FIXUP_FUNC,
7671 .v.func = alc269_fixup_limit_int_mic_boost
7673 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7674 .type = HDA_FIXUP_FUNC,
7675 .v.func = alc_fixup_disable_aamix,
7677 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7679 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7680 .type = HDA_FIXUP_FUNC,
7681 .v.func = alc_fixup_disable_mic_vref,
7683 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7685 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7686 .type = HDA_FIXUP_VERBS,
7687 .v.verbs = (const struct hda_verb[]) {
7688 /* Disable pass-through path for FRONT 14h */
7689 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7690 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7694 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7696 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7697 .type = HDA_FIXUP_FUNC,
7698 .v.func = alc_fixup_disable_aamix,
7700 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7702 [ALC221_FIXUP_HP_FRONT_MIC] = {
7703 .type = HDA_FIXUP_PINS,
7704 .v.pins = (const struct hda_pintbl[]) {
7705 { 0x19, 0x02a19020 }, /* Front Mic */
7709 [ALC292_FIXUP_TPT460] = {
7710 .type = HDA_FIXUP_FUNC,
7711 .v.func = alc_fixup_tpt440_dock,
7713 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7715 [ALC298_FIXUP_SPK_VOLUME] = {
7716 .type = HDA_FIXUP_FUNC,
7717 .v.func = alc298_fixup_speaker_volume,
7719 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7721 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7722 .type = HDA_FIXUP_FUNC,
7723 .v.func = alc298_fixup_speaker_volume,
7725 [ALC295_FIXUP_DISABLE_DAC3] = {
7726 .type = HDA_FIXUP_FUNC,
7727 .v.func = alc295_fixup_disable_dac3,
7729 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7730 .type = HDA_FIXUP_FUNC,
7731 .v.func = alc285_fixup_speaker2_to_dac1,
7733 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7735 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7736 .type = HDA_FIXUP_PINS,
7737 .v.pins = (const struct hda_pintbl[]) {
7738 { 0x1b, 0x90170151 },
7742 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7744 [ALC269_FIXUP_ATIV_BOOK_8] = {
7745 .type = HDA_FIXUP_FUNC,
7746 .v.func = alc_fixup_auto_mute_via_amp,
7748 .chain_id = ALC269_FIXUP_NO_SHUTUP
7750 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7751 .type = HDA_FIXUP_PINS,
7752 .v.pins = (const struct hda_pintbl[]) {
7753 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7754 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7758 .chain_id = ALC269_FIXUP_HEADSET_MODE
7760 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7761 .type = HDA_FIXUP_FUNC,
7762 .v.func = alc_fixup_headset_mode,
7764 [ALC256_FIXUP_ASUS_MIC] = {
7765 .type = HDA_FIXUP_PINS,
7766 .v.pins = (const struct hda_pintbl[]) {
7767 { 0x13, 0x90a60160 }, /* use as internal mic */
7768 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7772 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7774 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7775 .type = HDA_FIXUP_FUNC,
7776 /* Set up GPIO2 for the speaker amp */
7777 .v.func = alc_fixup_gpio4,
7779 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7780 .type = HDA_FIXUP_PINS,
7781 .v.pins = (const struct hda_pintbl[]) {
7782 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7786 .chain_id = ALC269_FIXUP_HEADSET_MIC
7788 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7789 .type = HDA_FIXUP_VERBS,
7790 .v.verbs = (const struct hda_verb[]) {
7791 /* Enables internal speaker */
7792 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7793 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7797 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7799 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7800 .type = HDA_FIXUP_FUNC,
7801 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7803 .chain_id = ALC269_FIXUP_GPIO2
7805 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7806 .type = HDA_FIXUP_VERBS,
7807 .v.verbs = (const struct hda_verb[]) {
7808 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7809 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7813 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7815 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7816 .type = HDA_FIXUP_PINS,
7817 .v.pins = (const struct hda_pintbl[]) {
7818 /* Change the mic location from front to right, otherwise there are
7819 two front mics with the same name, pulseaudio can't handle them.
7820 This is just a temporary workaround, after applying this fixup,
7821 there will be one "Front Mic" and one "Mic" in this machine.
7823 { 0x1a, 0x04a19040 },
7827 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7828 .type = HDA_FIXUP_PINS,
7829 .v.pins = (const struct hda_pintbl[]) {
7830 { 0x16, 0x0101102f }, /* Rear Headset HP */
7831 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7832 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7833 { 0x1b, 0x02011020 },
7837 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7839 [ALC225_FIXUP_S3_POP_NOISE] = {
7840 .type = HDA_FIXUP_FUNC,
7841 .v.func = alc225_fixup_s3_pop_noise,
7843 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7845 [ALC700_FIXUP_INTEL_REFERENCE] = {
7846 .type = HDA_FIXUP_VERBS,
7847 .v.verbs = (const struct hda_verb[]) {
7848 /* Enables internal speaker */
7849 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7850 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7851 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7852 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7853 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7854 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7855 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7856 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7860 [ALC274_FIXUP_DELL_BIND_DACS] = {
7861 .type = HDA_FIXUP_FUNC,
7862 .v.func = alc274_fixup_bind_dacs,
7864 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7866 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7867 .type = HDA_FIXUP_PINS,
7868 .v.pins = (const struct hda_pintbl[]) {
7869 { 0x1b, 0x0401102f },
7873 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7875 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7876 .type = HDA_FIXUP_FUNC,
7877 .v.func = alc_fixup_tpt470_dock,
7879 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7881 [ALC298_FIXUP_TPT470_DOCK] = {
7882 .type = HDA_FIXUP_FUNC,
7883 .v.func = alc_fixup_tpt470_dacs,
7885 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7887 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7888 .type = HDA_FIXUP_PINS,
7889 .v.pins = (const struct hda_pintbl[]) {
7890 { 0x14, 0x0201101f },
7894 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7896 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7897 .type = HDA_FIXUP_PINS,
7898 .v.pins = (const struct hda_pintbl[]) {
7899 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7903 .chain_id = ALC269_FIXUP_HEADSET_MIC
7905 [ALC295_FIXUP_HP_X360] = {
7906 .type = HDA_FIXUP_FUNC,
7907 .v.func = alc295_fixup_hp_top_speakers,
7909 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7911 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7912 .type = HDA_FIXUP_PINS,
7913 .v.pins = (const struct hda_pintbl[]) {
7914 { 0x19, 0x0181313f},
7918 .chain_id = ALC269_FIXUP_HEADSET_MIC
7920 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7921 .type = HDA_FIXUP_FUNC,
7922 .v.func = alc285_fixup_invalidate_dacs,
7924 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7926 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7927 .type = HDA_FIXUP_FUNC,
7928 .v.func = alc_fixup_auto_mute_via_amp,
7930 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7931 .type = HDA_FIXUP_PINS,
7932 .v.pins = (const struct hda_pintbl[]) {
7933 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7937 .chain_id = ALC269_FIXUP_HEADSET_MIC
7939 [ALC294_FIXUP_ASUS_MIC] = {
7940 .type = HDA_FIXUP_PINS,
7941 .v.pins = (const struct hda_pintbl[]) {
7942 { 0x13, 0x90a60160 }, /* use as internal mic */
7943 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7947 .chain_id = ALC269_FIXUP_HEADSET_MIC
7949 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7950 .type = HDA_FIXUP_PINS,
7951 .v.pins = (const struct hda_pintbl[]) {
7952 { 0x19, 0x01a1103c }, /* use as headset mic */
7956 .chain_id = ALC269_FIXUP_HEADSET_MIC
7958 [ALC294_FIXUP_ASUS_SPK] = {
7959 .type = HDA_FIXUP_VERBS,
7960 .v.verbs = (const struct hda_verb[]) {
7962 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7963 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7964 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7965 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7969 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7971 [ALC295_FIXUP_CHROME_BOOK] = {
7972 .type = HDA_FIXUP_FUNC,
7973 .v.func = alc295_fixup_chromebook,
7975 .chain_id = ALC225_FIXUP_HEADSET_JACK
7977 [ALC225_FIXUP_HEADSET_JACK] = {
7978 .type = HDA_FIXUP_FUNC,
7979 .v.func = alc_fixup_headset_jack,
7981 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7982 .type = HDA_FIXUP_PINS,
7983 .v.pins = (const struct hda_pintbl[]) {
7984 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7988 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7990 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7991 .type = HDA_FIXUP_VERBS,
7992 .v.verbs = (const struct hda_verb[]) {
7993 /* Disable PCBEEP-IN passthrough */
7994 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7995 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7999 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8001 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8002 .type = HDA_FIXUP_PINS,
8003 .v.pins = (const struct hda_pintbl[]) {
8004 { 0x19, 0x03a11130 },
8005 { 0x1a, 0x90a60140 }, /* use as internal mic */
8009 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8011 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8012 .type = HDA_FIXUP_PINS,
8013 .v.pins = (const struct hda_pintbl[]) {
8014 { 0x16, 0x01011020 }, /* Rear Line out */
8015 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8019 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8021 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8022 .type = HDA_FIXUP_FUNC,
8023 .v.func = alc_fixup_auto_mute_via_amp,
8025 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8027 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8028 .type = HDA_FIXUP_FUNC,
8029 .v.func = alc_fixup_disable_mic_vref,
8031 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8033 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8034 .type = HDA_FIXUP_VERBS,
8035 .v.verbs = (const struct hda_verb[]) {
8036 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8037 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8041 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8043 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8044 .type = HDA_FIXUP_PINS,
8045 .v.pins = (const struct hda_pintbl[]) {
8046 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8050 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8052 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8053 .type = HDA_FIXUP_PINS,
8054 .v.pins = (const struct hda_pintbl[]) {
8055 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8059 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8061 [ALC299_FIXUP_PREDATOR_SPK] = {
8062 .type = HDA_FIXUP_PINS,
8063 .v.pins = (const struct hda_pintbl[]) {
8064 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8068 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8069 .type = HDA_FIXUP_PINS,
8070 .v.pins = (const struct hda_pintbl[]) {
8071 { 0x19, 0x04a11040 },
8072 { 0x21, 0x04211020 },
8076 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8078 [ALC289_FIXUP_DELL_SPK2] = {
8079 .type = HDA_FIXUP_PINS,
8080 .v.pins = (const struct hda_pintbl[]) {
8081 { 0x17, 0x90170130 }, /* bass spk */
8085 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8087 [ALC289_FIXUP_DUAL_SPK] = {
8088 .type = HDA_FIXUP_FUNC,
8089 .v.func = alc285_fixup_speaker2_to_dac1,
8091 .chain_id = ALC289_FIXUP_DELL_SPK2
8093 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8094 .type = HDA_FIXUP_FUNC,
8095 .v.func = alc285_fixup_speaker2_to_dac1,
8097 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8099 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
8100 .type = HDA_FIXUP_FUNC,
8101 /* The GPIO must be pulled to initialize the AMP */
8102 .v.func = alc_fixup_gpio4,
8104 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8106 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8107 .type = HDA_FIXUP_FUNC,
8108 .v.func = alc285_fixup_thinkpad_x1_gen7,
8110 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8112 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8113 .type = HDA_FIXUP_FUNC,
8114 .v.func = alc_fixup_headset_jack,
8116 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8118 [ALC294_FIXUP_ASUS_HPE] = {
8119 .type = HDA_FIXUP_VERBS,
8120 .v.verbs = (const struct hda_verb[]) {
8122 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8123 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8127 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8129 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8130 .type = HDA_FIXUP_PINS,
8131 .v.pins = (const struct hda_pintbl[]) {
8132 { 0x19, 0x03a11050 }, /* front HP mic */
8133 { 0x1a, 0x01a11830 }, /* rear external mic */
8134 { 0x21, 0x03211020 }, /* front HP out */
8138 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8140 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8141 .type = HDA_FIXUP_VERBS,
8142 .v.verbs = (const struct hda_verb[]) {
8143 /* set 0x15 to HP-OUT ctrl */
8144 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8145 /* unmute the 0x15 amp */
8146 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8150 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8152 [ALC294_FIXUP_ASUS_GX502_HP] = {
8153 .type = HDA_FIXUP_FUNC,
8154 .v.func = alc294_fixup_gx502_hp,
8156 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8157 .type = HDA_FIXUP_PINS,
8158 .v.pins = (const struct hda_pintbl[]) {
8159 { 0x19, 0x01a11050 }, /* rear HP mic */
8160 { 0x1a, 0x01a11830 }, /* rear external mic */
8161 { 0x21, 0x012110f0 }, /* rear HP out */
8165 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8167 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8168 .type = HDA_FIXUP_VERBS,
8169 .v.verbs = (const struct hda_verb[]) {
8170 /* set 0x15 to HP-OUT ctrl */
8171 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8172 /* unmute the 0x15 amp */
8173 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8174 /* set 0x1b to HP-OUT */
8175 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8179 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8181 [ALC294_FIXUP_ASUS_GU502_HP] = {
8182 .type = HDA_FIXUP_FUNC,
8183 .v.func = alc294_fixup_gu502_hp,
8185 [ALC294_FIXUP_ASUS_COEF_1B] = {
8186 .type = HDA_FIXUP_VERBS,
8187 .v.verbs = (const struct hda_verb[]) {
8188 /* Set bit 10 to correct noisy output after reboot from
8189 * Windows 10 (due to pop noise reduction?)
8191 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8192 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8196 .chain_id = ALC289_FIXUP_ASUS_GA401,
8198 [ALC285_FIXUP_HP_GPIO_LED] = {
8199 .type = HDA_FIXUP_FUNC,
8200 .v.func = alc285_fixup_hp_gpio_led,
8202 [ALC285_FIXUP_HP_MUTE_LED] = {
8203 .type = HDA_FIXUP_FUNC,
8204 .v.func = alc285_fixup_hp_mute_led,
8206 [ALC236_FIXUP_HP_GPIO_LED] = {
8207 .type = HDA_FIXUP_FUNC,
8208 .v.func = alc236_fixup_hp_gpio_led,
8210 [ALC236_FIXUP_HP_MUTE_LED] = {
8211 .type = HDA_FIXUP_FUNC,
8212 .v.func = alc236_fixup_hp_mute_led,
8214 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8215 .type = HDA_FIXUP_FUNC,
8216 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8218 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8219 .type = HDA_FIXUP_VERBS,
8220 .v.verbs = (const struct hda_verb[]) {
8221 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8225 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8226 .type = HDA_FIXUP_PINS,
8227 .v.pins = (const struct hda_pintbl[]) {
8228 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8232 .chain_id = ALC269_FIXUP_HEADSET_MODE
8234 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8235 .type = HDA_FIXUP_PINS,
8236 .v.pins = (const struct hda_pintbl[]) {
8237 { 0x14, 0x90100120 }, /* use as internal speaker */
8238 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8239 { 0x1a, 0x01011020 }, /* use as line out */
8243 .chain_id = ALC269_FIXUP_HEADSET_MIC
8245 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8246 .type = HDA_FIXUP_PINS,
8247 .v.pins = (const struct hda_pintbl[]) {
8248 { 0x18, 0x02a11030 }, /* use as headset mic */
8252 .chain_id = ALC269_FIXUP_HEADSET_MIC
8254 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8255 .type = HDA_FIXUP_PINS,
8256 .v.pins = (const struct hda_pintbl[]) {
8257 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8261 .chain_id = ALC269_FIXUP_HEADSET_MIC
8263 [ALC289_FIXUP_ASUS_GA401] = {
8264 .type = HDA_FIXUP_FUNC,
8265 .v.func = alc289_fixup_asus_ga401,
8267 .chain_id = ALC289_FIXUP_ASUS_GA502,
8269 [ALC289_FIXUP_ASUS_GA502] = {
8270 .type = HDA_FIXUP_PINS,
8271 .v.pins = (const struct hda_pintbl[]) {
8272 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8276 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8277 .type = HDA_FIXUP_PINS,
8278 .v.pins = (const struct hda_pintbl[]) {
8279 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8283 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8285 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8286 .type = HDA_FIXUP_FUNC,
8287 .v.func = alc285_fixup_hp_gpio_amp_init,
8289 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8291 [ALC269_FIXUP_CZC_B20] = {
8292 .type = HDA_FIXUP_PINS,
8293 .v.pins = (const struct hda_pintbl[]) {
8294 { 0x12, 0x411111f0 },
8295 { 0x14, 0x90170110 }, /* speaker */
8296 { 0x15, 0x032f1020 }, /* HP out */
8297 { 0x17, 0x411111f0 },
8298 { 0x18, 0x03ab1040 }, /* mic */
8299 { 0x19, 0xb7a7013f },
8300 { 0x1a, 0x0181305f },
8301 { 0x1b, 0x411111f0 },
8302 { 0x1d, 0x411111f0 },
8303 { 0x1e, 0x411111f0 },
8306 .chain_id = ALC269_FIXUP_DMIC,
8308 [ALC269_FIXUP_CZC_TMI] = {
8309 .type = HDA_FIXUP_PINS,
8310 .v.pins = (const struct hda_pintbl[]) {
8311 { 0x12, 0x4000c000 },
8312 { 0x14, 0x90170110 }, /* speaker */
8313 { 0x15, 0x0421401f }, /* HP out */
8314 { 0x17, 0x411111f0 },
8315 { 0x18, 0x04a19020 }, /* mic */
8316 { 0x19, 0x411111f0 },
8317 { 0x1a, 0x411111f0 },
8318 { 0x1b, 0x411111f0 },
8319 { 0x1d, 0x40448505 },
8320 { 0x1e, 0x411111f0 },
8321 { 0x20, 0x8000ffff },
8324 .chain_id = ALC269_FIXUP_DMIC,
8326 [ALC269_FIXUP_CZC_L101] = {
8327 .type = HDA_FIXUP_PINS,
8328 .v.pins = (const struct hda_pintbl[]) {
8329 { 0x12, 0x40000000 },
8330 { 0x14, 0x01014010 }, /* speaker */
8331 { 0x15, 0x411111f0 }, /* HP out */
8332 { 0x16, 0x411111f0 },
8333 { 0x18, 0x01a19020 }, /* mic */
8334 { 0x19, 0x02a19021 },
8335 { 0x1a, 0x0181302f },
8336 { 0x1b, 0x0221401f },
8337 { 0x1c, 0x411111f0 },
8338 { 0x1d, 0x4044c601 },
8339 { 0x1e, 0x411111f0 },
8342 .chain_id = ALC269_FIXUP_DMIC,
8344 [ALC269_FIXUP_LEMOTE_A1802] = {
8345 .type = HDA_FIXUP_PINS,
8346 .v.pins = (const struct hda_pintbl[]) {
8347 { 0x12, 0x40000000 },
8348 { 0x14, 0x90170110 }, /* speaker */
8349 { 0x17, 0x411111f0 },
8350 { 0x18, 0x03a19040 }, /* mic1 */
8351 { 0x19, 0x90a70130 }, /* mic2 */
8352 { 0x1a, 0x411111f0 },
8353 { 0x1b, 0x411111f0 },
8354 { 0x1d, 0x40489d2d },
8355 { 0x1e, 0x411111f0 },
8356 { 0x20, 0x0003ffff },
8357 { 0x21, 0x03214020 },
8360 .chain_id = ALC269_FIXUP_DMIC,
8362 [ALC269_FIXUP_LEMOTE_A190X] = {
8363 .type = HDA_FIXUP_PINS,
8364 .v.pins = (const struct hda_pintbl[]) {
8365 { 0x14, 0x99130110 }, /* speaker */
8366 { 0x15, 0x0121401f }, /* HP out */
8367 { 0x18, 0x01a19c20 }, /* rear mic */
8368 { 0x19, 0x99a3092f }, /* front mic */
8369 { 0x1b, 0x0201401f }, /* front lineout */
8372 .chain_id = ALC269_FIXUP_DMIC,
8374 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8375 .type = HDA_FIXUP_PINS,
8376 .v.pins = (const struct hda_pintbl[]) {
8377 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8381 .chain_id = ALC269_FIXUP_HEADSET_MODE
8383 [ALC256_FIXUP_INTEL_NUC10] = {
8384 .type = HDA_FIXUP_PINS,
8385 .v.pins = (const struct hda_pintbl[]) {
8386 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8390 .chain_id = ALC269_FIXUP_HEADSET_MODE
8392 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8393 .type = HDA_FIXUP_VERBS,
8394 .v.verbs = (const struct hda_verb[]) {
8395 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8396 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8400 .chain_id = ALC289_FIXUP_ASUS_GA502
8402 [ALC274_FIXUP_HP_MIC] = {
8403 .type = HDA_FIXUP_VERBS,
8404 .v.verbs = (const struct hda_verb[]) {
8405 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8406 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8410 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8411 .type = HDA_FIXUP_FUNC,
8412 .v.func = alc274_fixup_hp_headset_mic,
8414 .chain_id = ALC274_FIXUP_HP_MIC
8416 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8417 .type = HDA_FIXUP_FUNC,
8418 .v.func = alc274_fixup_hp_envy_gpio,
8420 [ALC256_FIXUP_ASUS_HPE] = {
8421 .type = HDA_FIXUP_VERBS,
8422 .v.verbs = (const struct hda_verb[]) {
8424 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8425 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8429 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8431 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8432 .type = HDA_FIXUP_FUNC,
8433 .v.func = alc_fixup_headset_jack,
8435 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8437 [ALC287_FIXUP_HP_GPIO_LED] = {
8438 .type = HDA_FIXUP_FUNC,
8439 .v.func = alc287_fixup_hp_gpio_led,
8441 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8442 .type = HDA_FIXUP_FUNC,
8443 .v.func = alc274_fixup_hp_headset_mic,
8445 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8446 .type = HDA_FIXUP_FUNC,
8447 .v.func = alc_fixup_no_int_mic,
8449 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8451 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8452 .type = HDA_FIXUP_PINS,
8453 .v.pins = (const struct hda_pintbl[]) {
8454 { 0x1b, 0x411111f0 },
8455 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8459 .chain_id = ALC269_FIXUP_HEADSET_MODE
8461 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8462 .type = HDA_FIXUP_FUNC,
8463 .v.func = alc269_fixup_limit_int_mic_boost,
8465 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8467 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8468 .type = HDA_FIXUP_PINS,
8469 .v.pins = (const struct hda_pintbl[]) {
8470 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8471 { 0x1a, 0x90a1092f }, /* use as internal mic */
8475 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8477 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8478 .type = HDA_FIXUP_FUNC,
8479 .v.func = alc285_fixup_ideapad_s740_coef,
8481 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8483 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8484 .type = HDA_FIXUP_FUNC,
8485 .v.func = alc269_fixup_limit_int_mic_boost,
8487 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8489 [ALC295_FIXUP_ASUS_DACS] = {
8490 .type = HDA_FIXUP_FUNC,
8491 .v.func = alc295_fixup_asus_dacs,
8493 [ALC295_FIXUP_HP_OMEN] = {
8494 .type = HDA_FIXUP_PINS,
8495 .v.pins = (const struct hda_pintbl[]) {
8496 { 0x12, 0xb7a60130 },
8497 { 0x13, 0x40000000 },
8498 { 0x14, 0x411111f0 },
8499 { 0x16, 0x411111f0 },
8500 { 0x17, 0x90170110 },
8501 { 0x18, 0x411111f0 },
8502 { 0x19, 0x02a11030 },
8503 { 0x1a, 0x411111f0 },
8504 { 0x1b, 0x04a19030 },
8505 { 0x1d, 0x40600001 },
8506 { 0x1e, 0x411111f0 },
8507 { 0x21, 0x03211020 },
8511 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8513 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8514 .type = HDA_FIXUP_FUNC,
8515 .v.func = alc285_fixup_hp_spectre_x360,
8517 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8518 .type = HDA_FIXUP_FUNC,
8519 .v.func = alc285_fixup_hp_spectre_x360_eb1
8521 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8522 .type = HDA_FIXUP_FUNC,
8523 .v.func = alc285_fixup_ideapad_s740_coef,
8525 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8527 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8528 .type = HDA_FIXUP_FUNC,
8529 .v.func = alc_fixup_no_shutup,
8531 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8533 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8534 .type = HDA_FIXUP_PINS,
8535 .v.pins = (const struct hda_pintbl[]) {
8536 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8540 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8542 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8543 .type = HDA_FIXUP_FUNC,
8544 .v.func = alc269_fixup_limit_int_mic_boost,
8546 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8548 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8549 .type = HDA_FIXUP_FUNC,
8550 .v.func = alc285_fixup_ideapad_s740_coef,
8552 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8554 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8555 .type = HDA_FIXUP_FUNC,
8556 .v.func = alc287_fixup_legion_15imhg05_speakers,
8558 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8560 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8561 .type = HDA_FIXUP_VERBS,
8562 //.v.verbs = legion_15imhg05_coefs,
8563 .v.verbs = (const struct hda_verb[]) {
8564 // set left speaker Legion 7i.
8565 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8566 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8568 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8569 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8570 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8571 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8572 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8574 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8575 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8576 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8577 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8578 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8580 // set right speaker Legion 7i.
8581 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8582 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8584 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8585 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8586 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8587 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8588 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8590 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8591 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8592 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8593 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8594 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8598 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8600 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8601 .type = HDA_FIXUP_FUNC,
8602 .v.func = alc287_fixup_legion_15imhg05_speakers,
8604 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8606 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8607 .type = HDA_FIXUP_VERBS,
8608 .v.verbs = (const struct hda_verb[]) {
8609 // set left speaker Yoga 7i.
8610 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8611 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8613 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8614 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8615 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8616 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8617 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8619 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8620 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8621 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8622 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8623 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8625 // set right speaker Yoga 7i.
8626 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8627 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8629 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8630 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8631 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8632 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8633 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8635 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8636 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8637 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8638 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8639 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8643 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8645 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8646 .type = HDA_FIXUP_VERBS,
8647 .v.verbs = (const struct hda_verb[]) {
8648 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8649 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8650 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8651 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8652 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8653 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8654 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8655 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8656 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8657 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8658 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8659 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8660 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8661 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8665 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8667 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
8668 .type = HDA_FIXUP_FUNC,
8669 .v.func = alc256_fixup_set_coef_defaults,
8671 [ALC245_FIXUP_HP_GPIO_LED] = {
8672 .type = HDA_FIXUP_FUNC,
8673 .v.func = alc245_fixup_hp_gpio_led,
8675 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8676 .type = HDA_FIXUP_PINS,
8677 .v.pins = (const struct hda_pintbl[]) {
8678 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8682 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8684 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8685 .type = HDA_FIXUP_FUNC,
8686 .v.func = alc233_fixup_no_audio_jack,
8688 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8689 .type = HDA_FIXUP_FUNC,
8690 .v.func = alc256_fixup_mic_no_presence_and_resume,
8692 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8694 [ALC287_FIXUP_LEGION_16ACHG6] = {
8695 .type = HDA_FIXUP_FUNC,
8696 .v.func = alc287_fixup_legion_16achg6_speakers,
8698 [ALC287_FIXUP_CS35L41_I2C_2] = {
8699 .type = HDA_FIXUP_FUNC,
8700 .v.func = cs35l41_fixup_i2c_two,
8702 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
8703 .type = HDA_FIXUP_VERBS,
8704 .v.verbs = (const struct hda_verb[]) {
8705 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
8706 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
8710 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8714 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8715 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8716 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8717 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8718 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8719 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8720 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8721 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8722 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8723 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8724 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8725 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8726 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8727 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8728 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8729 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8730 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8731 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8732 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8733 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8734 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8735 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8736 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8737 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8738 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8739 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8740 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8741 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8742 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8743 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8744 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8745 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8746 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8747 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8748 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8749 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8750 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8751 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8752 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8753 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8754 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8755 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8756 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8757 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8758 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8759 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8760 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8761 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8762 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8763 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8764 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8765 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8766 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8767 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8768 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8769 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8770 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8771 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8772 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8773 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8774 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8775 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8776 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8777 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8778 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8779 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8780 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8781 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8782 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8783 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8784 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8785 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8786 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8787 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8788 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8789 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8790 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8791 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8792 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8793 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8794 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8795 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8796 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8797 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8798 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8799 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8800 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8801 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8802 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8803 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8804 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
8805 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8806 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8807 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8808 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8809 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8810 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8811 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8812 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8813 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8814 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8815 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8816 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8817 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8818 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8819 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8820 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8821 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8822 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8823 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8824 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8825 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8826 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8827 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8828 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8829 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8830 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8831 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8832 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8833 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8834 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8835 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8836 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8837 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8838 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8839 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8840 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8841 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8842 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8843 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8844 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8845 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8846 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8847 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8848 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8849 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8850 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8851 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8852 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8853 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8854 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8855 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8856 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8857 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8858 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8859 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8860 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8861 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8862 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8863 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8864 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8865 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8866 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8867 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8868 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8869 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8870 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8871 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8872 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8873 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8874 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8875 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8876 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8877 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8878 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8879 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8880 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8881 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8882 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8883 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8884 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8885 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
8886 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8887 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8888 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
8889 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
8890 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
8891 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8892 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8893 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8894 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
8895 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
8896 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8897 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8898 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8899 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8900 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8901 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
8902 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
8903 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8904 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8905 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8906 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8907 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8908 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
8909 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8910 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8911 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8912 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8913 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8914 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8915 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8916 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8917 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8918 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8919 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8920 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8921 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8922 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8923 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8924 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
8925 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
8926 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
8927 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8928 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
8929 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
8930 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8931 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8932 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
8933 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8934 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
8935 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8936 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8937 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8938 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8939 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8940 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
8941 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8942 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8943 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
8944 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
8945 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
8946 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
8947 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
8948 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8949 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
8950 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
8951 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
8952 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8953 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
8954 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
8955 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
8956 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
8957 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8958 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
8959 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
8960 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
8961 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
8962 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
8963 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
8964 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8965 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8966 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
8967 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
8968 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
8969 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
8970 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
8971 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8972 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
8973 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8974 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8975 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8976 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8977 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
8978 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8979 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8980 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8981 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
8982 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8983 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8984 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
8985 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
8986 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8987 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
8988 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8989 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
8990 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
8991 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8992 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8993 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8994 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8995 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
8996 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
8997 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8998 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8999 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9000 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9001 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
9002 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9003 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9004 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9005 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
9006 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
9007 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
9008 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9009 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9010 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9011 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9012 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9013 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9014 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9015 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9016 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9017 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9018 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9019 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9020 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9021 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9022 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9023 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9024 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9025 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9026 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9027 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9028 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9029 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9030 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9031 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9032 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9033 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9034 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9035 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9036 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9037 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9038 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9039 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9040 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9041 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9042 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9043 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9044 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9045 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9046 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9047 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9048 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9049 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9050 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9051 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9052 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
9053 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9054 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9055 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
9056 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9057 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9058 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9059 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9060 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9061 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9062 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9063 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9064 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9065 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9066 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9067 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9068 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9069 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9070 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9071 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
9072 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9073 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9074 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9075 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9076 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9077 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
9078 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
9079 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
9080 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
9081 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
9082 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
9083 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9084 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
9085 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
9086 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
9087 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
9088 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
9089 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
9090 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9091 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
9092 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
9093 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
9094 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9095 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9096 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
9097 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
9098 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9099 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9100 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9101 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
9102 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9103 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9104 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9105 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9106 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9107 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9108 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9109 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9110 SND_PCI_QUIRK(0x17aa, 0x22f1, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9111 SND_PCI_QUIRK(0x17aa, 0x22f2, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9112 SND_PCI_QUIRK(0x17aa, 0x22f3, "Thinkpad", ALC287_FIXUP_CS35L41_I2C_2),
9113 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9114 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9115 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9116 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9117 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9118 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9119 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9120 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9121 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9122 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9123 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9124 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9125 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
9126 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
9127 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9128 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
9129 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9130 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
9131 SND_PCI_QUIRK(0x17aa, 0x3847, "Legion 7 16ACHG6", ALC287_FIXUP_LEGION_16ACHG6),
9132 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9133 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9134 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9135 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9136 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
9137 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9138 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
9139 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9140 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
9141 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
9142 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9143 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
9144 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
9145 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
9146 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
9147 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
9148 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9149 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
9150 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
9151 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9152 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9153 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9154 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9155 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9156 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9157 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
9158 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
9159 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
9160 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9161 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9162 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
9163 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
9164 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9165 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
9166 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
9167 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9168 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
9169 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9170 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9171 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
9172 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
9173 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9176 /* Below is a quirk table taken from the old code.
9177 * Basically the device should work as is without the fixup table.
9178 * If BIOS doesn't give a proper info, enable the corresponding
9181 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9183 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9184 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9185 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9186 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9187 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9188 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9189 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9190 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9191 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9192 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9193 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9194 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9195 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9196 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9197 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9198 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9199 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9200 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9201 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9202 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9203 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9204 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9205 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9206 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9207 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9208 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9209 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9210 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9211 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9212 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9213 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9214 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9215 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9216 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9217 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9218 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9219 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9220 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9221 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9226 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9227 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9228 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9229 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9230 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9231 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9235 static const struct hda_model_fixup alc269_fixup_models[] = {
9236 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9237 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9238 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9239 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9240 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9241 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9242 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9243 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9244 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9245 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9246 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9247 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9248 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9249 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9250 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9251 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9252 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9253 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9254 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9255 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9256 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9257 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9258 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9259 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9260 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9261 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9262 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9263 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9264 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9265 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9266 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9267 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9268 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9269 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9270 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9271 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9272 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9273 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9274 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9275 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9276 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9277 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9278 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9279 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9280 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9281 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9282 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9283 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9284 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9285 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9286 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9287 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9288 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9289 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9290 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9291 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9292 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9293 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9294 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9295 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9296 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9297 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9298 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9299 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9300 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
9301 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
9302 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
9303 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
9304 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9305 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9306 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9307 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9308 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9309 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9310 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9311 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9312 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9313 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9314 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9315 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9316 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9317 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
9318 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9319 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9320 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
9321 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
9322 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
9323 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
9324 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9325 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9326 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9327 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9328 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9329 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9330 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9331 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9332 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9333 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9334 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9335 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9336 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9337 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9338 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9339 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9340 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
9341 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9342 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
9343 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
9344 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
9345 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
9346 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
9347 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
9348 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
9349 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
9350 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
9351 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
9352 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9353 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
9354 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
9355 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9356 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
9359 #define ALC225_STANDARD_PINS \
9362 #define ALC256_STANDARD_PINS \
9363 {0x12, 0x90a60140}, \
9364 {0x14, 0x90170110}, \
9367 #define ALC282_STANDARD_PINS \
9370 #define ALC290_STANDARD_PINS \
9373 #define ALC292_STANDARD_PINS \
9374 {0x14, 0x90170110}, \
9377 #define ALC295_STANDARD_PINS \
9378 {0x12, 0xb7a60130}, \
9379 {0x14, 0x90170110}, \
9382 #define ALC298_STANDARD_PINS \
9383 {0x12, 0x90a60130}, \
9386 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
9387 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9392 {0x21, 0x0221102f}),
9393 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9396 {0x21, 0x02211030}),
9397 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9400 {0x21, 0x03211020}),
9401 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9404 {0x21, 0x03211020}),
9405 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9406 ALC225_STANDARD_PINS,
9408 {0x14, 0x901701a0}),
9409 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9410 ALC225_STANDARD_PINS,
9412 {0x14, 0x901701b0}),
9413 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9414 ALC225_STANDARD_PINS,
9416 {0x14, 0x901701a0}),
9417 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9418 ALC225_STANDARD_PINS,
9420 {0x14, 0x901701b0}),
9421 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9422 ALC225_STANDARD_PINS,
9424 {0x1b, 0x90170110}),
9425 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9428 {0x21, 0x02211020}),
9429 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9433 {0x21, 0x02211020}),
9434 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9439 {0x21, 0x0221101f}),
9440 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9445 {0x21, 0x0221101f}),
9446 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9450 {0x21, 0x0221101f}),
9451 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9452 {0x21, 0x02211010}),
9453 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9456 {0x21, 0x02211030}),
9457 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9459 {0x21, 0x02211020}),
9460 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9462 {0x21, 0x02211040}),
9463 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9466 {0x21, 0x02211020}),
9467 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9470 {0x21, 0x02211030}),
9471 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9474 {0x21, 0x0221101f}),
9475 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9478 {0x21, 0x0221101f}),
9479 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9482 {0x21, 0x0221103f}),
9483 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9486 {0x21, 0x0221103f}),
9487 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9490 {0x21, 0x0221103f}),
9491 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9494 {0x21, 0x0221105f}),
9495 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9498 {0x21, 0x0221101f}),
9499 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9503 {0x21, 0x0321102f}),
9504 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9507 {0x21, 0x02211040}),
9508 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9511 {0x21, 0x02211050}),
9512 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9515 {0x21, 0x02211030}),
9516 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9519 {0x21, 0x02211040}),
9520 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9523 {0x21, 0x02211040}),
9524 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9527 {0x21, 0x02211050}),
9528 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9531 {0x21, 0x02211040}),
9532 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9535 {0x21, 0x02211030}),
9536 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9538 {0x21, 0x02211010}),
9539 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9542 {0x21, 0x04211020}),
9543 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9546 {0x21, 0x03211020}),
9547 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9550 {0x21, 0x03211020}),
9551 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9554 {0x21, 0x04211020}),
9555 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9558 {0x21, 0x03211020}),
9559 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9562 {0x21, 0x0221101f}),
9563 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9566 {0x21, 0x03211020}),
9567 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9571 {0x1a, 0x04a11020}),
9572 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9578 {0x1b, 0x02011020}),
9579 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9580 ALC282_STANDARD_PINS,
9583 {0x21, 0x0321101f}),
9584 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9585 ALC282_STANDARD_PINS,
9588 {0x21, 0x03211040}),
9589 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9590 ALC282_STANDARD_PINS,
9593 {0x21, 0x03211020}),
9594 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9595 ALC282_STANDARD_PINS,
9598 {0x21, 0x0421101f}),
9599 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9600 ALC282_STANDARD_PINS,
9603 {0x21, 0x04211020}),
9604 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9605 ALC282_STANDARD_PINS,
9611 {0x21, 0x0321101f}),
9612 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9613 ALC282_STANDARD_PINS,
9619 {0x21, 0x0321101f}),
9620 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9621 ALC282_STANDARD_PINS,
9623 {0x21, 0x0321101f}),
9624 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9627 {0x21, 0x02211030}),
9628 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9629 ALC282_STANDARD_PINS,
9632 {0x21, 0x0321101f}),
9633 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9637 {0x21, 0x04211020}),
9638 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9642 {0x21, 0x04211020}),
9643 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9646 {0x21, 0x04211020}),
9647 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9651 {0x21, 0x03211020}),
9652 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9655 {0x21, 0x02211020}),
9656 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9659 {0x21, 0x0321101f}),
9660 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9661 ALC290_STANDARD_PINS,
9664 {0x1a, 0x04a11020}),
9665 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9666 ALC290_STANDARD_PINS,
9669 {0x1a, 0x04a11020}),
9670 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9671 ALC290_STANDARD_PINS,
9673 {0x1a, 0x04a11020}),
9674 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9675 ALC290_STANDARD_PINS,
9677 {0x1a, 0x04a11040}),
9678 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9679 ALC290_STANDARD_PINS,
9682 {0x1a, 0x04a11040}),
9683 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9684 ALC290_STANDARD_PINS,
9687 {0x1a, 0x04a11020}),
9688 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9689 ALC290_STANDARD_PINS,
9692 {0x1a, 0x04a11020}),
9693 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9694 ALC292_STANDARD_PINS,
9697 {0x19, 0x01a19030}),
9698 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9699 ALC292_STANDARD_PINS,
9703 {0x19, 0x01a1903e}),
9704 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9705 ALC292_STANDARD_PINS,
9706 {0x12, 0x90a60140}),
9707 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9708 ALC292_STANDARD_PINS,
9711 {0x19, 0x21a19030}),
9712 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9713 ALC292_STANDARD_PINS,
9714 {0x13, 0x90a60140}),
9715 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9717 {0x21, 0x04211020}),
9718 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9721 {0x21, 0x04211020}),
9722 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9725 {0x21, 0x03211020}),
9726 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9729 {0x21, 0x04211020}),
9730 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9733 {0x21, 0x03211020}),
9734 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9737 {0x21, 0x04211030}),
9738 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9741 {0x21, 0x03211020}),
9742 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9745 {0x21, 0x03211020}),
9746 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9748 {0x21, 0x04211020}),
9749 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9751 {0x21, 0x04211030}),
9752 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9753 ALC295_STANDARD_PINS,
9755 {0x18, 0x21a19030}),
9756 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9757 ALC295_STANDARD_PINS,
9759 {0x18, 0x21a19050}),
9760 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9761 ALC295_STANDARD_PINS),
9762 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9763 ALC298_STANDARD_PINS,
9764 {0x17, 0x90170110}),
9765 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9766 ALC298_STANDARD_PINS,
9767 {0x17, 0x90170140}),
9768 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9769 ALC298_STANDARD_PINS,
9770 {0x17, 0x90170150}),
9771 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9776 {0x21, 0x03211030}),
9777 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9781 {0x21, 0x03211020}),
9782 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9783 ALC225_STANDARD_PINS,
9785 {0x17, 0x90170110}),
9786 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9791 {0x21, 0x0221101f}),
9795 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9796 * more machines, don't need to match all valid pins, just need to match
9797 * all the pins defined in the tbl. Just because of this reason, it is possible
9798 * that a single machine matches multiple tbls, so there is one limitation:
9799 * at most one tbl is allowed to define for the same vendor and same codec
9801 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9802 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9804 {0x1b, 0x40000000}),
9805 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9807 {0x1a, 0x40000000}),
9808 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9810 {0x1a, 0x40000000}),
9811 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9813 {0x1a, 0x40000000}),
9817 static void alc269_fill_coef(struct hda_codec *codec)
9819 struct alc_spec *spec = codec->spec;
9822 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9825 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9826 alc_write_coef_idx(codec, 0xf, 0x960b);
9827 alc_write_coef_idx(codec, 0xe, 0x8817);
9830 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9831 alc_write_coef_idx(codec, 0xf, 0x960b);
9832 alc_write_coef_idx(codec, 0xe, 0x8814);
9835 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9836 /* Power up output pin */
9837 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9840 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9841 val = alc_read_coef_idx(codec, 0xd);
9842 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9843 /* Capless ramp up clock control */
9844 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9846 val = alc_read_coef_idx(codec, 0x17);
9847 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9848 /* Class D power on reset */
9849 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9854 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
9859 static int patch_alc269(struct hda_codec *codec)
9861 struct alc_spec *spec;
9864 err = alc_alloc_spec(codec, 0x0b);
9869 spec->gen.shared_mic_vref_pin = 0x18;
9870 codec->power_save_node = 0;
9873 codec->patch_ops.suspend = alc269_suspend;
9874 codec->patch_ops.resume = alc269_resume;
9876 spec->shutup = alc_default_shutup;
9877 spec->init_hook = alc_default_init;
9879 switch (codec->core.vendor_id) {
9881 spec->codec_variant = ALC269_TYPE_ALC269VA;
9882 switch (alc_get_coef0(codec) & 0x00f0) {
9884 if (codec->bus->pci &&
9885 codec->bus->pci->subsystem_vendor == 0x1025 &&
9886 spec->cdefine.platform_type == 1)
9887 err = alc_codec_rename(codec, "ALC271X");
9888 spec->codec_variant = ALC269_TYPE_ALC269VB;
9891 if (codec->bus->pci &&
9892 codec->bus->pci->subsystem_vendor == 0x17aa &&
9893 codec->bus->pci->subsystem_device == 0x21f3)
9894 err = alc_codec_rename(codec, "ALC3202");
9895 spec->codec_variant = ALC269_TYPE_ALC269VC;
9898 spec->codec_variant = ALC269_TYPE_ALC269VD;
9901 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9905 spec->shutup = alc269_shutup;
9906 spec->init_hook = alc269_fill_coef;
9907 alc269_fill_coef(codec);
9912 spec->codec_variant = ALC269_TYPE_ALC280;
9915 spec->codec_variant = ALC269_TYPE_ALC282;
9916 spec->shutup = alc282_shutup;
9917 spec->init_hook = alc282_init;
9921 spec->codec_variant = ALC269_TYPE_ALC283;
9922 spec->shutup = alc283_shutup;
9923 spec->init_hook = alc283_init;
9927 spec->codec_variant = ALC269_TYPE_ALC284;
9930 spec->codec_variant = ALC269_TYPE_ALC293;
9934 spec->codec_variant = ALC269_TYPE_ALC286;
9937 spec->codec_variant = ALC269_TYPE_ALC298;
9941 spec->codec_variant = ALC269_TYPE_ALC255;
9942 spec->shutup = alc256_shutup;
9943 spec->init_hook = alc256_init;
9948 spec->codec_variant = ALC269_TYPE_ALC256;
9949 spec->shutup = alc256_shutup;
9950 spec->init_hook = alc256_init;
9951 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
9954 spec->codec_variant = ALC269_TYPE_ALC257;
9955 spec->shutup = alc256_shutup;
9956 spec->init_hook = alc256_init;
9957 spec->gen.mixer_nid = 0;
9963 spec->codec_variant = ALC269_TYPE_ALC215;
9964 spec->shutup = alc225_shutup;
9965 spec->init_hook = alc225_init;
9966 spec->gen.mixer_nid = 0;
9971 spec->codec_variant = ALC269_TYPE_ALC225;
9972 spec->shutup = alc225_shutup;
9973 spec->init_hook = alc225_init;
9974 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
9977 spec->codec_variant = ALC269_TYPE_ALC287;
9978 spec->shutup = alc225_shutup;
9979 spec->init_hook = alc225_init;
9980 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
9985 spec->codec_variant = ALC269_TYPE_ALC294;
9986 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
9987 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
9988 spec->init_hook = alc294_init;
9991 spec->codec_variant = ALC269_TYPE_ALC300;
9992 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
9995 spec->codec_variant = ALC269_TYPE_ALC623;
10001 spec->codec_variant = ALC269_TYPE_ALC700;
10002 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
10003 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
10004 spec->init_hook = alc294_init;
10009 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
10010 spec->has_alc5505_dsp = 1;
10011 spec->init_hook = alc5505_dsp_init;
10014 alc_pre_init(codec);
10016 snd_hda_pick_fixup(codec, alc269_fixup_models,
10017 alc269_fixup_tbl, alc269_fixups);
10018 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10019 * the quirk breaks the latter (bko#214101).
10020 * Clear the wrong entry.
10022 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10023 codec->core.vendor_id == 0x10ec0294) {
10024 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10025 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10028 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
10029 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
10030 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10032 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10034 alc_auto_parse_customize_define(codec);
10036 if (has_cdefine_beep(codec))
10037 spec->gen.beep_nid = 0x01;
10039 /* automatic parse from the BIOS config */
10040 err = alc269_parse_auto_config(codec);
10044 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10045 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10050 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10063 static int alc861_parse_auto_config(struct hda_codec *codec)
10065 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
10066 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10067 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
10070 /* Pin config fixes */
10072 ALC861_FIXUP_FSC_AMILO_PI1505,
10073 ALC861_FIXUP_AMP_VREF_0F,
10074 ALC861_FIXUP_NO_JACK_DETECT,
10075 ALC861_FIXUP_ASUS_A6RP,
10076 ALC660_FIXUP_ASUS_W7J,
10079 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10080 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
10081 const struct hda_fixup *fix, int action)
10083 struct alc_spec *spec = codec->spec;
10086 if (action != HDA_FIXUP_ACT_INIT)
10088 val = snd_hda_codec_get_pin_target(codec, 0x0f);
10089 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10090 val |= AC_PINCTL_IN_EN;
10091 val |= AC_PINCTL_VREF_50;
10092 snd_hda_set_pin_ctl(codec, 0x0f, val);
10093 spec->gen.keep_vref_in_automute = 1;
10096 /* suppress the jack-detection */
10097 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
10098 const struct hda_fixup *fix, int action)
10100 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10101 codec->no_jack_detect = 1;
10104 static const struct hda_fixup alc861_fixups[] = {
10105 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
10106 .type = HDA_FIXUP_PINS,
10107 .v.pins = (const struct hda_pintbl[]) {
10108 { 0x0b, 0x0221101f }, /* HP */
10109 { 0x0f, 0x90170310 }, /* speaker */
10113 [ALC861_FIXUP_AMP_VREF_0F] = {
10114 .type = HDA_FIXUP_FUNC,
10115 .v.func = alc861_fixup_asus_amp_vref_0f,
10117 [ALC861_FIXUP_NO_JACK_DETECT] = {
10118 .type = HDA_FIXUP_FUNC,
10119 .v.func = alc_fixup_no_jack_detect,
10121 [ALC861_FIXUP_ASUS_A6RP] = {
10122 .type = HDA_FIXUP_FUNC,
10123 .v.func = alc861_fixup_asus_amp_vref_0f,
10125 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
10127 [ALC660_FIXUP_ASUS_W7J] = {
10128 .type = HDA_FIXUP_VERBS,
10129 .v.verbs = (const struct hda_verb[]) {
10130 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10131 * for enabling outputs
10133 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10139 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
10140 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
10141 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
10142 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10143 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10144 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
10145 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
10146 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
10152 static int patch_alc861(struct hda_codec *codec)
10154 struct alc_spec *spec;
10157 err = alc_alloc_spec(codec, 0x15);
10161 spec = codec->spec;
10162 if (has_cdefine_beep(codec))
10163 spec->gen.beep_nid = 0x23;
10166 spec->power_hook = alc_power_eapd;
10169 alc_pre_init(codec);
10171 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10172 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10174 /* automatic parse from the BIOS config */
10175 err = alc861_parse_auto_config(codec);
10179 if (!spec->gen.no_analog) {
10180 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10185 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10195 * ALC861-VD support
10199 * In addition, an independent DAC
10201 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10203 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10204 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10205 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10209 ALC660VD_FIX_ASUS_GPIO1,
10210 ALC861VD_FIX_DALLAS,
10213 /* exclude VREF80 */
10214 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10215 const struct hda_fixup *fix, int action)
10217 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10218 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10219 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10224 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10225 const struct hda_fixup *fix, int action)
10227 struct alc_spec *spec = codec->spec;
10229 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10230 spec->gpio_mask |= 0x02;
10231 alc_fixup_gpio(codec, action, 0x01);
10234 static const struct hda_fixup alc861vd_fixups[] = {
10235 [ALC660VD_FIX_ASUS_GPIO1] = {
10236 .type = HDA_FIXUP_FUNC,
10237 .v.func = alc660vd_fixup_asus_gpio1,
10239 [ALC861VD_FIX_DALLAS] = {
10240 .type = HDA_FIXUP_FUNC,
10241 .v.func = alc861vd_fixup_dallas,
10245 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10246 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10247 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10248 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10254 static int patch_alc861vd(struct hda_codec *codec)
10256 struct alc_spec *spec;
10259 err = alc_alloc_spec(codec, 0x0b);
10263 spec = codec->spec;
10264 if (has_cdefine_beep(codec))
10265 spec->gen.beep_nid = 0x23;
10267 spec->shutup = alc_eapd_shutup;
10269 alc_pre_init(codec);
10271 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10272 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10274 /* automatic parse from the BIOS config */
10275 err = alc861vd_parse_auto_config(codec);
10279 if (!spec->gen.no_analog) {
10280 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10285 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10297 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10298 * configuration. Each pin widget can choose any input DACs and a mixer.
10299 * Each ADC is connected from a mixer of all inputs. This makes possible
10300 * 6-channel independent captures.
10302 * In addition, an independent DAC for the multi-playback (not used in this
10307 * BIOS auto configuration
10310 static int alc662_parse_auto_config(struct hda_codec *codec)
10312 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
10313 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10314 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10315 const hda_nid_t *ssids;
10317 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10318 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10319 codec->core.vendor_id == 0x10ec0671)
10320 ssids = alc663_ssids;
10322 ssids = alc662_ssids;
10323 return alc_parse_auto_config(codec, alc662_ignore, ssids);
10326 static void alc272_fixup_mario(struct hda_codec *codec,
10327 const struct hda_fixup *fix, int action)
10329 if (action != HDA_FIXUP_ACT_PRE_PROBE)
10331 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10332 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10333 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10334 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10335 (0 << AC_AMPCAP_MUTE_SHIFT)))
10336 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
10339 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10341 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10343 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10344 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10348 /* override the 2.1 chmap */
10349 static void alc_fixup_bass_chmap(struct hda_codec *codec,
10350 const struct hda_fixup *fix, int action)
10352 if (action == HDA_FIXUP_ACT_BUILD) {
10353 struct alc_spec *spec = codec->spec;
10354 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
10358 /* avoid D3 for keeping GPIO up */
10359 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10361 unsigned int power_state)
10363 struct alc_spec *spec = codec->spec;
10364 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
10365 return AC_PWRST_D0;
10366 return power_state;
10369 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10370 const struct hda_fixup *fix, int action)
10372 struct alc_spec *spec = codec->spec;
10374 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
10375 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10376 spec->mute_led_polarity = 1;
10377 codec->power_filter = gpio_led_power_filter;
10381 static void alc662_usi_automute_hook(struct hda_codec *codec,
10382 struct hda_jack_callback *jack)
10384 struct alc_spec *spec = codec->spec;
10387 snd_hda_gen_hp_automute(codec, jack);
10389 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10391 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10395 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10396 const struct hda_fixup *fix, int action)
10398 struct alc_spec *spec = codec->spec;
10399 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10400 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10401 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10405 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10406 struct hda_jack_callback *cb)
10408 /* surround speakers at 0x1b already get muted automatically when
10409 * headphones are plugged in, but we have to mute/unmute the remaining
10410 * channels manually:
10411 * 0x15 - front left/front right
10412 * 0x18 - front center/ LFE
10414 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10415 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10416 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10418 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10419 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10423 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10424 const struct hda_fixup *fix, int action)
10426 /* Pin 0x1b: shared headphones jack and surround speakers */
10427 if (!is_jack_detectable(codec, 0x1b))
10431 case HDA_FIXUP_ACT_PRE_PROBE:
10432 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10433 alc662_aspire_ethos_mute_speakers);
10434 /* subwoofer needs an extra GPIO setting to become audible */
10435 alc_setup_gpio(codec, 0x02);
10437 case HDA_FIXUP_ACT_INIT:
10438 /* Make sure to start in a correct state, i.e. if
10439 * headphones have been plugged in before powering up the system
10441 alc662_aspire_ethos_mute_speakers(codec, NULL);
10446 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10447 const struct hda_fixup *fix, int action)
10449 struct alc_spec *spec = codec->spec;
10451 static const struct hda_pintbl pincfgs[] = {
10452 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10453 { 0x1b, 0x0181304f },
10458 case HDA_FIXUP_ACT_PRE_PROBE:
10459 spec->gen.mixer_nid = 0;
10460 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10461 snd_hda_apply_pincfgs(codec, pincfgs);
10463 case HDA_FIXUP_ACT_INIT:
10464 alc_write_coef_idx(codec, 0x19, 0xa054);
10469 static void alc897_hp_automute_hook(struct hda_codec *codec,
10470 struct hda_jack_callback *jack)
10472 struct alc_spec *spec = codec->spec;
10475 snd_hda_gen_hp_automute(codec, jack);
10476 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10477 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10481 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10482 const struct hda_fixup *fix, int action)
10484 struct alc_spec *spec = codec->spec;
10485 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10486 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10490 static const struct coef_fw alc668_coefs[] = {
10491 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10492 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10493 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10494 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10495 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10496 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10497 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10498 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10499 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10500 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10501 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10502 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10503 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10504 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10505 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10506 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10507 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10508 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10509 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10510 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10514 static void alc668_restore_default_value(struct hda_codec *codec)
10516 alc_process_coef_fw(codec, alc668_coefs);
10520 ALC662_FIXUP_ASPIRE,
10521 ALC662_FIXUP_LED_GPIO1,
10522 ALC662_FIXUP_IDEAPAD,
10523 ALC272_FIXUP_MARIO,
10524 ALC662_FIXUP_CZC_ET26,
10525 ALC662_FIXUP_CZC_P10T,
10526 ALC662_FIXUP_SKU_IGNORE,
10527 ALC662_FIXUP_HP_RP5800,
10528 ALC662_FIXUP_ASUS_MODE1,
10529 ALC662_FIXUP_ASUS_MODE2,
10530 ALC662_FIXUP_ASUS_MODE3,
10531 ALC662_FIXUP_ASUS_MODE4,
10532 ALC662_FIXUP_ASUS_MODE5,
10533 ALC662_FIXUP_ASUS_MODE6,
10534 ALC662_FIXUP_ASUS_MODE7,
10535 ALC662_FIXUP_ASUS_MODE8,
10536 ALC662_FIXUP_NO_JACK_DETECT,
10537 ALC662_FIXUP_ZOTAC_Z68,
10538 ALC662_FIXUP_INV_DMIC,
10539 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10540 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10541 ALC662_FIXUP_HEADSET_MODE,
10542 ALC668_FIXUP_HEADSET_MODE,
10543 ALC662_FIXUP_BASS_MODE4_CHMAP,
10544 ALC662_FIXUP_BASS_16,
10545 ALC662_FIXUP_BASS_1A,
10546 ALC662_FIXUP_BASS_CHMAP,
10547 ALC668_FIXUP_AUTO_MUTE,
10548 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10549 ALC668_FIXUP_DELL_XPS13,
10550 ALC662_FIXUP_ASUS_Nx50,
10551 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10552 ALC668_FIXUP_ASUS_Nx51,
10553 ALC668_FIXUP_MIC_COEF,
10554 ALC668_FIXUP_ASUS_G751,
10555 ALC891_FIXUP_HEADSET_MODE,
10556 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10557 ALC662_FIXUP_ACER_VERITON,
10558 ALC892_FIXUP_ASROCK_MOBO,
10559 ALC662_FIXUP_USI_FUNC,
10560 ALC662_FIXUP_USI_HEADSET_MODE,
10561 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10562 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10563 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10564 ALC671_FIXUP_HP_HEADSET_MIC2,
10565 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10566 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10567 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10568 ALC668_FIXUP_HEADSET_MIC,
10569 ALC668_FIXUP_MIC_DET_COEF,
10570 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10571 ALC897_FIXUP_HEADSET_MIC_PIN,
10574 static const struct hda_fixup alc662_fixups[] = {
10575 [ALC662_FIXUP_ASPIRE] = {
10576 .type = HDA_FIXUP_PINS,
10577 .v.pins = (const struct hda_pintbl[]) {
10578 { 0x15, 0x99130112 }, /* subwoofer */
10582 [ALC662_FIXUP_LED_GPIO1] = {
10583 .type = HDA_FIXUP_FUNC,
10584 .v.func = alc662_fixup_led_gpio1,
10586 [ALC662_FIXUP_IDEAPAD] = {
10587 .type = HDA_FIXUP_PINS,
10588 .v.pins = (const struct hda_pintbl[]) {
10589 { 0x17, 0x99130112 }, /* subwoofer */
10593 .chain_id = ALC662_FIXUP_LED_GPIO1,
10595 [ALC272_FIXUP_MARIO] = {
10596 .type = HDA_FIXUP_FUNC,
10597 .v.func = alc272_fixup_mario,
10599 [ALC662_FIXUP_CZC_ET26] = {
10600 .type = HDA_FIXUP_PINS,
10601 .v.pins = (const struct hda_pintbl[]) {
10602 {0x12, 0x403cc000},
10603 {0x14, 0x90170110}, /* speaker */
10604 {0x15, 0x411111f0},
10605 {0x16, 0x411111f0},
10606 {0x18, 0x01a19030}, /* mic */
10607 {0x19, 0x90a7013f}, /* int-mic */
10608 {0x1a, 0x01014020},
10609 {0x1b, 0x0121401f},
10610 {0x1c, 0x411111f0},
10611 {0x1d, 0x411111f0},
10612 {0x1e, 0x40478e35},
10616 .chain_id = ALC662_FIXUP_SKU_IGNORE
10618 [ALC662_FIXUP_CZC_P10T] = {
10619 .type = HDA_FIXUP_VERBS,
10620 .v.verbs = (const struct hda_verb[]) {
10621 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10625 [ALC662_FIXUP_SKU_IGNORE] = {
10626 .type = HDA_FIXUP_FUNC,
10627 .v.func = alc_fixup_sku_ignore,
10629 [ALC662_FIXUP_HP_RP5800] = {
10630 .type = HDA_FIXUP_PINS,
10631 .v.pins = (const struct hda_pintbl[]) {
10632 { 0x14, 0x0221201f }, /* HP out */
10636 .chain_id = ALC662_FIXUP_SKU_IGNORE
10638 [ALC662_FIXUP_ASUS_MODE1] = {
10639 .type = HDA_FIXUP_PINS,
10640 .v.pins = (const struct hda_pintbl[]) {
10641 { 0x14, 0x99130110 }, /* speaker */
10642 { 0x18, 0x01a19c20 }, /* mic */
10643 { 0x19, 0x99a3092f }, /* int-mic */
10644 { 0x21, 0x0121401f }, /* HP out */
10648 .chain_id = ALC662_FIXUP_SKU_IGNORE
10650 [ALC662_FIXUP_ASUS_MODE2] = {
10651 .type = HDA_FIXUP_PINS,
10652 .v.pins = (const struct hda_pintbl[]) {
10653 { 0x14, 0x99130110 }, /* speaker */
10654 { 0x18, 0x01a19820 }, /* mic */
10655 { 0x19, 0x99a3092f }, /* int-mic */
10656 { 0x1b, 0x0121401f }, /* HP out */
10660 .chain_id = ALC662_FIXUP_SKU_IGNORE
10662 [ALC662_FIXUP_ASUS_MODE3] = {
10663 .type = HDA_FIXUP_PINS,
10664 .v.pins = (const struct hda_pintbl[]) {
10665 { 0x14, 0x99130110 }, /* speaker */
10666 { 0x15, 0x0121441f }, /* HP */
10667 { 0x18, 0x01a19840 }, /* mic */
10668 { 0x19, 0x99a3094f }, /* int-mic */
10669 { 0x21, 0x01211420 }, /* HP2 */
10673 .chain_id = ALC662_FIXUP_SKU_IGNORE
10675 [ALC662_FIXUP_ASUS_MODE4] = {
10676 .type = HDA_FIXUP_PINS,
10677 .v.pins = (const struct hda_pintbl[]) {
10678 { 0x14, 0x99130110 }, /* speaker */
10679 { 0x16, 0x99130111 }, /* speaker */
10680 { 0x18, 0x01a19840 }, /* mic */
10681 { 0x19, 0x99a3094f }, /* int-mic */
10682 { 0x21, 0x0121441f }, /* HP */
10686 .chain_id = ALC662_FIXUP_SKU_IGNORE
10688 [ALC662_FIXUP_ASUS_MODE5] = {
10689 .type = HDA_FIXUP_PINS,
10690 .v.pins = (const struct hda_pintbl[]) {
10691 { 0x14, 0x99130110 }, /* speaker */
10692 { 0x15, 0x0121441f }, /* HP */
10693 { 0x16, 0x99130111 }, /* speaker */
10694 { 0x18, 0x01a19840 }, /* mic */
10695 { 0x19, 0x99a3094f }, /* int-mic */
10699 .chain_id = ALC662_FIXUP_SKU_IGNORE
10701 [ALC662_FIXUP_ASUS_MODE6] = {
10702 .type = HDA_FIXUP_PINS,
10703 .v.pins = (const struct hda_pintbl[]) {
10704 { 0x14, 0x99130110 }, /* speaker */
10705 { 0x15, 0x01211420 }, /* HP2 */
10706 { 0x18, 0x01a19840 }, /* mic */
10707 { 0x19, 0x99a3094f }, /* int-mic */
10708 { 0x1b, 0x0121441f }, /* HP */
10712 .chain_id = ALC662_FIXUP_SKU_IGNORE
10714 [ALC662_FIXUP_ASUS_MODE7] = {
10715 .type = HDA_FIXUP_PINS,
10716 .v.pins = (const struct hda_pintbl[]) {
10717 { 0x14, 0x99130110 }, /* speaker */
10718 { 0x17, 0x99130111 }, /* speaker */
10719 { 0x18, 0x01a19840 }, /* mic */
10720 { 0x19, 0x99a3094f }, /* int-mic */
10721 { 0x1b, 0x01214020 }, /* HP */
10722 { 0x21, 0x0121401f }, /* HP */
10726 .chain_id = ALC662_FIXUP_SKU_IGNORE
10728 [ALC662_FIXUP_ASUS_MODE8] = {
10729 .type = HDA_FIXUP_PINS,
10730 .v.pins = (const struct hda_pintbl[]) {
10731 { 0x14, 0x99130110 }, /* speaker */
10732 { 0x12, 0x99a30970 }, /* int-mic */
10733 { 0x15, 0x01214020 }, /* HP */
10734 { 0x17, 0x99130111 }, /* speaker */
10735 { 0x18, 0x01a19840 }, /* mic */
10736 { 0x21, 0x0121401f }, /* HP */
10740 .chain_id = ALC662_FIXUP_SKU_IGNORE
10742 [ALC662_FIXUP_NO_JACK_DETECT] = {
10743 .type = HDA_FIXUP_FUNC,
10744 .v.func = alc_fixup_no_jack_detect,
10746 [ALC662_FIXUP_ZOTAC_Z68] = {
10747 .type = HDA_FIXUP_PINS,
10748 .v.pins = (const struct hda_pintbl[]) {
10749 { 0x1b, 0x02214020 }, /* Front HP */
10753 [ALC662_FIXUP_INV_DMIC] = {
10754 .type = HDA_FIXUP_FUNC,
10755 .v.func = alc_fixup_inv_dmic,
10757 [ALC668_FIXUP_DELL_XPS13] = {
10758 .type = HDA_FIXUP_FUNC,
10759 .v.func = alc_fixup_dell_xps13,
10761 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10763 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10764 .type = HDA_FIXUP_FUNC,
10765 .v.func = alc_fixup_disable_aamix,
10767 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10769 [ALC668_FIXUP_AUTO_MUTE] = {
10770 .type = HDA_FIXUP_FUNC,
10771 .v.func = alc_fixup_auto_mute_via_amp,
10773 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10775 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10776 .type = HDA_FIXUP_PINS,
10777 .v.pins = (const struct hda_pintbl[]) {
10778 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10779 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10783 .chain_id = ALC662_FIXUP_HEADSET_MODE
10785 [ALC662_FIXUP_HEADSET_MODE] = {
10786 .type = HDA_FIXUP_FUNC,
10787 .v.func = alc_fixup_headset_mode_alc662,
10789 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10790 .type = HDA_FIXUP_PINS,
10791 .v.pins = (const struct hda_pintbl[]) {
10792 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10793 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10797 .chain_id = ALC668_FIXUP_HEADSET_MODE
10799 [ALC668_FIXUP_HEADSET_MODE] = {
10800 .type = HDA_FIXUP_FUNC,
10801 .v.func = alc_fixup_headset_mode_alc668,
10803 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10804 .type = HDA_FIXUP_FUNC,
10805 .v.func = alc_fixup_bass_chmap,
10807 .chain_id = ALC662_FIXUP_ASUS_MODE4
10809 [ALC662_FIXUP_BASS_16] = {
10810 .type = HDA_FIXUP_PINS,
10811 .v.pins = (const struct hda_pintbl[]) {
10812 {0x16, 0x80106111}, /* bass speaker */
10816 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10818 [ALC662_FIXUP_BASS_1A] = {
10819 .type = HDA_FIXUP_PINS,
10820 .v.pins = (const struct hda_pintbl[]) {
10821 {0x1a, 0x80106111}, /* bass speaker */
10825 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10827 [ALC662_FIXUP_BASS_CHMAP] = {
10828 .type = HDA_FIXUP_FUNC,
10829 .v.func = alc_fixup_bass_chmap,
10831 [ALC662_FIXUP_ASUS_Nx50] = {
10832 .type = HDA_FIXUP_FUNC,
10833 .v.func = alc_fixup_auto_mute_via_amp,
10835 .chain_id = ALC662_FIXUP_BASS_1A
10837 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10838 .type = HDA_FIXUP_FUNC,
10839 .v.func = alc_fixup_headset_mode_alc668,
10840 .chain_id = ALC662_FIXUP_BASS_CHMAP
10842 [ALC668_FIXUP_ASUS_Nx51] = {
10843 .type = HDA_FIXUP_PINS,
10844 .v.pins = (const struct hda_pintbl[]) {
10845 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10846 { 0x1a, 0x90170151 }, /* bass speaker */
10847 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10851 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10853 [ALC668_FIXUP_MIC_COEF] = {
10854 .type = HDA_FIXUP_VERBS,
10855 .v.verbs = (const struct hda_verb[]) {
10856 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10857 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10861 [ALC668_FIXUP_ASUS_G751] = {
10862 .type = HDA_FIXUP_PINS,
10863 .v.pins = (const struct hda_pintbl[]) {
10864 { 0x16, 0x0421101f }, /* HP */
10868 .chain_id = ALC668_FIXUP_MIC_COEF
10870 [ALC891_FIXUP_HEADSET_MODE] = {
10871 .type = HDA_FIXUP_FUNC,
10872 .v.func = alc_fixup_headset_mode,
10874 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10875 .type = HDA_FIXUP_PINS,
10876 .v.pins = (const struct hda_pintbl[]) {
10877 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10878 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10882 .chain_id = ALC891_FIXUP_HEADSET_MODE
10884 [ALC662_FIXUP_ACER_VERITON] = {
10885 .type = HDA_FIXUP_PINS,
10886 .v.pins = (const struct hda_pintbl[]) {
10887 { 0x15, 0x50170120 }, /* no internal speaker */
10891 [ALC892_FIXUP_ASROCK_MOBO] = {
10892 .type = HDA_FIXUP_PINS,
10893 .v.pins = (const struct hda_pintbl[]) {
10894 { 0x15, 0x40f000f0 }, /* disabled */
10895 { 0x16, 0x40f000f0 }, /* disabled */
10899 [ALC662_FIXUP_USI_FUNC] = {
10900 .type = HDA_FIXUP_FUNC,
10901 .v.func = alc662_fixup_usi_headset_mic,
10903 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10904 .type = HDA_FIXUP_PINS,
10905 .v.pins = (const struct hda_pintbl[]) {
10906 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10907 { 0x18, 0x01a1903d },
10911 .chain_id = ALC662_FIXUP_USI_FUNC
10913 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10914 .type = HDA_FIXUP_FUNC,
10915 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10917 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10918 .type = HDA_FIXUP_FUNC,
10919 .v.func = alc662_fixup_aspire_ethos_hp,
10921 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10922 .type = HDA_FIXUP_PINS,
10923 .v.pins = (const struct hda_pintbl[]) {
10924 { 0x15, 0x92130110 }, /* front speakers */
10925 { 0x18, 0x99130111 }, /* center/subwoofer */
10926 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10930 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
10932 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10933 .type = HDA_FIXUP_FUNC,
10934 .v.func = alc671_fixup_hp_headset_mic2,
10936 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10937 .type = HDA_FIXUP_PINS,
10938 .v.pins = (const struct hda_pintbl[]) {
10939 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10943 .chain_id = ALC662_FIXUP_USI_FUNC
10945 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10946 .type = HDA_FIXUP_PINS,
10947 .v.pins = (const struct hda_pintbl[]) {
10948 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10949 { 0x1b, 0x0221144f },
10953 .chain_id = ALC662_FIXUP_USI_FUNC
10955 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
10956 .type = HDA_FIXUP_PINS,
10957 .v.pins = (const struct hda_pintbl[]) {
10958 { 0x1b, 0x04a1112c },
10962 .chain_id = ALC668_FIXUP_HEADSET_MIC
10964 [ALC668_FIXUP_HEADSET_MIC] = {
10965 .type = HDA_FIXUP_FUNC,
10966 .v.func = alc269_fixup_headset_mic,
10968 .chain_id = ALC668_FIXUP_MIC_DET_COEF
10970 [ALC668_FIXUP_MIC_DET_COEF] = {
10971 .type = HDA_FIXUP_VERBS,
10972 .v.verbs = (const struct hda_verb[]) {
10973 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
10974 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
10978 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
10979 .type = HDA_FIXUP_FUNC,
10980 .v.func = alc897_fixup_lenovo_headset_mic,
10982 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
10983 .type = HDA_FIXUP_PINS,
10984 .v.pins = (const struct hda_pintbl[]) {
10985 { 0x1a, 0x03a11050 },
10989 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
10993 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
10994 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
10995 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
10996 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
10997 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
10998 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
10999 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
11000 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
11001 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
11002 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
11003 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
11004 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
11005 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11006 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11007 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
11008 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
11009 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
11010 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11011 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11012 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11013 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11014 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11015 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11016 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
11017 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
11018 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
11019 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11020 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
11021 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
11022 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11023 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
11024 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11025 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
11026 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
11027 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
11028 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
11029 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11030 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
11031 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
11032 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
11033 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
11034 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
11035 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11036 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11037 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11038 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
11039 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
11040 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
11041 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
11042 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
11043 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
11044 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
11045 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11048 /* Below is a quirk table taken from the old code.
11049 * Basically the device should work as is without the fixup table.
11050 * If BIOS doesn't give a proper info, enable the corresponding
11053 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11054 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11055 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11056 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11057 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11058 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11059 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11060 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11061 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11062 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11063 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11064 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11065 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11066 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11067 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11068 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11069 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11070 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11071 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11072 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11073 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11074 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11075 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11076 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11077 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11078 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11079 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11080 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11081 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11082 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11083 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11084 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11085 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11086 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11087 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11088 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11089 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11090 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11091 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11092 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11093 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11094 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11095 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11096 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11097 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11098 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11099 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11100 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11101 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11102 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11107 static const struct hda_model_fixup alc662_fixup_models[] = {
11108 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11109 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
11110 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
11111 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
11112 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11113 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11114 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11115 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11116 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11117 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11118 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11119 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
11120 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
11121 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
11122 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
11123 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11124 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11125 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11126 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11127 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11128 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11129 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11130 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11131 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
11132 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
11133 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11134 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11135 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11136 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11137 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
11138 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11139 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
11143 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
11144 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11145 {0x17, 0x02211010},
11146 {0x18, 0x01a19030},
11147 {0x1a, 0x01813040},
11148 {0x21, 0x01014020}),
11149 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11150 {0x16, 0x01813030},
11151 {0x17, 0x02211010},
11152 {0x18, 0x01a19040},
11153 {0x21, 0x01014020}),
11154 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11155 {0x14, 0x01014010},
11156 {0x18, 0x01a19020},
11157 {0x1a, 0x0181302f},
11158 {0x1b, 0x0221401f}),
11159 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11160 {0x12, 0x99a30130},
11161 {0x14, 0x90170110},
11162 {0x15, 0x0321101f},
11163 {0x16, 0x03011020}),
11164 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11165 {0x12, 0x99a30140},
11166 {0x14, 0x90170110},
11167 {0x15, 0x0321101f},
11168 {0x16, 0x03011020}),
11169 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11170 {0x12, 0x99a30150},
11171 {0x14, 0x90170110},
11172 {0x15, 0x0321101f},
11173 {0x16, 0x03011020}),
11174 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11175 {0x14, 0x90170110},
11176 {0x15, 0x0321101f},
11177 {0x16, 0x03011020}),
11178 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11179 {0x12, 0x90a60130},
11180 {0x14, 0x90170110},
11181 {0x15, 0x0321101f}),
11182 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11183 {0x14, 0x01014010},
11184 {0x17, 0x90170150},
11185 {0x19, 0x02a11060},
11186 {0x1b, 0x01813030},
11187 {0x21, 0x02211020}),
11188 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11189 {0x14, 0x01014010},
11190 {0x18, 0x01a19040},
11191 {0x1b, 0x01813030},
11192 {0x21, 0x02211020}),
11193 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11194 {0x14, 0x01014020},
11195 {0x17, 0x90170110},
11196 {0x18, 0x01a19050},
11197 {0x1b, 0x01813040},
11198 {0x21, 0x02211030}),
11204 static int patch_alc662(struct hda_codec *codec)
11206 struct alc_spec *spec;
11209 err = alc_alloc_spec(codec, 0x0b);
11213 spec = codec->spec;
11215 spec->shutup = alc_eapd_shutup;
11217 /* handle multiple HPs as is */
11218 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11220 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11222 switch (codec->core.vendor_id) {
11224 spec->init_hook = alc668_restore_default_value;
11228 alc_pre_init(codec);
11230 snd_hda_pick_fixup(codec, alc662_fixup_models,
11231 alc662_fixup_tbl, alc662_fixups);
11232 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
11233 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11235 alc_auto_parse_customize_define(codec);
11237 if (has_cdefine_beep(codec))
11238 spec->gen.beep_nid = 0x01;
11240 if ((alc_get_coef0(codec) & (1 << 14)) &&
11241 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
11242 spec->cdefine.platform_type == 1) {
11243 err = alc_codec_rename(codec, "ALC272X");
11248 /* automatic parse from the BIOS config */
11249 err = alc662_parse_auto_config(codec);
11253 if (!spec->gen.no_analog && spec->gen.beep_nid) {
11254 switch (codec->core.vendor_id) {
11256 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11262 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
11265 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
11272 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11285 static int alc680_parse_auto_config(struct hda_codec *codec)
11287 return alc_parse_auto_config(codec, NULL, NULL);
11292 static int patch_alc680(struct hda_codec *codec)
11296 /* ALC680 has no aa-loopback mixer */
11297 err = alc_alloc_spec(codec, 0);
11301 /* automatic parse from the BIOS config */
11302 err = alc680_parse_auto_config(codec);
11314 static const struct hda_device_id snd_hda_id_realtek[] = {
11315 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
11316 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
11317 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
11318 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
11319 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
11320 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11321 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
11322 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
11323 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
11324 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
11325 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
11326 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11327 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
11328 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
11329 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11330 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11331 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11332 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11333 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11334 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11335 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
11336 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
11337 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11338 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11339 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11340 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11341 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11342 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
11343 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
11344 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
11345 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
11346 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
11347 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
11348 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11349 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11350 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
11351 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
11352 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
11353 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
11354 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
11355 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
11356 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
11357 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11358 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11359 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11360 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11361 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11362 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11363 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11364 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11365 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11366 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11367 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11368 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11369 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11370 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
11371 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11372 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11373 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
11374 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
11375 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
11376 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11377 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11378 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11379 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11380 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11381 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11382 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11383 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11384 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11385 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11386 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
11387 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
11388 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11389 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
11390 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
11391 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
11392 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
11393 {} /* terminator */
11395 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
11397 MODULE_LICENSE("GPL");
11398 MODULE_DESCRIPTION("Realtek HD-audio codec");
11400 static struct hda_codec_driver realtek_driver = {
11401 .id = snd_hda_id_realtek,
11404 module_hda_codec_driver(realtek_driver);