1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine;
82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
88 bool gpio_write_delay; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity;
92 int micmute_led_polarity;
93 hda_nid_t mute_led_nid;
94 hda_nid_t cap_mute_led_nid;
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
101 hda_nid_t headset_mic_pin;
102 hda_nid_t headphone_mic_pin;
103 int current_headset_mode;
104 int current_headset_type;
107 void (*init_hook)(struct hda_codec *codec);
109 void (*power_hook)(struct hda_codec *codec);
111 void (*shutup)(struct hda_codec *codec);
112 void (*reboot_notify)(struct hda_codec *codec);
115 int codec_variant; /* flag for other variants */
116 unsigned int has_alc5505_dsp:1;
117 unsigned int no_depop_delay:1;
118 unsigned int done_hp_init:1;
119 unsigned int no_shutup_pins:1;
120 unsigned int ultra_low_power:1;
121 unsigned int has_hs_key:1;
122 unsigned int no_internal_mic_pin:1;
126 unsigned int pll_coef_idx, pll_coef_bit;
128 struct input_dev *kb_dev;
129 u8 alc_mute_keycode_map[1];
133 * COEF access helper functions
136 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
137 unsigned int coef_idx)
141 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
142 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
146 #define alc_read_coef_idx(codec, coef_idx) \
147 alc_read_coefex_idx(codec, 0x20, coef_idx)
149 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
150 unsigned int coef_idx, unsigned int coef_val)
152 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
153 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
156 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
157 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
159 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
160 unsigned int coef_idx, unsigned int mask,
161 unsigned int bits_set)
163 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
166 alc_write_coefex_idx(codec, nid, coef_idx,
167 (val & ~mask) | bits_set);
170 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
171 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
173 /* a special bypass for COEF 0; read the cached value at the second time */
174 static unsigned int alc_get_coef0(struct hda_codec *codec)
176 struct alc_spec *spec = codec->spec;
179 spec->coef0 = alc_read_coef_idx(codec, 0);
183 /* coef writes/updates batch */
191 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
192 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
193 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
194 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
195 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
197 static void alc_process_coef_fw(struct hda_codec *codec,
198 const struct coef_fw *fw)
200 for (; fw->nid; fw++) {
201 if (fw->mask == (unsigned short)-1)
202 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
204 alc_update_coefex_idx(codec, fw->nid, fw->idx,
210 * GPIO setup tables, used in initialization
213 /* Enable GPIO mask and set output */
214 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
216 struct alc_spec *spec = codec->spec;
218 spec->gpio_mask |= mask;
219 spec->gpio_dir |= mask;
220 spec->gpio_data |= mask;
223 static void alc_write_gpio_data(struct hda_codec *codec)
225 struct alc_spec *spec = codec->spec;
227 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
231 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
234 struct alc_spec *spec = codec->spec;
235 unsigned int oldval = spec->gpio_data;
238 spec->gpio_data |= mask;
240 spec->gpio_data &= ~mask;
241 if (oldval != spec->gpio_data)
242 alc_write_gpio_data(codec);
245 static void alc_write_gpio(struct hda_codec *codec)
247 struct alc_spec *spec = codec->spec;
249 if (!spec->gpio_mask)
252 snd_hda_codec_write(codec, codec->core.afg, 0,
253 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
254 snd_hda_codec_write(codec, codec->core.afg, 0,
255 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
256 if (spec->gpio_write_delay)
258 alc_write_gpio_data(codec);
261 static void alc_fixup_gpio(struct hda_codec *codec, int action,
264 if (action == HDA_FIXUP_ACT_PRE_PROBE)
265 alc_setup_gpio(codec, mask);
268 static void alc_fixup_gpio1(struct hda_codec *codec,
269 const struct hda_fixup *fix, int action)
271 alc_fixup_gpio(codec, action, 0x01);
274 static void alc_fixup_gpio2(struct hda_codec *codec,
275 const struct hda_fixup *fix, int action)
277 alc_fixup_gpio(codec, action, 0x02);
280 static void alc_fixup_gpio3(struct hda_codec *codec,
281 const struct hda_fixup *fix, int action)
283 alc_fixup_gpio(codec, action, 0x03);
286 static void alc_fixup_gpio4(struct hda_codec *codec,
287 const struct hda_fixup *fix, int action)
289 alc_fixup_gpio(codec, action, 0x04);
292 static void alc_fixup_micmute_led(struct hda_codec *codec,
293 const struct hda_fixup *fix, int action)
295 if (action == HDA_FIXUP_ACT_PROBE)
296 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
300 * Fix hardware PLL issue
301 * On some codecs, the analog PLL gating control must be off while
302 * the default value is 1.
304 static void alc_fix_pll(struct hda_codec *codec)
306 struct alc_spec *spec = codec->spec;
309 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
310 1 << spec->pll_coef_bit, 0);
313 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
314 unsigned int coef_idx, unsigned int coef_bit)
316 struct alc_spec *spec = codec->spec;
318 spec->pll_coef_idx = coef_idx;
319 spec->pll_coef_bit = coef_bit;
323 /* update the master volume per volume-knob's unsol event */
324 static void alc_update_knob_master(struct hda_codec *codec,
325 struct hda_jack_callback *jack)
328 struct snd_kcontrol *kctl;
329 struct snd_ctl_elem_value *uctl;
331 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
334 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
337 val = snd_hda_codec_read(codec, jack->nid, 0,
338 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
339 val &= HDA_AMP_VOLMASK;
340 uctl->value.integer.value[0] = val;
341 uctl->value.integer.value[1] = val;
342 kctl->put(kctl, uctl);
346 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
348 /* For some reason, the res given from ALC880 is broken.
349 Here we adjust it properly. */
350 snd_hda_jack_unsol_event(codec, res >> 2);
353 /* Change EAPD to verb control */
354 static void alc_fill_eapd_coef(struct hda_codec *codec)
358 coef = alc_get_coef0(codec);
360 switch (codec->core.vendor_id) {
362 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
366 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
369 if ((coef & 0x00f0) == 0x0010)
370 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
371 if ((coef & 0x00f0) == 0x0020)
372 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
373 if ((coef & 0x00f0) == 0x0030)
374 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
380 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
385 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
404 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
407 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
410 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
419 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
422 if ((coef & 0x00f0) == 0x0030)
423 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
432 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
436 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
439 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
442 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
445 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
446 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
450 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
457 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
462 /* additional initialization for ALC888 variants */
463 static void alc888_coef_init(struct hda_codec *codec)
465 switch (alc_get_coef0(codec) & 0x00f0) {
470 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
475 /* turn on/off EAPD control (only if available) */
476 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
478 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
480 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
481 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
485 /* turn on/off EAPD controls of the codec */
486 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
488 /* We currently only handle front, HP */
489 static const hda_nid_t pins[] = {
490 0x0f, 0x10, 0x14, 0x15, 0x17, 0
493 for (p = pins; *p; p++)
494 set_eapd(codec, *p, on);
497 static int find_ext_mic_pin(struct hda_codec *codec);
499 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
501 const struct hda_pincfg *pin;
502 int mic_pin = find_ext_mic_pin(codec);
505 /* don't shut up pins when unloading the driver; otherwise it breaks
506 * the default pin setup at the next load of the driver
508 if (codec->bus->shutdown)
511 snd_array_for_each(&codec->init_pins, i, pin) {
512 /* use read here for syncing after issuing each verb */
513 if (pin->nid != mic_pin)
514 snd_hda_codec_read(codec, pin->nid, 0,
515 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
518 codec->pins_shutup = 1;
521 static void alc_shutup_pins(struct hda_codec *codec)
523 struct alc_spec *spec = codec->spec;
525 switch (codec->core.vendor_id) {
530 alc_headset_mic_no_shutup(codec);
533 if (!spec->no_shutup_pins)
534 snd_hda_shutup_pins(codec);
539 /* generic shutup callback;
540 * just turning off EAPD and a little pause for avoiding pop-noise
542 static void alc_eapd_shutup(struct hda_codec *codec)
544 struct alc_spec *spec = codec->spec;
546 alc_auto_setup_eapd(codec, false);
547 if (!spec->no_depop_delay)
549 alc_shutup_pins(codec);
552 /* generic EAPD initialization */
553 static void alc_auto_init_amp(struct hda_codec *codec, int type)
555 alc_auto_setup_eapd(codec, true);
556 alc_write_gpio(codec);
558 case ALC_INIT_DEFAULT:
559 switch (codec->core.vendor_id) {
561 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
567 alc_update_coef_idx(codec, 7, 0, 0x2030);
570 alc888_coef_init(codec);
577 /* get a primary headphone pin if available */
578 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
580 if (spec->gen.autocfg.hp_pins[0])
581 return spec->gen.autocfg.hp_pins[0];
582 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
583 return spec->gen.autocfg.line_out_pins[0];
588 * Realtek SSID verification
591 /* Could be any non-zero and even value. When used as fixup, tells
592 * the driver to ignore any present sku defines.
594 #define ALC_FIXUP_SKU_IGNORE (2)
596 static void alc_fixup_sku_ignore(struct hda_codec *codec,
597 const struct hda_fixup *fix, int action)
599 struct alc_spec *spec = codec->spec;
600 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
601 spec->cdefine.fixup = 1;
602 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
606 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
607 const struct hda_fixup *fix, int action)
609 struct alc_spec *spec = codec->spec;
611 if (action == HDA_FIXUP_ACT_PROBE) {
612 spec->no_depop_delay = 1;
613 codec->depop_delay = 0;
617 static int alc_auto_parse_customize_define(struct hda_codec *codec)
619 unsigned int ass, tmp, i;
621 struct alc_spec *spec = codec->spec;
623 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
625 if (spec->cdefine.fixup) {
626 ass = spec->cdefine.sku_cfg;
627 if (ass == ALC_FIXUP_SKU_IGNORE)
632 if (!codec->bus->pci)
634 ass = codec->core.subsystem_id & 0xffff;
635 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
639 if (codec->core.vendor_id == 0x10ec0260)
641 ass = snd_hda_codec_get_pincfg(codec, nid);
644 codec_info(codec, "%s: SKU not ready 0x%08x\n",
645 codec->core.chip_name, ass);
651 for (i = 1; i < 16; i++) {
655 if (((ass >> 16) & 0xf) != tmp)
658 spec->cdefine.port_connectivity = ass >> 30;
659 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
660 spec->cdefine.check_sum = (ass >> 16) & 0xf;
661 spec->cdefine.customization = ass >> 8;
663 spec->cdefine.sku_cfg = ass;
664 spec->cdefine.external_amp = (ass & 0x38) >> 3;
665 spec->cdefine.platform_type = (ass & 0x4) >> 2;
666 spec->cdefine.swap = (ass & 0x2) >> 1;
667 spec->cdefine.override = ass & 0x1;
669 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
670 nid, spec->cdefine.sku_cfg);
671 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
672 spec->cdefine.port_connectivity);
673 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
674 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
675 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
676 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
677 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
678 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
679 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
684 /* return the position of NID in the list, or -1 if not found */
685 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
688 for (i = 0; i < nums; i++)
693 /* return true if the given NID is found in the list */
694 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
696 return find_idx_in_nid_list(nid, list, nums) >= 0;
699 /* check subsystem ID and set up device-specific initialization;
700 * return 1 if initialized, 0 if invalid SSID
702 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
703 * 31 ~ 16 : Manufacture ID
705 * 7 ~ 0 : Assembly ID
706 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
708 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
710 unsigned int ass, tmp, i;
712 struct alc_spec *spec = codec->spec;
714 if (spec->cdefine.fixup) {
715 ass = spec->cdefine.sku_cfg;
716 if (ass == ALC_FIXUP_SKU_IGNORE)
721 ass = codec->core.subsystem_id & 0xffff;
722 if (codec->bus->pci &&
723 ass != codec->bus->pci->subsystem_device && (ass & 1))
726 /* invalid SSID, check the special NID pin defcfg instead */
728 * 31~30 : port connectivity
731 * 19~16 : Check sum (15:1)
736 if (codec->core.vendor_id == 0x10ec0260)
738 ass = snd_hda_codec_get_pincfg(codec, nid);
740 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
744 if ((ass >> 30) != 1) /* no physical connection */
749 for (i = 1; i < 16; i++) {
753 if (((ass >> 16) & 0xf) != tmp)
756 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
757 ass & 0xffff, codec->core.vendor_id);
761 * 2 : 0 --> Desktop, 1 --> Laptop
762 * 3~5 : External Amplifier control
765 tmp = (ass & 0x38) >> 3; /* external Amp control */
766 if (spec->init_amp == ALC_INIT_UNDEFINED) {
769 alc_setup_gpio(codec, 0x01);
772 alc_setup_gpio(codec, 0x02);
775 alc_setup_gpio(codec, 0x03);
779 spec->init_amp = ALC_INIT_DEFAULT;
784 /* is laptop or Desktop and enable the function "Mute internal speaker
785 * when the external headphone out jack is plugged"
790 * 10~8 : Jack location
791 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
793 * 15 : 1 --> enable the function "Mute internal speaker
794 * when the external headphone out jack is plugged"
796 if (!alc_get_hp_pin(spec)) {
798 tmp = (ass >> 11) & 0x3; /* HP to chassis */
800 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
801 spec->gen.autocfg.line_outs))
803 spec->gen.autocfg.hp_pins[0] = nid;
808 /* Check the validity of ALC subsystem-id
809 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
810 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
812 if (!alc_subsystem_id(codec, ports)) {
813 struct alc_spec *spec = codec->spec;
814 if (spec->init_amp == ALC_INIT_UNDEFINED) {
816 "realtek: Enable default setup for auto mode as fallback\n");
817 spec->init_amp = ALC_INIT_DEFAULT;
825 static void alc_fixup_inv_dmic(struct hda_codec *codec,
826 const struct hda_fixup *fix, int action)
828 struct alc_spec *spec = codec->spec;
830 spec->gen.inv_dmic_split = 1;
834 static int alc_build_controls(struct hda_codec *codec)
838 err = snd_hda_gen_build_controls(codec);
842 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
851 static void alc_pre_init(struct hda_codec *codec)
853 alc_fill_eapd_coef(codec);
856 #define is_s3_resume(codec) \
857 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
858 #define is_s4_resume(codec) \
859 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
861 static int alc_init(struct hda_codec *codec)
863 struct alc_spec *spec = codec->spec;
865 /* hibernation resume needs the full chip initialization */
866 if (is_s4_resume(codec))
870 spec->init_hook(codec);
872 spec->gen.skip_verbs = 1; /* applied in below */
873 snd_hda_gen_init(codec);
875 alc_auto_init_amp(codec, spec->init_amp);
876 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
878 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
883 static inline void alc_shutup(struct hda_codec *codec)
885 struct alc_spec *spec = codec->spec;
887 if (!snd_hda_get_bool_hint(codec, "shutup"))
888 return; /* disabled explicitly by hints */
890 if (spec && spec->shutup)
893 alc_shutup_pins(codec);
896 static void alc_reboot_notify(struct hda_codec *codec)
898 struct alc_spec *spec = codec->spec;
900 if (spec && spec->reboot_notify)
901 spec->reboot_notify(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,
951 .reboot_notify = alc_reboot_notify,
955 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
958 * Rename codecs appropriately from COEF value or subvendor id
960 struct alc_codec_rename_table {
961 unsigned int vendor_id;
962 unsigned short coef_mask;
963 unsigned short coef_bits;
967 struct alc_codec_rename_pci_table {
968 unsigned int codec_vendor_id;
969 unsigned short pci_subvendor;
970 unsigned short pci_subdevice;
974 static const struct alc_codec_rename_table rename_tbl[] = {
975 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
976 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
977 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
978 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
979 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
980 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
981 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
982 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
983 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
984 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
985 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
986 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
987 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
988 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
989 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
990 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
991 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
995 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
996 { 0x10ec0280, 0x1028, 0, "ALC3220" },
997 { 0x10ec0282, 0x1028, 0, "ALC3221" },
998 { 0x10ec0283, 0x1028, 0, "ALC3223" },
999 { 0x10ec0288, 0x1028, 0, "ALC3263" },
1000 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1001 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1002 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1003 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1004 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1005 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1006 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1007 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1008 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1009 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1010 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1011 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1012 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1013 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1014 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1015 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1016 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1017 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1018 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1019 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1020 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1021 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1022 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1023 { } /* terminator */
1026 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1028 const struct alc_codec_rename_table *p;
1029 const struct alc_codec_rename_pci_table *q;
1031 for (p = rename_tbl; p->vendor_id; p++) {
1032 if (p->vendor_id != codec->core.vendor_id)
1034 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1035 return alc_codec_rename(codec, p->name);
1038 if (!codec->bus->pci)
1040 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1041 if (q->codec_vendor_id != codec->core.vendor_id)
1043 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1045 if (!q->pci_subdevice ||
1046 q->pci_subdevice == codec->bus->pci->subsystem_device)
1047 return alc_codec_rename(codec, q->name);
1055 * Digital-beep handlers
1057 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1059 /* additional beep mixers; private_value will be overwritten */
1060 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1061 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1062 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1065 /* set up and create beep controls */
1066 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1069 struct snd_kcontrol_new *knew;
1070 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1073 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1074 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1075 &alc_beep_mixer[i]);
1078 knew->private_value = beep_amp;
1083 static const struct snd_pci_quirk beep_allow_list[] = {
1084 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1085 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1086 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1087 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1088 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1089 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1090 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1091 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1092 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1093 /* denylist -- no beep available */
1094 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1095 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1099 static inline int has_cdefine_beep(struct hda_codec *codec)
1101 struct alc_spec *spec = codec->spec;
1102 const struct snd_pci_quirk *q;
1103 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1106 return spec->cdefine.enable_pcbeep;
1109 #define set_beep_amp(spec, nid, idx, dir) 0
1110 #define has_cdefine_beep(codec) 0
1113 /* parse the BIOS configuration and set up the alc_spec */
1114 /* return 1 if successful, 0 if the proper config is not found,
1115 * or a negative error code
1117 static int alc_parse_auto_config(struct hda_codec *codec,
1118 const hda_nid_t *ignore_nids,
1119 const hda_nid_t *ssid_nids)
1121 struct alc_spec *spec = codec->spec;
1122 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1125 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1131 alc_ssid_check(codec, ssid_nids);
1133 err = snd_hda_gen_parse_auto_config(codec, cfg);
1140 /* common preparation job for alc_spec */
1141 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1143 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1149 snd_hda_gen_spec_init(&spec->gen);
1150 spec->gen.mixer_nid = mixer_nid;
1151 spec->gen.own_eapd_ctl = 1;
1152 codec->single_adc_amp = 1;
1153 /* FIXME: do we need this for all Realtek codec models? */
1154 codec->spdif_status_reset = 1;
1155 codec->forced_resume = 1;
1156 codec->patch_ops = alc_patch_ops;
1158 err = alc_codec_rename_from_preset(codec);
1166 static int alc880_parse_auto_config(struct hda_codec *codec)
1168 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1169 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1170 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1179 ALC880_FIXUP_MEDION_RIM,
1181 ALC880_FIXUP_LG_LW25,
1183 ALC880_FIXUP_EAPD_COEF,
1184 ALC880_FIXUP_TCL_S700,
1185 ALC880_FIXUP_VOL_KNOB,
1186 ALC880_FIXUP_FUJITSU,
1188 ALC880_FIXUP_UNIWILL,
1189 ALC880_FIXUP_UNIWILL_DIG,
1191 ALC880_FIXUP_ASUS_W5A,
1192 ALC880_FIXUP_3ST_BASE,
1194 ALC880_FIXUP_3ST_DIG,
1195 ALC880_FIXUP_5ST_BASE,
1197 ALC880_FIXUP_5ST_DIG,
1198 ALC880_FIXUP_6ST_BASE,
1200 ALC880_FIXUP_6ST_DIG,
1201 ALC880_FIXUP_6ST_AUTOMUTE,
1204 /* enable the volume-knob widget support on NID 0x21 */
1205 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1206 const struct hda_fixup *fix, int action)
1208 if (action == HDA_FIXUP_ACT_PROBE)
1209 snd_hda_jack_detect_enable_callback(codec, 0x21,
1210 alc_update_knob_master);
1213 static const struct hda_fixup alc880_fixups[] = {
1214 [ALC880_FIXUP_GPIO1] = {
1215 .type = HDA_FIXUP_FUNC,
1216 .v.func = alc_fixup_gpio1,
1218 [ALC880_FIXUP_GPIO2] = {
1219 .type = HDA_FIXUP_FUNC,
1220 .v.func = alc_fixup_gpio2,
1222 [ALC880_FIXUP_MEDION_RIM] = {
1223 .type = HDA_FIXUP_VERBS,
1224 .v.verbs = (const struct hda_verb[]) {
1225 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1226 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1230 .chain_id = ALC880_FIXUP_GPIO2,
1232 [ALC880_FIXUP_LG] = {
1233 .type = HDA_FIXUP_PINS,
1234 .v.pins = (const struct hda_pintbl[]) {
1235 /* disable bogus unused pins */
1236 { 0x16, 0x411111f0 },
1237 { 0x18, 0x411111f0 },
1238 { 0x1a, 0x411111f0 },
1242 [ALC880_FIXUP_LG_LW25] = {
1243 .type = HDA_FIXUP_PINS,
1244 .v.pins = (const struct hda_pintbl[]) {
1245 { 0x1a, 0x0181344f }, /* line-in */
1246 { 0x1b, 0x0321403f }, /* headphone */
1250 [ALC880_FIXUP_W810] = {
1251 .type = HDA_FIXUP_PINS,
1252 .v.pins = (const struct hda_pintbl[]) {
1253 /* disable bogus unused pins */
1254 { 0x17, 0x411111f0 },
1258 .chain_id = ALC880_FIXUP_GPIO2,
1260 [ALC880_FIXUP_EAPD_COEF] = {
1261 .type = HDA_FIXUP_VERBS,
1262 .v.verbs = (const struct hda_verb[]) {
1263 /* change to EAPD mode */
1264 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1265 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1269 [ALC880_FIXUP_TCL_S700] = {
1270 .type = HDA_FIXUP_VERBS,
1271 .v.verbs = (const struct hda_verb[]) {
1272 /* change to EAPD mode */
1273 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1274 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1278 .chain_id = ALC880_FIXUP_GPIO2,
1280 [ALC880_FIXUP_VOL_KNOB] = {
1281 .type = HDA_FIXUP_FUNC,
1282 .v.func = alc880_fixup_vol_knob,
1284 [ALC880_FIXUP_FUJITSU] = {
1285 /* override all pins as BIOS on old Amilo is broken */
1286 .type = HDA_FIXUP_PINS,
1287 .v.pins = (const struct hda_pintbl[]) {
1288 { 0x14, 0x0121401f }, /* HP */
1289 { 0x15, 0x99030120 }, /* speaker */
1290 { 0x16, 0x99030130 }, /* bass speaker */
1291 { 0x17, 0x411111f0 }, /* N/A */
1292 { 0x18, 0x411111f0 }, /* N/A */
1293 { 0x19, 0x01a19950 }, /* mic-in */
1294 { 0x1a, 0x411111f0 }, /* N/A */
1295 { 0x1b, 0x411111f0 }, /* N/A */
1296 { 0x1c, 0x411111f0 }, /* N/A */
1297 { 0x1d, 0x411111f0 }, /* N/A */
1298 { 0x1e, 0x01454140 }, /* SPDIF out */
1302 .chain_id = ALC880_FIXUP_VOL_KNOB,
1304 [ALC880_FIXUP_F1734] = {
1305 /* almost compatible with FUJITSU, but no bass and SPDIF */
1306 .type = HDA_FIXUP_PINS,
1307 .v.pins = (const struct hda_pintbl[]) {
1308 { 0x14, 0x0121401f }, /* HP */
1309 { 0x15, 0x99030120 }, /* speaker */
1310 { 0x16, 0x411111f0 }, /* N/A */
1311 { 0x17, 0x411111f0 }, /* N/A */
1312 { 0x18, 0x411111f0 }, /* N/A */
1313 { 0x19, 0x01a19950 }, /* mic-in */
1314 { 0x1a, 0x411111f0 }, /* N/A */
1315 { 0x1b, 0x411111f0 }, /* N/A */
1316 { 0x1c, 0x411111f0 }, /* N/A */
1317 { 0x1d, 0x411111f0 }, /* N/A */
1318 { 0x1e, 0x411111f0 }, /* N/A */
1322 .chain_id = ALC880_FIXUP_VOL_KNOB,
1324 [ALC880_FIXUP_UNIWILL] = {
1325 /* need to fix HP and speaker pins to be parsed correctly */
1326 .type = HDA_FIXUP_PINS,
1327 .v.pins = (const struct hda_pintbl[]) {
1328 { 0x14, 0x0121411f }, /* HP */
1329 { 0x15, 0x99030120 }, /* speaker */
1330 { 0x16, 0x99030130 }, /* bass speaker */
1334 [ALC880_FIXUP_UNIWILL_DIG] = {
1335 .type = HDA_FIXUP_PINS,
1336 .v.pins = (const struct hda_pintbl[]) {
1337 /* disable bogus unused pins */
1338 { 0x17, 0x411111f0 },
1339 { 0x19, 0x411111f0 },
1340 { 0x1b, 0x411111f0 },
1341 { 0x1f, 0x411111f0 },
1345 [ALC880_FIXUP_Z71V] = {
1346 .type = HDA_FIXUP_PINS,
1347 .v.pins = (const struct hda_pintbl[]) {
1348 /* set up the whole pins as BIOS is utterly broken */
1349 { 0x14, 0x99030120 }, /* speaker */
1350 { 0x15, 0x0121411f }, /* HP */
1351 { 0x16, 0x411111f0 }, /* N/A */
1352 { 0x17, 0x411111f0 }, /* N/A */
1353 { 0x18, 0x01a19950 }, /* mic-in */
1354 { 0x19, 0x411111f0 }, /* N/A */
1355 { 0x1a, 0x01813031 }, /* line-in */
1356 { 0x1b, 0x411111f0 }, /* N/A */
1357 { 0x1c, 0x411111f0 }, /* N/A */
1358 { 0x1d, 0x411111f0 }, /* N/A */
1359 { 0x1e, 0x0144111e }, /* SPDIF */
1363 [ALC880_FIXUP_ASUS_W5A] = {
1364 .type = HDA_FIXUP_PINS,
1365 .v.pins = (const struct hda_pintbl[]) {
1366 /* set up the whole pins as BIOS is utterly broken */
1367 { 0x14, 0x0121411f }, /* HP */
1368 { 0x15, 0x411111f0 }, /* N/A */
1369 { 0x16, 0x411111f0 }, /* N/A */
1370 { 0x17, 0x411111f0 }, /* N/A */
1371 { 0x18, 0x90a60160 }, /* mic */
1372 { 0x19, 0x411111f0 }, /* N/A */
1373 { 0x1a, 0x411111f0 }, /* N/A */
1374 { 0x1b, 0x411111f0 }, /* N/A */
1375 { 0x1c, 0x411111f0 }, /* N/A */
1376 { 0x1d, 0x411111f0 }, /* N/A */
1377 { 0x1e, 0xb743111e }, /* SPDIF out */
1381 .chain_id = ALC880_FIXUP_GPIO1,
1383 [ALC880_FIXUP_3ST_BASE] = {
1384 .type = HDA_FIXUP_PINS,
1385 .v.pins = (const struct hda_pintbl[]) {
1386 { 0x14, 0x01014010 }, /* line-out */
1387 { 0x15, 0x411111f0 }, /* N/A */
1388 { 0x16, 0x411111f0 }, /* N/A */
1389 { 0x17, 0x411111f0 }, /* N/A */
1390 { 0x18, 0x01a19c30 }, /* mic-in */
1391 { 0x19, 0x0121411f }, /* HP */
1392 { 0x1a, 0x01813031 }, /* line-in */
1393 { 0x1b, 0x02a19c40 }, /* front-mic */
1394 { 0x1c, 0x411111f0 }, /* N/A */
1395 { 0x1d, 0x411111f0 }, /* N/A */
1396 /* 0x1e is filled in below */
1397 { 0x1f, 0x411111f0 }, /* N/A */
1401 [ALC880_FIXUP_3ST] = {
1402 .type = HDA_FIXUP_PINS,
1403 .v.pins = (const struct hda_pintbl[]) {
1404 { 0x1e, 0x411111f0 }, /* N/A */
1408 .chain_id = ALC880_FIXUP_3ST_BASE,
1410 [ALC880_FIXUP_3ST_DIG] = {
1411 .type = HDA_FIXUP_PINS,
1412 .v.pins = (const struct hda_pintbl[]) {
1413 { 0x1e, 0x0144111e }, /* SPDIF */
1417 .chain_id = ALC880_FIXUP_3ST_BASE,
1419 [ALC880_FIXUP_5ST_BASE] = {
1420 .type = HDA_FIXUP_PINS,
1421 .v.pins = (const struct hda_pintbl[]) {
1422 { 0x14, 0x01014010 }, /* front */
1423 { 0x15, 0x411111f0 }, /* N/A */
1424 { 0x16, 0x01011411 }, /* CLFE */
1425 { 0x17, 0x01016412 }, /* surr */
1426 { 0x18, 0x01a19c30 }, /* mic-in */
1427 { 0x19, 0x0121411f }, /* HP */
1428 { 0x1a, 0x01813031 }, /* line-in */
1429 { 0x1b, 0x02a19c40 }, /* front-mic */
1430 { 0x1c, 0x411111f0 }, /* N/A */
1431 { 0x1d, 0x411111f0 }, /* N/A */
1432 /* 0x1e is filled in below */
1433 { 0x1f, 0x411111f0 }, /* N/A */
1437 [ALC880_FIXUP_5ST] = {
1438 .type = HDA_FIXUP_PINS,
1439 .v.pins = (const struct hda_pintbl[]) {
1440 { 0x1e, 0x411111f0 }, /* N/A */
1444 .chain_id = ALC880_FIXUP_5ST_BASE,
1446 [ALC880_FIXUP_5ST_DIG] = {
1447 .type = HDA_FIXUP_PINS,
1448 .v.pins = (const struct hda_pintbl[]) {
1449 { 0x1e, 0x0144111e }, /* SPDIF */
1453 .chain_id = ALC880_FIXUP_5ST_BASE,
1455 [ALC880_FIXUP_6ST_BASE] = {
1456 .type = HDA_FIXUP_PINS,
1457 .v.pins = (const struct hda_pintbl[]) {
1458 { 0x14, 0x01014010 }, /* front */
1459 { 0x15, 0x01016412 }, /* surr */
1460 { 0x16, 0x01011411 }, /* CLFE */
1461 { 0x17, 0x01012414 }, /* side */
1462 { 0x18, 0x01a19c30 }, /* mic-in */
1463 { 0x19, 0x02a19c40 }, /* front-mic */
1464 { 0x1a, 0x01813031 }, /* line-in */
1465 { 0x1b, 0x0121411f }, /* HP */
1466 { 0x1c, 0x411111f0 }, /* N/A */
1467 { 0x1d, 0x411111f0 }, /* N/A */
1468 /* 0x1e is filled in below */
1469 { 0x1f, 0x411111f0 }, /* N/A */
1473 [ALC880_FIXUP_6ST] = {
1474 .type = HDA_FIXUP_PINS,
1475 .v.pins = (const struct hda_pintbl[]) {
1476 { 0x1e, 0x411111f0 }, /* N/A */
1480 .chain_id = ALC880_FIXUP_6ST_BASE,
1482 [ALC880_FIXUP_6ST_DIG] = {
1483 .type = HDA_FIXUP_PINS,
1484 .v.pins = (const struct hda_pintbl[]) {
1485 { 0x1e, 0x0144111e }, /* SPDIF */
1489 .chain_id = ALC880_FIXUP_6ST_BASE,
1491 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1492 .type = HDA_FIXUP_PINS,
1493 .v.pins = (const struct hda_pintbl[]) {
1494 { 0x1b, 0x0121401f }, /* HP with jack detect */
1497 .chained_before = true,
1498 .chain_id = ALC880_FIXUP_6ST_BASE,
1502 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1503 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1504 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1505 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1506 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1507 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1508 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1509 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1510 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1511 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1512 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1513 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1514 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1515 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1516 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1517 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1518 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1519 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1520 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1521 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1522 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1523 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1524 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1525 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1527 /* Below is the copied entries from alc880_quirks.c.
1528 * It's not quite sure whether BIOS sets the correct pin-config table
1529 * on these machines, thus they are kept to be compatible with
1530 * the old static quirks. Once when it's confirmed to work without
1531 * these overrides, it'd be better to remove.
1533 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1534 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1535 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1536 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1537 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1538 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1539 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1540 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1541 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1542 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1543 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1544 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1545 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1546 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1547 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1548 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1549 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1550 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1551 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1552 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1553 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1554 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1555 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1556 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1557 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1558 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1559 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1560 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1561 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1562 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1563 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1564 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1565 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1567 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1568 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1569 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1573 static const struct hda_model_fixup alc880_fixup_models[] = {
1574 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1575 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1576 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1577 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1578 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1579 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1580 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1586 * OK, here we have finally the patch for ALC880
1588 static int patch_alc880(struct hda_codec *codec)
1590 struct alc_spec *spec;
1593 err = alc_alloc_spec(codec, 0x0b);
1598 spec->gen.need_dac_fix = 1;
1599 spec->gen.beep_nid = 0x01;
1601 codec->patch_ops.unsol_event = alc880_unsol_event;
1603 alc_pre_init(codec);
1605 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1607 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1609 /* automatic parse from the BIOS config */
1610 err = alc880_parse_auto_config(codec);
1614 if (!spec->gen.no_analog) {
1615 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1620 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1633 static int alc260_parse_auto_config(struct hda_codec *codec)
1635 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1636 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1637 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1644 ALC260_FIXUP_HP_DC5750,
1645 ALC260_FIXUP_HP_PIN_0F,
1648 ALC260_FIXUP_GPIO1_TOGGLE,
1649 ALC260_FIXUP_REPLACER,
1650 ALC260_FIXUP_HP_B1900,
1652 ALC260_FIXUP_FSC_S7020,
1653 ALC260_FIXUP_FSC_S7020_JWSE,
1654 ALC260_FIXUP_VAIO_PINS,
1657 static void alc260_gpio1_automute(struct hda_codec *codec)
1659 struct alc_spec *spec = codec->spec;
1661 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1664 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1665 const struct hda_fixup *fix, int action)
1667 struct alc_spec *spec = codec->spec;
1668 if (action == HDA_FIXUP_ACT_PROBE) {
1669 /* although the machine has only one output pin, we need to
1670 * toggle GPIO1 according to the jack state
1672 spec->gen.automute_hook = alc260_gpio1_automute;
1673 spec->gen.detect_hp = 1;
1674 spec->gen.automute_speaker = 1;
1675 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1676 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1677 snd_hda_gen_hp_automute);
1678 alc_setup_gpio(codec, 0x01);
1682 static void alc260_fixup_kn1(struct hda_codec *codec,
1683 const struct hda_fixup *fix, int action)
1685 struct alc_spec *spec = codec->spec;
1686 static const struct hda_pintbl pincfgs[] = {
1687 { 0x0f, 0x02214000 }, /* HP/speaker */
1688 { 0x12, 0x90a60160 }, /* int mic */
1689 { 0x13, 0x02a19000 }, /* ext mic */
1690 { 0x18, 0x01446000 }, /* SPDIF out */
1691 /* disable bogus I/O pins */
1692 { 0x10, 0x411111f0 },
1693 { 0x11, 0x411111f0 },
1694 { 0x14, 0x411111f0 },
1695 { 0x15, 0x411111f0 },
1696 { 0x16, 0x411111f0 },
1697 { 0x17, 0x411111f0 },
1698 { 0x19, 0x411111f0 },
1703 case HDA_FIXUP_ACT_PRE_PROBE:
1704 snd_hda_apply_pincfgs(codec, pincfgs);
1705 spec->init_amp = ALC_INIT_NONE;
1710 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1711 const struct hda_fixup *fix, int action)
1713 struct alc_spec *spec = codec->spec;
1714 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1715 spec->init_amp = ALC_INIT_NONE;
1718 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1719 const struct hda_fixup *fix, int action)
1721 struct alc_spec *spec = codec->spec;
1722 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1723 spec->gen.add_jack_modes = 1;
1724 spec->gen.hp_mic = 1;
1728 static const struct hda_fixup alc260_fixups[] = {
1729 [ALC260_FIXUP_HP_DC5750] = {
1730 .type = HDA_FIXUP_PINS,
1731 .v.pins = (const struct hda_pintbl[]) {
1732 { 0x11, 0x90130110 }, /* speaker */
1736 [ALC260_FIXUP_HP_PIN_0F] = {
1737 .type = HDA_FIXUP_PINS,
1738 .v.pins = (const struct hda_pintbl[]) {
1739 { 0x0f, 0x01214000 }, /* HP */
1743 [ALC260_FIXUP_COEF] = {
1744 .type = HDA_FIXUP_VERBS,
1745 .v.verbs = (const struct hda_verb[]) {
1746 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1747 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1751 [ALC260_FIXUP_GPIO1] = {
1752 .type = HDA_FIXUP_FUNC,
1753 .v.func = alc_fixup_gpio1,
1755 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1756 .type = HDA_FIXUP_FUNC,
1757 .v.func = alc260_fixup_gpio1_toggle,
1759 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1761 [ALC260_FIXUP_REPLACER] = {
1762 .type = HDA_FIXUP_VERBS,
1763 .v.verbs = (const struct hda_verb[]) {
1764 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1765 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1769 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1771 [ALC260_FIXUP_HP_B1900] = {
1772 .type = HDA_FIXUP_FUNC,
1773 .v.func = alc260_fixup_gpio1_toggle,
1775 .chain_id = ALC260_FIXUP_COEF,
1777 [ALC260_FIXUP_KN1] = {
1778 .type = HDA_FIXUP_FUNC,
1779 .v.func = alc260_fixup_kn1,
1781 [ALC260_FIXUP_FSC_S7020] = {
1782 .type = HDA_FIXUP_FUNC,
1783 .v.func = alc260_fixup_fsc_s7020,
1785 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1786 .type = HDA_FIXUP_FUNC,
1787 .v.func = alc260_fixup_fsc_s7020_jwse,
1789 .chain_id = ALC260_FIXUP_FSC_S7020,
1791 [ALC260_FIXUP_VAIO_PINS] = {
1792 .type = HDA_FIXUP_PINS,
1793 .v.pins = (const struct hda_pintbl[]) {
1794 /* Pin configs are missing completely on some VAIOs */
1795 { 0x0f, 0x01211020 },
1796 { 0x10, 0x0001003f },
1797 { 0x11, 0x411111f0 },
1798 { 0x12, 0x01a15930 },
1799 { 0x13, 0x411111f0 },
1800 { 0x14, 0x411111f0 },
1801 { 0x15, 0x411111f0 },
1802 { 0x16, 0x411111f0 },
1803 { 0x17, 0x411111f0 },
1804 { 0x18, 0x411111f0 },
1805 { 0x19, 0x411111f0 },
1811 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1812 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1813 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1814 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1815 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1816 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1817 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1818 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1819 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1820 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1821 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1822 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1823 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1827 static const struct hda_model_fixup alc260_fixup_models[] = {
1828 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1829 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1830 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1831 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1837 static int patch_alc260(struct hda_codec *codec)
1839 struct alc_spec *spec;
1842 err = alc_alloc_spec(codec, 0x07);
1847 /* as quite a few machines require HP amp for speaker outputs,
1848 * it's easier to enable it unconditionally; even if it's unneeded,
1849 * it's almost harmless.
1851 spec->gen.prefer_hp_amp = 1;
1852 spec->gen.beep_nid = 0x01;
1854 spec->shutup = alc_eapd_shutup;
1856 alc_pre_init(codec);
1858 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1860 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1862 /* automatic parse from the BIOS config */
1863 err = alc260_parse_auto_config(codec);
1867 if (!spec->gen.no_analog) {
1868 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1873 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1884 * ALC882/883/885/888/889 support
1886 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1887 * configuration. Each pin widget can choose any input DACs and a mixer.
1888 * Each ADC is connected from a mixer of all inputs. This makes possible
1889 * 6-channel independent captures.
1891 * In addition, an independent DAC for the multi-playback (not used in this
1899 ALC882_FIXUP_ABIT_AW9D_MAX,
1900 ALC882_FIXUP_LENOVO_Y530,
1901 ALC882_FIXUP_PB_M5210,
1902 ALC882_FIXUP_ACER_ASPIRE_7736,
1903 ALC882_FIXUP_ASUS_W90V,
1905 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1906 ALC889_FIXUP_VAIO_TT,
1907 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_CLEVO_P950,
1933 ALC1220_FIXUP_CLEVO_PB51ED,
1934 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1935 ALC887_FIXUP_ASUS_AUDIO,
1936 ALC887_FIXUP_ASUS_HMIC,
1939 static void alc889_fixup_coef(struct hda_codec *codec,
1940 const struct hda_fixup *fix, int action)
1942 if (action != HDA_FIXUP_ACT_INIT)
1944 alc_update_coef_idx(codec, 7, 0, 0x2030);
1947 /* set up GPIO at initialization */
1948 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1949 const struct hda_fixup *fix, int action)
1951 struct alc_spec *spec = codec->spec;
1953 spec->gpio_write_delay = true;
1954 alc_fixup_gpio3(codec, fix, action);
1957 /* Fix the connection of some pins for ALC889:
1958 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1959 * work correctly (bko#42740)
1961 static void alc889_fixup_dac_route(struct hda_codec *codec,
1962 const struct hda_fixup *fix, int action)
1964 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1965 /* fake the connections during parsing the tree */
1966 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1967 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1968 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1969 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1970 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1971 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1972 } else if (action == HDA_FIXUP_ACT_PROBE) {
1973 /* restore the connections */
1974 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1975 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1976 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1977 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1978 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1982 /* Set VREF on HP pin */
1983 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1984 const struct hda_fixup *fix, int action)
1986 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1987 struct alc_spec *spec = codec->spec;
1990 if (action != HDA_FIXUP_ACT_INIT)
1992 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1993 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1994 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1996 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1997 val |= AC_PINCTL_VREF_80;
1998 snd_hda_set_pin_ctl(codec, nids[i], val);
1999 spec->gen.keep_vref_in_automute = 1;
2004 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2005 const hda_nid_t *nids, int num_nids)
2007 struct alc_spec *spec = codec->spec;
2010 for (i = 0; i < num_nids; i++) {
2012 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2013 val |= AC_PINCTL_VREF_50;
2014 snd_hda_set_pin_ctl(codec, nids[i], val);
2016 spec->gen.keep_vref_in_automute = 1;
2019 /* Set VREF on speaker pins on imac91 */
2020 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2021 const struct hda_fixup *fix, int action)
2023 static const hda_nid_t nids[] = { 0x18, 0x1a };
2025 if (action == HDA_FIXUP_ACT_INIT)
2026 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2029 /* Set VREF on speaker pins on mba11 */
2030 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2031 const struct hda_fixup *fix, int action)
2033 static const hda_nid_t nids[] = { 0x18 };
2035 if (action == HDA_FIXUP_ACT_INIT)
2036 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2039 /* Set VREF on speaker pins on mba21 */
2040 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2041 const struct hda_fixup *fix, int action)
2043 static const hda_nid_t nids[] = { 0x18, 0x19 };
2045 if (action == HDA_FIXUP_ACT_INIT)
2046 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2049 /* Don't take HP output as primary
2050 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2051 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2053 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2054 const struct hda_fixup *fix, int action)
2056 struct alc_spec *spec = codec->spec;
2057 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2058 spec->gen.no_primary_hp = 1;
2059 spec->gen.no_multi_io = 1;
2063 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2064 const struct hda_fixup *fix, int action);
2066 /* For dual-codec configuration, we need to disable some features to avoid
2067 * conflicts of kctls and PCM streams
2069 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2070 const struct hda_fixup *fix, int action)
2072 struct alc_spec *spec = codec->spec;
2074 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2076 /* disable vmaster */
2077 spec->gen.suppress_vmaster = 1;
2078 /* auto-mute and auto-mic switch don't work with multiple codecs */
2079 spec->gen.suppress_auto_mute = 1;
2080 spec->gen.suppress_auto_mic = 1;
2081 /* disable aamix as well */
2082 spec->gen.mixer_nid = 0;
2083 /* add location prefix to avoid conflicts */
2084 codec->force_pin_prefix = 1;
2087 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2088 const char *newname)
2090 struct snd_kcontrol *kctl;
2092 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2094 strcpy(kctl->id.name, newname);
2097 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2098 const struct hda_fixup *fix,
2101 alc_fixup_dual_codecs(codec, fix, action);
2103 case HDA_FIXUP_ACT_PRE_PROBE:
2104 /* override card longname to provide a unique UCM profile */
2105 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2107 case HDA_FIXUP_ACT_BUILD:
2108 /* rename Capture controls depending on the codec */
2109 rename_ctl(codec, "Capture Volume",
2111 "Rear-Panel Capture Volume" :
2112 "Front-Panel Capture Volume");
2113 rename_ctl(codec, "Capture Switch",
2115 "Rear-Panel Capture Switch" :
2116 "Front-Panel Capture Switch");
2121 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2122 const struct hda_fixup *fix,
2125 static const hda_nid_t conn1[] = { 0x0c };
2127 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2130 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2131 /* We therefore want to make sure 0x14 (front headphone) and
2132 * 0x1b (speakers) use the stereo DAC 0x02
2134 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2135 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2138 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2139 const struct hda_fixup *fix, int action);
2141 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2142 const struct hda_fixup *fix,
2145 alc1220_fixup_clevo_p950(codec, fix, action);
2146 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2149 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2150 struct hda_jack_callback *jack)
2152 struct alc_spec *spec = codec->spec;
2155 snd_hda_gen_hp_automute(codec, jack);
2157 if (spec->gen.hp_jack_present)
2158 vref = AC_PINCTL_VREF_80;
2160 vref = AC_PINCTL_VREF_HIZ;
2161 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2164 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2165 const struct hda_fixup *fix, int action)
2167 struct alc_spec *spec = codec->spec;
2168 if (action != HDA_FIXUP_ACT_PROBE)
2170 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2171 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2174 static const struct hda_fixup alc882_fixups[] = {
2175 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2176 .type = HDA_FIXUP_PINS,
2177 .v.pins = (const struct hda_pintbl[]) {
2178 { 0x15, 0x01080104 }, /* side */
2179 { 0x16, 0x01011012 }, /* rear */
2180 { 0x17, 0x01016011 }, /* clfe */
2184 [ALC882_FIXUP_LENOVO_Y530] = {
2185 .type = HDA_FIXUP_PINS,
2186 .v.pins = (const struct hda_pintbl[]) {
2187 { 0x15, 0x99130112 }, /* rear int speakers */
2188 { 0x16, 0x99130111 }, /* subwoofer */
2192 [ALC882_FIXUP_PB_M5210] = {
2193 .type = HDA_FIXUP_PINCTLS,
2194 .v.pins = (const struct hda_pintbl[]) {
2195 { 0x19, PIN_VREF50 },
2199 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2200 .type = HDA_FIXUP_FUNC,
2201 .v.func = alc_fixup_sku_ignore,
2203 [ALC882_FIXUP_ASUS_W90V] = {
2204 .type = HDA_FIXUP_PINS,
2205 .v.pins = (const struct hda_pintbl[]) {
2206 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2210 [ALC889_FIXUP_CD] = {
2211 .type = HDA_FIXUP_PINS,
2212 .v.pins = (const struct hda_pintbl[]) {
2213 { 0x1c, 0x993301f0 }, /* CD */
2217 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2218 .type = HDA_FIXUP_PINS,
2219 .v.pins = (const struct hda_pintbl[]) {
2220 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2224 .chain_id = ALC889_FIXUP_CD,
2226 [ALC889_FIXUP_VAIO_TT] = {
2227 .type = HDA_FIXUP_PINS,
2228 .v.pins = (const struct hda_pintbl[]) {
2229 { 0x17, 0x90170111 }, /* hidden surround speaker */
2233 [ALC888_FIXUP_EEE1601] = {
2234 .type = HDA_FIXUP_VERBS,
2235 .v.verbs = (const struct hda_verb[]) {
2236 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2237 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2241 [ALC882_FIXUP_EAPD] = {
2242 .type = HDA_FIXUP_VERBS,
2243 .v.verbs = (const struct hda_verb[]) {
2244 /* change to EAPD mode */
2245 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2246 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2250 [ALC883_FIXUP_EAPD] = {
2251 .type = HDA_FIXUP_VERBS,
2252 .v.verbs = (const struct hda_verb[]) {
2253 /* change to EAPD mode */
2254 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2255 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2259 [ALC883_FIXUP_ACER_EAPD] = {
2260 .type = HDA_FIXUP_VERBS,
2261 .v.verbs = (const struct hda_verb[]) {
2262 /* eanable EAPD on Acer laptops */
2263 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2264 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2268 [ALC882_FIXUP_GPIO1] = {
2269 .type = HDA_FIXUP_FUNC,
2270 .v.func = alc_fixup_gpio1,
2272 [ALC882_FIXUP_GPIO2] = {
2273 .type = HDA_FIXUP_FUNC,
2274 .v.func = alc_fixup_gpio2,
2276 [ALC882_FIXUP_GPIO3] = {
2277 .type = HDA_FIXUP_FUNC,
2278 .v.func = alc_fixup_gpio3,
2280 [ALC882_FIXUP_ASUS_W2JC] = {
2281 .type = HDA_FIXUP_FUNC,
2282 .v.func = alc_fixup_gpio1,
2284 .chain_id = ALC882_FIXUP_EAPD,
2286 [ALC889_FIXUP_COEF] = {
2287 .type = HDA_FIXUP_FUNC,
2288 .v.func = alc889_fixup_coef,
2290 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2291 .type = HDA_FIXUP_PINS,
2292 .v.pins = (const struct hda_pintbl[]) {
2293 { 0x16, 0x99130111 }, /* CLFE speaker */
2294 { 0x17, 0x99130112 }, /* surround speaker */
2298 .chain_id = ALC882_FIXUP_GPIO1,
2300 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2301 .type = HDA_FIXUP_PINS,
2302 .v.pins = (const struct hda_pintbl[]) {
2303 { 0x16, 0x99130111 }, /* CLFE speaker */
2304 { 0x1b, 0x99130112 }, /* surround speaker */
2308 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2310 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2311 /* additional init verbs for Acer Aspire 8930G */
2312 .type = HDA_FIXUP_VERBS,
2313 .v.verbs = (const struct hda_verb[]) {
2314 /* Enable all DACs */
2315 /* DAC DISABLE/MUTE 1? */
2316 /* setting bits 1-5 disables DAC nids 0x02-0x06
2317 * apparently. Init=0x38 */
2318 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2319 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2320 /* DAC DISABLE/MUTE 2? */
2321 /* some bit here disables the other DACs.
2323 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2324 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2326 * This laptop has a stereo digital microphone.
2327 * The mics are only 1cm apart which makes the stereo
2328 * useless. However, either the mic or the ALC889
2329 * makes the signal become a difference/sum signal
2330 * instead of standard stereo, which is annoying.
2331 * So instead we flip this bit which makes the
2332 * codec replicate the sum signal to both channels,
2333 * turning it into a normal mono mic.
2335 /* DMIC_CONTROL? Init value = 0x0001 */
2336 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2337 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2338 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2339 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2343 .chain_id = ALC882_FIXUP_GPIO1,
2345 [ALC885_FIXUP_MACPRO_GPIO] = {
2346 .type = HDA_FIXUP_FUNC,
2347 .v.func = alc885_fixup_macpro_gpio,
2349 [ALC889_FIXUP_DAC_ROUTE] = {
2350 .type = HDA_FIXUP_FUNC,
2351 .v.func = alc889_fixup_dac_route,
2353 [ALC889_FIXUP_MBP_VREF] = {
2354 .type = HDA_FIXUP_FUNC,
2355 .v.func = alc889_fixup_mbp_vref,
2357 .chain_id = ALC882_FIXUP_GPIO1,
2359 [ALC889_FIXUP_IMAC91_VREF] = {
2360 .type = HDA_FIXUP_FUNC,
2361 .v.func = alc889_fixup_imac91_vref,
2363 .chain_id = ALC882_FIXUP_GPIO1,
2365 [ALC889_FIXUP_MBA11_VREF] = {
2366 .type = HDA_FIXUP_FUNC,
2367 .v.func = alc889_fixup_mba11_vref,
2369 .chain_id = ALC889_FIXUP_MBP_VREF,
2371 [ALC889_FIXUP_MBA21_VREF] = {
2372 .type = HDA_FIXUP_FUNC,
2373 .v.func = alc889_fixup_mba21_vref,
2375 .chain_id = ALC889_FIXUP_MBP_VREF,
2377 [ALC889_FIXUP_MP11_VREF] = {
2378 .type = HDA_FIXUP_FUNC,
2379 .v.func = alc889_fixup_mba11_vref,
2381 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2383 [ALC889_FIXUP_MP41_VREF] = {
2384 .type = HDA_FIXUP_FUNC,
2385 .v.func = alc889_fixup_mbp_vref,
2387 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2389 [ALC882_FIXUP_INV_DMIC] = {
2390 .type = HDA_FIXUP_FUNC,
2391 .v.func = alc_fixup_inv_dmic,
2393 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2394 .type = HDA_FIXUP_FUNC,
2395 .v.func = alc882_fixup_no_primary_hp,
2397 [ALC887_FIXUP_ASUS_BASS] = {
2398 .type = HDA_FIXUP_PINS,
2399 .v.pins = (const struct hda_pintbl[]) {
2400 {0x16, 0x99130130}, /* bass speaker */
2404 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2406 [ALC887_FIXUP_BASS_CHMAP] = {
2407 .type = HDA_FIXUP_FUNC,
2408 .v.func = alc_fixup_bass_chmap,
2410 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2411 .type = HDA_FIXUP_FUNC,
2412 .v.func = alc1220_fixup_gb_dual_codecs,
2414 [ALC1220_FIXUP_CLEVO_P950] = {
2415 .type = HDA_FIXUP_FUNC,
2416 .v.func = alc1220_fixup_clevo_p950,
2418 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2419 .type = HDA_FIXUP_FUNC,
2420 .v.func = alc1220_fixup_clevo_pb51ed,
2422 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2423 .type = HDA_FIXUP_PINS,
2424 .v.pins = (const struct hda_pintbl[]) {
2425 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2429 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2431 [ALC887_FIXUP_ASUS_AUDIO] = {
2432 .type = HDA_FIXUP_PINS,
2433 .v.pins = (const struct hda_pintbl[]) {
2434 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2435 { 0x19, 0x22219420 },
2439 [ALC887_FIXUP_ASUS_HMIC] = {
2440 .type = HDA_FIXUP_FUNC,
2441 .v.func = alc887_fixup_asus_jack,
2443 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2447 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2448 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2449 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2450 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2451 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2452 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2453 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2454 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2455 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2456 ALC882_FIXUP_ACER_ASPIRE_4930G),
2457 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2458 ALC882_FIXUP_ACER_ASPIRE_4930G),
2459 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2460 ALC882_FIXUP_ACER_ASPIRE_8930G),
2461 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2462 ALC882_FIXUP_ACER_ASPIRE_8930G),
2463 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2464 ALC882_FIXUP_ACER_ASPIRE_4930G),
2465 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2466 ALC882_FIXUP_ACER_ASPIRE_4930G),
2467 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2468 ALC882_FIXUP_ACER_ASPIRE_4930G),
2469 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2470 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2471 ALC882_FIXUP_ACER_ASPIRE_4930G),
2472 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2473 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2474 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2475 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2476 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2477 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2478 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2479 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2480 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2481 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2482 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2483 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2484 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2485 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2486 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2488 /* All Apple entries are in codec SSIDs */
2489 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2490 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2491 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2492 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2493 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2494 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2495 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2496 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2497 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2498 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2499 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2500 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2501 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2502 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2503 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2504 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2505 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2506 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2507 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2508 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2509 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2510 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2512 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2513 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2514 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2515 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
2516 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
2517 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2518 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2519 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2520 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2521 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2522 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2523 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2524 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2525 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2526 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2527 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2528 SND_PCI_QUIRK(0x1558, 0x950A, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2529 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2530 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2531 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2532 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2533 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2534 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2535 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2536 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2537 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2538 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2539 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2540 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2541 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2542 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2543 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2544 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2545 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2546 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2547 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2548 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2549 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2553 static const struct hda_model_fixup alc882_fixup_models[] = {
2554 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2555 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2556 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2557 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2558 {.id = ALC889_FIXUP_CD, .name = "cd"},
2559 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2560 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2561 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2562 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2563 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2564 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2565 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2566 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2567 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2568 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2569 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2570 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2571 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2572 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2573 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2574 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2575 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2576 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2577 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2578 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2579 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2580 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2581 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2582 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2583 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2584 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2589 * BIOS auto configuration
2591 /* almost identical with ALC880 parser... */
2592 static int alc882_parse_auto_config(struct hda_codec *codec)
2594 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2595 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2596 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2601 static int patch_alc882(struct hda_codec *codec)
2603 struct alc_spec *spec;
2606 err = alc_alloc_spec(codec, 0x0b);
2612 switch (codec->core.vendor_id) {
2620 /* ALC883 and variants */
2621 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2625 alc_pre_init(codec);
2627 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2629 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2631 alc_auto_parse_customize_define(codec);
2633 if (has_cdefine_beep(codec))
2634 spec->gen.beep_nid = 0x01;
2636 /* automatic parse from the BIOS config */
2637 err = alc882_parse_auto_config(codec);
2641 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2642 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2647 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2660 static int alc262_parse_auto_config(struct hda_codec *codec)
2662 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2663 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2664 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2671 ALC262_FIXUP_FSC_H270,
2672 ALC262_FIXUP_FSC_S7110,
2673 ALC262_FIXUP_HP_Z200,
2675 ALC262_FIXUP_LENOVO_3000,
2677 ALC262_FIXUP_BENQ_T31,
2678 ALC262_FIXUP_INV_DMIC,
2679 ALC262_FIXUP_INTEL_BAYLEYBAY,
2682 static const struct hda_fixup alc262_fixups[] = {
2683 [ALC262_FIXUP_FSC_H270] = {
2684 .type = HDA_FIXUP_PINS,
2685 .v.pins = (const struct hda_pintbl[]) {
2686 { 0x14, 0x99130110 }, /* speaker */
2687 { 0x15, 0x0221142f }, /* front HP */
2688 { 0x1b, 0x0121141f }, /* rear HP */
2692 [ALC262_FIXUP_FSC_S7110] = {
2693 .type = HDA_FIXUP_PINS,
2694 .v.pins = (const struct hda_pintbl[]) {
2695 { 0x15, 0x90170110 }, /* speaker */
2699 .chain_id = ALC262_FIXUP_BENQ,
2701 [ALC262_FIXUP_HP_Z200] = {
2702 .type = HDA_FIXUP_PINS,
2703 .v.pins = (const struct hda_pintbl[]) {
2704 { 0x16, 0x99130120 }, /* internal speaker */
2708 [ALC262_FIXUP_TYAN] = {
2709 .type = HDA_FIXUP_PINS,
2710 .v.pins = (const struct hda_pintbl[]) {
2711 { 0x14, 0x1993e1f0 }, /* int AUX */
2715 [ALC262_FIXUP_LENOVO_3000] = {
2716 .type = HDA_FIXUP_PINCTLS,
2717 .v.pins = (const struct hda_pintbl[]) {
2718 { 0x19, PIN_VREF50 },
2722 .chain_id = ALC262_FIXUP_BENQ,
2724 [ALC262_FIXUP_BENQ] = {
2725 .type = HDA_FIXUP_VERBS,
2726 .v.verbs = (const struct hda_verb[]) {
2727 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2728 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2732 [ALC262_FIXUP_BENQ_T31] = {
2733 .type = HDA_FIXUP_VERBS,
2734 .v.verbs = (const struct hda_verb[]) {
2735 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2736 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2740 [ALC262_FIXUP_INV_DMIC] = {
2741 .type = HDA_FIXUP_FUNC,
2742 .v.func = alc_fixup_inv_dmic,
2744 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2745 .type = HDA_FIXUP_FUNC,
2746 .v.func = alc_fixup_no_depop_delay,
2750 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2751 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2752 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2753 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2754 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2755 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2756 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2757 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2758 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2759 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2760 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2764 static const struct hda_model_fixup alc262_fixup_models[] = {
2765 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2766 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2767 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2768 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2769 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2770 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2771 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2772 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2773 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2779 static int patch_alc262(struct hda_codec *codec)
2781 struct alc_spec *spec;
2784 err = alc_alloc_spec(codec, 0x0b);
2789 spec->gen.shared_mic_vref_pin = 0x18;
2791 spec->shutup = alc_eapd_shutup;
2794 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2797 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2799 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2801 alc_pre_init(codec);
2803 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2805 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2807 alc_auto_parse_customize_define(codec);
2809 if (has_cdefine_beep(codec))
2810 spec->gen.beep_nid = 0x01;
2812 /* automatic parse from the BIOS config */
2813 err = alc262_parse_auto_config(codec);
2817 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2818 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2823 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2835 /* bind Beep switches of both NID 0x0f and 0x10 */
2836 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2837 struct snd_ctl_elem_value *ucontrol)
2839 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2843 mutex_lock(&codec->control_mutex);
2844 pval = kcontrol->private_value;
2845 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2846 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2848 kcontrol->private_value = (pval & ~0xff) | 0x10;
2849 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2851 kcontrol->private_value = pval;
2852 mutex_unlock(&codec->control_mutex);
2856 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2857 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2859 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2860 .name = "Beep Playback Switch",
2861 .subdevice = HDA_SUBDEV_AMP_FLAG,
2862 .info = snd_hda_mixer_amp_switch_info,
2863 .get = snd_hda_mixer_amp_switch_get,
2864 .put = alc268_beep_switch_put,
2865 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2869 /* set PCBEEP vol = 0, mute connections */
2870 static const struct hda_verb alc268_beep_init_verbs[] = {
2871 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2872 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2873 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2878 ALC268_FIXUP_INV_DMIC,
2879 ALC268_FIXUP_HP_EAPD,
2883 static const struct hda_fixup alc268_fixups[] = {
2884 [ALC268_FIXUP_INV_DMIC] = {
2885 .type = HDA_FIXUP_FUNC,
2886 .v.func = alc_fixup_inv_dmic,
2888 [ALC268_FIXUP_HP_EAPD] = {
2889 .type = HDA_FIXUP_VERBS,
2890 .v.verbs = (const struct hda_verb[]) {
2891 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2895 [ALC268_FIXUP_SPDIF] = {
2896 .type = HDA_FIXUP_PINS,
2897 .v.pins = (const struct hda_pintbl[]) {
2898 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2904 static const struct hda_model_fixup alc268_fixup_models[] = {
2905 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2906 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2907 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2911 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2912 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2913 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2914 /* below is codec SSID since multiple Toshiba laptops have the
2915 * same PCI SSID 1179:ff00
2917 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2922 * BIOS auto configuration
2924 static int alc268_parse_auto_config(struct hda_codec *codec)
2926 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2927 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2932 static int patch_alc268(struct hda_codec *codec)
2934 struct alc_spec *spec;
2937 /* ALC268 has no aa-loopback mixer */
2938 err = alc_alloc_spec(codec, 0);
2943 if (has_cdefine_beep(codec))
2944 spec->gen.beep_nid = 0x01;
2946 spec->shutup = alc_eapd_shutup;
2948 alc_pre_init(codec);
2950 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2951 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2953 /* automatic parse from the BIOS config */
2954 err = alc268_parse_auto_config(codec);
2958 if (err > 0 && !spec->gen.no_analog &&
2959 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2960 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2961 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2962 &alc268_beep_mixer[i])) {
2967 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2968 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2969 /* override the amp caps for beep generator */
2970 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
2971 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
2972 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
2973 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2974 (0 << AC_AMPCAP_MUTE_SHIFT));
2977 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2990 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
2991 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2994 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
2995 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2998 /* different alc269-variants */
3000 ALC269_TYPE_ALC269VA,
3001 ALC269_TYPE_ALC269VB,
3002 ALC269_TYPE_ALC269VC,
3003 ALC269_TYPE_ALC269VD,
3023 * BIOS auto configuration
3025 static int alc269_parse_auto_config(struct hda_codec *codec)
3027 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3028 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3029 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3030 struct alc_spec *spec = codec->spec;
3031 const hda_nid_t *ssids;
3033 switch (spec->codec_variant) {
3034 case ALC269_TYPE_ALC269VA:
3035 case ALC269_TYPE_ALC269VC:
3036 case ALC269_TYPE_ALC280:
3037 case ALC269_TYPE_ALC284:
3038 case ALC269_TYPE_ALC293:
3039 ssids = alc269va_ssids;
3041 case ALC269_TYPE_ALC269VB:
3042 case ALC269_TYPE_ALC269VD:
3043 case ALC269_TYPE_ALC282:
3044 case ALC269_TYPE_ALC283:
3045 case ALC269_TYPE_ALC286:
3046 case ALC269_TYPE_ALC298:
3047 case ALC269_TYPE_ALC255:
3048 case ALC269_TYPE_ALC256:
3049 case ALC269_TYPE_ALC257:
3050 case ALC269_TYPE_ALC215:
3051 case ALC269_TYPE_ALC225:
3052 case ALC269_TYPE_ALC294:
3053 case ALC269_TYPE_ALC300:
3054 case ALC269_TYPE_ALC623:
3055 case ALC269_TYPE_ALC700:
3056 ssids = alc269_ssids;
3059 ssids = alc269_ssids;
3063 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3066 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3067 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3068 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3069 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3070 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3074 static void alc_headset_btn_callback(struct hda_codec *codec,
3075 struct hda_jack_callback *jack)
3079 if (jack->unsol_res & (7 << 13))
3080 report |= SND_JACK_BTN_0;
3082 if (jack->unsol_res & (1 << 16 | 3 << 8))
3083 report |= SND_JACK_BTN_1;
3086 if (jack->unsol_res & (7 << 23))
3087 report |= SND_JACK_BTN_2;
3089 /* Volume down key */
3090 if (jack->unsol_res & (7 << 10))
3091 report |= SND_JACK_BTN_3;
3093 jack->jack->button_state = report;
3096 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3098 struct alc_spec *spec = codec->spec;
3100 if (!spec->has_hs_key)
3103 switch (codec->core.vendor_id) {
3111 alc_write_coef_idx(codec, 0x48, 0x0);
3112 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3113 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3117 alc_write_coef_idx(codec, 0x48, 0x0);
3118 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3123 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3125 struct alc_spec *spec = codec->spec;
3127 if (!spec->has_hs_key)
3130 switch (codec->core.vendor_id) {
3138 alc_write_coef_idx(codec, 0x48, 0xd011);
3139 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3140 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3144 alc_write_coef_idx(codec, 0x48, 0xd011);
3145 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3150 static void alc_fixup_headset_jack(struct hda_codec *codec,
3151 const struct hda_fixup *fix, int action)
3153 struct alc_spec *spec = codec->spec;
3156 case HDA_FIXUP_ACT_PRE_PROBE:
3157 spec->has_hs_key = 1;
3158 snd_hda_jack_detect_enable_callback(codec, 0x55,
3159 alc_headset_btn_callback);
3160 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
3161 SND_JACK_HEADSET, alc_headset_btn_keymap);
3163 case HDA_FIXUP_ACT_INIT:
3164 alc_enable_headset_jack_key(codec);
3169 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3171 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3174 static void alc269_shutup(struct hda_codec *codec)
3176 struct alc_spec *spec = codec->spec;
3178 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3179 alc269vb_toggle_power_output(codec, 0);
3180 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3181 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3184 alc_shutup_pins(codec);
3187 static const struct coef_fw alc282_coefs[] = {
3188 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3189 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3190 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3191 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3192 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3193 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3194 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3195 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3196 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3197 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3198 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3199 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3200 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3201 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3202 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3203 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3204 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3205 WRITE_COEF(0x63, 0x2902), /* PLL */
3206 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3207 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3208 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3209 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3210 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3211 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3212 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3213 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3214 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3215 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3216 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3220 static void alc282_restore_default_value(struct hda_codec *codec)
3222 alc_process_coef_fw(codec, alc282_coefs);
3225 static void alc282_init(struct hda_codec *codec)
3227 struct alc_spec *spec = codec->spec;
3228 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3232 alc282_restore_default_value(codec);
3236 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3237 coef78 = alc_read_coef_idx(codec, 0x78);
3239 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3240 /* Headphone capless set to high power mode */
3241 alc_write_coef_idx(codec, 0x78, 0x9004);
3246 snd_hda_codec_write(codec, hp_pin, 0,
3247 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3252 snd_hda_codec_write(codec, hp_pin, 0,
3253 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3258 /* Headphone capless set to normal mode */
3259 alc_write_coef_idx(codec, 0x78, coef78);
3262 static void alc282_shutup(struct hda_codec *codec)
3264 struct alc_spec *spec = codec->spec;
3265 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3270 alc269_shutup(codec);
3274 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3275 coef78 = alc_read_coef_idx(codec, 0x78);
3276 alc_write_coef_idx(codec, 0x78, 0x9004);
3281 snd_hda_codec_write(codec, hp_pin, 0,
3282 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3287 if (!spec->no_shutup_pins)
3288 snd_hda_codec_write(codec, hp_pin, 0,
3289 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3294 alc_auto_setup_eapd(codec, false);
3295 alc_shutup_pins(codec);
3296 alc_write_coef_idx(codec, 0x78, coef78);
3299 static const struct coef_fw alc283_coefs[] = {
3300 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3301 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3302 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3303 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3304 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3305 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3306 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3307 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3308 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3309 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3310 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3311 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3312 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3313 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3314 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3315 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3316 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3317 WRITE_COEF(0x2e, 0x2902), /* PLL */
3318 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3319 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3320 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3321 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3322 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3323 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3324 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3325 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3326 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3327 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3328 WRITE_COEF(0x49, 0x0), /* test mode */
3329 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3330 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3331 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3332 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3336 static void alc283_restore_default_value(struct hda_codec *codec)
3338 alc_process_coef_fw(codec, alc283_coefs);
3341 static void alc283_init(struct hda_codec *codec)
3343 struct alc_spec *spec = codec->spec;
3344 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3347 alc283_restore_default_value(codec);
3353 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3355 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3356 /* Headphone capless set to high power mode */
3357 alc_write_coef_idx(codec, 0x43, 0x9004);
3359 snd_hda_codec_write(codec, hp_pin, 0,
3360 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3365 snd_hda_codec_write(codec, hp_pin, 0,
3366 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3370 /* Index 0x46 Combo jack auto switch control 2 */
3371 /* 3k pull low control for Headset jack. */
3372 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3373 /* Headphone capless set to normal mode */
3374 alc_write_coef_idx(codec, 0x43, 0x9614);
3377 static void alc283_shutup(struct hda_codec *codec)
3379 struct alc_spec *spec = codec->spec;
3380 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3384 alc269_shutup(codec);
3388 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3390 alc_write_coef_idx(codec, 0x43, 0x9004);
3392 /*depop hp during suspend*/
3393 alc_write_coef_idx(codec, 0x06, 0x2100);
3395 snd_hda_codec_write(codec, hp_pin, 0,
3396 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3401 if (!spec->no_shutup_pins)
3402 snd_hda_codec_write(codec, hp_pin, 0,
3403 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3405 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3409 alc_auto_setup_eapd(codec, false);
3410 alc_shutup_pins(codec);
3411 alc_write_coef_idx(codec, 0x43, 0x9614);
3414 static void alc256_init(struct hda_codec *codec)
3416 struct alc_spec *spec = codec->spec;
3417 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3425 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3430 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3431 if (spec->ultra_low_power) {
3432 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3433 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3434 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3435 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3436 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3440 snd_hda_codec_write(codec, hp_pin, 0,
3441 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3443 if (hp_pin_sense || spec->ultra_low_power)
3446 snd_hda_codec_write(codec, hp_pin, 0,
3447 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3449 if (hp_pin_sense || spec->ultra_low_power)
3452 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3453 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3454 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3455 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3457 * Expose headphone mic (or possibly Line In on some machines) instead
3458 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3459 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3462 alc_write_coef_idx(codec, 0x36, 0x5757);
3465 static void alc256_shutup(struct hda_codec *codec)
3467 struct alc_spec *spec = codec->spec;
3468 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3474 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3479 snd_hda_codec_write(codec, hp_pin, 0,
3480 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3482 if (hp_pin_sense || spec->ultra_low_power)
3485 /* 3k pull low control for Headset jack. */
3486 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3487 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3488 * when booting with headset plugged. So skip setting it for the codec alc257
3490 if (codec->core.vendor_id != 0x10ec0257)
3491 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3493 if (!spec->no_shutup_pins)
3494 snd_hda_codec_write(codec, hp_pin, 0,
3495 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3497 if (hp_pin_sense || spec->ultra_low_power)
3500 alc_auto_setup_eapd(codec, false);
3501 alc_shutup_pins(codec);
3502 if (spec->ultra_low_power) {
3504 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3505 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3506 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3507 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3508 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3513 static void alc225_init(struct hda_codec *codec)
3515 struct alc_spec *spec = codec->spec;
3516 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3517 bool hp1_pin_sense, hp2_pin_sense;
3523 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3524 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3526 if (hp1_pin_sense || hp2_pin_sense)
3529 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3530 if (spec->ultra_low_power) {
3531 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3532 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3533 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3537 if (hp1_pin_sense || spec->ultra_low_power)
3538 snd_hda_codec_write(codec, hp_pin, 0,
3539 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3541 snd_hda_codec_write(codec, 0x16, 0,
3542 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3544 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3547 if (hp1_pin_sense || spec->ultra_low_power)
3548 snd_hda_codec_write(codec, hp_pin, 0,
3549 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3551 snd_hda_codec_write(codec, 0x16, 0,
3552 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3554 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3557 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3558 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3561 static void alc225_shutup(struct hda_codec *codec)
3563 struct alc_spec *spec = codec->spec;
3564 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3565 bool hp1_pin_sense, hp2_pin_sense;
3570 alc_disable_headset_jack_key(codec);
3571 /* 3k pull low control for Headset jack. */
3572 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3574 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3575 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3577 if (hp1_pin_sense || hp2_pin_sense)
3580 if (hp1_pin_sense || spec->ultra_low_power)
3581 snd_hda_codec_write(codec, hp_pin, 0,
3582 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3584 snd_hda_codec_write(codec, 0x16, 0,
3585 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3587 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3590 if (hp1_pin_sense || spec->ultra_low_power)
3591 snd_hda_codec_write(codec, hp_pin, 0,
3592 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3594 snd_hda_codec_write(codec, 0x16, 0,
3595 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3597 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3600 alc_auto_setup_eapd(codec, false);
3601 alc_shutup_pins(codec);
3602 if (spec->ultra_low_power) {
3604 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3605 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3606 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3607 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3611 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3612 alc_enable_headset_jack_key(codec);
3615 static void alc_default_init(struct hda_codec *codec)
3617 struct alc_spec *spec = codec->spec;
3618 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3626 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3631 snd_hda_codec_write(codec, hp_pin, 0,
3632 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3637 snd_hda_codec_write(codec, hp_pin, 0,
3638 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3644 static void alc_default_shutup(struct hda_codec *codec)
3646 struct alc_spec *spec = codec->spec;
3647 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3651 alc269_shutup(codec);
3655 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3660 snd_hda_codec_write(codec, hp_pin, 0,
3661 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3666 if (!spec->no_shutup_pins)
3667 snd_hda_codec_write(codec, hp_pin, 0,
3668 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3673 alc_auto_setup_eapd(codec, false);
3674 alc_shutup_pins(codec);
3677 static void alc294_hp_init(struct hda_codec *codec)
3679 struct alc_spec *spec = codec->spec;
3680 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3686 snd_hda_codec_write(codec, hp_pin, 0,
3687 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3691 if (!spec->no_shutup_pins)
3692 snd_hda_codec_write(codec, hp_pin, 0,
3693 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3695 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3696 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3698 /* Wait for depop procedure finish */
3699 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3700 for (i = 0; i < 20 && val & 0x0080; i++) {
3702 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3704 /* Set HP depop to auto mode */
3705 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3709 static void alc294_init(struct hda_codec *codec)
3711 struct alc_spec *spec = codec->spec;
3713 /* required only at boot or S4 resume time */
3714 if (!spec->done_hp_init ||
3715 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3716 alc294_hp_init(codec);
3717 spec->done_hp_init = true;
3719 alc_default_init(codec);
3722 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3725 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3726 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3727 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3730 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3734 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3735 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3737 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3742 static void alc5505_dsp_halt(struct hda_codec *codec)
3746 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3747 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3748 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3749 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3750 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3751 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3752 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3753 val = alc5505_coef_get(codec, 0x6220);
3754 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3757 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3759 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3760 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3761 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3762 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3763 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3764 alc5505_coef_set(codec, 0x880c, 0x00000004);
3767 static void alc5505_dsp_init(struct hda_codec *codec)
3771 alc5505_dsp_halt(codec);
3772 alc5505_dsp_back_from_halt(codec);
3773 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3774 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3775 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3776 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3777 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3778 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3779 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3780 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3781 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3782 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3783 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3784 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3785 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3787 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3789 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3791 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3793 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3794 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3795 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3796 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3797 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3798 alc5505_coef_set(codec, 0x880c, 0x00000003);
3799 alc5505_coef_set(codec, 0x880c, 0x00000010);
3801 #ifdef HALT_REALTEK_ALC5505
3802 alc5505_dsp_halt(codec);
3806 #ifdef HALT_REALTEK_ALC5505
3807 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3808 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3810 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3811 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3815 static int alc269_suspend(struct hda_codec *codec)
3817 struct alc_spec *spec = codec->spec;
3819 if (spec->has_alc5505_dsp)
3820 alc5505_dsp_suspend(codec);
3821 return alc_suspend(codec);
3824 static int alc269_resume(struct hda_codec *codec)
3826 struct alc_spec *spec = codec->spec;
3828 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3829 alc269vb_toggle_power_output(codec, 0);
3830 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3831 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3835 codec->patch_ops.init(codec);
3837 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3838 alc269vb_toggle_power_output(codec, 1);
3839 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3840 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3844 snd_hda_regmap_sync(codec);
3845 hda_call_check_power_status(codec, 0x01);
3847 /* on some machine, the BIOS will clear the codec gpio data when enter
3848 * suspend, and won't restore the data after resume, so we restore it
3851 if (spec->gpio_data)
3852 alc_write_gpio_data(codec);
3854 if (spec->has_alc5505_dsp)
3855 alc5505_dsp_resume(codec);
3859 #endif /* CONFIG_PM */
3861 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3862 const struct hda_fixup *fix, int action)
3864 struct alc_spec *spec = codec->spec;
3866 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3867 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3870 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3871 const struct hda_fixup *fix,
3874 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3875 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3877 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3878 snd_hda_codec_set_pincfg(codec, 0x19,
3879 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3880 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3883 static void alc269_fixup_hweq(struct hda_codec *codec,
3884 const struct hda_fixup *fix, int action)
3886 if (action == HDA_FIXUP_ACT_INIT)
3887 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3890 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3891 const struct hda_fixup *fix, int action)
3893 struct alc_spec *spec = codec->spec;
3895 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3896 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3899 static void alc271_fixup_dmic(struct hda_codec *codec,
3900 const struct hda_fixup *fix, int action)
3902 static const struct hda_verb verbs[] = {
3903 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3904 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3909 if (strcmp(codec->core.chip_name, "ALC271X") &&
3910 strcmp(codec->core.chip_name, "ALC269VB"))
3912 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3913 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3914 snd_hda_sequence_write(codec, verbs);
3917 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3918 const struct hda_fixup *fix, int action)
3920 struct alc_spec *spec = codec->spec;
3922 if (action != HDA_FIXUP_ACT_PROBE)
3925 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3926 * fix the sample rate of analog I/O to 44.1kHz
3928 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3929 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3932 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3933 const struct hda_fixup *fix, int action)
3935 /* The digital-mic unit sends PDM (differential signal) instead of
3936 * the standard PCM, thus you can't record a valid mono stream as is.
3937 * Below is a workaround specific to ALC269 to control the dmic
3938 * signal source as mono.
3940 if (action == HDA_FIXUP_ACT_INIT)
3941 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3944 static void alc269_quanta_automute(struct hda_codec *codec)
3946 snd_hda_gen_update_outputs(codec);
3948 alc_write_coef_idx(codec, 0x0c, 0x680);
3949 alc_write_coef_idx(codec, 0x0c, 0x480);
3952 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3953 const struct hda_fixup *fix, int action)
3955 struct alc_spec *spec = codec->spec;
3956 if (action != HDA_FIXUP_ACT_PROBE)
3958 spec->gen.automute_hook = alc269_quanta_automute;
3961 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3962 struct hda_jack_callback *jack)
3964 struct alc_spec *spec = codec->spec;
3967 snd_hda_gen_hp_automute(codec, jack);
3969 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3971 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3974 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3979 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
3981 struct hda_alc298_mbxinit {
3982 unsigned char value_0x23;
3983 unsigned char value_0x25;
3986 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
3987 const struct hda_alc298_mbxinit *initval,
3990 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
3991 alc_write_coef_idx(codec, 0x26, 0xb000);
3994 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
3996 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
3997 alc_write_coef_idx(codec, 0x26, 0xf000);
3998 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4000 if (initval->value_0x23 != 0x1e)
4001 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4003 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4004 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4007 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4008 const struct hda_fixup *fix,
4011 /* Initialization magic */
4012 static const struct hda_alc298_mbxinit dac_init[] = {
4013 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4014 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4015 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4016 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4017 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4018 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4020 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4021 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4022 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4025 const struct hda_alc298_mbxinit *seq;
4027 if (action != HDA_FIXUP_ACT_INIT)
4031 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4032 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4033 alc_write_coef_idx(codec, 0x26, 0xf000);
4034 alc_write_coef_idx(codec, 0x22, 0x31);
4035 alc_write_coef_idx(codec, 0x23, 0x0b);
4036 alc_write_coef_idx(codec, 0x25, 0x00);
4037 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4038 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4040 for (seq = dac_init; seq->value_0x23; seq++)
4041 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4044 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4045 const struct hda_fixup *fix, int action)
4047 struct alc_spec *spec = codec->spec;
4048 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4049 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4050 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4054 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4055 bool polarity, bool on)
4057 unsigned int pinval;
4063 pinval = snd_hda_codec_get_pin_target(codec, pin);
4064 pinval &= ~AC_PINCTL_VREFEN;
4065 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4066 /* temporarily power up/down for setting VREF */
4067 snd_hda_power_up_pm(codec);
4068 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4069 snd_hda_power_down_pm(codec);
4072 /* update mute-LED according to the speaker mute state via mic VREF pin */
4073 static int vref_mute_led_set(struct led_classdev *led_cdev,
4074 enum led_brightness brightness)
4076 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4077 struct alc_spec *spec = codec->spec;
4079 alc_update_vref_led(codec, spec->mute_led_nid,
4080 spec->mute_led_polarity, brightness);
4084 /* Make sure the led works even in runtime suspend */
4085 static unsigned int led_power_filter(struct hda_codec *codec,
4087 unsigned int power_state)
4089 struct alc_spec *spec = codec->spec;
4091 if (power_state != AC_PWRST_D3 || nid == 0 ||
4092 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4095 /* Set pin ctl again, it might have just been set to 0 */
4096 snd_hda_set_pin_ctl(codec, nid,
4097 snd_hda_codec_get_pin_target(codec, nid));
4099 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4102 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4103 const struct hda_fixup *fix, int action)
4105 struct alc_spec *spec = codec->spec;
4106 const struct dmi_device *dev = NULL;
4108 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4111 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4113 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4115 if (pin < 0x0a || pin >= 0x10)
4117 spec->mute_led_polarity = pol;
4118 spec->mute_led_nid = pin - 0x0a + 0x18;
4119 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4120 codec->power_filter = led_power_filter;
4122 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4123 spec->mute_led_polarity);
4128 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4129 const struct hda_fixup *fix,
4130 int action, hda_nid_t pin)
4132 struct alc_spec *spec = codec->spec;
4134 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4135 spec->mute_led_polarity = 0;
4136 spec->mute_led_nid = pin;
4137 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4138 codec->power_filter = led_power_filter;
4142 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4143 const struct hda_fixup *fix, int action)
4145 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4148 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4149 const struct hda_fixup *fix, int action)
4151 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4154 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4155 const struct hda_fixup *fix, int action)
4157 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4160 /* update LED status via GPIO */
4161 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4162 int polarity, bool enabled)
4166 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4169 /* turn on/off mute LED via GPIO per vmaster hook */
4170 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4171 enum led_brightness brightness)
4173 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4174 struct alc_spec *spec = codec->spec;
4176 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4177 spec->mute_led_polarity, !brightness);
4181 /* turn on/off mic-mute LED via GPIO per capture hook */
4182 static int micmute_led_set(struct led_classdev *led_cdev,
4183 enum led_brightness brightness)
4185 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4186 struct alc_spec *spec = codec->spec;
4188 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4189 spec->micmute_led_polarity, !brightness);
4193 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4194 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4196 unsigned int mute_mask,
4197 unsigned int micmute_mask)
4199 struct alc_spec *spec = codec->spec;
4201 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4203 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4206 spec->gpio_mute_led_mask = mute_mask;
4207 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4210 spec->gpio_mic_led_mask = micmute_mask;
4211 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4215 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4216 const struct hda_fixup *fix, int action)
4218 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4221 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4222 const struct hda_fixup *fix, int action)
4224 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4227 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4228 const struct hda_fixup *fix, int action)
4230 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4233 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4234 const struct hda_fixup *fix, int action)
4236 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4239 /* turn on/off mic-mute LED per capture hook via VREF change */
4240 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4241 enum led_brightness brightness)
4243 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4244 struct alc_spec *spec = codec->spec;
4246 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4247 spec->micmute_led_polarity, brightness);
4251 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4252 const struct hda_fixup *fix, int action)
4254 struct alc_spec *spec = codec->spec;
4256 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4257 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4258 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4259 * enable headphone amp
4261 spec->gpio_mask |= 0x10;
4262 spec->gpio_dir |= 0x10;
4263 spec->cap_mute_led_nid = 0x18;
4264 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4265 codec->power_filter = led_power_filter;
4269 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4270 const struct hda_fixup *fix, int action)
4272 struct alc_spec *spec = codec->spec;
4274 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4275 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4276 spec->cap_mute_led_nid = 0x18;
4277 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4278 codec->power_filter = led_power_filter;
4282 static void alc_update_coef_led(struct hda_codec *codec,
4283 struct alc_coef_led *led,
4284 bool polarity, bool on)
4288 /* temporarily power up/down for setting COEF bit */
4289 alc_update_coef_idx(codec, led->idx, led->mask,
4290 on ? led->on : led->off);
4293 /* update mute-LED according to the speaker mute state via COEF bit */
4294 static int coef_mute_led_set(struct led_classdev *led_cdev,
4295 enum led_brightness brightness)
4297 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4298 struct alc_spec *spec = codec->spec;
4300 alc_update_coef_led(codec, &spec->mute_led_coef,
4301 spec->mute_led_polarity, brightness);
4305 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4306 const struct hda_fixup *fix,
4309 struct alc_spec *spec = codec->spec;
4311 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4312 spec->mute_led_polarity = 0;
4313 spec->mute_led_coef.idx = 0x0b;
4314 spec->mute_led_coef.mask = 1 << 3;
4315 spec->mute_led_coef.on = 1 << 3;
4316 spec->mute_led_coef.off = 0;
4317 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4321 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4322 const struct hda_fixup *fix,
4325 struct alc_spec *spec = codec->spec;
4327 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4328 spec->mute_led_polarity = 0;
4329 spec->mute_led_coef.idx = 0x34;
4330 spec->mute_led_coef.mask = 1 << 5;
4331 spec->mute_led_coef.on = 0;
4332 spec->mute_led_coef.off = 1 << 5;
4333 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4337 /* turn on/off mic-mute LED per capture hook by coef bit */
4338 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4339 enum led_brightness brightness)
4341 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4342 struct alc_spec *spec = codec->spec;
4344 alc_update_coef_led(codec, &spec->mic_led_coef,
4345 spec->micmute_led_polarity, brightness);
4349 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4350 const struct hda_fixup *fix, int action)
4352 struct alc_spec *spec = codec->spec;
4354 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4355 spec->mic_led_coef.idx = 0x19;
4356 spec->mic_led_coef.mask = 1 << 13;
4357 spec->mic_led_coef.on = 1 << 13;
4358 spec->mic_led_coef.off = 0;
4359 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4363 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4364 const struct hda_fixup *fix, int action)
4366 struct alc_spec *spec = codec->spec;
4368 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4369 spec->mic_led_coef.idx = 0x35;
4370 spec->mic_led_coef.mask = 3 << 2;
4371 spec->mic_led_coef.on = 2 << 2;
4372 spec->mic_led_coef.off = 1 << 2;
4373 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4377 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4378 const struct hda_fixup *fix, int action)
4380 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4381 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4384 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4385 const struct hda_fixup *fix, int action)
4387 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4388 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4391 #if IS_REACHABLE(CONFIG_INPUT)
4392 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4393 struct hda_jack_callback *event)
4395 struct alc_spec *spec = codec->spec;
4397 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4398 send both key on and key off event for every interrupt. */
4399 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4400 input_sync(spec->kb_dev);
4401 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4402 input_sync(spec->kb_dev);
4405 static int alc_register_micmute_input_device(struct hda_codec *codec)
4407 struct alc_spec *spec = codec->spec;
4410 spec->kb_dev = input_allocate_device();
4411 if (!spec->kb_dev) {
4412 codec_err(codec, "Out of memory (input_allocate_device)\n");
4416 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4418 spec->kb_dev->name = "Microphone Mute Button";
4419 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4420 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4421 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4422 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4423 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4424 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4426 if (input_register_device(spec->kb_dev)) {
4427 codec_err(codec, "input_register_device failed\n");
4428 input_free_device(spec->kb_dev);
4429 spec->kb_dev = NULL;
4436 /* GPIO1 = set according to SKU external amp
4437 * GPIO2 = mic mute hotkey
4439 * GPIO4 = mic mute LED
4441 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4442 const struct hda_fixup *fix, int action)
4444 struct alc_spec *spec = codec->spec;
4446 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4447 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4448 spec->init_amp = ALC_INIT_DEFAULT;
4449 if (alc_register_micmute_input_device(codec) != 0)
4452 spec->gpio_mask |= 0x06;
4453 spec->gpio_dir |= 0x02;
4454 spec->gpio_data |= 0x02;
4455 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4456 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4457 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4458 gpio2_mic_hotkey_event);
4466 case HDA_FIXUP_ACT_FREE:
4467 input_unregister_device(spec->kb_dev);
4468 spec->kb_dev = NULL;
4472 /* Line2 = mic mute hotkey
4473 * GPIO2 = mic mute LED
4475 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4476 const struct hda_fixup *fix, int action)
4478 struct alc_spec *spec = codec->spec;
4480 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4481 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4482 spec->init_amp = ALC_INIT_DEFAULT;
4483 if (alc_register_micmute_input_device(codec) != 0)
4486 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4487 gpio2_mic_hotkey_event);
4495 case HDA_FIXUP_ACT_FREE:
4496 input_unregister_device(spec->kb_dev);
4497 spec->kb_dev = NULL;
4501 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4502 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4505 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4506 const struct hda_fixup *fix, int action)
4508 struct alc_spec *spec = codec->spec;
4510 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4511 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4512 spec->cap_mute_led_nid = 0x18;
4513 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4517 static const struct coef_fw alc225_pre_hsmode[] = {
4518 UPDATE_COEF(0x4a, 1<<8, 0),
4519 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4520 UPDATE_COEF(0x63, 3<<14, 3<<14),
4521 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4522 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4523 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4524 UPDATE_COEF(0x4a, 3<<10, 0),
4528 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4530 struct alc_spec *spec = codec->spec;
4531 static const struct coef_fw coef0255[] = {
4532 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4533 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4534 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4535 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4536 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4539 static const struct coef_fw coef0256[] = {
4540 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4541 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4542 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4543 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4544 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4547 static const struct coef_fw coef0233[] = {
4548 WRITE_COEF(0x1b, 0x0c0b),
4549 WRITE_COEF(0x45, 0xc429),
4550 UPDATE_COEF(0x35, 0x4000, 0),
4551 WRITE_COEF(0x06, 0x2104),
4552 WRITE_COEF(0x1a, 0x0001),
4553 WRITE_COEF(0x26, 0x0004),
4554 WRITE_COEF(0x32, 0x42a3),
4557 static const struct coef_fw coef0288[] = {
4558 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4559 UPDATE_COEF(0x50, 0x2000, 0x2000),
4560 UPDATE_COEF(0x56, 0x0006, 0x0006),
4561 UPDATE_COEF(0x66, 0x0008, 0),
4562 UPDATE_COEF(0x67, 0x2000, 0),
4565 static const struct coef_fw coef0298[] = {
4566 UPDATE_COEF(0x19, 0x1300, 0x0300),
4569 static const struct coef_fw coef0292[] = {
4570 WRITE_COEF(0x76, 0x000e),
4571 WRITE_COEF(0x6c, 0x2400),
4572 WRITE_COEF(0x18, 0x7308),
4573 WRITE_COEF(0x6b, 0xc429),
4576 static const struct coef_fw coef0293[] = {
4577 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4578 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4579 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4580 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4581 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4582 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4585 static const struct coef_fw coef0668[] = {
4586 WRITE_COEF(0x15, 0x0d40),
4587 WRITE_COEF(0xb7, 0x802b),
4590 static const struct coef_fw coef0225[] = {
4591 UPDATE_COEF(0x63, 3<<14, 0),
4594 static const struct coef_fw coef0274[] = {
4595 UPDATE_COEF(0x4a, 0x0100, 0),
4596 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4597 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4598 UPDATE_COEF(0x4a, 0x0010, 0),
4599 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4600 WRITE_COEF(0x45, 0x5289),
4601 UPDATE_COEF(0x4a, 0x0c00, 0),
4605 if (spec->no_internal_mic_pin) {
4606 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4610 switch (codec->core.vendor_id) {
4612 alc_process_coef_fw(codec, coef0255);
4616 alc_process_coef_fw(codec, coef0256);
4621 alc_process_coef_fw(codec, coef0274);
4625 alc_process_coef_fw(codec, coef0233);
4629 alc_process_coef_fw(codec, coef0288);
4632 alc_process_coef_fw(codec, coef0298);
4633 alc_process_coef_fw(codec, coef0288);
4636 alc_process_coef_fw(codec, coef0292);
4639 alc_process_coef_fw(codec, coef0293);
4642 alc_process_coef_fw(codec, coef0668);
4650 alc_process_coef_fw(codec, alc225_pre_hsmode);
4651 alc_process_coef_fw(codec, coef0225);
4654 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4657 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4661 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4664 static const struct coef_fw coef0255[] = {
4665 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4666 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4669 static const struct coef_fw coef0256[] = {
4670 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4671 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4672 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4675 static const struct coef_fw coef0233[] = {
4676 UPDATE_COEF(0x35, 0, 1<<14),
4677 WRITE_COEF(0x06, 0x2100),
4678 WRITE_COEF(0x1a, 0x0021),
4679 WRITE_COEF(0x26, 0x008c),
4682 static const struct coef_fw coef0288[] = {
4683 UPDATE_COEF(0x4f, 0x00c0, 0),
4684 UPDATE_COEF(0x50, 0x2000, 0),
4685 UPDATE_COEF(0x56, 0x0006, 0),
4686 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4687 UPDATE_COEF(0x66, 0x0008, 0x0008),
4688 UPDATE_COEF(0x67, 0x2000, 0x2000),
4691 static const struct coef_fw coef0292[] = {
4692 WRITE_COEF(0x19, 0xa208),
4693 WRITE_COEF(0x2e, 0xacf0),
4696 static const struct coef_fw coef0293[] = {
4697 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4698 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4699 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4702 static const struct coef_fw coef0688[] = {
4703 WRITE_COEF(0xb7, 0x802b),
4704 WRITE_COEF(0xb5, 0x1040),
4705 UPDATE_COEF(0xc3, 0, 1<<12),
4708 static const struct coef_fw coef0225[] = {
4709 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4710 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4711 UPDATE_COEF(0x63, 3<<14, 0),
4714 static const struct coef_fw coef0274[] = {
4715 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4716 UPDATE_COEF(0x4a, 0x0010, 0),
4717 UPDATE_COEF(0x6b, 0xf000, 0),
4721 switch (codec->core.vendor_id) {
4723 alc_write_coef_idx(codec, 0x45, 0xc489);
4724 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4725 alc_process_coef_fw(codec, coef0255);
4726 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4730 alc_write_coef_idx(codec, 0x45, 0xc489);
4731 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4732 alc_process_coef_fw(codec, coef0256);
4733 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4738 alc_write_coef_idx(codec, 0x45, 0x4689);
4739 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4740 alc_process_coef_fw(codec, coef0274);
4741 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4745 alc_write_coef_idx(codec, 0x45, 0xc429);
4746 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4747 alc_process_coef_fw(codec, coef0233);
4748 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4753 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4754 alc_process_coef_fw(codec, coef0288);
4755 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4758 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4759 alc_process_coef_fw(codec, coef0292);
4762 /* Set to TRS mode */
4763 alc_write_coef_idx(codec, 0x45, 0xc429);
4764 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4765 alc_process_coef_fw(codec, coef0293);
4766 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4769 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4773 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4774 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4777 alc_write_coef_idx(codec, 0x11, 0x0001);
4778 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4779 alc_process_coef_fw(codec, coef0688);
4780 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4788 alc_process_coef_fw(codec, alc225_pre_hsmode);
4789 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4790 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4791 alc_process_coef_fw(codec, coef0225);
4792 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4795 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4798 static void alc_headset_mode_default(struct hda_codec *codec)
4800 static const struct coef_fw coef0225[] = {
4801 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4802 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4803 UPDATE_COEF(0x49, 3<<8, 0<<8),
4804 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4805 UPDATE_COEF(0x63, 3<<14, 0),
4806 UPDATE_COEF(0x67, 0xf000, 0x3000),
4809 static const struct coef_fw coef0255[] = {
4810 WRITE_COEF(0x45, 0xc089),
4811 WRITE_COEF(0x45, 0xc489),
4812 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4813 WRITE_COEF(0x49, 0x0049),
4816 static const struct coef_fw coef0256[] = {
4817 WRITE_COEF(0x45, 0xc489),
4818 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4819 WRITE_COEF(0x49, 0x0049),
4820 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4821 WRITE_COEF(0x06, 0x6100),
4824 static const struct coef_fw coef0233[] = {
4825 WRITE_COEF(0x06, 0x2100),
4826 WRITE_COEF(0x32, 0x4ea3),
4829 static const struct coef_fw coef0288[] = {
4830 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4831 UPDATE_COEF(0x50, 0x2000, 0x2000),
4832 UPDATE_COEF(0x56, 0x0006, 0x0006),
4833 UPDATE_COEF(0x66, 0x0008, 0),
4834 UPDATE_COEF(0x67, 0x2000, 0),
4837 static const struct coef_fw coef0292[] = {
4838 WRITE_COEF(0x76, 0x000e),
4839 WRITE_COEF(0x6c, 0x2400),
4840 WRITE_COEF(0x6b, 0xc429),
4841 WRITE_COEF(0x18, 0x7308),
4844 static const struct coef_fw coef0293[] = {
4845 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4846 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4847 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4850 static const struct coef_fw coef0688[] = {
4851 WRITE_COEF(0x11, 0x0041),
4852 WRITE_COEF(0x15, 0x0d40),
4853 WRITE_COEF(0xb7, 0x802b),
4856 static const struct coef_fw coef0274[] = {
4857 WRITE_COEF(0x45, 0x4289),
4858 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4859 UPDATE_COEF(0x6b, 0x0f00, 0),
4860 UPDATE_COEF(0x49, 0x0300, 0x0300),
4864 switch (codec->core.vendor_id) {
4871 alc_process_coef_fw(codec, alc225_pre_hsmode);
4872 alc_process_coef_fw(codec, coef0225);
4875 alc_process_coef_fw(codec, coef0255);
4879 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4880 alc_write_coef_idx(codec, 0x45, 0xc089);
4882 alc_process_coef_fw(codec, coef0256);
4887 alc_process_coef_fw(codec, coef0274);
4891 alc_process_coef_fw(codec, coef0233);
4896 alc_process_coef_fw(codec, coef0288);
4899 alc_process_coef_fw(codec, coef0292);
4902 alc_process_coef_fw(codec, coef0293);
4905 alc_process_coef_fw(codec, coef0688);
4908 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4911 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4915 static void alc_headset_mode_ctia(struct hda_codec *codec)
4919 static const struct coef_fw coef0255[] = {
4920 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4921 WRITE_COEF(0x1b, 0x0c2b),
4922 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4925 static const struct coef_fw coef0256[] = {
4926 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4927 WRITE_COEF(0x1b, 0x0e6b),
4930 static const struct coef_fw coef0233[] = {
4931 WRITE_COEF(0x45, 0xd429),
4932 WRITE_COEF(0x1b, 0x0c2b),
4933 WRITE_COEF(0x32, 0x4ea3),
4936 static const struct coef_fw coef0288[] = {
4937 UPDATE_COEF(0x50, 0x2000, 0x2000),
4938 UPDATE_COEF(0x56, 0x0006, 0x0006),
4939 UPDATE_COEF(0x66, 0x0008, 0),
4940 UPDATE_COEF(0x67, 0x2000, 0),
4943 static const struct coef_fw coef0292[] = {
4944 WRITE_COEF(0x6b, 0xd429),
4945 WRITE_COEF(0x76, 0x0008),
4946 WRITE_COEF(0x18, 0x7388),
4949 static const struct coef_fw coef0293[] = {
4950 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4951 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4954 static const struct coef_fw coef0688[] = {
4955 WRITE_COEF(0x11, 0x0001),
4956 WRITE_COEF(0x15, 0x0d60),
4957 WRITE_COEF(0xc3, 0x0000),
4960 static const struct coef_fw coef0225_1[] = {
4961 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4962 UPDATE_COEF(0x63, 3<<14, 2<<14),
4965 static const struct coef_fw coef0225_2[] = {
4966 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4967 UPDATE_COEF(0x63, 3<<14, 1<<14),
4971 switch (codec->core.vendor_id) {
4973 alc_process_coef_fw(codec, coef0255);
4977 alc_process_coef_fw(codec, coef0256);
4982 alc_write_coef_idx(codec, 0x45, 0xd689);
4986 alc_process_coef_fw(codec, coef0233);
4989 val = alc_read_coef_idx(codec, 0x50);
4990 if (val & (1 << 12)) {
4991 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4992 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4995 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4996 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5002 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5004 alc_process_coef_fw(codec, coef0288);
5007 alc_process_coef_fw(codec, coef0292);
5010 alc_process_coef_fw(codec, coef0293);
5013 alc_process_coef_fw(codec, coef0688);
5021 val = alc_read_coef_idx(codec, 0x45);
5023 alc_process_coef_fw(codec, coef0225_2);
5025 alc_process_coef_fw(codec, coef0225_1);
5028 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5031 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5035 static void alc_headset_mode_omtp(struct hda_codec *codec)
5037 static const struct coef_fw coef0255[] = {
5038 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5039 WRITE_COEF(0x1b, 0x0c2b),
5040 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5043 static const struct coef_fw coef0256[] = {
5044 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5045 WRITE_COEF(0x1b, 0x0e6b),
5048 static const struct coef_fw coef0233[] = {
5049 WRITE_COEF(0x45, 0xe429),
5050 WRITE_COEF(0x1b, 0x0c2b),
5051 WRITE_COEF(0x32, 0x4ea3),
5054 static const struct coef_fw coef0288[] = {
5055 UPDATE_COEF(0x50, 0x2000, 0x2000),
5056 UPDATE_COEF(0x56, 0x0006, 0x0006),
5057 UPDATE_COEF(0x66, 0x0008, 0),
5058 UPDATE_COEF(0x67, 0x2000, 0),
5061 static const struct coef_fw coef0292[] = {
5062 WRITE_COEF(0x6b, 0xe429),
5063 WRITE_COEF(0x76, 0x0008),
5064 WRITE_COEF(0x18, 0x7388),
5067 static const struct coef_fw coef0293[] = {
5068 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5069 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5072 static const struct coef_fw coef0688[] = {
5073 WRITE_COEF(0x11, 0x0001),
5074 WRITE_COEF(0x15, 0x0d50),
5075 WRITE_COEF(0xc3, 0x0000),
5078 static const struct coef_fw coef0225[] = {
5079 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5080 UPDATE_COEF(0x63, 3<<14, 2<<14),
5084 switch (codec->core.vendor_id) {
5086 alc_process_coef_fw(codec, coef0255);
5090 alc_process_coef_fw(codec, coef0256);
5095 alc_write_coef_idx(codec, 0x45, 0xe689);
5099 alc_process_coef_fw(codec, coef0233);
5102 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5103 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5108 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5110 alc_process_coef_fw(codec, coef0288);
5113 alc_process_coef_fw(codec, coef0292);
5116 alc_process_coef_fw(codec, coef0293);
5119 alc_process_coef_fw(codec, coef0688);
5127 alc_process_coef_fw(codec, coef0225);
5130 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5133 static void alc_determine_headset_type(struct hda_codec *codec)
5136 bool is_ctia = false;
5137 struct alc_spec *spec = codec->spec;
5138 static const struct coef_fw coef0255[] = {
5139 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5140 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5144 static const struct coef_fw coef0288[] = {
5145 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5148 static const struct coef_fw coef0298[] = {
5149 UPDATE_COEF(0x50, 0x2000, 0x2000),
5150 UPDATE_COEF(0x56, 0x0006, 0x0006),
5151 UPDATE_COEF(0x66, 0x0008, 0),
5152 UPDATE_COEF(0x67, 0x2000, 0),
5153 UPDATE_COEF(0x19, 0x1300, 0x1300),
5156 static const struct coef_fw coef0293[] = {
5157 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5158 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5161 static const struct coef_fw coef0688[] = {
5162 WRITE_COEF(0x11, 0x0001),
5163 WRITE_COEF(0xb7, 0x802b),
5164 WRITE_COEF(0x15, 0x0d60),
5165 WRITE_COEF(0xc3, 0x0c00),
5168 static const struct coef_fw coef0274[] = {
5169 UPDATE_COEF(0x4a, 0x0010, 0),
5170 UPDATE_COEF(0x4a, 0x8000, 0),
5171 WRITE_COEF(0x45, 0xd289),
5172 UPDATE_COEF(0x49, 0x0300, 0x0300),
5176 if (spec->no_internal_mic_pin) {
5177 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5181 switch (codec->core.vendor_id) {
5183 alc_process_coef_fw(codec, coef0255);
5185 val = alc_read_coef_idx(codec, 0x46);
5186 is_ctia = (val & 0x0070) == 0x0070;
5190 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5191 alc_write_coef_idx(codec, 0x06, 0x6104);
5192 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5194 snd_hda_codec_write(codec, 0x21, 0,
5195 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5197 snd_hda_codec_write(codec, 0x21, 0,
5198 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5200 alc_process_coef_fw(codec, coef0255);
5202 val = alc_read_coef_idx(codec, 0x46);
5203 is_ctia = (val & 0x0070) == 0x0070;
5205 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5206 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5208 snd_hda_codec_write(codec, 0x21, 0,
5209 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5211 snd_hda_codec_write(codec, 0x21, 0,
5212 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5217 alc_process_coef_fw(codec, coef0274);
5219 val = alc_read_coef_idx(codec, 0x46);
5220 is_ctia = (val & 0x00f0) == 0x00f0;
5224 alc_write_coef_idx(codec, 0x45, 0xd029);
5226 val = alc_read_coef_idx(codec, 0x46);
5227 is_ctia = (val & 0x0070) == 0x0070;
5230 snd_hda_codec_write(codec, 0x21, 0,
5231 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5233 snd_hda_codec_write(codec, 0x21, 0,
5234 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5237 val = alc_read_coef_idx(codec, 0x50);
5238 if (val & (1 << 12)) {
5239 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5240 alc_process_coef_fw(codec, coef0288);
5242 val = alc_read_coef_idx(codec, 0x50);
5243 is_ctia = (val & 0x0070) == 0x0070;
5245 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5246 alc_process_coef_fw(codec, coef0288);
5248 val = alc_read_coef_idx(codec, 0x50);
5249 is_ctia = (val & 0x0070) == 0x0070;
5251 alc_process_coef_fw(codec, coef0298);
5252 snd_hda_codec_write(codec, 0x21, 0,
5253 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5255 snd_hda_codec_write(codec, 0x21, 0,
5256 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5260 alc_process_coef_fw(codec, coef0288);
5262 val = alc_read_coef_idx(codec, 0x50);
5263 is_ctia = (val & 0x0070) == 0x0070;
5266 alc_write_coef_idx(codec, 0x6b, 0xd429);
5268 val = alc_read_coef_idx(codec, 0x6c);
5269 is_ctia = (val & 0x001c) == 0x001c;
5272 alc_process_coef_fw(codec, coef0293);
5274 val = alc_read_coef_idx(codec, 0x46);
5275 is_ctia = (val & 0x0070) == 0x0070;
5278 alc_process_coef_fw(codec, coef0688);
5280 val = alc_read_coef_idx(codec, 0xbe);
5281 is_ctia = (val & 0x1c02) == 0x1c02;
5289 snd_hda_codec_write(codec, 0x21, 0,
5290 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5292 snd_hda_codec_write(codec, 0x21, 0,
5293 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5295 alc_process_coef_fw(codec, alc225_pre_hsmode);
5296 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5297 val = alc_read_coef_idx(codec, 0x45);
5298 if (val & (1 << 9)) {
5299 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5300 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5302 val = alc_read_coef_idx(codec, 0x46);
5303 is_ctia = (val & 0x00f0) == 0x00f0;
5305 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5306 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5308 val = alc_read_coef_idx(codec, 0x46);
5309 is_ctia = (val & 0x00f0) == 0x00f0;
5311 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5312 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5313 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5315 snd_hda_codec_write(codec, 0x21, 0,
5316 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5318 snd_hda_codec_write(codec, 0x21, 0,
5319 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5326 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5327 is_ctia ? "yes" : "no");
5328 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5331 static void alc_update_headset_mode(struct hda_codec *codec)
5333 struct alc_spec *spec = codec->spec;
5335 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5336 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5338 int new_headset_mode;
5340 if (!snd_hda_jack_detect(codec, hp_pin))
5341 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5342 else if (mux_pin == spec->headset_mic_pin)
5343 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5344 else if (mux_pin == spec->headphone_mic_pin)
5345 new_headset_mode = ALC_HEADSET_MODE_MIC;
5347 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5349 if (new_headset_mode == spec->current_headset_mode) {
5350 snd_hda_gen_update_outputs(codec);
5354 switch (new_headset_mode) {
5355 case ALC_HEADSET_MODE_UNPLUGGED:
5356 alc_headset_mode_unplugged(codec);
5357 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5358 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5359 spec->gen.hp_jack_present = false;
5361 case ALC_HEADSET_MODE_HEADSET:
5362 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5363 alc_determine_headset_type(codec);
5364 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5365 alc_headset_mode_ctia(codec);
5366 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5367 alc_headset_mode_omtp(codec);
5368 spec->gen.hp_jack_present = true;
5370 case ALC_HEADSET_MODE_MIC:
5371 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5372 spec->gen.hp_jack_present = false;
5374 case ALC_HEADSET_MODE_HEADPHONE:
5375 alc_headset_mode_default(codec);
5376 spec->gen.hp_jack_present = true;
5379 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5380 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5381 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5382 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5383 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5386 spec->current_headset_mode = new_headset_mode;
5388 snd_hda_gen_update_outputs(codec);
5391 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5392 struct snd_kcontrol *kcontrol,
5393 struct snd_ctl_elem_value *ucontrol)
5395 alc_update_headset_mode(codec);
5398 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5399 struct hda_jack_callback *jack)
5401 snd_hda_gen_hp_automute(codec, jack);
5404 static void alc_probe_headset_mode(struct hda_codec *codec)
5407 struct alc_spec *spec = codec->spec;
5408 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5411 for (i = 0; i < cfg->num_inputs; i++) {
5412 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5413 spec->headset_mic_pin = cfg->inputs[i].pin;
5414 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5415 spec->headphone_mic_pin = cfg->inputs[i].pin;
5418 WARN_ON(spec->gen.cap_sync_hook);
5419 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5420 spec->gen.automute_hook = alc_update_headset_mode;
5421 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5424 static void alc_fixup_headset_mode(struct hda_codec *codec,
5425 const struct hda_fixup *fix, int action)
5427 struct alc_spec *spec = codec->spec;
5430 case HDA_FIXUP_ACT_PRE_PROBE:
5431 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5433 case HDA_FIXUP_ACT_PROBE:
5434 alc_probe_headset_mode(codec);
5436 case HDA_FIXUP_ACT_INIT:
5437 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5438 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5439 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5441 alc_update_headset_mode(codec);
5446 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5447 const struct hda_fixup *fix, int action)
5449 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5450 struct alc_spec *spec = codec->spec;
5451 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5454 alc_fixup_headset_mode(codec, fix, action);
5457 static void alc255_set_default_jack_type(struct hda_codec *codec)
5459 /* Set to iphone type */
5460 static const struct coef_fw alc255fw[] = {
5461 WRITE_COEF(0x1b, 0x880b),
5462 WRITE_COEF(0x45, 0xd089),
5463 WRITE_COEF(0x1b, 0x080b),
5464 WRITE_COEF(0x46, 0x0004),
5465 WRITE_COEF(0x1b, 0x0c0b),
5468 static const struct coef_fw alc256fw[] = {
5469 WRITE_COEF(0x1b, 0x884b),
5470 WRITE_COEF(0x45, 0xd089),
5471 WRITE_COEF(0x1b, 0x084b),
5472 WRITE_COEF(0x46, 0x0004),
5473 WRITE_COEF(0x1b, 0x0c4b),
5476 switch (codec->core.vendor_id) {
5478 alc_process_coef_fw(codec, alc255fw);
5482 alc_process_coef_fw(codec, alc256fw);
5488 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5489 const struct hda_fixup *fix, int action)
5491 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5492 alc255_set_default_jack_type(codec);
5494 alc_fixup_headset_mode(codec, fix, action);
5497 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5498 const struct hda_fixup *fix, int action)
5500 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5501 struct alc_spec *spec = codec->spec;
5502 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5503 alc255_set_default_jack_type(codec);
5506 alc_fixup_headset_mode(codec, fix, action);
5509 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5510 struct hda_jack_callback *jack)
5512 struct alc_spec *spec = codec->spec;
5514 alc_update_headset_jack_cb(codec, jack);
5515 /* Headset Mic enable or disable, only for Dell Dino */
5516 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5519 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5520 const struct hda_fixup *fix, int action)
5522 alc_fixup_headset_mode(codec, fix, action);
5523 if (action == HDA_FIXUP_ACT_PROBE) {
5524 struct alc_spec *spec = codec->spec;
5525 /* toggled via hp_automute_hook */
5526 spec->gpio_mask |= 0x40;
5527 spec->gpio_dir |= 0x40;
5528 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5532 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5533 const struct hda_fixup *fix, int action)
5535 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5536 struct alc_spec *spec = codec->spec;
5537 spec->gen.auto_mute_via_amp = 1;
5541 static void alc_fixup_no_shutup(struct hda_codec *codec,
5542 const struct hda_fixup *fix, int action)
5544 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5545 struct alc_spec *spec = codec->spec;
5546 spec->no_shutup_pins = 1;
5550 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5551 const struct hda_fixup *fix, int action)
5553 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5554 struct alc_spec *spec = codec->spec;
5555 /* Disable AA-loopback as it causes white noise */
5556 spec->gen.mixer_nid = 0;
5560 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5561 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5562 const struct hda_fixup *fix, int action)
5564 static const struct hda_pintbl pincfgs[] = {
5565 { 0x16, 0x21211010 }, /* dock headphone */
5566 { 0x19, 0x21a11010 }, /* dock mic */
5569 struct alc_spec *spec = codec->spec;
5571 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5572 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5573 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5574 codec->power_save_node = 0; /* avoid click noises */
5575 snd_hda_apply_pincfgs(codec, pincfgs);
5579 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5580 const struct hda_fixup *fix, int action)
5582 static const struct hda_pintbl pincfgs[] = {
5583 { 0x17, 0x21211010 }, /* dock headphone */
5584 { 0x19, 0x21a11010 }, /* dock mic */
5587 struct alc_spec *spec = codec->spec;
5589 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5590 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5591 snd_hda_apply_pincfgs(codec, pincfgs);
5592 } else if (action == HDA_FIXUP_ACT_INIT) {
5593 /* Enable DOCK device */
5594 snd_hda_codec_write(codec, 0x17, 0,
5595 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5596 /* Enable DOCK device */
5597 snd_hda_codec_write(codec, 0x19, 0,
5598 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5602 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5603 const struct hda_fixup *fix, int action)
5605 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5606 * the speaker output becomes too low by some reason on Thinkpads with
5609 static const hda_nid_t preferred_pairs[] = {
5610 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5613 struct alc_spec *spec = codec->spec;
5615 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5616 spec->gen.preferred_dacs = preferred_pairs;
5619 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5621 struct alc_spec *spec = codec->spec;
5622 int hp_pin = alc_get_hp_pin(spec);
5624 /* Prevent pop noises when headphones are plugged in */
5625 snd_hda_codec_write(codec, hp_pin, 0,
5626 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5630 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5631 const struct hda_fixup *fix, int action)
5633 struct alc_spec *spec = codec->spec;
5634 struct hda_input_mux *imux = &spec->gen.input_mux;
5638 case HDA_FIXUP_ACT_PRE_PROBE:
5639 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5640 * it causes a click noise at start up
5642 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5643 spec->shutup = alc_shutup_dell_xps13;
5645 case HDA_FIXUP_ACT_PROBE:
5646 /* Make the internal mic the default input source. */
5647 for (i = 0; i < imux->num_items; i++) {
5648 if (spec->gen.imux_pins[i] == 0x12) {
5649 spec->gen.cur_mux[0] = i;
5657 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5658 const struct hda_fixup *fix, int action)
5660 struct alc_spec *spec = codec->spec;
5662 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5663 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5664 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5666 /* Disable boost for mic-in permanently. (This code is only called
5667 from quirks that guarantee that the headphone is at NID 0x1b.) */
5668 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5669 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5671 alc_fixup_headset_mode(codec, fix, action);
5674 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5675 const struct hda_fixup *fix, int action)
5677 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5678 alc_write_coef_idx(codec, 0xc4, 0x8000);
5679 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5680 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5682 alc_fixup_headset_mode(codec, fix, action);
5685 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5686 static int find_ext_mic_pin(struct hda_codec *codec)
5688 struct alc_spec *spec = codec->spec;
5689 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5691 unsigned int defcfg;
5694 for (i = 0; i < cfg->num_inputs; i++) {
5695 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5697 nid = cfg->inputs[i].pin;
5698 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5699 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5707 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5708 const struct hda_fixup *fix,
5711 struct alc_spec *spec = codec->spec;
5713 if (action == HDA_FIXUP_ACT_PROBE) {
5714 int mic_pin = find_ext_mic_pin(codec);
5715 int hp_pin = alc_get_hp_pin(spec);
5717 if (snd_BUG_ON(!mic_pin || !hp_pin))
5719 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5723 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5724 const struct hda_fixup *fix,
5727 struct alc_spec *spec = codec->spec;
5728 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5731 /* The mic boosts on level 2 and 3 are too noisy
5732 on the internal mic input.
5733 Therefore limit the boost to 0 or 1. */
5735 if (action != HDA_FIXUP_ACT_PROBE)
5738 for (i = 0; i < cfg->num_inputs; i++) {
5739 hda_nid_t nid = cfg->inputs[i].pin;
5740 unsigned int defcfg;
5741 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5743 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5744 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5747 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5748 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5749 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5750 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5751 (0 << AC_AMPCAP_MUTE_SHIFT));
5755 static void alc283_hp_automute_hook(struct hda_codec *codec,
5756 struct hda_jack_callback *jack)
5758 struct alc_spec *spec = codec->spec;
5762 snd_hda_gen_hp_automute(codec, jack);
5764 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5767 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5771 static void alc283_fixup_chromebook(struct hda_codec *codec,
5772 const struct hda_fixup *fix, int action)
5774 struct alc_spec *spec = codec->spec;
5777 case HDA_FIXUP_ACT_PRE_PROBE:
5778 snd_hda_override_wcaps(codec, 0x03, 0);
5779 /* Disable AA-loopback as it causes white noise */
5780 spec->gen.mixer_nid = 0;
5782 case HDA_FIXUP_ACT_INIT:
5783 /* MIC2-VREF control */
5784 /* Set to manual mode */
5785 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5786 /* Enable Line1 input control by verb */
5787 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5792 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5793 const struct hda_fixup *fix, int action)
5795 struct alc_spec *spec = codec->spec;
5798 case HDA_FIXUP_ACT_PRE_PROBE:
5799 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5801 case HDA_FIXUP_ACT_INIT:
5802 /* MIC2-VREF control */
5803 /* Set to manual mode */
5804 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5809 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5810 static void asus_tx300_automute(struct hda_codec *codec)
5812 struct alc_spec *spec = codec->spec;
5813 snd_hda_gen_update_outputs(codec);
5814 if (snd_hda_jack_detect(codec, 0x1b))
5815 spec->gen.mute_bits |= (1ULL << 0x14);
5818 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5819 const struct hda_fixup *fix, int action)
5821 struct alc_spec *spec = codec->spec;
5822 static const struct hda_pintbl dock_pins[] = {
5823 { 0x1b, 0x21114000 }, /* dock speaker pin */
5828 case HDA_FIXUP_ACT_PRE_PROBE:
5829 spec->init_amp = ALC_INIT_DEFAULT;
5830 /* TX300 needs to set up GPIO2 for the speaker amp */
5831 alc_setup_gpio(codec, 0x04);
5832 snd_hda_apply_pincfgs(codec, dock_pins);
5833 spec->gen.auto_mute_via_amp = 1;
5834 spec->gen.automute_hook = asus_tx300_automute;
5835 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5836 snd_hda_gen_hp_automute);
5838 case HDA_FIXUP_ACT_PROBE:
5839 spec->init_amp = ALC_INIT_DEFAULT;
5841 case HDA_FIXUP_ACT_BUILD:
5842 /* this is a bit tricky; give more sane names for the main
5843 * (tablet) speaker and the dock speaker, respectively
5845 rename_ctl(codec, "Speaker Playback Switch",
5846 "Dock Speaker Playback Switch");
5847 rename_ctl(codec, "Bass Speaker Playback Switch",
5848 "Speaker Playback Switch");
5853 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5854 const struct hda_fixup *fix, int action)
5856 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5857 /* DAC node 0x03 is giving mono output. We therefore want to
5858 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5859 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5860 static const hda_nid_t conn1[] = { 0x0c };
5861 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
5862 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
5866 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5867 const struct hda_fixup *fix, int action)
5869 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5870 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5871 we can't adjust the speaker's volume since this node does not has
5872 Amp-out capability. we change the speaker's route to:
5873 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5874 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5875 speaker's volume now. */
5877 static const hda_nid_t conn1[] = { 0x0c };
5878 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
5882 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5883 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5884 const struct hda_fixup *fix, int action)
5886 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5887 static const hda_nid_t conn[] = { 0x02, 0x03 };
5888 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5892 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5893 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
5894 const struct hda_fixup *fix, int action)
5896 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5897 static const hda_nid_t conn[] = { 0x02 };
5898 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5902 /* Hook to update amp GPIO4 for automute */
5903 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5904 struct hda_jack_callback *jack)
5906 struct alc_spec *spec = codec->spec;
5908 snd_hda_gen_hp_automute(codec, jack);
5909 /* mute_led_polarity is set to 0, so we pass inverted value here */
5910 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
5911 !spec->gen.hp_jack_present);
5914 /* Manage GPIOs for HP EliteBook Folio 9480m.
5916 * GPIO4 is the headphone amplifier power control
5917 * GPIO3 is the audio output mute indicator LED
5920 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5921 const struct hda_fixup *fix,
5924 struct alc_spec *spec = codec->spec;
5926 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5927 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5928 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5929 spec->gpio_mask |= 0x10;
5930 spec->gpio_dir |= 0x10;
5931 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5935 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5936 const struct hda_fixup *fix,
5939 struct alc_spec *spec = codec->spec;
5941 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5942 spec->gpio_mask |= 0x04;
5943 spec->gpio_dir |= 0x04;
5944 /* set data bit low */
5948 /* Quirk for Thinkpad X1 7th and 8th Gen
5949 * The following fixed routing needed
5950 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
5951 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
5952 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
5954 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
5955 const struct hda_fixup *fix, int action)
5957 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
5958 static const hda_nid_t preferred_pairs[] = {
5959 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
5961 struct alc_spec *spec = codec->spec;
5964 case HDA_FIXUP_ACT_PRE_PROBE:
5965 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5966 spec->gen.preferred_dacs = preferred_pairs;
5968 case HDA_FIXUP_ACT_BUILD:
5969 /* The generic parser creates somewhat unintuitive volume ctls
5970 * with the fixed routing above, and the shared DAC2 may be
5972 * Rename those to unique names so that PA doesn't touch them
5973 * and use only Master volume.
5975 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
5976 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
5981 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5982 const struct hda_fixup *fix,
5985 alc_fixup_dual_codecs(codec, fix, action);
5987 case HDA_FIXUP_ACT_PRE_PROBE:
5988 /* override card longname to provide a unique UCM profile */
5989 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5991 case HDA_FIXUP_ACT_BUILD:
5992 /* rename Capture controls depending on the codec */
5993 rename_ctl(codec, "Capture Volume",
5995 "Rear-Panel Capture Volume" :
5996 "Front-Panel Capture Volume");
5997 rename_ctl(codec, "Capture Switch",
5999 "Rear-Panel Capture Switch" :
6000 "Front-Panel Capture Switch");
6005 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6006 const struct hda_fixup *fix, int action)
6008 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6011 codec->power_save_node = 1;
6014 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6015 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6016 const struct hda_fixup *fix, int action)
6018 struct alc_spec *spec = codec->spec;
6019 static const hda_nid_t preferred_pairs[] = {
6020 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6024 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6027 spec->gen.preferred_dacs = preferred_pairs;
6028 spec->gen.auto_mute_via_amp = 1;
6029 codec->power_save_node = 0;
6032 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6033 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6034 const struct hda_fixup *fix, int action)
6036 static const hda_nid_t preferred_pairs[] = {
6037 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6039 struct alc_spec *spec = codec->spec;
6041 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6042 spec->gen.preferred_dacs = preferred_pairs;
6043 spec->gen.obey_preferred_dacs = 1;
6047 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6048 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6049 const struct hda_fixup *fix, int action)
6051 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6054 snd_hda_override_wcaps(codec, 0x03, 0);
6057 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6059 switch (codec->core.vendor_id) {
6065 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6066 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6072 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6073 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6078 static void alc295_fixup_chromebook(struct hda_codec *codec,
6079 const struct hda_fixup *fix, int action)
6081 struct alc_spec *spec = codec->spec;
6084 case HDA_FIXUP_ACT_PRE_PROBE:
6085 spec->ultra_low_power = true;
6087 case HDA_FIXUP_ACT_INIT:
6088 alc_combo_jack_hp_jd_restart(codec);
6093 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6094 const struct hda_fixup *fix, int action)
6096 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6097 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6101 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6102 struct hda_jack_callback *cb)
6104 /* The Windows driver sets the codec up in a very different way where
6105 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6107 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6108 alc_write_coef_idx(codec, 0x10, 0x8a20);
6110 alc_write_coef_idx(codec, 0x10, 0x0a20);
6113 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6114 const struct hda_fixup *fix, int action)
6116 /* Pin 0x21: headphones/headset mic */
6117 if (!is_jack_detectable(codec, 0x21))
6121 case HDA_FIXUP_ACT_PRE_PROBE:
6122 snd_hda_jack_detect_enable_callback(codec, 0x21,
6123 alc294_gx502_toggle_output);
6125 case HDA_FIXUP_ACT_INIT:
6126 /* Make sure to start in a correct state, i.e. if
6127 * headphones have been plugged in before powering up the system
6129 alc294_gx502_toggle_output(codec, NULL);
6134 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6135 const struct hda_fixup *fix, int action)
6137 if (action != HDA_FIXUP_ACT_INIT)
6141 alc_write_coef_idx(codec, 0x65, 0x0);
6144 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6145 const struct hda_fixup *fix, int action)
6148 case HDA_FIXUP_ACT_INIT:
6149 alc_combo_jack_hp_jd_restart(codec);
6154 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6155 const struct hda_fixup *fix, int action)
6157 struct alc_spec *spec = codec->spec;
6160 case HDA_FIXUP_ACT_PRE_PROBE:
6161 /* Mic RING SLEEVE swap for combo jack */
6162 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6163 spec->no_internal_mic_pin = true;
6165 case HDA_FIXUP_ACT_INIT:
6166 alc_combo_jack_hp_jd_restart(codec);
6171 /* for hda_fixup_thinkpad_acpi() */
6172 #include "thinkpad_helper.c"
6174 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6175 const struct hda_fixup *fix, int action)
6177 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6178 hda_fixup_thinkpad_acpi(codec, fix, action);
6181 /* for alc295_fixup_hp_top_speakers */
6182 #include "hp_x360_helper.c"
6186 ALC269_FIXUP_SONY_VAIO,
6187 ALC275_FIXUP_SONY_VAIO_GPIO2,
6188 ALC269_FIXUP_DELL_M101Z,
6189 ALC269_FIXUP_SKU_IGNORE,
6190 ALC269_FIXUP_ASUS_G73JW,
6191 ALC269_FIXUP_LENOVO_EAPD,
6192 ALC275_FIXUP_SONY_HWEQ,
6193 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6195 ALC269_FIXUP_PCM_44K,
6196 ALC269_FIXUP_STEREO_DMIC,
6197 ALC269_FIXUP_HEADSET_MIC,
6198 ALC269_FIXUP_QUANTA_MUTE,
6199 ALC269_FIXUP_LIFEBOOK,
6200 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6201 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6202 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6203 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6206 ALC269VB_FIXUP_AMIC,
6207 ALC269VB_FIXUP_DMIC,
6208 ALC269_FIXUP_HP_MUTE_LED,
6209 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6210 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6211 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6212 ALC269_FIXUP_HP_GPIO_LED,
6213 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6214 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6215 ALC269_FIXUP_INV_DMIC,
6216 ALC269_FIXUP_LENOVO_DOCK,
6217 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6218 ALC269_FIXUP_NO_SHUTUP,
6219 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6220 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6221 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6222 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6223 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6224 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6225 ALC269_FIXUP_HEADSET_MODE,
6226 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6227 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6228 ALC269_FIXUP_ASUS_X101_FUNC,
6229 ALC269_FIXUP_ASUS_X101_VERB,
6230 ALC269_FIXUP_ASUS_X101,
6231 ALC271_FIXUP_AMIC_MIC2,
6232 ALC271_FIXUP_HP_GATE_MIC_JACK,
6233 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6234 ALC269_FIXUP_ACER_AC700,
6235 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6236 ALC269VB_FIXUP_ASUS_ZENBOOK,
6237 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6238 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6239 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6240 ALC283_FIXUP_CHROME_BOOK,
6241 ALC283_FIXUP_SENSE_COMBO_JACK,
6242 ALC282_FIXUP_ASUS_TX300,
6243 ALC283_FIXUP_INT_MIC,
6244 ALC290_FIXUP_MONO_SPEAKERS,
6245 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6246 ALC290_FIXUP_SUBWOOFER,
6247 ALC290_FIXUP_SUBWOOFER_HSJACK,
6248 ALC269_FIXUP_THINKPAD_ACPI,
6249 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6250 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6251 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6252 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6253 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6254 ALC255_FIXUP_HEADSET_MODE,
6255 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6256 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6257 ALC292_FIXUP_TPT440_DOCK,
6258 ALC292_FIXUP_TPT440,
6259 ALC283_FIXUP_HEADSET_MIC,
6260 ALC255_FIXUP_MIC_MUTE_LED,
6261 ALC282_FIXUP_ASPIRE_V5_PINS,
6262 ALC280_FIXUP_HP_GPIO4,
6263 ALC286_FIXUP_HP_GPIO_LED,
6264 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6265 ALC280_FIXUP_HP_DOCK_PINS,
6266 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6267 ALC280_FIXUP_HP_9480M,
6268 ALC288_FIXUP_DELL_HEADSET_MODE,
6269 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6270 ALC288_FIXUP_DELL_XPS_13,
6271 ALC288_FIXUP_DISABLE_AAMIX,
6272 ALC292_FIXUP_DELL_E7X_AAMIX,
6273 ALC292_FIXUP_DELL_E7X,
6274 ALC292_FIXUP_DISABLE_AAMIX,
6275 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6276 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6277 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6278 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6279 ALC275_FIXUP_DELL_XPS,
6280 ALC293_FIXUP_LENOVO_SPK_NOISE,
6281 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6282 ALC255_FIXUP_DELL_SPK_NOISE,
6283 ALC225_FIXUP_DISABLE_MIC_VREF,
6284 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6285 ALC295_FIXUP_DISABLE_DAC3,
6286 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6287 ALC280_FIXUP_HP_HEADSET_MIC,
6288 ALC221_FIXUP_HP_FRONT_MIC,
6289 ALC292_FIXUP_TPT460,
6290 ALC298_FIXUP_SPK_VOLUME,
6291 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6292 ALC269_FIXUP_ATIV_BOOK_8,
6293 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6294 ALC256_FIXUP_ASUS_HEADSET_MODE,
6295 ALC256_FIXUP_ASUS_MIC,
6296 ALC256_FIXUP_ASUS_AIO_GPIO2,
6297 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6298 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6299 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6300 ALC233_FIXUP_ACER_HEADSET_MIC,
6301 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6302 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6303 ALC225_FIXUP_S3_POP_NOISE,
6304 ALC700_FIXUP_INTEL_REFERENCE,
6305 ALC274_FIXUP_DELL_BIND_DACS,
6306 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6307 ALC298_FIXUP_TPT470_DOCK_FIX,
6308 ALC298_FIXUP_TPT470_DOCK,
6309 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6310 ALC255_FIXUP_DELL_HEADSET_MIC,
6311 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6312 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6313 ALC295_FIXUP_HP_X360,
6314 ALC221_FIXUP_HP_HEADSET_MIC,
6315 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6316 ALC295_FIXUP_HP_AUTO_MUTE,
6317 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6318 ALC294_FIXUP_ASUS_MIC,
6319 ALC294_FIXUP_ASUS_HEADSET_MIC,
6320 ALC294_FIXUP_ASUS_SPK,
6321 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6322 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6323 ALC255_FIXUP_ACER_HEADSET_MIC,
6324 ALC295_FIXUP_CHROME_BOOK,
6325 ALC225_FIXUP_HEADSET_JACK,
6326 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6327 ALC225_FIXUP_WYSE_AUTO_MUTE,
6328 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6329 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6330 ALC256_FIXUP_ASUS_HEADSET_MIC,
6331 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6332 ALC299_FIXUP_PREDATOR_SPK,
6333 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6334 ALC289_FIXUP_DELL_SPK2,
6335 ALC289_FIXUP_DUAL_SPK,
6336 ALC294_FIXUP_SPK2_TO_DAC1,
6337 ALC294_FIXUP_ASUS_DUAL_SPK,
6338 ALC285_FIXUP_THINKPAD_X1_GEN7,
6339 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6340 ALC294_FIXUP_ASUS_HPE,
6341 ALC294_FIXUP_ASUS_COEF_1B,
6342 ALC294_FIXUP_ASUS_GX502_HP,
6343 ALC294_FIXUP_ASUS_GX502_PINS,
6344 ALC294_FIXUP_ASUS_GX502_VERBS,
6345 ALC285_FIXUP_HP_GPIO_LED,
6346 ALC285_FIXUP_HP_MUTE_LED,
6347 ALC236_FIXUP_HP_MUTE_LED,
6348 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6349 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6350 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6351 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6352 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6353 ALC289_FIXUP_ASUS_GA401,
6354 ALC289_FIXUP_ASUS_GA502,
6355 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6356 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6357 ALC269_FIXUP_CZC_B20,
6358 ALC269_FIXUP_CZC_TMI,
6359 ALC269_FIXUP_CZC_L101,
6360 ALC269_FIXUP_LEMOTE_A1802,
6361 ALC269_FIXUP_LEMOTE_A190X,
6362 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6363 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6364 ALC274_FIXUP_HP_MIC,
6365 ALC274_FIXUP_HP_HEADSET_MIC,
6366 ALC256_FIXUP_ASUS_HPE,
6367 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6368 ALC287_FIXUP_HP_GPIO_LED,
6369 ALC256_FIXUP_HP_HEADSET_MIC,
6370 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6371 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6374 static const struct hda_fixup alc269_fixups[] = {
6375 [ALC269_FIXUP_GPIO2] = {
6376 .type = HDA_FIXUP_FUNC,
6377 .v.func = alc_fixup_gpio2,
6379 [ALC269_FIXUP_SONY_VAIO] = {
6380 .type = HDA_FIXUP_PINCTLS,
6381 .v.pins = (const struct hda_pintbl[]) {
6382 {0x19, PIN_VREFGRD},
6386 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6387 .type = HDA_FIXUP_FUNC,
6388 .v.func = alc275_fixup_gpio4_off,
6390 .chain_id = ALC269_FIXUP_SONY_VAIO
6392 [ALC269_FIXUP_DELL_M101Z] = {
6393 .type = HDA_FIXUP_VERBS,
6394 .v.verbs = (const struct hda_verb[]) {
6395 /* Enables internal speaker */
6396 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6397 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6401 [ALC269_FIXUP_SKU_IGNORE] = {
6402 .type = HDA_FIXUP_FUNC,
6403 .v.func = alc_fixup_sku_ignore,
6405 [ALC269_FIXUP_ASUS_G73JW] = {
6406 .type = HDA_FIXUP_PINS,
6407 .v.pins = (const struct hda_pintbl[]) {
6408 { 0x17, 0x99130111 }, /* subwoofer */
6412 [ALC269_FIXUP_LENOVO_EAPD] = {
6413 .type = HDA_FIXUP_VERBS,
6414 .v.verbs = (const struct hda_verb[]) {
6415 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6419 [ALC275_FIXUP_SONY_HWEQ] = {
6420 .type = HDA_FIXUP_FUNC,
6421 .v.func = alc269_fixup_hweq,
6423 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6425 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6426 .type = HDA_FIXUP_FUNC,
6427 .v.func = alc_fixup_disable_aamix,
6429 .chain_id = ALC269_FIXUP_SONY_VAIO
6431 [ALC271_FIXUP_DMIC] = {
6432 .type = HDA_FIXUP_FUNC,
6433 .v.func = alc271_fixup_dmic,
6435 [ALC269_FIXUP_PCM_44K] = {
6436 .type = HDA_FIXUP_FUNC,
6437 .v.func = alc269_fixup_pcm_44k,
6439 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6441 [ALC269_FIXUP_STEREO_DMIC] = {
6442 .type = HDA_FIXUP_FUNC,
6443 .v.func = alc269_fixup_stereo_dmic,
6445 [ALC269_FIXUP_HEADSET_MIC] = {
6446 .type = HDA_FIXUP_FUNC,
6447 .v.func = alc269_fixup_headset_mic,
6449 [ALC269_FIXUP_QUANTA_MUTE] = {
6450 .type = HDA_FIXUP_FUNC,
6451 .v.func = alc269_fixup_quanta_mute,
6453 [ALC269_FIXUP_LIFEBOOK] = {
6454 .type = HDA_FIXUP_PINS,
6455 .v.pins = (const struct hda_pintbl[]) {
6456 { 0x1a, 0x2101103f }, /* dock line-out */
6457 { 0x1b, 0x23a11040 }, /* dock mic-in */
6461 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6463 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6464 .type = HDA_FIXUP_PINS,
6465 .v.pins = (const struct hda_pintbl[]) {
6466 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6470 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6471 .type = HDA_FIXUP_PINS,
6472 .v.pins = (const struct hda_pintbl[]) {
6473 { 0x21, 0x0221102f }, /* HP out */
6477 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6478 .type = HDA_FIXUP_FUNC,
6479 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6481 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6482 .type = HDA_FIXUP_FUNC,
6483 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6485 [ALC269_FIXUP_AMIC] = {
6486 .type = HDA_FIXUP_PINS,
6487 .v.pins = (const struct hda_pintbl[]) {
6488 { 0x14, 0x99130110 }, /* speaker */
6489 { 0x15, 0x0121401f }, /* HP out */
6490 { 0x18, 0x01a19c20 }, /* mic */
6491 { 0x19, 0x99a3092f }, /* int-mic */
6495 [ALC269_FIXUP_DMIC] = {
6496 .type = HDA_FIXUP_PINS,
6497 .v.pins = (const struct hda_pintbl[]) {
6498 { 0x12, 0x99a3092f }, /* int-mic */
6499 { 0x14, 0x99130110 }, /* speaker */
6500 { 0x15, 0x0121401f }, /* HP out */
6501 { 0x18, 0x01a19c20 }, /* mic */
6505 [ALC269VB_FIXUP_AMIC] = {
6506 .type = HDA_FIXUP_PINS,
6507 .v.pins = (const struct hda_pintbl[]) {
6508 { 0x14, 0x99130110 }, /* speaker */
6509 { 0x18, 0x01a19c20 }, /* mic */
6510 { 0x19, 0x99a3092f }, /* int-mic */
6511 { 0x21, 0x0121401f }, /* HP out */
6515 [ALC269VB_FIXUP_DMIC] = {
6516 .type = HDA_FIXUP_PINS,
6517 .v.pins = (const struct hda_pintbl[]) {
6518 { 0x12, 0x99a3092f }, /* int-mic */
6519 { 0x14, 0x99130110 }, /* speaker */
6520 { 0x18, 0x01a19c20 }, /* mic */
6521 { 0x21, 0x0121401f }, /* HP out */
6525 [ALC269_FIXUP_HP_MUTE_LED] = {
6526 .type = HDA_FIXUP_FUNC,
6527 .v.func = alc269_fixup_hp_mute_led,
6529 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6530 .type = HDA_FIXUP_FUNC,
6531 .v.func = alc269_fixup_hp_mute_led_mic1,
6533 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6534 .type = HDA_FIXUP_FUNC,
6535 .v.func = alc269_fixup_hp_mute_led_mic2,
6537 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6538 .type = HDA_FIXUP_FUNC,
6539 .v.func = alc269_fixup_hp_mute_led_mic3,
6541 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6543 [ALC269_FIXUP_HP_GPIO_LED] = {
6544 .type = HDA_FIXUP_FUNC,
6545 .v.func = alc269_fixup_hp_gpio_led,
6547 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6548 .type = HDA_FIXUP_FUNC,
6549 .v.func = alc269_fixup_hp_gpio_mic1_led,
6551 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6552 .type = HDA_FIXUP_FUNC,
6553 .v.func = alc269_fixup_hp_line1_mic1_led,
6555 [ALC269_FIXUP_INV_DMIC] = {
6556 .type = HDA_FIXUP_FUNC,
6557 .v.func = alc_fixup_inv_dmic,
6559 [ALC269_FIXUP_NO_SHUTUP] = {
6560 .type = HDA_FIXUP_FUNC,
6561 .v.func = alc_fixup_no_shutup,
6563 [ALC269_FIXUP_LENOVO_DOCK] = {
6564 .type = HDA_FIXUP_PINS,
6565 .v.pins = (const struct hda_pintbl[]) {
6566 { 0x19, 0x23a11040 }, /* dock mic */
6567 { 0x1b, 0x2121103f }, /* dock headphone */
6571 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6573 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6574 .type = HDA_FIXUP_FUNC,
6575 .v.func = alc269_fixup_limit_int_mic_boost,
6577 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6579 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6580 .type = HDA_FIXUP_FUNC,
6581 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6583 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6585 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6586 .type = HDA_FIXUP_PINS,
6587 .v.pins = (const struct hda_pintbl[]) {
6588 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6589 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6593 .chain_id = ALC269_FIXUP_HEADSET_MODE
6595 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6596 .type = HDA_FIXUP_PINS,
6597 .v.pins = (const struct hda_pintbl[]) {
6598 { 0x16, 0x21014020 }, /* dock line out */
6599 { 0x19, 0x21a19030 }, /* dock mic */
6600 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6604 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6606 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6607 .type = HDA_FIXUP_PINS,
6608 .v.pins = (const struct hda_pintbl[]) {
6609 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6613 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6615 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6616 .type = HDA_FIXUP_PINS,
6617 .v.pins = (const struct hda_pintbl[]) {
6618 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6619 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6623 .chain_id = ALC269_FIXUP_HEADSET_MODE
6625 [ALC269_FIXUP_HEADSET_MODE] = {
6626 .type = HDA_FIXUP_FUNC,
6627 .v.func = alc_fixup_headset_mode,
6629 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6631 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6632 .type = HDA_FIXUP_FUNC,
6633 .v.func = alc_fixup_headset_mode_no_hp_mic,
6635 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6636 .type = HDA_FIXUP_PINS,
6637 .v.pins = (const struct hda_pintbl[]) {
6638 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6642 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6644 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6645 .type = HDA_FIXUP_PINS,
6646 .v.pins = (const struct hda_pintbl[]) {
6647 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6651 .chain_id = ALC269_FIXUP_HEADSET_MIC
6653 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
6654 .type = HDA_FIXUP_PINS,
6655 .v.pins = (const struct hda_pintbl[]) {
6669 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6671 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
6672 .type = HDA_FIXUP_FUNC,
6673 .v.func = alc298_fixup_huawei_mbx_stereo,
6675 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6677 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6678 .type = HDA_FIXUP_FUNC,
6679 .v.func = alc269_fixup_x101_headset_mic,
6681 [ALC269_FIXUP_ASUS_X101_VERB] = {
6682 .type = HDA_FIXUP_VERBS,
6683 .v.verbs = (const struct hda_verb[]) {
6684 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6685 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6686 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6690 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6692 [ALC269_FIXUP_ASUS_X101] = {
6693 .type = HDA_FIXUP_PINS,
6694 .v.pins = (const struct hda_pintbl[]) {
6695 { 0x18, 0x04a1182c }, /* Headset mic */
6699 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6701 [ALC271_FIXUP_AMIC_MIC2] = {
6702 .type = HDA_FIXUP_PINS,
6703 .v.pins = (const struct hda_pintbl[]) {
6704 { 0x14, 0x99130110 }, /* speaker */
6705 { 0x19, 0x01a19c20 }, /* mic */
6706 { 0x1b, 0x99a7012f }, /* int-mic */
6707 { 0x21, 0x0121401f }, /* HP out */
6711 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6712 .type = HDA_FIXUP_FUNC,
6713 .v.func = alc271_hp_gate_mic_jack,
6715 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6717 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6718 .type = HDA_FIXUP_FUNC,
6719 .v.func = alc269_fixup_limit_int_mic_boost,
6721 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6723 [ALC269_FIXUP_ACER_AC700] = {
6724 .type = HDA_FIXUP_PINS,
6725 .v.pins = (const struct hda_pintbl[]) {
6726 { 0x12, 0x99a3092f }, /* int-mic */
6727 { 0x14, 0x99130110 }, /* speaker */
6728 { 0x18, 0x03a11c20 }, /* mic */
6729 { 0x1e, 0x0346101e }, /* SPDIF1 */
6730 { 0x21, 0x0321101f }, /* HP out */
6734 .chain_id = ALC271_FIXUP_DMIC,
6736 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6737 .type = HDA_FIXUP_FUNC,
6738 .v.func = alc269_fixup_limit_int_mic_boost,
6740 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6742 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6743 .type = HDA_FIXUP_FUNC,
6744 .v.func = alc269_fixup_limit_int_mic_boost,
6746 .chain_id = ALC269VB_FIXUP_DMIC,
6748 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6749 .type = HDA_FIXUP_VERBS,
6750 .v.verbs = (const struct hda_verb[]) {
6751 /* class-D output amp +5dB */
6752 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6753 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6757 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6759 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6760 .type = HDA_FIXUP_FUNC,
6761 .v.func = alc269_fixup_limit_int_mic_boost,
6763 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6765 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6766 .type = HDA_FIXUP_PINS,
6767 .v.pins = (const struct hda_pintbl[]) {
6768 { 0x12, 0x99a3092f }, /* int-mic */
6769 { 0x18, 0x03a11d20 }, /* mic */
6770 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6774 [ALC283_FIXUP_CHROME_BOOK] = {
6775 .type = HDA_FIXUP_FUNC,
6776 .v.func = alc283_fixup_chromebook,
6778 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6779 .type = HDA_FIXUP_FUNC,
6780 .v.func = alc283_fixup_sense_combo_jack,
6782 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6784 [ALC282_FIXUP_ASUS_TX300] = {
6785 .type = HDA_FIXUP_FUNC,
6786 .v.func = alc282_fixup_asus_tx300,
6788 [ALC283_FIXUP_INT_MIC] = {
6789 .type = HDA_FIXUP_VERBS,
6790 .v.verbs = (const struct hda_verb[]) {
6791 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6792 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6796 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6798 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6799 .type = HDA_FIXUP_PINS,
6800 .v.pins = (const struct hda_pintbl[]) {
6801 { 0x17, 0x90170112 }, /* subwoofer */
6805 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6807 [ALC290_FIXUP_SUBWOOFER] = {
6808 .type = HDA_FIXUP_PINS,
6809 .v.pins = (const struct hda_pintbl[]) {
6810 { 0x17, 0x90170112 }, /* subwoofer */
6814 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6816 [ALC290_FIXUP_MONO_SPEAKERS] = {
6817 .type = HDA_FIXUP_FUNC,
6818 .v.func = alc290_fixup_mono_speakers,
6820 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6821 .type = HDA_FIXUP_FUNC,
6822 .v.func = alc290_fixup_mono_speakers,
6824 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6826 [ALC269_FIXUP_THINKPAD_ACPI] = {
6827 .type = HDA_FIXUP_FUNC,
6828 .v.func = alc_fixup_thinkpad_acpi,
6830 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6832 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6833 .type = HDA_FIXUP_FUNC,
6834 .v.func = alc_fixup_inv_dmic,
6836 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6838 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6839 .type = HDA_FIXUP_PINS,
6840 .v.pins = (const struct hda_pintbl[]) {
6841 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6845 .chain_id = ALC255_FIXUP_HEADSET_MODE
6847 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6848 .type = HDA_FIXUP_PINS,
6849 .v.pins = (const struct hda_pintbl[]) {
6850 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6854 .chain_id = ALC255_FIXUP_HEADSET_MODE
6856 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6857 .type = HDA_FIXUP_PINS,
6858 .v.pins = (const struct hda_pintbl[]) {
6859 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6860 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6864 .chain_id = ALC255_FIXUP_HEADSET_MODE
6866 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6867 .type = HDA_FIXUP_PINS,
6868 .v.pins = (const struct hda_pintbl[]) {
6869 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6873 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6875 [ALC255_FIXUP_HEADSET_MODE] = {
6876 .type = HDA_FIXUP_FUNC,
6877 .v.func = alc_fixup_headset_mode_alc255,
6879 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6881 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6882 .type = HDA_FIXUP_FUNC,
6883 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6885 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6886 .type = HDA_FIXUP_PINS,
6887 .v.pins = (const struct hda_pintbl[]) {
6888 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6889 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6893 .chain_id = ALC269_FIXUP_HEADSET_MODE
6895 [ALC292_FIXUP_TPT440_DOCK] = {
6896 .type = HDA_FIXUP_FUNC,
6897 .v.func = alc_fixup_tpt440_dock,
6899 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6901 [ALC292_FIXUP_TPT440] = {
6902 .type = HDA_FIXUP_FUNC,
6903 .v.func = alc_fixup_disable_aamix,
6905 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6907 [ALC283_FIXUP_HEADSET_MIC] = {
6908 .type = HDA_FIXUP_PINS,
6909 .v.pins = (const struct hda_pintbl[]) {
6910 { 0x19, 0x04a110f0 },
6914 [ALC255_FIXUP_MIC_MUTE_LED] = {
6915 .type = HDA_FIXUP_FUNC,
6916 .v.func = alc_fixup_micmute_led,
6918 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6919 .type = HDA_FIXUP_PINS,
6920 .v.pins = (const struct hda_pintbl[]) {
6921 { 0x12, 0x90a60130 },
6922 { 0x14, 0x90170110 },
6923 { 0x17, 0x40000008 },
6924 { 0x18, 0x411111f0 },
6925 { 0x19, 0x01a1913c },
6926 { 0x1a, 0x411111f0 },
6927 { 0x1b, 0x411111f0 },
6928 { 0x1d, 0x40f89b2d },
6929 { 0x1e, 0x411111f0 },
6930 { 0x21, 0x0321101f },
6934 [ALC280_FIXUP_HP_GPIO4] = {
6935 .type = HDA_FIXUP_FUNC,
6936 .v.func = alc280_fixup_hp_gpio4,
6938 [ALC286_FIXUP_HP_GPIO_LED] = {
6939 .type = HDA_FIXUP_FUNC,
6940 .v.func = alc286_fixup_hp_gpio_led,
6942 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6943 .type = HDA_FIXUP_FUNC,
6944 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6946 [ALC280_FIXUP_HP_DOCK_PINS] = {
6947 .type = HDA_FIXUP_PINS,
6948 .v.pins = (const struct hda_pintbl[]) {
6949 { 0x1b, 0x21011020 }, /* line-out */
6950 { 0x1a, 0x01a1903c }, /* headset mic */
6951 { 0x18, 0x2181103f }, /* line-in */
6955 .chain_id = ALC280_FIXUP_HP_GPIO4
6957 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6958 .type = HDA_FIXUP_PINS,
6959 .v.pins = (const struct hda_pintbl[]) {
6960 { 0x1b, 0x21011020 }, /* line-out */
6961 { 0x18, 0x2181103f }, /* line-in */
6965 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6967 [ALC280_FIXUP_HP_9480M] = {
6968 .type = HDA_FIXUP_FUNC,
6969 .v.func = alc280_fixup_hp_9480m,
6971 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6972 .type = HDA_FIXUP_FUNC,
6973 .v.func = alc_fixup_headset_mode_dell_alc288,
6975 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6977 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6978 .type = HDA_FIXUP_PINS,
6979 .v.pins = (const struct hda_pintbl[]) {
6980 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6981 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6985 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6987 [ALC288_FIXUP_DISABLE_AAMIX] = {
6988 .type = HDA_FIXUP_FUNC,
6989 .v.func = alc_fixup_disable_aamix,
6991 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6993 [ALC288_FIXUP_DELL_XPS_13] = {
6994 .type = HDA_FIXUP_FUNC,
6995 .v.func = alc_fixup_dell_xps13,
6997 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6999 [ALC292_FIXUP_DISABLE_AAMIX] = {
7000 .type = HDA_FIXUP_FUNC,
7001 .v.func = alc_fixup_disable_aamix,
7003 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7005 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7006 .type = HDA_FIXUP_FUNC,
7007 .v.func = alc_fixup_disable_aamix,
7009 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7011 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7012 .type = HDA_FIXUP_FUNC,
7013 .v.func = alc_fixup_dell_xps13,
7015 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7017 [ALC292_FIXUP_DELL_E7X] = {
7018 .type = HDA_FIXUP_FUNC,
7019 .v.func = alc_fixup_micmute_led,
7020 /* micmute fixup must be applied at last */
7021 .chained_before = true,
7022 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7024 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7025 .type = HDA_FIXUP_PINS,
7026 .v.pins = (const struct hda_pintbl[]) {
7027 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7030 .chained_before = true,
7031 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7033 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7034 .type = HDA_FIXUP_PINS,
7035 .v.pins = (const struct hda_pintbl[]) {
7036 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7037 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7041 .chain_id = ALC269_FIXUP_HEADSET_MODE
7043 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7044 .type = HDA_FIXUP_PINS,
7045 .v.pins = (const struct hda_pintbl[]) {
7046 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7050 .chain_id = ALC269_FIXUP_HEADSET_MODE
7052 [ALC275_FIXUP_DELL_XPS] = {
7053 .type = HDA_FIXUP_VERBS,
7054 .v.verbs = (const struct hda_verb[]) {
7055 /* Enables internal speaker */
7056 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7057 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7058 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7059 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7063 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7064 .type = HDA_FIXUP_FUNC,
7065 .v.func = alc_fixup_disable_aamix,
7067 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7069 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7070 .type = HDA_FIXUP_FUNC,
7071 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7073 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7074 .type = HDA_FIXUP_FUNC,
7075 .v.func = alc_fixup_disable_aamix,
7077 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7079 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7080 .type = HDA_FIXUP_FUNC,
7081 .v.func = alc_fixup_disable_mic_vref,
7083 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7085 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7086 .type = HDA_FIXUP_VERBS,
7087 .v.verbs = (const struct hda_verb[]) {
7088 /* Disable pass-through path for FRONT 14h */
7089 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7090 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7094 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7096 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7097 .type = HDA_FIXUP_FUNC,
7098 .v.func = alc_fixup_disable_aamix,
7100 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7102 [ALC221_FIXUP_HP_FRONT_MIC] = {
7103 .type = HDA_FIXUP_PINS,
7104 .v.pins = (const struct hda_pintbl[]) {
7105 { 0x19, 0x02a19020 }, /* Front Mic */
7109 [ALC292_FIXUP_TPT460] = {
7110 .type = HDA_FIXUP_FUNC,
7111 .v.func = alc_fixup_tpt440_dock,
7113 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7115 [ALC298_FIXUP_SPK_VOLUME] = {
7116 .type = HDA_FIXUP_FUNC,
7117 .v.func = alc298_fixup_speaker_volume,
7119 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7121 [ALC295_FIXUP_DISABLE_DAC3] = {
7122 .type = HDA_FIXUP_FUNC,
7123 .v.func = alc295_fixup_disable_dac3,
7125 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7126 .type = HDA_FIXUP_FUNC,
7127 .v.func = alc285_fixup_speaker2_to_dac1,
7129 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7131 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7132 .type = HDA_FIXUP_PINS,
7133 .v.pins = (const struct hda_pintbl[]) {
7134 { 0x1b, 0x90170151 },
7138 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7140 [ALC269_FIXUP_ATIV_BOOK_8] = {
7141 .type = HDA_FIXUP_FUNC,
7142 .v.func = alc_fixup_auto_mute_via_amp,
7144 .chain_id = ALC269_FIXUP_NO_SHUTUP
7146 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7147 .type = HDA_FIXUP_PINS,
7148 .v.pins = (const struct hda_pintbl[]) {
7149 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7150 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7154 .chain_id = ALC269_FIXUP_HEADSET_MODE
7156 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7157 .type = HDA_FIXUP_FUNC,
7158 .v.func = alc_fixup_headset_mode,
7160 [ALC256_FIXUP_ASUS_MIC] = {
7161 .type = HDA_FIXUP_PINS,
7162 .v.pins = (const struct hda_pintbl[]) {
7163 { 0x13, 0x90a60160 }, /* use as internal mic */
7164 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7168 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7170 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7171 .type = HDA_FIXUP_FUNC,
7172 /* Set up GPIO2 for the speaker amp */
7173 .v.func = alc_fixup_gpio4,
7175 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7176 .type = HDA_FIXUP_PINS,
7177 .v.pins = (const struct hda_pintbl[]) {
7178 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7182 .chain_id = ALC269_FIXUP_HEADSET_MIC
7184 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7185 .type = HDA_FIXUP_VERBS,
7186 .v.verbs = (const struct hda_verb[]) {
7187 /* Enables internal speaker */
7188 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7189 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7193 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7195 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7196 .type = HDA_FIXUP_FUNC,
7197 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7199 .chain_id = ALC269_FIXUP_GPIO2
7201 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7202 .type = HDA_FIXUP_VERBS,
7203 .v.verbs = (const struct hda_verb[]) {
7204 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7205 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7209 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7211 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7212 .type = HDA_FIXUP_PINS,
7213 .v.pins = (const struct hda_pintbl[]) {
7214 /* Change the mic location from front to right, otherwise there are
7215 two front mics with the same name, pulseaudio can't handle them.
7216 This is just a temporary workaround, after applying this fixup,
7217 there will be one "Front Mic" and one "Mic" in this machine.
7219 { 0x1a, 0x04a19040 },
7223 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7224 .type = HDA_FIXUP_PINS,
7225 .v.pins = (const struct hda_pintbl[]) {
7226 { 0x16, 0x0101102f }, /* Rear Headset HP */
7227 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7228 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7229 { 0x1b, 0x02011020 },
7233 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7235 [ALC225_FIXUP_S3_POP_NOISE] = {
7236 .type = HDA_FIXUP_FUNC,
7237 .v.func = alc225_fixup_s3_pop_noise,
7239 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7241 [ALC700_FIXUP_INTEL_REFERENCE] = {
7242 .type = HDA_FIXUP_VERBS,
7243 .v.verbs = (const struct hda_verb[]) {
7244 /* Enables internal speaker */
7245 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7246 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7247 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7248 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7249 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7250 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7251 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7252 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7256 [ALC274_FIXUP_DELL_BIND_DACS] = {
7257 .type = HDA_FIXUP_FUNC,
7258 .v.func = alc274_fixup_bind_dacs,
7260 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7262 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7263 .type = HDA_FIXUP_PINS,
7264 .v.pins = (const struct hda_pintbl[]) {
7265 { 0x1b, 0x0401102f },
7269 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7271 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7272 .type = HDA_FIXUP_FUNC,
7273 .v.func = alc_fixup_tpt470_dock,
7275 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7277 [ALC298_FIXUP_TPT470_DOCK] = {
7278 .type = HDA_FIXUP_FUNC,
7279 .v.func = alc_fixup_tpt470_dacs,
7281 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7283 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7284 .type = HDA_FIXUP_PINS,
7285 .v.pins = (const struct hda_pintbl[]) {
7286 { 0x14, 0x0201101f },
7290 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7292 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7293 .type = HDA_FIXUP_PINS,
7294 .v.pins = (const struct hda_pintbl[]) {
7295 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7299 .chain_id = ALC269_FIXUP_HEADSET_MIC
7301 [ALC295_FIXUP_HP_X360] = {
7302 .type = HDA_FIXUP_FUNC,
7303 .v.func = alc295_fixup_hp_top_speakers,
7305 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7307 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7308 .type = HDA_FIXUP_PINS,
7309 .v.pins = (const struct hda_pintbl[]) {
7310 { 0x19, 0x0181313f},
7314 .chain_id = ALC269_FIXUP_HEADSET_MIC
7316 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7317 .type = HDA_FIXUP_FUNC,
7318 .v.func = alc285_fixup_invalidate_dacs,
7320 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7322 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7323 .type = HDA_FIXUP_FUNC,
7324 .v.func = alc_fixup_auto_mute_via_amp,
7326 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7327 .type = HDA_FIXUP_PINS,
7328 .v.pins = (const struct hda_pintbl[]) {
7329 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7333 .chain_id = ALC269_FIXUP_HEADSET_MIC
7335 [ALC294_FIXUP_ASUS_MIC] = {
7336 .type = HDA_FIXUP_PINS,
7337 .v.pins = (const struct hda_pintbl[]) {
7338 { 0x13, 0x90a60160 }, /* use as internal mic */
7339 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7343 .chain_id = ALC269_FIXUP_HEADSET_MIC
7345 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7346 .type = HDA_FIXUP_PINS,
7347 .v.pins = (const struct hda_pintbl[]) {
7348 { 0x19, 0x01a1103c }, /* use as headset mic */
7352 .chain_id = ALC269_FIXUP_HEADSET_MIC
7354 [ALC294_FIXUP_ASUS_SPK] = {
7355 .type = HDA_FIXUP_VERBS,
7356 .v.verbs = (const struct hda_verb[]) {
7358 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7359 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7360 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7361 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7365 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7367 [ALC295_FIXUP_CHROME_BOOK] = {
7368 .type = HDA_FIXUP_FUNC,
7369 .v.func = alc295_fixup_chromebook,
7371 .chain_id = ALC225_FIXUP_HEADSET_JACK
7373 [ALC225_FIXUP_HEADSET_JACK] = {
7374 .type = HDA_FIXUP_FUNC,
7375 .v.func = alc_fixup_headset_jack,
7377 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7378 .type = HDA_FIXUP_PINS,
7379 .v.pins = (const struct hda_pintbl[]) {
7380 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7384 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7386 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7387 .type = HDA_FIXUP_VERBS,
7388 .v.verbs = (const struct hda_verb[]) {
7389 /* Disable PCBEEP-IN passthrough */
7390 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7391 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7395 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7397 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7398 .type = HDA_FIXUP_PINS,
7399 .v.pins = (const struct hda_pintbl[]) {
7400 { 0x19, 0x03a11130 },
7401 { 0x1a, 0x90a60140 }, /* use as internal mic */
7405 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7407 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7408 .type = HDA_FIXUP_PINS,
7409 .v.pins = (const struct hda_pintbl[]) {
7410 { 0x16, 0x01011020 }, /* Rear Line out */
7411 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7415 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7417 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7418 .type = HDA_FIXUP_FUNC,
7419 .v.func = alc_fixup_auto_mute_via_amp,
7421 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7423 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7424 .type = HDA_FIXUP_FUNC,
7425 .v.func = alc_fixup_disable_mic_vref,
7427 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7429 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7430 .type = HDA_FIXUP_VERBS,
7431 .v.verbs = (const struct hda_verb[]) {
7432 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7433 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7437 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7439 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7440 .type = HDA_FIXUP_PINS,
7441 .v.pins = (const struct hda_pintbl[]) {
7442 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7446 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7448 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7449 .type = HDA_FIXUP_PINS,
7450 .v.pins = (const struct hda_pintbl[]) {
7451 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7455 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7457 [ALC299_FIXUP_PREDATOR_SPK] = {
7458 .type = HDA_FIXUP_PINS,
7459 .v.pins = (const struct hda_pintbl[]) {
7460 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7464 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7465 .type = HDA_FIXUP_PINS,
7466 .v.pins = (const struct hda_pintbl[]) {
7467 { 0x19, 0x04a11040 },
7468 { 0x21, 0x04211020 },
7472 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7474 [ALC289_FIXUP_DELL_SPK2] = {
7475 .type = HDA_FIXUP_PINS,
7476 .v.pins = (const struct hda_pintbl[]) {
7477 { 0x17, 0x90170130 }, /* bass spk */
7481 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7483 [ALC289_FIXUP_DUAL_SPK] = {
7484 .type = HDA_FIXUP_FUNC,
7485 .v.func = alc285_fixup_speaker2_to_dac1,
7487 .chain_id = ALC289_FIXUP_DELL_SPK2
7489 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7490 .type = HDA_FIXUP_FUNC,
7491 .v.func = alc285_fixup_speaker2_to_dac1,
7493 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7495 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7496 .type = HDA_FIXUP_FUNC,
7497 /* The GPIO must be pulled to initialize the AMP */
7498 .v.func = alc_fixup_gpio4,
7500 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7502 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
7503 .type = HDA_FIXUP_FUNC,
7504 .v.func = alc285_fixup_thinkpad_x1_gen7,
7506 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7508 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7509 .type = HDA_FIXUP_FUNC,
7510 .v.func = alc_fixup_headset_jack,
7512 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
7514 [ALC294_FIXUP_ASUS_HPE] = {
7515 .type = HDA_FIXUP_VERBS,
7516 .v.verbs = (const struct hda_verb[]) {
7518 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7519 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7523 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7525 [ALC294_FIXUP_ASUS_GX502_PINS] = {
7526 .type = HDA_FIXUP_PINS,
7527 .v.pins = (const struct hda_pintbl[]) {
7528 { 0x19, 0x03a11050 }, /* front HP mic */
7529 { 0x1a, 0x01a11830 }, /* rear external mic */
7530 { 0x21, 0x03211020 }, /* front HP out */
7534 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
7536 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
7537 .type = HDA_FIXUP_VERBS,
7538 .v.verbs = (const struct hda_verb[]) {
7539 /* set 0x15 to HP-OUT ctrl */
7540 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7541 /* unmute the 0x15 amp */
7542 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7546 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
7548 [ALC294_FIXUP_ASUS_GX502_HP] = {
7549 .type = HDA_FIXUP_FUNC,
7550 .v.func = alc294_fixup_gx502_hp,
7552 [ALC294_FIXUP_ASUS_COEF_1B] = {
7553 .type = HDA_FIXUP_VERBS,
7554 .v.verbs = (const struct hda_verb[]) {
7555 /* Set bit 10 to correct noisy output after reboot from
7556 * Windows 10 (due to pop noise reduction?)
7558 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
7559 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
7563 [ALC285_FIXUP_HP_GPIO_LED] = {
7564 .type = HDA_FIXUP_FUNC,
7565 .v.func = alc285_fixup_hp_gpio_led,
7567 [ALC285_FIXUP_HP_MUTE_LED] = {
7568 .type = HDA_FIXUP_FUNC,
7569 .v.func = alc285_fixup_hp_mute_led,
7571 [ALC236_FIXUP_HP_MUTE_LED] = {
7572 .type = HDA_FIXUP_FUNC,
7573 .v.func = alc236_fixup_hp_mute_led,
7575 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
7576 .type = HDA_FIXUP_VERBS,
7577 .v.verbs = (const struct hda_verb[]) {
7578 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
7582 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7583 .type = HDA_FIXUP_PINS,
7584 .v.pins = (const struct hda_pintbl[]) {
7585 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7589 .chain_id = ALC269_FIXUP_HEADSET_MODE
7591 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
7592 .type = HDA_FIXUP_PINS,
7593 .v.pins = (const struct hda_pintbl[]) {
7594 { 0x14, 0x90100120 }, /* use as internal speaker */
7595 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7596 { 0x1a, 0x01011020 }, /* use as line out */
7600 .chain_id = ALC269_FIXUP_HEADSET_MIC
7602 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
7603 .type = HDA_FIXUP_PINS,
7604 .v.pins = (const struct hda_pintbl[]) {
7605 { 0x18, 0x02a11030 }, /* use as headset mic */
7609 .chain_id = ALC269_FIXUP_HEADSET_MIC
7611 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
7612 .type = HDA_FIXUP_PINS,
7613 .v.pins = (const struct hda_pintbl[]) {
7614 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7618 .chain_id = ALC269_FIXUP_HEADSET_MIC
7620 [ALC289_FIXUP_ASUS_GA401] = {
7621 .type = HDA_FIXUP_FUNC,
7622 .v.func = alc289_fixup_asus_ga401,
7624 .chain_id = ALC289_FIXUP_ASUS_GA502,
7626 [ALC289_FIXUP_ASUS_GA502] = {
7627 .type = HDA_FIXUP_PINS,
7628 .v.pins = (const struct hda_pintbl[]) {
7629 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7633 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
7634 .type = HDA_FIXUP_PINS,
7635 .v.pins = (const struct hda_pintbl[]) {
7636 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
7640 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7642 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
7643 .type = HDA_FIXUP_FUNC,
7644 .v.func = alc285_fixup_hp_gpio_amp_init,
7646 .chain_id = ALC285_FIXUP_HP_GPIO_LED
7648 [ALC269_FIXUP_CZC_B20] = {
7649 .type = HDA_FIXUP_PINS,
7650 .v.pins = (const struct hda_pintbl[]) {
7651 { 0x12, 0x411111f0 },
7652 { 0x14, 0x90170110 }, /* speaker */
7653 { 0x15, 0x032f1020 }, /* HP out */
7654 { 0x17, 0x411111f0 },
7655 { 0x18, 0x03ab1040 }, /* mic */
7656 { 0x19, 0xb7a7013f },
7657 { 0x1a, 0x0181305f },
7658 { 0x1b, 0x411111f0 },
7659 { 0x1d, 0x411111f0 },
7660 { 0x1e, 0x411111f0 },
7663 .chain_id = ALC269_FIXUP_DMIC,
7665 [ALC269_FIXUP_CZC_TMI] = {
7666 .type = HDA_FIXUP_PINS,
7667 .v.pins = (const struct hda_pintbl[]) {
7668 { 0x12, 0x4000c000 },
7669 { 0x14, 0x90170110 }, /* speaker */
7670 { 0x15, 0x0421401f }, /* HP out */
7671 { 0x17, 0x411111f0 },
7672 { 0x18, 0x04a19020 }, /* mic */
7673 { 0x19, 0x411111f0 },
7674 { 0x1a, 0x411111f0 },
7675 { 0x1b, 0x411111f0 },
7676 { 0x1d, 0x40448505 },
7677 { 0x1e, 0x411111f0 },
7678 { 0x20, 0x8000ffff },
7681 .chain_id = ALC269_FIXUP_DMIC,
7683 [ALC269_FIXUP_CZC_L101] = {
7684 .type = HDA_FIXUP_PINS,
7685 .v.pins = (const struct hda_pintbl[]) {
7686 { 0x12, 0x40000000 },
7687 { 0x14, 0x01014010 }, /* speaker */
7688 { 0x15, 0x411111f0 }, /* HP out */
7689 { 0x16, 0x411111f0 },
7690 { 0x18, 0x01a19020 }, /* mic */
7691 { 0x19, 0x02a19021 },
7692 { 0x1a, 0x0181302f },
7693 { 0x1b, 0x0221401f },
7694 { 0x1c, 0x411111f0 },
7695 { 0x1d, 0x4044c601 },
7696 { 0x1e, 0x411111f0 },
7699 .chain_id = ALC269_FIXUP_DMIC,
7701 [ALC269_FIXUP_LEMOTE_A1802] = {
7702 .type = HDA_FIXUP_PINS,
7703 .v.pins = (const struct hda_pintbl[]) {
7704 { 0x12, 0x40000000 },
7705 { 0x14, 0x90170110 }, /* speaker */
7706 { 0x17, 0x411111f0 },
7707 { 0x18, 0x03a19040 }, /* mic1 */
7708 { 0x19, 0x90a70130 }, /* mic2 */
7709 { 0x1a, 0x411111f0 },
7710 { 0x1b, 0x411111f0 },
7711 { 0x1d, 0x40489d2d },
7712 { 0x1e, 0x411111f0 },
7713 { 0x20, 0x0003ffff },
7714 { 0x21, 0x03214020 },
7717 .chain_id = ALC269_FIXUP_DMIC,
7719 [ALC269_FIXUP_LEMOTE_A190X] = {
7720 .type = HDA_FIXUP_PINS,
7721 .v.pins = (const struct hda_pintbl[]) {
7722 { 0x14, 0x99130110 }, /* speaker */
7723 { 0x15, 0x0121401f }, /* HP out */
7724 { 0x18, 0x01a19c20 }, /* rear mic */
7725 { 0x19, 0x99a3092f }, /* front mic */
7726 { 0x1b, 0x0201401f }, /* front lineout */
7729 .chain_id = ALC269_FIXUP_DMIC,
7731 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
7732 .type = HDA_FIXUP_PINS,
7733 .v.pins = (const struct hda_pintbl[]) {
7734 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7738 .chain_id = ALC269_FIXUP_HEADSET_MODE
7740 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
7741 .type = HDA_FIXUP_VERBS,
7742 .v.verbs = (const struct hda_verb[]) {
7743 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7744 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7748 .chain_id = ALC289_FIXUP_ASUS_GA502
7750 [ALC274_FIXUP_HP_MIC] = {
7751 .type = HDA_FIXUP_VERBS,
7752 .v.verbs = (const struct hda_verb[]) {
7753 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7754 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7758 [ALC274_FIXUP_HP_HEADSET_MIC] = {
7759 .type = HDA_FIXUP_FUNC,
7760 .v.func = alc274_fixup_hp_headset_mic,
7762 .chain_id = ALC274_FIXUP_HP_MIC
7764 [ALC256_FIXUP_ASUS_HPE] = {
7765 .type = HDA_FIXUP_VERBS,
7766 .v.verbs = (const struct hda_verb[]) {
7768 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7769 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
7773 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7775 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
7776 .type = HDA_FIXUP_FUNC,
7777 .v.func = alc_fixup_headset_jack,
7779 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7781 [ALC287_FIXUP_HP_GPIO_LED] = {
7782 .type = HDA_FIXUP_FUNC,
7783 .v.func = alc287_fixup_hp_gpio_led,
7785 [ALC256_FIXUP_HP_HEADSET_MIC] = {
7786 .type = HDA_FIXUP_FUNC,
7787 .v.func = alc274_fixup_hp_headset_mic,
7789 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
7790 .type = HDA_FIXUP_FUNC,
7791 .v.func = alc_fixup_no_int_mic,
7793 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7795 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
7796 .type = HDA_FIXUP_PINS,
7797 .v.pins = (const struct hda_pintbl[]) {
7798 { 0x1b, 0x411111f0 },
7799 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7803 .chain_id = ALC269_FIXUP_HEADSET_MODE
7807 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
7808 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
7809 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
7810 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
7811 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7812 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7813 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7814 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
7815 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
7816 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7817 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7818 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
7819 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
7820 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
7821 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
7822 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7823 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7824 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
7825 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
7826 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
7827 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7828 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7829 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7830 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7831 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
7832 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
7833 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
7834 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
7835 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
7836 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
7837 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
7838 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
7839 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
7840 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
7841 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7842 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7843 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7844 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7845 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7846 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
7847 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
7848 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
7849 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7850 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7851 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
7852 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7853 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
7854 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7855 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7856 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7857 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7858 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7859 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7860 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7861 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7862 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7863 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
7864 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
7865 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
7866 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
7867 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
7868 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7869 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
7870 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7871 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7872 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7873 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7874 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
7875 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
7876 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
7877 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7878 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7879 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7880 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7881 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7882 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
7883 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
7884 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell Precision 3650 Tower", ALC255_FIXUP_DELL_HEADSET_MIC),
7885 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7886 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7887 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
7888 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
7889 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7890 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
7892 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7893 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7894 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7895 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7896 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7897 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7898 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7899 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7900 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7901 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7902 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7903 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7904 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
7905 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7906 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7907 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7908 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7909 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7910 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7911 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7912 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
7913 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7914 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7916 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7917 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7918 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7919 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7920 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7921 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7922 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7923 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7924 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7925 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
7926 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7927 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7928 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7929 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7930 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7931 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7932 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7933 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7934 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7935 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7936 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7937 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7938 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7939 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7940 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7941 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7942 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7943 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7944 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7945 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
7946 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7947 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7948 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7949 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
7950 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
7951 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7952 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7953 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7954 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7955 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7956 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7957 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
7958 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
7959 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
7960 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
7961 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
7962 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
7963 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
7964 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
7965 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7966 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
7967 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7968 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
7969 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7970 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7971 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7972 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7973 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
7974 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7975 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7976 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
7977 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
7978 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
7979 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
7980 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
7981 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
7982 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
7983 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
7984 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
7985 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
7986 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7987 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
7988 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
7989 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
7990 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
7991 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
7992 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7993 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7994 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7995 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
7996 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
7997 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
7998 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
7999 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8000 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
8001 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8002 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8003 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8004 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8005 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
8006 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8007 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8008 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8009 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8010 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8011 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
8012 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
8013 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
8014 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8015 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8016 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
8017 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
8018 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
8019 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8020 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
8021 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
8022 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8023 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8024 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8025 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8026 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8027 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
8028 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8029 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8030 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8031 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
8032 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8033 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8034 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8035 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8036 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8037 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8038 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8039 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8040 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8041 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8042 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8043 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8044 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8045 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8046 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8047 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8048 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8049 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8050 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8051 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8052 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8053 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8054 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8055 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8056 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8057 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8058 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8059 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8060 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8061 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8062 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8063 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
8064 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
8065 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8066 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8067 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8068 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8069 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8070 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8071 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8072 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8073 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8074 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8075 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
8076 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8077 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8078 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8079 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8080 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8081 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
8082 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
8083 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
8084 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
8085 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
8086 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
8087 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
8088 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
8089 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
8090 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
8091 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
8092 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
8093 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
8094 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8095 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
8096 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
8097 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
8098 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8099 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8100 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
8101 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
8102 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
8103 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8104 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8105 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
8106 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8107 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8108 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8109 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8110 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8111 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8112 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8113 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8114 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8115 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8116 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8117 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8118 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8119 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8120 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8121 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8122 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8123 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8124 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8125 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
8126 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8127 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8128 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
8129 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
8130 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8131 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
8132 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
8133 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
8134 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
8135 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
8136 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
8137 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
8138 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
8139 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8140 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8141 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8142 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8143 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8144 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8145 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
8146 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
8147 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
8148 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
8149 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
8150 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
8151 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
8152 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8153 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
8154 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8155 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
8156 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
8157 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
8160 /* Below is a quirk table taken from the old code.
8161 * Basically the device should work as is without the fixup table.
8162 * If BIOS doesn't give a proper info, enable the corresponding
8165 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
8167 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
8168 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
8169 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
8170 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
8171 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
8172 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
8173 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
8174 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
8175 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
8176 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
8177 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
8178 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
8179 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
8180 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
8181 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
8182 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
8183 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
8184 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
8185 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
8186 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
8187 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
8188 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
8189 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
8190 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
8191 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
8192 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
8193 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
8194 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
8195 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
8196 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
8197 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
8198 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
8199 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
8200 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
8201 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
8202 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
8203 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
8204 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
8205 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
8210 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
8211 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
8212 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
8213 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
8214 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
8215 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
8219 static const struct hda_model_fixup alc269_fixup_models[] = {
8220 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
8221 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
8222 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
8223 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
8224 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
8225 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
8226 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
8227 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
8228 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
8229 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
8230 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8231 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
8232 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
8233 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
8234 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
8235 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
8236 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
8237 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
8238 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
8239 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
8240 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
8241 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
8242 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
8243 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
8244 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
8245 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
8246 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
8247 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
8248 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
8249 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
8250 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
8251 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
8252 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
8253 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
8254 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
8255 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
8256 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
8257 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
8258 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
8259 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
8260 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
8261 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
8262 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
8263 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
8264 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
8265 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
8266 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
8267 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
8268 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
8269 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
8270 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
8271 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
8272 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
8273 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
8274 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
8275 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
8276 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
8277 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
8278 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
8279 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
8280 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
8281 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
8282 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
8283 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
8284 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
8285 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
8286 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
8287 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
8288 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8289 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
8290 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
8291 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
8292 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
8293 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
8294 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
8295 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
8296 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
8297 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
8298 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
8299 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
8300 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
8301 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
8302 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
8303 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
8304 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
8305 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
8306 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
8307 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
8308 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
8309 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
8310 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
8311 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
8312 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
8313 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
8314 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
8315 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
8316 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
8317 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
8318 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
8319 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
8320 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
8321 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
8322 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
8323 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8324 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
8325 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
8326 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
8327 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
8328 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
8329 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
8330 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
8331 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
8334 #define ALC225_STANDARD_PINS \
8337 #define ALC256_STANDARD_PINS \
8338 {0x12, 0x90a60140}, \
8339 {0x14, 0x90170110}, \
8342 #define ALC282_STANDARD_PINS \
8345 #define ALC290_STANDARD_PINS \
8348 #define ALC292_STANDARD_PINS \
8349 {0x14, 0x90170110}, \
8352 #define ALC295_STANDARD_PINS \
8353 {0x12, 0xb7a60130}, \
8354 {0x14, 0x90170110}, \
8357 #define ALC298_STANDARD_PINS \
8358 {0x12, 0x90a60130}, \
8361 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8362 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
8367 {0x21, 0x0221102f}),
8368 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8371 {0x21, 0x02211030}),
8372 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8375 {0x21, 0x03211020}),
8376 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8379 {0x21, 0x03211020}),
8380 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8381 ALC225_STANDARD_PINS,
8383 {0x14, 0x901701a0}),
8384 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8385 ALC225_STANDARD_PINS,
8387 {0x14, 0x901701b0}),
8388 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8389 ALC225_STANDARD_PINS,
8391 {0x14, 0x901701a0}),
8392 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8393 ALC225_STANDARD_PINS,
8395 {0x14, 0x901701b0}),
8396 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8397 ALC225_STANDARD_PINS,
8399 {0x1b, 0x90170110}),
8400 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8403 {0x21, 0x02211020}),
8404 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
8408 {0x21, 0x02211020}),
8409 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8414 {0x21, 0x0221101f}),
8415 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8420 {0x21, 0x0221101f}),
8421 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8425 {0x21, 0x0221101f}),
8426 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
8427 {0x21, 0x02211010}),
8428 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
8431 {0x21, 0x02211030}),
8432 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
8434 {0x21, 0x02211020}),
8435 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8437 {0x21, 0x02211040}),
8438 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8441 {0x21, 0x02211020}),
8442 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8445 {0x21, 0x02211030}),
8446 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8449 {0x21, 0x0221101f}),
8450 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8453 {0x21, 0x0221101f}),
8454 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8457 {0x21, 0x0221103f}),
8458 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8461 {0x21, 0x0221103f}),
8462 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8465 {0x21, 0x0221103f}),
8466 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8469 {0x21, 0x0221105f}),
8470 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8473 {0x21, 0x0221101f}),
8474 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8478 {0x21, 0x0321102f}),
8479 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8482 {0x21, 0x02211040}),
8483 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8486 {0x21, 0x02211050}),
8487 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8490 {0x21, 0x02211030}),
8491 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8494 {0x21, 0x02211040}),
8495 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8498 {0x21, 0x02211040}),
8499 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8502 {0x21, 0x02211050}),
8503 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8506 {0x21, 0x02211040}),
8507 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8510 {0x21, 0x02211030}),
8511 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8513 {0x21, 0x02211010}),
8514 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8517 {0x21, 0x04211020}),
8518 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8521 {0x21, 0x03211020}),
8522 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8525 {0x21, 0x03211020}),
8526 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8529 {0x21, 0x04211020}),
8530 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8533 {0x21, 0x03211020}),
8534 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
8537 {0x21, 0x0221101f}),
8538 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
8541 {0x21, 0x03211020}),
8542 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
8546 {0x1a, 0x04a11020}),
8547 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
8553 {0x1b, 0x02011020}),
8554 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8555 ALC282_STANDARD_PINS,
8558 {0x21, 0x0321101f}),
8559 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8560 ALC282_STANDARD_PINS,
8563 {0x21, 0x03211040}),
8564 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8565 ALC282_STANDARD_PINS,
8568 {0x21, 0x03211020}),
8569 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8570 ALC282_STANDARD_PINS,
8573 {0x21, 0x0421101f}),
8574 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
8575 ALC282_STANDARD_PINS,
8578 {0x21, 0x04211020}),
8579 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
8580 ALC282_STANDARD_PINS,
8586 {0x21, 0x0321101f}),
8587 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
8588 ALC282_STANDARD_PINS,
8594 {0x21, 0x0321101f}),
8595 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8596 ALC282_STANDARD_PINS,
8598 {0x21, 0x0321101f}),
8599 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8602 {0x21, 0x02211030}),
8603 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8604 ALC282_STANDARD_PINS,
8607 {0x21, 0x0321101f}),
8608 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
8611 {0x21, 0x04211020}),
8612 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
8616 {0x21, 0x04211020}),
8617 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8621 {0x21, 0x03211020}),
8622 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
8625 {0x21, 0x02211020}),
8626 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
8629 {0x21, 0x0321101f}),
8630 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8631 ALC290_STANDARD_PINS,
8634 {0x1a, 0x04a11020}),
8635 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8636 ALC290_STANDARD_PINS,
8639 {0x1a, 0x04a11020}),
8640 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8641 ALC290_STANDARD_PINS,
8643 {0x1a, 0x04a11020}),
8644 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8645 ALC290_STANDARD_PINS,
8647 {0x1a, 0x04a11040}),
8648 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8649 ALC290_STANDARD_PINS,
8652 {0x1a, 0x04a11040}),
8653 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8654 ALC290_STANDARD_PINS,
8657 {0x1a, 0x04a11020}),
8658 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8659 ALC290_STANDARD_PINS,
8662 {0x1a, 0x04a11020}),
8663 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
8664 ALC292_STANDARD_PINS,
8667 {0x19, 0x01a19030}),
8668 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
8669 ALC292_STANDARD_PINS,
8673 {0x19, 0x01a1903e}),
8674 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8675 ALC292_STANDARD_PINS,
8676 {0x12, 0x90a60140}),
8677 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
8678 ALC292_STANDARD_PINS,
8681 {0x19, 0x21a19030}),
8682 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
8683 ALC292_STANDARD_PINS,
8684 {0x13, 0x90a60140}),
8685 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
8687 {0x21, 0x04211020}),
8688 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
8691 {0x21, 0x04211020}),
8692 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
8695 {0x21, 0x03211020}),
8696 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
8699 {0x21, 0x04211020}),
8700 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
8703 {0x21, 0x03211020}),
8704 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8707 {0x21, 0x04211030}),
8708 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8711 {0x21, 0x03211020}),
8712 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8715 {0x21, 0x03211020}),
8716 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8718 {0x21, 0x04211020}),
8719 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8721 {0x21, 0x04211030}),
8722 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8723 ALC295_STANDARD_PINS,
8725 {0x18, 0x21a19030}),
8726 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8727 ALC295_STANDARD_PINS,
8729 {0x18, 0x21a19050}),
8730 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8731 ALC295_STANDARD_PINS),
8732 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8733 ALC298_STANDARD_PINS,
8734 {0x17, 0x90170110}),
8735 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8736 ALC298_STANDARD_PINS,
8737 {0x17, 0x90170140}),
8738 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8739 ALC298_STANDARD_PINS,
8740 {0x17, 0x90170150}),
8741 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
8746 {0x21, 0x03211030}),
8747 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
8751 {0x21, 0x03211020}),
8752 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8753 ALC225_STANDARD_PINS,
8755 {0x17, 0x90170110}),
8756 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
8761 {0x21, 0x0221101f}),
8765 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
8766 * more machines, don't need to match all valid pins, just need to match
8767 * all the pins defined in the tbl. Just because of this reason, it is possible
8768 * that a single machine matches multiple tbls, so there is one limitation:
8769 * at most one tbl is allowed to define for the same vendor and same codec
8771 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
8772 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8774 {0x1b, 0x40000000}),
8775 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8777 {0x1a, 0x40000000}),
8778 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8780 {0x1a, 0x40000000}),
8781 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
8783 {0x1a, 0x40000000}),
8787 static void alc269_fill_coef(struct hda_codec *codec)
8789 struct alc_spec *spec = codec->spec;
8792 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
8795 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
8796 alc_write_coef_idx(codec, 0xf, 0x960b);
8797 alc_write_coef_idx(codec, 0xe, 0x8817);
8800 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
8801 alc_write_coef_idx(codec, 0xf, 0x960b);
8802 alc_write_coef_idx(codec, 0xe, 0x8814);
8805 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
8806 /* Power up output pin */
8807 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
8810 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
8811 val = alc_read_coef_idx(codec, 0xd);
8812 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
8813 /* Capless ramp up clock control */
8814 alc_write_coef_idx(codec, 0xd, val | (1<<10));
8816 val = alc_read_coef_idx(codec, 0x17);
8817 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
8818 /* Class D power on reset */
8819 alc_write_coef_idx(codec, 0x17, val | (1<<7));
8824 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
8829 static int patch_alc269(struct hda_codec *codec)
8831 struct alc_spec *spec;
8834 err = alc_alloc_spec(codec, 0x0b);
8839 spec->gen.shared_mic_vref_pin = 0x18;
8840 codec->power_save_node = 0;
8843 codec->patch_ops.suspend = alc269_suspend;
8844 codec->patch_ops.resume = alc269_resume;
8846 spec->shutup = alc_default_shutup;
8847 spec->init_hook = alc_default_init;
8849 switch (codec->core.vendor_id) {
8851 spec->codec_variant = ALC269_TYPE_ALC269VA;
8852 switch (alc_get_coef0(codec) & 0x00f0) {
8854 if (codec->bus->pci &&
8855 codec->bus->pci->subsystem_vendor == 0x1025 &&
8856 spec->cdefine.platform_type == 1)
8857 err = alc_codec_rename(codec, "ALC271X");
8858 spec->codec_variant = ALC269_TYPE_ALC269VB;
8861 if (codec->bus->pci &&
8862 codec->bus->pci->subsystem_vendor == 0x17aa &&
8863 codec->bus->pci->subsystem_device == 0x21f3)
8864 err = alc_codec_rename(codec, "ALC3202");
8865 spec->codec_variant = ALC269_TYPE_ALC269VC;
8868 spec->codec_variant = ALC269_TYPE_ALC269VD;
8871 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8875 spec->shutup = alc269_shutup;
8876 spec->init_hook = alc269_fill_coef;
8877 alc269_fill_coef(codec);
8882 spec->codec_variant = ALC269_TYPE_ALC280;
8885 spec->codec_variant = ALC269_TYPE_ALC282;
8886 spec->shutup = alc282_shutup;
8887 spec->init_hook = alc282_init;
8891 spec->codec_variant = ALC269_TYPE_ALC283;
8892 spec->shutup = alc283_shutup;
8893 spec->init_hook = alc283_init;
8897 spec->codec_variant = ALC269_TYPE_ALC284;
8900 spec->codec_variant = ALC269_TYPE_ALC293;
8904 spec->codec_variant = ALC269_TYPE_ALC286;
8907 spec->codec_variant = ALC269_TYPE_ALC298;
8911 spec->codec_variant = ALC269_TYPE_ALC255;
8912 spec->shutup = alc256_shutup;
8913 spec->init_hook = alc256_init;
8917 spec->codec_variant = ALC269_TYPE_ALC256;
8918 spec->shutup = alc256_shutup;
8919 spec->init_hook = alc256_init;
8920 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
8923 spec->codec_variant = ALC269_TYPE_ALC257;
8924 spec->shutup = alc256_shutup;
8925 spec->init_hook = alc256_init;
8926 spec->gen.mixer_nid = 0;
8933 spec->codec_variant = ALC269_TYPE_ALC215;
8934 spec->shutup = alc225_shutup;
8935 spec->init_hook = alc225_init;
8936 spec->gen.mixer_nid = 0;
8941 spec->codec_variant = ALC269_TYPE_ALC225;
8942 spec->shutup = alc225_shutup;
8943 spec->init_hook = alc225_init;
8944 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
8949 spec->codec_variant = ALC269_TYPE_ALC294;
8950 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
8951 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
8952 spec->init_hook = alc294_init;
8955 spec->codec_variant = ALC269_TYPE_ALC300;
8956 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
8959 spec->codec_variant = ALC269_TYPE_ALC623;
8965 spec->codec_variant = ALC269_TYPE_ALC700;
8966 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
8967 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
8968 spec->init_hook = alc294_init;
8973 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
8974 spec->has_alc5505_dsp = 1;
8975 spec->init_hook = alc5505_dsp_init;
8978 alc_pre_init(codec);
8980 snd_hda_pick_fixup(codec, alc269_fixup_models,
8981 alc269_fixup_tbl, alc269_fixups);
8982 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
8983 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
8984 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
8986 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8988 alc_auto_parse_customize_define(codec);
8990 if (has_cdefine_beep(codec))
8991 spec->gen.beep_nid = 0x01;
8993 /* automatic parse from the BIOS config */
8994 err = alc269_parse_auto_config(codec);
8998 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
8999 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9004 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9017 static int alc861_parse_auto_config(struct hda_codec *codec)
9019 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
9020 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9021 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
9024 /* Pin config fixes */
9026 ALC861_FIXUP_FSC_AMILO_PI1505,
9027 ALC861_FIXUP_AMP_VREF_0F,
9028 ALC861_FIXUP_NO_JACK_DETECT,
9029 ALC861_FIXUP_ASUS_A6RP,
9030 ALC660_FIXUP_ASUS_W7J,
9033 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9034 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
9035 const struct hda_fixup *fix, int action)
9037 struct alc_spec *spec = codec->spec;
9040 if (action != HDA_FIXUP_ACT_INIT)
9042 val = snd_hda_codec_get_pin_target(codec, 0x0f);
9043 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9044 val |= AC_PINCTL_IN_EN;
9045 val |= AC_PINCTL_VREF_50;
9046 snd_hda_set_pin_ctl(codec, 0x0f, val);
9047 spec->gen.keep_vref_in_automute = 1;
9050 /* suppress the jack-detection */
9051 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
9052 const struct hda_fixup *fix, int action)
9054 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9055 codec->no_jack_detect = 1;
9058 static const struct hda_fixup alc861_fixups[] = {
9059 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
9060 .type = HDA_FIXUP_PINS,
9061 .v.pins = (const struct hda_pintbl[]) {
9062 { 0x0b, 0x0221101f }, /* HP */
9063 { 0x0f, 0x90170310 }, /* speaker */
9067 [ALC861_FIXUP_AMP_VREF_0F] = {
9068 .type = HDA_FIXUP_FUNC,
9069 .v.func = alc861_fixup_asus_amp_vref_0f,
9071 [ALC861_FIXUP_NO_JACK_DETECT] = {
9072 .type = HDA_FIXUP_FUNC,
9073 .v.func = alc_fixup_no_jack_detect,
9075 [ALC861_FIXUP_ASUS_A6RP] = {
9076 .type = HDA_FIXUP_FUNC,
9077 .v.func = alc861_fixup_asus_amp_vref_0f,
9079 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
9081 [ALC660_FIXUP_ASUS_W7J] = {
9082 .type = HDA_FIXUP_VERBS,
9083 .v.verbs = (const struct hda_verb[]) {
9084 /* ASUS W7J needs a magic pin setup on unused NID 0x10
9085 * for enabling outputs
9087 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
9093 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
9094 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
9095 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
9096 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
9097 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
9098 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
9099 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F),
9100 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F),
9101 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
9107 static int patch_alc861(struct hda_codec *codec)
9109 struct alc_spec *spec;
9112 err = alc_alloc_spec(codec, 0x15);
9117 if (has_cdefine_beep(codec))
9118 spec->gen.beep_nid = 0x23;
9121 spec->power_hook = alc_power_eapd;
9124 alc_pre_init(codec);
9126 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
9127 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9129 /* automatic parse from the BIOS config */
9130 err = alc861_parse_auto_config(codec);
9134 if (!spec->gen.no_analog) {
9135 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
9140 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9154 * In addition, an independent DAC
9156 static int alc861vd_parse_auto_config(struct hda_codec *codec)
9158 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
9159 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9160 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
9164 ALC660VD_FIX_ASUS_GPIO1,
9165 ALC861VD_FIX_DALLAS,
9168 /* exclude VREF80 */
9169 static void alc861vd_fixup_dallas(struct hda_codec *codec,
9170 const struct hda_fixup *fix, int action)
9172 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9173 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
9174 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
9179 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
9180 const struct hda_fixup *fix, int action)
9182 struct alc_spec *spec = codec->spec;
9184 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9185 spec->gpio_mask |= 0x02;
9186 alc_fixup_gpio(codec, action, 0x01);
9189 static const struct hda_fixup alc861vd_fixups[] = {
9190 [ALC660VD_FIX_ASUS_GPIO1] = {
9191 .type = HDA_FIXUP_FUNC,
9192 .v.func = alc660vd_fixup_asus_gpio1,
9194 [ALC861VD_FIX_DALLAS] = {
9195 .type = HDA_FIXUP_FUNC,
9196 .v.func = alc861vd_fixup_dallas,
9200 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
9201 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
9202 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
9203 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
9209 static int patch_alc861vd(struct hda_codec *codec)
9211 struct alc_spec *spec;
9214 err = alc_alloc_spec(codec, 0x0b);
9219 if (has_cdefine_beep(codec))
9220 spec->gen.beep_nid = 0x23;
9222 spec->shutup = alc_eapd_shutup;
9224 alc_pre_init(codec);
9226 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
9227 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9229 /* automatic parse from the BIOS config */
9230 err = alc861vd_parse_auto_config(codec);
9234 if (!spec->gen.no_analog) {
9235 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9240 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9252 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
9253 * configuration. Each pin widget can choose any input DACs and a mixer.
9254 * Each ADC is connected from a mixer of all inputs. This makes possible
9255 * 6-channel independent captures.
9257 * In addition, an independent DAC for the multi-playback (not used in this
9262 * BIOS auto configuration
9265 static int alc662_parse_auto_config(struct hda_codec *codec)
9267 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
9268 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
9269 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9270 const hda_nid_t *ssids;
9272 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
9273 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
9274 codec->core.vendor_id == 0x10ec0671)
9275 ssids = alc663_ssids;
9277 ssids = alc662_ssids;
9278 return alc_parse_auto_config(codec, alc662_ignore, ssids);
9281 static void alc272_fixup_mario(struct hda_codec *codec,
9282 const struct hda_fixup *fix, int action)
9284 if (action != HDA_FIXUP_ACT_PRE_PROBE)
9286 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
9287 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
9288 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
9289 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
9290 (0 << AC_AMPCAP_MUTE_SHIFT)))
9291 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
9294 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
9296 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
9298 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
9299 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
9303 /* override the 2.1 chmap */
9304 static void alc_fixup_bass_chmap(struct hda_codec *codec,
9305 const struct hda_fixup *fix, int action)
9307 if (action == HDA_FIXUP_ACT_BUILD) {
9308 struct alc_spec *spec = codec->spec;
9309 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
9313 /* avoid D3 for keeping GPIO up */
9314 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
9316 unsigned int power_state)
9318 struct alc_spec *spec = codec->spec;
9319 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
9324 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
9325 const struct hda_fixup *fix, int action)
9327 struct alc_spec *spec = codec->spec;
9329 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
9330 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9331 spec->mute_led_polarity = 1;
9332 codec->power_filter = gpio_led_power_filter;
9336 static void alc662_usi_automute_hook(struct hda_codec *codec,
9337 struct hda_jack_callback *jack)
9339 struct alc_spec *spec = codec->spec;
9342 snd_hda_gen_hp_automute(codec, jack);
9344 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
9346 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
9350 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
9351 const struct hda_fixup *fix, int action)
9353 struct alc_spec *spec = codec->spec;
9354 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9355 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9356 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
9360 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
9361 struct hda_jack_callback *cb)
9363 /* surround speakers at 0x1b already get muted automatically when
9364 * headphones are plugged in, but we have to mute/unmute the remaining
9365 * channels manually:
9366 * 0x15 - front left/front right
9367 * 0x18 - front center/ LFE
9369 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
9370 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
9371 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
9373 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
9374 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
9378 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
9379 const struct hda_fixup *fix, int action)
9381 /* Pin 0x1b: shared headphones jack and surround speakers */
9382 if (!is_jack_detectable(codec, 0x1b))
9386 case HDA_FIXUP_ACT_PRE_PROBE:
9387 snd_hda_jack_detect_enable_callback(codec, 0x1b,
9388 alc662_aspire_ethos_mute_speakers);
9389 /* subwoofer needs an extra GPIO setting to become audible */
9390 alc_setup_gpio(codec, 0x02);
9392 case HDA_FIXUP_ACT_INIT:
9393 /* Make sure to start in a correct state, i.e. if
9394 * headphones have been plugged in before powering up the system
9396 alc662_aspire_ethos_mute_speakers(codec, NULL);
9401 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
9402 const struct hda_fixup *fix, int action)
9404 struct alc_spec *spec = codec->spec;
9406 static const struct hda_pintbl pincfgs[] = {
9407 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
9408 { 0x1b, 0x0181304f },
9413 case HDA_FIXUP_ACT_PRE_PROBE:
9414 spec->gen.mixer_nid = 0;
9415 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9416 snd_hda_apply_pincfgs(codec, pincfgs);
9418 case HDA_FIXUP_ACT_INIT:
9419 alc_write_coef_idx(codec, 0x19, 0xa054);
9424 static const struct coef_fw alc668_coefs[] = {
9425 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
9426 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
9427 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
9428 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
9429 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
9430 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
9431 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
9432 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
9433 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
9434 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
9435 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
9436 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
9437 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
9438 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
9439 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
9440 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
9441 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
9442 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
9443 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
9444 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
9448 static void alc668_restore_default_value(struct hda_codec *codec)
9450 alc_process_coef_fw(codec, alc668_coefs);
9454 ALC662_FIXUP_ASPIRE,
9455 ALC662_FIXUP_LED_GPIO1,
9456 ALC662_FIXUP_IDEAPAD,
9458 ALC662_FIXUP_CZC_ET26,
9459 ALC662_FIXUP_CZC_P10T,
9460 ALC662_FIXUP_SKU_IGNORE,
9461 ALC662_FIXUP_HP_RP5800,
9462 ALC662_FIXUP_ASUS_MODE1,
9463 ALC662_FIXUP_ASUS_MODE2,
9464 ALC662_FIXUP_ASUS_MODE3,
9465 ALC662_FIXUP_ASUS_MODE4,
9466 ALC662_FIXUP_ASUS_MODE5,
9467 ALC662_FIXUP_ASUS_MODE6,
9468 ALC662_FIXUP_ASUS_MODE7,
9469 ALC662_FIXUP_ASUS_MODE8,
9470 ALC662_FIXUP_NO_JACK_DETECT,
9471 ALC662_FIXUP_ZOTAC_Z68,
9472 ALC662_FIXUP_INV_DMIC,
9473 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9474 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
9475 ALC662_FIXUP_HEADSET_MODE,
9476 ALC668_FIXUP_HEADSET_MODE,
9477 ALC662_FIXUP_BASS_MODE4_CHMAP,
9478 ALC662_FIXUP_BASS_16,
9479 ALC662_FIXUP_BASS_1A,
9480 ALC662_FIXUP_BASS_CHMAP,
9481 ALC668_FIXUP_AUTO_MUTE,
9482 ALC668_FIXUP_DELL_DISABLE_AAMIX,
9483 ALC668_FIXUP_DELL_XPS13,
9484 ALC662_FIXUP_ASUS_Nx50,
9485 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9486 ALC668_FIXUP_ASUS_Nx51,
9487 ALC668_FIXUP_MIC_COEF,
9488 ALC668_FIXUP_ASUS_G751,
9489 ALC891_FIXUP_HEADSET_MODE,
9490 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9491 ALC662_FIXUP_ACER_VERITON,
9492 ALC892_FIXUP_ASROCK_MOBO,
9493 ALC662_FIXUP_USI_FUNC,
9494 ALC662_FIXUP_USI_HEADSET_MODE,
9495 ALC662_FIXUP_LENOVO_MULTI_CODECS,
9496 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
9497 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
9498 ALC671_FIXUP_HP_HEADSET_MIC2,
9499 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
9500 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
9503 static const struct hda_fixup alc662_fixups[] = {
9504 [ALC662_FIXUP_ASPIRE] = {
9505 .type = HDA_FIXUP_PINS,
9506 .v.pins = (const struct hda_pintbl[]) {
9507 { 0x15, 0x99130112 }, /* subwoofer */
9511 [ALC662_FIXUP_LED_GPIO1] = {
9512 .type = HDA_FIXUP_FUNC,
9513 .v.func = alc662_fixup_led_gpio1,
9515 [ALC662_FIXUP_IDEAPAD] = {
9516 .type = HDA_FIXUP_PINS,
9517 .v.pins = (const struct hda_pintbl[]) {
9518 { 0x17, 0x99130112 }, /* subwoofer */
9522 .chain_id = ALC662_FIXUP_LED_GPIO1,
9524 [ALC272_FIXUP_MARIO] = {
9525 .type = HDA_FIXUP_FUNC,
9526 .v.func = alc272_fixup_mario,
9528 [ALC662_FIXUP_CZC_ET26] = {
9529 .type = HDA_FIXUP_PINS,
9530 .v.pins = (const struct hda_pintbl[]) {
9532 {0x14, 0x90170110}, /* speaker */
9535 {0x18, 0x01a19030}, /* mic */
9536 {0x19, 0x90a7013f}, /* int-mic */
9545 .chain_id = ALC662_FIXUP_SKU_IGNORE
9547 [ALC662_FIXUP_CZC_P10T] = {
9548 .type = HDA_FIXUP_VERBS,
9549 .v.verbs = (const struct hda_verb[]) {
9550 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
9554 [ALC662_FIXUP_SKU_IGNORE] = {
9555 .type = HDA_FIXUP_FUNC,
9556 .v.func = alc_fixup_sku_ignore,
9558 [ALC662_FIXUP_HP_RP5800] = {
9559 .type = HDA_FIXUP_PINS,
9560 .v.pins = (const struct hda_pintbl[]) {
9561 { 0x14, 0x0221201f }, /* HP out */
9565 .chain_id = ALC662_FIXUP_SKU_IGNORE
9567 [ALC662_FIXUP_ASUS_MODE1] = {
9568 .type = HDA_FIXUP_PINS,
9569 .v.pins = (const struct hda_pintbl[]) {
9570 { 0x14, 0x99130110 }, /* speaker */
9571 { 0x18, 0x01a19c20 }, /* mic */
9572 { 0x19, 0x99a3092f }, /* int-mic */
9573 { 0x21, 0x0121401f }, /* HP out */
9577 .chain_id = ALC662_FIXUP_SKU_IGNORE
9579 [ALC662_FIXUP_ASUS_MODE2] = {
9580 .type = HDA_FIXUP_PINS,
9581 .v.pins = (const struct hda_pintbl[]) {
9582 { 0x14, 0x99130110 }, /* speaker */
9583 { 0x18, 0x01a19820 }, /* mic */
9584 { 0x19, 0x99a3092f }, /* int-mic */
9585 { 0x1b, 0x0121401f }, /* HP out */
9589 .chain_id = ALC662_FIXUP_SKU_IGNORE
9591 [ALC662_FIXUP_ASUS_MODE3] = {
9592 .type = HDA_FIXUP_PINS,
9593 .v.pins = (const struct hda_pintbl[]) {
9594 { 0x14, 0x99130110 }, /* speaker */
9595 { 0x15, 0x0121441f }, /* HP */
9596 { 0x18, 0x01a19840 }, /* mic */
9597 { 0x19, 0x99a3094f }, /* int-mic */
9598 { 0x21, 0x01211420 }, /* HP2 */
9602 .chain_id = ALC662_FIXUP_SKU_IGNORE
9604 [ALC662_FIXUP_ASUS_MODE4] = {
9605 .type = HDA_FIXUP_PINS,
9606 .v.pins = (const struct hda_pintbl[]) {
9607 { 0x14, 0x99130110 }, /* speaker */
9608 { 0x16, 0x99130111 }, /* speaker */
9609 { 0x18, 0x01a19840 }, /* mic */
9610 { 0x19, 0x99a3094f }, /* int-mic */
9611 { 0x21, 0x0121441f }, /* HP */
9615 .chain_id = ALC662_FIXUP_SKU_IGNORE
9617 [ALC662_FIXUP_ASUS_MODE5] = {
9618 .type = HDA_FIXUP_PINS,
9619 .v.pins = (const struct hda_pintbl[]) {
9620 { 0x14, 0x99130110 }, /* speaker */
9621 { 0x15, 0x0121441f }, /* HP */
9622 { 0x16, 0x99130111 }, /* speaker */
9623 { 0x18, 0x01a19840 }, /* mic */
9624 { 0x19, 0x99a3094f }, /* int-mic */
9628 .chain_id = ALC662_FIXUP_SKU_IGNORE
9630 [ALC662_FIXUP_ASUS_MODE6] = {
9631 .type = HDA_FIXUP_PINS,
9632 .v.pins = (const struct hda_pintbl[]) {
9633 { 0x14, 0x99130110 }, /* speaker */
9634 { 0x15, 0x01211420 }, /* HP2 */
9635 { 0x18, 0x01a19840 }, /* mic */
9636 { 0x19, 0x99a3094f }, /* int-mic */
9637 { 0x1b, 0x0121441f }, /* HP */
9641 .chain_id = ALC662_FIXUP_SKU_IGNORE
9643 [ALC662_FIXUP_ASUS_MODE7] = {
9644 .type = HDA_FIXUP_PINS,
9645 .v.pins = (const struct hda_pintbl[]) {
9646 { 0x14, 0x99130110 }, /* speaker */
9647 { 0x17, 0x99130111 }, /* speaker */
9648 { 0x18, 0x01a19840 }, /* mic */
9649 { 0x19, 0x99a3094f }, /* int-mic */
9650 { 0x1b, 0x01214020 }, /* HP */
9651 { 0x21, 0x0121401f }, /* HP */
9655 .chain_id = ALC662_FIXUP_SKU_IGNORE
9657 [ALC662_FIXUP_ASUS_MODE8] = {
9658 .type = HDA_FIXUP_PINS,
9659 .v.pins = (const struct hda_pintbl[]) {
9660 { 0x14, 0x99130110 }, /* speaker */
9661 { 0x12, 0x99a30970 }, /* int-mic */
9662 { 0x15, 0x01214020 }, /* HP */
9663 { 0x17, 0x99130111 }, /* speaker */
9664 { 0x18, 0x01a19840 }, /* mic */
9665 { 0x21, 0x0121401f }, /* HP */
9669 .chain_id = ALC662_FIXUP_SKU_IGNORE
9671 [ALC662_FIXUP_NO_JACK_DETECT] = {
9672 .type = HDA_FIXUP_FUNC,
9673 .v.func = alc_fixup_no_jack_detect,
9675 [ALC662_FIXUP_ZOTAC_Z68] = {
9676 .type = HDA_FIXUP_PINS,
9677 .v.pins = (const struct hda_pintbl[]) {
9678 { 0x1b, 0x02214020 }, /* Front HP */
9682 [ALC662_FIXUP_INV_DMIC] = {
9683 .type = HDA_FIXUP_FUNC,
9684 .v.func = alc_fixup_inv_dmic,
9686 [ALC668_FIXUP_DELL_XPS13] = {
9687 .type = HDA_FIXUP_FUNC,
9688 .v.func = alc_fixup_dell_xps13,
9690 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
9692 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
9693 .type = HDA_FIXUP_FUNC,
9694 .v.func = alc_fixup_disable_aamix,
9696 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
9698 [ALC668_FIXUP_AUTO_MUTE] = {
9699 .type = HDA_FIXUP_FUNC,
9700 .v.func = alc_fixup_auto_mute_via_amp,
9702 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
9704 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
9705 .type = HDA_FIXUP_PINS,
9706 .v.pins = (const struct hda_pintbl[]) {
9707 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9708 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
9712 .chain_id = ALC662_FIXUP_HEADSET_MODE
9714 [ALC662_FIXUP_HEADSET_MODE] = {
9715 .type = HDA_FIXUP_FUNC,
9716 .v.func = alc_fixup_headset_mode_alc662,
9718 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
9719 .type = HDA_FIXUP_PINS,
9720 .v.pins = (const struct hda_pintbl[]) {
9721 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9722 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9726 .chain_id = ALC668_FIXUP_HEADSET_MODE
9728 [ALC668_FIXUP_HEADSET_MODE] = {
9729 .type = HDA_FIXUP_FUNC,
9730 .v.func = alc_fixup_headset_mode_alc668,
9732 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
9733 .type = HDA_FIXUP_FUNC,
9734 .v.func = alc_fixup_bass_chmap,
9736 .chain_id = ALC662_FIXUP_ASUS_MODE4
9738 [ALC662_FIXUP_BASS_16] = {
9739 .type = HDA_FIXUP_PINS,
9740 .v.pins = (const struct hda_pintbl[]) {
9741 {0x16, 0x80106111}, /* bass speaker */
9745 .chain_id = ALC662_FIXUP_BASS_CHMAP,
9747 [ALC662_FIXUP_BASS_1A] = {
9748 .type = HDA_FIXUP_PINS,
9749 .v.pins = (const struct hda_pintbl[]) {
9750 {0x1a, 0x80106111}, /* bass speaker */
9754 .chain_id = ALC662_FIXUP_BASS_CHMAP,
9756 [ALC662_FIXUP_BASS_CHMAP] = {
9757 .type = HDA_FIXUP_FUNC,
9758 .v.func = alc_fixup_bass_chmap,
9760 [ALC662_FIXUP_ASUS_Nx50] = {
9761 .type = HDA_FIXUP_FUNC,
9762 .v.func = alc_fixup_auto_mute_via_amp,
9764 .chain_id = ALC662_FIXUP_BASS_1A
9766 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
9767 .type = HDA_FIXUP_FUNC,
9768 .v.func = alc_fixup_headset_mode_alc668,
9769 .chain_id = ALC662_FIXUP_BASS_CHMAP
9771 [ALC668_FIXUP_ASUS_Nx51] = {
9772 .type = HDA_FIXUP_PINS,
9773 .v.pins = (const struct hda_pintbl[]) {
9774 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9775 { 0x1a, 0x90170151 }, /* bass speaker */
9776 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9780 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9782 [ALC668_FIXUP_MIC_COEF] = {
9783 .type = HDA_FIXUP_VERBS,
9784 .v.verbs = (const struct hda_verb[]) {
9785 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
9786 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
9790 [ALC668_FIXUP_ASUS_G751] = {
9791 .type = HDA_FIXUP_PINS,
9792 .v.pins = (const struct hda_pintbl[]) {
9793 { 0x16, 0x0421101f }, /* HP */
9797 .chain_id = ALC668_FIXUP_MIC_COEF
9799 [ALC891_FIXUP_HEADSET_MODE] = {
9800 .type = HDA_FIXUP_FUNC,
9801 .v.func = alc_fixup_headset_mode,
9803 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
9804 .type = HDA_FIXUP_PINS,
9805 .v.pins = (const struct hda_pintbl[]) {
9806 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9807 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9811 .chain_id = ALC891_FIXUP_HEADSET_MODE
9813 [ALC662_FIXUP_ACER_VERITON] = {
9814 .type = HDA_FIXUP_PINS,
9815 .v.pins = (const struct hda_pintbl[]) {
9816 { 0x15, 0x50170120 }, /* no internal speaker */
9820 [ALC892_FIXUP_ASROCK_MOBO] = {
9821 .type = HDA_FIXUP_PINS,
9822 .v.pins = (const struct hda_pintbl[]) {
9823 { 0x15, 0x40f000f0 }, /* disabled */
9824 { 0x16, 0x40f000f0 }, /* disabled */
9828 [ALC662_FIXUP_USI_FUNC] = {
9829 .type = HDA_FIXUP_FUNC,
9830 .v.func = alc662_fixup_usi_headset_mic,
9832 [ALC662_FIXUP_USI_HEADSET_MODE] = {
9833 .type = HDA_FIXUP_PINS,
9834 .v.pins = (const struct hda_pintbl[]) {
9835 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
9836 { 0x18, 0x01a1903d },
9840 .chain_id = ALC662_FIXUP_USI_FUNC
9842 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
9843 .type = HDA_FIXUP_FUNC,
9844 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
9846 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
9847 .type = HDA_FIXUP_FUNC,
9848 .v.func = alc662_fixup_aspire_ethos_hp,
9850 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
9851 .type = HDA_FIXUP_PINS,
9852 .v.pins = (const struct hda_pintbl[]) {
9853 { 0x15, 0x92130110 }, /* front speakers */
9854 { 0x18, 0x99130111 }, /* center/subwoofer */
9855 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
9859 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
9861 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
9862 .type = HDA_FIXUP_FUNC,
9863 .v.func = alc671_fixup_hp_headset_mic2,
9865 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
9866 .type = HDA_FIXUP_PINS,
9867 .v.pins = (const struct hda_pintbl[]) {
9868 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9872 .chain_id = ALC662_FIXUP_USI_FUNC
9874 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
9875 .type = HDA_FIXUP_PINS,
9876 .v.pins = (const struct hda_pintbl[]) {
9877 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
9878 { 0x1b, 0x0221144f },
9882 .chain_id = ALC662_FIXUP_USI_FUNC
9886 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
9887 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
9888 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
9889 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
9890 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
9891 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
9892 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
9893 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
9894 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9895 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
9896 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
9897 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9898 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9899 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
9900 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
9901 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
9902 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9903 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9904 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9905 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9906 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9907 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
9908 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
9909 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
9910 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9911 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
9912 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
9913 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9914 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9915 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
9916 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
9917 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
9918 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
9919 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
9920 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9921 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
9922 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
9923 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
9924 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
9925 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
9926 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
9927 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
9928 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
9929 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9930 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
9931 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
9932 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
9933 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
9936 /* Below is a quirk table taken from the old code.
9937 * Basically the device should work as is without the fixup table.
9938 * If BIOS doesn't give a proper info, enable the corresponding
9941 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
9942 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
9943 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
9944 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
9945 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9946 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9947 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9948 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
9949 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
9950 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9951 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
9952 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
9953 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
9954 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
9955 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
9956 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9957 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
9958 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
9959 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9960 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9961 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9962 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9963 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
9964 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
9965 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
9966 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9967 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
9968 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9969 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9970 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
9971 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9972 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9973 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
9974 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
9975 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
9976 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
9977 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
9978 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
9979 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
9980 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9981 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
9982 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
9983 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9984 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
9985 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
9986 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
9987 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
9988 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
9989 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9990 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
9995 static const struct hda_model_fixup alc662_fixup_models[] = {
9996 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
9997 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
9998 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
9999 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
10000 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
10001 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
10002 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
10003 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
10004 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
10005 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
10006 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
10007 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
10008 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
10009 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
10010 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
10011 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10012 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
10013 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
10014 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
10015 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
10016 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
10017 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
10018 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
10019 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
10020 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
10021 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
10022 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
10023 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
10024 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
10025 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
10026 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10027 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
10031 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
10032 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10033 {0x17, 0x02211010},
10034 {0x18, 0x01a19030},
10035 {0x1a, 0x01813040},
10036 {0x21, 0x01014020}),
10037 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10038 {0x16, 0x01813030},
10039 {0x17, 0x02211010},
10040 {0x18, 0x01a19040},
10041 {0x21, 0x01014020}),
10042 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10043 {0x14, 0x01014010},
10044 {0x18, 0x01a19020},
10045 {0x1a, 0x0181302f},
10046 {0x1b, 0x0221401f}),
10047 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10048 {0x12, 0x99a30130},
10049 {0x14, 0x90170110},
10050 {0x15, 0x0321101f},
10051 {0x16, 0x03011020}),
10052 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10053 {0x12, 0x99a30140},
10054 {0x14, 0x90170110},
10055 {0x15, 0x0321101f},
10056 {0x16, 0x03011020}),
10057 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10058 {0x12, 0x99a30150},
10059 {0x14, 0x90170110},
10060 {0x15, 0x0321101f},
10061 {0x16, 0x03011020}),
10062 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10063 {0x14, 0x90170110},
10064 {0x15, 0x0321101f},
10065 {0x16, 0x03011020}),
10066 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
10067 {0x12, 0x90a60130},
10068 {0x14, 0x90170110},
10069 {0x15, 0x0321101f}),
10070 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10071 {0x14, 0x01014010},
10072 {0x17, 0x90170150},
10073 {0x19, 0x02a11060},
10074 {0x1b, 0x01813030},
10075 {0x21, 0x02211020}),
10076 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10077 {0x14, 0x01014010},
10078 {0x18, 0x01a19040},
10079 {0x1b, 0x01813030},
10080 {0x21, 0x02211020}),
10081 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10082 {0x14, 0x01014020},
10083 {0x17, 0x90170110},
10084 {0x18, 0x01a19050},
10085 {0x1b, 0x01813040},
10086 {0x21, 0x02211030}),
10092 static int patch_alc662(struct hda_codec *codec)
10094 struct alc_spec *spec;
10097 err = alc_alloc_spec(codec, 0x0b);
10101 spec = codec->spec;
10103 spec->shutup = alc_eapd_shutup;
10105 /* handle multiple HPs as is */
10106 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
10108 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10110 switch (codec->core.vendor_id) {
10112 spec->init_hook = alc668_restore_default_value;
10116 alc_pre_init(codec);
10118 snd_hda_pick_fixup(codec, alc662_fixup_models,
10119 alc662_fixup_tbl, alc662_fixups);
10120 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
10121 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10123 alc_auto_parse_customize_define(codec);
10125 if (has_cdefine_beep(codec))
10126 spec->gen.beep_nid = 0x01;
10128 if ((alc_get_coef0(codec) & (1 << 14)) &&
10129 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
10130 spec->cdefine.platform_type == 1) {
10131 err = alc_codec_rename(codec, "ALC272X");
10136 /* automatic parse from the BIOS config */
10137 err = alc662_parse_auto_config(codec);
10141 if (!spec->gen.no_analog && spec->gen.beep_nid) {
10142 switch (codec->core.vendor_id) {
10144 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10150 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
10153 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
10160 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10173 static int alc680_parse_auto_config(struct hda_codec *codec)
10175 return alc_parse_auto_config(codec, NULL, NULL);
10180 static int patch_alc680(struct hda_codec *codec)
10184 /* ALC680 has no aa-loopback mixer */
10185 err = alc_alloc_spec(codec, 0);
10189 /* automatic parse from the BIOS config */
10190 err = alc680_parse_auto_config(codec);
10202 static const struct hda_device_id snd_hda_id_realtek[] = {
10203 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
10204 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
10205 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
10206 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
10207 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
10208 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
10209 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
10210 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
10211 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
10212 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
10213 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
10214 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
10215 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
10216 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
10217 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
10218 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
10219 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
10220 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
10221 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
10222 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
10223 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
10224 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
10225 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
10226 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
10227 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
10228 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
10229 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
10230 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
10231 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
10232 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
10233 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
10234 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
10235 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
10236 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
10237 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
10238 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
10239 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
10240 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
10241 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
10242 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
10243 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
10244 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
10245 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
10246 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
10247 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
10248 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
10249 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
10250 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
10251 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
10252 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
10253 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
10254 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
10255 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
10256 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
10257 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
10258 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
10259 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
10260 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
10261 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
10262 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
10263 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
10264 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
10265 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
10266 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
10267 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
10268 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
10269 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
10270 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
10271 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
10272 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
10273 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
10274 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
10275 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
10276 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
10277 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
10278 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
10279 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
10280 {} /* terminator */
10282 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
10284 MODULE_LICENSE("GPL");
10285 MODULE_DESCRIPTION("Realtek HD-audio codec");
10287 static struct hda_codec_driver realtek_driver = {
10288 .id = snd_hda_id_realtek,
10291 module_hda_codec_driver(realtek_driver);