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 <sound/core.h>
21 #include <sound/jack.h>
22 #include <sound/hda_codec.h>
23 #include "hda_local.h"
24 #include "hda_auto_parser.h"
26 #include "hda_generic.h"
28 /* keep halting ALC5505 DSP, for power saving */
29 #define HALT_REALTEK_ALC5505
31 /* extra amp-initialization sequence types */
39 ALC_HEADSET_MODE_UNKNOWN,
40 ALC_HEADSET_MODE_UNPLUGGED,
41 ALC_HEADSET_MODE_HEADSET,
43 ALC_HEADSET_MODE_HEADPHONE,
47 ALC_HEADSET_TYPE_UNKNOWN,
48 ALC_HEADSET_TYPE_CTIA,
49 ALC_HEADSET_TYPE_OMTP,
53 ALC_KEY_MICMUTE_INDEX,
56 struct alc_customize_define {
58 unsigned char port_connectivity;
59 unsigned char check_sum;
60 unsigned char customization;
61 unsigned char external_amp;
62 unsigned int enable_pcbeep:1;
63 unsigned int platform_type:1;
65 unsigned int override:1;
66 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
70 struct hda_gen_spec gen; /* must be at head */
72 /* codec parameterization */
73 struct alc_customize_define cdefine;
74 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
77 unsigned int gpio_mask;
78 unsigned int gpio_dir;
79 unsigned int gpio_data;
80 bool gpio_write_delay; /* add a delay before writing gpio_data */
82 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
83 int mute_led_polarity;
84 int micmute_led_polarity;
85 hda_nid_t mute_led_nid;
86 hda_nid_t cap_mute_led_nid;
88 unsigned int gpio_mute_led_mask;
89 unsigned int gpio_mic_led_mask;
90 unsigned int mute_led_coef_idx;
91 unsigned int mute_led_coefbit_mask;
92 unsigned int mute_led_coefbit_on;
93 unsigned int mute_led_coefbit_off;
94 unsigned int mic_led_coef_idx;
95 unsigned int mic_led_coefbit_mask;
96 unsigned int mic_led_coefbit_on;
97 unsigned int mic_led_coefbit_off;
99 hda_nid_t headset_mic_pin;
100 hda_nid_t headphone_mic_pin;
101 int current_headset_mode;
102 int current_headset_type;
105 void (*init_hook)(struct hda_codec *codec);
107 void (*power_hook)(struct hda_codec *codec);
109 void (*shutup)(struct hda_codec *codec);
110 void (*reboot_notify)(struct hda_codec *codec);
113 int codec_variant; /* flag for other variants */
114 unsigned int has_alc5505_dsp:1;
115 unsigned int no_depop_delay:1;
116 unsigned int done_hp_init:1;
117 unsigned int no_shutup_pins:1;
118 unsigned int ultra_low_power:1;
119 unsigned int has_hs_key:1;
123 unsigned int pll_coef_idx, pll_coef_bit;
125 struct input_dev *kb_dev;
126 u8 alc_mute_keycode_map[1];
130 * COEF access helper functions
133 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
134 unsigned int coef_idx)
138 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
139 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
143 #define alc_read_coef_idx(codec, coef_idx) \
144 alc_read_coefex_idx(codec, 0x20, coef_idx)
146 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
147 unsigned int coef_idx, unsigned int coef_val)
149 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
150 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
153 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
154 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
156 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
157 unsigned int coef_idx, unsigned int mask,
158 unsigned int bits_set)
160 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
163 alc_write_coefex_idx(codec, nid, coef_idx,
164 (val & ~mask) | bits_set);
167 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
168 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
170 /* a special bypass for COEF 0; read the cached value at the second time */
171 static unsigned int alc_get_coef0(struct hda_codec *codec)
173 struct alc_spec *spec = codec->spec;
176 spec->coef0 = alc_read_coef_idx(codec, 0);
180 /* coef writes/updates batch */
188 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
189 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
190 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
191 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
192 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
194 static void alc_process_coef_fw(struct hda_codec *codec,
195 const struct coef_fw *fw)
197 for (; fw->nid; fw++) {
198 if (fw->mask == (unsigned short)-1)
199 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
201 alc_update_coefex_idx(codec, fw->nid, fw->idx,
207 * GPIO setup tables, used in initialization
210 /* Enable GPIO mask and set output */
211 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
213 struct alc_spec *spec = codec->spec;
215 spec->gpio_mask |= mask;
216 spec->gpio_dir |= mask;
217 spec->gpio_data |= mask;
220 static void alc_write_gpio_data(struct hda_codec *codec)
222 struct alc_spec *spec = codec->spec;
224 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
228 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
231 struct alc_spec *spec = codec->spec;
232 unsigned int oldval = spec->gpio_data;
235 spec->gpio_data |= mask;
237 spec->gpio_data &= ~mask;
238 if (oldval != spec->gpio_data)
239 alc_write_gpio_data(codec);
242 static void alc_write_gpio(struct hda_codec *codec)
244 struct alc_spec *spec = codec->spec;
246 if (!spec->gpio_mask)
249 snd_hda_codec_write(codec, codec->core.afg, 0,
250 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
251 snd_hda_codec_write(codec, codec->core.afg, 0,
252 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
253 if (spec->gpio_write_delay)
255 alc_write_gpio_data(codec);
258 static void alc_fixup_gpio(struct hda_codec *codec, int action,
261 if (action == HDA_FIXUP_ACT_PRE_PROBE)
262 alc_setup_gpio(codec, mask);
265 static void alc_fixup_gpio1(struct hda_codec *codec,
266 const struct hda_fixup *fix, int action)
268 alc_fixup_gpio(codec, action, 0x01);
271 static void alc_fixup_gpio2(struct hda_codec *codec,
272 const struct hda_fixup *fix, int action)
274 alc_fixup_gpio(codec, action, 0x02);
277 static void alc_fixup_gpio3(struct hda_codec *codec,
278 const struct hda_fixup *fix, int action)
280 alc_fixup_gpio(codec, action, 0x03);
283 static void alc_fixup_gpio4(struct hda_codec *codec,
284 const struct hda_fixup *fix, int action)
286 alc_fixup_gpio(codec, action, 0x04);
290 * Fix hardware PLL issue
291 * On some codecs, the analog PLL gating control must be off while
292 * the default value is 1.
294 static void alc_fix_pll(struct hda_codec *codec)
296 struct alc_spec *spec = codec->spec;
299 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
300 1 << spec->pll_coef_bit, 0);
303 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
304 unsigned int coef_idx, unsigned int coef_bit)
306 struct alc_spec *spec = codec->spec;
308 spec->pll_coef_idx = coef_idx;
309 spec->pll_coef_bit = coef_bit;
313 /* update the master volume per volume-knob's unsol event */
314 static void alc_update_knob_master(struct hda_codec *codec,
315 struct hda_jack_callback *jack)
318 struct snd_kcontrol *kctl;
319 struct snd_ctl_elem_value *uctl;
321 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
324 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
327 val = snd_hda_codec_read(codec, jack->nid, 0,
328 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
329 val &= HDA_AMP_VOLMASK;
330 uctl->value.integer.value[0] = val;
331 uctl->value.integer.value[1] = val;
332 kctl->put(kctl, uctl);
336 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
338 /* For some reason, the res given from ALC880 is broken.
339 Here we adjust it properly. */
340 snd_hda_jack_unsol_event(codec, res >> 2);
343 /* Change EAPD to verb control */
344 static void alc_fill_eapd_coef(struct hda_codec *codec)
348 coef = alc_get_coef0(codec);
350 switch (codec->core.vendor_id) {
352 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
356 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
359 if ((coef & 0x00f0) == 0x0010)
360 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
361 if ((coef & 0x00f0) == 0x0020)
362 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
363 if ((coef & 0x00f0) == 0x0030)
364 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
370 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
375 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
395 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
398 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
401 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
402 alc_write_coef_idx(codec, 0x8, 0x4ab7);
405 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
414 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
417 if ((coef & 0x00f0) == 0x0030)
418 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
427 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
431 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
434 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
437 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
440 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
441 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
445 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
452 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
457 /* additional initialization for ALC888 variants */
458 static void alc888_coef_init(struct hda_codec *codec)
460 switch (alc_get_coef0(codec) & 0x00f0) {
465 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
470 /* turn on/off EAPD control (only if available) */
471 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
473 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
475 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
476 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
480 /* turn on/off EAPD controls of the codec */
481 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
483 /* We currently only handle front, HP */
484 static const hda_nid_t pins[] = {
485 0x0f, 0x10, 0x14, 0x15, 0x17, 0
488 for (p = pins; *p; p++)
489 set_eapd(codec, *p, on);
492 static int find_ext_mic_pin(struct hda_codec *codec);
494 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
496 const struct hda_pincfg *pin;
497 int mic_pin = find_ext_mic_pin(codec);
500 /* don't shut up pins when unloading the driver; otherwise it breaks
501 * the default pin setup at the next load of the driver
503 if (codec->bus->shutdown)
506 snd_array_for_each(&codec->init_pins, i, pin) {
507 /* use read here for syncing after issuing each verb */
508 if (pin->nid != mic_pin)
509 snd_hda_codec_read(codec, pin->nid, 0,
510 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
513 codec->pins_shutup = 1;
516 static void alc_shutup_pins(struct hda_codec *codec)
518 struct alc_spec *spec = codec->spec;
520 switch (codec->core.vendor_id) {
528 alc_headset_mic_no_shutup(codec);
531 if (!spec->no_shutup_pins)
532 snd_hda_shutup_pins(codec);
537 /* generic shutup callback;
538 * just turning off EAPD and a little pause for avoiding pop-noise
540 static void alc_eapd_shutup(struct hda_codec *codec)
542 struct alc_spec *spec = codec->spec;
544 alc_auto_setup_eapd(codec, false);
545 if (!spec->no_depop_delay)
547 alc_shutup_pins(codec);
550 /* generic EAPD initialization */
551 static void alc_auto_init_amp(struct hda_codec *codec, int type)
553 alc_auto_setup_eapd(codec, true);
554 alc_write_gpio(codec);
556 case ALC_INIT_DEFAULT:
557 switch (codec->core.vendor_id) {
559 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
565 alc_update_coef_idx(codec, 7, 0, 0x2030);
568 alc888_coef_init(codec);
575 /* get a primary headphone pin if available */
576 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
578 if (spec->gen.autocfg.hp_pins[0])
579 return spec->gen.autocfg.hp_pins[0];
580 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
581 return spec->gen.autocfg.line_out_pins[0];
586 * Realtek SSID verification
589 /* Could be any non-zero and even value. When used as fixup, tells
590 * the driver to ignore any present sku defines.
592 #define ALC_FIXUP_SKU_IGNORE (2)
594 static void alc_fixup_sku_ignore(struct hda_codec *codec,
595 const struct hda_fixup *fix, int action)
597 struct alc_spec *spec = codec->spec;
598 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
599 spec->cdefine.fixup = 1;
600 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
604 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
605 const struct hda_fixup *fix, int action)
607 struct alc_spec *spec = codec->spec;
609 if (action == HDA_FIXUP_ACT_PROBE) {
610 spec->no_depop_delay = 1;
611 codec->depop_delay = 0;
615 static int alc_auto_parse_customize_define(struct hda_codec *codec)
617 unsigned int ass, tmp, i;
619 struct alc_spec *spec = codec->spec;
621 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
623 if (spec->cdefine.fixup) {
624 ass = spec->cdefine.sku_cfg;
625 if (ass == ALC_FIXUP_SKU_IGNORE)
630 if (!codec->bus->pci)
632 ass = codec->core.subsystem_id & 0xffff;
633 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
637 if (codec->core.vendor_id == 0x10ec0260)
639 ass = snd_hda_codec_get_pincfg(codec, nid);
642 codec_info(codec, "%s: SKU not ready 0x%08x\n",
643 codec->core.chip_name, ass);
649 for (i = 1; i < 16; i++) {
653 if (((ass >> 16) & 0xf) != tmp)
656 spec->cdefine.port_connectivity = ass >> 30;
657 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
658 spec->cdefine.check_sum = (ass >> 16) & 0xf;
659 spec->cdefine.customization = ass >> 8;
661 spec->cdefine.sku_cfg = ass;
662 spec->cdefine.external_amp = (ass & 0x38) >> 3;
663 spec->cdefine.platform_type = (ass & 0x4) >> 2;
664 spec->cdefine.swap = (ass & 0x2) >> 1;
665 spec->cdefine.override = ass & 0x1;
667 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
668 nid, spec->cdefine.sku_cfg);
669 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
670 spec->cdefine.port_connectivity);
671 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
672 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
673 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
674 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
675 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
676 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
677 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
682 /* return the position of NID in the list, or -1 if not found */
683 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
686 for (i = 0; i < nums; i++)
691 /* return true if the given NID is found in the list */
692 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
694 return find_idx_in_nid_list(nid, list, nums) >= 0;
697 /* check subsystem ID and set up device-specific initialization;
698 * return 1 if initialized, 0 if invalid SSID
700 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
701 * 31 ~ 16 : Manufacture ID
703 * 7 ~ 0 : Assembly ID
704 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
706 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
708 unsigned int ass, tmp, i;
710 struct alc_spec *spec = codec->spec;
712 if (spec->cdefine.fixup) {
713 ass = spec->cdefine.sku_cfg;
714 if (ass == ALC_FIXUP_SKU_IGNORE)
719 ass = codec->core.subsystem_id & 0xffff;
720 if (codec->bus->pci &&
721 ass != codec->bus->pci->subsystem_device && (ass & 1))
724 /* invalid SSID, check the special NID pin defcfg instead */
726 * 31~30 : port connectivity
729 * 19~16 : Check sum (15:1)
734 if (codec->core.vendor_id == 0x10ec0260)
736 ass = snd_hda_codec_get_pincfg(codec, nid);
738 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
742 if ((ass >> 30) != 1) /* no physical connection */
747 for (i = 1; i < 16; i++) {
751 if (((ass >> 16) & 0xf) != tmp)
754 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
755 ass & 0xffff, codec->core.vendor_id);
759 * 2 : 0 --> Desktop, 1 --> Laptop
760 * 3~5 : External Amplifier control
763 tmp = (ass & 0x38) >> 3; /* external Amp control */
764 if (spec->init_amp == ALC_INIT_UNDEFINED) {
767 alc_setup_gpio(codec, 0x01);
770 alc_setup_gpio(codec, 0x02);
773 alc_setup_gpio(codec, 0x04);
777 spec->init_amp = ALC_INIT_DEFAULT;
782 /* is laptop or Desktop and enable the function "Mute internal speaker
783 * when the external headphone out jack is plugged"
788 * 10~8 : Jack location
789 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
791 * 15 : 1 --> enable the function "Mute internal speaker
792 * when the external headphone out jack is plugged"
794 if (!alc_get_hp_pin(spec)) {
796 tmp = (ass >> 11) & 0x3; /* HP to chassis */
798 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
799 spec->gen.autocfg.line_outs))
801 spec->gen.autocfg.hp_pins[0] = nid;
806 /* Check the validity of ALC subsystem-id
807 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
808 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
810 if (!alc_subsystem_id(codec, ports)) {
811 struct alc_spec *spec = codec->spec;
812 if (spec->init_amp == ALC_INIT_UNDEFINED) {
814 "realtek: Enable default setup for auto mode as fallback\n");
815 spec->init_amp = ALC_INIT_DEFAULT;
823 static void alc_fixup_inv_dmic(struct hda_codec *codec,
824 const struct hda_fixup *fix, int action)
826 struct alc_spec *spec = codec->spec;
828 spec->gen.inv_dmic_split = 1;
832 static int alc_build_controls(struct hda_codec *codec)
836 err = snd_hda_gen_build_controls(codec);
840 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
849 static void alc_pre_init(struct hda_codec *codec)
851 alc_fill_eapd_coef(codec);
854 #define is_s3_resume(codec) \
855 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
856 #define is_s4_resume(codec) \
857 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
859 static int alc_init(struct hda_codec *codec)
861 struct alc_spec *spec = codec->spec;
863 /* hibernation resume needs the full chip initialization */
864 if (is_s4_resume(codec))
868 spec->init_hook(codec);
870 spec->gen.skip_verbs = 1; /* applied in below */
871 snd_hda_gen_init(codec);
873 alc_auto_init_amp(codec, spec->init_amp);
874 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
876 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
881 static inline void alc_shutup(struct hda_codec *codec)
883 struct alc_spec *spec = codec->spec;
885 if (!snd_hda_get_bool_hint(codec, "shutup"))
886 return; /* disabled explicitly by hints */
888 if (spec && spec->shutup)
891 alc_shutup_pins(codec);
894 static void alc_reboot_notify(struct hda_codec *codec)
896 struct alc_spec *spec = codec->spec;
898 if (spec && spec->reboot_notify)
899 spec->reboot_notify(codec);
904 #define alc_free snd_hda_gen_free
907 static void alc_power_eapd(struct hda_codec *codec)
909 alc_auto_setup_eapd(codec, false);
912 static int alc_suspend(struct hda_codec *codec)
914 struct alc_spec *spec = codec->spec;
916 if (spec && spec->power_hook)
917 spec->power_hook(codec);
923 static int alc_resume(struct hda_codec *codec)
925 struct alc_spec *spec = codec->spec;
927 if (!spec->no_depop_delay)
928 msleep(150); /* to avoid pop noise */
929 codec->patch_ops.init(codec);
930 snd_hda_regmap_sync(codec);
931 hda_call_check_power_status(codec, 0x01);
938 static const struct hda_codec_ops alc_patch_ops = {
939 .build_controls = alc_build_controls,
940 .build_pcms = snd_hda_gen_build_pcms,
943 .unsol_event = snd_hda_jack_unsol_event,
945 .resume = alc_resume,
946 .suspend = alc_suspend,
947 .check_power_status = snd_hda_gen_check_power_status,
949 .reboot_notify = alc_reboot_notify,
953 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
956 * Rename codecs appropriately from COEF value or subvendor id
958 struct alc_codec_rename_table {
959 unsigned int vendor_id;
960 unsigned short coef_mask;
961 unsigned short coef_bits;
965 struct alc_codec_rename_pci_table {
966 unsigned int codec_vendor_id;
967 unsigned short pci_subvendor;
968 unsigned short pci_subdevice;
972 static const struct alc_codec_rename_table rename_tbl[] = {
973 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
974 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
975 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
976 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
977 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
978 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
979 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
980 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
981 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
982 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
983 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
984 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
985 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
986 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
987 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
988 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
989 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
993 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
994 { 0x10ec0280, 0x1028, 0, "ALC3220" },
995 { 0x10ec0282, 0x1028, 0, "ALC3221" },
996 { 0x10ec0283, 0x1028, 0, "ALC3223" },
997 { 0x10ec0288, 0x1028, 0, "ALC3263" },
998 { 0x10ec0292, 0x1028, 0, "ALC3226" },
999 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1000 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1001 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1002 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1003 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1004 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1005 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1006 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1007 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1008 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1009 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1010 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1011 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1012 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1013 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1014 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1015 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1016 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1017 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1018 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1019 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1020 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1021 { } /* terminator */
1024 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1026 const struct alc_codec_rename_table *p;
1027 const struct alc_codec_rename_pci_table *q;
1029 for (p = rename_tbl; p->vendor_id; p++) {
1030 if (p->vendor_id != codec->core.vendor_id)
1032 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1033 return alc_codec_rename(codec, p->name);
1036 if (!codec->bus->pci)
1038 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1039 if (q->codec_vendor_id != codec->core.vendor_id)
1041 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1043 if (!q->pci_subdevice ||
1044 q->pci_subdevice == codec->bus->pci->subsystem_device)
1045 return alc_codec_rename(codec, q->name);
1053 * Digital-beep handlers
1055 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1057 /* additional beep mixers; private_value will be overwritten */
1058 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1059 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1060 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1063 /* set up and create beep controls */
1064 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1067 struct snd_kcontrol_new *knew;
1068 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1071 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1072 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1073 &alc_beep_mixer[i]);
1076 knew->private_value = beep_amp;
1081 static const struct snd_pci_quirk beep_white_list[] = {
1082 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1083 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1084 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1085 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1086 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1087 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1088 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1089 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1090 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1091 /* blacklist -- no beep available */
1092 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1093 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1097 static inline int has_cdefine_beep(struct hda_codec *codec)
1099 struct alc_spec *spec = codec->spec;
1100 const struct snd_pci_quirk *q;
1101 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
1104 return spec->cdefine.enable_pcbeep;
1107 #define set_beep_amp(spec, nid, idx, dir) 0
1108 #define has_cdefine_beep(codec) 0
1111 /* parse the BIOS configuration and set up the alc_spec */
1112 /* return 1 if successful, 0 if the proper config is not found,
1113 * or a negative error code
1115 static int alc_parse_auto_config(struct hda_codec *codec,
1116 const hda_nid_t *ignore_nids,
1117 const hda_nid_t *ssid_nids)
1119 struct alc_spec *spec = codec->spec;
1120 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1123 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1129 alc_ssid_check(codec, ssid_nids);
1131 err = snd_hda_gen_parse_auto_config(codec, cfg);
1138 /* common preparation job for alc_spec */
1139 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1141 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1147 snd_hda_gen_spec_init(&spec->gen);
1148 spec->gen.mixer_nid = mixer_nid;
1149 spec->gen.own_eapd_ctl = 1;
1150 codec->single_adc_amp = 1;
1151 /* FIXME: do we need this for all Realtek codec models? */
1152 codec->spdif_status_reset = 1;
1153 codec->forced_resume = 1;
1154 codec->patch_ops = alc_patch_ops;
1156 err = alc_codec_rename_from_preset(codec);
1164 static int alc880_parse_auto_config(struct hda_codec *codec)
1166 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1167 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1168 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1177 ALC880_FIXUP_MEDION_RIM,
1179 ALC880_FIXUP_LG_LW25,
1181 ALC880_FIXUP_EAPD_COEF,
1182 ALC880_FIXUP_TCL_S700,
1183 ALC880_FIXUP_VOL_KNOB,
1184 ALC880_FIXUP_FUJITSU,
1186 ALC880_FIXUP_UNIWILL,
1187 ALC880_FIXUP_UNIWILL_DIG,
1189 ALC880_FIXUP_ASUS_W5A,
1190 ALC880_FIXUP_3ST_BASE,
1192 ALC880_FIXUP_3ST_DIG,
1193 ALC880_FIXUP_5ST_BASE,
1195 ALC880_FIXUP_5ST_DIG,
1196 ALC880_FIXUP_6ST_BASE,
1198 ALC880_FIXUP_6ST_DIG,
1199 ALC880_FIXUP_6ST_AUTOMUTE,
1202 /* enable the volume-knob widget support on NID 0x21 */
1203 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1204 const struct hda_fixup *fix, int action)
1206 if (action == HDA_FIXUP_ACT_PROBE)
1207 snd_hda_jack_detect_enable_callback(codec, 0x21,
1208 alc_update_knob_master);
1211 static const struct hda_fixup alc880_fixups[] = {
1212 [ALC880_FIXUP_GPIO1] = {
1213 .type = HDA_FIXUP_FUNC,
1214 .v.func = alc_fixup_gpio1,
1216 [ALC880_FIXUP_GPIO2] = {
1217 .type = HDA_FIXUP_FUNC,
1218 .v.func = alc_fixup_gpio2,
1220 [ALC880_FIXUP_MEDION_RIM] = {
1221 .type = HDA_FIXUP_VERBS,
1222 .v.verbs = (const struct hda_verb[]) {
1223 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1224 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1228 .chain_id = ALC880_FIXUP_GPIO2,
1230 [ALC880_FIXUP_LG] = {
1231 .type = HDA_FIXUP_PINS,
1232 .v.pins = (const struct hda_pintbl[]) {
1233 /* disable bogus unused pins */
1234 { 0x16, 0x411111f0 },
1235 { 0x18, 0x411111f0 },
1236 { 0x1a, 0x411111f0 },
1240 [ALC880_FIXUP_LG_LW25] = {
1241 .type = HDA_FIXUP_PINS,
1242 .v.pins = (const struct hda_pintbl[]) {
1243 { 0x1a, 0x0181344f }, /* line-in */
1244 { 0x1b, 0x0321403f }, /* headphone */
1248 [ALC880_FIXUP_W810] = {
1249 .type = HDA_FIXUP_PINS,
1250 .v.pins = (const struct hda_pintbl[]) {
1251 /* disable bogus unused pins */
1252 { 0x17, 0x411111f0 },
1256 .chain_id = ALC880_FIXUP_GPIO2,
1258 [ALC880_FIXUP_EAPD_COEF] = {
1259 .type = HDA_FIXUP_VERBS,
1260 .v.verbs = (const struct hda_verb[]) {
1261 /* change to EAPD mode */
1262 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1263 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1267 [ALC880_FIXUP_TCL_S700] = {
1268 .type = HDA_FIXUP_VERBS,
1269 .v.verbs = (const struct hda_verb[]) {
1270 /* change to EAPD mode */
1271 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1272 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1276 .chain_id = ALC880_FIXUP_GPIO2,
1278 [ALC880_FIXUP_VOL_KNOB] = {
1279 .type = HDA_FIXUP_FUNC,
1280 .v.func = alc880_fixup_vol_knob,
1282 [ALC880_FIXUP_FUJITSU] = {
1283 /* override all pins as BIOS on old Amilo is broken */
1284 .type = HDA_FIXUP_PINS,
1285 .v.pins = (const struct hda_pintbl[]) {
1286 { 0x14, 0x0121401f }, /* HP */
1287 { 0x15, 0x99030120 }, /* speaker */
1288 { 0x16, 0x99030130 }, /* bass speaker */
1289 { 0x17, 0x411111f0 }, /* N/A */
1290 { 0x18, 0x411111f0 }, /* N/A */
1291 { 0x19, 0x01a19950 }, /* mic-in */
1292 { 0x1a, 0x411111f0 }, /* N/A */
1293 { 0x1b, 0x411111f0 }, /* N/A */
1294 { 0x1c, 0x411111f0 }, /* N/A */
1295 { 0x1d, 0x411111f0 }, /* N/A */
1296 { 0x1e, 0x01454140 }, /* SPDIF out */
1300 .chain_id = ALC880_FIXUP_VOL_KNOB,
1302 [ALC880_FIXUP_F1734] = {
1303 /* almost compatible with FUJITSU, but no bass and SPDIF */
1304 .type = HDA_FIXUP_PINS,
1305 .v.pins = (const struct hda_pintbl[]) {
1306 { 0x14, 0x0121401f }, /* HP */
1307 { 0x15, 0x99030120 }, /* speaker */
1308 { 0x16, 0x411111f0 }, /* N/A */
1309 { 0x17, 0x411111f0 }, /* N/A */
1310 { 0x18, 0x411111f0 }, /* N/A */
1311 { 0x19, 0x01a19950 }, /* mic-in */
1312 { 0x1a, 0x411111f0 }, /* N/A */
1313 { 0x1b, 0x411111f0 }, /* N/A */
1314 { 0x1c, 0x411111f0 }, /* N/A */
1315 { 0x1d, 0x411111f0 }, /* N/A */
1316 { 0x1e, 0x411111f0 }, /* N/A */
1320 .chain_id = ALC880_FIXUP_VOL_KNOB,
1322 [ALC880_FIXUP_UNIWILL] = {
1323 /* need to fix HP and speaker pins to be parsed correctly */
1324 .type = HDA_FIXUP_PINS,
1325 .v.pins = (const struct hda_pintbl[]) {
1326 { 0x14, 0x0121411f }, /* HP */
1327 { 0x15, 0x99030120 }, /* speaker */
1328 { 0x16, 0x99030130 }, /* bass speaker */
1332 [ALC880_FIXUP_UNIWILL_DIG] = {
1333 .type = HDA_FIXUP_PINS,
1334 .v.pins = (const struct hda_pintbl[]) {
1335 /* disable bogus unused pins */
1336 { 0x17, 0x411111f0 },
1337 { 0x19, 0x411111f0 },
1338 { 0x1b, 0x411111f0 },
1339 { 0x1f, 0x411111f0 },
1343 [ALC880_FIXUP_Z71V] = {
1344 .type = HDA_FIXUP_PINS,
1345 .v.pins = (const struct hda_pintbl[]) {
1346 /* set up the whole pins as BIOS is utterly broken */
1347 { 0x14, 0x99030120 }, /* speaker */
1348 { 0x15, 0x0121411f }, /* HP */
1349 { 0x16, 0x411111f0 }, /* N/A */
1350 { 0x17, 0x411111f0 }, /* N/A */
1351 { 0x18, 0x01a19950 }, /* mic-in */
1352 { 0x19, 0x411111f0 }, /* N/A */
1353 { 0x1a, 0x01813031 }, /* line-in */
1354 { 0x1b, 0x411111f0 }, /* N/A */
1355 { 0x1c, 0x411111f0 }, /* N/A */
1356 { 0x1d, 0x411111f0 }, /* N/A */
1357 { 0x1e, 0x0144111e }, /* SPDIF */
1361 [ALC880_FIXUP_ASUS_W5A] = {
1362 .type = HDA_FIXUP_PINS,
1363 .v.pins = (const struct hda_pintbl[]) {
1364 /* set up the whole pins as BIOS is utterly broken */
1365 { 0x14, 0x0121411f }, /* HP */
1366 { 0x15, 0x411111f0 }, /* N/A */
1367 { 0x16, 0x411111f0 }, /* N/A */
1368 { 0x17, 0x411111f0 }, /* N/A */
1369 { 0x18, 0x90a60160 }, /* mic */
1370 { 0x19, 0x411111f0 }, /* N/A */
1371 { 0x1a, 0x411111f0 }, /* N/A */
1372 { 0x1b, 0x411111f0 }, /* N/A */
1373 { 0x1c, 0x411111f0 }, /* N/A */
1374 { 0x1d, 0x411111f0 }, /* N/A */
1375 { 0x1e, 0xb743111e }, /* SPDIF out */
1379 .chain_id = ALC880_FIXUP_GPIO1,
1381 [ALC880_FIXUP_3ST_BASE] = {
1382 .type = HDA_FIXUP_PINS,
1383 .v.pins = (const struct hda_pintbl[]) {
1384 { 0x14, 0x01014010 }, /* line-out */
1385 { 0x15, 0x411111f0 }, /* N/A */
1386 { 0x16, 0x411111f0 }, /* N/A */
1387 { 0x17, 0x411111f0 }, /* N/A */
1388 { 0x18, 0x01a19c30 }, /* mic-in */
1389 { 0x19, 0x0121411f }, /* HP */
1390 { 0x1a, 0x01813031 }, /* line-in */
1391 { 0x1b, 0x02a19c40 }, /* front-mic */
1392 { 0x1c, 0x411111f0 }, /* N/A */
1393 { 0x1d, 0x411111f0 }, /* N/A */
1394 /* 0x1e is filled in below */
1395 { 0x1f, 0x411111f0 }, /* N/A */
1399 [ALC880_FIXUP_3ST] = {
1400 .type = HDA_FIXUP_PINS,
1401 .v.pins = (const struct hda_pintbl[]) {
1402 { 0x1e, 0x411111f0 }, /* N/A */
1406 .chain_id = ALC880_FIXUP_3ST_BASE,
1408 [ALC880_FIXUP_3ST_DIG] = {
1409 .type = HDA_FIXUP_PINS,
1410 .v.pins = (const struct hda_pintbl[]) {
1411 { 0x1e, 0x0144111e }, /* SPDIF */
1415 .chain_id = ALC880_FIXUP_3ST_BASE,
1417 [ALC880_FIXUP_5ST_BASE] = {
1418 .type = HDA_FIXUP_PINS,
1419 .v.pins = (const struct hda_pintbl[]) {
1420 { 0x14, 0x01014010 }, /* front */
1421 { 0x15, 0x411111f0 }, /* N/A */
1422 { 0x16, 0x01011411 }, /* CLFE */
1423 { 0x17, 0x01016412 }, /* surr */
1424 { 0x18, 0x01a19c30 }, /* mic-in */
1425 { 0x19, 0x0121411f }, /* HP */
1426 { 0x1a, 0x01813031 }, /* line-in */
1427 { 0x1b, 0x02a19c40 }, /* front-mic */
1428 { 0x1c, 0x411111f0 }, /* N/A */
1429 { 0x1d, 0x411111f0 }, /* N/A */
1430 /* 0x1e is filled in below */
1431 { 0x1f, 0x411111f0 }, /* N/A */
1435 [ALC880_FIXUP_5ST] = {
1436 .type = HDA_FIXUP_PINS,
1437 .v.pins = (const struct hda_pintbl[]) {
1438 { 0x1e, 0x411111f0 }, /* N/A */
1442 .chain_id = ALC880_FIXUP_5ST_BASE,
1444 [ALC880_FIXUP_5ST_DIG] = {
1445 .type = HDA_FIXUP_PINS,
1446 .v.pins = (const struct hda_pintbl[]) {
1447 { 0x1e, 0x0144111e }, /* SPDIF */
1451 .chain_id = ALC880_FIXUP_5ST_BASE,
1453 [ALC880_FIXUP_6ST_BASE] = {
1454 .type = HDA_FIXUP_PINS,
1455 .v.pins = (const struct hda_pintbl[]) {
1456 { 0x14, 0x01014010 }, /* front */
1457 { 0x15, 0x01016412 }, /* surr */
1458 { 0x16, 0x01011411 }, /* CLFE */
1459 { 0x17, 0x01012414 }, /* side */
1460 { 0x18, 0x01a19c30 }, /* mic-in */
1461 { 0x19, 0x02a19c40 }, /* front-mic */
1462 { 0x1a, 0x01813031 }, /* line-in */
1463 { 0x1b, 0x0121411f }, /* HP */
1464 { 0x1c, 0x411111f0 }, /* N/A */
1465 { 0x1d, 0x411111f0 }, /* N/A */
1466 /* 0x1e is filled in below */
1467 { 0x1f, 0x411111f0 }, /* N/A */
1471 [ALC880_FIXUP_6ST] = {
1472 .type = HDA_FIXUP_PINS,
1473 .v.pins = (const struct hda_pintbl[]) {
1474 { 0x1e, 0x411111f0 }, /* N/A */
1478 .chain_id = ALC880_FIXUP_6ST_BASE,
1480 [ALC880_FIXUP_6ST_DIG] = {
1481 .type = HDA_FIXUP_PINS,
1482 .v.pins = (const struct hda_pintbl[]) {
1483 { 0x1e, 0x0144111e }, /* SPDIF */
1487 .chain_id = ALC880_FIXUP_6ST_BASE,
1489 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1490 .type = HDA_FIXUP_PINS,
1491 .v.pins = (const struct hda_pintbl[]) {
1492 { 0x1b, 0x0121401f }, /* HP with jack detect */
1495 .chained_before = true,
1496 .chain_id = ALC880_FIXUP_6ST_BASE,
1500 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1501 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1502 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1503 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1504 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1505 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1506 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1507 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1508 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1509 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1510 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1511 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1512 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1513 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1514 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1515 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1516 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1517 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1518 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1519 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1520 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1521 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1522 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1523 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1525 /* Below is the copied entries from alc880_quirks.c.
1526 * It's not quite sure whether BIOS sets the correct pin-config table
1527 * on these machines, thus they are kept to be compatible with
1528 * the old static quirks. Once when it's confirmed to work without
1529 * these overrides, it'd be better to remove.
1531 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1532 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1533 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1534 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1535 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1536 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1537 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1538 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1539 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1540 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1541 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1542 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1543 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1544 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1545 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1546 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1547 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1548 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1549 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1550 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1551 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1552 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1553 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1554 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1555 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1556 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1557 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1558 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1559 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1560 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1561 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1562 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1563 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1565 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1566 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1567 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1571 static const struct hda_model_fixup alc880_fixup_models[] = {
1572 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1573 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1574 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1575 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1576 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1577 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1578 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1584 * OK, here we have finally the patch for ALC880
1586 static int patch_alc880(struct hda_codec *codec)
1588 struct alc_spec *spec;
1591 err = alc_alloc_spec(codec, 0x0b);
1596 spec->gen.need_dac_fix = 1;
1597 spec->gen.beep_nid = 0x01;
1599 codec->patch_ops.unsol_event = alc880_unsol_event;
1601 alc_pre_init(codec);
1603 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1605 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1607 /* automatic parse from the BIOS config */
1608 err = alc880_parse_auto_config(codec);
1612 if (!spec->gen.no_analog) {
1613 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1618 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1631 static int alc260_parse_auto_config(struct hda_codec *codec)
1633 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1634 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1635 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1642 ALC260_FIXUP_HP_DC5750,
1643 ALC260_FIXUP_HP_PIN_0F,
1646 ALC260_FIXUP_GPIO1_TOGGLE,
1647 ALC260_FIXUP_REPLACER,
1648 ALC260_FIXUP_HP_B1900,
1650 ALC260_FIXUP_FSC_S7020,
1651 ALC260_FIXUP_FSC_S7020_JWSE,
1652 ALC260_FIXUP_VAIO_PINS,
1655 static void alc260_gpio1_automute(struct hda_codec *codec)
1657 struct alc_spec *spec = codec->spec;
1659 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1662 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1663 const struct hda_fixup *fix, int action)
1665 struct alc_spec *spec = codec->spec;
1666 if (action == HDA_FIXUP_ACT_PROBE) {
1667 /* although the machine has only one output pin, we need to
1668 * toggle GPIO1 according to the jack state
1670 spec->gen.automute_hook = alc260_gpio1_automute;
1671 spec->gen.detect_hp = 1;
1672 spec->gen.automute_speaker = 1;
1673 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1674 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1675 snd_hda_gen_hp_automute);
1676 alc_setup_gpio(codec, 0x01);
1680 static void alc260_fixup_kn1(struct hda_codec *codec,
1681 const struct hda_fixup *fix, int action)
1683 struct alc_spec *spec = codec->spec;
1684 static const struct hda_pintbl pincfgs[] = {
1685 { 0x0f, 0x02214000 }, /* HP/speaker */
1686 { 0x12, 0x90a60160 }, /* int mic */
1687 { 0x13, 0x02a19000 }, /* ext mic */
1688 { 0x18, 0x01446000 }, /* SPDIF out */
1689 /* disable bogus I/O pins */
1690 { 0x10, 0x411111f0 },
1691 { 0x11, 0x411111f0 },
1692 { 0x14, 0x411111f0 },
1693 { 0x15, 0x411111f0 },
1694 { 0x16, 0x411111f0 },
1695 { 0x17, 0x411111f0 },
1696 { 0x19, 0x411111f0 },
1701 case HDA_FIXUP_ACT_PRE_PROBE:
1702 snd_hda_apply_pincfgs(codec, pincfgs);
1703 spec->init_amp = ALC_INIT_NONE;
1708 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1709 const struct hda_fixup *fix, int action)
1711 struct alc_spec *spec = codec->spec;
1712 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1713 spec->init_amp = ALC_INIT_NONE;
1716 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1717 const struct hda_fixup *fix, int action)
1719 struct alc_spec *spec = codec->spec;
1720 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1721 spec->gen.add_jack_modes = 1;
1722 spec->gen.hp_mic = 1;
1726 static const struct hda_fixup alc260_fixups[] = {
1727 [ALC260_FIXUP_HP_DC5750] = {
1728 .type = HDA_FIXUP_PINS,
1729 .v.pins = (const struct hda_pintbl[]) {
1730 { 0x11, 0x90130110 }, /* speaker */
1734 [ALC260_FIXUP_HP_PIN_0F] = {
1735 .type = HDA_FIXUP_PINS,
1736 .v.pins = (const struct hda_pintbl[]) {
1737 { 0x0f, 0x01214000 }, /* HP */
1741 [ALC260_FIXUP_COEF] = {
1742 .type = HDA_FIXUP_VERBS,
1743 .v.verbs = (const struct hda_verb[]) {
1744 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1745 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1749 [ALC260_FIXUP_GPIO1] = {
1750 .type = HDA_FIXUP_FUNC,
1751 .v.func = alc_fixup_gpio1,
1753 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1754 .type = HDA_FIXUP_FUNC,
1755 .v.func = alc260_fixup_gpio1_toggle,
1757 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1759 [ALC260_FIXUP_REPLACER] = {
1760 .type = HDA_FIXUP_VERBS,
1761 .v.verbs = (const struct hda_verb[]) {
1762 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1763 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1767 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1769 [ALC260_FIXUP_HP_B1900] = {
1770 .type = HDA_FIXUP_FUNC,
1771 .v.func = alc260_fixup_gpio1_toggle,
1773 .chain_id = ALC260_FIXUP_COEF,
1775 [ALC260_FIXUP_KN1] = {
1776 .type = HDA_FIXUP_FUNC,
1777 .v.func = alc260_fixup_kn1,
1779 [ALC260_FIXUP_FSC_S7020] = {
1780 .type = HDA_FIXUP_FUNC,
1781 .v.func = alc260_fixup_fsc_s7020,
1783 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1784 .type = HDA_FIXUP_FUNC,
1785 .v.func = alc260_fixup_fsc_s7020_jwse,
1787 .chain_id = ALC260_FIXUP_FSC_S7020,
1789 [ALC260_FIXUP_VAIO_PINS] = {
1790 .type = HDA_FIXUP_PINS,
1791 .v.pins = (const struct hda_pintbl[]) {
1792 /* Pin configs are missing completely on some VAIOs */
1793 { 0x0f, 0x01211020 },
1794 { 0x10, 0x0001003f },
1795 { 0x11, 0x411111f0 },
1796 { 0x12, 0x01a15930 },
1797 { 0x13, 0x411111f0 },
1798 { 0x14, 0x411111f0 },
1799 { 0x15, 0x411111f0 },
1800 { 0x16, 0x411111f0 },
1801 { 0x17, 0x411111f0 },
1802 { 0x18, 0x411111f0 },
1803 { 0x19, 0x411111f0 },
1809 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1810 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1811 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1812 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1813 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1814 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1815 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1816 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1817 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1818 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1819 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1820 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1821 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1825 static const struct hda_model_fixup alc260_fixup_models[] = {
1826 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1827 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1828 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1829 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1835 static int patch_alc260(struct hda_codec *codec)
1837 struct alc_spec *spec;
1840 err = alc_alloc_spec(codec, 0x07);
1845 /* as quite a few machines require HP amp for speaker outputs,
1846 * it's easier to enable it unconditionally; even if it's unneeded,
1847 * it's almost harmless.
1849 spec->gen.prefer_hp_amp = 1;
1850 spec->gen.beep_nid = 0x01;
1852 spec->shutup = alc_eapd_shutup;
1854 alc_pre_init(codec);
1856 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1858 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1860 /* automatic parse from the BIOS config */
1861 err = alc260_parse_auto_config(codec);
1865 if (!spec->gen.no_analog) {
1866 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1871 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1882 * ALC882/883/885/888/889 support
1884 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1885 * configuration. Each pin widget can choose any input DACs and a mixer.
1886 * Each ADC is connected from a mixer of all inputs. This makes possible
1887 * 6-channel independent captures.
1889 * In addition, an independent DAC for the multi-playback (not used in this
1897 ALC882_FIXUP_ABIT_AW9D_MAX,
1898 ALC882_FIXUP_LENOVO_Y530,
1899 ALC882_FIXUP_PB_M5210,
1900 ALC882_FIXUP_ACER_ASPIRE_7736,
1901 ALC882_FIXUP_ASUS_W90V,
1903 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1904 ALC889_FIXUP_VAIO_TT,
1905 ALC888_FIXUP_EEE1601,
1909 ALC883_FIXUP_ACER_EAPD,
1914 ALC882_FIXUP_ASUS_W2JC,
1915 ALC882_FIXUP_ACER_ASPIRE_4930G,
1916 ALC882_FIXUP_ACER_ASPIRE_8930G,
1917 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1918 ALC885_FIXUP_MACPRO_GPIO,
1919 ALC889_FIXUP_DAC_ROUTE,
1920 ALC889_FIXUP_MBP_VREF,
1921 ALC889_FIXUP_IMAC91_VREF,
1922 ALC889_FIXUP_MBA11_VREF,
1923 ALC889_FIXUP_MBA21_VREF,
1924 ALC889_FIXUP_MP11_VREF,
1925 ALC889_FIXUP_MP41_VREF,
1926 ALC882_FIXUP_INV_DMIC,
1927 ALC882_FIXUP_NO_PRIMARY_HP,
1928 ALC887_FIXUP_ASUS_BASS,
1929 ALC887_FIXUP_BASS_CHMAP,
1930 ALC1220_FIXUP_GB_DUAL_CODECS,
1931 ALC1220_FIXUP_GB_X570,
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,
1937 ALCS1200A_FIXUP_MIC_VREF,
1940 static void alc889_fixup_coef(struct hda_codec *codec,
1941 const struct hda_fixup *fix, int action)
1943 if (action != HDA_FIXUP_ACT_INIT)
1945 alc_update_coef_idx(codec, 7, 0, 0x2030);
1948 /* set up GPIO at initialization */
1949 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1950 const struct hda_fixup *fix, int action)
1952 struct alc_spec *spec = codec->spec;
1954 spec->gpio_write_delay = true;
1955 alc_fixup_gpio3(codec, fix, action);
1958 /* Fix the connection of some pins for ALC889:
1959 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1960 * work correctly (bko#42740)
1962 static void alc889_fixup_dac_route(struct hda_codec *codec,
1963 const struct hda_fixup *fix, int action)
1965 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1966 /* fake the connections during parsing the tree */
1967 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1968 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1969 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1970 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1971 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1972 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1973 } else if (action == HDA_FIXUP_ACT_PROBE) {
1974 /* restore the connections */
1975 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1976 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1977 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1978 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1979 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1983 /* Set VREF on HP pin */
1984 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1985 const struct hda_fixup *fix, int action)
1987 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1988 struct alc_spec *spec = codec->spec;
1991 if (action != HDA_FIXUP_ACT_INIT)
1993 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1994 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1995 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1997 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1998 val |= AC_PINCTL_VREF_80;
1999 snd_hda_set_pin_ctl(codec, nids[i], val);
2000 spec->gen.keep_vref_in_automute = 1;
2005 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2006 const hda_nid_t *nids, int num_nids)
2008 struct alc_spec *spec = codec->spec;
2011 for (i = 0; i < num_nids; i++) {
2013 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2014 val |= AC_PINCTL_VREF_50;
2015 snd_hda_set_pin_ctl(codec, nids[i], val);
2017 spec->gen.keep_vref_in_automute = 1;
2020 /* Set VREF on speaker pins on imac91 */
2021 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2022 const struct hda_fixup *fix, int action)
2024 static const hda_nid_t nids[] = { 0x18, 0x1a };
2026 if (action == HDA_FIXUP_ACT_INIT)
2027 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2030 /* Set VREF on speaker pins on mba11 */
2031 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2032 const struct hda_fixup *fix, int action)
2034 static const hda_nid_t nids[] = { 0x18 };
2036 if (action == HDA_FIXUP_ACT_INIT)
2037 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2040 /* Set VREF on speaker pins on mba21 */
2041 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2042 const struct hda_fixup *fix, int action)
2044 static const hda_nid_t nids[] = { 0x18, 0x19 };
2046 if (action == HDA_FIXUP_ACT_INIT)
2047 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2050 /* Don't take HP output as primary
2051 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2052 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2054 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2055 const struct hda_fixup *fix, int action)
2057 struct alc_spec *spec = codec->spec;
2058 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2059 spec->gen.no_primary_hp = 1;
2060 spec->gen.no_multi_io = 1;
2064 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2065 const struct hda_fixup *fix, int action);
2067 /* For dual-codec configuration, we need to disable some features to avoid
2068 * conflicts of kctls and PCM streams
2070 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2071 const struct hda_fixup *fix, int action)
2073 struct alc_spec *spec = codec->spec;
2075 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2077 /* disable vmaster */
2078 spec->gen.suppress_vmaster = 1;
2079 /* auto-mute and auto-mic switch don't work with multiple codecs */
2080 spec->gen.suppress_auto_mute = 1;
2081 spec->gen.suppress_auto_mic = 1;
2082 /* disable aamix as well */
2083 spec->gen.mixer_nid = 0;
2084 /* add location prefix to avoid conflicts */
2085 codec->force_pin_prefix = 1;
2088 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2089 const char *newname)
2091 struct snd_kcontrol *kctl;
2093 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2095 strcpy(kctl->id.name, newname);
2098 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2099 const struct hda_fixup *fix,
2102 alc_fixup_dual_codecs(codec, fix, action);
2104 case HDA_FIXUP_ACT_PRE_PROBE:
2105 /* override card longname to provide a unique UCM profile */
2106 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2108 case HDA_FIXUP_ACT_BUILD:
2109 /* rename Capture controls depending on the codec */
2110 rename_ctl(codec, "Capture Volume",
2112 "Rear-Panel Capture Volume" :
2113 "Front-Panel Capture Volume");
2114 rename_ctl(codec, "Capture Switch",
2116 "Rear-Panel Capture Switch" :
2117 "Front-Panel Capture Switch");
2122 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2123 const struct hda_fixup *fix,
2126 static const hda_nid_t conn1[] = { 0x0c };
2127 static const struct coef_fw gb_x570_coefs[] = {
2128 WRITE_COEF(0x07, 0x03c0),
2129 WRITE_COEF(0x1a, 0x01c1),
2130 WRITE_COEF(0x1b, 0x0202),
2131 WRITE_COEF(0x43, 0x3005),
2136 case HDA_FIXUP_ACT_PRE_PROBE:
2137 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2138 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2140 case HDA_FIXUP_ACT_INIT:
2141 alc_process_coef_fw(codec, gb_x570_coefs);
2146 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2147 const struct hda_fixup *fix,
2150 static const hda_nid_t conn1[] = { 0x0c };
2152 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2155 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2156 /* We therefore want to make sure 0x14 (front headphone) and
2157 * 0x1b (speakers) use the stereo DAC 0x02
2159 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2160 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2163 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2164 const struct hda_fixup *fix, int action);
2166 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2167 const struct hda_fixup *fix,
2170 alc1220_fixup_clevo_p950(codec, fix, action);
2171 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2174 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2175 struct hda_jack_callback *jack)
2177 struct alc_spec *spec = codec->spec;
2180 snd_hda_gen_hp_automute(codec, jack);
2182 if (spec->gen.hp_jack_present)
2183 vref = AC_PINCTL_VREF_80;
2185 vref = AC_PINCTL_VREF_HIZ;
2186 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2189 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2190 const struct hda_fixup *fix, int action)
2192 struct alc_spec *spec = codec->spec;
2193 if (action != HDA_FIXUP_ACT_PROBE)
2195 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2196 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2199 static const struct hda_fixup alc882_fixups[] = {
2200 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2201 .type = HDA_FIXUP_PINS,
2202 .v.pins = (const struct hda_pintbl[]) {
2203 { 0x15, 0x01080104 }, /* side */
2204 { 0x16, 0x01011012 }, /* rear */
2205 { 0x17, 0x01016011 }, /* clfe */
2209 [ALC882_FIXUP_LENOVO_Y530] = {
2210 .type = HDA_FIXUP_PINS,
2211 .v.pins = (const struct hda_pintbl[]) {
2212 { 0x15, 0x99130112 }, /* rear int speakers */
2213 { 0x16, 0x99130111 }, /* subwoofer */
2217 [ALC882_FIXUP_PB_M5210] = {
2218 .type = HDA_FIXUP_PINCTLS,
2219 .v.pins = (const struct hda_pintbl[]) {
2220 { 0x19, PIN_VREF50 },
2224 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2225 .type = HDA_FIXUP_FUNC,
2226 .v.func = alc_fixup_sku_ignore,
2228 [ALC882_FIXUP_ASUS_W90V] = {
2229 .type = HDA_FIXUP_PINS,
2230 .v.pins = (const struct hda_pintbl[]) {
2231 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2235 [ALC889_FIXUP_CD] = {
2236 .type = HDA_FIXUP_PINS,
2237 .v.pins = (const struct hda_pintbl[]) {
2238 { 0x1c, 0x993301f0 }, /* CD */
2242 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2243 .type = HDA_FIXUP_PINS,
2244 .v.pins = (const struct hda_pintbl[]) {
2245 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2249 .chain_id = ALC889_FIXUP_CD,
2251 [ALC889_FIXUP_VAIO_TT] = {
2252 .type = HDA_FIXUP_PINS,
2253 .v.pins = (const struct hda_pintbl[]) {
2254 { 0x17, 0x90170111 }, /* hidden surround speaker */
2258 [ALC888_FIXUP_EEE1601] = {
2259 .type = HDA_FIXUP_VERBS,
2260 .v.verbs = (const struct hda_verb[]) {
2261 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2262 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2266 [ALC886_FIXUP_EAPD] = {
2267 .type = HDA_FIXUP_VERBS,
2268 .v.verbs = (const struct hda_verb[]) {
2269 /* change to EAPD mode */
2270 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2271 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2275 [ALC882_FIXUP_EAPD] = {
2276 .type = HDA_FIXUP_VERBS,
2277 .v.verbs = (const struct hda_verb[]) {
2278 /* change to EAPD mode */
2279 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2280 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2284 [ALC883_FIXUP_EAPD] = {
2285 .type = HDA_FIXUP_VERBS,
2286 .v.verbs = (const struct hda_verb[]) {
2287 /* change to EAPD mode */
2288 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2289 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2293 [ALC883_FIXUP_ACER_EAPD] = {
2294 .type = HDA_FIXUP_VERBS,
2295 .v.verbs = (const struct hda_verb[]) {
2296 /* eanable EAPD on Acer laptops */
2297 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2298 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2302 [ALC882_FIXUP_GPIO1] = {
2303 .type = HDA_FIXUP_FUNC,
2304 .v.func = alc_fixup_gpio1,
2306 [ALC882_FIXUP_GPIO2] = {
2307 .type = HDA_FIXUP_FUNC,
2308 .v.func = alc_fixup_gpio2,
2310 [ALC882_FIXUP_GPIO3] = {
2311 .type = HDA_FIXUP_FUNC,
2312 .v.func = alc_fixup_gpio3,
2314 [ALC882_FIXUP_ASUS_W2JC] = {
2315 .type = HDA_FIXUP_FUNC,
2316 .v.func = alc_fixup_gpio1,
2318 .chain_id = ALC882_FIXUP_EAPD,
2320 [ALC889_FIXUP_COEF] = {
2321 .type = HDA_FIXUP_FUNC,
2322 .v.func = alc889_fixup_coef,
2324 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2325 .type = HDA_FIXUP_PINS,
2326 .v.pins = (const struct hda_pintbl[]) {
2327 { 0x16, 0x99130111 }, /* CLFE speaker */
2328 { 0x17, 0x99130112 }, /* surround speaker */
2332 .chain_id = ALC882_FIXUP_GPIO1,
2334 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2335 .type = HDA_FIXUP_PINS,
2336 .v.pins = (const struct hda_pintbl[]) {
2337 { 0x16, 0x99130111 }, /* CLFE speaker */
2338 { 0x1b, 0x99130112 }, /* surround speaker */
2342 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2344 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2345 /* additional init verbs for Acer Aspire 8930G */
2346 .type = HDA_FIXUP_VERBS,
2347 .v.verbs = (const struct hda_verb[]) {
2348 /* Enable all DACs */
2349 /* DAC DISABLE/MUTE 1? */
2350 /* setting bits 1-5 disables DAC nids 0x02-0x06
2351 * apparently. Init=0x38 */
2352 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2353 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2354 /* DAC DISABLE/MUTE 2? */
2355 /* some bit here disables the other DACs.
2357 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2358 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2360 * This laptop has a stereo digital microphone.
2361 * The mics are only 1cm apart which makes the stereo
2362 * useless. However, either the mic or the ALC889
2363 * makes the signal become a difference/sum signal
2364 * instead of standard stereo, which is annoying.
2365 * So instead we flip this bit which makes the
2366 * codec replicate the sum signal to both channels,
2367 * turning it into a normal mono mic.
2369 /* DMIC_CONTROL? Init value = 0x0001 */
2370 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2371 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2372 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2373 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2377 .chain_id = ALC882_FIXUP_GPIO1,
2379 [ALC885_FIXUP_MACPRO_GPIO] = {
2380 .type = HDA_FIXUP_FUNC,
2381 .v.func = alc885_fixup_macpro_gpio,
2383 [ALC889_FIXUP_DAC_ROUTE] = {
2384 .type = HDA_FIXUP_FUNC,
2385 .v.func = alc889_fixup_dac_route,
2387 [ALC889_FIXUP_MBP_VREF] = {
2388 .type = HDA_FIXUP_FUNC,
2389 .v.func = alc889_fixup_mbp_vref,
2391 .chain_id = ALC882_FIXUP_GPIO1,
2393 [ALC889_FIXUP_IMAC91_VREF] = {
2394 .type = HDA_FIXUP_FUNC,
2395 .v.func = alc889_fixup_imac91_vref,
2397 .chain_id = ALC882_FIXUP_GPIO1,
2399 [ALC889_FIXUP_MBA11_VREF] = {
2400 .type = HDA_FIXUP_FUNC,
2401 .v.func = alc889_fixup_mba11_vref,
2403 .chain_id = ALC889_FIXUP_MBP_VREF,
2405 [ALC889_FIXUP_MBA21_VREF] = {
2406 .type = HDA_FIXUP_FUNC,
2407 .v.func = alc889_fixup_mba21_vref,
2409 .chain_id = ALC889_FIXUP_MBP_VREF,
2411 [ALC889_FIXUP_MP11_VREF] = {
2412 .type = HDA_FIXUP_FUNC,
2413 .v.func = alc889_fixup_mba11_vref,
2415 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2417 [ALC889_FIXUP_MP41_VREF] = {
2418 .type = HDA_FIXUP_FUNC,
2419 .v.func = alc889_fixup_mbp_vref,
2421 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2423 [ALC882_FIXUP_INV_DMIC] = {
2424 .type = HDA_FIXUP_FUNC,
2425 .v.func = alc_fixup_inv_dmic,
2427 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2428 .type = HDA_FIXUP_FUNC,
2429 .v.func = alc882_fixup_no_primary_hp,
2431 [ALC887_FIXUP_ASUS_BASS] = {
2432 .type = HDA_FIXUP_PINS,
2433 .v.pins = (const struct hda_pintbl[]) {
2434 {0x16, 0x99130130}, /* bass speaker */
2438 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2440 [ALC887_FIXUP_BASS_CHMAP] = {
2441 .type = HDA_FIXUP_FUNC,
2442 .v.func = alc_fixup_bass_chmap,
2444 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2445 .type = HDA_FIXUP_FUNC,
2446 .v.func = alc1220_fixup_gb_dual_codecs,
2448 [ALC1220_FIXUP_GB_X570] = {
2449 .type = HDA_FIXUP_FUNC,
2450 .v.func = alc1220_fixup_gb_x570,
2452 [ALC1220_FIXUP_CLEVO_P950] = {
2453 .type = HDA_FIXUP_FUNC,
2454 .v.func = alc1220_fixup_clevo_p950,
2456 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2457 .type = HDA_FIXUP_FUNC,
2458 .v.func = alc1220_fixup_clevo_pb51ed,
2460 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2461 .type = HDA_FIXUP_PINS,
2462 .v.pins = (const struct hda_pintbl[]) {
2463 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2467 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2469 [ALC887_FIXUP_ASUS_AUDIO] = {
2470 .type = HDA_FIXUP_PINS,
2471 .v.pins = (const struct hda_pintbl[]) {
2472 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2473 { 0x19, 0x22219420 },
2477 [ALC887_FIXUP_ASUS_HMIC] = {
2478 .type = HDA_FIXUP_FUNC,
2479 .v.func = alc887_fixup_asus_jack,
2481 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2483 [ALCS1200A_FIXUP_MIC_VREF] = {
2484 .type = HDA_FIXUP_PINCTLS,
2485 .v.pins = (const struct hda_pintbl[]) {
2486 { 0x18, PIN_VREF50 }, /* rear mic */
2487 { 0x19, PIN_VREF50 }, /* front mic */
2493 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2494 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2495 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2496 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2497 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2498 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2499 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2500 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2501 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2502 ALC882_FIXUP_ACER_ASPIRE_4930G),
2503 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2504 ALC882_FIXUP_ACER_ASPIRE_4930G),
2505 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2506 ALC882_FIXUP_ACER_ASPIRE_8930G),
2507 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2508 ALC882_FIXUP_ACER_ASPIRE_8930G),
2509 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2510 ALC882_FIXUP_ACER_ASPIRE_4930G),
2511 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2512 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2513 ALC882_FIXUP_ACER_ASPIRE_4930G),
2514 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2515 ALC882_FIXUP_ACER_ASPIRE_4930G),
2516 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2517 ALC882_FIXUP_ACER_ASPIRE_4930G),
2518 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2519 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2520 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2521 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2522 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2523 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2524 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2525 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2526 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2527 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2528 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2529 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2530 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2531 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2532 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2533 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2535 /* All Apple entries are in codec SSIDs */
2536 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2537 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2538 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2539 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2540 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2541 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2542 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2543 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2544 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2545 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2546 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2547 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2548 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2549 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2550 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2551 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2552 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2553 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2554 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2555 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2556 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2557 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2559 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2560 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2561 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2562 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2563 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2564 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2565 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2566 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2567 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2568 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2569 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2570 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2571 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2572 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2573 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2574 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2575 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2576 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2577 SND_PCI_QUIRK(0x1558, 0x3702, "Clevo X370SN[VW]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2578 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2579 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2580 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2581 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2582 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2583 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2584 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2585 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2586 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2587 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2588 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2589 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2590 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2591 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2592 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2593 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2594 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2595 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2596 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2597 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2598 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2599 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2600 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2601 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2602 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2603 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2604 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2605 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2606 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2607 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2608 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2612 static const struct hda_model_fixup alc882_fixup_models[] = {
2613 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2614 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2615 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2616 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2617 {.id = ALC889_FIXUP_CD, .name = "cd"},
2618 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2619 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2620 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2621 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2622 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2623 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2624 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2625 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2626 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2627 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2628 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2629 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2630 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2631 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2632 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2633 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2634 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2635 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2636 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2637 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2638 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2639 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2640 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2641 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2642 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2643 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2644 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2648 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2649 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2657 {0x1e, 0x01456130}),
2658 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2666 {0x1e, 0x01451130}),
2671 * BIOS auto configuration
2673 /* almost identical with ALC880 parser... */
2674 static int alc882_parse_auto_config(struct hda_codec *codec)
2676 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2677 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2678 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2683 static int patch_alc882(struct hda_codec *codec)
2685 struct alc_spec *spec;
2688 err = alc_alloc_spec(codec, 0x0b);
2694 switch (codec->core.vendor_id) {
2702 /* ALC883 and variants */
2703 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2707 alc_pre_init(codec);
2709 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2711 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2712 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2714 alc_auto_parse_customize_define(codec);
2716 if (has_cdefine_beep(codec))
2717 spec->gen.beep_nid = 0x01;
2719 /* automatic parse from the BIOS config */
2720 err = alc882_parse_auto_config(codec);
2724 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2725 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2730 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2743 static int alc262_parse_auto_config(struct hda_codec *codec)
2745 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2746 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2747 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2754 ALC262_FIXUP_FSC_H270,
2755 ALC262_FIXUP_FSC_S7110,
2756 ALC262_FIXUP_HP_Z200,
2758 ALC262_FIXUP_LENOVO_3000,
2760 ALC262_FIXUP_BENQ_T31,
2761 ALC262_FIXUP_INV_DMIC,
2762 ALC262_FIXUP_INTEL_BAYLEYBAY,
2765 static const struct hda_fixup alc262_fixups[] = {
2766 [ALC262_FIXUP_FSC_H270] = {
2767 .type = HDA_FIXUP_PINS,
2768 .v.pins = (const struct hda_pintbl[]) {
2769 { 0x14, 0x99130110 }, /* speaker */
2770 { 0x15, 0x0221142f }, /* front HP */
2771 { 0x1b, 0x0121141f }, /* rear HP */
2775 [ALC262_FIXUP_FSC_S7110] = {
2776 .type = HDA_FIXUP_PINS,
2777 .v.pins = (const struct hda_pintbl[]) {
2778 { 0x15, 0x90170110 }, /* speaker */
2782 .chain_id = ALC262_FIXUP_BENQ,
2784 [ALC262_FIXUP_HP_Z200] = {
2785 .type = HDA_FIXUP_PINS,
2786 .v.pins = (const struct hda_pintbl[]) {
2787 { 0x16, 0x99130120 }, /* internal speaker */
2791 [ALC262_FIXUP_TYAN] = {
2792 .type = HDA_FIXUP_PINS,
2793 .v.pins = (const struct hda_pintbl[]) {
2794 { 0x14, 0x1993e1f0 }, /* int AUX */
2798 [ALC262_FIXUP_LENOVO_3000] = {
2799 .type = HDA_FIXUP_PINCTLS,
2800 .v.pins = (const struct hda_pintbl[]) {
2801 { 0x19, PIN_VREF50 },
2805 .chain_id = ALC262_FIXUP_BENQ,
2807 [ALC262_FIXUP_BENQ] = {
2808 .type = HDA_FIXUP_VERBS,
2809 .v.verbs = (const struct hda_verb[]) {
2810 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2811 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2815 [ALC262_FIXUP_BENQ_T31] = {
2816 .type = HDA_FIXUP_VERBS,
2817 .v.verbs = (const struct hda_verb[]) {
2818 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2819 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2823 [ALC262_FIXUP_INV_DMIC] = {
2824 .type = HDA_FIXUP_FUNC,
2825 .v.func = alc_fixup_inv_dmic,
2827 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2828 .type = HDA_FIXUP_FUNC,
2829 .v.func = alc_fixup_no_depop_delay,
2833 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2834 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2835 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2836 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2837 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2838 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2839 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2840 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2841 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2842 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2843 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2847 static const struct hda_model_fixup alc262_fixup_models[] = {
2848 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2849 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2850 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2851 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2852 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2853 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2854 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2855 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2856 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2862 static int patch_alc262(struct hda_codec *codec)
2864 struct alc_spec *spec;
2867 err = alc_alloc_spec(codec, 0x0b);
2872 spec->gen.shared_mic_vref_pin = 0x18;
2874 spec->shutup = alc_eapd_shutup;
2877 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2880 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2882 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2884 alc_pre_init(codec);
2886 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2888 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2890 alc_auto_parse_customize_define(codec);
2892 if (has_cdefine_beep(codec))
2893 spec->gen.beep_nid = 0x01;
2895 /* automatic parse from the BIOS config */
2896 err = alc262_parse_auto_config(codec);
2900 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2901 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2906 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2918 /* bind Beep switches of both NID 0x0f and 0x10 */
2919 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2920 struct snd_ctl_elem_value *ucontrol)
2922 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2926 mutex_lock(&codec->control_mutex);
2927 pval = kcontrol->private_value;
2928 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2929 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2931 kcontrol->private_value = (pval & ~0xff) | 0x10;
2932 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2934 kcontrol->private_value = pval;
2935 mutex_unlock(&codec->control_mutex);
2939 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2940 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2942 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2943 .name = "Beep Playback Switch",
2944 .subdevice = HDA_SUBDEV_AMP_FLAG,
2945 .info = snd_hda_mixer_amp_switch_info,
2946 .get = snd_hda_mixer_amp_switch_get,
2947 .put = alc268_beep_switch_put,
2948 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2952 /* set PCBEEP vol = 0, mute connections */
2953 static const struct hda_verb alc268_beep_init_verbs[] = {
2954 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2955 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2956 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2961 ALC268_FIXUP_INV_DMIC,
2962 ALC268_FIXUP_HP_EAPD,
2966 static const struct hda_fixup alc268_fixups[] = {
2967 [ALC268_FIXUP_INV_DMIC] = {
2968 .type = HDA_FIXUP_FUNC,
2969 .v.func = alc_fixup_inv_dmic,
2971 [ALC268_FIXUP_HP_EAPD] = {
2972 .type = HDA_FIXUP_VERBS,
2973 .v.verbs = (const struct hda_verb[]) {
2974 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2978 [ALC268_FIXUP_SPDIF] = {
2979 .type = HDA_FIXUP_PINS,
2980 .v.pins = (const struct hda_pintbl[]) {
2981 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2987 static const struct hda_model_fixup alc268_fixup_models[] = {
2988 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2989 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2990 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2994 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2995 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2996 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2997 /* below is codec SSID since multiple Toshiba laptops have the
2998 * same PCI SSID 1179:ff00
3000 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3005 * BIOS auto configuration
3007 static int alc268_parse_auto_config(struct hda_codec *codec)
3009 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3010 return alc_parse_auto_config(codec, NULL, alc268_ssids);
3015 static int patch_alc268(struct hda_codec *codec)
3017 struct alc_spec *spec;
3020 /* ALC268 has no aa-loopback mixer */
3021 err = alc_alloc_spec(codec, 0);
3026 if (has_cdefine_beep(codec))
3027 spec->gen.beep_nid = 0x01;
3029 spec->shutup = alc_eapd_shutup;
3031 alc_pre_init(codec);
3033 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3034 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3036 /* automatic parse from the BIOS config */
3037 err = alc268_parse_auto_config(codec);
3041 if (err > 0 && !spec->gen.no_analog &&
3042 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3043 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3044 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3045 &alc268_beep_mixer[i])) {
3050 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3051 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3052 /* override the amp caps for beep generator */
3053 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3054 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3055 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3056 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3057 (0 << AC_AMPCAP_MUTE_SHIFT));
3060 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3073 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3074 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3077 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3078 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3081 /* different alc269-variants */
3083 ALC269_TYPE_ALC269VA,
3084 ALC269_TYPE_ALC269VB,
3085 ALC269_TYPE_ALC269VC,
3086 ALC269_TYPE_ALC269VD,
3106 * BIOS auto configuration
3108 static int alc269_parse_auto_config(struct hda_codec *codec)
3110 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3111 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3112 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3113 struct alc_spec *spec = codec->spec;
3114 const hda_nid_t *ssids;
3116 switch (spec->codec_variant) {
3117 case ALC269_TYPE_ALC269VA:
3118 case ALC269_TYPE_ALC269VC:
3119 case ALC269_TYPE_ALC280:
3120 case ALC269_TYPE_ALC284:
3121 case ALC269_TYPE_ALC293:
3122 ssids = alc269va_ssids;
3124 case ALC269_TYPE_ALC269VB:
3125 case ALC269_TYPE_ALC269VD:
3126 case ALC269_TYPE_ALC282:
3127 case ALC269_TYPE_ALC283:
3128 case ALC269_TYPE_ALC286:
3129 case ALC269_TYPE_ALC298:
3130 case ALC269_TYPE_ALC255:
3131 case ALC269_TYPE_ALC256:
3132 case ALC269_TYPE_ALC257:
3133 case ALC269_TYPE_ALC215:
3134 case ALC269_TYPE_ALC225:
3135 case ALC269_TYPE_ALC294:
3136 case ALC269_TYPE_ALC300:
3137 case ALC269_TYPE_ALC623:
3138 case ALC269_TYPE_ALC700:
3139 ssids = alc269_ssids;
3142 ssids = alc269_ssids;
3146 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3149 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3150 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3151 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3152 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3153 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3157 static void alc_headset_btn_callback(struct hda_codec *codec,
3158 struct hda_jack_callback *jack)
3162 if (jack->unsol_res & (7 << 13))
3163 report |= SND_JACK_BTN_0;
3165 if (jack->unsol_res & (1 << 16 | 3 << 8))
3166 report |= SND_JACK_BTN_1;
3169 if (jack->unsol_res & (7 << 23))
3170 report |= SND_JACK_BTN_2;
3172 /* Volume down key */
3173 if (jack->unsol_res & (7 << 10))
3174 report |= SND_JACK_BTN_3;
3176 jack->jack->button_state = report;
3179 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3181 struct alc_spec *spec = codec->spec;
3183 if (!spec->has_hs_key)
3186 switch (codec->core.vendor_id) {
3194 alc_write_coef_idx(codec, 0x48, 0x0);
3195 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3196 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3202 alc_write_coef_idx(codec, 0x48, 0x0);
3203 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3208 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3210 struct alc_spec *spec = codec->spec;
3212 if (!spec->has_hs_key)
3215 switch (codec->core.vendor_id) {
3223 alc_write_coef_idx(codec, 0x48, 0xd011);
3224 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3225 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3231 alc_write_coef_idx(codec, 0x48, 0xd011);
3232 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3237 static void alc_fixup_headset_jack(struct hda_codec *codec,
3238 const struct hda_fixup *fix, int action)
3240 struct alc_spec *spec = codec->spec;
3243 case HDA_FIXUP_ACT_PRE_PROBE:
3244 spec->has_hs_key = 1;
3245 snd_hda_jack_detect_enable_callback(codec, 0x55,
3246 alc_headset_btn_callback);
3247 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
3248 SND_JACK_HEADSET, alc_headset_btn_keymap);
3250 case HDA_FIXUP_ACT_INIT:
3251 alc_enable_headset_jack_key(codec);
3256 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3258 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3261 static void alc269_shutup(struct hda_codec *codec)
3263 struct alc_spec *spec = codec->spec;
3265 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3266 alc269vb_toggle_power_output(codec, 0);
3267 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3268 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3271 alc_shutup_pins(codec);
3274 static const struct coef_fw alc282_coefs[] = {
3275 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3276 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3277 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3278 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3279 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3280 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3281 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3282 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3283 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3284 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3285 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3286 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3287 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3288 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3289 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3290 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3291 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3292 WRITE_COEF(0x63, 0x2902), /* PLL */
3293 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3294 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3295 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3296 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3297 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3298 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3299 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3300 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3301 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3302 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3303 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3307 static void alc282_restore_default_value(struct hda_codec *codec)
3309 alc_process_coef_fw(codec, alc282_coefs);
3312 static void alc282_init(struct hda_codec *codec)
3314 struct alc_spec *spec = codec->spec;
3315 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3319 alc282_restore_default_value(codec);
3323 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3324 coef78 = alc_read_coef_idx(codec, 0x78);
3326 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3327 /* Headphone capless set to high power mode */
3328 alc_write_coef_idx(codec, 0x78, 0x9004);
3333 snd_hda_codec_write(codec, hp_pin, 0,
3334 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3339 snd_hda_codec_write(codec, hp_pin, 0,
3340 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3345 /* Headphone capless set to normal mode */
3346 alc_write_coef_idx(codec, 0x78, coef78);
3349 static void alc282_shutup(struct hda_codec *codec)
3351 struct alc_spec *spec = codec->spec;
3352 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3357 alc269_shutup(codec);
3361 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3362 coef78 = alc_read_coef_idx(codec, 0x78);
3363 alc_write_coef_idx(codec, 0x78, 0x9004);
3368 snd_hda_codec_write(codec, hp_pin, 0,
3369 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3374 if (!spec->no_shutup_pins)
3375 snd_hda_codec_write(codec, hp_pin, 0,
3376 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3381 alc_auto_setup_eapd(codec, false);
3382 alc_shutup_pins(codec);
3383 alc_write_coef_idx(codec, 0x78, coef78);
3386 static const struct coef_fw alc283_coefs[] = {
3387 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3388 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3389 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3390 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3391 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3392 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3393 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3394 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3395 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3396 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3397 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3398 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3399 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3400 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3401 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3402 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3403 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3404 WRITE_COEF(0x2e, 0x2902), /* PLL */
3405 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3406 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3407 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3408 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3409 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3410 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3411 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3412 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3413 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3414 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3415 WRITE_COEF(0x49, 0x0), /* test mode */
3416 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3417 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3418 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3419 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3423 static void alc283_restore_default_value(struct hda_codec *codec)
3425 alc_process_coef_fw(codec, alc283_coefs);
3428 static void alc283_init(struct hda_codec *codec)
3430 struct alc_spec *spec = codec->spec;
3431 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3434 alc283_restore_default_value(codec);
3440 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3442 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3443 /* Headphone capless set to high power mode */
3444 alc_write_coef_idx(codec, 0x43, 0x9004);
3446 snd_hda_codec_write(codec, hp_pin, 0,
3447 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3452 snd_hda_codec_write(codec, hp_pin, 0,
3453 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3457 /* Index 0x46 Combo jack auto switch control 2 */
3458 /* 3k pull low control for Headset jack. */
3459 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3460 /* Headphone capless set to normal mode */
3461 alc_write_coef_idx(codec, 0x43, 0x9614);
3464 static void alc283_shutup(struct hda_codec *codec)
3466 struct alc_spec *spec = codec->spec;
3467 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3471 alc269_shutup(codec);
3475 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3477 alc_write_coef_idx(codec, 0x43, 0x9004);
3479 /*depop hp during suspend*/
3480 alc_write_coef_idx(codec, 0x06, 0x2100);
3482 snd_hda_codec_write(codec, hp_pin, 0,
3483 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3488 if (!spec->no_shutup_pins)
3489 snd_hda_codec_write(codec, hp_pin, 0,
3490 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3492 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3496 alc_auto_setup_eapd(codec, false);
3497 alc_shutup_pins(codec);
3498 alc_write_coef_idx(codec, 0x43, 0x9614);
3501 static void alc256_init(struct hda_codec *codec)
3503 struct alc_spec *spec = codec->spec;
3504 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3507 if (spec->ultra_low_power) {
3508 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3509 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3510 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3511 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3512 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3521 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3526 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3528 snd_hda_codec_write(codec, hp_pin, 0,
3529 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3531 if (hp_pin_sense || spec->ultra_low_power)
3534 snd_hda_codec_write(codec, hp_pin, 0,
3535 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3537 if (hp_pin_sense || spec->ultra_low_power)
3540 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3541 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3542 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3543 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3545 * Expose headphone mic (or possibly Line In on some machines) instead
3546 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3547 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3550 alc_write_coef_idx(codec, 0x36, 0x5757);
3553 static void alc256_shutup(struct hda_codec *codec)
3555 struct alc_spec *spec = codec->spec;
3556 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3562 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3567 snd_hda_codec_write(codec, hp_pin, 0,
3568 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3570 if (hp_pin_sense || spec->ultra_low_power)
3573 /* 3k pull low control for Headset jack. */
3574 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3575 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3576 * when booting with headset plugged. So skip setting it for the codec alc257
3578 if (codec->core.vendor_id != 0x10ec0236 &&
3579 codec->core.vendor_id != 0x10ec0257)
3580 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3582 if (!spec->no_shutup_pins)
3583 snd_hda_codec_write(codec, hp_pin, 0,
3584 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3586 if (hp_pin_sense || spec->ultra_low_power)
3589 alc_auto_setup_eapd(codec, false);
3590 alc_shutup_pins(codec);
3591 if (spec->ultra_low_power) {
3593 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3594 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3595 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3596 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3597 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3602 static void alc225_init(struct hda_codec *codec)
3604 struct alc_spec *spec = codec->spec;
3605 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3606 bool hp1_pin_sense, hp2_pin_sense;
3608 if (spec->ultra_low_power) {
3609 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3610 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3611 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3619 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3620 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3622 if (hp1_pin_sense || hp2_pin_sense)
3625 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3627 if (hp1_pin_sense || spec->ultra_low_power)
3628 snd_hda_codec_write(codec, hp_pin, 0,
3629 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3631 snd_hda_codec_write(codec, 0x16, 0,
3632 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3634 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3637 if (hp1_pin_sense || spec->ultra_low_power)
3638 snd_hda_codec_write(codec, hp_pin, 0,
3639 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3641 snd_hda_codec_write(codec, 0x16, 0,
3642 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3644 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3647 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3648 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3651 static void alc225_shutup(struct hda_codec *codec)
3653 struct alc_spec *spec = codec->spec;
3654 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3655 bool hp1_pin_sense, hp2_pin_sense;
3660 alc_disable_headset_jack_key(codec);
3661 /* 3k pull low control for Headset jack. */
3662 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3664 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3665 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3667 if (hp1_pin_sense || hp2_pin_sense)
3670 if (hp1_pin_sense || spec->ultra_low_power)
3671 snd_hda_codec_write(codec, hp_pin, 0,
3672 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3674 snd_hda_codec_write(codec, 0x16, 0,
3675 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3677 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3680 if (hp1_pin_sense || spec->ultra_low_power)
3681 snd_hda_codec_write(codec, hp_pin, 0,
3682 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3684 snd_hda_codec_write(codec, 0x16, 0,
3685 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3687 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3690 alc_auto_setup_eapd(codec, false);
3691 alc_shutup_pins(codec);
3692 if (spec->ultra_low_power) {
3694 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3695 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3696 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3697 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3701 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3702 alc_enable_headset_jack_key(codec);
3705 static void alc_default_init(struct hda_codec *codec)
3707 struct alc_spec *spec = codec->spec;
3708 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3716 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3721 snd_hda_codec_write(codec, hp_pin, 0,
3722 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3727 snd_hda_codec_write(codec, hp_pin, 0,
3728 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3734 static void alc_default_shutup(struct hda_codec *codec)
3736 struct alc_spec *spec = codec->spec;
3737 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3741 alc269_shutup(codec);
3745 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3750 snd_hda_codec_write(codec, hp_pin, 0,
3751 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3756 if (!spec->no_shutup_pins)
3757 snd_hda_codec_write(codec, hp_pin, 0,
3758 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3763 alc_auto_setup_eapd(codec, false);
3764 alc_shutup_pins(codec);
3767 static void alc294_hp_init(struct hda_codec *codec)
3769 struct alc_spec *spec = codec->spec;
3770 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3776 snd_hda_codec_write(codec, hp_pin, 0,
3777 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3781 if (!spec->no_shutup_pins)
3782 snd_hda_codec_write(codec, hp_pin, 0,
3783 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3785 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3786 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3788 /* Wait for depop procedure finish */
3789 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3790 for (i = 0; i < 20 && val & 0x0080; i++) {
3792 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3794 /* Set HP depop to auto mode */
3795 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3799 static void alc294_init(struct hda_codec *codec)
3801 struct alc_spec *spec = codec->spec;
3803 /* required only at boot or S4 resume time */
3804 if (!spec->done_hp_init ||
3805 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3806 alc294_hp_init(codec);
3807 spec->done_hp_init = true;
3809 alc_default_init(codec);
3812 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3815 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3816 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3817 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3820 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3824 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3825 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3827 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3832 static void alc5505_dsp_halt(struct hda_codec *codec)
3836 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3837 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3838 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3839 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3840 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3841 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3842 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3843 val = alc5505_coef_get(codec, 0x6220);
3844 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3847 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3849 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3850 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3851 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3852 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3853 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3854 alc5505_coef_set(codec, 0x880c, 0x00000004);
3857 static void alc5505_dsp_init(struct hda_codec *codec)
3861 alc5505_dsp_halt(codec);
3862 alc5505_dsp_back_from_halt(codec);
3863 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3864 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3865 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3866 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3867 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3868 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3869 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3870 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3871 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3872 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3873 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3874 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3875 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3877 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3879 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3881 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3883 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3884 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3885 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3886 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3887 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3888 alc5505_coef_set(codec, 0x880c, 0x00000003);
3889 alc5505_coef_set(codec, 0x880c, 0x00000010);
3891 #ifdef HALT_REALTEK_ALC5505
3892 alc5505_dsp_halt(codec);
3896 #ifdef HALT_REALTEK_ALC5505
3897 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3898 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3900 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3901 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3905 static int alc269_suspend(struct hda_codec *codec)
3907 struct alc_spec *spec = codec->spec;
3909 if (spec->has_alc5505_dsp)
3910 alc5505_dsp_suspend(codec);
3911 return alc_suspend(codec);
3914 static int alc269_resume(struct hda_codec *codec)
3916 struct alc_spec *spec = codec->spec;
3918 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3919 alc269vb_toggle_power_output(codec, 0);
3920 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3921 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3925 codec->patch_ops.init(codec);
3927 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3928 alc269vb_toggle_power_output(codec, 1);
3929 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3930 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3934 snd_hda_regmap_sync(codec);
3935 hda_call_check_power_status(codec, 0x01);
3937 /* on some machine, the BIOS will clear the codec gpio data when enter
3938 * suspend, and won't restore the data after resume, so we restore it
3941 if (spec->gpio_data)
3942 alc_write_gpio_data(codec);
3944 if (spec->has_alc5505_dsp)
3945 alc5505_dsp_resume(codec);
3949 #endif /* CONFIG_PM */
3951 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3952 const struct hda_fixup *fix, int action)
3954 struct alc_spec *spec = codec->spec;
3956 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3957 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3960 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3961 const struct hda_fixup *fix,
3964 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3965 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3967 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3968 snd_hda_codec_set_pincfg(codec, 0x19,
3969 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3970 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3973 static void alc269_fixup_hweq(struct hda_codec *codec,
3974 const struct hda_fixup *fix, int action)
3976 if (action == HDA_FIXUP_ACT_INIT)
3977 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3980 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3981 const struct hda_fixup *fix, int action)
3983 struct alc_spec *spec = codec->spec;
3985 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3986 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3989 static void alc271_fixup_dmic(struct hda_codec *codec,
3990 const struct hda_fixup *fix, int action)
3992 static const struct hda_verb verbs[] = {
3993 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3994 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3999 if (strcmp(codec->core.chip_name, "ALC271X") &&
4000 strcmp(codec->core.chip_name, "ALC269VB"))
4002 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4003 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4004 snd_hda_sequence_write(codec, verbs);
4007 /* Fix the speaker amp after resume, etc */
4008 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4009 const struct hda_fixup *fix,
4012 if (action == HDA_FIXUP_ACT_INIT)
4013 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4016 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4017 const struct hda_fixup *fix, int action)
4019 struct alc_spec *spec = codec->spec;
4021 if (action != HDA_FIXUP_ACT_PROBE)
4024 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4025 * fix the sample rate of analog I/O to 44.1kHz
4027 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4028 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4031 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4032 const struct hda_fixup *fix, int action)
4034 /* The digital-mic unit sends PDM (differential signal) instead of
4035 * the standard PCM, thus you can't record a valid mono stream as is.
4036 * Below is a workaround specific to ALC269 to control the dmic
4037 * signal source as mono.
4039 if (action == HDA_FIXUP_ACT_INIT)
4040 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4043 static void alc269_quanta_automute(struct hda_codec *codec)
4045 snd_hda_gen_update_outputs(codec);
4047 alc_write_coef_idx(codec, 0x0c, 0x680);
4048 alc_write_coef_idx(codec, 0x0c, 0x480);
4051 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4052 const struct hda_fixup *fix, int action)
4054 struct alc_spec *spec = codec->spec;
4055 if (action != HDA_FIXUP_ACT_PROBE)
4057 spec->gen.automute_hook = alc269_quanta_automute;
4060 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4061 struct hda_jack_callback *jack)
4063 struct alc_spec *spec = codec->spec;
4066 snd_hda_gen_hp_automute(codec, jack);
4068 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4070 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4073 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4078 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4080 struct hda_alc298_mbxinit {
4081 unsigned char value_0x23;
4082 unsigned char value_0x25;
4085 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4086 const struct hda_alc298_mbxinit *initval,
4089 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4090 alc_write_coef_idx(codec, 0x26, 0xb000);
4093 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4095 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4096 alc_write_coef_idx(codec, 0x26, 0xf000);
4097 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4099 if (initval->value_0x23 != 0x1e)
4100 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4102 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4103 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4106 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4107 const struct hda_fixup *fix,
4110 /* Initialization magic */
4111 static const struct hda_alc298_mbxinit dac_init[] = {
4112 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4113 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4114 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4115 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4116 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4117 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4119 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4120 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4121 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4124 const struct hda_alc298_mbxinit *seq;
4126 if (action != HDA_FIXUP_ACT_INIT)
4130 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4131 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4132 alc_write_coef_idx(codec, 0x26, 0xf000);
4133 alc_write_coef_idx(codec, 0x22, 0x31);
4134 alc_write_coef_idx(codec, 0x23, 0x0b);
4135 alc_write_coef_idx(codec, 0x25, 0x00);
4136 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4137 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4139 for (seq = dac_init; seq->value_0x23; seq++)
4140 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4143 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4144 const struct hda_fixup *fix, int action)
4146 struct alc_spec *spec = codec->spec;
4147 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4148 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4149 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4154 /* update mute-LED according to the speaker mute state via mic VREF pin */
4155 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
4157 struct hda_codec *codec = private_data;
4158 struct alc_spec *spec = codec->spec;
4159 unsigned int pinval;
4161 if (spec->mute_led_polarity)
4163 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
4164 pinval &= ~AC_PINCTL_VREFEN;
4165 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
4166 if (spec->mute_led_nid) {
4167 /* temporarily power up/down for setting VREF */
4168 snd_hda_power_up_pm(codec);
4169 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
4170 snd_hda_power_down_pm(codec);
4174 /* Make sure the led works even in runtime suspend */
4175 static unsigned int led_power_filter(struct hda_codec *codec,
4177 unsigned int power_state)
4179 struct alc_spec *spec = codec->spec;
4181 if (power_state != AC_PWRST_D3 || nid == 0 ||
4182 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4185 /* Set pin ctl again, it might have just been set to 0 */
4186 snd_hda_set_pin_ctl(codec, nid,
4187 snd_hda_codec_get_pin_target(codec, nid));
4189 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4192 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4193 const struct hda_fixup *fix, int action)
4195 struct alc_spec *spec = codec->spec;
4196 const struct dmi_device *dev = NULL;
4198 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4201 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4203 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4205 if (pin < 0x0a || pin >= 0x10)
4207 spec->mute_led_polarity = pol;
4208 spec->mute_led_nid = pin - 0x0a + 0x18;
4209 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
4210 spec->gen.vmaster_mute_enum = 1;
4211 codec->power_filter = led_power_filter;
4213 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4214 spec->mute_led_polarity);
4219 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4220 const struct hda_fixup *fix,
4221 int action, hda_nid_t pin)
4223 struct alc_spec *spec = codec->spec;
4225 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4226 spec->mute_led_polarity = 0;
4227 spec->mute_led_nid = pin;
4228 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
4229 spec->gen.vmaster_mute_enum = 1;
4230 codec->power_filter = led_power_filter;
4234 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4235 const struct hda_fixup *fix, int action)
4237 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4240 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4241 const struct hda_fixup *fix, int action)
4243 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4246 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4247 const struct hda_fixup *fix, int action)
4249 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4252 /* update LED status via GPIO */
4253 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4254 int polarity, bool enabled)
4258 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4261 /* turn on/off mute LED via GPIO per vmaster hook */
4262 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
4264 struct hda_codec *codec = private_data;
4265 struct alc_spec *spec = codec->spec;
4267 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4268 spec->mute_led_polarity, enabled);
4271 /* turn on/off mic-mute LED via GPIO per capture hook */
4272 static void alc_gpio_micmute_update(struct hda_codec *codec)
4274 struct alc_spec *spec = codec->spec;
4276 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4277 spec->micmute_led_polarity,
4278 spec->gen.micmute_led.led_value);
4281 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4282 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4284 unsigned int mute_mask,
4285 unsigned int micmute_mask)
4287 struct alc_spec *spec = codec->spec;
4289 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4291 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4294 spec->gpio_mute_led_mask = mute_mask;
4295 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
4298 spec->gpio_mic_led_mask = micmute_mask;
4299 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
4303 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4304 const struct hda_fixup *fix, int action)
4306 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4309 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4310 const struct hda_fixup *fix, int action)
4312 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4315 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4316 const struct hda_fixup *fix, int action)
4318 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x00);
4321 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4322 const struct hda_fixup *fix, int action)
4324 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4327 /* turn on/off mic-mute LED per capture hook */
4328 static void alc_cap_micmute_update(struct hda_codec *codec)
4330 struct alc_spec *spec = codec->spec;
4331 unsigned int pinval;
4333 if (!spec->cap_mute_led_nid)
4335 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
4336 pinval &= ~AC_PINCTL_VREFEN;
4337 if (spec->gen.micmute_led.led_value)
4338 pinval |= AC_PINCTL_VREF_80;
4340 pinval |= AC_PINCTL_VREF_HIZ;
4341 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
4344 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4345 const struct hda_fixup *fix, int action)
4347 struct alc_spec *spec = codec->spec;
4349 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4350 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4351 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4352 * enable headphone amp
4354 spec->gpio_mask |= 0x10;
4355 spec->gpio_dir |= 0x10;
4356 spec->cap_mute_led_nid = 0x18;
4357 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4358 codec->power_filter = led_power_filter;
4362 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4363 const struct hda_fixup *fix, int action)
4365 struct alc_spec *spec = codec->spec;
4367 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4368 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4369 spec->cap_mute_led_nid = 0x18;
4370 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4371 codec->power_filter = led_power_filter;
4375 /* update mute-LED according to the speaker mute state via COEF bit */
4376 static void alc_fixup_mute_led_coefbit_hook(void *private_data, int enabled)
4378 struct hda_codec *codec = private_data;
4379 struct alc_spec *spec = codec->spec;
4381 if (spec->mute_led_polarity)
4384 /* temporarily power up/down for setting COEF bit */
4385 enabled ? alc_update_coef_idx(codec, spec->mute_led_coef_idx,
4386 spec->mute_led_coefbit_mask, spec->mute_led_coefbit_off) :
4387 alc_update_coef_idx(codec, spec->mute_led_coef_idx,
4388 spec->mute_led_coefbit_mask, spec->mute_led_coefbit_on);
4391 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4392 const struct hda_fixup *fix,
4395 struct alc_spec *spec = codec->spec;
4397 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4398 spec->mute_led_polarity = 0;
4399 spec->mute_led_coef_idx = 0x0b;
4400 spec->mute_led_coefbit_mask = 1<<3;
4401 spec->mute_led_coefbit_on = 1<<3;
4402 spec->mute_led_coefbit_off = 0;
4403 spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4404 spec->gen.vmaster_mute_enum = 1;
4408 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4409 const struct hda_fixup *fix,
4412 struct alc_spec *spec = codec->spec;
4414 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4415 spec->mute_led_polarity = 0;
4416 spec->mute_led_coef_idx = 0x34;
4417 spec->mute_led_coefbit_mask = 1<<5;
4418 spec->mute_led_coefbit_on = 0;
4419 spec->mute_led_coefbit_off = 1<<5;
4420 spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4421 spec->gen.vmaster_mute_enum = 1;
4425 /* turn on/off mic-mute LED per capture hook by coef bit */
4426 static void alc_hp_cap_micmute_update(struct hda_codec *codec)
4428 struct alc_spec *spec = codec->spec;
4430 if (spec->gen.micmute_led.led_value)
4431 alc_update_coef_idx(codec, spec->mic_led_coef_idx,
4432 spec->mic_led_coefbit_mask, spec->mic_led_coefbit_on);
4434 alc_update_coef_idx(codec, spec->mic_led_coef_idx,
4435 spec->mic_led_coefbit_mask, spec->mic_led_coefbit_off);
4438 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4439 const struct hda_fixup *fix, int action)
4441 struct alc_spec *spec = codec->spec;
4443 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4444 spec->mic_led_coef_idx = 0x19;
4445 spec->mic_led_coefbit_mask = 1<<13;
4446 spec->mic_led_coefbit_on = 1<<13;
4447 spec->mic_led_coefbit_off = 0;
4448 snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4452 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4453 const struct hda_fixup *fix, int action)
4455 struct alc_spec *spec = codec->spec;
4457 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4458 spec->mic_led_coef_idx = 0x35;
4459 spec->mic_led_coefbit_mask = 3<<2;
4460 spec->mic_led_coefbit_on = 2<<2;
4461 spec->mic_led_coefbit_off = 1<<2;
4462 snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4466 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4467 const struct hda_fixup *fix, int action)
4469 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4470 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4473 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4474 const struct hda_fixup *fix, int action)
4476 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4477 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4480 #if IS_REACHABLE(CONFIG_INPUT)
4481 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4482 struct hda_jack_callback *event)
4484 struct alc_spec *spec = codec->spec;
4486 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4487 send both key on and key off event for every interrupt. */
4488 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4489 input_sync(spec->kb_dev);
4490 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4491 input_sync(spec->kb_dev);
4494 static int alc_register_micmute_input_device(struct hda_codec *codec)
4496 struct alc_spec *spec = codec->spec;
4499 spec->kb_dev = input_allocate_device();
4500 if (!spec->kb_dev) {
4501 codec_err(codec, "Out of memory (input_allocate_device)\n");
4505 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4507 spec->kb_dev->name = "Microphone Mute Button";
4508 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4509 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4510 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4511 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4512 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4513 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4515 if (input_register_device(spec->kb_dev)) {
4516 codec_err(codec, "input_register_device failed\n");
4517 input_free_device(spec->kb_dev);
4518 spec->kb_dev = NULL;
4525 /* GPIO1 = set according to SKU external amp
4526 * GPIO2 = mic mute hotkey
4528 * GPIO4 = mic mute LED
4530 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4531 const struct hda_fixup *fix, int action)
4533 struct alc_spec *spec = codec->spec;
4535 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4536 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4537 spec->init_amp = ALC_INIT_DEFAULT;
4538 if (alc_register_micmute_input_device(codec) != 0)
4541 spec->gpio_mask |= 0x06;
4542 spec->gpio_dir |= 0x02;
4543 spec->gpio_data |= 0x02;
4544 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4545 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4546 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4547 gpio2_mic_hotkey_event);
4555 case HDA_FIXUP_ACT_FREE:
4556 input_unregister_device(spec->kb_dev);
4557 spec->kb_dev = NULL;
4561 /* Line2 = mic mute hotkey
4562 * GPIO2 = mic mute LED
4564 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4565 const struct hda_fixup *fix, int action)
4567 struct alc_spec *spec = codec->spec;
4569 spec->micmute_led_polarity = 1;
4570 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4571 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4572 spec->init_amp = ALC_INIT_DEFAULT;
4573 if (alc_register_micmute_input_device(codec) != 0)
4576 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4577 gpio2_mic_hotkey_event);
4585 case HDA_FIXUP_ACT_FREE:
4586 input_unregister_device(spec->kb_dev);
4587 spec->kb_dev = NULL;
4591 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4592 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4595 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4596 const struct hda_fixup *fix, int action)
4598 struct alc_spec *spec = codec->spec;
4600 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4601 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4602 spec->cap_mute_led_nid = 0x18;
4603 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4607 static const struct coef_fw alc225_pre_hsmode[] = {
4608 UPDATE_COEF(0x4a, 1<<8, 0),
4609 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4610 UPDATE_COEF(0x63, 3<<14, 3<<14),
4611 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4612 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4613 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4614 UPDATE_COEF(0x4a, 3<<10, 0),
4618 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4620 static const struct coef_fw coef0255[] = {
4621 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4622 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4623 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4624 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4625 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4628 static const struct coef_fw coef0256[] = {
4629 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4630 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4631 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4632 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4633 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4636 static const struct coef_fw coef0233[] = {
4637 WRITE_COEF(0x1b, 0x0c0b),
4638 WRITE_COEF(0x45, 0xc429),
4639 UPDATE_COEF(0x35, 0x4000, 0),
4640 WRITE_COEF(0x06, 0x2104),
4641 WRITE_COEF(0x1a, 0x0001),
4642 WRITE_COEF(0x26, 0x0004),
4643 WRITE_COEF(0x32, 0x42a3),
4646 static const struct coef_fw coef0288[] = {
4647 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4648 UPDATE_COEF(0x50, 0x2000, 0x2000),
4649 UPDATE_COEF(0x56, 0x0006, 0x0006),
4650 UPDATE_COEF(0x66, 0x0008, 0),
4651 UPDATE_COEF(0x67, 0x2000, 0),
4654 static const struct coef_fw coef0298[] = {
4655 UPDATE_COEF(0x19, 0x1300, 0x0300),
4658 static const struct coef_fw coef0292[] = {
4659 WRITE_COEF(0x76, 0x000e),
4660 WRITE_COEF(0x6c, 0x2400),
4661 WRITE_COEF(0x18, 0x7308),
4662 WRITE_COEF(0x6b, 0xc429),
4665 static const struct coef_fw coef0293[] = {
4666 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4667 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4668 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4669 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4670 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4671 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4674 static const struct coef_fw coef0668[] = {
4675 WRITE_COEF(0x15, 0x0d40),
4676 WRITE_COEF(0xb7, 0x802b),
4679 static const struct coef_fw coef0225[] = {
4680 UPDATE_COEF(0x63, 3<<14, 0),
4683 static const struct coef_fw coef0274[] = {
4684 UPDATE_COEF(0x4a, 0x0100, 0),
4685 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4686 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4687 UPDATE_COEF(0x4a, 0x0010, 0),
4688 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4689 WRITE_COEF(0x45, 0x5289),
4690 UPDATE_COEF(0x4a, 0x0c00, 0),
4694 switch (codec->core.vendor_id) {
4696 alc_process_coef_fw(codec, coef0255);
4702 alc_process_coef_fw(codec, coef0256);
4707 alc_process_coef_fw(codec, coef0274);
4711 alc_process_coef_fw(codec, coef0233);
4715 alc_process_coef_fw(codec, coef0288);
4718 alc_process_coef_fw(codec, coef0298);
4719 alc_process_coef_fw(codec, coef0288);
4722 alc_process_coef_fw(codec, coef0292);
4725 alc_process_coef_fw(codec, coef0293);
4728 alc_process_coef_fw(codec, coef0668);
4736 alc_process_coef_fw(codec, alc225_pre_hsmode);
4737 alc_process_coef_fw(codec, coef0225);
4740 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4743 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4747 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4750 static const struct coef_fw coef0255[] = {
4751 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4752 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4755 static const struct coef_fw coef0256[] = {
4756 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4757 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4758 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4761 static const struct coef_fw coef0233[] = {
4762 UPDATE_COEF(0x35, 0, 1<<14),
4763 WRITE_COEF(0x06, 0x2100),
4764 WRITE_COEF(0x1a, 0x0021),
4765 WRITE_COEF(0x26, 0x008c),
4768 static const struct coef_fw coef0288[] = {
4769 UPDATE_COEF(0x4f, 0x00c0, 0),
4770 UPDATE_COEF(0x50, 0x2000, 0),
4771 UPDATE_COEF(0x56, 0x0006, 0),
4772 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4773 UPDATE_COEF(0x66, 0x0008, 0x0008),
4774 UPDATE_COEF(0x67, 0x2000, 0x2000),
4777 static const struct coef_fw coef0292[] = {
4778 WRITE_COEF(0x19, 0xa208),
4779 WRITE_COEF(0x2e, 0xacf0),
4782 static const struct coef_fw coef0293[] = {
4783 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4784 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4785 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4788 static const struct coef_fw coef0688[] = {
4789 WRITE_COEF(0xb7, 0x802b),
4790 WRITE_COEF(0xb5, 0x1040),
4791 UPDATE_COEF(0xc3, 0, 1<<12),
4794 static const struct coef_fw coef0225[] = {
4795 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4796 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4797 UPDATE_COEF(0x63, 3<<14, 0),
4800 static const struct coef_fw coef0274[] = {
4801 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4802 UPDATE_COEF(0x4a, 0x0010, 0),
4803 UPDATE_COEF(0x6b, 0xf000, 0),
4807 switch (codec->core.vendor_id) {
4809 alc_write_coef_idx(codec, 0x45, 0xc489);
4810 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4811 alc_process_coef_fw(codec, coef0255);
4812 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4818 alc_write_coef_idx(codec, 0x45, 0xc489);
4819 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4820 alc_process_coef_fw(codec, coef0256);
4821 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4826 alc_write_coef_idx(codec, 0x45, 0x4689);
4827 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4828 alc_process_coef_fw(codec, coef0274);
4829 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4833 alc_write_coef_idx(codec, 0x45, 0xc429);
4834 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4835 alc_process_coef_fw(codec, coef0233);
4836 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4841 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4842 alc_process_coef_fw(codec, coef0288);
4843 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4846 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4847 alc_process_coef_fw(codec, coef0292);
4850 /* Set to TRS mode */
4851 alc_write_coef_idx(codec, 0x45, 0xc429);
4852 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4853 alc_process_coef_fw(codec, coef0293);
4854 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4857 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4861 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4862 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4865 alc_write_coef_idx(codec, 0x11, 0x0001);
4866 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4867 alc_process_coef_fw(codec, coef0688);
4868 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4876 alc_process_coef_fw(codec, alc225_pre_hsmode);
4877 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4878 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4879 alc_process_coef_fw(codec, coef0225);
4880 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4883 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4886 static void alc_headset_mode_default(struct hda_codec *codec)
4888 static const struct coef_fw coef0225[] = {
4889 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4890 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4891 UPDATE_COEF(0x49, 3<<8, 0<<8),
4892 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4893 UPDATE_COEF(0x63, 3<<14, 0),
4894 UPDATE_COEF(0x67, 0xf000, 0x3000),
4897 static const struct coef_fw coef0255[] = {
4898 WRITE_COEF(0x45, 0xc089),
4899 WRITE_COEF(0x45, 0xc489),
4900 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4901 WRITE_COEF(0x49, 0x0049),
4904 static const struct coef_fw coef0256[] = {
4905 WRITE_COEF(0x45, 0xc489),
4906 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4907 WRITE_COEF(0x49, 0x0049),
4908 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4909 WRITE_COEF(0x06, 0x6100),
4912 static const struct coef_fw coef0233[] = {
4913 WRITE_COEF(0x06, 0x2100),
4914 WRITE_COEF(0x32, 0x4ea3),
4917 static const struct coef_fw coef0288[] = {
4918 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4919 UPDATE_COEF(0x50, 0x2000, 0x2000),
4920 UPDATE_COEF(0x56, 0x0006, 0x0006),
4921 UPDATE_COEF(0x66, 0x0008, 0),
4922 UPDATE_COEF(0x67, 0x2000, 0),
4925 static const struct coef_fw coef0292[] = {
4926 WRITE_COEF(0x76, 0x000e),
4927 WRITE_COEF(0x6c, 0x2400),
4928 WRITE_COEF(0x6b, 0xc429),
4929 WRITE_COEF(0x18, 0x7308),
4932 static const struct coef_fw coef0293[] = {
4933 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4934 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4935 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4938 static const struct coef_fw coef0688[] = {
4939 WRITE_COEF(0x11, 0x0041),
4940 WRITE_COEF(0x15, 0x0d40),
4941 WRITE_COEF(0xb7, 0x802b),
4944 static const struct coef_fw coef0274[] = {
4945 WRITE_COEF(0x45, 0x4289),
4946 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4947 UPDATE_COEF(0x6b, 0x0f00, 0),
4948 UPDATE_COEF(0x49, 0x0300, 0x0300),
4952 switch (codec->core.vendor_id) {
4959 alc_process_coef_fw(codec, alc225_pre_hsmode);
4960 alc_process_coef_fw(codec, coef0225);
4963 alc_process_coef_fw(codec, coef0255);
4969 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4970 alc_write_coef_idx(codec, 0x45, 0xc089);
4972 alc_process_coef_fw(codec, coef0256);
4977 alc_process_coef_fw(codec, coef0274);
4981 alc_process_coef_fw(codec, coef0233);
4986 alc_process_coef_fw(codec, coef0288);
4989 alc_process_coef_fw(codec, coef0292);
4992 alc_process_coef_fw(codec, coef0293);
4995 alc_process_coef_fw(codec, coef0688);
4998 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5001 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5005 static void alc_headset_mode_ctia(struct hda_codec *codec)
5009 static const struct coef_fw coef0255[] = {
5010 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5011 WRITE_COEF(0x1b, 0x0c2b),
5012 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5015 static const struct coef_fw coef0256[] = {
5016 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5017 WRITE_COEF(0x1b, 0x0e6b),
5020 static const struct coef_fw coef0233[] = {
5021 WRITE_COEF(0x45, 0xd429),
5022 WRITE_COEF(0x1b, 0x0c2b),
5023 WRITE_COEF(0x32, 0x4ea3),
5026 static const struct coef_fw coef0288[] = {
5027 UPDATE_COEF(0x50, 0x2000, 0x2000),
5028 UPDATE_COEF(0x56, 0x0006, 0x0006),
5029 UPDATE_COEF(0x66, 0x0008, 0),
5030 UPDATE_COEF(0x67, 0x2000, 0),
5033 static const struct coef_fw coef0292[] = {
5034 WRITE_COEF(0x6b, 0xd429),
5035 WRITE_COEF(0x76, 0x0008),
5036 WRITE_COEF(0x18, 0x7388),
5039 static const struct coef_fw coef0293[] = {
5040 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5041 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5044 static const struct coef_fw coef0688[] = {
5045 WRITE_COEF(0x11, 0x0001),
5046 WRITE_COEF(0x15, 0x0d60),
5047 WRITE_COEF(0xc3, 0x0000),
5050 static const struct coef_fw coef0225_1[] = {
5051 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5052 UPDATE_COEF(0x63, 3<<14, 2<<14),
5055 static const struct coef_fw coef0225_2[] = {
5056 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5057 UPDATE_COEF(0x63, 3<<14, 1<<14),
5061 switch (codec->core.vendor_id) {
5063 alc_process_coef_fw(codec, coef0255);
5069 alc_process_coef_fw(codec, coef0256);
5074 alc_write_coef_idx(codec, 0x45, 0xd689);
5078 alc_process_coef_fw(codec, coef0233);
5081 val = alc_read_coef_idx(codec, 0x50);
5082 if (val & (1 << 12)) {
5083 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5084 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5087 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5088 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5094 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5096 alc_process_coef_fw(codec, coef0288);
5099 alc_process_coef_fw(codec, coef0292);
5102 alc_process_coef_fw(codec, coef0293);
5105 alc_process_coef_fw(codec, coef0688);
5113 val = alc_read_coef_idx(codec, 0x45);
5115 alc_process_coef_fw(codec, coef0225_2);
5117 alc_process_coef_fw(codec, coef0225_1);
5120 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5123 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5127 static void alc_headset_mode_omtp(struct hda_codec *codec)
5129 static const struct coef_fw coef0255[] = {
5130 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5131 WRITE_COEF(0x1b, 0x0c2b),
5132 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5135 static const struct coef_fw coef0256[] = {
5136 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5137 WRITE_COEF(0x1b, 0x0e6b),
5140 static const struct coef_fw coef0233[] = {
5141 WRITE_COEF(0x45, 0xe429),
5142 WRITE_COEF(0x1b, 0x0c2b),
5143 WRITE_COEF(0x32, 0x4ea3),
5146 static const struct coef_fw coef0288[] = {
5147 UPDATE_COEF(0x50, 0x2000, 0x2000),
5148 UPDATE_COEF(0x56, 0x0006, 0x0006),
5149 UPDATE_COEF(0x66, 0x0008, 0),
5150 UPDATE_COEF(0x67, 0x2000, 0),
5153 static const struct coef_fw coef0292[] = {
5154 WRITE_COEF(0x6b, 0xe429),
5155 WRITE_COEF(0x76, 0x0008),
5156 WRITE_COEF(0x18, 0x7388),
5159 static const struct coef_fw coef0293[] = {
5160 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5161 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5164 static const struct coef_fw coef0688[] = {
5165 WRITE_COEF(0x11, 0x0001),
5166 WRITE_COEF(0x15, 0x0d50),
5167 WRITE_COEF(0xc3, 0x0000),
5170 static const struct coef_fw coef0225[] = {
5171 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5172 UPDATE_COEF(0x63, 3<<14, 2<<14),
5176 switch (codec->core.vendor_id) {
5178 alc_process_coef_fw(codec, coef0255);
5184 alc_process_coef_fw(codec, coef0256);
5189 alc_write_coef_idx(codec, 0x45, 0xe689);
5193 alc_process_coef_fw(codec, coef0233);
5196 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5197 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5202 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5204 alc_process_coef_fw(codec, coef0288);
5207 alc_process_coef_fw(codec, coef0292);
5210 alc_process_coef_fw(codec, coef0293);
5213 alc_process_coef_fw(codec, coef0688);
5221 alc_process_coef_fw(codec, coef0225);
5224 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5227 static void alc_determine_headset_type(struct hda_codec *codec)
5230 bool is_ctia = false;
5231 struct alc_spec *spec = codec->spec;
5232 static const struct coef_fw coef0255[] = {
5233 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5234 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5238 static const struct coef_fw coef0288[] = {
5239 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5242 static const struct coef_fw coef0298[] = {
5243 UPDATE_COEF(0x50, 0x2000, 0x2000),
5244 UPDATE_COEF(0x56, 0x0006, 0x0006),
5245 UPDATE_COEF(0x66, 0x0008, 0),
5246 UPDATE_COEF(0x67, 0x2000, 0),
5247 UPDATE_COEF(0x19, 0x1300, 0x1300),
5250 static const struct coef_fw coef0293[] = {
5251 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5252 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5255 static const struct coef_fw coef0688[] = {
5256 WRITE_COEF(0x11, 0x0001),
5257 WRITE_COEF(0xb7, 0x802b),
5258 WRITE_COEF(0x15, 0x0d60),
5259 WRITE_COEF(0xc3, 0x0c00),
5262 static const struct coef_fw coef0274[] = {
5263 UPDATE_COEF(0x4a, 0x0010, 0),
5264 UPDATE_COEF(0x4a, 0x8000, 0),
5265 WRITE_COEF(0x45, 0xd289),
5266 UPDATE_COEF(0x49, 0x0300, 0x0300),
5270 switch (codec->core.vendor_id) {
5272 alc_process_coef_fw(codec, coef0255);
5274 val = alc_read_coef_idx(codec, 0x46);
5275 is_ctia = (val & 0x0070) == 0x0070;
5281 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5282 alc_write_coef_idx(codec, 0x06, 0x6104);
5283 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5285 snd_hda_codec_write(codec, 0x21, 0,
5286 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5288 snd_hda_codec_write(codec, 0x21, 0,
5289 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5291 alc_process_coef_fw(codec, coef0255);
5293 val = alc_read_coef_idx(codec, 0x46);
5294 is_ctia = (val & 0x0070) == 0x0070;
5296 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5297 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5299 snd_hda_codec_write(codec, 0x21, 0,
5300 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5302 snd_hda_codec_write(codec, 0x21, 0,
5303 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5308 alc_process_coef_fw(codec, coef0274);
5310 val = alc_read_coef_idx(codec, 0x46);
5311 is_ctia = (val & 0x00f0) == 0x00f0;
5315 alc_write_coef_idx(codec, 0x45, 0xd029);
5317 val = alc_read_coef_idx(codec, 0x46);
5318 is_ctia = (val & 0x0070) == 0x0070;
5321 snd_hda_codec_write(codec, 0x21, 0,
5322 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5324 snd_hda_codec_write(codec, 0x21, 0,
5325 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5328 val = alc_read_coef_idx(codec, 0x50);
5329 if (val & (1 << 12)) {
5330 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5331 alc_process_coef_fw(codec, coef0288);
5333 val = alc_read_coef_idx(codec, 0x50);
5334 is_ctia = (val & 0x0070) == 0x0070;
5336 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5337 alc_process_coef_fw(codec, coef0288);
5339 val = alc_read_coef_idx(codec, 0x50);
5340 is_ctia = (val & 0x0070) == 0x0070;
5342 alc_process_coef_fw(codec, coef0298);
5343 snd_hda_codec_write(codec, 0x21, 0,
5344 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5346 snd_hda_codec_write(codec, 0x21, 0,
5347 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5351 alc_process_coef_fw(codec, coef0288);
5353 val = alc_read_coef_idx(codec, 0x50);
5354 is_ctia = (val & 0x0070) == 0x0070;
5357 alc_write_coef_idx(codec, 0x6b, 0xd429);
5359 val = alc_read_coef_idx(codec, 0x6c);
5360 is_ctia = (val & 0x001c) == 0x001c;
5363 alc_process_coef_fw(codec, coef0293);
5365 val = alc_read_coef_idx(codec, 0x46);
5366 is_ctia = (val & 0x0070) == 0x0070;
5369 alc_process_coef_fw(codec, coef0688);
5371 val = alc_read_coef_idx(codec, 0xbe);
5372 is_ctia = (val & 0x1c02) == 0x1c02;
5380 snd_hda_codec_write(codec, 0x21, 0,
5381 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5383 snd_hda_codec_write(codec, 0x21, 0,
5384 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5386 alc_process_coef_fw(codec, alc225_pre_hsmode);
5387 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5388 val = alc_read_coef_idx(codec, 0x45);
5389 if (val & (1 << 9)) {
5390 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5391 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5393 val = alc_read_coef_idx(codec, 0x46);
5394 is_ctia = (val & 0x00f0) == 0x00f0;
5396 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5397 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5399 val = alc_read_coef_idx(codec, 0x46);
5400 is_ctia = (val & 0x00f0) == 0x00f0;
5402 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5403 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5404 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5406 snd_hda_codec_write(codec, 0x21, 0,
5407 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5409 snd_hda_codec_write(codec, 0x21, 0,
5410 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5417 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5418 is_ctia ? "yes" : "no");
5419 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5422 static void alc_update_headset_mode(struct hda_codec *codec)
5424 struct alc_spec *spec = codec->spec;
5426 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5427 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5429 int new_headset_mode;
5431 if (!snd_hda_jack_detect(codec, hp_pin))
5432 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5433 else if (mux_pin == spec->headset_mic_pin)
5434 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5435 else if (mux_pin == spec->headphone_mic_pin)
5436 new_headset_mode = ALC_HEADSET_MODE_MIC;
5438 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5440 if (new_headset_mode == spec->current_headset_mode) {
5441 snd_hda_gen_update_outputs(codec);
5445 switch (new_headset_mode) {
5446 case ALC_HEADSET_MODE_UNPLUGGED:
5447 alc_headset_mode_unplugged(codec);
5448 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5449 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5450 spec->gen.hp_jack_present = false;
5452 case ALC_HEADSET_MODE_HEADSET:
5453 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5454 alc_determine_headset_type(codec);
5455 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5456 alc_headset_mode_ctia(codec);
5457 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5458 alc_headset_mode_omtp(codec);
5459 spec->gen.hp_jack_present = true;
5461 case ALC_HEADSET_MODE_MIC:
5462 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5463 spec->gen.hp_jack_present = false;
5465 case ALC_HEADSET_MODE_HEADPHONE:
5466 alc_headset_mode_default(codec);
5467 spec->gen.hp_jack_present = true;
5470 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5471 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5472 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5473 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5474 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5477 spec->current_headset_mode = new_headset_mode;
5479 snd_hda_gen_update_outputs(codec);
5482 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5483 struct snd_kcontrol *kcontrol,
5484 struct snd_ctl_elem_value *ucontrol)
5486 alc_update_headset_mode(codec);
5489 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5490 struct hda_jack_callback *jack)
5492 snd_hda_gen_hp_automute(codec, jack);
5493 alc_update_headset_mode(codec);
5496 static void alc_probe_headset_mode(struct hda_codec *codec)
5499 struct alc_spec *spec = codec->spec;
5500 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5503 for (i = 0; i < cfg->num_inputs; i++) {
5504 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5505 spec->headset_mic_pin = cfg->inputs[i].pin;
5506 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5507 spec->headphone_mic_pin = cfg->inputs[i].pin;
5510 WARN_ON(spec->gen.cap_sync_hook);
5511 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5512 spec->gen.automute_hook = alc_update_headset_mode;
5513 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5516 static void alc_fixup_headset_mode(struct hda_codec *codec,
5517 const struct hda_fixup *fix, int action)
5519 struct alc_spec *spec = codec->spec;
5522 case HDA_FIXUP_ACT_PRE_PROBE:
5523 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5525 case HDA_FIXUP_ACT_PROBE:
5526 alc_probe_headset_mode(codec);
5528 case HDA_FIXUP_ACT_INIT:
5529 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5530 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5531 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5533 alc_update_headset_mode(codec);
5538 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5539 const struct hda_fixup *fix, int action)
5541 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5542 struct alc_spec *spec = codec->spec;
5543 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5546 alc_fixup_headset_mode(codec, fix, action);
5549 static void alc255_set_default_jack_type(struct hda_codec *codec)
5551 /* Set to iphone type */
5552 static const struct coef_fw alc255fw[] = {
5553 WRITE_COEF(0x1b, 0x880b),
5554 WRITE_COEF(0x45, 0xd089),
5555 WRITE_COEF(0x1b, 0x080b),
5556 WRITE_COEF(0x46, 0x0004),
5557 WRITE_COEF(0x1b, 0x0c0b),
5560 static const struct coef_fw alc256fw[] = {
5561 WRITE_COEF(0x1b, 0x884b),
5562 WRITE_COEF(0x45, 0xd089),
5563 WRITE_COEF(0x1b, 0x084b),
5564 WRITE_COEF(0x46, 0x0004),
5565 WRITE_COEF(0x1b, 0x0c4b),
5568 switch (codec->core.vendor_id) {
5570 alc_process_coef_fw(codec, alc255fw);
5576 alc_process_coef_fw(codec, alc256fw);
5582 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5583 const struct hda_fixup *fix, int action)
5585 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5586 alc255_set_default_jack_type(codec);
5588 alc_fixup_headset_mode(codec, fix, action);
5591 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5592 const struct hda_fixup *fix, int action)
5594 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5595 struct alc_spec *spec = codec->spec;
5596 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5597 alc255_set_default_jack_type(codec);
5600 alc_fixup_headset_mode(codec, fix, action);
5603 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5604 struct hda_jack_callback *jack)
5606 struct alc_spec *spec = codec->spec;
5608 alc_update_headset_jack_cb(codec, jack);
5609 /* Headset Mic enable or disable, only for Dell Dino */
5610 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5613 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5614 const struct hda_fixup *fix, int action)
5616 alc_fixup_headset_mode(codec, fix, action);
5617 if (action == HDA_FIXUP_ACT_PROBE) {
5618 struct alc_spec *spec = codec->spec;
5619 /* toggled via hp_automute_hook */
5620 spec->gpio_mask |= 0x40;
5621 spec->gpio_dir |= 0x40;
5622 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5626 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5627 const struct hda_fixup *fix, int action)
5629 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5630 struct alc_spec *spec = codec->spec;
5631 spec->gen.auto_mute_via_amp = 1;
5635 static void alc_fixup_no_shutup(struct hda_codec *codec,
5636 const struct hda_fixup *fix, int action)
5638 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5639 struct alc_spec *spec = codec->spec;
5640 spec->no_shutup_pins = 1;
5644 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5645 const struct hda_fixup *fix, int action)
5647 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5648 struct alc_spec *spec = codec->spec;
5649 /* Disable AA-loopback as it causes white noise */
5650 spec->gen.mixer_nid = 0;
5654 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5655 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5656 const struct hda_fixup *fix, int action)
5658 static const struct hda_pintbl pincfgs[] = {
5659 { 0x16, 0x21211010 }, /* dock headphone */
5660 { 0x19, 0x21a11010 }, /* dock mic */
5663 struct alc_spec *spec = codec->spec;
5665 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5666 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5667 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5668 codec->power_save_node = 0; /* avoid click noises */
5669 snd_hda_apply_pincfgs(codec, pincfgs);
5673 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5674 const struct hda_fixup *fix, int action)
5676 static const struct hda_pintbl pincfgs[] = {
5677 { 0x17, 0x21211010 }, /* dock headphone */
5678 { 0x19, 0x21a11010 }, /* dock mic */
5681 struct alc_spec *spec = codec->spec;
5683 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5684 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5685 snd_hda_apply_pincfgs(codec, pincfgs);
5686 } else if (action == HDA_FIXUP_ACT_INIT) {
5687 /* Enable DOCK device */
5688 snd_hda_codec_write(codec, 0x17, 0,
5689 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5690 /* Enable DOCK device */
5691 snd_hda_codec_write(codec, 0x19, 0,
5692 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5696 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5697 const struct hda_fixup *fix, int action)
5699 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5700 * the speaker output becomes too low by some reason on Thinkpads with
5703 static const hda_nid_t preferred_pairs[] = {
5704 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5707 struct alc_spec *spec = codec->spec;
5709 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5710 spec->gen.preferred_dacs = preferred_pairs;
5713 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5714 const struct hda_fixup *fix, int action)
5716 static const hda_nid_t preferred_pairs[] = {
5717 0x17, 0x02, 0x21, 0x03, 0
5719 struct alc_spec *spec = codec->spec;
5721 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5722 spec->gen.preferred_dacs = preferred_pairs;
5725 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5727 struct alc_spec *spec = codec->spec;
5728 int hp_pin = alc_get_hp_pin(spec);
5730 /* Prevent pop noises when headphones are plugged in */
5731 snd_hda_codec_write(codec, hp_pin, 0,
5732 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5736 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5737 const struct hda_fixup *fix, int action)
5739 struct alc_spec *spec = codec->spec;
5740 struct hda_input_mux *imux = &spec->gen.input_mux;
5744 case HDA_FIXUP_ACT_PRE_PROBE:
5745 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5746 * it causes a click noise at start up
5748 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5749 spec->shutup = alc_shutup_dell_xps13;
5751 case HDA_FIXUP_ACT_PROBE:
5752 /* Make the internal mic the default input source. */
5753 for (i = 0; i < imux->num_items; i++) {
5754 if (spec->gen.imux_pins[i] == 0x12) {
5755 spec->gen.cur_mux[0] = i;
5763 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5764 const struct hda_fixup *fix, int action)
5766 struct alc_spec *spec = codec->spec;
5768 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5769 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5770 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5772 /* Disable boost for mic-in permanently. (This code is only called
5773 from quirks that guarantee that the headphone is at NID 0x1b.) */
5774 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5775 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5777 alc_fixup_headset_mode(codec, fix, action);
5780 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5781 const struct hda_fixup *fix, int action)
5783 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5784 alc_write_coef_idx(codec, 0xc4, 0x8000);
5785 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5786 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5788 alc_fixup_headset_mode(codec, fix, action);
5791 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5792 static int find_ext_mic_pin(struct hda_codec *codec)
5794 struct alc_spec *spec = codec->spec;
5795 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5797 unsigned int defcfg;
5800 for (i = 0; i < cfg->num_inputs; i++) {
5801 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5803 nid = cfg->inputs[i].pin;
5804 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5805 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5813 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5814 const struct hda_fixup *fix,
5817 struct alc_spec *spec = codec->spec;
5819 if (action == HDA_FIXUP_ACT_PROBE) {
5820 int mic_pin = find_ext_mic_pin(codec);
5821 int hp_pin = alc_get_hp_pin(spec);
5823 if (snd_BUG_ON(!mic_pin || !hp_pin))
5825 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5829 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5830 const struct hda_fixup *fix,
5833 struct alc_spec *spec = codec->spec;
5834 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5837 /* The mic boosts on level 2 and 3 are too noisy
5838 on the internal mic input.
5839 Therefore limit the boost to 0 or 1. */
5841 if (action != HDA_FIXUP_ACT_PROBE)
5844 for (i = 0; i < cfg->num_inputs; i++) {
5845 hda_nid_t nid = cfg->inputs[i].pin;
5846 unsigned int defcfg;
5847 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5849 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5850 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5853 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5854 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5855 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5856 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5857 (0 << AC_AMPCAP_MUTE_SHIFT));
5861 static void alc283_hp_automute_hook(struct hda_codec *codec,
5862 struct hda_jack_callback *jack)
5864 struct alc_spec *spec = codec->spec;
5868 snd_hda_gen_hp_automute(codec, jack);
5870 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5873 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5877 static void alc283_fixup_chromebook(struct hda_codec *codec,
5878 const struct hda_fixup *fix, int action)
5880 struct alc_spec *spec = codec->spec;
5883 case HDA_FIXUP_ACT_PRE_PROBE:
5884 snd_hda_override_wcaps(codec, 0x03, 0);
5885 /* Disable AA-loopback as it causes white noise */
5886 spec->gen.mixer_nid = 0;
5888 case HDA_FIXUP_ACT_INIT:
5889 /* MIC2-VREF control */
5890 /* Set to manual mode */
5891 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5892 /* Enable Line1 input control by verb */
5893 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5898 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5899 const struct hda_fixup *fix, int action)
5901 struct alc_spec *spec = codec->spec;
5904 case HDA_FIXUP_ACT_PRE_PROBE:
5905 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5907 case HDA_FIXUP_ACT_INIT:
5908 /* MIC2-VREF control */
5909 /* Set to manual mode */
5910 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5915 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5916 static void asus_tx300_automute(struct hda_codec *codec)
5918 struct alc_spec *spec = codec->spec;
5919 snd_hda_gen_update_outputs(codec);
5920 if (snd_hda_jack_detect(codec, 0x1b))
5921 spec->gen.mute_bits |= (1ULL << 0x14);
5924 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5925 const struct hda_fixup *fix, int action)
5927 struct alc_spec *spec = codec->spec;
5928 static const struct hda_pintbl dock_pins[] = {
5929 { 0x1b, 0x21114000 }, /* dock speaker pin */
5934 case HDA_FIXUP_ACT_PRE_PROBE:
5935 spec->init_amp = ALC_INIT_DEFAULT;
5936 /* TX300 needs to set up GPIO2 for the speaker amp */
5937 alc_setup_gpio(codec, 0x04);
5938 snd_hda_apply_pincfgs(codec, dock_pins);
5939 spec->gen.auto_mute_via_amp = 1;
5940 spec->gen.automute_hook = asus_tx300_automute;
5941 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5942 snd_hda_gen_hp_automute);
5944 case HDA_FIXUP_ACT_PROBE:
5945 spec->init_amp = ALC_INIT_DEFAULT;
5947 case HDA_FIXUP_ACT_BUILD:
5948 /* this is a bit tricky; give more sane names for the main
5949 * (tablet) speaker and the dock speaker, respectively
5951 rename_ctl(codec, "Speaker Playback Switch",
5952 "Dock Speaker Playback Switch");
5953 rename_ctl(codec, "Bass Speaker Playback Switch",
5954 "Speaker Playback Switch");
5959 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5960 const struct hda_fixup *fix, int action)
5962 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5963 /* DAC node 0x03 is giving mono output. We therefore want to
5964 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5965 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5966 static const hda_nid_t conn1[] = { 0x0c };
5967 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
5968 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
5972 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5973 const struct hda_fixup *fix, int action)
5975 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5976 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5977 we can't adjust the speaker's volume since this node does not has
5978 Amp-out capability. we change the speaker's route to:
5979 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5980 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5981 speaker's volume now. */
5983 static const hda_nid_t conn1[] = { 0x0c };
5984 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
5988 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5989 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5990 const struct hda_fixup *fix, int action)
5992 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5993 static const hda_nid_t conn[] = { 0x02, 0x03 };
5994 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5998 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5999 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6000 const struct hda_fixup *fix, int action)
6002 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6003 static const hda_nid_t conn[] = { 0x02 };
6004 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6008 /* Hook to update amp GPIO4 for automute */
6009 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6010 struct hda_jack_callback *jack)
6012 struct alc_spec *spec = codec->spec;
6014 snd_hda_gen_hp_automute(codec, jack);
6015 /* mute_led_polarity is set to 0, so we pass inverted value here */
6016 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6017 !spec->gen.hp_jack_present);
6020 /* Manage GPIOs for HP EliteBook Folio 9480m.
6022 * GPIO4 is the headphone amplifier power control
6023 * GPIO3 is the audio output mute indicator LED
6026 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6027 const struct hda_fixup *fix,
6030 struct alc_spec *spec = codec->spec;
6032 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6033 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6034 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6035 spec->gpio_mask |= 0x10;
6036 spec->gpio_dir |= 0x10;
6037 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6041 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6042 const struct hda_fixup *fix,
6045 struct alc_spec *spec = codec->spec;
6047 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6048 spec->gpio_mask |= 0x04;
6049 spec->gpio_dir |= 0x04;
6050 /* set data bit low */
6054 /* Quirk for Thinkpad X1 7th and 8th Gen
6055 * The following fixed routing needed
6056 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6057 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6058 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6060 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6061 const struct hda_fixup *fix, int action)
6063 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6064 static const hda_nid_t preferred_pairs[] = {
6065 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6067 struct alc_spec *spec = codec->spec;
6070 case HDA_FIXUP_ACT_PRE_PROBE:
6071 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6072 spec->gen.preferred_dacs = preferred_pairs;
6074 case HDA_FIXUP_ACT_BUILD:
6075 /* The generic parser creates somewhat unintuitive volume ctls
6076 * with the fixed routing above, and the shared DAC2 may be
6078 * Rename those to unique names so that PA doesn't touch them
6079 * and use only Master volume.
6081 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6082 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6087 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6088 const struct hda_fixup *fix,
6091 alc_fixup_dual_codecs(codec, fix, action);
6093 case HDA_FIXUP_ACT_PRE_PROBE:
6094 /* override card longname to provide a unique UCM profile */
6095 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6097 case HDA_FIXUP_ACT_BUILD:
6098 /* rename Capture controls depending on the codec */
6099 rename_ctl(codec, "Capture Volume",
6101 "Rear-Panel Capture Volume" :
6102 "Front-Panel Capture Volume");
6103 rename_ctl(codec, "Capture Switch",
6105 "Rear-Panel Capture Switch" :
6106 "Front-Panel Capture Switch");
6111 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6112 const struct hda_fixup *fix, int action)
6114 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6117 codec->power_save_node = 1;
6120 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6121 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6122 const struct hda_fixup *fix, int action)
6124 struct alc_spec *spec = codec->spec;
6125 static const hda_nid_t preferred_pairs[] = {
6126 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6130 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6133 spec->gen.preferred_dacs = preferred_pairs;
6134 spec->gen.auto_mute_via_amp = 1;
6135 codec->power_save_node = 0;
6138 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6139 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6140 const struct hda_fixup *fix, int action)
6142 static const hda_nid_t preferred_pairs[] = {
6143 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6145 struct alc_spec *spec = codec->spec;
6147 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6148 spec->gen.preferred_dacs = preferred_pairs;
6149 spec->gen.obey_preferred_dacs = 1;
6153 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6154 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6155 const struct hda_fixup *fix, int action)
6157 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6160 snd_hda_override_wcaps(codec, 0x03, 0);
6163 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6165 switch (codec->core.vendor_id) {
6171 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6172 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6180 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6181 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6186 static void alc295_fixup_chromebook(struct hda_codec *codec,
6187 const struct hda_fixup *fix, int action)
6189 struct alc_spec *spec = codec->spec;
6192 case HDA_FIXUP_ACT_PRE_PROBE:
6193 spec->ultra_low_power = true;
6195 case HDA_FIXUP_ACT_INIT:
6196 alc_combo_jack_hp_jd_restart(codec);
6201 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6202 const struct hda_fixup *fix, int action)
6204 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6205 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6209 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6210 struct hda_jack_callback *cb)
6212 /* The Windows driver sets the codec up in a very different way where
6213 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6215 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6216 alc_write_coef_idx(codec, 0x10, 0x8a20);
6218 alc_write_coef_idx(codec, 0x10, 0x0a20);
6221 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6222 const struct hda_fixup *fix, int action)
6224 /* Pin 0x21: headphones/headset mic */
6225 if (!is_jack_detectable(codec, 0x21))
6229 case HDA_FIXUP_ACT_PRE_PROBE:
6230 snd_hda_jack_detect_enable_callback(codec, 0x21,
6231 alc294_gx502_toggle_output);
6233 case HDA_FIXUP_ACT_INIT:
6234 /* Make sure to start in a correct state, i.e. if
6235 * headphones have been plugged in before powering up the system
6237 alc294_gx502_toggle_output(codec, NULL);
6242 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6243 struct hda_jack_callback *cb)
6245 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6246 * responsible from changes between speakers and headphones
6248 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6249 alc_write_coef_idx(codec, 0x10, 0x8420);
6251 alc_write_coef_idx(codec, 0x10, 0x0a20);
6254 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6255 const struct hda_fixup *fix, int action)
6257 if (!is_jack_detectable(codec, 0x21))
6261 case HDA_FIXUP_ACT_PRE_PROBE:
6262 snd_hda_jack_detect_enable_callback(codec, 0x21,
6263 alc294_gu502_toggle_output);
6265 case HDA_FIXUP_ACT_INIT:
6266 alc294_gu502_toggle_output(codec, NULL);
6271 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6272 const struct hda_fixup *fix, int action)
6274 if (action != HDA_FIXUP_ACT_INIT)
6278 alc_write_coef_idx(codec, 0x65, 0x0);
6281 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6282 const struct hda_fixup *fix, int action)
6285 case HDA_FIXUP_ACT_INIT:
6286 alc_combo_jack_hp_jd_restart(codec);
6291 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6292 const struct hda_fixup *fix, int action)
6294 static const hda_nid_t conn[] = { 0x02 };
6295 static const struct hda_pintbl pincfgs[] = {
6296 { 0x14, 0x90170110 }, /* rear speaker */
6301 case HDA_FIXUP_ACT_PRE_PROBE:
6302 snd_hda_apply_pincfgs(codec, pincfgs);
6303 /* force front speaker to DAC1 */
6304 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6309 /* for hda_fixup_thinkpad_acpi() */
6310 #include "thinkpad_helper.c"
6312 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6313 const struct hda_fixup *fix, int action)
6315 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6316 hda_fixup_thinkpad_acpi(codec, fix, action);
6319 /* for alc295_fixup_hp_top_speakers */
6320 #include "hp_x360_helper.c"
6324 ALC269_FIXUP_SONY_VAIO,
6325 ALC275_FIXUP_SONY_VAIO_GPIO2,
6326 ALC269_FIXUP_DELL_M101Z,
6327 ALC269_FIXUP_SKU_IGNORE,
6328 ALC269_FIXUP_ASUS_G73JW,
6329 ALC269_FIXUP_LENOVO_EAPD,
6330 ALC275_FIXUP_SONY_HWEQ,
6331 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6333 ALC269_FIXUP_PCM_44K,
6334 ALC269_FIXUP_STEREO_DMIC,
6335 ALC269_FIXUP_HEADSET_MIC,
6336 ALC269_FIXUP_QUANTA_MUTE,
6337 ALC269_FIXUP_LIFEBOOK,
6338 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6339 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6340 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6341 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6344 ALC269VB_FIXUP_AMIC,
6345 ALC269VB_FIXUP_DMIC,
6346 ALC269_FIXUP_HP_MUTE_LED,
6347 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6348 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6349 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6350 ALC269_FIXUP_HP_GPIO_LED,
6351 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6352 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6353 ALC269_FIXUP_INV_DMIC,
6354 ALC269_FIXUP_LENOVO_DOCK,
6355 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6356 ALC269_FIXUP_NO_SHUTUP,
6357 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6358 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6359 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6360 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6361 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6362 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6363 ALC269_FIXUP_HEADSET_MODE,
6364 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6365 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6366 ALC269_FIXUP_ASUS_X101_FUNC,
6367 ALC269_FIXUP_ASUS_X101_VERB,
6368 ALC269_FIXUP_ASUS_X101,
6369 ALC271_FIXUP_AMIC_MIC2,
6370 ALC271_FIXUP_HP_GATE_MIC_JACK,
6371 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6372 ALC269_FIXUP_ACER_AC700,
6373 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6374 ALC269VB_FIXUP_ASUS_ZENBOOK,
6375 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6376 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
6377 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6378 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6379 ALC283_FIXUP_CHROME_BOOK,
6380 ALC283_FIXUP_SENSE_COMBO_JACK,
6381 ALC282_FIXUP_ASUS_TX300,
6382 ALC283_FIXUP_INT_MIC,
6383 ALC290_FIXUP_MONO_SPEAKERS,
6384 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6385 ALC290_FIXUP_SUBWOOFER,
6386 ALC290_FIXUP_SUBWOOFER_HSJACK,
6387 ALC269_FIXUP_THINKPAD_ACPI,
6388 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6389 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6390 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6391 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6392 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6393 ALC255_FIXUP_HEADSET_MODE,
6394 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6395 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6396 ALC292_FIXUP_TPT440_DOCK,
6397 ALC292_FIXUP_TPT440,
6398 ALC283_FIXUP_HEADSET_MIC,
6399 ALC255_FIXUP_MIC_MUTE_LED,
6400 ALC282_FIXUP_ASPIRE_V5_PINS,
6401 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6402 ALC280_FIXUP_HP_GPIO4,
6403 ALC286_FIXUP_HP_GPIO_LED,
6404 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6405 ALC280_FIXUP_HP_DOCK_PINS,
6406 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6407 ALC280_FIXUP_HP_9480M,
6408 ALC288_FIXUP_DELL_HEADSET_MODE,
6409 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6410 ALC288_FIXUP_DELL_XPS_13,
6411 ALC288_FIXUP_DISABLE_AAMIX,
6412 ALC292_FIXUP_DELL_E7X_AAMIX,
6413 ALC292_FIXUP_DELL_E7X,
6414 ALC292_FIXUP_DISABLE_AAMIX,
6415 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6416 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6417 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6418 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6419 ALC275_FIXUP_DELL_XPS,
6420 ALC293_FIXUP_LENOVO_SPK_NOISE,
6421 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6422 ALC255_FIXUP_DELL_SPK_NOISE,
6423 ALC225_FIXUP_DISABLE_MIC_VREF,
6424 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6425 ALC295_FIXUP_DISABLE_DAC3,
6426 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6427 ALC280_FIXUP_HP_HEADSET_MIC,
6428 ALC221_FIXUP_HP_FRONT_MIC,
6429 ALC292_FIXUP_TPT460,
6430 ALC298_FIXUP_SPK_VOLUME,
6431 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6432 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6433 ALC269_FIXUP_ATIV_BOOK_8,
6434 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
6435 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6436 ALC256_FIXUP_ASUS_HEADSET_MODE,
6437 ALC256_FIXUP_ASUS_MIC,
6438 ALC256_FIXUP_ASUS_AIO_GPIO2,
6439 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6440 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6441 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6442 ALC233_FIXUP_ACER_HEADSET_MIC,
6443 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6444 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6445 ALC225_FIXUP_S3_POP_NOISE,
6446 ALC700_FIXUP_INTEL_REFERENCE,
6447 ALC274_FIXUP_DELL_BIND_DACS,
6448 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6449 ALC298_FIXUP_TPT470_DOCK_FIX,
6450 ALC298_FIXUP_TPT470_DOCK,
6451 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6452 ALC255_FIXUP_DELL_HEADSET_MIC,
6453 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6454 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6455 ALC295_FIXUP_HP_X360,
6456 ALC221_FIXUP_HP_HEADSET_MIC,
6457 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6458 ALC295_FIXUP_HP_AUTO_MUTE,
6459 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6460 ALC294_FIXUP_ASUS_MIC,
6461 ALC294_FIXUP_ASUS_HEADSET_MIC,
6462 ALC294_FIXUP_ASUS_SPK,
6463 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6464 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6465 ALC255_FIXUP_ACER_HEADSET_MIC,
6466 ALC295_FIXUP_CHROME_BOOK,
6467 ALC225_FIXUP_HEADSET_JACK,
6468 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6469 ALC225_FIXUP_WYSE_AUTO_MUTE,
6470 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6471 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6472 ALC256_FIXUP_ASUS_HEADSET_MIC,
6473 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6474 ALC299_FIXUP_PREDATOR_SPK,
6475 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6476 ALC289_FIXUP_DELL_SPK2,
6477 ALC289_FIXUP_DUAL_SPK,
6478 ALC294_FIXUP_SPK2_TO_DAC1,
6479 ALC294_FIXUP_ASUS_DUAL_SPK,
6480 ALC285_FIXUP_THINKPAD_X1_GEN7,
6481 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6482 ALC294_FIXUP_ASUS_HPE,
6483 ALC294_FIXUP_ASUS_COEF_1B,
6484 ALC294_FIXUP_ASUS_GX502_HP,
6485 ALC294_FIXUP_ASUS_GX502_PINS,
6486 ALC294_FIXUP_ASUS_GX502_VERBS,
6487 ALC294_FIXUP_ASUS_GU502_HP,
6488 ALC294_FIXUP_ASUS_GU502_PINS,
6489 ALC294_FIXUP_ASUS_GU502_VERBS,
6490 ALC294_FIXUP_ASUS_G513_PINS,
6491 ALC285_FIXUP_ASUS_G533Z_PINS,
6492 ALC285_FIXUP_HP_GPIO_LED,
6493 ALC285_FIXUP_HP_MUTE_LED,
6494 ALC236_FIXUP_HP_GPIO_LED,
6495 ALC236_FIXUP_HP_MUTE_LED,
6496 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6497 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6498 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6499 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6500 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6501 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6502 ALC289_FIXUP_ASUS_GA401,
6503 ALC289_FIXUP_ASUS_GA502,
6504 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6505 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6506 ALC269_FIXUP_CZC_B20,
6507 ALC269_FIXUP_CZC_TMI,
6508 ALC269_FIXUP_CZC_L101,
6509 ALC269_FIXUP_LEMOTE_A1802,
6510 ALC269_FIXUP_LEMOTE_A190X,
6511 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6512 ALC233_FIXUP_INTEL_NUC8_DMIC,
6513 ALC233_FIXUP_INTEL_NUC8_BOOST,
6514 ALC256_FIXUP_INTEL_NUC10,
6515 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6516 ALC274_FIXUP_HP_MIC,
6517 ALC274_FIXUP_HP_HEADSET_MIC,
6518 ALC256_FIXUP_ASUS_HPE,
6519 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6520 ALC295_FIXUP_ASUS_DACS,
6521 ALC295_FIXUP_HP_OMEN,
6522 ALC285_FIXUP_HP_SPECTRE_X360,
6525 static const struct hda_fixup alc269_fixups[] = {
6526 [ALC269_FIXUP_GPIO2] = {
6527 .type = HDA_FIXUP_FUNC,
6528 .v.func = alc_fixup_gpio2,
6530 [ALC269_FIXUP_SONY_VAIO] = {
6531 .type = HDA_FIXUP_PINCTLS,
6532 .v.pins = (const struct hda_pintbl[]) {
6533 {0x19, PIN_VREFGRD},
6537 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6538 .type = HDA_FIXUP_FUNC,
6539 .v.func = alc275_fixup_gpio4_off,
6541 .chain_id = ALC269_FIXUP_SONY_VAIO
6543 [ALC269_FIXUP_DELL_M101Z] = {
6544 .type = HDA_FIXUP_VERBS,
6545 .v.verbs = (const struct hda_verb[]) {
6546 /* Enables internal speaker */
6547 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6548 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6552 [ALC269_FIXUP_SKU_IGNORE] = {
6553 .type = HDA_FIXUP_FUNC,
6554 .v.func = alc_fixup_sku_ignore,
6556 [ALC269_FIXUP_ASUS_G73JW] = {
6557 .type = HDA_FIXUP_PINS,
6558 .v.pins = (const struct hda_pintbl[]) {
6559 { 0x17, 0x99130111 }, /* subwoofer */
6563 [ALC269_FIXUP_LENOVO_EAPD] = {
6564 .type = HDA_FIXUP_VERBS,
6565 .v.verbs = (const struct hda_verb[]) {
6566 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6570 [ALC275_FIXUP_SONY_HWEQ] = {
6571 .type = HDA_FIXUP_FUNC,
6572 .v.func = alc269_fixup_hweq,
6574 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6576 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6577 .type = HDA_FIXUP_FUNC,
6578 .v.func = alc_fixup_disable_aamix,
6580 .chain_id = ALC269_FIXUP_SONY_VAIO
6582 [ALC271_FIXUP_DMIC] = {
6583 .type = HDA_FIXUP_FUNC,
6584 .v.func = alc271_fixup_dmic,
6586 [ALC269_FIXUP_PCM_44K] = {
6587 .type = HDA_FIXUP_FUNC,
6588 .v.func = alc269_fixup_pcm_44k,
6590 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6592 [ALC269_FIXUP_STEREO_DMIC] = {
6593 .type = HDA_FIXUP_FUNC,
6594 .v.func = alc269_fixup_stereo_dmic,
6596 [ALC269_FIXUP_HEADSET_MIC] = {
6597 .type = HDA_FIXUP_FUNC,
6598 .v.func = alc269_fixup_headset_mic,
6600 [ALC269_FIXUP_QUANTA_MUTE] = {
6601 .type = HDA_FIXUP_FUNC,
6602 .v.func = alc269_fixup_quanta_mute,
6604 [ALC269_FIXUP_LIFEBOOK] = {
6605 .type = HDA_FIXUP_PINS,
6606 .v.pins = (const struct hda_pintbl[]) {
6607 { 0x1a, 0x2101103f }, /* dock line-out */
6608 { 0x1b, 0x23a11040 }, /* dock mic-in */
6612 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6614 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6615 .type = HDA_FIXUP_PINS,
6616 .v.pins = (const struct hda_pintbl[]) {
6617 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6621 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6622 .type = HDA_FIXUP_PINS,
6623 .v.pins = (const struct hda_pintbl[]) {
6624 { 0x21, 0x0221102f }, /* HP out */
6628 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6629 .type = HDA_FIXUP_FUNC,
6630 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6632 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6633 .type = HDA_FIXUP_FUNC,
6634 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6636 [ALC269_FIXUP_AMIC] = {
6637 .type = HDA_FIXUP_PINS,
6638 .v.pins = (const struct hda_pintbl[]) {
6639 { 0x14, 0x99130110 }, /* speaker */
6640 { 0x15, 0x0121401f }, /* HP out */
6641 { 0x18, 0x01a19c20 }, /* mic */
6642 { 0x19, 0x99a3092f }, /* int-mic */
6646 [ALC269_FIXUP_DMIC] = {
6647 .type = HDA_FIXUP_PINS,
6648 .v.pins = (const struct hda_pintbl[]) {
6649 { 0x12, 0x99a3092f }, /* int-mic */
6650 { 0x14, 0x99130110 }, /* speaker */
6651 { 0x15, 0x0121401f }, /* HP out */
6652 { 0x18, 0x01a19c20 }, /* mic */
6656 [ALC269VB_FIXUP_AMIC] = {
6657 .type = HDA_FIXUP_PINS,
6658 .v.pins = (const struct hda_pintbl[]) {
6659 { 0x14, 0x99130110 }, /* speaker */
6660 { 0x18, 0x01a19c20 }, /* mic */
6661 { 0x19, 0x99a3092f }, /* int-mic */
6662 { 0x21, 0x0121401f }, /* HP out */
6666 [ALC269VB_FIXUP_DMIC] = {
6667 .type = HDA_FIXUP_PINS,
6668 .v.pins = (const struct hda_pintbl[]) {
6669 { 0x12, 0x99a3092f }, /* int-mic */
6670 { 0x14, 0x99130110 }, /* speaker */
6671 { 0x18, 0x01a19c20 }, /* mic */
6672 { 0x21, 0x0121401f }, /* HP out */
6676 [ALC269_FIXUP_HP_MUTE_LED] = {
6677 .type = HDA_FIXUP_FUNC,
6678 .v.func = alc269_fixup_hp_mute_led,
6680 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6681 .type = HDA_FIXUP_FUNC,
6682 .v.func = alc269_fixup_hp_mute_led_mic1,
6684 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6685 .type = HDA_FIXUP_FUNC,
6686 .v.func = alc269_fixup_hp_mute_led_mic2,
6688 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6689 .type = HDA_FIXUP_FUNC,
6690 .v.func = alc269_fixup_hp_mute_led_mic3,
6692 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6694 [ALC269_FIXUP_HP_GPIO_LED] = {
6695 .type = HDA_FIXUP_FUNC,
6696 .v.func = alc269_fixup_hp_gpio_led,
6698 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6699 .type = HDA_FIXUP_FUNC,
6700 .v.func = alc269_fixup_hp_gpio_mic1_led,
6702 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6703 .type = HDA_FIXUP_FUNC,
6704 .v.func = alc269_fixup_hp_line1_mic1_led,
6706 [ALC269_FIXUP_INV_DMIC] = {
6707 .type = HDA_FIXUP_FUNC,
6708 .v.func = alc_fixup_inv_dmic,
6710 [ALC269_FIXUP_NO_SHUTUP] = {
6711 .type = HDA_FIXUP_FUNC,
6712 .v.func = alc_fixup_no_shutup,
6714 [ALC269_FIXUP_LENOVO_DOCK] = {
6715 .type = HDA_FIXUP_PINS,
6716 .v.pins = (const struct hda_pintbl[]) {
6717 { 0x19, 0x23a11040 }, /* dock mic */
6718 { 0x1b, 0x2121103f }, /* dock headphone */
6722 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6724 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6725 .type = HDA_FIXUP_FUNC,
6726 .v.func = alc269_fixup_limit_int_mic_boost,
6728 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6730 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6731 .type = HDA_FIXUP_FUNC,
6732 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6734 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6736 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6737 .type = HDA_FIXUP_PINS,
6738 .v.pins = (const struct hda_pintbl[]) {
6739 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6740 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6744 .chain_id = ALC269_FIXUP_HEADSET_MODE
6746 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6747 .type = HDA_FIXUP_PINS,
6748 .v.pins = (const struct hda_pintbl[]) {
6749 { 0x16, 0x21014020 }, /* dock line out */
6750 { 0x19, 0x21a19030 }, /* dock mic */
6751 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6755 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6757 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6758 .type = HDA_FIXUP_PINS,
6759 .v.pins = (const struct hda_pintbl[]) {
6760 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6764 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6766 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6767 .type = HDA_FIXUP_PINS,
6768 .v.pins = (const struct hda_pintbl[]) {
6769 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6770 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6774 .chain_id = ALC269_FIXUP_HEADSET_MODE
6776 [ALC269_FIXUP_HEADSET_MODE] = {
6777 .type = HDA_FIXUP_FUNC,
6778 .v.func = alc_fixup_headset_mode,
6780 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6782 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6783 .type = HDA_FIXUP_FUNC,
6784 .v.func = alc_fixup_headset_mode_no_hp_mic,
6786 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6787 .type = HDA_FIXUP_PINS,
6788 .v.pins = (const struct hda_pintbl[]) {
6789 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6793 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6795 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6796 .type = HDA_FIXUP_PINS,
6797 .v.pins = (const struct hda_pintbl[]) {
6798 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6802 .chain_id = ALC269_FIXUP_HEADSET_MIC
6804 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
6805 .type = HDA_FIXUP_PINS,
6806 .v.pins = (const struct hda_pintbl[]) {
6820 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6822 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
6823 .type = HDA_FIXUP_FUNC,
6824 .v.func = alc298_fixup_huawei_mbx_stereo,
6826 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6828 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6829 .type = HDA_FIXUP_FUNC,
6830 .v.func = alc269_fixup_x101_headset_mic,
6832 [ALC269_FIXUP_ASUS_X101_VERB] = {
6833 .type = HDA_FIXUP_VERBS,
6834 .v.verbs = (const struct hda_verb[]) {
6835 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6836 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6837 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6841 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6843 [ALC269_FIXUP_ASUS_X101] = {
6844 .type = HDA_FIXUP_PINS,
6845 .v.pins = (const struct hda_pintbl[]) {
6846 { 0x18, 0x04a1182c }, /* Headset mic */
6850 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6852 [ALC271_FIXUP_AMIC_MIC2] = {
6853 .type = HDA_FIXUP_PINS,
6854 .v.pins = (const struct hda_pintbl[]) {
6855 { 0x14, 0x99130110 }, /* speaker */
6856 { 0x19, 0x01a19c20 }, /* mic */
6857 { 0x1b, 0x99a7012f }, /* int-mic */
6858 { 0x21, 0x0121401f }, /* HP out */
6862 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6863 .type = HDA_FIXUP_FUNC,
6864 .v.func = alc271_hp_gate_mic_jack,
6866 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6868 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6869 .type = HDA_FIXUP_FUNC,
6870 .v.func = alc269_fixup_limit_int_mic_boost,
6872 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6874 [ALC269_FIXUP_ACER_AC700] = {
6875 .type = HDA_FIXUP_PINS,
6876 .v.pins = (const struct hda_pintbl[]) {
6877 { 0x12, 0x99a3092f }, /* int-mic */
6878 { 0x14, 0x99130110 }, /* speaker */
6879 { 0x18, 0x03a11c20 }, /* mic */
6880 { 0x1e, 0x0346101e }, /* SPDIF1 */
6881 { 0x21, 0x0321101f }, /* HP out */
6885 .chain_id = ALC271_FIXUP_DMIC,
6887 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6888 .type = HDA_FIXUP_FUNC,
6889 .v.func = alc269_fixup_limit_int_mic_boost,
6891 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6893 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6894 .type = HDA_FIXUP_FUNC,
6895 .v.func = alc269_fixup_limit_int_mic_boost,
6897 .chain_id = ALC269VB_FIXUP_DMIC,
6899 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6900 .type = HDA_FIXUP_VERBS,
6901 .v.verbs = (const struct hda_verb[]) {
6902 /* class-D output amp +5dB */
6903 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6904 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6908 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6910 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6911 .type = HDA_FIXUP_PINS,
6912 .v.pins = (const struct hda_pintbl[]) {
6913 { 0x18, 0x01a110f0 }, /* use as headset mic */
6917 .chain_id = ALC269_FIXUP_HEADSET_MIC
6919 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6920 .type = HDA_FIXUP_FUNC,
6921 .v.func = alc269_fixup_limit_int_mic_boost,
6923 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6925 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6926 .type = HDA_FIXUP_PINS,
6927 .v.pins = (const struct hda_pintbl[]) {
6928 { 0x12, 0x99a3092f }, /* int-mic */
6929 { 0x18, 0x03a11d20 }, /* mic */
6930 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6934 [ALC283_FIXUP_CHROME_BOOK] = {
6935 .type = HDA_FIXUP_FUNC,
6936 .v.func = alc283_fixup_chromebook,
6938 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6939 .type = HDA_FIXUP_FUNC,
6940 .v.func = alc283_fixup_sense_combo_jack,
6942 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6944 [ALC282_FIXUP_ASUS_TX300] = {
6945 .type = HDA_FIXUP_FUNC,
6946 .v.func = alc282_fixup_asus_tx300,
6948 [ALC283_FIXUP_INT_MIC] = {
6949 .type = HDA_FIXUP_VERBS,
6950 .v.verbs = (const struct hda_verb[]) {
6951 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6952 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6956 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6958 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6959 .type = HDA_FIXUP_PINS,
6960 .v.pins = (const struct hda_pintbl[]) {
6961 { 0x17, 0x90170112 }, /* subwoofer */
6965 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6967 [ALC290_FIXUP_SUBWOOFER] = {
6968 .type = HDA_FIXUP_PINS,
6969 .v.pins = (const struct hda_pintbl[]) {
6970 { 0x17, 0x90170112 }, /* subwoofer */
6974 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6976 [ALC290_FIXUP_MONO_SPEAKERS] = {
6977 .type = HDA_FIXUP_FUNC,
6978 .v.func = alc290_fixup_mono_speakers,
6980 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6981 .type = HDA_FIXUP_FUNC,
6982 .v.func = alc290_fixup_mono_speakers,
6984 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6986 [ALC269_FIXUP_THINKPAD_ACPI] = {
6987 .type = HDA_FIXUP_FUNC,
6988 .v.func = alc_fixup_thinkpad_acpi,
6990 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6992 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6993 .type = HDA_FIXUP_FUNC,
6994 .v.func = alc_fixup_inv_dmic,
6996 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6998 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6999 .type = HDA_FIXUP_PINS,
7000 .v.pins = (const struct hda_pintbl[]) {
7001 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7005 .chain_id = ALC255_FIXUP_HEADSET_MODE
7007 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7008 .type = HDA_FIXUP_PINS,
7009 .v.pins = (const struct hda_pintbl[]) {
7010 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7014 .chain_id = ALC255_FIXUP_HEADSET_MODE
7016 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7017 .type = HDA_FIXUP_PINS,
7018 .v.pins = (const struct hda_pintbl[]) {
7019 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7020 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7024 .chain_id = ALC255_FIXUP_HEADSET_MODE
7026 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7027 .type = HDA_FIXUP_PINS,
7028 .v.pins = (const struct hda_pintbl[]) {
7029 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7033 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7035 [ALC255_FIXUP_HEADSET_MODE] = {
7036 .type = HDA_FIXUP_FUNC,
7037 .v.func = alc_fixup_headset_mode_alc255,
7039 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7041 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7042 .type = HDA_FIXUP_FUNC,
7043 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7045 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7046 .type = HDA_FIXUP_PINS,
7047 .v.pins = (const struct hda_pintbl[]) {
7048 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7049 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7053 .chain_id = ALC269_FIXUP_HEADSET_MODE
7055 [ALC292_FIXUP_TPT440_DOCK] = {
7056 .type = HDA_FIXUP_FUNC,
7057 .v.func = alc_fixup_tpt440_dock,
7059 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7061 [ALC292_FIXUP_TPT440] = {
7062 .type = HDA_FIXUP_FUNC,
7063 .v.func = alc_fixup_disable_aamix,
7065 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7067 [ALC283_FIXUP_HEADSET_MIC] = {
7068 .type = HDA_FIXUP_PINS,
7069 .v.pins = (const struct hda_pintbl[]) {
7070 { 0x19, 0x04a110f0 },
7074 [ALC255_FIXUP_MIC_MUTE_LED] = {
7075 .type = HDA_FIXUP_FUNC,
7076 .v.func = snd_hda_gen_fixup_micmute_led,
7078 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7079 .type = HDA_FIXUP_PINS,
7080 .v.pins = (const struct hda_pintbl[]) {
7081 { 0x12, 0x90a60130 },
7082 { 0x14, 0x90170110 },
7083 { 0x17, 0x40000008 },
7084 { 0x18, 0x411111f0 },
7085 { 0x19, 0x01a1913c },
7086 { 0x1a, 0x411111f0 },
7087 { 0x1b, 0x411111f0 },
7088 { 0x1d, 0x40f89b2d },
7089 { 0x1e, 0x411111f0 },
7090 { 0x21, 0x0321101f },
7094 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7095 .type = HDA_FIXUP_FUNC,
7096 .v.func = alc269vb_fixup_aspire_e1_coef,
7098 [ALC280_FIXUP_HP_GPIO4] = {
7099 .type = HDA_FIXUP_FUNC,
7100 .v.func = alc280_fixup_hp_gpio4,
7102 [ALC286_FIXUP_HP_GPIO_LED] = {
7103 .type = HDA_FIXUP_FUNC,
7104 .v.func = alc286_fixup_hp_gpio_led,
7106 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7107 .type = HDA_FIXUP_FUNC,
7108 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7110 [ALC280_FIXUP_HP_DOCK_PINS] = {
7111 .type = HDA_FIXUP_PINS,
7112 .v.pins = (const struct hda_pintbl[]) {
7113 { 0x1b, 0x21011020 }, /* line-out */
7114 { 0x1a, 0x01a1903c }, /* headset mic */
7115 { 0x18, 0x2181103f }, /* line-in */
7119 .chain_id = ALC280_FIXUP_HP_GPIO4
7121 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7122 .type = HDA_FIXUP_PINS,
7123 .v.pins = (const struct hda_pintbl[]) {
7124 { 0x1b, 0x21011020 }, /* line-out */
7125 { 0x18, 0x2181103f }, /* line-in */
7129 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7131 [ALC280_FIXUP_HP_9480M] = {
7132 .type = HDA_FIXUP_FUNC,
7133 .v.func = alc280_fixup_hp_9480m,
7135 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7136 .type = HDA_FIXUP_FUNC,
7137 .v.func = alc_fixup_headset_mode_dell_alc288,
7139 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7141 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7142 .type = HDA_FIXUP_PINS,
7143 .v.pins = (const struct hda_pintbl[]) {
7144 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7145 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7149 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7151 [ALC288_FIXUP_DISABLE_AAMIX] = {
7152 .type = HDA_FIXUP_FUNC,
7153 .v.func = alc_fixup_disable_aamix,
7155 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7157 [ALC288_FIXUP_DELL_XPS_13] = {
7158 .type = HDA_FIXUP_FUNC,
7159 .v.func = alc_fixup_dell_xps13,
7161 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7163 [ALC292_FIXUP_DISABLE_AAMIX] = {
7164 .type = HDA_FIXUP_FUNC,
7165 .v.func = alc_fixup_disable_aamix,
7167 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7169 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7170 .type = HDA_FIXUP_FUNC,
7171 .v.func = alc_fixup_disable_aamix,
7173 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7175 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7176 .type = HDA_FIXUP_FUNC,
7177 .v.func = alc_fixup_dell_xps13,
7179 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7181 [ALC292_FIXUP_DELL_E7X] = {
7182 .type = HDA_FIXUP_FUNC,
7183 .v.func = snd_hda_gen_fixup_micmute_led,
7184 /* micmute fixup must be applied at last */
7185 .chained_before = true,
7186 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7188 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7189 .type = HDA_FIXUP_PINS,
7190 .v.pins = (const struct hda_pintbl[]) {
7191 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7194 .chained_before = true,
7195 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7197 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7198 .type = HDA_FIXUP_PINS,
7199 .v.pins = (const struct hda_pintbl[]) {
7200 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7201 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7205 .chain_id = ALC269_FIXUP_HEADSET_MODE
7207 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7208 .type = HDA_FIXUP_PINS,
7209 .v.pins = (const struct hda_pintbl[]) {
7210 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7214 .chain_id = ALC269_FIXUP_HEADSET_MODE
7216 [ALC275_FIXUP_DELL_XPS] = {
7217 .type = HDA_FIXUP_VERBS,
7218 .v.verbs = (const struct hda_verb[]) {
7219 /* Enables internal speaker */
7220 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7221 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7222 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7223 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7227 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7228 .type = HDA_FIXUP_FUNC,
7229 .v.func = alc_fixup_disable_aamix,
7231 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7233 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7234 .type = HDA_FIXUP_FUNC,
7235 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7237 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7238 .type = HDA_FIXUP_FUNC,
7239 .v.func = alc_fixup_inv_dmic,
7241 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7243 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7244 .type = HDA_FIXUP_FUNC,
7245 .v.func = alc269_fixup_limit_int_mic_boost
7247 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7248 .type = HDA_FIXUP_FUNC,
7249 .v.func = alc_fixup_disable_aamix,
7251 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7253 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7254 .type = HDA_FIXUP_FUNC,
7255 .v.func = alc_fixup_disable_mic_vref,
7257 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7259 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7260 .type = HDA_FIXUP_VERBS,
7261 .v.verbs = (const struct hda_verb[]) {
7262 /* Disable pass-through path for FRONT 14h */
7263 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7264 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7268 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7270 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7271 .type = HDA_FIXUP_FUNC,
7272 .v.func = alc_fixup_disable_aamix,
7274 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7276 [ALC221_FIXUP_HP_FRONT_MIC] = {
7277 .type = HDA_FIXUP_PINS,
7278 .v.pins = (const struct hda_pintbl[]) {
7279 { 0x19, 0x02a19020 }, /* Front Mic */
7283 [ALC292_FIXUP_TPT460] = {
7284 .type = HDA_FIXUP_FUNC,
7285 .v.func = alc_fixup_tpt440_dock,
7287 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7289 [ALC298_FIXUP_SPK_VOLUME] = {
7290 .type = HDA_FIXUP_FUNC,
7291 .v.func = alc298_fixup_speaker_volume,
7293 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7295 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7296 .type = HDA_FIXUP_FUNC,
7297 .v.func = alc298_fixup_speaker_volume,
7299 [ALC295_FIXUP_DISABLE_DAC3] = {
7300 .type = HDA_FIXUP_FUNC,
7301 .v.func = alc295_fixup_disable_dac3,
7303 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7304 .type = HDA_FIXUP_FUNC,
7305 .v.func = alc285_fixup_speaker2_to_dac1,
7307 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7309 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7310 .type = HDA_FIXUP_PINS,
7311 .v.pins = (const struct hda_pintbl[]) {
7312 { 0x1b, 0x90170151 },
7316 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7318 [ALC269_FIXUP_ATIV_BOOK_8] = {
7319 .type = HDA_FIXUP_FUNC,
7320 .v.func = alc_fixup_auto_mute_via_amp,
7322 .chain_id = ALC269_FIXUP_NO_SHUTUP
7324 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
7325 .type = HDA_FIXUP_PINS,
7326 .v.pins = (const struct hda_pintbl[]) {
7327 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7328 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
7332 .chain_id = ALC269_FIXUP_HEADSET_MODE
7334 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7335 .type = HDA_FIXUP_PINS,
7336 .v.pins = (const struct hda_pintbl[]) {
7337 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7338 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7342 .chain_id = ALC269_FIXUP_HEADSET_MODE
7344 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7345 .type = HDA_FIXUP_FUNC,
7346 .v.func = alc_fixup_headset_mode,
7348 [ALC256_FIXUP_ASUS_MIC] = {
7349 .type = HDA_FIXUP_PINS,
7350 .v.pins = (const struct hda_pintbl[]) {
7351 { 0x13, 0x90a60160 }, /* use as internal mic */
7352 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7356 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7358 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7359 .type = HDA_FIXUP_FUNC,
7360 /* Set up GPIO2 for the speaker amp */
7361 .v.func = alc_fixup_gpio4,
7363 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7364 .type = HDA_FIXUP_PINS,
7365 .v.pins = (const struct hda_pintbl[]) {
7366 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7370 .chain_id = ALC269_FIXUP_HEADSET_MIC
7372 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7373 .type = HDA_FIXUP_VERBS,
7374 .v.verbs = (const struct hda_verb[]) {
7375 /* Enables internal speaker */
7376 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7377 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7381 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7383 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7384 .type = HDA_FIXUP_FUNC,
7385 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7387 .chain_id = ALC269_FIXUP_GPIO2
7389 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7390 .type = HDA_FIXUP_VERBS,
7391 .v.verbs = (const struct hda_verb[]) {
7392 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7393 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7397 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7399 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7400 .type = HDA_FIXUP_PINS,
7401 .v.pins = (const struct hda_pintbl[]) {
7402 /* Change the mic location from front to right, otherwise there are
7403 two front mics with the same name, pulseaudio can't handle them.
7404 This is just a temporary workaround, after applying this fixup,
7405 there will be one "Front Mic" and one "Mic" in this machine.
7407 { 0x1a, 0x04a19040 },
7411 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7412 .type = HDA_FIXUP_PINS,
7413 .v.pins = (const struct hda_pintbl[]) {
7414 { 0x16, 0x0101102f }, /* Rear Headset HP */
7415 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7416 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7417 { 0x1b, 0x02011020 },
7421 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7423 [ALC225_FIXUP_S3_POP_NOISE] = {
7424 .type = HDA_FIXUP_FUNC,
7425 .v.func = alc225_fixup_s3_pop_noise,
7427 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7429 [ALC700_FIXUP_INTEL_REFERENCE] = {
7430 .type = HDA_FIXUP_VERBS,
7431 .v.verbs = (const struct hda_verb[]) {
7432 /* Enables internal speaker */
7433 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7434 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7435 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7436 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7437 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7438 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7439 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7440 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7444 [ALC274_FIXUP_DELL_BIND_DACS] = {
7445 .type = HDA_FIXUP_FUNC,
7446 .v.func = alc274_fixup_bind_dacs,
7448 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7450 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7451 .type = HDA_FIXUP_PINS,
7452 .v.pins = (const struct hda_pintbl[]) {
7453 { 0x1b, 0x0401102f },
7457 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7459 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7460 .type = HDA_FIXUP_FUNC,
7461 .v.func = alc_fixup_tpt470_dock,
7463 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7465 [ALC298_FIXUP_TPT470_DOCK] = {
7466 .type = HDA_FIXUP_FUNC,
7467 .v.func = alc_fixup_tpt470_dacs,
7469 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7471 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7472 .type = HDA_FIXUP_PINS,
7473 .v.pins = (const struct hda_pintbl[]) {
7474 { 0x14, 0x0201101f },
7478 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7480 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7481 .type = HDA_FIXUP_PINS,
7482 .v.pins = (const struct hda_pintbl[]) {
7483 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7487 .chain_id = ALC269_FIXUP_HEADSET_MIC
7489 [ALC295_FIXUP_HP_X360] = {
7490 .type = HDA_FIXUP_FUNC,
7491 .v.func = alc295_fixup_hp_top_speakers,
7493 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7495 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7496 .type = HDA_FIXUP_PINS,
7497 .v.pins = (const struct hda_pintbl[]) {
7498 { 0x19, 0x0181313f},
7502 .chain_id = ALC269_FIXUP_HEADSET_MIC
7504 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7505 .type = HDA_FIXUP_FUNC,
7506 .v.func = alc285_fixup_invalidate_dacs,
7508 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7510 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7511 .type = HDA_FIXUP_FUNC,
7512 .v.func = alc_fixup_auto_mute_via_amp,
7514 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7515 .type = HDA_FIXUP_PINS,
7516 .v.pins = (const struct hda_pintbl[]) {
7517 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7521 .chain_id = ALC269_FIXUP_HEADSET_MIC
7523 [ALC294_FIXUP_ASUS_MIC] = {
7524 .type = HDA_FIXUP_PINS,
7525 .v.pins = (const struct hda_pintbl[]) {
7526 { 0x13, 0x90a60160 }, /* use as internal mic */
7527 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7531 .chain_id = ALC269_FIXUP_HEADSET_MIC
7533 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7534 .type = HDA_FIXUP_PINS,
7535 .v.pins = (const struct hda_pintbl[]) {
7536 { 0x19, 0x01a1103c }, /* use as headset mic */
7540 .chain_id = ALC269_FIXUP_HEADSET_MIC
7542 [ALC294_FIXUP_ASUS_SPK] = {
7543 .type = HDA_FIXUP_VERBS,
7544 .v.verbs = (const struct hda_verb[]) {
7546 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7547 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7548 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7549 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7553 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7555 [ALC295_FIXUP_CHROME_BOOK] = {
7556 .type = HDA_FIXUP_FUNC,
7557 .v.func = alc295_fixup_chromebook,
7559 .chain_id = ALC225_FIXUP_HEADSET_JACK
7561 [ALC225_FIXUP_HEADSET_JACK] = {
7562 .type = HDA_FIXUP_FUNC,
7563 .v.func = alc_fixup_headset_jack,
7565 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7566 .type = HDA_FIXUP_PINS,
7567 .v.pins = (const struct hda_pintbl[]) {
7568 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7572 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7574 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7575 .type = HDA_FIXUP_VERBS,
7576 .v.verbs = (const struct hda_verb[]) {
7577 /* Disable PCBEEP-IN passthrough */
7578 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7579 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7583 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7585 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7586 .type = HDA_FIXUP_PINS,
7587 .v.pins = (const struct hda_pintbl[]) {
7588 { 0x19, 0x03a11130 },
7589 { 0x1a, 0x90a60140 }, /* use as internal mic */
7593 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7595 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7596 .type = HDA_FIXUP_PINS,
7597 .v.pins = (const struct hda_pintbl[]) {
7598 { 0x16, 0x01011020 }, /* Rear Line out */
7599 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7603 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7605 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7606 .type = HDA_FIXUP_FUNC,
7607 .v.func = alc_fixup_auto_mute_via_amp,
7609 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7611 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7612 .type = HDA_FIXUP_FUNC,
7613 .v.func = alc_fixup_disable_mic_vref,
7615 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7617 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7618 .type = HDA_FIXUP_VERBS,
7619 .v.verbs = (const struct hda_verb[]) {
7620 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7621 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7625 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7627 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7628 .type = HDA_FIXUP_PINS,
7629 .v.pins = (const struct hda_pintbl[]) {
7630 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7634 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7636 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7637 .type = HDA_FIXUP_PINS,
7638 .v.pins = (const struct hda_pintbl[]) {
7639 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7643 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7645 [ALC299_FIXUP_PREDATOR_SPK] = {
7646 .type = HDA_FIXUP_PINS,
7647 .v.pins = (const struct hda_pintbl[]) {
7648 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7652 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7653 .type = HDA_FIXUP_PINS,
7654 .v.pins = (const struct hda_pintbl[]) {
7655 { 0x19, 0x04a11040 },
7656 { 0x21, 0x04211020 },
7660 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7662 [ALC289_FIXUP_DELL_SPK2] = {
7663 .type = HDA_FIXUP_PINS,
7664 .v.pins = (const struct hda_pintbl[]) {
7665 { 0x17, 0x90170130 }, /* bass spk */
7669 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7671 [ALC289_FIXUP_DUAL_SPK] = {
7672 .type = HDA_FIXUP_FUNC,
7673 .v.func = alc285_fixup_speaker2_to_dac1,
7675 .chain_id = ALC289_FIXUP_DELL_SPK2
7677 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7678 .type = HDA_FIXUP_FUNC,
7679 .v.func = alc285_fixup_speaker2_to_dac1,
7681 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7683 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7684 .type = HDA_FIXUP_FUNC,
7685 /* The GPIO must be pulled to initialize the AMP */
7686 .v.func = alc_fixup_gpio4,
7688 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7690 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
7691 .type = HDA_FIXUP_FUNC,
7692 .v.func = alc285_fixup_thinkpad_x1_gen7,
7694 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7696 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7697 .type = HDA_FIXUP_FUNC,
7698 .v.func = alc_fixup_headset_jack,
7700 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
7702 [ALC294_FIXUP_ASUS_HPE] = {
7703 .type = HDA_FIXUP_VERBS,
7704 .v.verbs = (const struct hda_verb[]) {
7706 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7707 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7711 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7713 [ALC294_FIXUP_ASUS_GX502_PINS] = {
7714 .type = HDA_FIXUP_PINS,
7715 .v.pins = (const struct hda_pintbl[]) {
7716 { 0x19, 0x03a11050 }, /* front HP mic */
7717 { 0x1a, 0x01a11830 }, /* rear external mic */
7718 { 0x21, 0x03211020 }, /* front HP out */
7722 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
7724 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
7725 .type = HDA_FIXUP_VERBS,
7726 .v.verbs = (const struct hda_verb[]) {
7727 /* set 0x15 to HP-OUT ctrl */
7728 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7729 /* unmute the 0x15 amp */
7730 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7734 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
7736 [ALC294_FIXUP_ASUS_GX502_HP] = {
7737 .type = HDA_FIXUP_FUNC,
7738 .v.func = alc294_fixup_gx502_hp,
7740 [ALC294_FIXUP_ASUS_GU502_PINS] = {
7741 .type = HDA_FIXUP_PINS,
7742 .v.pins = (const struct hda_pintbl[]) {
7743 { 0x19, 0x01a11050 }, /* rear HP mic */
7744 { 0x1a, 0x01a11830 }, /* rear external mic */
7745 { 0x21, 0x012110f0 }, /* rear HP out */
7749 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
7751 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
7752 .type = HDA_FIXUP_VERBS,
7753 .v.verbs = (const struct hda_verb[]) {
7754 /* set 0x15 to HP-OUT ctrl */
7755 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
7756 /* unmute the 0x15 amp */
7757 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
7758 /* set 0x1b to HP-OUT */
7759 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
7763 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
7765 [ALC294_FIXUP_ASUS_GU502_HP] = {
7766 .type = HDA_FIXUP_FUNC,
7767 .v.func = alc294_fixup_gu502_hp,
7769 [ALC294_FIXUP_ASUS_G513_PINS] = {
7770 .type = HDA_FIXUP_PINS,
7771 .v.pins = (const struct hda_pintbl[]) {
7772 { 0x19, 0x03a11050 }, /* front HP mic */
7773 { 0x1a, 0x03a11c30 }, /* rear external mic */
7774 { 0x21, 0x03211420 }, /* front HP out */
7778 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
7779 .type = HDA_FIXUP_PINS,
7780 .v.pins = (const struct hda_pintbl[]) {
7781 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
7782 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
7783 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
7784 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
7785 { 0x21, 0x03211420 },
7789 [ALC294_FIXUP_ASUS_COEF_1B] = {
7790 .type = HDA_FIXUP_VERBS,
7791 .v.verbs = (const struct hda_verb[]) {
7792 /* Set bit 10 to correct noisy output after reboot from
7793 * Windows 10 (due to pop noise reduction?)
7795 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
7796 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
7800 .chain_id = ALC289_FIXUP_ASUS_GA401,
7802 [ALC285_FIXUP_HP_GPIO_LED] = {
7803 .type = HDA_FIXUP_FUNC,
7804 .v.func = alc285_fixup_hp_gpio_led,
7806 [ALC285_FIXUP_HP_MUTE_LED] = {
7807 .type = HDA_FIXUP_FUNC,
7808 .v.func = alc285_fixup_hp_mute_led,
7810 [ALC236_FIXUP_HP_GPIO_LED] = {
7811 .type = HDA_FIXUP_FUNC,
7812 .v.func = alc236_fixup_hp_gpio_led,
7814 [ALC236_FIXUP_HP_MUTE_LED] = {
7815 .type = HDA_FIXUP_FUNC,
7816 .v.func = alc236_fixup_hp_mute_led,
7818 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
7819 .type = HDA_FIXUP_VERBS,
7820 .v.verbs = (const struct hda_verb[]) {
7821 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
7825 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
7826 .type = HDA_FIXUP_VERBS,
7827 .v.verbs = (const struct hda_verb[]) {
7828 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7829 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
7833 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7834 .type = HDA_FIXUP_PINS,
7835 .v.pins = (const struct hda_pintbl[]) {
7836 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7840 .chain_id = ALC269_FIXUP_HEADSET_MODE
7842 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
7843 .type = HDA_FIXUP_PINS,
7844 .v.pins = (const struct hda_pintbl[]) {
7845 { 0x14, 0x90100120 }, /* use as internal speaker */
7846 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7847 { 0x1a, 0x01011020 }, /* use as line out */
7851 .chain_id = ALC269_FIXUP_HEADSET_MIC
7853 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
7854 .type = HDA_FIXUP_PINS,
7855 .v.pins = (const struct hda_pintbl[]) {
7856 { 0x18, 0x02a11030 }, /* use as headset mic */
7860 .chain_id = ALC269_FIXUP_HEADSET_MIC
7862 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
7863 .type = HDA_FIXUP_PINS,
7864 .v.pins = (const struct hda_pintbl[]) {
7865 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7869 .chain_id = ALC269_FIXUP_HEADSET_MIC
7871 [ALC289_FIXUP_ASUS_GA401] = {
7872 .type = HDA_FIXUP_FUNC,
7873 .v.func = alc289_fixup_asus_ga401,
7875 .chain_id = ALC289_FIXUP_ASUS_GA502,
7877 [ALC289_FIXUP_ASUS_GA502] = {
7878 .type = HDA_FIXUP_PINS,
7879 .v.pins = (const struct hda_pintbl[]) {
7880 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7884 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
7885 .type = HDA_FIXUP_PINS,
7886 .v.pins = (const struct hda_pintbl[]) {
7887 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
7891 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7893 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
7894 .type = HDA_FIXUP_FUNC,
7895 .v.func = alc285_fixup_hp_gpio_amp_init,
7897 .chain_id = ALC285_FIXUP_HP_GPIO_LED
7899 [ALC269_FIXUP_CZC_B20] = {
7900 .type = HDA_FIXUP_PINS,
7901 .v.pins = (const struct hda_pintbl[]) {
7902 { 0x12, 0x411111f0 },
7903 { 0x14, 0x90170110 }, /* speaker */
7904 { 0x15, 0x032f1020 }, /* HP out */
7905 { 0x17, 0x411111f0 },
7906 { 0x18, 0x03ab1040 }, /* mic */
7907 { 0x19, 0xb7a7013f },
7908 { 0x1a, 0x0181305f },
7909 { 0x1b, 0x411111f0 },
7910 { 0x1d, 0x411111f0 },
7911 { 0x1e, 0x411111f0 },
7914 .chain_id = ALC269_FIXUP_DMIC,
7916 [ALC269_FIXUP_CZC_TMI] = {
7917 .type = HDA_FIXUP_PINS,
7918 .v.pins = (const struct hda_pintbl[]) {
7919 { 0x12, 0x4000c000 },
7920 { 0x14, 0x90170110 }, /* speaker */
7921 { 0x15, 0x0421401f }, /* HP out */
7922 { 0x17, 0x411111f0 },
7923 { 0x18, 0x04a19020 }, /* mic */
7924 { 0x19, 0x411111f0 },
7925 { 0x1a, 0x411111f0 },
7926 { 0x1b, 0x411111f0 },
7927 { 0x1d, 0x40448505 },
7928 { 0x1e, 0x411111f0 },
7929 { 0x20, 0x8000ffff },
7932 .chain_id = ALC269_FIXUP_DMIC,
7934 [ALC269_FIXUP_CZC_L101] = {
7935 .type = HDA_FIXUP_PINS,
7936 .v.pins = (const struct hda_pintbl[]) {
7937 { 0x12, 0x40000000 },
7938 { 0x14, 0x01014010 }, /* speaker */
7939 { 0x15, 0x411111f0 }, /* HP out */
7940 { 0x16, 0x411111f0 },
7941 { 0x18, 0x01a19020 }, /* mic */
7942 { 0x19, 0x02a19021 },
7943 { 0x1a, 0x0181302f },
7944 { 0x1b, 0x0221401f },
7945 { 0x1c, 0x411111f0 },
7946 { 0x1d, 0x4044c601 },
7947 { 0x1e, 0x411111f0 },
7950 .chain_id = ALC269_FIXUP_DMIC,
7952 [ALC269_FIXUP_LEMOTE_A1802] = {
7953 .type = HDA_FIXUP_PINS,
7954 .v.pins = (const struct hda_pintbl[]) {
7955 { 0x12, 0x40000000 },
7956 { 0x14, 0x90170110 }, /* speaker */
7957 { 0x17, 0x411111f0 },
7958 { 0x18, 0x03a19040 }, /* mic1 */
7959 { 0x19, 0x90a70130 }, /* mic2 */
7960 { 0x1a, 0x411111f0 },
7961 { 0x1b, 0x411111f0 },
7962 { 0x1d, 0x40489d2d },
7963 { 0x1e, 0x411111f0 },
7964 { 0x20, 0x0003ffff },
7965 { 0x21, 0x03214020 },
7968 .chain_id = ALC269_FIXUP_DMIC,
7970 [ALC269_FIXUP_LEMOTE_A190X] = {
7971 .type = HDA_FIXUP_PINS,
7972 .v.pins = (const struct hda_pintbl[]) {
7973 { 0x14, 0x99130110 }, /* speaker */
7974 { 0x15, 0x0121401f }, /* HP out */
7975 { 0x18, 0x01a19c20 }, /* rear mic */
7976 { 0x19, 0x99a3092f }, /* front mic */
7977 { 0x1b, 0x0201401f }, /* front lineout */
7980 .chain_id = ALC269_FIXUP_DMIC,
7982 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
7983 .type = HDA_FIXUP_PINS,
7984 .v.pins = (const struct hda_pintbl[]) {
7985 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7989 .chain_id = ALC269_FIXUP_HEADSET_MODE
7991 [ALC256_FIXUP_INTEL_NUC10] = {
7992 .type = HDA_FIXUP_PINS,
7993 .v.pins = (const struct hda_pintbl[]) {
7994 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7998 .chain_id = ALC269_FIXUP_HEADSET_MODE
8000 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8001 .type = HDA_FIXUP_VERBS,
8002 .v.verbs = (const struct hda_verb[]) {
8003 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8004 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8008 .chain_id = ALC289_FIXUP_ASUS_GA502
8010 [ALC274_FIXUP_HP_MIC] = {
8011 .type = HDA_FIXUP_VERBS,
8012 .v.verbs = (const struct hda_verb[]) {
8013 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8014 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8018 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8019 .type = HDA_FIXUP_FUNC,
8020 .v.func = alc274_fixup_hp_headset_mic,
8022 .chain_id = ALC274_FIXUP_HP_MIC
8024 [ALC256_FIXUP_ASUS_HPE] = {
8025 .type = HDA_FIXUP_VERBS,
8026 .v.verbs = (const struct hda_verb[]) {
8028 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8029 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8033 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8035 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8036 .type = HDA_FIXUP_FUNC,
8037 .v.func = alc_fixup_headset_jack,
8039 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8041 [ALC295_FIXUP_ASUS_DACS] = {
8042 .type = HDA_FIXUP_FUNC,
8043 .v.func = alc295_fixup_asus_dacs,
8045 [ALC295_FIXUP_HP_OMEN] = {
8046 .type = HDA_FIXUP_PINS,
8047 .v.pins = (const struct hda_pintbl[]) {
8048 { 0x12, 0xb7a60130 },
8049 { 0x13, 0x40000000 },
8050 { 0x14, 0x411111f0 },
8051 { 0x16, 0x411111f0 },
8052 { 0x17, 0x90170110 },
8053 { 0x18, 0x411111f0 },
8054 { 0x19, 0x02a11030 },
8055 { 0x1a, 0x411111f0 },
8056 { 0x1b, 0x04a19030 },
8057 { 0x1d, 0x40600001 },
8058 { 0x1e, 0x411111f0 },
8059 { 0x21, 0x03211020 },
8063 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8065 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8066 .type = HDA_FIXUP_FUNC,
8067 .v.func = alc285_fixup_hp_spectre_x360,
8071 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8072 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8073 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8074 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8075 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8076 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8077 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8078 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8079 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8080 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8081 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8082 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8083 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8084 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8085 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8086 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8087 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8088 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8089 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8090 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8091 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8092 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8093 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8094 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8095 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8096 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8097 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8098 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8099 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8100 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8101 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8102 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8103 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8104 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8105 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
8106 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8107 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8108 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8109 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8110 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8111 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8112 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8113 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8114 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8115 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8116 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8117 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8118 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8119 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8120 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8121 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8122 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8123 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8124 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8125 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8126 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8127 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8128 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8129 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8130 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8131 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8132 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8133 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8134 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8135 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8136 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8137 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8138 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8139 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8140 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8141 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8142 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8143 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8144 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8145 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8146 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8147 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8148 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8149 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8150 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8151 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8152 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8153 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8154 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8155 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8156 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8157 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8158 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8159 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8160 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8161 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8162 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8163 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8164 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8165 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8166 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8167 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8168 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8169 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8170 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8171 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8172 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8173 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8174 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8175 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8176 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8177 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8178 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8179 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8180 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8181 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8182 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8183 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8184 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8185 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8186 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8187 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8188 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8189 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8190 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8191 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8192 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8193 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8194 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8195 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8196 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8197 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8198 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8199 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8200 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8201 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8202 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8203 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8204 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8205 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8206 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8207 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8208 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8209 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8210 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8211 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8212 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
8213 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8214 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8215 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8216 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8217 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8218 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8219 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8220 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8221 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8222 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8223 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8224 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8225 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8226 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8227 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8228 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8229 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8230 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
8231 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
8232 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
8233 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8234 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
8235 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
8236 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8237 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8238 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
8239 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8240 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
8241 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8242 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
8243 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
8244 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8245 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8246 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8247 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8248 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
8249 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8250 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
8251 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
8252 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
8253 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
8254 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
8255 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
8256 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
8257 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
8258 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
8259 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
8260 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
8261 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
8262 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
8263 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
8264 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
8265 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
8266 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
8267 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
8268 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
8269 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
8270 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
8271 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
8272 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
8273 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
8274 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
8275 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8276 SND_PCI_QUIRK(0x1043, 0x1c62, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
8277 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
8278 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
8279 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
8280 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
8281 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
8282 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
8283 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
8284 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
8285 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
8286 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
8287 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
8288 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
8289 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
8290 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
8291 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8292 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
8293 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
8294 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
8295 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8296 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
8297 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
8298 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8299 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
8300 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
8301 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
8302 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8303 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
8304 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
8305 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
8306 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
8307 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
8308 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8309 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8310 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8311 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
8312 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
8313 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
8314 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8315 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8316 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8317 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8318 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
8319 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8320 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8321 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
8322 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
8323 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
8324 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
8325 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
8326 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8327 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8328 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8329 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8330 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8331 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8332 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8333 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8334 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8335 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8336 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8337 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8338 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8339 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8340 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8341 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8342 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8343 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8344 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8345 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8346 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8347 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8348 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8349 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8350 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8351 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8352 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8353 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8354 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8355 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8356 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8357 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8358 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8359 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8360 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8361 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8362 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8363 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8364 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
8365 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
8366 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[5|7][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
8367 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8368 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8369 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8370 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8371 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8372 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8373 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8374 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8375 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8376 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8377 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL53RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8378 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL5XNU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8379 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8380 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8381 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8382 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8383 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8384 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8385 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
8386 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8387 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
8388 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
8389 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
8390 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
8391 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
8392 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
8393 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
8394 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
8395 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
8396 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
8397 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
8398 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
8399 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
8400 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
8401 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
8402 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
8403 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
8404 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8405 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
8406 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
8407 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
8408 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8409 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8410 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
8411 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
8412 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
8413 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8414 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8415 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
8416 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8417 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8418 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8419 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8420 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8421 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
8422 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8423 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
8424 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8425 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
8426 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8427 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8428 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8429 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8430 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
8431 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8432 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8433 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
8434 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
8435 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8436 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
8437 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
8438 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
8439 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8440 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
8441 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
8442 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8443 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
8444 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
8445 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
8446 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
8447 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
8448 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
8449 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
8450 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
8451 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8452 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8453 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8454 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
8455 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8456 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
8457 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
8458 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
8459 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
8460 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
8461 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
8462 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
8463 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
8464 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
8465 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
8466 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8467 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
8468 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
8469 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
8470 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
8471 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
8472 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
8473 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
8476 /* Below is a quirk table taken from the old code.
8477 * Basically the device should work as is without the fixup table.
8478 * If BIOS doesn't give a proper info, enable the corresponding
8481 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
8483 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
8484 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
8485 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
8486 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
8487 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
8488 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
8489 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
8490 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
8491 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
8492 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
8493 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
8494 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
8495 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
8496 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
8497 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
8498 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
8499 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
8500 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
8501 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
8502 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
8503 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
8504 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
8505 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
8506 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
8507 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
8508 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
8509 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
8510 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
8511 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
8512 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
8513 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
8514 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
8515 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
8516 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
8517 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
8518 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
8519 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
8520 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
8521 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
8526 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
8527 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
8528 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
8529 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
8530 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
8531 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
8535 static const struct hda_model_fixup alc269_fixup_models[] = {
8536 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
8537 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
8538 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
8539 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
8540 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
8541 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
8542 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
8543 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
8544 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
8545 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
8546 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8547 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
8548 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
8549 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
8550 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
8551 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
8552 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
8553 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
8554 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
8555 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
8556 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
8557 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
8558 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
8559 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
8560 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
8561 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
8562 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
8563 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
8564 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
8565 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
8566 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
8567 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
8568 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
8569 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
8570 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
8571 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
8572 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
8573 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
8574 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
8575 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
8576 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
8577 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
8578 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
8579 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
8580 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
8581 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
8582 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
8583 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
8584 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
8585 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
8586 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
8587 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
8588 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
8589 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
8590 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
8591 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
8592 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
8593 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
8594 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
8595 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
8596 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
8597 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
8598 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
8599 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
8600 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
8601 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
8602 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
8603 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
8604 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
8605 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
8606 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
8607 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
8608 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
8609 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
8610 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
8611 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
8612 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
8613 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
8614 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
8615 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
8616 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
8617 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
8618 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
8619 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
8620 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
8621 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
8622 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
8623 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
8624 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
8625 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
8626 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
8627 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
8628 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
8629 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
8630 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
8631 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
8632 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
8633 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
8634 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
8635 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
8636 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
8637 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
8638 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
8639 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
8640 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
8641 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
8642 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
8643 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
8644 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
8645 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
8646 {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
8647 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
8648 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
8649 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
8650 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
8651 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
8654 #define ALC225_STANDARD_PINS \
8657 #define ALC256_STANDARD_PINS \
8658 {0x12, 0x90a60140}, \
8659 {0x14, 0x90170110}, \
8662 #define ALC282_STANDARD_PINS \
8665 #define ALC290_STANDARD_PINS \
8668 #define ALC292_STANDARD_PINS \
8669 {0x14, 0x90170110}, \
8672 #define ALC295_STANDARD_PINS \
8673 {0x12, 0xb7a60130}, \
8674 {0x14, 0x90170110}, \
8677 #define ALC298_STANDARD_PINS \
8678 {0x12, 0x90a60130}, \
8681 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
8682 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
8687 {0x21, 0x0221102f}),
8688 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8691 {0x21, 0x02211030}),
8692 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8695 {0x21, 0x03211020}),
8696 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8699 {0x21, 0x03211020}),
8700 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8701 ALC225_STANDARD_PINS,
8703 {0x14, 0x901701a0}),
8704 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8705 ALC225_STANDARD_PINS,
8707 {0x14, 0x901701b0}),
8708 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8709 ALC225_STANDARD_PINS,
8711 {0x14, 0x901701a0}),
8712 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8713 ALC225_STANDARD_PINS,
8715 {0x14, 0x901701b0}),
8716 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8717 ALC225_STANDARD_PINS,
8719 {0x1b, 0x90170110}),
8720 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8723 {0x21, 0x02211020}),
8724 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
8728 {0x21, 0x02211020}),
8729 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8734 {0x21, 0x0221101f}),
8735 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8740 {0x21, 0x0221101f}),
8741 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8745 {0x21, 0x0221101f}),
8746 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
8748 {0x21, 0x02211020}),
8749 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8751 {0x21, 0x02211040}),
8752 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8755 {0x21, 0x02211020}),
8756 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8759 {0x21, 0x02211030}),
8760 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8763 {0x21, 0x0221101f}),
8764 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8767 {0x21, 0x0221101f}),
8768 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8771 {0x21, 0x0221103f}),
8772 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8775 {0x21, 0x0221103f}),
8776 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8779 {0x21, 0x0221103f}),
8780 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8783 {0x21, 0x0221105f}),
8784 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8787 {0x21, 0x0221101f}),
8788 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8792 {0x21, 0x0321102f}),
8793 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8796 {0x21, 0x02211040}),
8797 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8800 {0x21, 0x02211050}),
8801 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8804 {0x21, 0x02211030}),
8805 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8808 {0x21, 0x02211040}),
8809 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8812 {0x21, 0x02211040}),
8813 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8816 {0x21, 0x02211050}),
8817 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8820 {0x21, 0x02211040}),
8821 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8824 {0x21, 0x02211030}),
8825 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8827 {0x21, 0x02211010}),
8828 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8832 {0x21, 0x0221101f}),
8833 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8836 {0x21, 0x02211030}),
8837 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8840 {0x21, 0x02211030}),
8841 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8844 {0x21, 0x02211030}),
8845 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8848 {0x21, 0x02211020}),
8849 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8853 {0x21, 0x0221101f}),
8854 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8855 ALC256_STANDARD_PINS),
8856 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8859 {0x21, 0x0221101f}),
8860 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8863 {0x21, 0x04211020}),
8864 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8867 {0x21, 0x03211020}),
8868 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8871 {0x21, 0x03211020}),
8872 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8875 {0x21, 0x04211020}),
8876 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8879 {0x21, 0x03211020}),
8880 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
8883 {0x21, 0x03211020}),
8884 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
8888 {0x1a, 0x04a11020}),
8889 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
8895 {0x1b, 0x02011020}),
8896 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8897 ALC282_STANDARD_PINS,
8900 {0x21, 0x0321101f}),
8901 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8902 ALC282_STANDARD_PINS,
8905 {0x21, 0x03211040}),
8906 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8907 ALC282_STANDARD_PINS,
8910 {0x21, 0x03211020}),
8911 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8912 ALC282_STANDARD_PINS,
8915 {0x21, 0x0421101f}),
8916 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
8917 ALC282_STANDARD_PINS,
8920 {0x21, 0x04211020}),
8921 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8922 ALC282_STANDARD_PINS,
8924 {0x21, 0x0321101f}),
8925 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8928 {0x21, 0x02211030}),
8929 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8930 ALC282_STANDARD_PINS,
8933 {0x21, 0x0321101f}),
8934 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
8938 {0x21, 0x04211020}),
8939 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
8943 {0x21, 0x04211020}),
8944 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
8947 {0x21, 0x04211020}),
8948 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8952 {0x21, 0x03211020}),
8953 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
8956 {0x21, 0x02211020}),
8957 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
8960 {0x21, 0x0321101f}),
8961 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8962 ALC290_STANDARD_PINS,
8965 {0x1a, 0x04a11020}),
8966 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8967 ALC290_STANDARD_PINS,
8970 {0x1a, 0x04a11020}),
8971 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8972 ALC290_STANDARD_PINS,
8974 {0x1a, 0x04a11020}),
8975 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8976 ALC290_STANDARD_PINS,
8978 {0x1a, 0x04a11040}),
8979 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8980 ALC290_STANDARD_PINS,
8983 {0x1a, 0x04a11040}),
8984 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8985 ALC290_STANDARD_PINS,
8988 {0x1a, 0x04a11020}),
8989 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8990 ALC290_STANDARD_PINS,
8993 {0x1a, 0x04a11020}),
8994 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
8995 ALC292_STANDARD_PINS,
8998 {0x19, 0x01a19030}),
8999 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9000 ALC292_STANDARD_PINS,
9004 {0x19, 0x01a1903e}),
9005 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9006 ALC292_STANDARD_PINS,
9007 {0x12, 0x90a60140}),
9008 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9009 ALC292_STANDARD_PINS,
9012 {0x19, 0x21a19030}),
9013 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9014 ALC292_STANDARD_PINS,
9015 {0x13, 0x90a60140}),
9016 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9018 {0x21, 0x04211020}),
9019 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9022 {0x21, 0x04211020}),
9023 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9026 {0x21, 0x03211020}),
9027 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9030 {0x21, 0x04211020}),
9031 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9034 {0x21, 0x03211020}),
9035 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9038 {0x21, 0x04211030}),
9039 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9042 {0x21, 0x03211020}),
9043 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9046 {0x21, 0x03211020}),
9047 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9049 {0x21, 0x04211020}),
9050 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9052 {0x21, 0x04211030}),
9053 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9054 ALC295_STANDARD_PINS,
9056 {0x18, 0x21a19030}),
9057 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9058 ALC295_STANDARD_PINS,
9060 {0x18, 0x21a19050}),
9061 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9062 ALC295_STANDARD_PINS),
9063 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9064 ALC298_STANDARD_PINS,
9065 {0x17, 0x90170110}),
9066 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9067 ALC298_STANDARD_PINS,
9068 {0x17, 0x90170140}),
9069 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9070 ALC298_STANDARD_PINS,
9071 {0x17, 0x90170150}),
9072 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9077 {0x21, 0x03211030}),
9078 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9082 {0x21, 0x03211020}),
9083 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9084 ALC225_STANDARD_PINS,
9086 {0x17, 0x90170110}),
9087 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9092 {0x21, 0x0221101f}),
9096 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9097 * more machines, don't need to match all valid pins, just need to match
9098 * all the pins defined in the tbl. Just because of this reason, it is possible
9099 * that a single machine matches multiple tbls, so there is one limitation:
9100 * at most one tbl is allowed to define for the same vendor and same codec
9102 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9103 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9105 {0x1b, 0x40000000}),
9106 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9108 {0x1a, 0x40000000}),
9109 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9111 {0x1a, 0x40000000}),
9115 static void alc269_fill_coef(struct hda_codec *codec)
9117 struct alc_spec *spec = codec->spec;
9120 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9123 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9124 alc_write_coef_idx(codec, 0xf, 0x960b);
9125 alc_write_coef_idx(codec, 0xe, 0x8817);
9128 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9129 alc_write_coef_idx(codec, 0xf, 0x960b);
9130 alc_write_coef_idx(codec, 0xe, 0x8814);
9133 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9134 /* Power up output pin */
9135 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9138 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9139 val = alc_read_coef_idx(codec, 0xd);
9140 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9141 /* Capless ramp up clock control */
9142 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9144 val = alc_read_coef_idx(codec, 0x17);
9145 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9146 /* Class D power on reset */
9147 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9152 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
9157 static int patch_alc269(struct hda_codec *codec)
9159 struct alc_spec *spec;
9162 err = alc_alloc_spec(codec, 0x0b);
9167 spec->gen.shared_mic_vref_pin = 0x18;
9168 codec->power_save_node = 0;
9171 codec->patch_ops.suspend = alc269_suspend;
9172 codec->patch_ops.resume = alc269_resume;
9174 spec->shutup = alc_default_shutup;
9175 spec->init_hook = alc_default_init;
9177 switch (codec->core.vendor_id) {
9179 spec->codec_variant = ALC269_TYPE_ALC269VA;
9180 switch (alc_get_coef0(codec) & 0x00f0) {
9182 if (codec->bus->pci &&
9183 codec->bus->pci->subsystem_vendor == 0x1025 &&
9184 spec->cdefine.platform_type == 1)
9185 err = alc_codec_rename(codec, "ALC271X");
9186 spec->codec_variant = ALC269_TYPE_ALC269VB;
9189 if (codec->bus->pci &&
9190 codec->bus->pci->subsystem_vendor == 0x17aa &&
9191 codec->bus->pci->subsystem_device == 0x21f3)
9192 err = alc_codec_rename(codec, "ALC3202");
9193 spec->codec_variant = ALC269_TYPE_ALC269VC;
9196 spec->codec_variant = ALC269_TYPE_ALC269VD;
9199 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9203 spec->shutup = alc269_shutup;
9204 spec->init_hook = alc269_fill_coef;
9205 alc269_fill_coef(codec);
9210 spec->codec_variant = ALC269_TYPE_ALC280;
9213 spec->codec_variant = ALC269_TYPE_ALC282;
9214 spec->shutup = alc282_shutup;
9215 spec->init_hook = alc282_init;
9219 spec->codec_variant = ALC269_TYPE_ALC283;
9220 spec->shutup = alc283_shutup;
9221 spec->init_hook = alc283_init;
9225 spec->codec_variant = ALC269_TYPE_ALC284;
9228 spec->codec_variant = ALC269_TYPE_ALC293;
9232 spec->codec_variant = ALC269_TYPE_ALC286;
9235 spec->codec_variant = ALC269_TYPE_ALC298;
9239 spec->codec_variant = ALC269_TYPE_ALC255;
9240 spec->shutup = alc256_shutup;
9241 spec->init_hook = alc256_init;
9247 spec->codec_variant = ALC269_TYPE_ALC256;
9248 spec->shutup = alc256_shutup;
9249 spec->init_hook = alc256_init;
9250 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
9253 spec->codec_variant = ALC269_TYPE_ALC257;
9254 spec->shutup = alc256_shutup;
9255 spec->init_hook = alc256_init;
9256 spec->gen.mixer_nid = 0;
9263 spec->codec_variant = ALC269_TYPE_ALC215;
9264 spec->shutup = alc225_shutup;
9265 spec->init_hook = alc225_init;
9266 spec->gen.mixer_nid = 0;
9271 spec->codec_variant = ALC269_TYPE_ALC225;
9272 spec->shutup = alc225_shutup;
9273 spec->init_hook = alc225_init;
9274 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
9279 spec->codec_variant = ALC269_TYPE_ALC294;
9280 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
9281 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
9282 spec->init_hook = alc294_init;
9285 spec->codec_variant = ALC269_TYPE_ALC300;
9286 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
9289 spec->codec_variant = ALC269_TYPE_ALC623;
9295 spec->codec_variant = ALC269_TYPE_ALC700;
9296 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
9297 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
9298 spec->init_hook = alc294_init;
9303 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
9304 spec->has_alc5505_dsp = 1;
9305 spec->init_hook = alc5505_dsp_init;
9308 alc_pre_init(codec);
9310 snd_hda_pick_fixup(codec, alc269_fixup_models,
9311 alc269_fixup_tbl, alc269_fixups);
9312 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
9313 * the quirk breaks the latter (bko#214101).
9314 * Clear the wrong entry.
9316 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
9317 codec->core.vendor_id == 0x10ec0294) {
9318 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
9319 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
9322 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
9323 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
9324 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
9326 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9328 alc_auto_parse_customize_define(codec);
9330 if (has_cdefine_beep(codec))
9331 spec->gen.beep_nid = 0x01;
9333 /* automatic parse from the BIOS config */
9334 err = alc269_parse_auto_config(codec);
9338 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
9339 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
9344 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9357 static int alc861_parse_auto_config(struct hda_codec *codec)
9359 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
9360 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
9361 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
9364 /* Pin config fixes */
9366 ALC861_FIXUP_FSC_AMILO_PI1505,
9367 ALC861_FIXUP_AMP_VREF_0F,
9368 ALC861_FIXUP_NO_JACK_DETECT,
9369 ALC861_FIXUP_ASUS_A6RP,
9370 ALC660_FIXUP_ASUS_W7J,
9373 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
9374 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
9375 const struct hda_fixup *fix, int action)
9377 struct alc_spec *spec = codec->spec;
9380 if (action != HDA_FIXUP_ACT_INIT)
9382 val = snd_hda_codec_get_pin_target(codec, 0x0f);
9383 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
9384 val |= AC_PINCTL_IN_EN;
9385 val |= AC_PINCTL_VREF_50;
9386 snd_hda_set_pin_ctl(codec, 0x0f, val);
9387 spec->gen.keep_vref_in_automute = 1;
9390 /* suppress the jack-detection */
9391 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
9392 const struct hda_fixup *fix, int action)
9394 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9395 codec->no_jack_detect = 1;
9398 static const struct hda_fixup alc861_fixups[] = {
9399 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
9400 .type = HDA_FIXUP_PINS,
9401 .v.pins = (const struct hda_pintbl[]) {
9402 { 0x0b, 0x0221101f }, /* HP */
9403 { 0x0f, 0x90170310 }, /* speaker */
9407 [ALC861_FIXUP_AMP_VREF_0F] = {
9408 .type = HDA_FIXUP_FUNC,
9409 .v.func = alc861_fixup_asus_amp_vref_0f,
9411 [ALC861_FIXUP_NO_JACK_DETECT] = {
9412 .type = HDA_FIXUP_FUNC,
9413 .v.func = alc_fixup_no_jack_detect,
9415 [ALC861_FIXUP_ASUS_A6RP] = {
9416 .type = HDA_FIXUP_FUNC,
9417 .v.func = alc861_fixup_asus_amp_vref_0f,
9419 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
9421 [ALC660_FIXUP_ASUS_W7J] = {
9422 .type = HDA_FIXUP_VERBS,
9423 .v.verbs = (const struct hda_verb[]) {
9424 /* ASUS W7J needs a magic pin setup on unused NID 0x10
9425 * for enabling outputs
9427 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
9433 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
9434 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
9435 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
9436 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
9437 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
9438 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
9439 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
9440 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
9446 static int patch_alc861(struct hda_codec *codec)
9448 struct alc_spec *spec;
9451 err = alc_alloc_spec(codec, 0x15);
9456 if (has_cdefine_beep(codec))
9457 spec->gen.beep_nid = 0x23;
9460 spec->power_hook = alc_power_eapd;
9463 alc_pre_init(codec);
9465 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
9466 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9468 /* automatic parse from the BIOS config */
9469 err = alc861_parse_auto_config(codec);
9473 if (!spec->gen.no_analog) {
9474 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
9479 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9493 * In addition, an independent DAC
9495 static int alc861vd_parse_auto_config(struct hda_codec *codec)
9497 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
9498 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9499 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
9503 ALC660VD_FIX_ASUS_GPIO1,
9504 ALC861VD_FIX_DALLAS,
9507 /* exclude VREF80 */
9508 static void alc861vd_fixup_dallas(struct hda_codec *codec,
9509 const struct hda_fixup *fix, int action)
9511 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9512 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
9513 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
9518 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
9519 const struct hda_fixup *fix, int action)
9521 struct alc_spec *spec = codec->spec;
9523 if (action == HDA_FIXUP_ACT_PRE_PROBE)
9524 spec->gpio_mask |= 0x02;
9525 alc_fixup_gpio(codec, action, 0x01);
9528 static const struct hda_fixup alc861vd_fixups[] = {
9529 [ALC660VD_FIX_ASUS_GPIO1] = {
9530 .type = HDA_FIXUP_FUNC,
9531 .v.func = alc660vd_fixup_asus_gpio1,
9533 [ALC861VD_FIX_DALLAS] = {
9534 .type = HDA_FIXUP_FUNC,
9535 .v.func = alc861vd_fixup_dallas,
9539 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
9540 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
9541 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
9542 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
9548 static int patch_alc861vd(struct hda_codec *codec)
9550 struct alc_spec *spec;
9553 err = alc_alloc_spec(codec, 0x0b);
9558 if (has_cdefine_beep(codec))
9559 spec->gen.beep_nid = 0x23;
9561 spec->shutup = alc_eapd_shutup;
9563 alc_pre_init(codec);
9565 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
9566 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9568 /* automatic parse from the BIOS config */
9569 err = alc861vd_parse_auto_config(codec);
9573 if (!spec->gen.no_analog) {
9574 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9579 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9591 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
9592 * configuration. Each pin widget can choose any input DACs and a mixer.
9593 * Each ADC is connected from a mixer of all inputs. This makes possible
9594 * 6-channel independent captures.
9596 * In addition, an independent DAC for the multi-playback (not used in this
9601 * BIOS auto configuration
9604 static int alc662_parse_auto_config(struct hda_codec *codec)
9606 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
9607 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
9608 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
9609 const hda_nid_t *ssids;
9611 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
9612 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
9613 codec->core.vendor_id == 0x10ec0671)
9614 ssids = alc663_ssids;
9616 ssids = alc662_ssids;
9617 return alc_parse_auto_config(codec, alc662_ignore, ssids);
9620 static void alc272_fixup_mario(struct hda_codec *codec,
9621 const struct hda_fixup *fix, int action)
9623 if (action != HDA_FIXUP_ACT_PRE_PROBE)
9625 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
9626 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
9627 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
9628 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
9629 (0 << AC_AMPCAP_MUTE_SHIFT)))
9630 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
9633 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
9635 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
9637 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
9638 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
9642 /* override the 2.1 chmap */
9643 static void alc_fixup_bass_chmap(struct hda_codec *codec,
9644 const struct hda_fixup *fix, int action)
9646 if (action == HDA_FIXUP_ACT_BUILD) {
9647 struct alc_spec *spec = codec->spec;
9648 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
9652 /* avoid D3 for keeping GPIO up */
9653 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
9655 unsigned int power_state)
9657 struct alc_spec *spec = codec->spec;
9658 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
9663 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
9664 const struct hda_fixup *fix, int action)
9666 struct alc_spec *spec = codec->spec;
9668 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
9669 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9670 spec->mute_led_polarity = 1;
9671 codec->power_filter = gpio_led_power_filter;
9675 static void alc662_usi_automute_hook(struct hda_codec *codec,
9676 struct hda_jack_callback *jack)
9678 struct alc_spec *spec = codec->spec;
9681 snd_hda_gen_hp_automute(codec, jack);
9683 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
9685 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
9689 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
9690 const struct hda_fixup *fix, int action)
9692 struct alc_spec *spec = codec->spec;
9693 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9694 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9695 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
9699 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
9700 struct hda_jack_callback *cb)
9702 /* surround speakers at 0x1b already get muted automatically when
9703 * headphones are plugged in, but we have to mute/unmute the remaining
9704 * channels manually:
9705 * 0x15 - front left/front right
9706 * 0x18 - front center/ LFE
9708 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
9709 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
9710 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
9712 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
9713 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
9717 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
9718 const struct hda_fixup *fix, int action)
9720 /* Pin 0x1b: shared headphones jack and surround speakers */
9721 if (!is_jack_detectable(codec, 0x1b))
9725 case HDA_FIXUP_ACT_PRE_PROBE:
9726 snd_hda_jack_detect_enable_callback(codec, 0x1b,
9727 alc662_aspire_ethos_mute_speakers);
9728 /* subwoofer needs an extra GPIO setting to become audible */
9729 alc_setup_gpio(codec, 0x02);
9731 case HDA_FIXUP_ACT_INIT:
9732 /* Make sure to start in a correct state, i.e. if
9733 * headphones have been plugged in before powering up the system
9735 alc662_aspire_ethos_mute_speakers(codec, NULL);
9740 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
9741 const struct hda_fixup *fix, int action)
9743 struct alc_spec *spec = codec->spec;
9745 static const struct hda_pintbl pincfgs[] = {
9746 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
9747 { 0x1b, 0x0181304f },
9752 case HDA_FIXUP_ACT_PRE_PROBE:
9753 spec->gen.mixer_nid = 0;
9754 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9755 snd_hda_apply_pincfgs(codec, pincfgs);
9757 case HDA_FIXUP_ACT_INIT:
9758 alc_write_coef_idx(codec, 0x19, 0xa054);
9763 static void alc897_hp_automute_hook(struct hda_codec *codec,
9764 struct hda_jack_callback *jack)
9766 struct alc_spec *spec = codec->spec;
9769 snd_hda_gen_hp_automute(codec, jack);
9770 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
9771 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
9775 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
9776 const struct hda_fixup *fix, int action)
9778 struct alc_spec *spec = codec->spec;
9779 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9780 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
9784 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
9785 const struct hda_fixup *fix, int action)
9787 struct alc_spec *spec = codec->spec;
9789 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
9790 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9791 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
9795 static const struct coef_fw alc668_coefs[] = {
9796 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
9797 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
9798 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
9799 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
9800 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
9801 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
9802 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
9803 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
9804 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
9805 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
9806 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
9807 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
9808 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
9809 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
9810 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
9811 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
9812 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
9813 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
9814 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
9815 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
9819 static void alc668_restore_default_value(struct hda_codec *codec)
9821 alc_process_coef_fw(codec, alc668_coefs);
9825 ALC662_FIXUP_ASPIRE,
9826 ALC662_FIXUP_LED_GPIO1,
9827 ALC662_FIXUP_IDEAPAD,
9829 ALC662_FIXUP_CZC_ET26,
9830 ALC662_FIXUP_CZC_P10T,
9831 ALC662_FIXUP_SKU_IGNORE,
9832 ALC662_FIXUP_HP_RP5800,
9833 ALC662_FIXUP_ASUS_MODE1,
9834 ALC662_FIXUP_ASUS_MODE2,
9835 ALC662_FIXUP_ASUS_MODE3,
9836 ALC662_FIXUP_ASUS_MODE4,
9837 ALC662_FIXUP_ASUS_MODE5,
9838 ALC662_FIXUP_ASUS_MODE6,
9839 ALC662_FIXUP_ASUS_MODE7,
9840 ALC662_FIXUP_ASUS_MODE8,
9841 ALC662_FIXUP_NO_JACK_DETECT,
9842 ALC662_FIXUP_ZOTAC_Z68,
9843 ALC662_FIXUP_INV_DMIC,
9844 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9845 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
9846 ALC662_FIXUP_HEADSET_MODE,
9847 ALC668_FIXUP_HEADSET_MODE,
9848 ALC662_FIXUP_BASS_MODE4_CHMAP,
9849 ALC662_FIXUP_BASS_16,
9850 ALC662_FIXUP_BASS_1A,
9851 ALC662_FIXUP_BASS_CHMAP,
9852 ALC668_FIXUP_AUTO_MUTE,
9853 ALC668_FIXUP_DELL_DISABLE_AAMIX,
9854 ALC668_FIXUP_DELL_XPS13,
9855 ALC662_FIXUP_ASUS_Nx50,
9856 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9857 ALC668_FIXUP_ASUS_Nx51,
9858 ALC668_FIXUP_MIC_COEF,
9859 ALC668_FIXUP_ASUS_G751,
9860 ALC891_FIXUP_HEADSET_MODE,
9861 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9862 ALC662_FIXUP_ACER_VERITON,
9863 ALC892_FIXUP_ASROCK_MOBO,
9864 ALC662_FIXUP_USI_FUNC,
9865 ALC662_FIXUP_USI_HEADSET_MODE,
9866 ALC662_FIXUP_LENOVO_MULTI_CODECS,
9867 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
9868 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
9869 ALC671_FIXUP_HP_HEADSET_MIC2,
9870 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
9871 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
9872 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
9873 ALC668_FIXUP_HEADSET_MIC,
9874 ALC668_FIXUP_MIC_DET_COEF,
9875 ALC897_FIXUP_LENOVO_HEADSET_MIC,
9876 ALC897_FIXUP_HEADSET_MIC_PIN,
9877 ALC897_FIXUP_HP_HSMIC_VERB,
9878 ALC897_FIXUP_LENOVO_HEADSET_MODE,
9879 ALC897_FIXUP_HEADSET_MIC_PIN2,
9880 ALC897_FIXUP_UNIS_H3C_X500S,
9883 static const struct hda_fixup alc662_fixups[] = {
9884 [ALC662_FIXUP_ASPIRE] = {
9885 .type = HDA_FIXUP_PINS,
9886 .v.pins = (const struct hda_pintbl[]) {
9887 { 0x15, 0x99130112 }, /* subwoofer */
9891 [ALC662_FIXUP_LED_GPIO1] = {
9892 .type = HDA_FIXUP_FUNC,
9893 .v.func = alc662_fixup_led_gpio1,
9895 [ALC662_FIXUP_IDEAPAD] = {
9896 .type = HDA_FIXUP_PINS,
9897 .v.pins = (const struct hda_pintbl[]) {
9898 { 0x17, 0x99130112 }, /* subwoofer */
9902 .chain_id = ALC662_FIXUP_LED_GPIO1,
9904 [ALC272_FIXUP_MARIO] = {
9905 .type = HDA_FIXUP_FUNC,
9906 .v.func = alc272_fixup_mario,
9908 [ALC662_FIXUP_CZC_ET26] = {
9909 .type = HDA_FIXUP_PINS,
9910 .v.pins = (const struct hda_pintbl[]) {
9912 {0x14, 0x90170110}, /* speaker */
9915 {0x18, 0x01a19030}, /* mic */
9916 {0x19, 0x90a7013f}, /* int-mic */
9925 .chain_id = ALC662_FIXUP_SKU_IGNORE
9927 [ALC662_FIXUP_CZC_P10T] = {
9928 .type = HDA_FIXUP_VERBS,
9929 .v.verbs = (const struct hda_verb[]) {
9930 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
9934 [ALC662_FIXUP_SKU_IGNORE] = {
9935 .type = HDA_FIXUP_FUNC,
9936 .v.func = alc_fixup_sku_ignore,
9938 [ALC662_FIXUP_HP_RP5800] = {
9939 .type = HDA_FIXUP_PINS,
9940 .v.pins = (const struct hda_pintbl[]) {
9941 { 0x14, 0x0221201f }, /* HP out */
9945 .chain_id = ALC662_FIXUP_SKU_IGNORE
9947 [ALC662_FIXUP_ASUS_MODE1] = {
9948 .type = HDA_FIXUP_PINS,
9949 .v.pins = (const struct hda_pintbl[]) {
9950 { 0x14, 0x99130110 }, /* speaker */
9951 { 0x18, 0x01a19c20 }, /* mic */
9952 { 0x19, 0x99a3092f }, /* int-mic */
9953 { 0x21, 0x0121401f }, /* HP out */
9957 .chain_id = ALC662_FIXUP_SKU_IGNORE
9959 [ALC662_FIXUP_ASUS_MODE2] = {
9960 .type = HDA_FIXUP_PINS,
9961 .v.pins = (const struct hda_pintbl[]) {
9962 { 0x14, 0x99130110 }, /* speaker */
9963 { 0x18, 0x01a19820 }, /* mic */
9964 { 0x19, 0x99a3092f }, /* int-mic */
9965 { 0x1b, 0x0121401f }, /* HP out */
9969 .chain_id = ALC662_FIXUP_SKU_IGNORE
9971 [ALC662_FIXUP_ASUS_MODE3] = {
9972 .type = HDA_FIXUP_PINS,
9973 .v.pins = (const struct hda_pintbl[]) {
9974 { 0x14, 0x99130110 }, /* speaker */
9975 { 0x15, 0x0121441f }, /* HP */
9976 { 0x18, 0x01a19840 }, /* mic */
9977 { 0x19, 0x99a3094f }, /* int-mic */
9978 { 0x21, 0x01211420 }, /* HP2 */
9982 .chain_id = ALC662_FIXUP_SKU_IGNORE
9984 [ALC662_FIXUP_ASUS_MODE4] = {
9985 .type = HDA_FIXUP_PINS,
9986 .v.pins = (const struct hda_pintbl[]) {
9987 { 0x14, 0x99130110 }, /* speaker */
9988 { 0x16, 0x99130111 }, /* speaker */
9989 { 0x18, 0x01a19840 }, /* mic */
9990 { 0x19, 0x99a3094f }, /* int-mic */
9991 { 0x21, 0x0121441f }, /* HP */
9995 .chain_id = ALC662_FIXUP_SKU_IGNORE
9997 [ALC662_FIXUP_ASUS_MODE5] = {
9998 .type = HDA_FIXUP_PINS,
9999 .v.pins = (const struct hda_pintbl[]) {
10000 { 0x14, 0x99130110 }, /* speaker */
10001 { 0x15, 0x0121441f }, /* HP */
10002 { 0x16, 0x99130111 }, /* speaker */
10003 { 0x18, 0x01a19840 }, /* mic */
10004 { 0x19, 0x99a3094f }, /* int-mic */
10008 .chain_id = ALC662_FIXUP_SKU_IGNORE
10010 [ALC662_FIXUP_ASUS_MODE6] = {
10011 .type = HDA_FIXUP_PINS,
10012 .v.pins = (const struct hda_pintbl[]) {
10013 { 0x14, 0x99130110 }, /* speaker */
10014 { 0x15, 0x01211420 }, /* HP2 */
10015 { 0x18, 0x01a19840 }, /* mic */
10016 { 0x19, 0x99a3094f }, /* int-mic */
10017 { 0x1b, 0x0121441f }, /* HP */
10021 .chain_id = ALC662_FIXUP_SKU_IGNORE
10023 [ALC662_FIXUP_ASUS_MODE7] = {
10024 .type = HDA_FIXUP_PINS,
10025 .v.pins = (const struct hda_pintbl[]) {
10026 { 0x14, 0x99130110 }, /* speaker */
10027 { 0x17, 0x99130111 }, /* speaker */
10028 { 0x18, 0x01a19840 }, /* mic */
10029 { 0x19, 0x99a3094f }, /* int-mic */
10030 { 0x1b, 0x01214020 }, /* HP */
10031 { 0x21, 0x0121401f }, /* HP */
10035 .chain_id = ALC662_FIXUP_SKU_IGNORE
10037 [ALC662_FIXUP_ASUS_MODE8] = {
10038 .type = HDA_FIXUP_PINS,
10039 .v.pins = (const struct hda_pintbl[]) {
10040 { 0x14, 0x99130110 }, /* speaker */
10041 { 0x12, 0x99a30970 }, /* int-mic */
10042 { 0x15, 0x01214020 }, /* HP */
10043 { 0x17, 0x99130111 }, /* speaker */
10044 { 0x18, 0x01a19840 }, /* mic */
10045 { 0x21, 0x0121401f }, /* HP */
10049 .chain_id = ALC662_FIXUP_SKU_IGNORE
10051 [ALC662_FIXUP_NO_JACK_DETECT] = {
10052 .type = HDA_FIXUP_FUNC,
10053 .v.func = alc_fixup_no_jack_detect,
10055 [ALC662_FIXUP_ZOTAC_Z68] = {
10056 .type = HDA_FIXUP_PINS,
10057 .v.pins = (const struct hda_pintbl[]) {
10058 { 0x1b, 0x02214020 }, /* Front HP */
10062 [ALC662_FIXUP_INV_DMIC] = {
10063 .type = HDA_FIXUP_FUNC,
10064 .v.func = alc_fixup_inv_dmic,
10066 [ALC668_FIXUP_DELL_XPS13] = {
10067 .type = HDA_FIXUP_FUNC,
10068 .v.func = alc_fixup_dell_xps13,
10070 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10072 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10073 .type = HDA_FIXUP_FUNC,
10074 .v.func = alc_fixup_disable_aamix,
10076 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10078 [ALC668_FIXUP_AUTO_MUTE] = {
10079 .type = HDA_FIXUP_FUNC,
10080 .v.func = alc_fixup_auto_mute_via_amp,
10082 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10084 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10085 .type = HDA_FIXUP_PINS,
10086 .v.pins = (const struct hda_pintbl[]) {
10087 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10088 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10092 .chain_id = ALC662_FIXUP_HEADSET_MODE
10094 [ALC662_FIXUP_HEADSET_MODE] = {
10095 .type = HDA_FIXUP_FUNC,
10096 .v.func = alc_fixup_headset_mode_alc662,
10098 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10099 .type = HDA_FIXUP_PINS,
10100 .v.pins = (const struct hda_pintbl[]) {
10101 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10102 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10106 .chain_id = ALC668_FIXUP_HEADSET_MODE
10108 [ALC668_FIXUP_HEADSET_MODE] = {
10109 .type = HDA_FIXUP_FUNC,
10110 .v.func = alc_fixup_headset_mode_alc668,
10112 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10113 .type = HDA_FIXUP_FUNC,
10114 .v.func = alc_fixup_bass_chmap,
10116 .chain_id = ALC662_FIXUP_ASUS_MODE4
10118 [ALC662_FIXUP_BASS_16] = {
10119 .type = HDA_FIXUP_PINS,
10120 .v.pins = (const struct hda_pintbl[]) {
10121 {0x16, 0x80106111}, /* bass speaker */
10125 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10127 [ALC662_FIXUP_BASS_1A] = {
10128 .type = HDA_FIXUP_PINS,
10129 .v.pins = (const struct hda_pintbl[]) {
10130 {0x1a, 0x80106111}, /* bass speaker */
10134 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10136 [ALC662_FIXUP_BASS_CHMAP] = {
10137 .type = HDA_FIXUP_FUNC,
10138 .v.func = alc_fixup_bass_chmap,
10140 [ALC662_FIXUP_ASUS_Nx50] = {
10141 .type = HDA_FIXUP_FUNC,
10142 .v.func = alc_fixup_auto_mute_via_amp,
10144 .chain_id = ALC662_FIXUP_BASS_1A
10146 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10147 .type = HDA_FIXUP_FUNC,
10148 .v.func = alc_fixup_headset_mode_alc668,
10149 .chain_id = ALC662_FIXUP_BASS_CHMAP
10151 [ALC668_FIXUP_ASUS_Nx51] = {
10152 .type = HDA_FIXUP_PINS,
10153 .v.pins = (const struct hda_pintbl[]) {
10154 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10155 { 0x1a, 0x90170151 }, /* bass speaker */
10156 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10160 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10162 [ALC668_FIXUP_MIC_COEF] = {
10163 .type = HDA_FIXUP_VERBS,
10164 .v.verbs = (const struct hda_verb[]) {
10165 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10166 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10170 [ALC668_FIXUP_ASUS_G751] = {
10171 .type = HDA_FIXUP_PINS,
10172 .v.pins = (const struct hda_pintbl[]) {
10173 { 0x16, 0x0421101f }, /* HP */
10177 .chain_id = ALC668_FIXUP_MIC_COEF
10179 [ALC891_FIXUP_HEADSET_MODE] = {
10180 .type = HDA_FIXUP_FUNC,
10181 .v.func = alc_fixup_headset_mode,
10183 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10184 .type = HDA_FIXUP_PINS,
10185 .v.pins = (const struct hda_pintbl[]) {
10186 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10187 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10191 .chain_id = ALC891_FIXUP_HEADSET_MODE
10193 [ALC662_FIXUP_ACER_VERITON] = {
10194 .type = HDA_FIXUP_PINS,
10195 .v.pins = (const struct hda_pintbl[]) {
10196 { 0x15, 0x50170120 }, /* no internal speaker */
10200 [ALC892_FIXUP_ASROCK_MOBO] = {
10201 .type = HDA_FIXUP_PINS,
10202 .v.pins = (const struct hda_pintbl[]) {
10203 { 0x15, 0x40f000f0 }, /* disabled */
10204 { 0x16, 0x40f000f0 }, /* disabled */
10208 [ALC662_FIXUP_USI_FUNC] = {
10209 .type = HDA_FIXUP_FUNC,
10210 .v.func = alc662_fixup_usi_headset_mic,
10212 [ALC662_FIXUP_USI_HEADSET_MODE] = {
10213 .type = HDA_FIXUP_PINS,
10214 .v.pins = (const struct hda_pintbl[]) {
10215 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
10216 { 0x18, 0x01a1903d },
10220 .chain_id = ALC662_FIXUP_USI_FUNC
10222 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
10223 .type = HDA_FIXUP_FUNC,
10224 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
10226 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
10227 .type = HDA_FIXUP_FUNC,
10228 .v.func = alc662_fixup_aspire_ethos_hp,
10230 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
10231 .type = HDA_FIXUP_PINS,
10232 .v.pins = (const struct hda_pintbl[]) {
10233 { 0x15, 0x92130110 }, /* front speakers */
10234 { 0x18, 0x99130111 }, /* center/subwoofer */
10235 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
10239 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
10241 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
10242 .type = HDA_FIXUP_FUNC,
10243 .v.func = alc671_fixup_hp_headset_mic2,
10245 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
10246 .type = HDA_FIXUP_PINS,
10247 .v.pins = (const struct hda_pintbl[]) {
10248 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
10252 .chain_id = ALC662_FIXUP_USI_FUNC
10254 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
10255 .type = HDA_FIXUP_PINS,
10256 .v.pins = (const struct hda_pintbl[]) {
10257 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10258 { 0x1b, 0x0221144f },
10262 .chain_id = ALC662_FIXUP_USI_FUNC
10264 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
10265 .type = HDA_FIXUP_PINS,
10266 .v.pins = (const struct hda_pintbl[]) {
10267 { 0x1b, 0x04a1112c },
10271 .chain_id = ALC668_FIXUP_HEADSET_MIC
10273 [ALC668_FIXUP_HEADSET_MIC] = {
10274 .type = HDA_FIXUP_FUNC,
10275 .v.func = alc269_fixup_headset_mic,
10277 .chain_id = ALC668_FIXUP_MIC_DET_COEF
10279 [ALC668_FIXUP_MIC_DET_COEF] = {
10280 .type = HDA_FIXUP_VERBS,
10281 .v.verbs = (const struct hda_verb[]) {
10282 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
10283 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
10287 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
10288 .type = HDA_FIXUP_FUNC,
10289 .v.func = alc897_fixup_lenovo_headset_mic,
10291 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
10292 .type = HDA_FIXUP_PINS,
10293 .v.pins = (const struct hda_pintbl[]) {
10294 { 0x1a, 0x03a11050 },
10298 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
10300 [ALC897_FIXUP_HP_HSMIC_VERB] = {
10301 .type = HDA_FIXUP_PINS,
10302 .v.pins = (const struct hda_pintbl[]) {
10303 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
10307 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
10308 .type = HDA_FIXUP_FUNC,
10309 .v.func = alc897_fixup_lenovo_headset_mode,
10311 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
10312 .type = HDA_FIXUP_PINS,
10313 .v.pins = (const struct hda_pintbl[]) {
10314 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
10318 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
10320 [ALC897_FIXUP_UNIS_H3C_X500S] = {
10321 .type = HDA_FIXUP_VERBS,
10322 .v.verbs = (const struct hda_verb[]) {
10323 { 0x14, AC_VERB_SET_EAPD_BTLENABLE, 0 },
10329 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
10330 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
10331 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
10332 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
10333 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
10334 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
10335 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
10336 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
10337 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
10338 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
10339 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
10340 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
10341 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10342 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10343 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
10344 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
10345 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
10346 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10347 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10348 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10349 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10350 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
10351 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
10352 SND_PCI_QUIRK(0x103c, 0x870c, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
10353 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
10354 SND_PCI_QUIRK(0x103c, 0x872b, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
10355 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
10356 SND_PCI_QUIRK(0x103c, 0x8768, "HP Slim Desktop S01", ALC671_FIXUP_HP_HEADSET_MIC2),
10357 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
10358 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
10359 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
10360 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
10361 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
10362 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
10363 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
10364 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10365 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
10366 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
10367 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
10368 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
10369 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
10370 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
10371 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
10372 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
10373 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
10374 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
10375 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
10376 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
10377 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
10378 SND_PCI_QUIRK(0x17aa, 0x1064, "Lenovo P3 Tower", ALC897_FIXUP_HEADSET_MIC_PIN),
10379 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
10380 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
10381 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
10382 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
10383 SND_PCI_QUIRK(0x17aa, 0x3321, "Lenovo ThinkCentre M70 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
10384 SND_PCI_QUIRK(0x17aa, 0x331b, "Lenovo ThinkCentre M90 Gen4", ALC897_FIXUP_HEADSET_MIC_PIN),
10385 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
10386 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
10387 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
10388 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
10389 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
10390 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
10391 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
10392 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
10393 SND_PCI_QUIRK(0x1c6c, 0x1239, "Compaq N14JP6-V2", ALC897_FIXUP_HP_HSMIC_VERB),
10396 /* Below is a quirk table taken from the old code.
10397 * Basically the device should work as is without the fixup table.
10398 * If BIOS doesn't give a proper info, enable the corresponding
10401 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
10402 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
10403 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
10404 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
10405 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10406 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10407 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10408 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
10409 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
10410 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10411 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
10412 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
10413 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
10414 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
10415 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
10416 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10417 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
10418 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
10419 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10420 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10421 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10422 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10423 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
10424 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
10425 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
10426 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10427 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
10428 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
10429 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10430 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
10431 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10432 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10433 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
10434 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
10435 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
10436 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
10437 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
10438 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
10439 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
10440 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
10441 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
10442 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
10443 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10444 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
10445 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
10446 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
10447 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
10448 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
10449 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
10450 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
10455 static const struct hda_model_fixup alc662_fixup_models[] = {
10456 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
10457 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
10458 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
10459 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
10460 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
10461 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
10462 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
10463 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
10464 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
10465 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
10466 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
10467 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
10468 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
10469 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
10470 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
10471 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
10472 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
10473 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
10474 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
10475 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
10476 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
10477 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
10478 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
10479 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
10480 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
10481 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
10482 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
10483 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
10484 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
10485 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
10486 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
10487 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
10488 {.id = ALC897_FIXUP_UNIS_H3C_X500S, .name = "unis-h3c-x500s"},
10492 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
10493 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10494 {0x17, 0x02211010},
10495 {0x18, 0x01a19030},
10496 {0x1a, 0x01813040},
10497 {0x21, 0x01014020}),
10498 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10499 {0x16, 0x01813030},
10500 {0x17, 0x02211010},
10501 {0x18, 0x01a19040},
10502 {0x21, 0x01014020}),
10503 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10504 {0x14, 0x01014010},
10505 {0x18, 0x01a19020},
10506 {0x1a, 0x0181302f},
10507 {0x1b, 0x0221401f}),
10508 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10509 {0x12, 0x99a30130},
10510 {0x14, 0x90170110},
10511 {0x15, 0x0321101f},
10512 {0x16, 0x03011020}),
10513 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10514 {0x12, 0x99a30140},
10515 {0x14, 0x90170110},
10516 {0x15, 0x0321101f},
10517 {0x16, 0x03011020}),
10518 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10519 {0x12, 0x99a30150},
10520 {0x14, 0x90170110},
10521 {0x15, 0x0321101f},
10522 {0x16, 0x03011020}),
10523 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
10524 {0x14, 0x90170110},
10525 {0x15, 0x0321101f},
10526 {0x16, 0x03011020}),
10527 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
10528 {0x12, 0x90a60130},
10529 {0x14, 0x90170110},
10530 {0x15, 0x0321101f}),
10531 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10532 {0x14, 0x01014010},
10533 {0x17, 0x90170150},
10534 {0x19, 0x02a11060},
10535 {0x1b, 0x01813030},
10536 {0x21, 0x02211020}),
10537 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10538 {0x14, 0x01014010},
10539 {0x18, 0x01a19040},
10540 {0x1b, 0x01813030},
10541 {0x21, 0x02211020}),
10542 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
10543 {0x14, 0x01014020},
10544 {0x17, 0x90170110},
10545 {0x18, 0x01a19050},
10546 {0x1b, 0x01813040},
10547 {0x21, 0x02211030}),
10553 static int patch_alc662(struct hda_codec *codec)
10555 struct alc_spec *spec;
10558 err = alc_alloc_spec(codec, 0x0b);
10562 spec = codec->spec;
10564 spec->shutup = alc_eapd_shutup;
10566 /* handle multiple HPs as is */
10567 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
10569 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10571 switch (codec->core.vendor_id) {
10573 spec->init_hook = alc668_restore_default_value;
10577 alc_pre_init(codec);
10579 snd_hda_pick_fixup(codec, alc662_fixup_models,
10580 alc662_fixup_tbl, alc662_fixups);
10581 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
10582 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10584 alc_auto_parse_customize_define(codec);
10586 if (has_cdefine_beep(codec))
10587 spec->gen.beep_nid = 0x01;
10589 if ((alc_get_coef0(codec) & (1 << 14)) &&
10590 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
10591 spec->cdefine.platform_type == 1) {
10592 err = alc_codec_rename(codec, "ALC272X");
10597 /* automatic parse from the BIOS config */
10598 err = alc662_parse_auto_config(codec);
10602 if (!spec->gen.no_analog && spec->gen.beep_nid) {
10603 switch (codec->core.vendor_id) {
10605 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10611 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
10614 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
10621 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10634 static int alc680_parse_auto_config(struct hda_codec *codec)
10636 return alc_parse_auto_config(codec, NULL, NULL);
10641 static int patch_alc680(struct hda_codec *codec)
10645 /* ALC680 has no aa-loopback mixer */
10646 err = alc_alloc_spec(codec, 0);
10650 /* automatic parse from the BIOS config */
10651 err = alc680_parse_auto_config(codec);
10663 static const struct hda_device_id snd_hda_id_realtek[] = {
10664 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
10665 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
10666 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
10667 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
10668 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
10669 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
10670 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
10671 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
10672 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
10673 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
10674 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
10675 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
10676 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
10677 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
10678 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
10679 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
10680 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
10681 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
10682 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
10683 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
10684 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
10685 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
10686 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
10687 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
10688 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
10689 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
10690 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
10691 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
10692 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
10693 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
10694 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
10695 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
10696 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
10697 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
10698 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
10699 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
10700 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
10701 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
10702 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
10703 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
10704 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
10705 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
10706 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
10707 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
10708 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
10709 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
10710 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
10711 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
10712 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
10713 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
10714 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
10715 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
10716 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
10717 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
10718 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
10719 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
10720 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
10721 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
10722 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
10723 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
10724 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
10725 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
10726 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
10727 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
10728 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
10729 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
10730 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
10731 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
10732 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
10733 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
10734 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
10735 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
10736 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
10737 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
10738 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
10739 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
10740 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
10741 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
10742 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
10743 {} /* terminator */
10745 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
10747 MODULE_LICENSE("GPL");
10748 MODULE_DESCRIPTION("Realtek HD-audio codec");
10750 static struct hda_codec_driver realtek_driver = {
10751 .id = snd_hda_id_realtek,
10754 module_hda_codec_driver(realtek_driver);