1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine;
82 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask;
86 unsigned int gpio_dir;
87 unsigned int gpio_data;
88 bool gpio_write_delay; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity;
92 int micmute_led_polarity;
93 hda_nid_t mute_led_nid;
94 hda_nid_t cap_mute_led_nid;
96 unsigned int gpio_mute_led_mask;
97 unsigned int gpio_mic_led_mask;
98 struct alc_coef_led mute_led_coef;
99 struct alc_coef_led mic_led_coef;
100 struct mutex coef_mutex;
102 hda_nid_t headset_mic_pin;
103 hda_nid_t headphone_mic_pin;
104 int current_headset_mode;
105 int current_headset_type;
108 void (*init_hook)(struct hda_codec *codec);
110 void (*power_hook)(struct hda_codec *codec);
112 void (*shutup)(struct hda_codec *codec);
115 int codec_variant; /* flag for other variants */
116 unsigned int has_alc5505_dsp:1;
117 unsigned int no_depop_delay:1;
118 unsigned int done_hp_init:1;
119 unsigned int no_shutup_pins:1;
120 unsigned int ultra_low_power:1;
121 unsigned int has_hs_key:1;
122 unsigned int no_internal_mic_pin:1;
126 unsigned int pll_coef_idx, pll_coef_bit;
128 struct input_dev *kb_dev;
129 u8 alc_mute_keycode_map[1];
133 * COEF access helper functions
136 static void coef_mutex_lock(struct hda_codec *codec)
138 struct alc_spec *spec = codec->spec;
140 snd_hda_power_up_pm(codec);
141 mutex_lock(&spec->coef_mutex);
144 static void coef_mutex_unlock(struct hda_codec *codec)
146 struct alc_spec *spec = codec->spec;
148 mutex_unlock(&spec->coef_mutex);
149 snd_hda_power_down_pm(codec);
152 static int __alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
153 unsigned int coef_idx)
157 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
158 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
162 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
163 unsigned int coef_idx)
167 coef_mutex_lock(codec);
168 val = __alc_read_coefex_idx(codec, nid, coef_idx);
169 coef_mutex_unlock(codec);
173 #define alc_read_coef_idx(codec, coef_idx) \
174 alc_read_coefex_idx(codec, 0x20, coef_idx)
176 static void __alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
177 unsigned int coef_idx, unsigned int coef_val)
179 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
180 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
183 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
184 unsigned int coef_idx, unsigned int coef_val)
186 coef_mutex_lock(codec);
187 __alc_write_coefex_idx(codec, nid, coef_idx, coef_val);
188 coef_mutex_unlock(codec);
191 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
192 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
194 static void __alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
195 unsigned int coef_idx, unsigned int mask,
196 unsigned int bits_set)
198 unsigned int val = __alc_read_coefex_idx(codec, nid, coef_idx);
201 __alc_write_coefex_idx(codec, nid, coef_idx,
202 (val & ~mask) | bits_set);
205 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
206 unsigned int coef_idx, unsigned int mask,
207 unsigned int bits_set)
209 coef_mutex_lock(codec);
210 __alc_update_coefex_idx(codec, nid, coef_idx, mask, bits_set);
211 coef_mutex_unlock(codec);
214 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
215 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
217 /* a special bypass for COEF 0; read the cached value at the second time */
218 static unsigned int alc_get_coef0(struct hda_codec *codec)
220 struct alc_spec *spec = codec->spec;
223 spec->coef0 = alc_read_coef_idx(codec, 0);
227 /* coef writes/updates batch */
235 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
236 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
237 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
238 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
239 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
241 static void alc_process_coef_fw(struct hda_codec *codec,
242 const struct coef_fw *fw)
244 coef_mutex_lock(codec);
245 for (; fw->nid; fw++) {
246 if (fw->mask == (unsigned short)-1)
247 __alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
249 __alc_update_coefex_idx(codec, fw->nid, fw->idx,
252 coef_mutex_unlock(codec);
256 * GPIO setup tables, used in initialization
259 /* Enable GPIO mask and set output */
260 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
262 struct alc_spec *spec = codec->spec;
264 spec->gpio_mask |= mask;
265 spec->gpio_dir |= mask;
266 spec->gpio_data |= mask;
269 static void alc_write_gpio_data(struct hda_codec *codec)
271 struct alc_spec *spec = codec->spec;
273 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
277 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
280 struct alc_spec *spec = codec->spec;
281 unsigned int oldval = spec->gpio_data;
284 spec->gpio_data |= mask;
286 spec->gpio_data &= ~mask;
287 if (oldval != spec->gpio_data)
288 alc_write_gpio_data(codec);
291 static void alc_write_gpio(struct hda_codec *codec)
293 struct alc_spec *spec = codec->spec;
295 if (!spec->gpio_mask)
298 snd_hda_codec_write(codec, codec->core.afg, 0,
299 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
300 snd_hda_codec_write(codec, codec->core.afg, 0,
301 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
302 if (spec->gpio_write_delay)
304 alc_write_gpio_data(codec);
307 static void alc_fixup_gpio(struct hda_codec *codec, int action,
310 if (action == HDA_FIXUP_ACT_PRE_PROBE)
311 alc_setup_gpio(codec, mask);
314 static void alc_fixup_gpio1(struct hda_codec *codec,
315 const struct hda_fixup *fix, int action)
317 alc_fixup_gpio(codec, action, 0x01);
320 static void alc_fixup_gpio2(struct hda_codec *codec,
321 const struct hda_fixup *fix, int action)
323 alc_fixup_gpio(codec, action, 0x02);
326 static void alc_fixup_gpio3(struct hda_codec *codec,
327 const struct hda_fixup *fix, int action)
329 alc_fixup_gpio(codec, action, 0x03);
332 static void alc_fixup_gpio4(struct hda_codec *codec,
333 const struct hda_fixup *fix, int action)
335 alc_fixup_gpio(codec, action, 0x04);
338 static void alc_fixup_micmute_led(struct hda_codec *codec,
339 const struct hda_fixup *fix, int action)
341 if (action == HDA_FIXUP_ACT_PRE_PROBE)
342 snd_hda_gen_add_micmute_led_cdev(codec, NULL);
346 * Fix hardware PLL issue
347 * On some codecs, the analog PLL gating control must be off while
348 * the default value is 1.
350 static void alc_fix_pll(struct hda_codec *codec)
352 struct alc_spec *spec = codec->spec;
355 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
356 1 << spec->pll_coef_bit, 0);
359 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
360 unsigned int coef_idx, unsigned int coef_bit)
362 struct alc_spec *spec = codec->spec;
364 spec->pll_coef_idx = coef_idx;
365 spec->pll_coef_bit = coef_bit;
369 /* update the master volume per volume-knob's unsol event */
370 static void alc_update_knob_master(struct hda_codec *codec,
371 struct hda_jack_callback *jack)
374 struct snd_kcontrol *kctl;
375 struct snd_ctl_elem_value *uctl;
377 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
380 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
383 val = snd_hda_codec_read(codec, jack->nid, 0,
384 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
385 val &= HDA_AMP_VOLMASK;
386 uctl->value.integer.value[0] = val;
387 uctl->value.integer.value[1] = val;
388 kctl->put(kctl, uctl);
392 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
394 /* For some reason, the res given from ALC880 is broken.
395 Here we adjust it properly. */
396 snd_hda_jack_unsol_event(codec, res >> 2);
399 /* Change EAPD to verb control */
400 static void alc_fill_eapd_coef(struct hda_codec *codec)
404 coef = alc_get_coef0(codec);
406 switch (codec->core.vendor_id) {
408 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
412 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
415 if ((coef & 0x00f0) == 0x0010)
416 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
417 if ((coef & 0x00f0) == 0x0020)
418 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
419 if ((coef & 0x00f0) == 0x0030)
420 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
426 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
431 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
451 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
454 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
457 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
458 alc_write_coef_idx(codec, 0x8, 0x4ab7);
461 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
470 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
473 if ((coef & 0x00f0) == 0x0030)
474 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
483 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
487 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
490 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
493 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
496 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
497 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
501 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
508 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
513 /* additional initialization for ALC888 variants */
514 static void alc888_coef_init(struct hda_codec *codec)
516 switch (alc_get_coef0(codec) & 0x00f0) {
521 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
526 /* turn on/off EAPD control (only if available) */
527 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
529 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
531 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
532 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
536 /* turn on/off EAPD controls of the codec */
537 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
539 /* We currently only handle front, HP */
540 static const hda_nid_t pins[] = {
541 0x0f, 0x10, 0x14, 0x15, 0x17, 0
544 for (p = pins; *p; p++)
545 set_eapd(codec, *p, on);
548 static int find_ext_mic_pin(struct hda_codec *codec);
550 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
552 const struct hda_pincfg *pin;
553 int mic_pin = find_ext_mic_pin(codec);
556 /* don't shut up pins when unloading the driver; otherwise it breaks
557 * the default pin setup at the next load of the driver
559 if (codec->bus->shutdown)
562 snd_array_for_each(&codec->init_pins, i, pin) {
563 /* use read here for syncing after issuing each verb */
564 if (pin->nid != mic_pin)
565 snd_hda_codec_read(codec, pin->nid, 0,
566 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
569 codec->pins_shutup = 1;
572 static void alc_shutup_pins(struct hda_codec *codec)
574 struct alc_spec *spec = codec->spec;
576 switch (codec->core.vendor_id) {
584 alc_headset_mic_no_shutup(codec);
587 if (!spec->no_shutup_pins)
588 snd_hda_shutup_pins(codec);
593 /* generic shutup callback;
594 * just turning off EAPD and a little pause for avoiding pop-noise
596 static void alc_eapd_shutup(struct hda_codec *codec)
598 struct alc_spec *spec = codec->spec;
600 alc_auto_setup_eapd(codec, false);
601 if (!spec->no_depop_delay)
603 alc_shutup_pins(codec);
606 /* generic EAPD initialization */
607 static void alc_auto_init_amp(struct hda_codec *codec, int type)
609 alc_auto_setup_eapd(codec, true);
610 alc_write_gpio(codec);
612 case ALC_INIT_DEFAULT:
613 switch (codec->core.vendor_id) {
615 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
621 alc_update_coef_idx(codec, 7, 0, 0x2030);
624 alc888_coef_init(codec);
631 /* get a primary headphone pin if available */
632 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
634 if (spec->gen.autocfg.hp_pins[0])
635 return spec->gen.autocfg.hp_pins[0];
636 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
637 return spec->gen.autocfg.line_out_pins[0];
642 * Realtek SSID verification
645 /* Could be any non-zero and even value. When used as fixup, tells
646 * the driver to ignore any present sku defines.
648 #define ALC_FIXUP_SKU_IGNORE (2)
650 static void alc_fixup_sku_ignore(struct hda_codec *codec,
651 const struct hda_fixup *fix, int action)
653 struct alc_spec *spec = codec->spec;
654 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
655 spec->cdefine.fixup = 1;
656 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
660 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
661 const struct hda_fixup *fix, int action)
663 struct alc_spec *spec = codec->spec;
665 if (action == HDA_FIXUP_ACT_PROBE) {
666 spec->no_depop_delay = 1;
667 codec->depop_delay = 0;
671 static int alc_auto_parse_customize_define(struct hda_codec *codec)
673 unsigned int ass, tmp, i;
675 struct alc_spec *spec = codec->spec;
677 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
679 if (spec->cdefine.fixup) {
680 ass = spec->cdefine.sku_cfg;
681 if (ass == ALC_FIXUP_SKU_IGNORE)
686 if (!codec->bus->pci)
688 ass = codec->core.subsystem_id & 0xffff;
689 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
693 if (codec->core.vendor_id == 0x10ec0260)
695 ass = snd_hda_codec_get_pincfg(codec, nid);
698 codec_info(codec, "%s: SKU not ready 0x%08x\n",
699 codec->core.chip_name, ass);
705 for (i = 1; i < 16; i++) {
709 if (((ass >> 16) & 0xf) != tmp)
712 spec->cdefine.port_connectivity = ass >> 30;
713 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
714 spec->cdefine.check_sum = (ass >> 16) & 0xf;
715 spec->cdefine.customization = ass >> 8;
717 spec->cdefine.sku_cfg = ass;
718 spec->cdefine.external_amp = (ass & 0x38) >> 3;
719 spec->cdefine.platform_type = (ass & 0x4) >> 2;
720 spec->cdefine.swap = (ass & 0x2) >> 1;
721 spec->cdefine.override = ass & 0x1;
723 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
724 nid, spec->cdefine.sku_cfg);
725 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
726 spec->cdefine.port_connectivity);
727 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
728 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
729 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
730 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
731 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
732 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
733 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
738 /* return the position of NID in the list, or -1 if not found */
739 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
742 for (i = 0; i < nums; i++)
747 /* return true if the given NID is found in the list */
748 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
750 return find_idx_in_nid_list(nid, list, nums) >= 0;
753 /* check subsystem ID and set up device-specific initialization;
754 * return 1 if initialized, 0 if invalid SSID
756 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
757 * 31 ~ 16 : Manufacture ID
759 * 7 ~ 0 : Assembly ID
760 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
762 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
764 unsigned int ass, tmp, i;
766 struct alc_spec *spec = codec->spec;
768 if (spec->cdefine.fixup) {
769 ass = spec->cdefine.sku_cfg;
770 if (ass == ALC_FIXUP_SKU_IGNORE)
775 ass = codec->core.subsystem_id & 0xffff;
776 if (codec->bus->pci &&
777 ass != codec->bus->pci->subsystem_device && (ass & 1))
780 /* invalid SSID, check the special NID pin defcfg instead */
782 * 31~30 : port connectivity
785 * 19~16 : Check sum (15:1)
790 if (codec->core.vendor_id == 0x10ec0260)
792 ass = snd_hda_codec_get_pincfg(codec, nid);
794 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
798 if ((ass >> 30) != 1) /* no physical connection */
803 for (i = 1; i < 16; i++) {
807 if (((ass >> 16) & 0xf) != tmp)
810 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
811 ass & 0xffff, codec->core.vendor_id);
815 * 2 : 0 --> Desktop, 1 --> Laptop
816 * 3~5 : External Amplifier control
819 tmp = (ass & 0x38) >> 3; /* external Amp control */
820 if (spec->init_amp == ALC_INIT_UNDEFINED) {
823 alc_setup_gpio(codec, 0x01);
826 alc_setup_gpio(codec, 0x02);
829 alc_setup_gpio(codec, 0x03);
833 spec->init_amp = ALC_INIT_DEFAULT;
838 /* is laptop or Desktop and enable the function "Mute internal speaker
839 * when the external headphone out jack is plugged"
844 * 10~8 : Jack location
845 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
847 * 15 : 1 --> enable the function "Mute internal speaker
848 * when the external headphone out jack is plugged"
850 if (!alc_get_hp_pin(spec)) {
852 tmp = (ass >> 11) & 0x3; /* HP to chassis */
854 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
855 spec->gen.autocfg.line_outs))
857 spec->gen.autocfg.hp_pins[0] = nid;
862 /* Check the validity of ALC subsystem-id
863 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
864 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
866 if (!alc_subsystem_id(codec, ports)) {
867 struct alc_spec *spec = codec->spec;
868 if (spec->init_amp == ALC_INIT_UNDEFINED) {
870 "realtek: Enable default setup for auto mode as fallback\n");
871 spec->init_amp = ALC_INIT_DEFAULT;
879 static void alc_fixup_inv_dmic(struct hda_codec *codec,
880 const struct hda_fixup *fix, int action)
882 struct alc_spec *spec = codec->spec;
884 spec->gen.inv_dmic_split = 1;
888 static int alc_build_controls(struct hda_codec *codec)
892 err = snd_hda_gen_build_controls(codec);
896 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
905 static void alc_pre_init(struct hda_codec *codec)
907 alc_fill_eapd_coef(codec);
910 #define is_s3_resume(codec) \
911 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
912 #define is_s4_resume(codec) \
913 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
915 static int alc_init(struct hda_codec *codec)
917 struct alc_spec *spec = codec->spec;
919 /* hibernation resume needs the full chip initialization */
920 if (is_s4_resume(codec))
924 spec->init_hook(codec);
926 spec->gen.skip_verbs = 1; /* applied in below */
927 snd_hda_gen_init(codec);
929 alc_auto_init_amp(codec, spec->init_amp);
930 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
932 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
937 #define alc_free snd_hda_gen_free
940 static inline void alc_shutup(struct hda_codec *codec)
942 struct alc_spec *spec = codec->spec;
944 if (!snd_hda_get_bool_hint(codec, "shutup"))
945 return; /* disabled explicitly by hints */
947 if (spec && spec->shutup)
950 alc_shutup_pins(codec);
953 static void alc_power_eapd(struct hda_codec *codec)
955 alc_auto_setup_eapd(codec, false);
958 static int alc_suspend(struct hda_codec *codec)
960 struct alc_spec *spec = codec->spec;
962 if (spec && spec->power_hook)
963 spec->power_hook(codec);
967 static int alc_resume(struct hda_codec *codec)
969 struct alc_spec *spec = codec->spec;
971 if (!spec->no_depop_delay)
972 msleep(150); /* to avoid pop noise */
973 codec->patch_ops.init(codec);
974 snd_hda_regmap_sync(codec);
975 hda_call_check_power_status(codec, 0x01);
982 static const struct hda_codec_ops alc_patch_ops = {
983 .build_controls = alc_build_controls,
984 .build_pcms = snd_hda_gen_build_pcms,
987 .unsol_event = snd_hda_jack_unsol_event,
989 .resume = alc_resume,
990 .suspend = alc_suspend,
991 .check_power_status = snd_hda_gen_check_power_status,
996 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
999 * Rename codecs appropriately from COEF value or subvendor id
1001 struct alc_codec_rename_table {
1002 unsigned int vendor_id;
1003 unsigned short coef_mask;
1004 unsigned short coef_bits;
1008 struct alc_codec_rename_pci_table {
1009 unsigned int codec_vendor_id;
1010 unsigned short pci_subvendor;
1011 unsigned short pci_subdevice;
1015 static const struct alc_codec_rename_table rename_tbl[] = {
1016 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
1017 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
1018 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
1019 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
1020 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
1021 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
1022 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
1023 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
1024 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
1025 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
1026 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
1027 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
1028 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
1029 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
1030 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
1031 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
1032 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
1033 { } /* terminator */
1036 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
1037 { 0x10ec0280, 0x1028, 0, "ALC3220" },
1038 { 0x10ec0282, 0x1028, 0, "ALC3221" },
1039 { 0x10ec0283, 0x1028, 0, "ALC3223" },
1040 { 0x10ec0288, 0x1028, 0, "ALC3263" },
1041 { 0x10ec0292, 0x1028, 0, "ALC3226" },
1042 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1043 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1044 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1045 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1046 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1047 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1048 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1049 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1050 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1051 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1052 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1053 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1054 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1055 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1056 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1057 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1058 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1059 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1060 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1061 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1062 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1063 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1064 { } /* terminator */
1067 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1069 const struct alc_codec_rename_table *p;
1070 const struct alc_codec_rename_pci_table *q;
1072 for (p = rename_tbl; p->vendor_id; p++) {
1073 if (p->vendor_id != codec->core.vendor_id)
1075 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1076 return alc_codec_rename(codec, p->name);
1079 if (!codec->bus->pci)
1081 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1082 if (q->codec_vendor_id != codec->core.vendor_id)
1084 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1086 if (!q->pci_subdevice ||
1087 q->pci_subdevice == codec->bus->pci->subsystem_device)
1088 return alc_codec_rename(codec, q->name);
1096 * Digital-beep handlers
1098 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1100 /* additional beep mixers; private_value will be overwritten */
1101 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1102 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1103 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1106 /* set up and create beep controls */
1107 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1110 struct snd_kcontrol_new *knew;
1111 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1114 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1115 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1116 &alc_beep_mixer[i]);
1119 knew->private_value = beep_amp;
1124 static const struct snd_pci_quirk beep_allow_list[] = {
1125 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1126 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1127 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1128 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1129 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1130 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1131 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1132 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1133 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1134 /* denylist -- no beep available */
1135 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1136 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1140 static inline int has_cdefine_beep(struct hda_codec *codec)
1142 struct alc_spec *spec = codec->spec;
1143 const struct snd_pci_quirk *q;
1144 q = snd_pci_quirk_lookup(codec->bus->pci, beep_allow_list);
1147 return spec->cdefine.enable_pcbeep;
1150 #define set_beep_amp(spec, nid, idx, dir) 0
1151 #define has_cdefine_beep(codec) 0
1154 /* parse the BIOS configuration and set up the alc_spec */
1155 /* return 1 if successful, 0 if the proper config is not found,
1156 * or a negative error code
1158 static int alc_parse_auto_config(struct hda_codec *codec,
1159 const hda_nid_t *ignore_nids,
1160 const hda_nid_t *ssid_nids)
1162 struct alc_spec *spec = codec->spec;
1163 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1166 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1172 alc_ssid_check(codec, ssid_nids);
1174 err = snd_hda_gen_parse_auto_config(codec, cfg);
1181 /* common preparation job for alc_spec */
1182 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1184 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1190 snd_hda_gen_spec_init(&spec->gen);
1191 spec->gen.mixer_nid = mixer_nid;
1192 spec->gen.own_eapd_ctl = 1;
1193 codec->single_adc_amp = 1;
1194 /* FIXME: do we need this for all Realtek codec models? */
1195 codec->spdif_status_reset = 1;
1196 codec->forced_resume = 1;
1197 codec->patch_ops = alc_patch_ops;
1198 mutex_init(&spec->coef_mutex);
1200 err = alc_codec_rename_from_preset(codec);
1208 static int alc880_parse_auto_config(struct hda_codec *codec)
1210 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1211 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1212 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1221 ALC880_FIXUP_MEDION_RIM,
1223 ALC880_FIXUP_LG_LW25,
1225 ALC880_FIXUP_EAPD_COEF,
1226 ALC880_FIXUP_TCL_S700,
1227 ALC880_FIXUP_VOL_KNOB,
1228 ALC880_FIXUP_FUJITSU,
1230 ALC880_FIXUP_UNIWILL,
1231 ALC880_FIXUP_UNIWILL_DIG,
1233 ALC880_FIXUP_ASUS_W5A,
1234 ALC880_FIXUP_3ST_BASE,
1236 ALC880_FIXUP_3ST_DIG,
1237 ALC880_FIXUP_5ST_BASE,
1239 ALC880_FIXUP_5ST_DIG,
1240 ALC880_FIXUP_6ST_BASE,
1242 ALC880_FIXUP_6ST_DIG,
1243 ALC880_FIXUP_6ST_AUTOMUTE,
1246 /* enable the volume-knob widget support on NID 0x21 */
1247 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1248 const struct hda_fixup *fix, int action)
1250 if (action == HDA_FIXUP_ACT_PROBE)
1251 snd_hda_jack_detect_enable_callback(codec, 0x21,
1252 alc_update_knob_master);
1255 static const struct hda_fixup alc880_fixups[] = {
1256 [ALC880_FIXUP_GPIO1] = {
1257 .type = HDA_FIXUP_FUNC,
1258 .v.func = alc_fixup_gpio1,
1260 [ALC880_FIXUP_GPIO2] = {
1261 .type = HDA_FIXUP_FUNC,
1262 .v.func = alc_fixup_gpio2,
1264 [ALC880_FIXUP_MEDION_RIM] = {
1265 .type = HDA_FIXUP_VERBS,
1266 .v.verbs = (const struct hda_verb[]) {
1267 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1268 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1272 .chain_id = ALC880_FIXUP_GPIO2,
1274 [ALC880_FIXUP_LG] = {
1275 .type = HDA_FIXUP_PINS,
1276 .v.pins = (const struct hda_pintbl[]) {
1277 /* disable bogus unused pins */
1278 { 0x16, 0x411111f0 },
1279 { 0x18, 0x411111f0 },
1280 { 0x1a, 0x411111f0 },
1284 [ALC880_FIXUP_LG_LW25] = {
1285 .type = HDA_FIXUP_PINS,
1286 .v.pins = (const struct hda_pintbl[]) {
1287 { 0x1a, 0x0181344f }, /* line-in */
1288 { 0x1b, 0x0321403f }, /* headphone */
1292 [ALC880_FIXUP_W810] = {
1293 .type = HDA_FIXUP_PINS,
1294 .v.pins = (const struct hda_pintbl[]) {
1295 /* disable bogus unused pins */
1296 { 0x17, 0x411111f0 },
1300 .chain_id = ALC880_FIXUP_GPIO2,
1302 [ALC880_FIXUP_EAPD_COEF] = {
1303 .type = HDA_FIXUP_VERBS,
1304 .v.verbs = (const struct hda_verb[]) {
1305 /* change to EAPD mode */
1306 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1307 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1311 [ALC880_FIXUP_TCL_S700] = {
1312 .type = HDA_FIXUP_VERBS,
1313 .v.verbs = (const struct hda_verb[]) {
1314 /* change to EAPD mode */
1315 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1316 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1320 .chain_id = ALC880_FIXUP_GPIO2,
1322 [ALC880_FIXUP_VOL_KNOB] = {
1323 .type = HDA_FIXUP_FUNC,
1324 .v.func = alc880_fixup_vol_knob,
1326 [ALC880_FIXUP_FUJITSU] = {
1327 /* override all pins as BIOS on old Amilo is broken */
1328 .type = HDA_FIXUP_PINS,
1329 .v.pins = (const struct hda_pintbl[]) {
1330 { 0x14, 0x0121401f }, /* HP */
1331 { 0x15, 0x99030120 }, /* speaker */
1332 { 0x16, 0x99030130 }, /* bass speaker */
1333 { 0x17, 0x411111f0 }, /* N/A */
1334 { 0x18, 0x411111f0 }, /* N/A */
1335 { 0x19, 0x01a19950 }, /* mic-in */
1336 { 0x1a, 0x411111f0 }, /* N/A */
1337 { 0x1b, 0x411111f0 }, /* N/A */
1338 { 0x1c, 0x411111f0 }, /* N/A */
1339 { 0x1d, 0x411111f0 }, /* N/A */
1340 { 0x1e, 0x01454140 }, /* SPDIF out */
1344 .chain_id = ALC880_FIXUP_VOL_KNOB,
1346 [ALC880_FIXUP_F1734] = {
1347 /* almost compatible with FUJITSU, but no bass and SPDIF */
1348 .type = HDA_FIXUP_PINS,
1349 .v.pins = (const struct hda_pintbl[]) {
1350 { 0x14, 0x0121401f }, /* HP */
1351 { 0x15, 0x99030120 }, /* speaker */
1352 { 0x16, 0x411111f0 }, /* N/A */
1353 { 0x17, 0x411111f0 }, /* N/A */
1354 { 0x18, 0x411111f0 }, /* N/A */
1355 { 0x19, 0x01a19950 }, /* mic-in */
1356 { 0x1a, 0x411111f0 }, /* N/A */
1357 { 0x1b, 0x411111f0 }, /* N/A */
1358 { 0x1c, 0x411111f0 }, /* N/A */
1359 { 0x1d, 0x411111f0 }, /* N/A */
1360 { 0x1e, 0x411111f0 }, /* N/A */
1364 .chain_id = ALC880_FIXUP_VOL_KNOB,
1366 [ALC880_FIXUP_UNIWILL] = {
1367 /* need to fix HP and speaker pins to be parsed correctly */
1368 .type = HDA_FIXUP_PINS,
1369 .v.pins = (const struct hda_pintbl[]) {
1370 { 0x14, 0x0121411f }, /* HP */
1371 { 0x15, 0x99030120 }, /* speaker */
1372 { 0x16, 0x99030130 }, /* bass speaker */
1376 [ALC880_FIXUP_UNIWILL_DIG] = {
1377 .type = HDA_FIXUP_PINS,
1378 .v.pins = (const struct hda_pintbl[]) {
1379 /* disable bogus unused pins */
1380 { 0x17, 0x411111f0 },
1381 { 0x19, 0x411111f0 },
1382 { 0x1b, 0x411111f0 },
1383 { 0x1f, 0x411111f0 },
1387 [ALC880_FIXUP_Z71V] = {
1388 .type = HDA_FIXUP_PINS,
1389 .v.pins = (const struct hda_pintbl[]) {
1390 /* set up the whole pins as BIOS is utterly broken */
1391 { 0x14, 0x99030120 }, /* speaker */
1392 { 0x15, 0x0121411f }, /* HP */
1393 { 0x16, 0x411111f0 }, /* N/A */
1394 { 0x17, 0x411111f0 }, /* N/A */
1395 { 0x18, 0x01a19950 }, /* mic-in */
1396 { 0x19, 0x411111f0 }, /* N/A */
1397 { 0x1a, 0x01813031 }, /* line-in */
1398 { 0x1b, 0x411111f0 }, /* N/A */
1399 { 0x1c, 0x411111f0 }, /* N/A */
1400 { 0x1d, 0x411111f0 }, /* N/A */
1401 { 0x1e, 0x0144111e }, /* SPDIF */
1405 [ALC880_FIXUP_ASUS_W5A] = {
1406 .type = HDA_FIXUP_PINS,
1407 .v.pins = (const struct hda_pintbl[]) {
1408 /* set up the whole pins as BIOS is utterly broken */
1409 { 0x14, 0x0121411f }, /* HP */
1410 { 0x15, 0x411111f0 }, /* N/A */
1411 { 0x16, 0x411111f0 }, /* N/A */
1412 { 0x17, 0x411111f0 }, /* N/A */
1413 { 0x18, 0x90a60160 }, /* mic */
1414 { 0x19, 0x411111f0 }, /* N/A */
1415 { 0x1a, 0x411111f0 }, /* N/A */
1416 { 0x1b, 0x411111f0 }, /* N/A */
1417 { 0x1c, 0x411111f0 }, /* N/A */
1418 { 0x1d, 0x411111f0 }, /* N/A */
1419 { 0x1e, 0xb743111e }, /* SPDIF out */
1423 .chain_id = ALC880_FIXUP_GPIO1,
1425 [ALC880_FIXUP_3ST_BASE] = {
1426 .type = HDA_FIXUP_PINS,
1427 .v.pins = (const struct hda_pintbl[]) {
1428 { 0x14, 0x01014010 }, /* line-out */
1429 { 0x15, 0x411111f0 }, /* N/A */
1430 { 0x16, 0x411111f0 }, /* N/A */
1431 { 0x17, 0x411111f0 }, /* N/A */
1432 { 0x18, 0x01a19c30 }, /* mic-in */
1433 { 0x19, 0x0121411f }, /* HP */
1434 { 0x1a, 0x01813031 }, /* line-in */
1435 { 0x1b, 0x02a19c40 }, /* front-mic */
1436 { 0x1c, 0x411111f0 }, /* N/A */
1437 { 0x1d, 0x411111f0 }, /* N/A */
1438 /* 0x1e is filled in below */
1439 { 0x1f, 0x411111f0 }, /* N/A */
1443 [ALC880_FIXUP_3ST] = {
1444 .type = HDA_FIXUP_PINS,
1445 .v.pins = (const struct hda_pintbl[]) {
1446 { 0x1e, 0x411111f0 }, /* N/A */
1450 .chain_id = ALC880_FIXUP_3ST_BASE,
1452 [ALC880_FIXUP_3ST_DIG] = {
1453 .type = HDA_FIXUP_PINS,
1454 .v.pins = (const struct hda_pintbl[]) {
1455 { 0x1e, 0x0144111e }, /* SPDIF */
1459 .chain_id = ALC880_FIXUP_3ST_BASE,
1461 [ALC880_FIXUP_5ST_BASE] = {
1462 .type = HDA_FIXUP_PINS,
1463 .v.pins = (const struct hda_pintbl[]) {
1464 { 0x14, 0x01014010 }, /* front */
1465 { 0x15, 0x411111f0 }, /* N/A */
1466 { 0x16, 0x01011411 }, /* CLFE */
1467 { 0x17, 0x01016412 }, /* surr */
1468 { 0x18, 0x01a19c30 }, /* mic-in */
1469 { 0x19, 0x0121411f }, /* HP */
1470 { 0x1a, 0x01813031 }, /* line-in */
1471 { 0x1b, 0x02a19c40 }, /* front-mic */
1472 { 0x1c, 0x411111f0 }, /* N/A */
1473 { 0x1d, 0x411111f0 }, /* N/A */
1474 /* 0x1e is filled in below */
1475 { 0x1f, 0x411111f0 }, /* N/A */
1479 [ALC880_FIXUP_5ST] = {
1480 .type = HDA_FIXUP_PINS,
1481 .v.pins = (const struct hda_pintbl[]) {
1482 { 0x1e, 0x411111f0 }, /* N/A */
1486 .chain_id = ALC880_FIXUP_5ST_BASE,
1488 [ALC880_FIXUP_5ST_DIG] = {
1489 .type = HDA_FIXUP_PINS,
1490 .v.pins = (const struct hda_pintbl[]) {
1491 { 0x1e, 0x0144111e }, /* SPDIF */
1495 .chain_id = ALC880_FIXUP_5ST_BASE,
1497 [ALC880_FIXUP_6ST_BASE] = {
1498 .type = HDA_FIXUP_PINS,
1499 .v.pins = (const struct hda_pintbl[]) {
1500 { 0x14, 0x01014010 }, /* front */
1501 { 0x15, 0x01016412 }, /* surr */
1502 { 0x16, 0x01011411 }, /* CLFE */
1503 { 0x17, 0x01012414 }, /* side */
1504 { 0x18, 0x01a19c30 }, /* mic-in */
1505 { 0x19, 0x02a19c40 }, /* front-mic */
1506 { 0x1a, 0x01813031 }, /* line-in */
1507 { 0x1b, 0x0121411f }, /* HP */
1508 { 0x1c, 0x411111f0 }, /* N/A */
1509 { 0x1d, 0x411111f0 }, /* N/A */
1510 /* 0x1e is filled in below */
1511 { 0x1f, 0x411111f0 }, /* N/A */
1515 [ALC880_FIXUP_6ST] = {
1516 .type = HDA_FIXUP_PINS,
1517 .v.pins = (const struct hda_pintbl[]) {
1518 { 0x1e, 0x411111f0 }, /* N/A */
1522 .chain_id = ALC880_FIXUP_6ST_BASE,
1524 [ALC880_FIXUP_6ST_DIG] = {
1525 .type = HDA_FIXUP_PINS,
1526 .v.pins = (const struct hda_pintbl[]) {
1527 { 0x1e, 0x0144111e }, /* SPDIF */
1531 .chain_id = ALC880_FIXUP_6ST_BASE,
1533 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1534 .type = HDA_FIXUP_PINS,
1535 .v.pins = (const struct hda_pintbl[]) {
1536 { 0x1b, 0x0121401f }, /* HP with jack detect */
1539 .chained_before = true,
1540 .chain_id = ALC880_FIXUP_6ST_BASE,
1544 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1545 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1546 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1547 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1548 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1549 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1550 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1551 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1552 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1553 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1554 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1555 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1556 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1557 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1558 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1559 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1560 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1561 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1562 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1563 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1564 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1565 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1566 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1567 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1569 /* Below is the copied entries from alc880_quirks.c.
1570 * It's not quite sure whether BIOS sets the correct pin-config table
1571 * on these machines, thus they are kept to be compatible with
1572 * the old static quirks. Once when it's confirmed to work without
1573 * these overrides, it'd be better to remove.
1575 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1576 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1577 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1578 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1579 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1580 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1581 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1582 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1583 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1584 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1585 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1586 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1587 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1588 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1589 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1590 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1591 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1592 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1593 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1594 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1595 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1596 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1597 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1598 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1599 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1600 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1601 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1602 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1603 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1604 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1605 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1606 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1607 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1609 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1610 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1611 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1615 static const struct hda_model_fixup alc880_fixup_models[] = {
1616 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1617 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1618 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1619 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1620 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1621 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1622 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1628 * OK, here we have finally the patch for ALC880
1630 static int patch_alc880(struct hda_codec *codec)
1632 struct alc_spec *spec;
1635 err = alc_alloc_spec(codec, 0x0b);
1640 spec->gen.need_dac_fix = 1;
1641 spec->gen.beep_nid = 0x01;
1643 codec->patch_ops.unsol_event = alc880_unsol_event;
1645 alc_pre_init(codec);
1647 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1649 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1651 /* automatic parse from the BIOS config */
1652 err = alc880_parse_auto_config(codec);
1656 if (!spec->gen.no_analog) {
1657 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1662 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1675 static int alc260_parse_auto_config(struct hda_codec *codec)
1677 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1678 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1679 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1686 ALC260_FIXUP_HP_DC5750,
1687 ALC260_FIXUP_HP_PIN_0F,
1690 ALC260_FIXUP_GPIO1_TOGGLE,
1691 ALC260_FIXUP_REPLACER,
1692 ALC260_FIXUP_HP_B1900,
1694 ALC260_FIXUP_FSC_S7020,
1695 ALC260_FIXUP_FSC_S7020_JWSE,
1696 ALC260_FIXUP_VAIO_PINS,
1699 static void alc260_gpio1_automute(struct hda_codec *codec)
1701 struct alc_spec *spec = codec->spec;
1703 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1706 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1707 const struct hda_fixup *fix, int action)
1709 struct alc_spec *spec = codec->spec;
1710 if (action == HDA_FIXUP_ACT_PROBE) {
1711 /* although the machine has only one output pin, we need to
1712 * toggle GPIO1 according to the jack state
1714 spec->gen.automute_hook = alc260_gpio1_automute;
1715 spec->gen.detect_hp = 1;
1716 spec->gen.automute_speaker = 1;
1717 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1718 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1719 snd_hda_gen_hp_automute);
1720 alc_setup_gpio(codec, 0x01);
1724 static void alc260_fixup_kn1(struct hda_codec *codec,
1725 const struct hda_fixup *fix, int action)
1727 struct alc_spec *spec = codec->spec;
1728 static const struct hda_pintbl pincfgs[] = {
1729 { 0x0f, 0x02214000 }, /* HP/speaker */
1730 { 0x12, 0x90a60160 }, /* int mic */
1731 { 0x13, 0x02a19000 }, /* ext mic */
1732 { 0x18, 0x01446000 }, /* SPDIF out */
1733 /* disable bogus I/O pins */
1734 { 0x10, 0x411111f0 },
1735 { 0x11, 0x411111f0 },
1736 { 0x14, 0x411111f0 },
1737 { 0x15, 0x411111f0 },
1738 { 0x16, 0x411111f0 },
1739 { 0x17, 0x411111f0 },
1740 { 0x19, 0x411111f0 },
1745 case HDA_FIXUP_ACT_PRE_PROBE:
1746 snd_hda_apply_pincfgs(codec, pincfgs);
1747 spec->init_amp = ALC_INIT_NONE;
1752 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1753 const struct hda_fixup *fix, int action)
1755 struct alc_spec *spec = codec->spec;
1756 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1757 spec->init_amp = ALC_INIT_NONE;
1760 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1761 const struct hda_fixup *fix, int action)
1763 struct alc_spec *spec = codec->spec;
1764 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1765 spec->gen.add_jack_modes = 1;
1766 spec->gen.hp_mic = 1;
1770 static const struct hda_fixup alc260_fixups[] = {
1771 [ALC260_FIXUP_HP_DC5750] = {
1772 .type = HDA_FIXUP_PINS,
1773 .v.pins = (const struct hda_pintbl[]) {
1774 { 0x11, 0x90130110 }, /* speaker */
1778 [ALC260_FIXUP_HP_PIN_0F] = {
1779 .type = HDA_FIXUP_PINS,
1780 .v.pins = (const struct hda_pintbl[]) {
1781 { 0x0f, 0x01214000 }, /* HP */
1785 [ALC260_FIXUP_COEF] = {
1786 .type = HDA_FIXUP_VERBS,
1787 .v.verbs = (const struct hda_verb[]) {
1788 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1789 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1793 [ALC260_FIXUP_GPIO1] = {
1794 .type = HDA_FIXUP_FUNC,
1795 .v.func = alc_fixup_gpio1,
1797 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1798 .type = HDA_FIXUP_FUNC,
1799 .v.func = alc260_fixup_gpio1_toggle,
1801 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1803 [ALC260_FIXUP_REPLACER] = {
1804 .type = HDA_FIXUP_VERBS,
1805 .v.verbs = (const struct hda_verb[]) {
1806 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1807 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1811 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1813 [ALC260_FIXUP_HP_B1900] = {
1814 .type = HDA_FIXUP_FUNC,
1815 .v.func = alc260_fixup_gpio1_toggle,
1817 .chain_id = ALC260_FIXUP_COEF,
1819 [ALC260_FIXUP_KN1] = {
1820 .type = HDA_FIXUP_FUNC,
1821 .v.func = alc260_fixup_kn1,
1823 [ALC260_FIXUP_FSC_S7020] = {
1824 .type = HDA_FIXUP_FUNC,
1825 .v.func = alc260_fixup_fsc_s7020,
1827 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1828 .type = HDA_FIXUP_FUNC,
1829 .v.func = alc260_fixup_fsc_s7020_jwse,
1831 .chain_id = ALC260_FIXUP_FSC_S7020,
1833 [ALC260_FIXUP_VAIO_PINS] = {
1834 .type = HDA_FIXUP_PINS,
1835 .v.pins = (const struct hda_pintbl[]) {
1836 /* Pin configs are missing completely on some VAIOs */
1837 { 0x0f, 0x01211020 },
1838 { 0x10, 0x0001003f },
1839 { 0x11, 0x411111f0 },
1840 { 0x12, 0x01a15930 },
1841 { 0x13, 0x411111f0 },
1842 { 0x14, 0x411111f0 },
1843 { 0x15, 0x411111f0 },
1844 { 0x16, 0x411111f0 },
1845 { 0x17, 0x411111f0 },
1846 { 0x18, 0x411111f0 },
1847 { 0x19, 0x411111f0 },
1853 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1854 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1855 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1856 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1857 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1858 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1859 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1860 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1861 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1862 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1863 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1864 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1865 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1869 static const struct hda_model_fixup alc260_fixup_models[] = {
1870 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1871 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1872 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1873 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1879 static int patch_alc260(struct hda_codec *codec)
1881 struct alc_spec *spec;
1884 err = alc_alloc_spec(codec, 0x07);
1889 /* as quite a few machines require HP amp for speaker outputs,
1890 * it's easier to enable it unconditionally; even if it's unneeded,
1891 * it's almost harmless.
1893 spec->gen.prefer_hp_amp = 1;
1894 spec->gen.beep_nid = 0x01;
1896 spec->shutup = alc_eapd_shutup;
1898 alc_pre_init(codec);
1900 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1902 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1904 /* automatic parse from the BIOS config */
1905 err = alc260_parse_auto_config(codec);
1909 if (!spec->gen.no_analog) {
1910 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1915 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1926 * ALC882/883/885/888/889 support
1928 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1929 * configuration. Each pin widget can choose any input DACs and a mixer.
1930 * Each ADC is connected from a mixer of all inputs. This makes possible
1931 * 6-channel independent captures.
1933 * In addition, an independent DAC for the multi-playback (not used in this
1941 ALC882_FIXUP_ABIT_AW9D_MAX,
1942 ALC882_FIXUP_LENOVO_Y530,
1943 ALC882_FIXUP_PB_M5210,
1944 ALC882_FIXUP_ACER_ASPIRE_7736,
1945 ALC882_FIXUP_ASUS_W90V,
1947 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1948 ALC889_FIXUP_VAIO_TT,
1949 ALC888_FIXUP_EEE1601,
1953 ALC883_FIXUP_ACER_EAPD,
1958 ALC882_FIXUP_ASUS_W2JC,
1959 ALC882_FIXUP_ACER_ASPIRE_4930G,
1960 ALC882_FIXUP_ACER_ASPIRE_8930G,
1961 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1962 ALC885_FIXUP_MACPRO_GPIO,
1963 ALC889_FIXUP_DAC_ROUTE,
1964 ALC889_FIXUP_MBP_VREF,
1965 ALC889_FIXUP_IMAC91_VREF,
1966 ALC889_FIXUP_MBA11_VREF,
1967 ALC889_FIXUP_MBA21_VREF,
1968 ALC889_FIXUP_MP11_VREF,
1969 ALC889_FIXUP_MP41_VREF,
1970 ALC882_FIXUP_INV_DMIC,
1971 ALC882_FIXUP_NO_PRIMARY_HP,
1972 ALC887_FIXUP_ASUS_BASS,
1973 ALC887_FIXUP_BASS_CHMAP,
1974 ALC1220_FIXUP_GB_DUAL_CODECS,
1975 ALC1220_FIXUP_GB_X570,
1976 ALC1220_FIXUP_CLEVO_P950,
1977 ALC1220_FIXUP_CLEVO_PB51ED,
1978 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1979 ALC887_FIXUP_ASUS_AUDIO,
1980 ALC887_FIXUP_ASUS_HMIC,
1981 ALCS1200A_FIXUP_MIC_VREF,
1984 static void alc889_fixup_coef(struct hda_codec *codec,
1985 const struct hda_fixup *fix, int action)
1987 if (action != HDA_FIXUP_ACT_INIT)
1989 alc_update_coef_idx(codec, 7, 0, 0x2030);
1992 /* set up GPIO at initialization */
1993 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1994 const struct hda_fixup *fix, int action)
1996 struct alc_spec *spec = codec->spec;
1998 spec->gpio_write_delay = true;
1999 alc_fixup_gpio3(codec, fix, action);
2002 /* Fix the connection of some pins for ALC889:
2003 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
2004 * work correctly (bko#42740)
2006 static void alc889_fixup_dac_route(struct hda_codec *codec,
2007 const struct hda_fixup *fix, int action)
2009 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2010 /* fake the connections during parsing the tree */
2011 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
2012 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
2013 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2014 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
2015 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
2016 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
2017 } else if (action == HDA_FIXUP_ACT_PROBE) {
2018 /* restore the connections */
2019 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
2020 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
2021 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
2022 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
2023 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
2027 /* Set VREF on HP pin */
2028 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
2029 const struct hda_fixup *fix, int action)
2031 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
2032 struct alc_spec *spec = codec->spec;
2035 if (action != HDA_FIXUP_ACT_INIT)
2037 for (i = 0; i < ARRAY_SIZE(nids); i++) {
2038 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
2039 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
2041 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2042 val |= AC_PINCTL_VREF_80;
2043 snd_hda_set_pin_ctl(codec, nids[i], val);
2044 spec->gen.keep_vref_in_automute = 1;
2049 static void alc889_fixup_mac_pins(struct hda_codec *codec,
2050 const hda_nid_t *nids, int num_nids)
2052 struct alc_spec *spec = codec->spec;
2055 for (i = 0; i < num_nids; i++) {
2057 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2058 val |= AC_PINCTL_VREF_50;
2059 snd_hda_set_pin_ctl(codec, nids[i], val);
2061 spec->gen.keep_vref_in_automute = 1;
2064 /* Set VREF on speaker pins on imac91 */
2065 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2066 const struct hda_fixup *fix, int action)
2068 static const hda_nid_t nids[] = { 0x18, 0x1a };
2070 if (action == HDA_FIXUP_ACT_INIT)
2071 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2074 /* Set VREF on speaker pins on mba11 */
2075 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2076 const struct hda_fixup *fix, int action)
2078 static const hda_nid_t nids[] = { 0x18 };
2080 if (action == HDA_FIXUP_ACT_INIT)
2081 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2084 /* Set VREF on speaker pins on mba21 */
2085 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2086 const struct hda_fixup *fix, int action)
2088 static const hda_nid_t nids[] = { 0x18, 0x19 };
2090 if (action == HDA_FIXUP_ACT_INIT)
2091 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2094 /* Don't take HP output as primary
2095 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2096 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2098 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2099 const struct hda_fixup *fix, int action)
2101 struct alc_spec *spec = codec->spec;
2102 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2103 spec->gen.no_primary_hp = 1;
2104 spec->gen.no_multi_io = 1;
2108 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2109 const struct hda_fixup *fix, int action);
2111 /* For dual-codec configuration, we need to disable some features to avoid
2112 * conflicts of kctls and PCM streams
2114 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2115 const struct hda_fixup *fix, int action)
2117 struct alc_spec *spec = codec->spec;
2119 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2121 /* disable vmaster */
2122 spec->gen.suppress_vmaster = 1;
2123 /* auto-mute and auto-mic switch don't work with multiple codecs */
2124 spec->gen.suppress_auto_mute = 1;
2125 spec->gen.suppress_auto_mic = 1;
2126 /* disable aamix as well */
2127 spec->gen.mixer_nid = 0;
2128 /* add location prefix to avoid conflicts */
2129 codec->force_pin_prefix = 1;
2132 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2133 const char *newname)
2135 struct snd_kcontrol *kctl;
2137 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2139 strcpy(kctl->id.name, newname);
2142 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2143 const struct hda_fixup *fix,
2146 alc_fixup_dual_codecs(codec, fix, action);
2148 case HDA_FIXUP_ACT_PRE_PROBE:
2149 /* override card longname to provide a unique UCM profile */
2150 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2152 case HDA_FIXUP_ACT_BUILD:
2153 /* rename Capture controls depending on the codec */
2154 rename_ctl(codec, "Capture Volume",
2156 "Rear-Panel Capture Volume" :
2157 "Front-Panel Capture Volume");
2158 rename_ctl(codec, "Capture Switch",
2160 "Rear-Panel Capture Switch" :
2161 "Front-Panel Capture Switch");
2166 static void alc1220_fixup_gb_x570(struct hda_codec *codec,
2167 const struct hda_fixup *fix,
2170 static const hda_nid_t conn1[] = { 0x0c };
2171 static const struct coef_fw gb_x570_coefs[] = {
2172 WRITE_COEF(0x07, 0x03c0),
2173 WRITE_COEF(0x1a, 0x01c1),
2174 WRITE_COEF(0x1b, 0x0202),
2175 WRITE_COEF(0x43, 0x3005),
2180 case HDA_FIXUP_ACT_PRE_PROBE:
2181 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2182 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2184 case HDA_FIXUP_ACT_INIT:
2185 alc_process_coef_fw(codec, gb_x570_coefs);
2190 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2191 const struct hda_fixup *fix,
2194 static const hda_nid_t conn1[] = { 0x0c };
2196 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2199 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2200 /* We therefore want to make sure 0x14 (front headphone) and
2201 * 0x1b (speakers) use the stereo DAC 0x02
2203 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2204 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2207 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2208 const struct hda_fixup *fix, int action);
2210 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2211 const struct hda_fixup *fix,
2214 alc1220_fixup_clevo_p950(codec, fix, action);
2215 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2218 static void alc887_asus_hp_automute_hook(struct hda_codec *codec,
2219 struct hda_jack_callback *jack)
2221 struct alc_spec *spec = codec->spec;
2224 snd_hda_gen_hp_automute(codec, jack);
2226 if (spec->gen.hp_jack_present)
2227 vref = AC_PINCTL_VREF_80;
2229 vref = AC_PINCTL_VREF_HIZ;
2230 snd_hda_set_pin_ctl(codec, 0x19, PIN_HP | vref);
2233 static void alc887_fixup_asus_jack(struct hda_codec *codec,
2234 const struct hda_fixup *fix, int action)
2236 struct alc_spec *spec = codec->spec;
2237 if (action != HDA_FIXUP_ACT_PROBE)
2239 snd_hda_set_pin_ctl_cache(codec, 0x1b, PIN_HP);
2240 spec->gen.hp_automute_hook = alc887_asus_hp_automute_hook;
2243 static const struct hda_fixup alc882_fixups[] = {
2244 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2245 .type = HDA_FIXUP_PINS,
2246 .v.pins = (const struct hda_pintbl[]) {
2247 { 0x15, 0x01080104 }, /* side */
2248 { 0x16, 0x01011012 }, /* rear */
2249 { 0x17, 0x01016011 }, /* clfe */
2253 [ALC882_FIXUP_LENOVO_Y530] = {
2254 .type = HDA_FIXUP_PINS,
2255 .v.pins = (const struct hda_pintbl[]) {
2256 { 0x15, 0x99130112 }, /* rear int speakers */
2257 { 0x16, 0x99130111 }, /* subwoofer */
2261 [ALC882_FIXUP_PB_M5210] = {
2262 .type = HDA_FIXUP_PINCTLS,
2263 .v.pins = (const struct hda_pintbl[]) {
2264 { 0x19, PIN_VREF50 },
2268 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2269 .type = HDA_FIXUP_FUNC,
2270 .v.func = alc_fixup_sku_ignore,
2272 [ALC882_FIXUP_ASUS_W90V] = {
2273 .type = HDA_FIXUP_PINS,
2274 .v.pins = (const struct hda_pintbl[]) {
2275 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2279 [ALC889_FIXUP_CD] = {
2280 .type = HDA_FIXUP_PINS,
2281 .v.pins = (const struct hda_pintbl[]) {
2282 { 0x1c, 0x993301f0 }, /* CD */
2286 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2287 .type = HDA_FIXUP_PINS,
2288 .v.pins = (const struct hda_pintbl[]) {
2289 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2293 .chain_id = ALC889_FIXUP_CD,
2295 [ALC889_FIXUP_VAIO_TT] = {
2296 .type = HDA_FIXUP_PINS,
2297 .v.pins = (const struct hda_pintbl[]) {
2298 { 0x17, 0x90170111 }, /* hidden surround speaker */
2302 [ALC888_FIXUP_EEE1601] = {
2303 .type = HDA_FIXUP_VERBS,
2304 .v.verbs = (const struct hda_verb[]) {
2305 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2306 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2310 [ALC886_FIXUP_EAPD] = {
2311 .type = HDA_FIXUP_VERBS,
2312 .v.verbs = (const struct hda_verb[]) {
2313 /* change to EAPD mode */
2314 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2315 { 0x20, AC_VERB_SET_PROC_COEF, 0x0068 },
2319 [ALC882_FIXUP_EAPD] = {
2320 .type = HDA_FIXUP_VERBS,
2321 .v.verbs = (const struct hda_verb[]) {
2322 /* change to EAPD mode */
2323 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2324 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2328 [ALC883_FIXUP_EAPD] = {
2329 .type = HDA_FIXUP_VERBS,
2330 .v.verbs = (const struct hda_verb[]) {
2331 /* change to EAPD mode */
2332 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2333 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2337 [ALC883_FIXUP_ACER_EAPD] = {
2338 .type = HDA_FIXUP_VERBS,
2339 .v.verbs = (const struct hda_verb[]) {
2340 /* eanable EAPD on Acer laptops */
2341 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2342 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2346 [ALC882_FIXUP_GPIO1] = {
2347 .type = HDA_FIXUP_FUNC,
2348 .v.func = alc_fixup_gpio1,
2350 [ALC882_FIXUP_GPIO2] = {
2351 .type = HDA_FIXUP_FUNC,
2352 .v.func = alc_fixup_gpio2,
2354 [ALC882_FIXUP_GPIO3] = {
2355 .type = HDA_FIXUP_FUNC,
2356 .v.func = alc_fixup_gpio3,
2358 [ALC882_FIXUP_ASUS_W2JC] = {
2359 .type = HDA_FIXUP_FUNC,
2360 .v.func = alc_fixup_gpio1,
2362 .chain_id = ALC882_FIXUP_EAPD,
2364 [ALC889_FIXUP_COEF] = {
2365 .type = HDA_FIXUP_FUNC,
2366 .v.func = alc889_fixup_coef,
2368 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2369 .type = HDA_FIXUP_PINS,
2370 .v.pins = (const struct hda_pintbl[]) {
2371 { 0x16, 0x99130111 }, /* CLFE speaker */
2372 { 0x17, 0x99130112 }, /* surround speaker */
2376 .chain_id = ALC882_FIXUP_GPIO1,
2378 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2379 .type = HDA_FIXUP_PINS,
2380 .v.pins = (const struct hda_pintbl[]) {
2381 { 0x16, 0x99130111 }, /* CLFE speaker */
2382 { 0x1b, 0x99130112 }, /* surround speaker */
2386 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2388 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2389 /* additional init verbs for Acer Aspire 8930G */
2390 .type = HDA_FIXUP_VERBS,
2391 .v.verbs = (const struct hda_verb[]) {
2392 /* Enable all DACs */
2393 /* DAC DISABLE/MUTE 1? */
2394 /* setting bits 1-5 disables DAC nids 0x02-0x06
2395 * apparently. Init=0x38 */
2396 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2397 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2398 /* DAC DISABLE/MUTE 2? */
2399 /* some bit here disables the other DACs.
2401 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2402 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2404 * This laptop has a stereo digital microphone.
2405 * The mics are only 1cm apart which makes the stereo
2406 * useless. However, either the mic or the ALC889
2407 * makes the signal become a difference/sum signal
2408 * instead of standard stereo, which is annoying.
2409 * So instead we flip this bit which makes the
2410 * codec replicate the sum signal to both channels,
2411 * turning it into a normal mono mic.
2413 /* DMIC_CONTROL? Init value = 0x0001 */
2414 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2415 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2416 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2417 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2421 .chain_id = ALC882_FIXUP_GPIO1,
2423 [ALC885_FIXUP_MACPRO_GPIO] = {
2424 .type = HDA_FIXUP_FUNC,
2425 .v.func = alc885_fixup_macpro_gpio,
2427 [ALC889_FIXUP_DAC_ROUTE] = {
2428 .type = HDA_FIXUP_FUNC,
2429 .v.func = alc889_fixup_dac_route,
2431 [ALC889_FIXUP_MBP_VREF] = {
2432 .type = HDA_FIXUP_FUNC,
2433 .v.func = alc889_fixup_mbp_vref,
2435 .chain_id = ALC882_FIXUP_GPIO1,
2437 [ALC889_FIXUP_IMAC91_VREF] = {
2438 .type = HDA_FIXUP_FUNC,
2439 .v.func = alc889_fixup_imac91_vref,
2441 .chain_id = ALC882_FIXUP_GPIO1,
2443 [ALC889_FIXUP_MBA11_VREF] = {
2444 .type = HDA_FIXUP_FUNC,
2445 .v.func = alc889_fixup_mba11_vref,
2447 .chain_id = ALC889_FIXUP_MBP_VREF,
2449 [ALC889_FIXUP_MBA21_VREF] = {
2450 .type = HDA_FIXUP_FUNC,
2451 .v.func = alc889_fixup_mba21_vref,
2453 .chain_id = ALC889_FIXUP_MBP_VREF,
2455 [ALC889_FIXUP_MP11_VREF] = {
2456 .type = HDA_FIXUP_FUNC,
2457 .v.func = alc889_fixup_mba11_vref,
2459 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2461 [ALC889_FIXUP_MP41_VREF] = {
2462 .type = HDA_FIXUP_FUNC,
2463 .v.func = alc889_fixup_mbp_vref,
2465 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2467 [ALC882_FIXUP_INV_DMIC] = {
2468 .type = HDA_FIXUP_FUNC,
2469 .v.func = alc_fixup_inv_dmic,
2471 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2472 .type = HDA_FIXUP_FUNC,
2473 .v.func = alc882_fixup_no_primary_hp,
2475 [ALC887_FIXUP_ASUS_BASS] = {
2476 .type = HDA_FIXUP_PINS,
2477 .v.pins = (const struct hda_pintbl[]) {
2478 {0x16, 0x99130130}, /* bass speaker */
2482 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2484 [ALC887_FIXUP_BASS_CHMAP] = {
2485 .type = HDA_FIXUP_FUNC,
2486 .v.func = alc_fixup_bass_chmap,
2488 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2489 .type = HDA_FIXUP_FUNC,
2490 .v.func = alc1220_fixup_gb_dual_codecs,
2492 [ALC1220_FIXUP_GB_X570] = {
2493 .type = HDA_FIXUP_FUNC,
2494 .v.func = alc1220_fixup_gb_x570,
2496 [ALC1220_FIXUP_CLEVO_P950] = {
2497 .type = HDA_FIXUP_FUNC,
2498 .v.func = alc1220_fixup_clevo_p950,
2500 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2501 .type = HDA_FIXUP_FUNC,
2502 .v.func = alc1220_fixup_clevo_pb51ed,
2504 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2505 .type = HDA_FIXUP_PINS,
2506 .v.pins = (const struct hda_pintbl[]) {
2507 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2511 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2513 [ALC887_FIXUP_ASUS_AUDIO] = {
2514 .type = HDA_FIXUP_PINS,
2515 .v.pins = (const struct hda_pintbl[]) {
2516 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2517 { 0x19, 0x22219420 },
2521 [ALC887_FIXUP_ASUS_HMIC] = {
2522 .type = HDA_FIXUP_FUNC,
2523 .v.func = alc887_fixup_asus_jack,
2525 .chain_id = ALC887_FIXUP_ASUS_AUDIO,
2527 [ALCS1200A_FIXUP_MIC_VREF] = {
2528 .type = HDA_FIXUP_PINCTLS,
2529 .v.pins = (const struct hda_pintbl[]) {
2530 { 0x18, PIN_VREF50 }, /* rear mic */
2531 { 0x19, PIN_VREF50 }, /* front mic */
2537 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2538 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2539 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2540 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2541 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2542 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2543 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2544 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2545 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2546 ALC882_FIXUP_ACER_ASPIRE_4930G),
2547 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2548 ALC882_FIXUP_ACER_ASPIRE_4930G),
2549 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2550 ALC882_FIXUP_ACER_ASPIRE_8930G),
2551 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2552 ALC882_FIXUP_ACER_ASPIRE_8930G),
2553 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2554 ALC882_FIXUP_ACER_ASPIRE_4930G),
2555 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2556 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2557 ALC882_FIXUP_ACER_ASPIRE_4930G),
2558 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2559 ALC882_FIXUP_ACER_ASPIRE_4930G),
2560 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2561 ALC882_FIXUP_ACER_ASPIRE_4930G),
2562 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2563 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2564 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2565 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2566 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2567 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2568 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC),
2569 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2570 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2571 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2572 SND_PCI_QUIRK(0x1043, 0x8797, "ASUS TUF B550M-PLUS", ALCS1200A_FIXUP_MIC_VREF),
2573 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2574 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2575 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2576 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2577 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2579 /* All Apple entries are in codec SSIDs */
2580 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2581 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2582 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2583 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2584 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2585 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2586 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2587 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2588 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2589 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2590 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2591 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2592 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2593 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2594 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2595 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2596 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2597 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2598 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2599 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2600 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2601 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2603 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2604 SND_PCI_QUIRK(0x13fe, 0x1009, "Advantech MIT-W101", ALC886_FIXUP_EAPD),
2605 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2606 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2607 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
2608 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
2609 SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
2610 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2611 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2612 SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
2613 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2614 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2615 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2616 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2617 SND_PCI_QUIRK(0x1462, 0xcc34, "MSI Godlike X570", ALC1220_FIXUP_GB_DUAL_CODECS),
2618 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2619 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2620 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2621 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2622 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2623 SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2624 SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2625 SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2626 SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2627 SND_PCI_QUIRK(0x1558, 0x65f5, "Clevo PD50PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2628 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2629 SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2630 SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2631 SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2632 SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2633 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2634 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2635 SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
2636 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2637 SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950),
2638 SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950),
2639 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2640 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2641 SND_PCI_QUIRK(0x1558, 0x95e3, "Clevo P955[ER]T", ALC1220_FIXUP_CLEVO_P950),
2642 SND_PCI_QUIRK(0x1558, 0x95e4, "Clevo P955ER", ALC1220_FIXUP_CLEVO_P950),
2643 SND_PCI_QUIRK(0x1558, 0x95e5, "Clevo P955EE6", ALC1220_FIXUP_CLEVO_P950),
2644 SND_PCI_QUIRK(0x1558, 0x95e6, "Clevo P950R[CDF]", ALC1220_FIXUP_CLEVO_P950),
2645 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2646 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2647 SND_PCI_QUIRK(0x1558, 0x97e2, "Clevo P970RC-M", ALC1220_FIXUP_CLEVO_P950),
2648 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2649 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2650 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2651 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2655 static const struct hda_model_fixup alc882_fixup_models[] = {
2656 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2657 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2658 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2659 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2660 {.id = ALC889_FIXUP_CD, .name = "cd"},
2661 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2662 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2663 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2664 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2665 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2666 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2667 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2668 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2669 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2670 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2671 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2672 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2673 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2674 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2675 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2676 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2677 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2678 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2679 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2680 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2681 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2682 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2683 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2684 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2685 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2686 {.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
2687 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2691 static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = {
2692 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950,
2700 {0x1e, 0x01456130}),
2701 SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950,
2709 {0x1e, 0x01451130}),
2714 * BIOS auto configuration
2716 /* almost identical with ALC880 parser... */
2717 static int alc882_parse_auto_config(struct hda_codec *codec)
2719 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2720 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2721 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2726 static int patch_alc882(struct hda_codec *codec)
2728 struct alc_spec *spec;
2731 err = alc_alloc_spec(codec, 0x0b);
2737 switch (codec->core.vendor_id) {
2745 /* ALC883 and variants */
2746 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2750 alc_pre_init(codec);
2752 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2754 snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true);
2755 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2757 alc_auto_parse_customize_define(codec);
2759 if (has_cdefine_beep(codec))
2760 spec->gen.beep_nid = 0x01;
2762 /* automatic parse from the BIOS config */
2763 err = alc882_parse_auto_config(codec);
2767 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2768 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2773 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2786 static int alc262_parse_auto_config(struct hda_codec *codec)
2788 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2789 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2790 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2797 ALC262_FIXUP_FSC_H270,
2798 ALC262_FIXUP_FSC_S7110,
2799 ALC262_FIXUP_HP_Z200,
2801 ALC262_FIXUP_LENOVO_3000,
2803 ALC262_FIXUP_BENQ_T31,
2804 ALC262_FIXUP_INV_DMIC,
2805 ALC262_FIXUP_INTEL_BAYLEYBAY,
2808 static const struct hda_fixup alc262_fixups[] = {
2809 [ALC262_FIXUP_FSC_H270] = {
2810 .type = HDA_FIXUP_PINS,
2811 .v.pins = (const struct hda_pintbl[]) {
2812 { 0x14, 0x99130110 }, /* speaker */
2813 { 0x15, 0x0221142f }, /* front HP */
2814 { 0x1b, 0x0121141f }, /* rear HP */
2818 [ALC262_FIXUP_FSC_S7110] = {
2819 .type = HDA_FIXUP_PINS,
2820 .v.pins = (const struct hda_pintbl[]) {
2821 { 0x15, 0x90170110 }, /* speaker */
2825 .chain_id = ALC262_FIXUP_BENQ,
2827 [ALC262_FIXUP_HP_Z200] = {
2828 .type = HDA_FIXUP_PINS,
2829 .v.pins = (const struct hda_pintbl[]) {
2830 { 0x16, 0x99130120 }, /* internal speaker */
2834 [ALC262_FIXUP_TYAN] = {
2835 .type = HDA_FIXUP_PINS,
2836 .v.pins = (const struct hda_pintbl[]) {
2837 { 0x14, 0x1993e1f0 }, /* int AUX */
2841 [ALC262_FIXUP_LENOVO_3000] = {
2842 .type = HDA_FIXUP_PINCTLS,
2843 .v.pins = (const struct hda_pintbl[]) {
2844 { 0x19, PIN_VREF50 },
2848 .chain_id = ALC262_FIXUP_BENQ,
2850 [ALC262_FIXUP_BENQ] = {
2851 .type = HDA_FIXUP_VERBS,
2852 .v.verbs = (const struct hda_verb[]) {
2853 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2854 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2858 [ALC262_FIXUP_BENQ_T31] = {
2859 .type = HDA_FIXUP_VERBS,
2860 .v.verbs = (const struct hda_verb[]) {
2861 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2862 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2866 [ALC262_FIXUP_INV_DMIC] = {
2867 .type = HDA_FIXUP_FUNC,
2868 .v.func = alc_fixup_inv_dmic,
2870 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2871 .type = HDA_FIXUP_FUNC,
2872 .v.func = alc_fixup_no_depop_delay,
2876 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2877 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2878 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2879 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2880 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2881 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2882 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2883 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2884 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2885 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2886 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2890 static const struct hda_model_fixup alc262_fixup_models[] = {
2891 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2892 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2893 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2894 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2895 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2896 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2897 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2898 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2899 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2905 static int patch_alc262(struct hda_codec *codec)
2907 struct alc_spec *spec;
2910 err = alc_alloc_spec(codec, 0x0b);
2915 spec->gen.shared_mic_vref_pin = 0x18;
2917 spec->shutup = alc_eapd_shutup;
2920 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2923 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2925 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2927 alc_pre_init(codec);
2929 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2931 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2933 alc_auto_parse_customize_define(codec);
2935 if (has_cdefine_beep(codec))
2936 spec->gen.beep_nid = 0x01;
2938 /* automatic parse from the BIOS config */
2939 err = alc262_parse_auto_config(codec);
2943 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2944 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2949 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2961 /* bind Beep switches of both NID 0x0f and 0x10 */
2962 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2963 struct snd_ctl_elem_value *ucontrol)
2965 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2969 mutex_lock(&codec->control_mutex);
2970 pval = kcontrol->private_value;
2971 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2972 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2974 kcontrol->private_value = (pval & ~0xff) | 0x10;
2975 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2977 kcontrol->private_value = pval;
2978 mutex_unlock(&codec->control_mutex);
2982 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2983 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2985 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2986 .name = "Beep Playback Switch",
2987 .subdevice = HDA_SUBDEV_AMP_FLAG,
2988 .info = snd_hda_mixer_amp_switch_info,
2989 .get = snd_hda_mixer_amp_switch_get,
2990 .put = alc268_beep_switch_put,
2991 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2995 /* set PCBEEP vol = 0, mute connections */
2996 static const struct hda_verb alc268_beep_init_verbs[] = {
2997 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2998 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2999 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
3004 ALC268_FIXUP_INV_DMIC,
3005 ALC268_FIXUP_HP_EAPD,
3009 static const struct hda_fixup alc268_fixups[] = {
3010 [ALC268_FIXUP_INV_DMIC] = {
3011 .type = HDA_FIXUP_FUNC,
3012 .v.func = alc_fixup_inv_dmic,
3014 [ALC268_FIXUP_HP_EAPD] = {
3015 .type = HDA_FIXUP_VERBS,
3016 .v.verbs = (const struct hda_verb[]) {
3017 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
3021 [ALC268_FIXUP_SPDIF] = {
3022 .type = HDA_FIXUP_PINS,
3023 .v.pins = (const struct hda_pintbl[]) {
3024 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
3030 static const struct hda_model_fixup alc268_fixup_models[] = {
3031 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
3032 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
3033 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
3037 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
3038 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
3039 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
3040 /* below is codec SSID since multiple Toshiba laptops have the
3041 * same PCI SSID 1179:ff00
3043 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
3048 * BIOS auto configuration
3050 static int alc268_parse_auto_config(struct hda_codec *codec)
3052 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3053 return alc_parse_auto_config(codec, NULL, alc268_ssids);
3058 static int patch_alc268(struct hda_codec *codec)
3060 struct alc_spec *spec;
3063 /* ALC268 has no aa-loopback mixer */
3064 err = alc_alloc_spec(codec, 0);
3069 if (has_cdefine_beep(codec))
3070 spec->gen.beep_nid = 0x01;
3072 spec->shutup = alc_eapd_shutup;
3074 alc_pre_init(codec);
3076 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
3077 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
3079 /* automatic parse from the BIOS config */
3080 err = alc268_parse_auto_config(codec);
3084 if (err > 0 && !spec->gen.no_analog &&
3085 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
3086 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
3087 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
3088 &alc268_beep_mixer[i])) {
3093 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
3094 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
3095 /* override the amp caps for beep generator */
3096 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
3097 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
3098 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
3099 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
3100 (0 << AC_AMPCAP_MUTE_SHIFT));
3103 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
3116 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
3117 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3120 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
3121 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
3124 /* different alc269-variants */
3126 ALC269_TYPE_ALC269VA,
3127 ALC269_TYPE_ALC269VB,
3128 ALC269_TYPE_ALC269VC,
3129 ALC269_TYPE_ALC269VD,
3151 * BIOS auto configuration
3153 static int alc269_parse_auto_config(struct hda_codec *codec)
3155 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
3156 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
3157 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
3158 struct alc_spec *spec = codec->spec;
3159 const hda_nid_t *ssids;
3161 switch (spec->codec_variant) {
3162 case ALC269_TYPE_ALC269VA:
3163 case ALC269_TYPE_ALC269VC:
3164 case ALC269_TYPE_ALC280:
3165 case ALC269_TYPE_ALC284:
3166 case ALC269_TYPE_ALC293:
3167 ssids = alc269va_ssids;
3169 case ALC269_TYPE_ALC269VB:
3170 case ALC269_TYPE_ALC269VD:
3171 case ALC269_TYPE_ALC282:
3172 case ALC269_TYPE_ALC283:
3173 case ALC269_TYPE_ALC286:
3174 case ALC269_TYPE_ALC298:
3175 case ALC269_TYPE_ALC255:
3176 case ALC269_TYPE_ALC256:
3177 case ALC269_TYPE_ALC257:
3178 case ALC269_TYPE_ALC215:
3179 case ALC269_TYPE_ALC225:
3180 case ALC269_TYPE_ALC245:
3181 case ALC269_TYPE_ALC287:
3182 case ALC269_TYPE_ALC294:
3183 case ALC269_TYPE_ALC300:
3184 case ALC269_TYPE_ALC623:
3185 case ALC269_TYPE_ALC700:
3186 ssids = alc269_ssids;
3189 ssids = alc269_ssids;
3193 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3196 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3197 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3198 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3199 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3200 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3204 static void alc_headset_btn_callback(struct hda_codec *codec,
3205 struct hda_jack_callback *jack)
3209 if (jack->unsol_res & (7 << 13))
3210 report |= SND_JACK_BTN_0;
3212 if (jack->unsol_res & (1 << 16 | 3 << 8))
3213 report |= SND_JACK_BTN_1;
3216 if (jack->unsol_res & (7 << 23))
3217 report |= SND_JACK_BTN_2;
3219 /* Volume down key */
3220 if (jack->unsol_res & (7 << 10))
3221 report |= SND_JACK_BTN_3;
3223 snd_hda_jack_set_button_state(codec, jack->nid, report);
3226 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3228 struct alc_spec *spec = codec->spec;
3230 if (!spec->has_hs_key)
3233 switch (codec->core.vendor_id) {
3241 alc_write_coef_idx(codec, 0x48, 0x0);
3242 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3243 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3249 alc_write_coef_idx(codec, 0x48, 0x0);
3250 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3255 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3257 struct alc_spec *spec = codec->spec;
3259 if (!spec->has_hs_key)
3262 switch (codec->core.vendor_id) {
3270 alc_write_coef_idx(codec, 0x48, 0xd011);
3271 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3272 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3278 alc_write_coef_idx(codec, 0x48, 0xd011);
3279 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3284 static void alc_fixup_headset_jack(struct hda_codec *codec,
3285 const struct hda_fixup *fix, int action)
3287 struct alc_spec *spec = codec->spec;
3291 case HDA_FIXUP_ACT_PRE_PROBE:
3292 spec->has_hs_key = 1;
3293 snd_hda_jack_detect_enable_callback(codec, 0x55,
3294 alc_headset_btn_callback);
3296 case HDA_FIXUP_ACT_BUILD:
3297 hp_pin = alc_get_hp_pin(spec);
3298 if (!hp_pin || snd_hda_jack_bind_keymap(codec, 0x55,
3299 alc_headset_btn_keymap,
3301 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack",
3302 false, SND_JACK_HEADSET,
3303 alc_headset_btn_keymap);
3305 alc_enable_headset_jack_key(codec);
3310 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3312 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3315 static void alc269_shutup(struct hda_codec *codec)
3317 struct alc_spec *spec = codec->spec;
3319 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3320 alc269vb_toggle_power_output(codec, 0);
3321 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3322 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3325 alc_shutup_pins(codec);
3328 static const struct coef_fw alc282_coefs[] = {
3329 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3330 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3331 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3332 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3333 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3334 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3335 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3336 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3337 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3338 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3339 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3340 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3341 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3342 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3343 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3344 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3345 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3346 WRITE_COEF(0x63, 0x2902), /* PLL */
3347 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3348 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3349 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3350 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3351 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3352 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3353 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3354 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3355 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3356 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3357 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3361 static void alc282_restore_default_value(struct hda_codec *codec)
3363 alc_process_coef_fw(codec, alc282_coefs);
3366 static void alc282_init(struct hda_codec *codec)
3368 struct alc_spec *spec = codec->spec;
3369 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3373 alc282_restore_default_value(codec);
3377 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3378 coef78 = alc_read_coef_idx(codec, 0x78);
3380 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3381 /* Headphone capless set to high power mode */
3382 alc_write_coef_idx(codec, 0x78, 0x9004);
3387 snd_hda_codec_write(codec, hp_pin, 0,
3388 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3393 snd_hda_codec_write(codec, hp_pin, 0,
3394 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3399 /* Headphone capless set to normal mode */
3400 alc_write_coef_idx(codec, 0x78, coef78);
3403 static void alc282_shutup(struct hda_codec *codec)
3405 struct alc_spec *spec = codec->spec;
3406 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3411 alc269_shutup(codec);
3415 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3416 coef78 = alc_read_coef_idx(codec, 0x78);
3417 alc_write_coef_idx(codec, 0x78, 0x9004);
3422 snd_hda_codec_write(codec, hp_pin, 0,
3423 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3428 if (!spec->no_shutup_pins)
3429 snd_hda_codec_write(codec, hp_pin, 0,
3430 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3435 alc_auto_setup_eapd(codec, false);
3436 alc_shutup_pins(codec);
3437 alc_write_coef_idx(codec, 0x78, coef78);
3440 static const struct coef_fw alc283_coefs[] = {
3441 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3442 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3443 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3444 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3445 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3446 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3447 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3448 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3449 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3450 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3451 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3452 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3453 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3454 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3455 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3456 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3457 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3458 WRITE_COEF(0x2e, 0x2902), /* PLL */
3459 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3460 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3461 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3462 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3463 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3464 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3465 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3466 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3467 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3468 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3469 WRITE_COEF(0x49, 0x0), /* test mode */
3470 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3471 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3472 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3473 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3477 static void alc283_restore_default_value(struct hda_codec *codec)
3479 alc_process_coef_fw(codec, alc283_coefs);
3482 static void alc283_init(struct hda_codec *codec)
3484 struct alc_spec *spec = codec->spec;
3485 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3488 alc283_restore_default_value(codec);
3494 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3496 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3497 /* Headphone capless set to high power mode */
3498 alc_write_coef_idx(codec, 0x43, 0x9004);
3500 snd_hda_codec_write(codec, hp_pin, 0,
3501 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3506 snd_hda_codec_write(codec, hp_pin, 0,
3507 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3511 /* Index 0x46 Combo jack auto switch control 2 */
3512 /* 3k pull low control for Headset jack. */
3513 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3514 /* Headphone capless set to normal mode */
3515 alc_write_coef_idx(codec, 0x43, 0x9614);
3518 static void alc283_shutup(struct hda_codec *codec)
3520 struct alc_spec *spec = codec->spec;
3521 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3525 alc269_shutup(codec);
3529 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3531 alc_write_coef_idx(codec, 0x43, 0x9004);
3533 /*depop hp during suspend*/
3534 alc_write_coef_idx(codec, 0x06, 0x2100);
3536 snd_hda_codec_write(codec, hp_pin, 0,
3537 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3542 if (!spec->no_shutup_pins)
3543 snd_hda_codec_write(codec, hp_pin, 0,
3544 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3546 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3550 alc_auto_setup_eapd(codec, false);
3551 alc_shutup_pins(codec);
3552 alc_write_coef_idx(codec, 0x43, 0x9614);
3555 static void alc256_init(struct hda_codec *codec)
3557 struct alc_spec *spec = codec->spec;
3558 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3566 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3571 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3572 if (spec->ultra_low_power) {
3573 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3574 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3575 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3576 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3577 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3581 snd_hda_codec_write(codec, hp_pin, 0,
3582 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3584 if (hp_pin_sense || spec->ultra_low_power)
3587 snd_hda_codec_write(codec, hp_pin, 0,
3588 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3590 if (hp_pin_sense || spec->ultra_low_power)
3593 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3594 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3595 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3596 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3598 * Expose headphone mic (or possibly Line In on some machines) instead
3599 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3600 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3603 alc_write_coef_idx(codec, 0x36, 0x5757);
3606 static void alc256_shutup(struct hda_codec *codec)
3608 struct alc_spec *spec = codec->spec;
3609 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3615 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3620 snd_hda_codec_write(codec, hp_pin, 0,
3621 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3623 if (hp_pin_sense || spec->ultra_low_power)
3626 /* 3k pull low control for Headset jack. */
3627 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3628 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3629 * when booting with headset plugged. So skip setting it for the codec alc257
3631 if (codec->core.vendor_id != 0x10ec0236 &&
3632 codec->core.vendor_id != 0x10ec0257)
3633 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3635 if (!spec->no_shutup_pins)
3636 snd_hda_codec_write(codec, hp_pin, 0,
3637 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3639 if (hp_pin_sense || spec->ultra_low_power)
3642 alc_auto_setup_eapd(codec, false);
3643 alc_shutup_pins(codec);
3644 if (spec->ultra_low_power) {
3646 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3647 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3648 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3649 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3650 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3655 static void alc285_hp_init(struct hda_codec *codec)
3657 struct alc_spec *spec = codec->spec;
3658 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3660 int coef38, coef0d, coef36;
3662 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3663 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3664 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3665 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3666 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3667 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3669 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3672 snd_hda_codec_write(codec, hp_pin, 0,
3673 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3676 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3677 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3680 snd_hda_codec_write(codec, hp_pin, 0,
3681 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3683 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3684 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3685 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3686 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3688 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3689 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3690 for (i = 0; i < 20 && val & 0x8000; i++) {
3692 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3693 } /* Wait for depop procedure finish */
3695 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3696 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3697 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3698 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3701 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3704 static void alc225_init(struct hda_codec *codec)
3706 struct alc_spec *spec = codec->spec;
3707 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3708 bool hp1_pin_sense, hp2_pin_sense;
3710 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3711 spec->codec_variant != ALC269_TYPE_ALC245)
3712 /* required only at boot or S3 and S4 resume time */
3713 if (!spec->done_hp_init ||
3714 is_s3_resume(codec) ||
3715 is_s4_resume(codec)) {
3716 alc285_hp_init(codec);
3717 spec->done_hp_init = true;
3724 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3725 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3727 if (hp1_pin_sense || hp2_pin_sense)
3730 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3731 if (spec->ultra_low_power) {
3732 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3733 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3734 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3738 if (hp1_pin_sense || spec->ultra_low_power)
3739 snd_hda_codec_write(codec, hp_pin, 0,
3740 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3742 snd_hda_codec_write(codec, 0x16, 0,
3743 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3745 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3748 if (hp1_pin_sense || spec->ultra_low_power)
3749 snd_hda_codec_write(codec, hp_pin, 0,
3750 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3752 snd_hda_codec_write(codec, 0x16, 0,
3753 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3755 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3758 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3759 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3762 static void alc225_shutup(struct hda_codec *codec)
3764 struct alc_spec *spec = codec->spec;
3765 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3766 bool hp1_pin_sense, hp2_pin_sense;
3771 alc_disable_headset_jack_key(codec);
3772 /* 3k pull low control for Headset jack. */
3773 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3775 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3776 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3778 if (hp1_pin_sense || hp2_pin_sense)
3781 if (hp1_pin_sense || spec->ultra_low_power)
3782 snd_hda_codec_write(codec, hp_pin, 0,
3783 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3785 snd_hda_codec_write(codec, 0x16, 0,
3786 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3788 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3791 if (hp1_pin_sense || spec->ultra_low_power)
3792 snd_hda_codec_write(codec, hp_pin, 0,
3793 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3795 snd_hda_codec_write(codec, 0x16, 0,
3796 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3798 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3801 alc_auto_setup_eapd(codec, false);
3802 alc_shutup_pins(codec);
3803 if (spec->ultra_low_power) {
3805 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3806 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3807 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3808 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3812 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3813 alc_enable_headset_jack_key(codec);
3816 static void alc_default_init(struct hda_codec *codec)
3818 struct alc_spec *spec = codec->spec;
3819 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3827 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3832 snd_hda_codec_write(codec, hp_pin, 0,
3833 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3838 snd_hda_codec_write(codec, hp_pin, 0,
3839 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3845 static void alc_default_shutup(struct hda_codec *codec)
3847 struct alc_spec *spec = codec->spec;
3848 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3852 alc269_shutup(codec);
3856 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3861 snd_hda_codec_write(codec, hp_pin, 0,
3862 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3867 if (!spec->no_shutup_pins)
3868 snd_hda_codec_write(codec, hp_pin, 0,
3869 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3874 alc_auto_setup_eapd(codec, false);
3875 alc_shutup_pins(codec);
3878 static void alc294_hp_init(struct hda_codec *codec)
3880 struct alc_spec *spec = codec->spec;
3881 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3887 snd_hda_codec_write(codec, hp_pin, 0,
3888 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3892 if (!spec->no_shutup_pins)
3893 snd_hda_codec_write(codec, hp_pin, 0,
3894 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3896 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3897 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3899 /* Wait for depop procedure finish */
3900 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3901 for (i = 0; i < 20 && val & 0x0080; i++) {
3903 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3905 /* Set HP depop to auto mode */
3906 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3910 static void alc294_init(struct hda_codec *codec)
3912 struct alc_spec *spec = codec->spec;
3914 /* required only at boot or S4 resume time */
3915 if (!spec->done_hp_init ||
3916 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3917 alc294_hp_init(codec);
3918 spec->done_hp_init = true;
3920 alc_default_init(codec);
3923 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3926 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3927 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3928 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3931 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3935 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3936 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3938 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3943 static void alc5505_dsp_halt(struct hda_codec *codec)
3947 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3948 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3949 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3950 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3951 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3952 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3953 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3954 val = alc5505_coef_get(codec, 0x6220);
3955 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3958 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3960 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3961 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3962 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3963 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3964 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3965 alc5505_coef_set(codec, 0x880c, 0x00000004);
3968 static void alc5505_dsp_init(struct hda_codec *codec)
3972 alc5505_dsp_halt(codec);
3973 alc5505_dsp_back_from_halt(codec);
3974 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3975 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3976 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3977 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3978 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3979 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3980 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3981 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3982 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3983 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3984 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3985 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3986 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3988 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3990 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3992 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3994 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3995 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3996 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3997 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3998 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3999 alc5505_coef_set(codec, 0x880c, 0x00000003);
4000 alc5505_coef_set(codec, 0x880c, 0x00000010);
4002 #ifdef HALT_REALTEK_ALC5505
4003 alc5505_dsp_halt(codec);
4007 #ifdef HALT_REALTEK_ALC5505
4008 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4009 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
4011 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4012 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4016 static int alc269_suspend(struct hda_codec *codec)
4018 struct alc_spec *spec = codec->spec;
4020 if (spec->has_alc5505_dsp)
4021 alc5505_dsp_suspend(codec);
4022 return alc_suspend(codec);
4025 static int alc269_resume(struct hda_codec *codec)
4027 struct alc_spec *spec = codec->spec;
4029 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4030 alc269vb_toggle_power_output(codec, 0);
4031 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4032 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
4036 codec->patch_ops.init(codec);
4038 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4039 alc269vb_toggle_power_output(codec, 1);
4040 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4041 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
4045 snd_hda_regmap_sync(codec);
4046 hda_call_check_power_status(codec, 0x01);
4048 /* on some machine, the BIOS will clear the codec gpio data when enter
4049 * suspend, and won't restore the data after resume, so we restore it
4052 if (spec->gpio_data)
4053 alc_write_gpio_data(codec);
4055 if (spec->has_alc5505_dsp)
4056 alc5505_dsp_resume(codec);
4060 #endif /* CONFIG_PM */
4062 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4063 const struct hda_fixup *fix, int action)
4065 struct alc_spec *spec = codec->spec;
4067 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4068 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4071 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4072 const struct hda_fixup *fix,
4075 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4076 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4078 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4079 snd_hda_codec_set_pincfg(codec, 0x19,
4080 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4081 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4084 static void alc269_fixup_hweq(struct hda_codec *codec,
4085 const struct hda_fixup *fix, int action)
4087 if (action == HDA_FIXUP_ACT_INIT)
4088 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4091 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4092 const struct hda_fixup *fix, int action)
4094 struct alc_spec *spec = codec->spec;
4096 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4097 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4100 static void alc271_fixup_dmic(struct hda_codec *codec,
4101 const struct hda_fixup *fix, int action)
4103 static const struct hda_verb verbs[] = {
4104 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4105 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4110 if (strcmp(codec->core.chip_name, "ALC271X") &&
4111 strcmp(codec->core.chip_name, "ALC269VB"))
4113 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4114 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4115 snd_hda_sequence_write(codec, verbs);
4118 /* Fix the speaker amp after resume, etc */
4119 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4120 const struct hda_fixup *fix,
4123 if (action == HDA_FIXUP_ACT_INIT)
4124 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4127 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4128 const struct hda_fixup *fix, int action)
4130 struct alc_spec *spec = codec->spec;
4132 if (action != HDA_FIXUP_ACT_PROBE)
4135 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4136 * fix the sample rate of analog I/O to 44.1kHz
4138 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4139 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4142 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4143 const struct hda_fixup *fix, int action)
4145 /* The digital-mic unit sends PDM (differential signal) instead of
4146 * the standard PCM, thus you can't record a valid mono stream as is.
4147 * Below is a workaround specific to ALC269 to control the dmic
4148 * signal source as mono.
4150 if (action == HDA_FIXUP_ACT_INIT)
4151 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4154 static void alc269_quanta_automute(struct hda_codec *codec)
4156 snd_hda_gen_update_outputs(codec);
4158 alc_write_coef_idx(codec, 0x0c, 0x680);
4159 alc_write_coef_idx(codec, 0x0c, 0x480);
4162 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4163 const struct hda_fixup *fix, int action)
4165 struct alc_spec *spec = codec->spec;
4166 if (action != HDA_FIXUP_ACT_PROBE)
4168 spec->gen.automute_hook = alc269_quanta_automute;
4171 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4172 struct hda_jack_callback *jack)
4174 struct alc_spec *spec = codec->spec;
4177 snd_hda_gen_hp_automute(codec, jack);
4179 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4181 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4184 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4189 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4191 struct hda_alc298_mbxinit {
4192 unsigned char value_0x23;
4193 unsigned char value_0x25;
4196 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4197 const struct hda_alc298_mbxinit *initval,
4200 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4201 alc_write_coef_idx(codec, 0x26, 0xb000);
4204 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4206 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4207 alc_write_coef_idx(codec, 0x26, 0xf000);
4208 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4210 if (initval->value_0x23 != 0x1e)
4211 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4213 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4214 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4217 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4218 const struct hda_fixup *fix,
4221 /* Initialization magic */
4222 static const struct hda_alc298_mbxinit dac_init[] = {
4223 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4224 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4225 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4226 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4227 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4228 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4230 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4231 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4232 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4235 const struct hda_alc298_mbxinit *seq;
4237 if (action != HDA_FIXUP_ACT_INIT)
4241 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4242 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4243 alc_write_coef_idx(codec, 0x26, 0xf000);
4244 alc_write_coef_idx(codec, 0x22, 0x31);
4245 alc_write_coef_idx(codec, 0x23, 0x0b);
4246 alc_write_coef_idx(codec, 0x25, 0x00);
4247 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4248 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4250 for (seq = dac_init; seq->value_0x23; seq++)
4251 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4254 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4255 const struct hda_fixup *fix, int action)
4257 struct alc_spec *spec = codec->spec;
4258 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4259 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4260 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4264 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4265 bool polarity, bool on)
4267 unsigned int pinval;
4273 pinval = snd_hda_codec_get_pin_target(codec, pin);
4274 pinval &= ~AC_PINCTL_VREFEN;
4275 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4276 /* temporarily power up/down for setting VREF */
4277 snd_hda_power_up_pm(codec);
4278 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4279 snd_hda_power_down_pm(codec);
4282 /* update mute-LED according to the speaker mute state via mic VREF pin */
4283 static int vref_mute_led_set(struct led_classdev *led_cdev,
4284 enum led_brightness brightness)
4286 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4287 struct alc_spec *spec = codec->spec;
4289 alc_update_vref_led(codec, spec->mute_led_nid,
4290 spec->mute_led_polarity, brightness);
4294 /* Make sure the led works even in runtime suspend */
4295 static unsigned int led_power_filter(struct hda_codec *codec,
4297 unsigned int power_state)
4299 struct alc_spec *spec = codec->spec;
4301 if (power_state != AC_PWRST_D3 || nid == 0 ||
4302 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4305 /* Set pin ctl again, it might have just been set to 0 */
4306 snd_hda_set_pin_ctl(codec, nid,
4307 snd_hda_codec_get_pin_target(codec, nid));
4309 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4312 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4313 const struct hda_fixup *fix, int action)
4315 struct alc_spec *spec = codec->spec;
4316 const struct dmi_device *dev = NULL;
4318 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4321 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4323 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4325 if (pin < 0x0a || pin >= 0x10)
4327 spec->mute_led_polarity = pol;
4328 spec->mute_led_nid = pin - 0x0a + 0x18;
4329 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4330 codec->power_filter = led_power_filter;
4332 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4333 spec->mute_led_polarity);
4338 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4339 const struct hda_fixup *fix,
4340 int action, hda_nid_t pin)
4342 struct alc_spec *spec = codec->spec;
4344 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4345 spec->mute_led_polarity = 0;
4346 spec->mute_led_nid = pin;
4347 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4348 codec->power_filter = led_power_filter;
4352 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4353 const struct hda_fixup *fix, int action)
4355 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4358 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4359 const struct hda_fixup *fix, int action)
4361 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4364 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4365 const struct hda_fixup *fix, int action)
4367 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4370 /* update LED status via GPIO */
4371 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4372 int polarity, bool enabled)
4376 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4379 /* turn on/off mute LED via GPIO per vmaster hook */
4380 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4381 enum led_brightness brightness)
4383 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4384 struct alc_spec *spec = codec->spec;
4386 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4387 spec->mute_led_polarity, !brightness);
4391 /* turn on/off mic-mute LED via GPIO per capture hook */
4392 static int micmute_led_set(struct led_classdev *led_cdev,
4393 enum led_brightness brightness)
4395 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4396 struct alc_spec *spec = codec->spec;
4398 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4399 spec->micmute_led_polarity, !brightness);
4403 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4404 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4406 unsigned int mute_mask,
4407 unsigned int micmute_mask)
4409 struct alc_spec *spec = codec->spec;
4411 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4413 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4416 spec->gpio_mute_led_mask = mute_mask;
4417 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4420 spec->gpio_mic_led_mask = micmute_mask;
4421 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4425 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4426 const struct hda_fixup *fix, int action)
4428 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4431 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4432 const struct hda_fixup *fix, int action)
4434 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4437 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4438 const struct hda_fixup *fix, int action)
4440 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4443 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4444 const struct hda_fixup *fix, int action)
4446 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4449 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4450 const struct hda_fixup *fix, int action)
4452 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4455 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4456 const struct hda_fixup *fix, int action)
4458 struct alc_spec *spec = codec->spec;
4460 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4461 spec->micmute_led_polarity = 1;
4462 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4465 /* turn on/off mic-mute LED per capture hook via VREF change */
4466 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4467 enum led_brightness brightness)
4469 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4470 struct alc_spec *spec = codec->spec;
4472 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4473 spec->micmute_led_polarity, brightness);
4477 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4478 const struct hda_fixup *fix, int action)
4480 struct alc_spec *spec = codec->spec;
4482 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4483 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4484 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4485 * enable headphone amp
4487 spec->gpio_mask |= 0x10;
4488 spec->gpio_dir |= 0x10;
4489 spec->cap_mute_led_nid = 0x18;
4490 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4491 codec->power_filter = led_power_filter;
4495 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4496 const struct hda_fixup *fix, int action)
4498 struct alc_spec *spec = codec->spec;
4500 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4501 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4502 spec->cap_mute_led_nid = 0x18;
4503 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4504 codec->power_filter = led_power_filter;
4508 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4509 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4511 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4512 const struct hda_fixup *fix, int action)
4514 struct alc_spec *spec = codec->spec;
4517 case HDA_FIXUP_ACT_PRE_PROBE:
4518 spec->gpio_mask |= 0x01;
4519 spec->gpio_dir |= 0x01;
4521 case HDA_FIXUP_ACT_INIT:
4522 /* need to toggle GPIO to enable the amp */
4523 alc_update_gpio_data(codec, 0x01, true);
4525 alc_update_gpio_data(codec, 0x01, false);
4530 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4531 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4532 struct hda_codec *codec,
4533 struct snd_pcm_substream *substream,
4537 case HDA_GEN_PCM_ACT_PREPARE:
4538 alc_update_gpio_data(codec, 0x04, true);
4540 case HDA_GEN_PCM_ACT_CLEANUP:
4541 alc_update_gpio_data(codec, 0x04, false);
4546 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4547 const struct hda_fixup *fix,
4550 struct alc_spec *spec = codec->spec;
4552 if (action == HDA_FIXUP_ACT_PROBE) {
4553 spec->gpio_mask |= 0x04;
4554 spec->gpio_dir |= 0x04;
4555 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4559 static void alc_update_coef_led(struct hda_codec *codec,
4560 struct alc_coef_led *led,
4561 bool polarity, bool on)
4565 /* temporarily power up/down for setting COEF bit */
4566 alc_update_coef_idx(codec, led->idx, led->mask,
4567 on ? led->on : led->off);
4570 /* update mute-LED according to the speaker mute state via COEF bit */
4571 static int coef_mute_led_set(struct led_classdev *led_cdev,
4572 enum led_brightness brightness)
4574 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4575 struct alc_spec *spec = codec->spec;
4577 alc_update_coef_led(codec, &spec->mute_led_coef,
4578 spec->mute_led_polarity, brightness);
4582 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4583 const struct hda_fixup *fix,
4586 struct alc_spec *spec = codec->spec;
4588 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4589 spec->mute_led_polarity = 0;
4590 spec->mute_led_coef.idx = 0x0b;
4591 spec->mute_led_coef.mask = 1 << 3;
4592 spec->mute_led_coef.on = 1 << 3;
4593 spec->mute_led_coef.off = 0;
4594 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4598 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4599 const struct hda_fixup *fix,
4602 struct alc_spec *spec = codec->spec;
4604 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4605 spec->mute_led_polarity = 0;
4606 spec->mute_led_coef.idx = 0x34;
4607 spec->mute_led_coef.mask = 1 << 5;
4608 spec->mute_led_coef.on = 0;
4609 spec->mute_led_coef.off = 1 << 5;
4610 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4614 /* turn on/off mic-mute LED per capture hook by coef bit */
4615 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4616 enum led_brightness brightness)
4618 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4619 struct alc_spec *spec = codec->spec;
4621 alc_update_coef_led(codec, &spec->mic_led_coef,
4622 spec->micmute_led_polarity, brightness);
4626 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4627 const struct hda_fixup *fix, int action)
4629 struct alc_spec *spec = codec->spec;
4631 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4632 spec->mic_led_coef.idx = 0x19;
4633 spec->mic_led_coef.mask = 1 << 13;
4634 spec->mic_led_coef.on = 1 << 13;
4635 spec->mic_led_coef.off = 0;
4636 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4640 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4641 const struct hda_fixup *fix, int action)
4643 struct alc_spec *spec = codec->spec;
4645 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4646 spec->mic_led_coef.idx = 0x35;
4647 spec->mic_led_coef.mask = 3 << 2;
4648 spec->mic_led_coef.on = 2 << 2;
4649 spec->mic_led_coef.off = 1 << 2;
4650 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4654 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4655 const struct hda_fixup *fix, int action)
4657 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4658 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4661 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4662 const struct hda_fixup *fix, int action)
4664 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4665 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4668 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4669 const struct hda_fixup *fix, int action)
4671 struct alc_spec *spec = codec->spec;
4673 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4674 spec->cap_mute_led_nid = 0x1a;
4675 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4676 codec->power_filter = led_power_filter;
4680 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4681 const struct hda_fixup *fix, int action)
4683 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4684 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4687 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4688 const unsigned short coefs[2])
4690 alc_write_coef_idx(codec, 0x23, coefs[0]);
4691 alc_write_coef_idx(codec, 0x25, coefs[1]);
4692 alc_write_coef_idx(codec, 0x26, 0xb011);
4695 struct alc298_samsung_amp_desc {
4697 unsigned short init_seq[2][2];
4700 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4701 const struct hda_fixup *fix, int action)
4704 static const unsigned short init_seq[][2] = {
4705 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4706 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4707 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4708 { 0x41, 0x07 }, { 0x400, 0x1 }
4710 static const struct alc298_samsung_amp_desc amps[] = {
4711 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4712 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4715 if (action != HDA_FIXUP_ACT_INIT)
4718 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4719 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4721 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4722 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4724 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4725 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4729 #if IS_REACHABLE(CONFIG_INPUT)
4730 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4731 struct hda_jack_callback *event)
4733 struct alc_spec *spec = codec->spec;
4735 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4736 send both key on and key off event for every interrupt. */
4737 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4738 input_sync(spec->kb_dev);
4739 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4740 input_sync(spec->kb_dev);
4743 static int alc_register_micmute_input_device(struct hda_codec *codec)
4745 struct alc_spec *spec = codec->spec;
4748 spec->kb_dev = input_allocate_device();
4749 if (!spec->kb_dev) {
4750 codec_err(codec, "Out of memory (input_allocate_device)\n");
4754 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4756 spec->kb_dev->name = "Microphone Mute Button";
4757 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4758 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4759 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4760 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4761 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4762 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4764 if (input_register_device(spec->kb_dev)) {
4765 codec_err(codec, "input_register_device failed\n");
4766 input_free_device(spec->kb_dev);
4767 spec->kb_dev = NULL;
4774 /* GPIO1 = set according to SKU external amp
4775 * GPIO2 = mic mute hotkey
4777 * GPIO4 = mic mute LED
4779 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4780 const struct hda_fixup *fix, int action)
4782 struct alc_spec *spec = codec->spec;
4784 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4785 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4786 spec->init_amp = ALC_INIT_DEFAULT;
4787 if (alc_register_micmute_input_device(codec) != 0)
4790 spec->gpio_mask |= 0x06;
4791 spec->gpio_dir |= 0x02;
4792 spec->gpio_data |= 0x02;
4793 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4794 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4795 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4796 gpio2_mic_hotkey_event);
4804 case HDA_FIXUP_ACT_FREE:
4805 input_unregister_device(spec->kb_dev);
4806 spec->kb_dev = NULL;
4810 /* Line2 = mic mute hotkey
4811 * GPIO2 = mic mute LED
4813 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4814 const struct hda_fixup *fix, int action)
4816 struct alc_spec *spec = codec->spec;
4818 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4819 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4820 spec->init_amp = ALC_INIT_DEFAULT;
4821 if (alc_register_micmute_input_device(codec) != 0)
4824 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4825 gpio2_mic_hotkey_event);
4833 case HDA_FIXUP_ACT_FREE:
4834 input_unregister_device(spec->kb_dev);
4835 spec->kb_dev = NULL;
4839 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4840 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4843 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4844 const struct hda_fixup *fix, int action)
4846 struct alc_spec *spec = codec->spec;
4848 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4849 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4850 spec->cap_mute_led_nid = 0x18;
4851 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4855 static const struct coef_fw alc225_pre_hsmode[] = {
4856 UPDATE_COEF(0x4a, 1<<8, 0),
4857 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4858 UPDATE_COEF(0x63, 3<<14, 3<<14),
4859 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4860 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4861 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4862 UPDATE_COEF(0x4a, 3<<10, 0),
4866 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4868 struct alc_spec *spec = codec->spec;
4869 static const struct coef_fw coef0255[] = {
4870 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4871 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4872 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4873 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4874 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4877 static const struct coef_fw coef0256[] = {
4878 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4879 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4880 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4881 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4882 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4885 static const struct coef_fw coef0233[] = {
4886 WRITE_COEF(0x1b, 0x0c0b),
4887 WRITE_COEF(0x45, 0xc429),
4888 UPDATE_COEF(0x35, 0x4000, 0),
4889 WRITE_COEF(0x06, 0x2104),
4890 WRITE_COEF(0x1a, 0x0001),
4891 WRITE_COEF(0x26, 0x0004),
4892 WRITE_COEF(0x32, 0x42a3),
4895 static const struct coef_fw coef0288[] = {
4896 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4897 UPDATE_COEF(0x50, 0x2000, 0x2000),
4898 UPDATE_COEF(0x56, 0x0006, 0x0006),
4899 UPDATE_COEF(0x66, 0x0008, 0),
4900 UPDATE_COEF(0x67, 0x2000, 0),
4903 static const struct coef_fw coef0298[] = {
4904 UPDATE_COEF(0x19, 0x1300, 0x0300),
4907 static const struct coef_fw coef0292[] = {
4908 WRITE_COEF(0x76, 0x000e),
4909 WRITE_COEF(0x6c, 0x2400),
4910 WRITE_COEF(0x18, 0x7308),
4911 WRITE_COEF(0x6b, 0xc429),
4914 static const struct coef_fw coef0293[] = {
4915 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4916 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4917 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4918 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4919 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4920 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4923 static const struct coef_fw coef0668[] = {
4924 WRITE_COEF(0x15, 0x0d40),
4925 WRITE_COEF(0xb7, 0x802b),
4928 static const struct coef_fw coef0225[] = {
4929 UPDATE_COEF(0x63, 3<<14, 0),
4932 static const struct coef_fw coef0274[] = {
4933 UPDATE_COEF(0x4a, 0x0100, 0),
4934 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4935 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4936 UPDATE_COEF(0x4a, 0x0010, 0),
4937 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4938 WRITE_COEF(0x45, 0x5289),
4939 UPDATE_COEF(0x4a, 0x0c00, 0),
4943 if (spec->no_internal_mic_pin) {
4944 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4948 switch (codec->core.vendor_id) {
4950 alc_process_coef_fw(codec, coef0255);
4956 alc_process_coef_fw(codec, coef0256);
4961 alc_process_coef_fw(codec, coef0274);
4965 alc_process_coef_fw(codec, coef0233);
4969 alc_process_coef_fw(codec, coef0288);
4972 alc_process_coef_fw(codec, coef0298);
4973 alc_process_coef_fw(codec, coef0288);
4976 alc_process_coef_fw(codec, coef0292);
4979 alc_process_coef_fw(codec, coef0293);
4982 alc_process_coef_fw(codec, coef0668);
4990 alc_process_coef_fw(codec, alc225_pre_hsmode);
4991 alc_process_coef_fw(codec, coef0225);
4994 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4997 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5001 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5004 static const struct coef_fw coef0255[] = {
5005 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5006 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5009 static const struct coef_fw coef0256[] = {
5010 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5011 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5012 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5015 static const struct coef_fw coef0233[] = {
5016 UPDATE_COEF(0x35, 0, 1<<14),
5017 WRITE_COEF(0x06, 0x2100),
5018 WRITE_COEF(0x1a, 0x0021),
5019 WRITE_COEF(0x26, 0x008c),
5022 static const struct coef_fw coef0288[] = {
5023 UPDATE_COEF(0x4f, 0x00c0, 0),
5024 UPDATE_COEF(0x50, 0x2000, 0),
5025 UPDATE_COEF(0x56, 0x0006, 0),
5026 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5027 UPDATE_COEF(0x66, 0x0008, 0x0008),
5028 UPDATE_COEF(0x67, 0x2000, 0x2000),
5031 static const struct coef_fw coef0292[] = {
5032 WRITE_COEF(0x19, 0xa208),
5033 WRITE_COEF(0x2e, 0xacf0),
5036 static const struct coef_fw coef0293[] = {
5037 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5038 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5039 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5042 static const struct coef_fw coef0688[] = {
5043 WRITE_COEF(0xb7, 0x802b),
5044 WRITE_COEF(0xb5, 0x1040),
5045 UPDATE_COEF(0xc3, 0, 1<<12),
5048 static const struct coef_fw coef0225[] = {
5049 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5050 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5051 UPDATE_COEF(0x63, 3<<14, 0),
5054 static const struct coef_fw coef0274[] = {
5055 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5056 UPDATE_COEF(0x4a, 0x0010, 0),
5057 UPDATE_COEF(0x6b, 0xf000, 0),
5061 switch (codec->core.vendor_id) {
5063 alc_write_coef_idx(codec, 0x45, 0xc489);
5064 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5065 alc_process_coef_fw(codec, coef0255);
5066 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5072 alc_write_coef_idx(codec, 0x45, 0xc489);
5073 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5074 alc_process_coef_fw(codec, coef0256);
5075 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5080 alc_write_coef_idx(codec, 0x45, 0x4689);
5081 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5082 alc_process_coef_fw(codec, coef0274);
5083 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5087 alc_write_coef_idx(codec, 0x45, 0xc429);
5088 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5089 alc_process_coef_fw(codec, coef0233);
5090 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5095 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5096 alc_process_coef_fw(codec, coef0288);
5097 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5100 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5101 alc_process_coef_fw(codec, coef0292);
5104 /* Set to TRS mode */
5105 alc_write_coef_idx(codec, 0x45, 0xc429);
5106 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5107 alc_process_coef_fw(codec, coef0293);
5108 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5111 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5115 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5116 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5119 alc_write_coef_idx(codec, 0x11, 0x0001);
5120 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5121 alc_process_coef_fw(codec, coef0688);
5122 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5130 alc_process_coef_fw(codec, alc225_pre_hsmode);
5131 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5132 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5133 alc_process_coef_fw(codec, coef0225);
5134 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5137 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5140 static void alc_headset_mode_default(struct hda_codec *codec)
5142 static const struct coef_fw coef0225[] = {
5143 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5144 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5145 UPDATE_COEF(0x49, 3<<8, 0<<8),
5146 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5147 UPDATE_COEF(0x63, 3<<14, 0),
5148 UPDATE_COEF(0x67, 0xf000, 0x3000),
5151 static const struct coef_fw coef0255[] = {
5152 WRITE_COEF(0x45, 0xc089),
5153 WRITE_COEF(0x45, 0xc489),
5154 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5155 WRITE_COEF(0x49, 0x0049),
5158 static const struct coef_fw coef0256[] = {
5159 WRITE_COEF(0x45, 0xc489),
5160 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5161 WRITE_COEF(0x49, 0x0049),
5162 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5163 WRITE_COEF(0x06, 0x6100),
5166 static const struct coef_fw coef0233[] = {
5167 WRITE_COEF(0x06, 0x2100),
5168 WRITE_COEF(0x32, 0x4ea3),
5171 static const struct coef_fw coef0288[] = {
5172 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5173 UPDATE_COEF(0x50, 0x2000, 0x2000),
5174 UPDATE_COEF(0x56, 0x0006, 0x0006),
5175 UPDATE_COEF(0x66, 0x0008, 0),
5176 UPDATE_COEF(0x67, 0x2000, 0),
5179 static const struct coef_fw coef0292[] = {
5180 WRITE_COEF(0x76, 0x000e),
5181 WRITE_COEF(0x6c, 0x2400),
5182 WRITE_COEF(0x6b, 0xc429),
5183 WRITE_COEF(0x18, 0x7308),
5186 static const struct coef_fw coef0293[] = {
5187 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5188 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5189 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5192 static const struct coef_fw coef0688[] = {
5193 WRITE_COEF(0x11, 0x0041),
5194 WRITE_COEF(0x15, 0x0d40),
5195 WRITE_COEF(0xb7, 0x802b),
5198 static const struct coef_fw coef0274[] = {
5199 WRITE_COEF(0x45, 0x4289),
5200 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5201 UPDATE_COEF(0x6b, 0x0f00, 0),
5202 UPDATE_COEF(0x49, 0x0300, 0x0300),
5206 switch (codec->core.vendor_id) {
5213 alc_process_coef_fw(codec, alc225_pre_hsmode);
5214 alc_process_coef_fw(codec, coef0225);
5217 alc_process_coef_fw(codec, coef0255);
5223 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5224 alc_write_coef_idx(codec, 0x45, 0xc089);
5226 alc_process_coef_fw(codec, coef0256);
5231 alc_process_coef_fw(codec, coef0274);
5235 alc_process_coef_fw(codec, coef0233);
5240 alc_process_coef_fw(codec, coef0288);
5243 alc_process_coef_fw(codec, coef0292);
5246 alc_process_coef_fw(codec, coef0293);
5249 alc_process_coef_fw(codec, coef0688);
5252 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5255 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5259 static void alc_headset_mode_ctia(struct hda_codec *codec)
5263 static const struct coef_fw coef0255[] = {
5264 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5265 WRITE_COEF(0x1b, 0x0c2b),
5266 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5269 static const struct coef_fw coef0256[] = {
5270 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5271 WRITE_COEF(0x1b, 0x0e6b),
5274 static const struct coef_fw coef0233[] = {
5275 WRITE_COEF(0x45, 0xd429),
5276 WRITE_COEF(0x1b, 0x0c2b),
5277 WRITE_COEF(0x32, 0x4ea3),
5280 static const struct coef_fw coef0288[] = {
5281 UPDATE_COEF(0x50, 0x2000, 0x2000),
5282 UPDATE_COEF(0x56, 0x0006, 0x0006),
5283 UPDATE_COEF(0x66, 0x0008, 0),
5284 UPDATE_COEF(0x67, 0x2000, 0),
5287 static const struct coef_fw coef0292[] = {
5288 WRITE_COEF(0x6b, 0xd429),
5289 WRITE_COEF(0x76, 0x0008),
5290 WRITE_COEF(0x18, 0x7388),
5293 static const struct coef_fw coef0293[] = {
5294 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5295 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5298 static const struct coef_fw coef0688[] = {
5299 WRITE_COEF(0x11, 0x0001),
5300 WRITE_COEF(0x15, 0x0d60),
5301 WRITE_COEF(0xc3, 0x0000),
5304 static const struct coef_fw coef0225_1[] = {
5305 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5306 UPDATE_COEF(0x63, 3<<14, 2<<14),
5309 static const struct coef_fw coef0225_2[] = {
5310 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5311 UPDATE_COEF(0x63, 3<<14, 1<<14),
5315 switch (codec->core.vendor_id) {
5317 alc_process_coef_fw(codec, coef0255);
5323 alc_process_coef_fw(codec, coef0256);
5328 alc_write_coef_idx(codec, 0x45, 0xd689);
5332 alc_process_coef_fw(codec, coef0233);
5335 val = alc_read_coef_idx(codec, 0x50);
5336 if (val & (1 << 12)) {
5337 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5338 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5341 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5342 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5348 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5350 alc_process_coef_fw(codec, coef0288);
5353 alc_process_coef_fw(codec, coef0292);
5356 alc_process_coef_fw(codec, coef0293);
5359 alc_process_coef_fw(codec, coef0688);
5367 val = alc_read_coef_idx(codec, 0x45);
5369 alc_process_coef_fw(codec, coef0225_2);
5371 alc_process_coef_fw(codec, coef0225_1);
5374 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5377 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5381 static void alc_headset_mode_omtp(struct hda_codec *codec)
5383 static const struct coef_fw coef0255[] = {
5384 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5385 WRITE_COEF(0x1b, 0x0c2b),
5386 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5389 static const struct coef_fw coef0256[] = {
5390 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5391 WRITE_COEF(0x1b, 0x0e6b),
5394 static const struct coef_fw coef0233[] = {
5395 WRITE_COEF(0x45, 0xe429),
5396 WRITE_COEF(0x1b, 0x0c2b),
5397 WRITE_COEF(0x32, 0x4ea3),
5400 static const struct coef_fw coef0288[] = {
5401 UPDATE_COEF(0x50, 0x2000, 0x2000),
5402 UPDATE_COEF(0x56, 0x0006, 0x0006),
5403 UPDATE_COEF(0x66, 0x0008, 0),
5404 UPDATE_COEF(0x67, 0x2000, 0),
5407 static const struct coef_fw coef0292[] = {
5408 WRITE_COEF(0x6b, 0xe429),
5409 WRITE_COEF(0x76, 0x0008),
5410 WRITE_COEF(0x18, 0x7388),
5413 static const struct coef_fw coef0293[] = {
5414 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5415 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5418 static const struct coef_fw coef0688[] = {
5419 WRITE_COEF(0x11, 0x0001),
5420 WRITE_COEF(0x15, 0x0d50),
5421 WRITE_COEF(0xc3, 0x0000),
5424 static const struct coef_fw coef0225[] = {
5425 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5426 UPDATE_COEF(0x63, 3<<14, 2<<14),
5430 switch (codec->core.vendor_id) {
5432 alc_process_coef_fw(codec, coef0255);
5438 alc_process_coef_fw(codec, coef0256);
5443 alc_write_coef_idx(codec, 0x45, 0xe689);
5447 alc_process_coef_fw(codec, coef0233);
5450 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5451 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5456 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5458 alc_process_coef_fw(codec, coef0288);
5461 alc_process_coef_fw(codec, coef0292);
5464 alc_process_coef_fw(codec, coef0293);
5467 alc_process_coef_fw(codec, coef0688);
5475 alc_process_coef_fw(codec, coef0225);
5478 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5481 static void alc_determine_headset_type(struct hda_codec *codec)
5484 bool is_ctia = false;
5485 struct alc_spec *spec = codec->spec;
5486 static const struct coef_fw coef0255[] = {
5487 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5488 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5492 static const struct coef_fw coef0288[] = {
5493 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5496 static const struct coef_fw coef0298[] = {
5497 UPDATE_COEF(0x50, 0x2000, 0x2000),
5498 UPDATE_COEF(0x56, 0x0006, 0x0006),
5499 UPDATE_COEF(0x66, 0x0008, 0),
5500 UPDATE_COEF(0x67, 0x2000, 0),
5501 UPDATE_COEF(0x19, 0x1300, 0x1300),
5504 static const struct coef_fw coef0293[] = {
5505 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5506 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5509 static const struct coef_fw coef0688[] = {
5510 WRITE_COEF(0x11, 0x0001),
5511 WRITE_COEF(0xb7, 0x802b),
5512 WRITE_COEF(0x15, 0x0d60),
5513 WRITE_COEF(0xc3, 0x0c00),
5516 static const struct coef_fw coef0274[] = {
5517 UPDATE_COEF(0x4a, 0x0010, 0),
5518 UPDATE_COEF(0x4a, 0x8000, 0),
5519 WRITE_COEF(0x45, 0xd289),
5520 UPDATE_COEF(0x49, 0x0300, 0x0300),
5524 if (spec->no_internal_mic_pin) {
5525 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5529 switch (codec->core.vendor_id) {
5531 alc_process_coef_fw(codec, coef0255);
5533 val = alc_read_coef_idx(codec, 0x46);
5534 is_ctia = (val & 0x0070) == 0x0070;
5540 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5541 alc_write_coef_idx(codec, 0x06, 0x6104);
5542 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5544 snd_hda_codec_write(codec, 0x21, 0,
5545 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5547 snd_hda_codec_write(codec, 0x21, 0,
5548 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5550 alc_process_coef_fw(codec, coef0255);
5552 val = alc_read_coef_idx(codec, 0x46);
5553 is_ctia = (val & 0x0070) == 0x0070;
5555 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5556 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5558 snd_hda_codec_write(codec, 0x21, 0,
5559 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5561 snd_hda_codec_write(codec, 0x21, 0,
5562 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5567 alc_process_coef_fw(codec, coef0274);
5569 val = alc_read_coef_idx(codec, 0x46);
5570 is_ctia = (val & 0x00f0) == 0x00f0;
5574 alc_write_coef_idx(codec, 0x45, 0xd029);
5576 val = alc_read_coef_idx(codec, 0x46);
5577 is_ctia = (val & 0x0070) == 0x0070;
5580 snd_hda_codec_write(codec, 0x21, 0,
5581 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5583 snd_hda_codec_write(codec, 0x21, 0,
5584 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5587 val = alc_read_coef_idx(codec, 0x50);
5588 if (val & (1 << 12)) {
5589 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5590 alc_process_coef_fw(codec, coef0288);
5592 val = alc_read_coef_idx(codec, 0x50);
5593 is_ctia = (val & 0x0070) == 0x0070;
5595 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5596 alc_process_coef_fw(codec, coef0288);
5598 val = alc_read_coef_idx(codec, 0x50);
5599 is_ctia = (val & 0x0070) == 0x0070;
5601 alc_process_coef_fw(codec, coef0298);
5602 snd_hda_codec_write(codec, 0x21, 0,
5603 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5605 snd_hda_codec_write(codec, 0x21, 0,
5606 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5610 alc_process_coef_fw(codec, coef0288);
5612 val = alc_read_coef_idx(codec, 0x50);
5613 is_ctia = (val & 0x0070) == 0x0070;
5616 alc_write_coef_idx(codec, 0x6b, 0xd429);
5618 val = alc_read_coef_idx(codec, 0x6c);
5619 is_ctia = (val & 0x001c) == 0x001c;
5622 alc_process_coef_fw(codec, coef0293);
5624 val = alc_read_coef_idx(codec, 0x46);
5625 is_ctia = (val & 0x0070) == 0x0070;
5628 alc_process_coef_fw(codec, coef0688);
5630 val = alc_read_coef_idx(codec, 0xbe);
5631 is_ctia = (val & 0x1c02) == 0x1c02;
5639 snd_hda_codec_write(codec, 0x21, 0,
5640 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5642 snd_hda_codec_write(codec, 0x21, 0,
5643 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5645 alc_process_coef_fw(codec, alc225_pre_hsmode);
5646 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5647 val = alc_read_coef_idx(codec, 0x45);
5648 if (val & (1 << 9)) {
5649 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5650 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5652 val = alc_read_coef_idx(codec, 0x46);
5653 is_ctia = (val & 0x00f0) == 0x00f0;
5655 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5656 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5658 val = alc_read_coef_idx(codec, 0x46);
5659 is_ctia = (val & 0x00f0) == 0x00f0;
5661 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5662 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5663 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5665 snd_hda_codec_write(codec, 0x21, 0,
5666 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5668 snd_hda_codec_write(codec, 0x21, 0,
5669 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5676 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5677 is_ctia ? "yes" : "no");
5678 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5681 static void alc_update_headset_mode(struct hda_codec *codec)
5683 struct alc_spec *spec = codec->spec;
5685 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5686 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5688 int new_headset_mode;
5690 if (!snd_hda_jack_detect(codec, hp_pin))
5691 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5692 else if (mux_pin == spec->headset_mic_pin)
5693 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5694 else if (mux_pin == spec->headphone_mic_pin)
5695 new_headset_mode = ALC_HEADSET_MODE_MIC;
5697 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5699 if (new_headset_mode == spec->current_headset_mode) {
5700 snd_hda_gen_update_outputs(codec);
5704 switch (new_headset_mode) {
5705 case ALC_HEADSET_MODE_UNPLUGGED:
5706 alc_headset_mode_unplugged(codec);
5707 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5708 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5709 spec->gen.hp_jack_present = false;
5711 case ALC_HEADSET_MODE_HEADSET:
5712 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5713 alc_determine_headset_type(codec);
5714 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5715 alc_headset_mode_ctia(codec);
5716 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5717 alc_headset_mode_omtp(codec);
5718 spec->gen.hp_jack_present = true;
5720 case ALC_HEADSET_MODE_MIC:
5721 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5722 spec->gen.hp_jack_present = false;
5724 case ALC_HEADSET_MODE_HEADPHONE:
5725 alc_headset_mode_default(codec);
5726 spec->gen.hp_jack_present = true;
5729 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5730 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5731 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5732 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5733 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5736 spec->current_headset_mode = new_headset_mode;
5738 snd_hda_gen_update_outputs(codec);
5741 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5742 struct snd_kcontrol *kcontrol,
5743 struct snd_ctl_elem_value *ucontrol)
5745 alc_update_headset_mode(codec);
5748 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5749 struct hda_jack_callback *jack)
5751 snd_hda_gen_hp_automute(codec, jack);
5752 alc_update_headset_mode(codec);
5755 static void alc_probe_headset_mode(struct hda_codec *codec)
5758 struct alc_spec *spec = codec->spec;
5759 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5762 for (i = 0; i < cfg->num_inputs; i++) {
5763 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5764 spec->headset_mic_pin = cfg->inputs[i].pin;
5765 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5766 spec->headphone_mic_pin = cfg->inputs[i].pin;
5769 WARN_ON(spec->gen.cap_sync_hook);
5770 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5771 spec->gen.automute_hook = alc_update_headset_mode;
5772 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5775 static void alc_fixup_headset_mode(struct hda_codec *codec,
5776 const struct hda_fixup *fix, int action)
5778 struct alc_spec *spec = codec->spec;
5781 case HDA_FIXUP_ACT_PRE_PROBE:
5782 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5784 case HDA_FIXUP_ACT_PROBE:
5785 alc_probe_headset_mode(codec);
5787 case HDA_FIXUP_ACT_INIT:
5788 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5789 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5790 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5792 alc_update_headset_mode(codec);
5797 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5798 const struct hda_fixup *fix, int action)
5800 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5801 struct alc_spec *spec = codec->spec;
5802 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5805 alc_fixup_headset_mode(codec, fix, action);
5808 static void alc255_set_default_jack_type(struct hda_codec *codec)
5810 /* Set to iphone type */
5811 static const struct coef_fw alc255fw[] = {
5812 WRITE_COEF(0x1b, 0x880b),
5813 WRITE_COEF(0x45, 0xd089),
5814 WRITE_COEF(0x1b, 0x080b),
5815 WRITE_COEF(0x46, 0x0004),
5816 WRITE_COEF(0x1b, 0x0c0b),
5819 static const struct coef_fw alc256fw[] = {
5820 WRITE_COEF(0x1b, 0x884b),
5821 WRITE_COEF(0x45, 0xd089),
5822 WRITE_COEF(0x1b, 0x084b),
5823 WRITE_COEF(0x46, 0x0004),
5824 WRITE_COEF(0x1b, 0x0c4b),
5827 switch (codec->core.vendor_id) {
5829 alc_process_coef_fw(codec, alc255fw);
5835 alc_process_coef_fw(codec, alc256fw);
5841 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5842 const struct hda_fixup *fix, int action)
5844 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5845 alc255_set_default_jack_type(codec);
5847 alc_fixup_headset_mode(codec, fix, action);
5850 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5851 const struct hda_fixup *fix, int action)
5853 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5854 struct alc_spec *spec = codec->spec;
5855 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5856 alc255_set_default_jack_type(codec);
5859 alc_fixup_headset_mode(codec, fix, action);
5862 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5863 struct hda_jack_callback *jack)
5865 struct alc_spec *spec = codec->spec;
5867 alc_update_headset_jack_cb(codec, jack);
5868 /* Headset Mic enable or disable, only for Dell Dino */
5869 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5872 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5873 const struct hda_fixup *fix, int action)
5875 alc_fixup_headset_mode(codec, fix, action);
5876 if (action == HDA_FIXUP_ACT_PROBE) {
5877 struct alc_spec *spec = codec->spec;
5878 /* toggled via hp_automute_hook */
5879 spec->gpio_mask |= 0x40;
5880 spec->gpio_dir |= 0x40;
5881 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5885 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5886 const struct hda_fixup *fix, int action)
5888 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5889 struct alc_spec *spec = codec->spec;
5890 spec->gen.auto_mute_via_amp = 1;
5894 static void alc_fixup_no_shutup(struct hda_codec *codec,
5895 const struct hda_fixup *fix, int action)
5897 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5898 struct alc_spec *spec = codec->spec;
5899 spec->no_shutup_pins = 1;
5903 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5904 const struct hda_fixup *fix, int action)
5906 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5907 struct alc_spec *spec = codec->spec;
5908 /* Disable AA-loopback as it causes white noise */
5909 spec->gen.mixer_nid = 0;
5913 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5914 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5915 const struct hda_fixup *fix, int action)
5917 static const struct hda_pintbl pincfgs[] = {
5918 { 0x16, 0x21211010 }, /* dock headphone */
5919 { 0x19, 0x21a11010 }, /* dock mic */
5922 struct alc_spec *spec = codec->spec;
5924 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5925 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5926 codec->power_save_node = 0; /* avoid click noises */
5927 snd_hda_apply_pincfgs(codec, pincfgs);
5931 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5932 const struct hda_fixup *fix, int action)
5934 static const struct hda_pintbl pincfgs[] = {
5935 { 0x17, 0x21211010 }, /* dock headphone */
5936 { 0x19, 0x21a11010 }, /* dock mic */
5939 struct alc_spec *spec = codec->spec;
5941 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5942 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5943 snd_hda_apply_pincfgs(codec, pincfgs);
5944 } else if (action == HDA_FIXUP_ACT_INIT) {
5945 /* Enable DOCK device */
5946 snd_hda_codec_write(codec, 0x17, 0,
5947 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5948 /* Enable DOCK device */
5949 snd_hda_codec_write(codec, 0x19, 0,
5950 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5954 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5955 const struct hda_fixup *fix, int action)
5957 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5958 * the speaker output becomes too low by some reason on Thinkpads with
5961 static const hda_nid_t preferred_pairs[] = {
5962 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5965 struct alc_spec *spec = codec->spec;
5967 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5968 spec->gen.preferred_dacs = preferred_pairs;
5971 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5972 const struct hda_fixup *fix, int action)
5974 static const hda_nid_t preferred_pairs[] = {
5975 0x17, 0x02, 0x21, 0x03, 0
5977 struct alc_spec *spec = codec->spec;
5979 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5980 spec->gen.preferred_dacs = preferred_pairs;
5983 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5985 struct alc_spec *spec = codec->spec;
5986 int hp_pin = alc_get_hp_pin(spec);
5988 /* Prevent pop noises when headphones are plugged in */
5989 snd_hda_codec_write(codec, hp_pin, 0,
5990 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5994 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5995 const struct hda_fixup *fix, int action)
5997 struct alc_spec *spec = codec->spec;
5998 struct hda_input_mux *imux = &spec->gen.input_mux;
6002 case HDA_FIXUP_ACT_PRE_PROBE:
6003 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6004 * it causes a click noise at start up
6006 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6007 spec->shutup = alc_shutup_dell_xps13;
6009 case HDA_FIXUP_ACT_PROBE:
6010 /* Make the internal mic the default input source. */
6011 for (i = 0; i < imux->num_items; i++) {
6012 if (spec->gen.imux_pins[i] == 0x12) {
6013 spec->gen.cur_mux[0] = i;
6021 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6022 const struct hda_fixup *fix, int action)
6024 struct alc_spec *spec = codec->spec;
6026 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6027 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6028 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6030 /* Disable boost for mic-in permanently. (This code is only called
6031 from quirks that guarantee that the headphone is at NID 0x1b.) */
6032 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6033 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6035 alc_fixup_headset_mode(codec, fix, action);
6038 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6039 const struct hda_fixup *fix, int action)
6041 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6042 alc_write_coef_idx(codec, 0xc4, 0x8000);
6043 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6044 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6046 alc_fixup_headset_mode(codec, fix, action);
6049 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6050 static int find_ext_mic_pin(struct hda_codec *codec)
6052 struct alc_spec *spec = codec->spec;
6053 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6055 unsigned int defcfg;
6058 for (i = 0; i < cfg->num_inputs; i++) {
6059 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6061 nid = cfg->inputs[i].pin;
6062 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6063 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6071 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6072 const struct hda_fixup *fix,
6075 struct alc_spec *spec = codec->spec;
6077 if (action == HDA_FIXUP_ACT_PROBE) {
6078 int mic_pin = find_ext_mic_pin(codec);
6079 int hp_pin = alc_get_hp_pin(spec);
6081 if (snd_BUG_ON(!mic_pin || !hp_pin))
6083 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6087 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6088 const struct hda_fixup *fix,
6091 struct alc_spec *spec = codec->spec;
6092 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6095 /* The mic boosts on level 2 and 3 are too noisy
6096 on the internal mic input.
6097 Therefore limit the boost to 0 or 1. */
6099 if (action != HDA_FIXUP_ACT_PROBE)
6102 for (i = 0; i < cfg->num_inputs; i++) {
6103 hda_nid_t nid = cfg->inputs[i].pin;
6104 unsigned int defcfg;
6105 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6107 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6108 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6111 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6112 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6113 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6114 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6115 (0 << AC_AMPCAP_MUTE_SHIFT));
6119 static void alc283_hp_automute_hook(struct hda_codec *codec,
6120 struct hda_jack_callback *jack)
6122 struct alc_spec *spec = codec->spec;
6126 snd_hda_gen_hp_automute(codec, jack);
6128 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6131 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6135 static void alc283_fixup_chromebook(struct hda_codec *codec,
6136 const struct hda_fixup *fix, int action)
6138 struct alc_spec *spec = codec->spec;
6141 case HDA_FIXUP_ACT_PRE_PROBE:
6142 snd_hda_override_wcaps(codec, 0x03, 0);
6143 /* Disable AA-loopback as it causes white noise */
6144 spec->gen.mixer_nid = 0;
6146 case HDA_FIXUP_ACT_INIT:
6147 /* MIC2-VREF control */
6148 /* Set to manual mode */
6149 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6150 /* Enable Line1 input control by verb */
6151 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6156 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6157 const struct hda_fixup *fix, int action)
6159 struct alc_spec *spec = codec->spec;
6162 case HDA_FIXUP_ACT_PRE_PROBE:
6163 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6165 case HDA_FIXUP_ACT_INIT:
6166 /* MIC2-VREF control */
6167 /* Set to manual mode */
6168 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6173 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6174 static void asus_tx300_automute(struct hda_codec *codec)
6176 struct alc_spec *spec = codec->spec;
6177 snd_hda_gen_update_outputs(codec);
6178 if (snd_hda_jack_detect(codec, 0x1b))
6179 spec->gen.mute_bits |= (1ULL << 0x14);
6182 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6183 const struct hda_fixup *fix, int action)
6185 struct alc_spec *spec = codec->spec;
6186 static const struct hda_pintbl dock_pins[] = {
6187 { 0x1b, 0x21114000 }, /* dock speaker pin */
6192 case HDA_FIXUP_ACT_PRE_PROBE:
6193 spec->init_amp = ALC_INIT_DEFAULT;
6194 /* TX300 needs to set up GPIO2 for the speaker amp */
6195 alc_setup_gpio(codec, 0x04);
6196 snd_hda_apply_pincfgs(codec, dock_pins);
6197 spec->gen.auto_mute_via_amp = 1;
6198 spec->gen.automute_hook = asus_tx300_automute;
6199 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6200 snd_hda_gen_hp_automute);
6202 case HDA_FIXUP_ACT_PROBE:
6203 spec->init_amp = ALC_INIT_DEFAULT;
6205 case HDA_FIXUP_ACT_BUILD:
6206 /* this is a bit tricky; give more sane names for the main
6207 * (tablet) speaker and the dock speaker, respectively
6209 rename_ctl(codec, "Speaker Playback Switch",
6210 "Dock Speaker Playback Switch");
6211 rename_ctl(codec, "Bass Speaker Playback Switch",
6212 "Speaker Playback Switch");
6217 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6218 const struct hda_fixup *fix, int action)
6220 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6221 /* DAC node 0x03 is giving mono output. We therefore want to
6222 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6223 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6224 static const hda_nid_t conn1[] = { 0x0c };
6225 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6226 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6230 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6231 const struct hda_fixup *fix, int action)
6233 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6234 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6235 we can't adjust the speaker's volume since this node does not has
6236 Amp-out capability. we change the speaker's route to:
6237 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6238 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6239 speaker's volume now. */
6241 static const hda_nid_t conn1[] = { 0x0c };
6242 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6246 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6247 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6248 const struct hda_fixup *fix, int action)
6250 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6251 static const hda_nid_t conn[] = { 0x02, 0x03 };
6252 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6256 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6257 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6258 const struct hda_fixup *fix, int action)
6260 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6261 static const hda_nid_t conn[] = { 0x02 };
6262 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6266 /* Hook to update amp GPIO4 for automute */
6267 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6268 struct hda_jack_callback *jack)
6270 struct alc_spec *spec = codec->spec;
6272 snd_hda_gen_hp_automute(codec, jack);
6273 /* mute_led_polarity is set to 0, so we pass inverted value here */
6274 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6275 !spec->gen.hp_jack_present);
6278 /* Manage GPIOs for HP EliteBook Folio 9480m.
6280 * GPIO4 is the headphone amplifier power control
6281 * GPIO3 is the audio output mute indicator LED
6284 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6285 const struct hda_fixup *fix,
6288 struct alc_spec *spec = codec->spec;
6290 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6291 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6292 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6293 spec->gpio_mask |= 0x10;
6294 spec->gpio_dir |= 0x10;
6295 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6299 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6300 const struct hda_fixup *fix,
6303 struct alc_spec *spec = codec->spec;
6305 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6306 spec->gpio_mask |= 0x04;
6307 spec->gpio_dir |= 0x04;
6308 /* set data bit low */
6312 /* Quirk for Thinkpad X1 7th and 8th Gen
6313 * The following fixed routing needed
6314 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6315 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6316 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6318 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6319 const struct hda_fixup *fix, int action)
6321 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6322 static const hda_nid_t preferred_pairs[] = {
6323 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6325 struct alc_spec *spec = codec->spec;
6328 case HDA_FIXUP_ACT_PRE_PROBE:
6329 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6330 spec->gen.preferred_dacs = preferred_pairs;
6332 case HDA_FIXUP_ACT_BUILD:
6333 /* The generic parser creates somewhat unintuitive volume ctls
6334 * with the fixed routing above, and the shared DAC2 may be
6336 * Rename those to unique names so that PA doesn't touch them
6337 * and use only Master volume.
6339 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6340 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6345 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6346 const struct hda_fixup *fix,
6349 alc_fixup_dual_codecs(codec, fix, action);
6351 case HDA_FIXUP_ACT_PRE_PROBE:
6352 /* override card longname to provide a unique UCM profile */
6353 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6355 case HDA_FIXUP_ACT_BUILD:
6356 /* rename Capture controls depending on the codec */
6357 rename_ctl(codec, "Capture Volume",
6359 "Rear-Panel Capture Volume" :
6360 "Front-Panel Capture Volume");
6361 rename_ctl(codec, "Capture Switch",
6363 "Rear-Panel Capture Switch" :
6364 "Front-Panel Capture Switch");
6369 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6370 const struct hda_fixup *fix, int action)
6372 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6375 codec->power_save_node = 1;
6378 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6379 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6380 const struct hda_fixup *fix, int action)
6382 struct alc_spec *spec = codec->spec;
6383 static const hda_nid_t preferred_pairs[] = {
6384 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6388 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6391 spec->gen.preferred_dacs = preferred_pairs;
6392 spec->gen.auto_mute_via_amp = 1;
6393 codec->power_save_node = 0;
6396 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6397 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6398 const struct hda_fixup *fix, int action)
6400 static const hda_nid_t preferred_pairs[] = {
6401 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6403 struct alc_spec *spec = codec->spec;
6405 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6406 spec->gen.preferred_dacs = preferred_pairs;
6407 spec->gen.obey_preferred_dacs = 1;
6411 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6412 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6413 const struct hda_fixup *fix, int action)
6415 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6418 snd_hda_override_wcaps(codec, 0x03, 0);
6421 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6423 switch (codec->core.vendor_id) {
6429 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6430 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6438 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6439 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6444 static void alc295_fixup_chromebook(struct hda_codec *codec,
6445 const struct hda_fixup *fix, int action)
6447 struct alc_spec *spec = codec->spec;
6450 case HDA_FIXUP_ACT_PRE_PROBE:
6451 spec->ultra_low_power = true;
6453 case HDA_FIXUP_ACT_INIT:
6454 alc_combo_jack_hp_jd_restart(codec);
6459 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6460 const struct hda_fixup *fix, int action)
6462 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6463 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6467 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6468 struct hda_jack_callback *cb)
6470 /* The Windows driver sets the codec up in a very different way where
6471 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6473 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6474 alc_write_coef_idx(codec, 0x10, 0x8a20);
6476 alc_write_coef_idx(codec, 0x10, 0x0a20);
6479 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6480 const struct hda_fixup *fix, int action)
6482 /* Pin 0x21: headphones/headset mic */
6483 if (!is_jack_detectable(codec, 0x21))
6487 case HDA_FIXUP_ACT_PRE_PROBE:
6488 snd_hda_jack_detect_enable_callback(codec, 0x21,
6489 alc294_gx502_toggle_output);
6491 case HDA_FIXUP_ACT_INIT:
6492 /* Make sure to start in a correct state, i.e. if
6493 * headphones have been plugged in before powering up the system
6495 alc294_gx502_toggle_output(codec, NULL);
6500 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6501 struct hda_jack_callback *cb)
6503 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6504 * responsible from changes between speakers and headphones
6506 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6507 alc_write_coef_idx(codec, 0x10, 0x8420);
6509 alc_write_coef_idx(codec, 0x10, 0x0a20);
6512 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6513 const struct hda_fixup *fix, int action)
6515 if (!is_jack_detectable(codec, 0x21))
6519 case HDA_FIXUP_ACT_PRE_PROBE:
6520 snd_hda_jack_detect_enable_callback(codec, 0x21,
6521 alc294_gu502_toggle_output);
6523 case HDA_FIXUP_ACT_INIT:
6524 alc294_gu502_toggle_output(codec, NULL);
6529 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6530 const struct hda_fixup *fix, int action)
6532 if (action != HDA_FIXUP_ACT_INIT)
6536 alc_write_coef_idx(codec, 0x65, 0x0);
6539 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6540 const struct hda_fixup *fix, int action)
6543 case HDA_FIXUP_ACT_INIT:
6544 alc_combo_jack_hp_jd_restart(codec);
6549 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6550 const struct hda_fixup *fix, int action)
6552 struct alc_spec *spec = codec->spec;
6555 case HDA_FIXUP_ACT_PRE_PROBE:
6556 /* Mic RING SLEEVE swap for combo jack */
6557 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6558 spec->no_internal_mic_pin = true;
6560 case HDA_FIXUP_ACT_INIT:
6561 alc_combo_jack_hp_jd_restart(codec);
6566 /* GPIO1 = amplifier on/off
6567 * GPIO3 = mic mute LED
6569 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6570 const struct hda_fixup *fix, int action)
6572 static const hda_nid_t conn[] = { 0x02 };
6574 struct alc_spec *spec = codec->spec;
6575 static const struct hda_pintbl pincfgs[] = {
6576 { 0x14, 0x90170110 }, /* front/high speakers */
6577 { 0x17, 0x90170130 }, /* back/bass speakers */
6581 //enable micmute led
6582 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6585 case HDA_FIXUP_ACT_PRE_PROBE:
6586 spec->micmute_led_polarity = 1;
6587 /* needed for amp of back speakers */
6588 spec->gpio_mask |= 0x01;
6589 spec->gpio_dir |= 0x01;
6590 snd_hda_apply_pincfgs(codec, pincfgs);
6591 /* share DAC to have unified volume control */
6592 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6593 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6595 case HDA_FIXUP_ACT_INIT:
6596 /* need to toggle GPIO to enable the amp of back speakers */
6597 alc_update_gpio_data(codec, 0x01, true);
6599 alc_update_gpio_data(codec, 0x01, false);
6604 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6605 const struct hda_fixup *fix, int action)
6607 static const hda_nid_t conn[] = { 0x02 };
6608 static const struct hda_pintbl pincfgs[] = {
6609 { 0x14, 0x90170110 }, /* rear speaker */
6614 case HDA_FIXUP_ACT_PRE_PROBE:
6615 snd_hda_apply_pincfgs(codec, pincfgs);
6616 /* force front speaker to DAC1 */
6617 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6622 /* for hda_fixup_thinkpad_acpi() */
6623 #include "thinkpad_helper.c"
6625 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6626 const struct hda_fixup *fix, int action)
6628 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6629 hda_fixup_thinkpad_acpi(codec, fix, action);
6632 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6633 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6634 const struct hda_fixup *fix,
6637 struct alc_spec *spec = codec->spec;
6640 case HDA_FIXUP_ACT_PRE_PROBE:
6641 spec->gen.suppress_auto_mute = 1;
6646 /* for alc295_fixup_hp_top_speakers */
6647 #include "hp_x360_helper.c"
6649 /* for alc285_fixup_ideapad_s740_coef() */
6650 #include "ideapad_s740_helper.c"
6652 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6653 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6654 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6655 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6659 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6660 const struct hda_fixup *fix,
6664 * A certain other OS sets these coeffs to different values. On at least
6665 * one TongFang barebone these settings might survive even a cold
6666 * reboot. So to restore a clean slate the values are explicitly reset
6667 * to default here. Without this, the external microphone is always in a
6668 * plugged-in state, while the internal microphone is always in an
6669 * unplugged state, breaking the ability to use the internal microphone.
6671 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6674 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6675 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6676 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6677 WRITE_COEF(0x49, 0x0149),
6681 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6682 const struct hda_fixup *fix,
6686 * The audio jack input and output is not detected on the ASRock NUC Box
6687 * 1100 series when cold booting without this fix. Warm rebooting from a
6688 * certain other OS makes the audio functional, as COEF settings are
6689 * preserved in this case. This fix sets these altered COEF values as
6692 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6695 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6696 const struct hda_fixup *fix,
6700 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6701 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6702 * needs an additional quirk for sound working after suspend and resume.
6704 if (codec->core.vendor_id == 0x10ec0256) {
6705 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6706 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6708 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6714 ALC269_FIXUP_SONY_VAIO,
6715 ALC275_FIXUP_SONY_VAIO_GPIO2,
6716 ALC269_FIXUP_DELL_M101Z,
6717 ALC269_FIXUP_SKU_IGNORE,
6718 ALC269_FIXUP_ASUS_G73JW,
6719 ALC269_FIXUP_LENOVO_EAPD,
6720 ALC275_FIXUP_SONY_HWEQ,
6721 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6723 ALC269_FIXUP_PCM_44K,
6724 ALC269_FIXUP_STEREO_DMIC,
6725 ALC269_FIXUP_HEADSET_MIC,
6726 ALC269_FIXUP_QUANTA_MUTE,
6727 ALC269_FIXUP_LIFEBOOK,
6728 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6729 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6730 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6731 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6734 ALC269VB_FIXUP_AMIC,
6735 ALC269VB_FIXUP_DMIC,
6736 ALC269_FIXUP_HP_MUTE_LED,
6737 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6738 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6739 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6740 ALC269_FIXUP_HP_GPIO_LED,
6741 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6742 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6743 ALC269_FIXUP_INV_DMIC,
6744 ALC269_FIXUP_LENOVO_DOCK,
6745 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6746 ALC269_FIXUP_NO_SHUTUP,
6747 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6748 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6749 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6750 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6751 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6752 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6753 ALC269_FIXUP_HEADSET_MODE,
6754 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6755 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6756 ALC269_FIXUP_ASUS_X101_FUNC,
6757 ALC269_FIXUP_ASUS_X101_VERB,
6758 ALC269_FIXUP_ASUS_X101,
6759 ALC271_FIXUP_AMIC_MIC2,
6760 ALC271_FIXUP_HP_GATE_MIC_JACK,
6761 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6762 ALC269_FIXUP_ACER_AC700,
6763 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6764 ALC269VB_FIXUP_ASUS_ZENBOOK,
6765 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6766 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
6767 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6768 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6769 ALC283_FIXUP_CHROME_BOOK,
6770 ALC283_FIXUP_SENSE_COMBO_JACK,
6771 ALC282_FIXUP_ASUS_TX300,
6772 ALC283_FIXUP_INT_MIC,
6773 ALC290_FIXUP_MONO_SPEAKERS,
6774 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6775 ALC290_FIXUP_SUBWOOFER,
6776 ALC290_FIXUP_SUBWOOFER_HSJACK,
6777 ALC269_FIXUP_THINKPAD_ACPI,
6778 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6779 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6780 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6781 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6782 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6783 ALC255_FIXUP_HEADSET_MODE,
6784 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6785 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6786 ALC292_FIXUP_TPT440_DOCK,
6787 ALC292_FIXUP_TPT440,
6788 ALC283_FIXUP_HEADSET_MIC,
6789 ALC255_FIXUP_MIC_MUTE_LED,
6790 ALC282_FIXUP_ASPIRE_V5_PINS,
6791 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6792 ALC280_FIXUP_HP_GPIO4,
6793 ALC286_FIXUP_HP_GPIO_LED,
6794 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6795 ALC280_FIXUP_HP_DOCK_PINS,
6796 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6797 ALC280_FIXUP_HP_9480M,
6798 ALC245_FIXUP_HP_X360_AMP,
6799 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
6800 ALC288_FIXUP_DELL_HEADSET_MODE,
6801 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6802 ALC288_FIXUP_DELL_XPS_13,
6803 ALC288_FIXUP_DISABLE_AAMIX,
6804 ALC292_FIXUP_DELL_E7X_AAMIX,
6805 ALC292_FIXUP_DELL_E7X,
6806 ALC292_FIXUP_DISABLE_AAMIX,
6807 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6808 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6809 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6810 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6811 ALC275_FIXUP_DELL_XPS,
6812 ALC293_FIXUP_LENOVO_SPK_NOISE,
6813 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6814 ALC255_FIXUP_DELL_SPK_NOISE,
6815 ALC225_FIXUP_DISABLE_MIC_VREF,
6816 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6817 ALC295_FIXUP_DISABLE_DAC3,
6818 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6819 ALC280_FIXUP_HP_HEADSET_MIC,
6820 ALC221_FIXUP_HP_FRONT_MIC,
6821 ALC292_FIXUP_TPT460,
6822 ALC298_FIXUP_SPK_VOLUME,
6823 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6824 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6825 ALC269_FIXUP_ATIV_BOOK_8,
6826 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
6827 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6828 ALC256_FIXUP_ASUS_HEADSET_MODE,
6829 ALC256_FIXUP_ASUS_MIC,
6830 ALC256_FIXUP_ASUS_AIO_GPIO2,
6831 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6832 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6833 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6834 ALC233_FIXUP_ACER_HEADSET_MIC,
6835 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6836 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6837 ALC225_FIXUP_S3_POP_NOISE,
6838 ALC700_FIXUP_INTEL_REFERENCE,
6839 ALC274_FIXUP_DELL_BIND_DACS,
6840 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6841 ALC298_FIXUP_TPT470_DOCK_FIX,
6842 ALC298_FIXUP_TPT470_DOCK,
6843 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6844 ALC255_FIXUP_DELL_HEADSET_MIC,
6845 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6846 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6847 ALC295_FIXUP_HP_X360,
6848 ALC221_FIXUP_HP_HEADSET_MIC,
6849 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6850 ALC295_FIXUP_HP_AUTO_MUTE,
6851 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6852 ALC294_FIXUP_ASUS_MIC,
6853 ALC294_FIXUP_ASUS_HEADSET_MIC,
6854 ALC294_FIXUP_ASUS_SPK,
6855 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6856 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6857 ALC255_FIXUP_ACER_HEADSET_MIC,
6858 ALC295_FIXUP_CHROME_BOOK,
6859 ALC225_FIXUP_HEADSET_JACK,
6860 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6861 ALC225_FIXUP_WYSE_AUTO_MUTE,
6862 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6863 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6864 ALC256_FIXUP_ASUS_HEADSET_MIC,
6865 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6866 ALC299_FIXUP_PREDATOR_SPK,
6867 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6868 ALC289_FIXUP_DELL_SPK2,
6869 ALC289_FIXUP_DUAL_SPK,
6870 ALC294_FIXUP_SPK2_TO_DAC1,
6871 ALC294_FIXUP_ASUS_DUAL_SPK,
6872 ALC285_FIXUP_THINKPAD_X1_GEN7,
6873 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6874 ALC294_FIXUP_ASUS_HPE,
6875 ALC294_FIXUP_ASUS_COEF_1B,
6876 ALC294_FIXUP_ASUS_GX502_HP,
6877 ALC294_FIXUP_ASUS_GX502_PINS,
6878 ALC294_FIXUP_ASUS_GX502_VERBS,
6879 ALC294_FIXUP_ASUS_GU502_HP,
6880 ALC294_FIXUP_ASUS_GU502_PINS,
6881 ALC294_FIXUP_ASUS_GU502_VERBS,
6882 ALC294_FIXUP_ASUS_G513_PINS,
6883 ALC285_FIXUP_ASUS_G533Z_PINS,
6884 ALC285_FIXUP_HP_GPIO_LED,
6885 ALC285_FIXUP_HP_MUTE_LED,
6886 ALC236_FIXUP_HP_GPIO_LED,
6887 ALC236_FIXUP_HP_MUTE_LED,
6888 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6889 ALC298_FIXUP_SAMSUNG_AMP,
6890 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6891 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6892 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6893 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6894 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6895 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6896 ALC289_FIXUP_ASUS_GA401,
6897 ALC289_FIXUP_ASUS_GA502,
6898 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6899 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6900 ALC269_FIXUP_CZC_B20,
6901 ALC269_FIXUP_CZC_TMI,
6902 ALC269_FIXUP_CZC_L101,
6903 ALC269_FIXUP_LEMOTE_A1802,
6904 ALC269_FIXUP_LEMOTE_A190X,
6905 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6906 ALC233_FIXUP_INTEL_NUC8_DMIC,
6907 ALC233_FIXUP_INTEL_NUC8_BOOST,
6908 ALC256_FIXUP_INTEL_NUC10,
6909 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6910 ALC274_FIXUP_HP_MIC,
6911 ALC274_FIXUP_HP_HEADSET_MIC,
6912 ALC274_FIXUP_HP_ENVY_GPIO,
6913 ALC256_FIXUP_ASUS_HPE,
6914 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6915 ALC287_FIXUP_HP_GPIO_LED,
6916 ALC256_FIXUP_HP_HEADSET_MIC,
6917 ALC245_FIXUP_HP_GPIO_LED,
6918 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6919 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6920 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6921 ALC256_FIXUP_ACER_HEADSET_MIC,
6922 ALC285_FIXUP_IDEAPAD_S740_COEF,
6923 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6924 ALC295_FIXUP_ASUS_DACS,
6925 ALC295_FIXUP_HP_OMEN,
6926 ALC285_FIXUP_HP_SPECTRE_X360,
6927 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6928 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6929 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6930 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6931 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6932 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6933 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
6934 ALC298_FIXUP_LENOVO_C940_DUET7,
6935 ALC287_FIXUP_13S_GEN2_SPEAKERS,
6936 ALC256_FIXUP_SET_COEF_DEFAULTS,
6937 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6938 ALC233_FIXUP_NO_AUDIO_JACK,
6939 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
6940 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
6941 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
6942 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
6945 /* A special fixup for Lenovo C940 and Yoga Duet 7;
6946 * both have the very same PCI SSID, and we need to apply different fixups
6947 * depending on the codec ID
6949 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
6950 const struct hda_fixup *fix,
6955 if (codec->core.vendor_id == 0x10ec0298)
6956 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
6958 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
6959 __snd_hda_apply_fixup(codec, id, action, 0);
6962 static const struct hda_fixup alc269_fixups[] = {
6963 [ALC269_FIXUP_GPIO2] = {
6964 .type = HDA_FIXUP_FUNC,
6965 .v.func = alc_fixup_gpio2,
6967 [ALC269_FIXUP_SONY_VAIO] = {
6968 .type = HDA_FIXUP_PINCTLS,
6969 .v.pins = (const struct hda_pintbl[]) {
6970 {0x19, PIN_VREFGRD},
6974 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6975 .type = HDA_FIXUP_FUNC,
6976 .v.func = alc275_fixup_gpio4_off,
6978 .chain_id = ALC269_FIXUP_SONY_VAIO
6980 [ALC269_FIXUP_DELL_M101Z] = {
6981 .type = HDA_FIXUP_VERBS,
6982 .v.verbs = (const struct hda_verb[]) {
6983 /* Enables internal speaker */
6984 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6985 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6989 [ALC269_FIXUP_SKU_IGNORE] = {
6990 .type = HDA_FIXUP_FUNC,
6991 .v.func = alc_fixup_sku_ignore,
6993 [ALC269_FIXUP_ASUS_G73JW] = {
6994 .type = HDA_FIXUP_PINS,
6995 .v.pins = (const struct hda_pintbl[]) {
6996 { 0x17, 0x99130111 }, /* subwoofer */
7000 [ALC269_FIXUP_LENOVO_EAPD] = {
7001 .type = HDA_FIXUP_VERBS,
7002 .v.verbs = (const struct hda_verb[]) {
7003 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7007 [ALC275_FIXUP_SONY_HWEQ] = {
7008 .type = HDA_FIXUP_FUNC,
7009 .v.func = alc269_fixup_hweq,
7011 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7013 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7014 .type = HDA_FIXUP_FUNC,
7015 .v.func = alc_fixup_disable_aamix,
7017 .chain_id = ALC269_FIXUP_SONY_VAIO
7019 [ALC271_FIXUP_DMIC] = {
7020 .type = HDA_FIXUP_FUNC,
7021 .v.func = alc271_fixup_dmic,
7023 [ALC269_FIXUP_PCM_44K] = {
7024 .type = HDA_FIXUP_FUNC,
7025 .v.func = alc269_fixup_pcm_44k,
7027 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7029 [ALC269_FIXUP_STEREO_DMIC] = {
7030 .type = HDA_FIXUP_FUNC,
7031 .v.func = alc269_fixup_stereo_dmic,
7033 [ALC269_FIXUP_HEADSET_MIC] = {
7034 .type = HDA_FIXUP_FUNC,
7035 .v.func = alc269_fixup_headset_mic,
7037 [ALC269_FIXUP_QUANTA_MUTE] = {
7038 .type = HDA_FIXUP_FUNC,
7039 .v.func = alc269_fixup_quanta_mute,
7041 [ALC269_FIXUP_LIFEBOOK] = {
7042 .type = HDA_FIXUP_PINS,
7043 .v.pins = (const struct hda_pintbl[]) {
7044 { 0x1a, 0x2101103f }, /* dock line-out */
7045 { 0x1b, 0x23a11040 }, /* dock mic-in */
7049 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7051 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7052 .type = HDA_FIXUP_PINS,
7053 .v.pins = (const struct hda_pintbl[]) {
7054 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7058 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7059 .type = HDA_FIXUP_PINS,
7060 .v.pins = (const struct hda_pintbl[]) {
7061 { 0x21, 0x0221102f }, /* HP out */
7065 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7066 .type = HDA_FIXUP_FUNC,
7067 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7069 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7070 .type = HDA_FIXUP_FUNC,
7071 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7073 [ALC269_FIXUP_AMIC] = {
7074 .type = HDA_FIXUP_PINS,
7075 .v.pins = (const struct hda_pintbl[]) {
7076 { 0x14, 0x99130110 }, /* speaker */
7077 { 0x15, 0x0121401f }, /* HP out */
7078 { 0x18, 0x01a19c20 }, /* mic */
7079 { 0x19, 0x99a3092f }, /* int-mic */
7083 [ALC269_FIXUP_DMIC] = {
7084 .type = HDA_FIXUP_PINS,
7085 .v.pins = (const struct hda_pintbl[]) {
7086 { 0x12, 0x99a3092f }, /* int-mic */
7087 { 0x14, 0x99130110 }, /* speaker */
7088 { 0x15, 0x0121401f }, /* HP out */
7089 { 0x18, 0x01a19c20 }, /* mic */
7093 [ALC269VB_FIXUP_AMIC] = {
7094 .type = HDA_FIXUP_PINS,
7095 .v.pins = (const struct hda_pintbl[]) {
7096 { 0x14, 0x99130110 }, /* speaker */
7097 { 0x18, 0x01a19c20 }, /* mic */
7098 { 0x19, 0x99a3092f }, /* int-mic */
7099 { 0x21, 0x0121401f }, /* HP out */
7103 [ALC269VB_FIXUP_DMIC] = {
7104 .type = HDA_FIXUP_PINS,
7105 .v.pins = (const struct hda_pintbl[]) {
7106 { 0x12, 0x99a3092f }, /* int-mic */
7107 { 0x14, 0x99130110 }, /* speaker */
7108 { 0x18, 0x01a19c20 }, /* mic */
7109 { 0x21, 0x0121401f }, /* HP out */
7113 [ALC269_FIXUP_HP_MUTE_LED] = {
7114 .type = HDA_FIXUP_FUNC,
7115 .v.func = alc269_fixup_hp_mute_led,
7117 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7118 .type = HDA_FIXUP_FUNC,
7119 .v.func = alc269_fixup_hp_mute_led_mic1,
7121 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7122 .type = HDA_FIXUP_FUNC,
7123 .v.func = alc269_fixup_hp_mute_led_mic2,
7125 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7126 .type = HDA_FIXUP_FUNC,
7127 .v.func = alc269_fixup_hp_mute_led_mic3,
7129 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7131 [ALC269_FIXUP_HP_GPIO_LED] = {
7132 .type = HDA_FIXUP_FUNC,
7133 .v.func = alc269_fixup_hp_gpio_led,
7135 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7136 .type = HDA_FIXUP_FUNC,
7137 .v.func = alc269_fixup_hp_gpio_mic1_led,
7139 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7140 .type = HDA_FIXUP_FUNC,
7141 .v.func = alc269_fixup_hp_line1_mic1_led,
7143 [ALC269_FIXUP_INV_DMIC] = {
7144 .type = HDA_FIXUP_FUNC,
7145 .v.func = alc_fixup_inv_dmic,
7147 [ALC269_FIXUP_NO_SHUTUP] = {
7148 .type = HDA_FIXUP_FUNC,
7149 .v.func = alc_fixup_no_shutup,
7151 [ALC269_FIXUP_LENOVO_DOCK] = {
7152 .type = HDA_FIXUP_PINS,
7153 .v.pins = (const struct hda_pintbl[]) {
7154 { 0x19, 0x23a11040 }, /* dock mic */
7155 { 0x1b, 0x2121103f }, /* dock headphone */
7159 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7161 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7162 .type = HDA_FIXUP_FUNC,
7163 .v.func = alc269_fixup_limit_int_mic_boost,
7165 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7167 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7168 .type = HDA_FIXUP_FUNC,
7169 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7171 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7173 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7174 .type = HDA_FIXUP_PINS,
7175 .v.pins = (const struct hda_pintbl[]) {
7176 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7177 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7181 .chain_id = ALC269_FIXUP_HEADSET_MODE
7183 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7184 .type = HDA_FIXUP_PINS,
7185 .v.pins = (const struct hda_pintbl[]) {
7186 { 0x16, 0x21014020 }, /* dock line out */
7187 { 0x19, 0x21a19030 }, /* dock mic */
7188 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7192 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7194 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7195 .type = HDA_FIXUP_PINS,
7196 .v.pins = (const struct hda_pintbl[]) {
7197 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7201 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7203 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7204 .type = HDA_FIXUP_PINS,
7205 .v.pins = (const struct hda_pintbl[]) {
7206 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7207 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7211 .chain_id = ALC269_FIXUP_HEADSET_MODE
7213 [ALC269_FIXUP_HEADSET_MODE] = {
7214 .type = HDA_FIXUP_FUNC,
7215 .v.func = alc_fixup_headset_mode,
7217 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7219 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7220 .type = HDA_FIXUP_FUNC,
7221 .v.func = alc_fixup_headset_mode_no_hp_mic,
7223 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7224 .type = HDA_FIXUP_PINS,
7225 .v.pins = (const struct hda_pintbl[]) {
7226 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7230 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7232 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7233 .type = HDA_FIXUP_PINS,
7234 .v.pins = (const struct hda_pintbl[]) {
7235 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7239 .chain_id = ALC269_FIXUP_HEADSET_MIC
7241 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7242 .type = HDA_FIXUP_PINS,
7243 .v.pins = (const struct hda_pintbl[]) {
7257 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7259 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7260 .type = HDA_FIXUP_FUNC,
7261 .v.func = alc298_fixup_huawei_mbx_stereo,
7263 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7265 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7266 .type = HDA_FIXUP_FUNC,
7267 .v.func = alc269_fixup_x101_headset_mic,
7269 [ALC269_FIXUP_ASUS_X101_VERB] = {
7270 .type = HDA_FIXUP_VERBS,
7271 .v.verbs = (const struct hda_verb[]) {
7272 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7273 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7274 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7278 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7280 [ALC269_FIXUP_ASUS_X101] = {
7281 .type = HDA_FIXUP_PINS,
7282 .v.pins = (const struct hda_pintbl[]) {
7283 { 0x18, 0x04a1182c }, /* Headset mic */
7287 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7289 [ALC271_FIXUP_AMIC_MIC2] = {
7290 .type = HDA_FIXUP_PINS,
7291 .v.pins = (const struct hda_pintbl[]) {
7292 { 0x14, 0x99130110 }, /* speaker */
7293 { 0x19, 0x01a19c20 }, /* mic */
7294 { 0x1b, 0x99a7012f }, /* int-mic */
7295 { 0x21, 0x0121401f }, /* HP out */
7299 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7300 .type = HDA_FIXUP_FUNC,
7301 .v.func = alc271_hp_gate_mic_jack,
7303 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7305 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7306 .type = HDA_FIXUP_FUNC,
7307 .v.func = alc269_fixup_limit_int_mic_boost,
7309 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7311 [ALC269_FIXUP_ACER_AC700] = {
7312 .type = HDA_FIXUP_PINS,
7313 .v.pins = (const struct hda_pintbl[]) {
7314 { 0x12, 0x99a3092f }, /* int-mic */
7315 { 0x14, 0x99130110 }, /* speaker */
7316 { 0x18, 0x03a11c20 }, /* mic */
7317 { 0x1e, 0x0346101e }, /* SPDIF1 */
7318 { 0x21, 0x0321101f }, /* HP out */
7322 .chain_id = ALC271_FIXUP_DMIC,
7324 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7325 .type = HDA_FIXUP_FUNC,
7326 .v.func = alc269_fixup_limit_int_mic_boost,
7328 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7330 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7331 .type = HDA_FIXUP_FUNC,
7332 .v.func = alc269_fixup_limit_int_mic_boost,
7334 .chain_id = ALC269VB_FIXUP_DMIC,
7336 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7337 .type = HDA_FIXUP_VERBS,
7338 .v.verbs = (const struct hda_verb[]) {
7339 /* class-D output amp +5dB */
7340 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7341 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7345 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7347 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7348 .type = HDA_FIXUP_PINS,
7349 .v.pins = (const struct hda_pintbl[]) {
7350 { 0x18, 0x01a110f0 }, /* use as headset mic */
7354 .chain_id = ALC269_FIXUP_HEADSET_MIC
7356 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7357 .type = HDA_FIXUP_FUNC,
7358 .v.func = alc269_fixup_limit_int_mic_boost,
7360 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7362 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7363 .type = HDA_FIXUP_PINS,
7364 .v.pins = (const struct hda_pintbl[]) {
7365 { 0x12, 0x99a3092f }, /* int-mic */
7366 { 0x18, 0x03a11d20 }, /* mic */
7367 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7371 [ALC283_FIXUP_CHROME_BOOK] = {
7372 .type = HDA_FIXUP_FUNC,
7373 .v.func = alc283_fixup_chromebook,
7375 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7376 .type = HDA_FIXUP_FUNC,
7377 .v.func = alc283_fixup_sense_combo_jack,
7379 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7381 [ALC282_FIXUP_ASUS_TX300] = {
7382 .type = HDA_FIXUP_FUNC,
7383 .v.func = alc282_fixup_asus_tx300,
7385 [ALC283_FIXUP_INT_MIC] = {
7386 .type = HDA_FIXUP_VERBS,
7387 .v.verbs = (const struct hda_verb[]) {
7388 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7389 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7393 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7395 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7396 .type = HDA_FIXUP_PINS,
7397 .v.pins = (const struct hda_pintbl[]) {
7398 { 0x17, 0x90170112 }, /* subwoofer */
7402 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7404 [ALC290_FIXUP_SUBWOOFER] = {
7405 .type = HDA_FIXUP_PINS,
7406 .v.pins = (const struct hda_pintbl[]) {
7407 { 0x17, 0x90170112 }, /* subwoofer */
7411 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7413 [ALC290_FIXUP_MONO_SPEAKERS] = {
7414 .type = HDA_FIXUP_FUNC,
7415 .v.func = alc290_fixup_mono_speakers,
7417 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7418 .type = HDA_FIXUP_FUNC,
7419 .v.func = alc290_fixup_mono_speakers,
7421 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7423 [ALC269_FIXUP_THINKPAD_ACPI] = {
7424 .type = HDA_FIXUP_FUNC,
7425 .v.func = alc_fixup_thinkpad_acpi,
7427 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7429 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7430 .type = HDA_FIXUP_FUNC,
7431 .v.func = alc_fixup_inv_dmic,
7433 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7435 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7436 .type = HDA_FIXUP_PINS,
7437 .v.pins = (const struct hda_pintbl[]) {
7438 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7442 .chain_id = ALC255_FIXUP_HEADSET_MODE
7444 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7445 .type = HDA_FIXUP_PINS,
7446 .v.pins = (const struct hda_pintbl[]) {
7447 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7451 .chain_id = ALC255_FIXUP_HEADSET_MODE
7453 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7454 .type = HDA_FIXUP_PINS,
7455 .v.pins = (const struct hda_pintbl[]) {
7456 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7457 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7461 .chain_id = ALC255_FIXUP_HEADSET_MODE
7463 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7464 .type = HDA_FIXUP_PINS,
7465 .v.pins = (const struct hda_pintbl[]) {
7466 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7470 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7472 [ALC255_FIXUP_HEADSET_MODE] = {
7473 .type = HDA_FIXUP_FUNC,
7474 .v.func = alc_fixup_headset_mode_alc255,
7476 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7478 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7479 .type = HDA_FIXUP_FUNC,
7480 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7482 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7483 .type = HDA_FIXUP_PINS,
7484 .v.pins = (const struct hda_pintbl[]) {
7485 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7486 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7490 .chain_id = ALC269_FIXUP_HEADSET_MODE
7492 [ALC292_FIXUP_TPT440_DOCK] = {
7493 .type = HDA_FIXUP_FUNC,
7494 .v.func = alc_fixup_tpt440_dock,
7496 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7498 [ALC292_FIXUP_TPT440] = {
7499 .type = HDA_FIXUP_FUNC,
7500 .v.func = alc_fixup_disable_aamix,
7502 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7504 [ALC283_FIXUP_HEADSET_MIC] = {
7505 .type = HDA_FIXUP_PINS,
7506 .v.pins = (const struct hda_pintbl[]) {
7507 { 0x19, 0x04a110f0 },
7511 [ALC255_FIXUP_MIC_MUTE_LED] = {
7512 .type = HDA_FIXUP_FUNC,
7513 .v.func = alc_fixup_micmute_led,
7515 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7516 .type = HDA_FIXUP_PINS,
7517 .v.pins = (const struct hda_pintbl[]) {
7518 { 0x12, 0x90a60130 },
7519 { 0x14, 0x90170110 },
7520 { 0x17, 0x40000008 },
7521 { 0x18, 0x411111f0 },
7522 { 0x19, 0x01a1913c },
7523 { 0x1a, 0x411111f0 },
7524 { 0x1b, 0x411111f0 },
7525 { 0x1d, 0x40f89b2d },
7526 { 0x1e, 0x411111f0 },
7527 { 0x21, 0x0321101f },
7531 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7532 .type = HDA_FIXUP_FUNC,
7533 .v.func = alc269vb_fixup_aspire_e1_coef,
7535 [ALC280_FIXUP_HP_GPIO4] = {
7536 .type = HDA_FIXUP_FUNC,
7537 .v.func = alc280_fixup_hp_gpio4,
7539 [ALC286_FIXUP_HP_GPIO_LED] = {
7540 .type = HDA_FIXUP_FUNC,
7541 .v.func = alc286_fixup_hp_gpio_led,
7543 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7544 .type = HDA_FIXUP_FUNC,
7545 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7547 [ALC280_FIXUP_HP_DOCK_PINS] = {
7548 .type = HDA_FIXUP_PINS,
7549 .v.pins = (const struct hda_pintbl[]) {
7550 { 0x1b, 0x21011020 }, /* line-out */
7551 { 0x1a, 0x01a1903c }, /* headset mic */
7552 { 0x18, 0x2181103f }, /* line-in */
7556 .chain_id = ALC280_FIXUP_HP_GPIO4
7558 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7559 .type = HDA_FIXUP_PINS,
7560 .v.pins = (const struct hda_pintbl[]) {
7561 { 0x1b, 0x21011020 }, /* line-out */
7562 { 0x18, 0x2181103f }, /* line-in */
7566 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7568 [ALC280_FIXUP_HP_9480M] = {
7569 .type = HDA_FIXUP_FUNC,
7570 .v.func = alc280_fixup_hp_9480m,
7572 [ALC245_FIXUP_HP_X360_AMP] = {
7573 .type = HDA_FIXUP_FUNC,
7574 .v.func = alc245_fixup_hp_x360_amp,
7576 .chain_id = ALC245_FIXUP_HP_GPIO_LED
7578 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7579 .type = HDA_FIXUP_FUNC,
7580 .v.func = alc_fixup_headset_mode_dell_alc288,
7582 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7584 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7585 .type = HDA_FIXUP_PINS,
7586 .v.pins = (const struct hda_pintbl[]) {
7587 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7588 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7592 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7594 [ALC288_FIXUP_DISABLE_AAMIX] = {
7595 .type = HDA_FIXUP_FUNC,
7596 .v.func = alc_fixup_disable_aamix,
7598 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7600 [ALC288_FIXUP_DELL_XPS_13] = {
7601 .type = HDA_FIXUP_FUNC,
7602 .v.func = alc_fixup_dell_xps13,
7604 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7606 [ALC292_FIXUP_DISABLE_AAMIX] = {
7607 .type = HDA_FIXUP_FUNC,
7608 .v.func = alc_fixup_disable_aamix,
7610 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7612 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7613 .type = HDA_FIXUP_FUNC,
7614 .v.func = alc_fixup_disable_aamix,
7616 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7618 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7619 .type = HDA_FIXUP_FUNC,
7620 .v.func = alc_fixup_dell_xps13,
7622 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7624 [ALC292_FIXUP_DELL_E7X] = {
7625 .type = HDA_FIXUP_FUNC,
7626 .v.func = alc_fixup_micmute_led,
7627 /* micmute fixup must be applied at last */
7628 .chained_before = true,
7629 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7631 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7632 .type = HDA_FIXUP_PINS,
7633 .v.pins = (const struct hda_pintbl[]) {
7634 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7637 .chained_before = true,
7638 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7640 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7641 .type = HDA_FIXUP_PINS,
7642 .v.pins = (const struct hda_pintbl[]) {
7643 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7644 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7648 .chain_id = ALC269_FIXUP_HEADSET_MODE
7650 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7651 .type = HDA_FIXUP_PINS,
7652 .v.pins = (const struct hda_pintbl[]) {
7653 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7657 .chain_id = ALC269_FIXUP_HEADSET_MODE
7659 [ALC275_FIXUP_DELL_XPS] = {
7660 .type = HDA_FIXUP_VERBS,
7661 .v.verbs = (const struct hda_verb[]) {
7662 /* Enables internal speaker */
7663 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7664 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7665 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7666 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7670 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7671 .type = HDA_FIXUP_FUNC,
7672 .v.func = alc_fixup_disable_aamix,
7674 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7676 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7677 .type = HDA_FIXUP_FUNC,
7678 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7680 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7681 .type = HDA_FIXUP_FUNC,
7682 .v.func = alc_fixup_inv_dmic,
7684 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7686 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7687 .type = HDA_FIXUP_FUNC,
7688 .v.func = alc269_fixup_limit_int_mic_boost
7690 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7691 .type = HDA_FIXUP_FUNC,
7692 .v.func = alc_fixup_disable_aamix,
7694 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7696 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7697 .type = HDA_FIXUP_FUNC,
7698 .v.func = alc_fixup_disable_mic_vref,
7700 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7702 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7703 .type = HDA_FIXUP_VERBS,
7704 .v.verbs = (const struct hda_verb[]) {
7705 /* Disable pass-through path for FRONT 14h */
7706 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7707 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7711 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7713 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7714 .type = HDA_FIXUP_FUNC,
7715 .v.func = alc_fixup_disable_aamix,
7717 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7719 [ALC221_FIXUP_HP_FRONT_MIC] = {
7720 .type = HDA_FIXUP_PINS,
7721 .v.pins = (const struct hda_pintbl[]) {
7722 { 0x19, 0x02a19020 }, /* Front Mic */
7726 [ALC292_FIXUP_TPT460] = {
7727 .type = HDA_FIXUP_FUNC,
7728 .v.func = alc_fixup_tpt440_dock,
7730 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7732 [ALC298_FIXUP_SPK_VOLUME] = {
7733 .type = HDA_FIXUP_FUNC,
7734 .v.func = alc298_fixup_speaker_volume,
7736 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7738 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7739 .type = HDA_FIXUP_FUNC,
7740 .v.func = alc298_fixup_speaker_volume,
7742 [ALC295_FIXUP_DISABLE_DAC3] = {
7743 .type = HDA_FIXUP_FUNC,
7744 .v.func = alc295_fixup_disable_dac3,
7746 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7747 .type = HDA_FIXUP_FUNC,
7748 .v.func = alc285_fixup_speaker2_to_dac1,
7750 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7752 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7753 .type = HDA_FIXUP_PINS,
7754 .v.pins = (const struct hda_pintbl[]) {
7755 { 0x1b, 0x90170151 },
7759 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7761 [ALC269_FIXUP_ATIV_BOOK_8] = {
7762 .type = HDA_FIXUP_FUNC,
7763 .v.func = alc_fixup_auto_mute_via_amp,
7765 .chain_id = ALC269_FIXUP_NO_SHUTUP
7767 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
7768 .type = HDA_FIXUP_PINS,
7769 .v.pins = (const struct hda_pintbl[]) {
7770 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7771 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
7775 .chain_id = ALC269_FIXUP_HEADSET_MODE
7777 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7778 .type = HDA_FIXUP_PINS,
7779 .v.pins = (const struct hda_pintbl[]) {
7780 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7781 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7785 .chain_id = ALC269_FIXUP_HEADSET_MODE
7787 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7788 .type = HDA_FIXUP_FUNC,
7789 .v.func = alc_fixup_headset_mode,
7791 [ALC256_FIXUP_ASUS_MIC] = {
7792 .type = HDA_FIXUP_PINS,
7793 .v.pins = (const struct hda_pintbl[]) {
7794 { 0x13, 0x90a60160 }, /* use as internal mic */
7795 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7799 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7801 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7802 .type = HDA_FIXUP_FUNC,
7803 /* Set up GPIO2 for the speaker amp */
7804 .v.func = alc_fixup_gpio4,
7806 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7807 .type = HDA_FIXUP_PINS,
7808 .v.pins = (const struct hda_pintbl[]) {
7809 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7813 .chain_id = ALC269_FIXUP_HEADSET_MIC
7815 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7816 .type = HDA_FIXUP_VERBS,
7817 .v.verbs = (const struct hda_verb[]) {
7818 /* Enables internal speaker */
7819 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7820 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7824 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7826 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7827 .type = HDA_FIXUP_FUNC,
7828 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7830 .chain_id = ALC269_FIXUP_GPIO2
7832 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7833 .type = HDA_FIXUP_VERBS,
7834 .v.verbs = (const struct hda_verb[]) {
7835 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7836 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7840 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7842 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7843 .type = HDA_FIXUP_PINS,
7844 .v.pins = (const struct hda_pintbl[]) {
7845 /* Change the mic location from front to right, otherwise there are
7846 two front mics with the same name, pulseaudio can't handle them.
7847 This is just a temporary workaround, after applying this fixup,
7848 there will be one "Front Mic" and one "Mic" in this machine.
7850 { 0x1a, 0x04a19040 },
7854 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7855 .type = HDA_FIXUP_PINS,
7856 .v.pins = (const struct hda_pintbl[]) {
7857 { 0x16, 0x0101102f }, /* Rear Headset HP */
7858 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7859 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7860 { 0x1b, 0x02011020 },
7864 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7866 [ALC225_FIXUP_S3_POP_NOISE] = {
7867 .type = HDA_FIXUP_FUNC,
7868 .v.func = alc225_fixup_s3_pop_noise,
7870 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7872 [ALC700_FIXUP_INTEL_REFERENCE] = {
7873 .type = HDA_FIXUP_VERBS,
7874 .v.verbs = (const struct hda_verb[]) {
7875 /* Enables internal speaker */
7876 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7877 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7878 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7879 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7880 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7881 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7882 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7883 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7887 [ALC274_FIXUP_DELL_BIND_DACS] = {
7888 .type = HDA_FIXUP_FUNC,
7889 .v.func = alc274_fixup_bind_dacs,
7891 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7893 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7894 .type = HDA_FIXUP_PINS,
7895 .v.pins = (const struct hda_pintbl[]) {
7896 { 0x1b, 0x0401102f },
7900 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7902 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7903 .type = HDA_FIXUP_FUNC,
7904 .v.func = alc_fixup_tpt470_dock,
7906 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7908 [ALC298_FIXUP_TPT470_DOCK] = {
7909 .type = HDA_FIXUP_FUNC,
7910 .v.func = alc_fixup_tpt470_dacs,
7912 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7914 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7915 .type = HDA_FIXUP_PINS,
7916 .v.pins = (const struct hda_pintbl[]) {
7917 { 0x14, 0x0201101f },
7921 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7923 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7924 .type = HDA_FIXUP_PINS,
7925 .v.pins = (const struct hda_pintbl[]) {
7926 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7930 .chain_id = ALC269_FIXUP_HEADSET_MIC
7932 [ALC295_FIXUP_HP_X360] = {
7933 .type = HDA_FIXUP_FUNC,
7934 .v.func = alc295_fixup_hp_top_speakers,
7936 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7938 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7939 .type = HDA_FIXUP_PINS,
7940 .v.pins = (const struct hda_pintbl[]) {
7941 { 0x19, 0x0181313f},
7945 .chain_id = ALC269_FIXUP_HEADSET_MIC
7947 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7948 .type = HDA_FIXUP_FUNC,
7949 .v.func = alc285_fixup_invalidate_dacs,
7951 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7953 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7954 .type = HDA_FIXUP_FUNC,
7955 .v.func = alc_fixup_auto_mute_via_amp,
7957 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7958 .type = HDA_FIXUP_PINS,
7959 .v.pins = (const struct hda_pintbl[]) {
7960 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7964 .chain_id = ALC269_FIXUP_HEADSET_MIC
7966 [ALC294_FIXUP_ASUS_MIC] = {
7967 .type = HDA_FIXUP_PINS,
7968 .v.pins = (const struct hda_pintbl[]) {
7969 { 0x13, 0x90a60160 }, /* use as internal mic */
7970 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7974 .chain_id = ALC269_FIXUP_HEADSET_MIC
7976 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7977 .type = HDA_FIXUP_PINS,
7978 .v.pins = (const struct hda_pintbl[]) {
7979 { 0x19, 0x01a1103c }, /* use as headset mic */
7983 .chain_id = ALC269_FIXUP_HEADSET_MIC
7985 [ALC294_FIXUP_ASUS_SPK] = {
7986 .type = HDA_FIXUP_VERBS,
7987 .v.verbs = (const struct hda_verb[]) {
7989 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7990 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7991 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7992 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7996 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7998 [ALC295_FIXUP_CHROME_BOOK] = {
7999 .type = HDA_FIXUP_FUNC,
8000 .v.func = alc295_fixup_chromebook,
8002 .chain_id = ALC225_FIXUP_HEADSET_JACK
8004 [ALC225_FIXUP_HEADSET_JACK] = {
8005 .type = HDA_FIXUP_FUNC,
8006 .v.func = alc_fixup_headset_jack,
8008 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8009 .type = HDA_FIXUP_PINS,
8010 .v.pins = (const struct hda_pintbl[]) {
8011 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8015 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8017 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8018 .type = HDA_FIXUP_VERBS,
8019 .v.verbs = (const struct hda_verb[]) {
8020 /* Disable PCBEEP-IN passthrough */
8021 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8022 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8026 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8028 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8029 .type = HDA_FIXUP_PINS,
8030 .v.pins = (const struct hda_pintbl[]) {
8031 { 0x19, 0x03a11130 },
8032 { 0x1a, 0x90a60140 }, /* use as internal mic */
8036 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8038 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8039 .type = HDA_FIXUP_PINS,
8040 .v.pins = (const struct hda_pintbl[]) {
8041 { 0x16, 0x01011020 }, /* Rear Line out */
8042 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8046 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8048 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8049 .type = HDA_FIXUP_FUNC,
8050 .v.func = alc_fixup_auto_mute_via_amp,
8052 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8054 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8055 .type = HDA_FIXUP_FUNC,
8056 .v.func = alc_fixup_disable_mic_vref,
8058 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8060 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8061 .type = HDA_FIXUP_VERBS,
8062 .v.verbs = (const struct hda_verb[]) {
8063 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8064 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8068 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8070 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8071 .type = HDA_FIXUP_PINS,
8072 .v.pins = (const struct hda_pintbl[]) {
8073 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8077 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8079 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8080 .type = HDA_FIXUP_PINS,
8081 .v.pins = (const struct hda_pintbl[]) {
8082 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8086 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8088 [ALC299_FIXUP_PREDATOR_SPK] = {
8089 .type = HDA_FIXUP_PINS,
8090 .v.pins = (const struct hda_pintbl[]) {
8091 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8095 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8096 .type = HDA_FIXUP_PINS,
8097 .v.pins = (const struct hda_pintbl[]) {
8098 { 0x19, 0x04a11040 },
8099 { 0x21, 0x04211020 },
8103 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8105 [ALC289_FIXUP_DELL_SPK2] = {
8106 .type = HDA_FIXUP_PINS,
8107 .v.pins = (const struct hda_pintbl[]) {
8108 { 0x17, 0x90170130 }, /* bass spk */
8112 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8114 [ALC289_FIXUP_DUAL_SPK] = {
8115 .type = HDA_FIXUP_FUNC,
8116 .v.func = alc285_fixup_speaker2_to_dac1,
8118 .chain_id = ALC289_FIXUP_DELL_SPK2
8120 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8121 .type = HDA_FIXUP_FUNC,
8122 .v.func = alc285_fixup_speaker2_to_dac1,
8124 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8126 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
8127 .type = HDA_FIXUP_FUNC,
8128 /* The GPIO must be pulled to initialize the AMP */
8129 .v.func = alc_fixup_gpio4,
8131 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8133 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8134 .type = HDA_FIXUP_FUNC,
8135 .v.func = alc285_fixup_thinkpad_x1_gen7,
8137 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8139 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8140 .type = HDA_FIXUP_FUNC,
8141 .v.func = alc_fixup_headset_jack,
8143 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8145 [ALC294_FIXUP_ASUS_HPE] = {
8146 .type = HDA_FIXUP_VERBS,
8147 .v.verbs = (const struct hda_verb[]) {
8149 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8150 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8154 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8156 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8157 .type = HDA_FIXUP_PINS,
8158 .v.pins = (const struct hda_pintbl[]) {
8159 { 0x19, 0x03a11050 }, /* front HP mic */
8160 { 0x1a, 0x01a11830 }, /* rear external mic */
8161 { 0x21, 0x03211020 }, /* front HP out */
8165 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8167 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8168 .type = HDA_FIXUP_VERBS,
8169 .v.verbs = (const struct hda_verb[]) {
8170 /* set 0x15 to HP-OUT ctrl */
8171 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8172 /* unmute the 0x15 amp */
8173 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8177 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8179 [ALC294_FIXUP_ASUS_GX502_HP] = {
8180 .type = HDA_FIXUP_FUNC,
8181 .v.func = alc294_fixup_gx502_hp,
8183 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8184 .type = HDA_FIXUP_PINS,
8185 .v.pins = (const struct hda_pintbl[]) {
8186 { 0x19, 0x01a11050 }, /* rear HP mic */
8187 { 0x1a, 0x01a11830 }, /* rear external mic */
8188 { 0x21, 0x012110f0 }, /* rear HP out */
8192 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8194 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8195 .type = HDA_FIXUP_VERBS,
8196 .v.verbs = (const struct hda_verb[]) {
8197 /* set 0x15 to HP-OUT ctrl */
8198 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8199 /* unmute the 0x15 amp */
8200 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8201 /* set 0x1b to HP-OUT */
8202 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8206 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8208 [ALC294_FIXUP_ASUS_GU502_HP] = {
8209 .type = HDA_FIXUP_FUNC,
8210 .v.func = alc294_fixup_gu502_hp,
8212 [ALC294_FIXUP_ASUS_G513_PINS] = {
8213 .type = HDA_FIXUP_PINS,
8214 .v.pins = (const struct hda_pintbl[]) {
8215 { 0x19, 0x03a11050 }, /* front HP mic */
8216 { 0x1a, 0x03a11c30 }, /* rear external mic */
8217 { 0x21, 0x03211420 }, /* front HP out */
8221 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8222 .type = HDA_FIXUP_PINS,
8223 .v.pins = (const struct hda_pintbl[]) {
8224 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8225 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8226 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8227 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8228 { 0x21, 0x03211420 },
8232 [ALC294_FIXUP_ASUS_COEF_1B] = {
8233 .type = HDA_FIXUP_VERBS,
8234 .v.verbs = (const struct hda_verb[]) {
8235 /* Set bit 10 to correct noisy output after reboot from
8236 * Windows 10 (due to pop noise reduction?)
8238 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8239 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8243 .chain_id = ALC289_FIXUP_ASUS_GA401,
8245 [ALC285_FIXUP_HP_GPIO_LED] = {
8246 .type = HDA_FIXUP_FUNC,
8247 .v.func = alc285_fixup_hp_gpio_led,
8249 [ALC285_FIXUP_HP_MUTE_LED] = {
8250 .type = HDA_FIXUP_FUNC,
8251 .v.func = alc285_fixup_hp_mute_led,
8253 [ALC236_FIXUP_HP_GPIO_LED] = {
8254 .type = HDA_FIXUP_FUNC,
8255 .v.func = alc236_fixup_hp_gpio_led,
8257 [ALC236_FIXUP_HP_MUTE_LED] = {
8258 .type = HDA_FIXUP_FUNC,
8259 .v.func = alc236_fixup_hp_mute_led,
8261 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8262 .type = HDA_FIXUP_FUNC,
8263 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8265 [ALC298_FIXUP_SAMSUNG_AMP] = {
8266 .type = HDA_FIXUP_FUNC,
8267 .v.func = alc298_fixup_samsung_amp,
8269 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8271 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8272 .type = HDA_FIXUP_VERBS,
8273 .v.verbs = (const struct hda_verb[]) {
8274 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8278 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8279 .type = HDA_FIXUP_VERBS,
8280 .v.verbs = (const struct hda_verb[]) {
8281 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8282 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8286 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8287 .type = HDA_FIXUP_PINS,
8288 .v.pins = (const struct hda_pintbl[]) {
8289 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8293 .chain_id = ALC269_FIXUP_HEADSET_MODE
8295 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8296 .type = HDA_FIXUP_PINS,
8297 .v.pins = (const struct hda_pintbl[]) {
8298 { 0x14, 0x90100120 }, /* use as internal speaker */
8299 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8300 { 0x1a, 0x01011020 }, /* use as line out */
8304 .chain_id = ALC269_FIXUP_HEADSET_MIC
8306 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8307 .type = HDA_FIXUP_PINS,
8308 .v.pins = (const struct hda_pintbl[]) {
8309 { 0x18, 0x02a11030 }, /* use as headset mic */
8313 .chain_id = ALC269_FIXUP_HEADSET_MIC
8315 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8316 .type = HDA_FIXUP_PINS,
8317 .v.pins = (const struct hda_pintbl[]) {
8318 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8322 .chain_id = ALC269_FIXUP_HEADSET_MIC
8324 [ALC289_FIXUP_ASUS_GA401] = {
8325 .type = HDA_FIXUP_FUNC,
8326 .v.func = alc289_fixup_asus_ga401,
8328 .chain_id = ALC289_FIXUP_ASUS_GA502,
8330 [ALC289_FIXUP_ASUS_GA502] = {
8331 .type = HDA_FIXUP_PINS,
8332 .v.pins = (const struct hda_pintbl[]) {
8333 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8337 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8338 .type = HDA_FIXUP_PINS,
8339 .v.pins = (const struct hda_pintbl[]) {
8340 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8344 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8346 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8347 .type = HDA_FIXUP_FUNC,
8348 .v.func = alc285_fixup_hp_gpio_amp_init,
8350 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8352 [ALC269_FIXUP_CZC_B20] = {
8353 .type = HDA_FIXUP_PINS,
8354 .v.pins = (const struct hda_pintbl[]) {
8355 { 0x12, 0x411111f0 },
8356 { 0x14, 0x90170110 }, /* speaker */
8357 { 0x15, 0x032f1020 }, /* HP out */
8358 { 0x17, 0x411111f0 },
8359 { 0x18, 0x03ab1040 }, /* mic */
8360 { 0x19, 0xb7a7013f },
8361 { 0x1a, 0x0181305f },
8362 { 0x1b, 0x411111f0 },
8363 { 0x1d, 0x411111f0 },
8364 { 0x1e, 0x411111f0 },
8367 .chain_id = ALC269_FIXUP_DMIC,
8369 [ALC269_FIXUP_CZC_TMI] = {
8370 .type = HDA_FIXUP_PINS,
8371 .v.pins = (const struct hda_pintbl[]) {
8372 { 0x12, 0x4000c000 },
8373 { 0x14, 0x90170110 }, /* speaker */
8374 { 0x15, 0x0421401f }, /* HP out */
8375 { 0x17, 0x411111f0 },
8376 { 0x18, 0x04a19020 }, /* mic */
8377 { 0x19, 0x411111f0 },
8378 { 0x1a, 0x411111f0 },
8379 { 0x1b, 0x411111f0 },
8380 { 0x1d, 0x40448505 },
8381 { 0x1e, 0x411111f0 },
8382 { 0x20, 0x8000ffff },
8385 .chain_id = ALC269_FIXUP_DMIC,
8387 [ALC269_FIXUP_CZC_L101] = {
8388 .type = HDA_FIXUP_PINS,
8389 .v.pins = (const struct hda_pintbl[]) {
8390 { 0x12, 0x40000000 },
8391 { 0x14, 0x01014010 }, /* speaker */
8392 { 0x15, 0x411111f0 }, /* HP out */
8393 { 0x16, 0x411111f0 },
8394 { 0x18, 0x01a19020 }, /* mic */
8395 { 0x19, 0x02a19021 },
8396 { 0x1a, 0x0181302f },
8397 { 0x1b, 0x0221401f },
8398 { 0x1c, 0x411111f0 },
8399 { 0x1d, 0x4044c601 },
8400 { 0x1e, 0x411111f0 },
8403 .chain_id = ALC269_FIXUP_DMIC,
8405 [ALC269_FIXUP_LEMOTE_A1802] = {
8406 .type = HDA_FIXUP_PINS,
8407 .v.pins = (const struct hda_pintbl[]) {
8408 { 0x12, 0x40000000 },
8409 { 0x14, 0x90170110 }, /* speaker */
8410 { 0x17, 0x411111f0 },
8411 { 0x18, 0x03a19040 }, /* mic1 */
8412 { 0x19, 0x90a70130 }, /* mic2 */
8413 { 0x1a, 0x411111f0 },
8414 { 0x1b, 0x411111f0 },
8415 { 0x1d, 0x40489d2d },
8416 { 0x1e, 0x411111f0 },
8417 { 0x20, 0x0003ffff },
8418 { 0x21, 0x03214020 },
8421 .chain_id = ALC269_FIXUP_DMIC,
8423 [ALC269_FIXUP_LEMOTE_A190X] = {
8424 .type = HDA_FIXUP_PINS,
8425 .v.pins = (const struct hda_pintbl[]) {
8426 { 0x14, 0x99130110 }, /* speaker */
8427 { 0x15, 0x0121401f }, /* HP out */
8428 { 0x18, 0x01a19c20 }, /* rear mic */
8429 { 0x19, 0x99a3092f }, /* front mic */
8430 { 0x1b, 0x0201401f }, /* front lineout */
8433 .chain_id = ALC269_FIXUP_DMIC,
8435 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8436 .type = HDA_FIXUP_PINS,
8437 .v.pins = (const struct hda_pintbl[]) {
8438 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8442 .chain_id = ALC269_FIXUP_HEADSET_MODE
8444 [ALC256_FIXUP_INTEL_NUC10] = {
8445 .type = HDA_FIXUP_PINS,
8446 .v.pins = (const struct hda_pintbl[]) {
8447 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8451 .chain_id = ALC269_FIXUP_HEADSET_MODE
8453 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8454 .type = HDA_FIXUP_VERBS,
8455 .v.verbs = (const struct hda_verb[]) {
8456 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8457 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8461 .chain_id = ALC289_FIXUP_ASUS_GA502
8463 [ALC274_FIXUP_HP_MIC] = {
8464 .type = HDA_FIXUP_VERBS,
8465 .v.verbs = (const struct hda_verb[]) {
8466 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8467 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8471 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8472 .type = HDA_FIXUP_FUNC,
8473 .v.func = alc274_fixup_hp_headset_mic,
8475 .chain_id = ALC274_FIXUP_HP_MIC
8477 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8478 .type = HDA_FIXUP_FUNC,
8479 .v.func = alc274_fixup_hp_envy_gpio,
8481 [ALC256_FIXUP_ASUS_HPE] = {
8482 .type = HDA_FIXUP_VERBS,
8483 .v.verbs = (const struct hda_verb[]) {
8485 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8486 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8490 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8492 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8493 .type = HDA_FIXUP_FUNC,
8494 .v.func = alc_fixup_headset_jack,
8496 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8498 [ALC287_FIXUP_HP_GPIO_LED] = {
8499 .type = HDA_FIXUP_FUNC,
8500 .v.func = alc287_fixup_hp_gpio_led,
8502 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8503 .type = HDA_FIXUP_FUNC,
8504 .v.func = alc274_fixup_hp_headset_mic,
8506 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8507 .type = HDA_FIXUP_FUNC,
8508 .v.func = alc_fixup_no_int_mic,
8510 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8512 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8513 .type = HDA_FIXUP_PINS,
8514 .v.pins = (const struct hda_pintbl[]) {
8515 { 0x1b, 0x411111f0 },
8516 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8520 .chain_id = ALC269_FIXUP_HEADSET_MODE
8522 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8523 .type = HDA_FIXUP_FUNC,
8524 .v.func = alc269_fixup_limit_int_mic_boost,
8526 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8528 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8529 .type = HDA_FIXUP_PINS,
8530 .v.pins = (const struct hda_pintbl[]) {
8531 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8532 { 0x1a, 0x90a1092f }, /* use as internal mic */
8536 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8538 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8539 .type = HDA_FIXUP_FUNC,
8540 .v.func = alc285_fixup_ideapad_s740_coef,
8542 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8544 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8545 .type = HDA_FIXUP_FUNC,
8546 .v.func = alc269_fixup_limit_int_mic_boost,
8548 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8550 [ALC295_FIXUP_ASUS_DACS] = {
8551 .type = HDA_FIXUP_FUNC,
8552 .v.func = alc295_fixup_asus_dacs,
8554 [ALC295_FIXUP_HP_OMEN] = {
8555 .type = HDA_FIXUP_PINS,
8556 .v.pins = (const struct hda_pintbl[]) {
8557 { 0x12, 0xb7a60130 },
8558 { 0x13, 0x40000000 },
8559 { 0x14, 0x411111f0 },
8560 { 0x16, 0x411111f0 },
8561 { 0x17, 0x90170110 },
8562 { 0x18, 0x411111f0 },
8563 { 0x19, 0x02a11030 },
8564 { 0x1a, 0x411111f0 },
8565 { 0x1b, 0x04a19030 },
8566 { 0x1d, 0x40600001 },
8567 { 0x1e, 0x411111f0 },
8568 { 0x21, 0x03211020 },
8572 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8574 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8575 .type = HDA_FIXUP_FUNC,
8576 .v.func = alc285_fixup_hp_spectre_x360,
8578 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8579 .type = HDA_FIXUP_FUNC,
8580 .v.func = alc285_fixup_hp_spectre_x360_eb1
8582 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8583 .type = HDA_FIXUP_FUNC,
8584 .v.func = alc285_fixup_ideapad_s740_coef,
8586 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8588 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8589 .type = HDA_FIXUP_FUNC,
8590 .v.func = alc_fixup_no_shutup,
8592 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8594 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8595 .type = HDA_FIXUP_PINS,
8596 .v.pins = (const struct hda_pintbl[]) {
8597 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8601 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8603 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8604 .type = HDA_FIXUP_FUNC,
8605 .v.func = alc269_fixup_limit_int_mic_boost,
8607 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8609 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8610 .type = HDA_FIXUP_FUNC,
8611 .v.func = alc285_fixup_ideapad_s740_coef,
8613 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8615 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8616 .type = HDA_FIXUP_FUNC,
8617 .v.func = alc287_fixup_legion_15imhg05_speakers,
8619 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8621 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8622 .type = HDA_FIXUP_VERBS,
8623 //.v.verbs = legion_15imhg05_coefs,
8624 .v.verbs = (const struct hda_verb[]) {
8625 // set left speaker Legion 7i.
8626 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8627 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8629 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8630 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8631 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8632 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8633 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8635 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8636 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8637 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8638 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8639 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8641 // set right speaker Legion 7i.
8642 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8643 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8645 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8646 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8647 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8648 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8649 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8651 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8652 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8653 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8654 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8655 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8659 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8661 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8662 .type = HDA_FIXUP_FUNC,
8663 .v.func = alc287_fixup_legion_15imhg05_speakers,
8665 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8667 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8668 .type = HDA_FIXUP_VERBS,
8669 .v.verbs = (const struct hda_verb[]) {
8670 // set left speaker Yoga 7i.
8671 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8672 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8674 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8675 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8676 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8677 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8678 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8680 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8681 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8682 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8683 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8684 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8686 // set right speaker Yoga 7i.
8687 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8688 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8690 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8691 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8692 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8693 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8694 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8696 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8697 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8698 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8699 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8700 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8704 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8706 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
8707 .type = HDA_FIXUP_FUNC,
8708 .v.func = alc298_fixup_lenovo_c940_duet7,
8710 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8711 .type = HDA_FIXUP_VERBS,
8712 .v.verbs = (const struct hda_verb[]) {
8713 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8714 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8715 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8716 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8717 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8718 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8719 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8720 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8721 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8722 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8723 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8724 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8725 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8726 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8730 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8732 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
8733 .type = HDA_FIXUP_FUNC,
8734 .v.func = alc256_fixup_set_coef_defaults,
8736 [ALC245_FIXUP_HP_GPIO_LED] = {
8737 .type = HDA_FIXUP_FUNC,
8738 .v.func = alc245_fixup_hp_gpio_led,
8740 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8741 .type = HDA_FIXUP_PINS,
8742 .v.pins = (const struct hda_pintbl[]) {
8743 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8747 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8749 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8750 .type = HDA_FIXUP_FUNC,
8751 .v.func = alc233_fixup_no_audio_jack,
8753 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8754 .type = HDA_FIXUP_FUNC,
8755 .v.func = alc256_fixup_mic_no_presence_and_resume,
8757 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8759 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
8760 .type = HDA_FIXUP_VERBS,
8761 .v.verbs = (const struct hda_verb[]) {
8762 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
8763 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
8767 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8771 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8772 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8773 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8774 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8775 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8776 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8777 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8778 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8779 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8780 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8781 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8782 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8783 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8784 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8785 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8786 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8787 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8788 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8789 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8790 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8791 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8792 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8793 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8794 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8795 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8796 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8797 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8798 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8799 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8800 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8801 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8802 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8803 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8804 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8805 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8806 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8807 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8808 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8809 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8810 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8811 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
8812 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8813 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8814 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8815 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8816 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8817 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8818 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8819 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8820 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8821 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8822 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8823 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8824 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8825 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8826 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8827 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8828 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8829 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8830 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8831 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8832 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8833 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8834 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8835 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8836 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8837 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8838 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8839 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8840 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8841 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8842 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8843 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8844 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8845 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8846 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8847 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8848 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8849 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8850 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8851 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8852 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8853 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8854 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8855 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8856 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8857 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8858 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8859 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8860 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8861 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8862 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8863 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
8864 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8865 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8866 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
8867 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
8868 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8869 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8870 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8871 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8872 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8873 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8874 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8875 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8876 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8877 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8878 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8879 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8880 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8881 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8882 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8883 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8884 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8885 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8886 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8887 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8888 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8889 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8890 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8891 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8892 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8893 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8894 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8895 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8896 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8897 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8898 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8899 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8900 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8901 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8902 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8903 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8904 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8905 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8906 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8907 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8908 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8909 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8910 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8911 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8912 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8913 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8914 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8915 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8916 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8917 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8918 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8919 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8920 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8921 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8922 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8923 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8924 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8925 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8926 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8927 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
8928 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8929 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8930 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8931 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
8932 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8933 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
8934 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
8935 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8936 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8937 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
8938 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8939 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8940 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8941 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
8942 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
8943 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8944 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8945 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8946 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8947 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
8948 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8949 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8950 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8951 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8952 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
8953 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
8954 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
8955 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8956 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8957 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8958 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
8959 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
8960 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
8961 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
8962 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8963 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
8964 ALC285_FIXUP_HP_GPIO_AMP_INIT),
8965 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
8966 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
8967 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
8968 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
8969 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8970 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8971 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8972 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8973 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
8974 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
8975 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8976 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
8977 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
8978 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8979 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8980 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
8981 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8982 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8983 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8984 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
8985 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8986 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8987 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8988 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8989 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
8990 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
8991 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
8992 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
8993 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8994 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
8995 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
8996 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
8997 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
8998 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
8999 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9000 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9001 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9002 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
9003 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9004 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9005 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9006 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
9007 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9008 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9009 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9010 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9011 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9012 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9013 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9014 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9015 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
9016 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
9017 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
9018 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
9019 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
9020 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
9021 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9022 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9023 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
9024 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
9025 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
9026 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
9027 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
9028 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
9029 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
9030 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
9031 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
9032 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
9033 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
9034 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
9035 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
9036 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
9037 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
9038 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9039 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9040 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
9041 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
9042 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
9043 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
9044 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
9045 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
9046 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
9047 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
9048 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
9049 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
9050 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
9051 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
9052 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9053 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9054 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9055 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9056 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
9057 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9058 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9059 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9060 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
9061 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9062 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9063 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
9064 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
9065 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9066 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
9067 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9068 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
9069 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
9070 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
9071 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9072 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9073 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9074 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9075 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
9076 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
9077 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9078 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
9079 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
9080 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9081 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
9082 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
9083 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
9084 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
9085 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
9086 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9087 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9088 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
9089 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
9090 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
9091 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9092 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9093 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9094 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9095 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9096 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9097 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9098 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9099 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9100 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9101 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9102 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9103 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9104 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9105 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9106 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9107 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9108 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9109 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9110 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9111 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9112 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9113 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9114 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9115 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9116 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9117 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9118 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9119 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9120 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9121 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9122 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9123 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9124 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9125 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9126 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9127 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9128 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9129 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9130 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9131 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9132 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9133 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9134 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9135 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9136 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9137 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9138 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9139 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
9140 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9141 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9142 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9143 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9144 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9145 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
9146 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9147 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9148 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9149 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9150 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9151 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9152 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9153 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9154 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9155 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9156 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9157 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9158 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9159 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9160 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9161 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
9162 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9163 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9164 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9165 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9166 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9167 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
9168 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
9169 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
9170 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
9171 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
9172 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
9173 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9174 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
9175 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
9176 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
9177 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
9178 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
9179 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
9180 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9181 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
9182 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
9183 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
9184 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9185 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9186 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
9187 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
9188 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9189 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9190 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9191 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
9192 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9193 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9194 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9195 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9196 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9197 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9198 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9199 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9200 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9201 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9202 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9203 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9204 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9205 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9206 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9207 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9208 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9209 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9210 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9211 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9212 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9213 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
9214 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
9215 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9216 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9217 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
9218 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9219 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9220 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
9221 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9222 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9223 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9224 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9225 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
9226 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9227 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
9228 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9229 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
9230 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
9231 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9232 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
9233 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
9234 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
9235 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
9236 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
9237 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9238 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
9239 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
9240 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9241 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9242 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9243 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9244 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9245 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9246 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9247 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
9248 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
9249 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
9250 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
9251 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9252 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9253 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9254 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
9255 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
9256 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9257 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
9258 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
9259 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9260 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9261 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9262 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9263 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9264 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9265 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9266 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
9267 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9268 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
9269 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9270 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
9271 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9272 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
9273 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
9274 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9277 /* Below is a quirk table taken from the old code.
9278 * Basically the device should work as is without the fixup table.
9279 * If BIOS doesn't give a proper info, enable the corresponding
9282 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9284 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9285 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9286 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9287 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9288 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9289 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9290 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9291 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9292 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9293 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9294 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9295 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9296 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9297 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9298 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9299 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9300 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9301 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9302 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9303 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9304 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9305 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9306 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9307 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9308 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9309 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9310 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9311 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9312 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9313 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9314 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9315 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9316 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9317 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9318 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9319 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9320 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9321 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9322 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9327 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9328 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9329 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9330 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9331 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9332 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9336 static const struct hda_model_fixup alc269_fixup_models[] = {
9337 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9338 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9339 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9340 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9341 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9342 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9343 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9344 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9345 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9346 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9347 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9348 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9349 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9350 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9351 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9352 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9353 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9354 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9355 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9356 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9357 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9358 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9359 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9360 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9361 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9362 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9363 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9364 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9365 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9366 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9367 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9368 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9369 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9370 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9371 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9372 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9373 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9374 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9375 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9376 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9377 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9378 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9379 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9380 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9381 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9382 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9383 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9384 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9385 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9386 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9387 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9388 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9389 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9390 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9391 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9392 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9393 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9394 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9395 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9396 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9397 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9398 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9399 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9400 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9401 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
9402 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
9403 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
9404 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
9405 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9406 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9407 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9408 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9409 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9410 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9411 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9412 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9413 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9414 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9415 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9416 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9417 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9418 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
9419 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9420 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9421 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
9422 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
9423 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
9424 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
9425 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9426 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9427 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9428 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9429 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9430 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9431 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9432 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9433 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9434 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9435 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9436 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9437 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9438 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9439 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9440 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9441 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
9442 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9443 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
9444 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
9445 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
9446 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
9447 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
9448 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
9449 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
9450 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
9451 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
9452 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
9453 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
9454 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9455 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
9456 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
9457 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9458 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
9461 #define ALC225_STANDARD_PINS \
9464 #define ALC256_STANDARD_PINS \
9465 {0x12, 0x90a60140}, \
9466 {0x14, 0x90170110}, \
9469 #define ALC282_STANDARD_PINS \
9472 #define ALC290_STANDARD_PINS \
9475 #define ALC292_STANDARD_PINS \
9476 {0x14, 0x90170110}, \
9479 #define ALC295_STANDARD_PINS \
9480 {0x12, 0xb7a60130}, \
9481 {0x14, 0x90170110}, \
9484 #define ALC298_STANDARD_PINS \
9485 {0x12, 0x90a60130}, \
9488 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
9489 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9494 {0x21, 0x0221102f}),
9495 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9498 {0x21, 0x02211030}),
9499 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9502 {0x21, 0x03211020}),
9503 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9506 {0x21, 0x03211020}),
9507 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9508 ALC225_STANDARD_PINS,
9510 {0x14, 0x901701a0}),
9511 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9512 ALC225_STANDARD_PINS,
9514 {0x14, 0x901701b0}),
9515 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9516 ALC225_STANDARD_PINS,
9518 {0x14, 0x901701a0}),
9519 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9520 ALC225_STANDARD_PINS,
9522 {0x14, 0x901701b0}),
9523 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9524 ALC225_STANDARD_PINS,
9526 {0x1b, 0x90170110}),
9527 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9530 {0x21, 0x02211020}),
9531 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9535 {0x21, 0x02211020}),
9536 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9541 {0x21, 0x0221101f}),
9542 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9547 {0x21, 0x0221101f}),
9548 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9552 {0x21, 0x0221101f}),
9553 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9554 {0x21, 0x02211010}),
9555 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9558 {0x21, 0x02211030}),
9559 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9561 {0x21, 0x02211020}),
9562 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9564 {0x21, 0x02211040}),
9565 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9568 {0x21, 0x02211020}),
9569 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9572 {0x21, 0x02211030}),
9573 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9576 {0x21, 0x0221101f}),
9577 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9580 {0x21, 0x0221101f}),
9581 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9584 {0x21, 0x0221103f}),
9585 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9588 {0x21, 0x0221103f}),
9589 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9592 {0x21, 0x0221103f}),
9593 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9596 {0x21, 0x0221105f}),
9597 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9600 {0x21, 0x0221101f}),
9601 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9605 {0x21, 0x0321102f}),
9606 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9609 {0x21, 0x02211040}),
9610 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9613 {0x21, 0x02211050}),
9614 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9617 {0x21, 0x02211030}),
9618 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9621 {0x21, 0x02211040}),
9622 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9625 {0x21, 0x02211040}),
9626 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9629 {0x21, 0x02211050}),
9630 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9633 {0x21, 0x02211040}),
9634 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9637 {0x21, 0x02211030}),
9638 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9640 {0x21, 0x02211010}),
9641 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9644 {0x21, 0x04211020}),
9645 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9648 {0x21, 0x03211020}),
9649 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9652 {0x21, 0x03211020}),
9653 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9656 {0x21, 0x04211020}),
9657 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9660 {0x21, 0x03211020}),
9661 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9664 {0x21, 0x0221101f}),
9665 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9668 {0x21, 0x03211020}),
9669 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9673 {0x1a, 0x04a11020}),
9674 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9680 {0x1b, 0x02011020}),
9681 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9682 ALC282_STANDARD_PINS,
9685 {0x21, 0x0321101f}),
9686 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9687 ALC282_STANDARD_PINS,
9690 {0x21, 0x03211040}),
9691 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9692 ALC282_STANDARD_PINS,
9695 {0x21, 0x03211020}),
9696 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9697 ALC282_STANDARD_PINS,
9700 {0x21, 0x0421101f}),
9701 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9702 ALC282_STANDARD_PINS,
9705 {0x21, 0x04211020}),
9706 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9707 ALC282_STANDARD_PINS,
9713 {0x21, 0x0321101f}),
9714 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9715 ALC282_STANDARD_PINS,
9721 {0x21, 0x0321101f}),
9722 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9723 ALC282_STANDARD_PINS,
9725 {0x21, 0x0321101f}),
9726 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9729 {0x21, 0x02211030}),
9730 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9731 ALC282_STANDARD_PINS,
9734 {0x21, 0x0321101f}),
9735 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9739 {0x21, 0x04211020}),
9740 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9744 {0x21, 0x04211020}),
9745 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9748 {0x21, 0x04211020}),
9749 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9753 {0x21, 0x03211020}),
9754 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9757 {0x21, 0x02211020}),
9758 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9761 {0x21, 0x0321101f}),
9762 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9763 ALC290_STANDARD_PINS,
9766 {0x1a, 0x04a11020}),
9767 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9768 ALC290_STANDARD_PINS,
9771 {0x1a, 0x04a11020}),
9772 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9773 ALC290_STANDARD_PINS,
9775 {0x1a, 0x04a11020}),
9776 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9777 ALC290_STANDARD_PINS,
9779 {0x1a, 0x04a11040}),
9780 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9781 ALC290_STANDARD_PINS,
9784 {0x1a, 0x04a11040}),
9785 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9786 ALC290_STANDARD_PINS,
9789 {0x1a, 0x04a11020}),
9790 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9791 ALC290_STANDARD_PINS,
9794 {0x1a, 0x04a11020}),
9795 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9796 ALC292_STANDARD_PINS,
9799 {0x19, 0x01a19030}),
9800 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9801 ALC292_STANDARD_PINS,
9805 {0x19, 0x01a1903e}),
9806 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9807 ALC292_STANDARD_PINS,
9808 {0x12, 0x90a60140}),
9809 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9810 ALC292_STANDARD_PINS,
9813 {0x19, 0x21a19030}),
9814 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9815 ALC292_STANDARD_PINS,
9816 {0x13, 0x90a60140}),
9817 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9819 {0x21, 0x04211020}),
9820 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9823 {0x21, 0x04211020}),
9824 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9827 {0x21, 0x03211020}),
9828 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9831 {0x21, 0x04211020}),
9832 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9835 {0x21, 0x03211020}),
9836 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9839 {0x21, 0x04211030}),
9840 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9843 {0x21, 0x03211020}),
9844 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9847 {0x21, 0x03211020}),
9848 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9850 {0x21, 0x04211020}),
9851 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9853 {0x21, 0x04211030}),
9854 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9855 ALC295_STANDARD_PINS,
9857 {0x18, 0x21a19030}),
9858 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9859 ALC295_STANDARD_PINS,
9861 {0x18, 0x21a19050}),
9862 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9863 ALC295_STANDARD_PINS),
9864 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9865 ALC298_STANDARD_PINS,
9866 {0x17, 0x90170110}),
9867 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9868 ALC298_STANDARD_PINS,
9869 {0x17, 0x90170140}),
9870 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9871 ALC298_STANDARD_PINS,
9872 {0x17, 0x90170150}),
9873 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9878 {0x21, 0x03211030}),
9879 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9883 {0x21, 0x03211020}),
9884 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9885 ALC225_STANDARD_PINS,
9887 {0x17, 0x90170110}),
9888 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9893 {0x21, 0x0221101f}),
9897 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9898 * more machines, don't need to match all valid pins, just need to match
9899 * all the pins defined in the tbl. Just because of this reason, it is possible
9900 * that a single machine matches multiple tbls, so there is one limitation:
9901 * at most one tbl is allowed to define for the same vendor and same codec
9903 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9904 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9906 {0x1b, 0x40000000}),
9907 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9909 {0x1a, 0x40000000}),
9910 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9912 {0x1a, 0x40000000}),
9913 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9915 {0x1a, 0x40000000}),
9919 static void alc269_fill_coef(struct hda_codec *codec)
9921 struct alc_spec *spec = codec->spec;
9924 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
9927 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
9928 alc_write_coef_idx(codec, 0xf, 0x960b);
9929 alc_write_coef_idx(codec, 0xe, 0x8817);
9932 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
9933 alc_write_coef_idx(codec, 0xf, 0x960b);
9934 alc_write_coef_idx(codec, 0xe, 0x8814);
9937 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
9938 /* Power up output pin */
9939 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
9942 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
9943 val = alc_read_coef_idx(codec, 0xd);
9944 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
9945 /* Capless ramp up clock control */
9946 alc_write_coef_idx(codec, 0xd, val | (1<<10));
9948 val = alc_read_coef_idx(codec, 0x17);
9949 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
9950 /* Class D power on reset */
9951 alc_write_coef_idx(codec, 0x17, val | (1<<7));
9956 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
9961 static int patch_alc269(struct hda_codec *codec)
9963 struct alc_spec *spec;
9966 err = alc_alloc_spec(codec, 0x0b);
9971 spec->gen.shared_mic_vref_pin = 0x18;
9972 codec->power_save_node = 0;
9975 codec->patch_ops.suspend = alc269_suspend;
9976 codec->patch_ops.resume = alc269_resume;
9978 spec->shutup = alc_default_shutup;
9979 spec->init_hook = alc_default_init;
9981 switch (codec->core.vendor_id) {
9983 spec->codec_variant = ALC269_TYPE_ALC269VA;
9984 switch (alc_get_coef0(codec) & 0x00f0) {
9986 if (codec->bus->pci &&
9987 codec->bus->pci->subsystem_vendor == 0x1025 &&
9988 spec->cdefine.platform_type == 1)
9989 err = alc_codec_rename(codec, "ALC271X");
9990 spec->codec_variant = ALC269_TYPE_ALC269VB;
9993 if (codec->bus->pci &&
9994 codec->bus->pci->subsystem_vendor == 0x17aa &&
9995 codec->bus->pci->subsystem_device == 0x21f3)
9996 err = alc_codec_rename(codec, "ALC3202");
9997 spec->codec_variant = ALC269_TYPE_ALC269VC;
10000 spec->codec_variant = ALC269_TYPE_ALC269VD;
10003 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10007 spec->shutup = alc269_shutup;
10008 spec->init_hook = alc269_fill_coef;
10009 alc269_fill_coef(codec);
10014 spec->codec_variant = ALC269_TYPE_ALC280;
10017 spec->codec_variant = ALC269_TYPE_ALC282;
10018 spec->shutup = alc282_shutup;
10019 spec->init_hook = alc282_init;
10023 spec->codec_variant = ALC269_TYPE_ALC283;
10024 spec->shutup = alc283_shutup;
10025 spec->init_hook = alc283_init;
10029 spec->codec_variant = ALC269_TYPE_ALC284;
10032 spec->codec_variant = ALC269_TYPE_ALC293;
10036 spec->codec_variant = ALC269_TYPE_ALC286;
10039 spec->codec_variant = ALC269_TYPE_ALC298;
10043 spec->codec_variant = ALC269_TYPE_ALC255;
10044 spec->shutup = alc256_shutup;
10045 spec->init_hook = alc256_init;
10051 spec->codec_variant = ALC269_TYPE_ALC256;
10052 spec->shutup = alc256_shutup;
10053 spec->init_hook = alc256_init;
10054 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
10057 spec->codec_variant = ALC269_TYPE_ALC257;
10058 spec->shutup = alc256_shutup;
10059 spec->init_hook = alc256_init;
10060 spec->gen.mixer_nid = 0;
10066 if (alc_get_coef0(codec) & 0x0010)
10067 spec->codec_variant = ALC269_TYPE_ALC245;
10069 spec->codec_variant = ALC269_TYPE_ALC215;
10070 spec->shutup = alc225_shutup;
10071 spec->init_hook = alc225_init;
10072 spec->gen.mixer_nid = 0;
10077 spec->codec_variant = ALC269_TYPE_ALC225;
10078 spec->shutup = alc225_shutup;
10079 spec->init_hook = alc225_init;
10080 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
10083 spec->codec_variant = ALC269_TYPE_ALC287;
10084 spec->shutup = alc225_shutup;
10085 spec->init_hook = alc225_init;
10086 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10091 spec->codec_variant = ALC269_TYPE_ALC294;
10092 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
10093 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
10094 spec->init_hook = alc294_init;
10097 spec->codec_variant = ALC269_TYPE_ALC300;
10098 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
10101 spec->codec_variant = ALC269_TYPE_ALC623;
10107 spec->codec_variant = ALC269_TYPE_ALC700;
10108 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
10109 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
10110 spec->init_hook = alc294_init;
10115 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
10116 spec->has_alc5505_dsp = 1;
10117 spec->init_hook = alc5505_dsp_init;
10120 alc_pre_init(codec);
10122 snd_hda_pick_fixup(codec, alc269_fixup_models,
10123 alc269_fixup_tbl, alc269_fixups);
10124 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10125 * the quirk breaks the latter (bko#214101).
10126 * Clear the wrong entry.
10128 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10129 codec->core.vendor_id == 0x10ec0294) {
10130 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10131 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10134 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
10135 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
10136 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10138 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10140 alc_auto_parse_customize_define(codec);
10142 if (has_cdefine_beep(codec))
10143 spec->gen.beep_nid = 0x01;
10145 /* automatic parse from the BIOS config */
10146 err = alc269_parse_auto_config(codec);
10150 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10151 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10156 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10169 static int alc861_parse_auto_config(struct hda_codec *codec)
10171 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
10172 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10173 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
10176 /* Pin config fixes */
10178 ALC861_FIXUP_FSC_AMILO_PI1505,
10179 ALC861_FIXUP_AMP_VREF_0F,
10180 ALC861_FIXUP_NO_JACK_DETECT,
10181 ALC861_FIXUP_ASUS_A6RP,
10182 ALC660_FIXUP_ASUS_W7J,
10185 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10186 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
10187 const struct hda_fixup *fix, int action)
10189 struct alc_spec *spec = codec->spec;
10192 if (action != HDA_FIXUP_ACT_INIT)
10194 val = snd_hda_codec_get_pin_target(codec, 0x0f);
10195 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10196 val |= AC_PINCTL_IN_EN;
10197 val |= AC_PINCTL_VREF_50;
10198 snd_hda_set_pin_ctl(codec, 0x0f, val);
10199 spec->gen.keep_vref_in_automute = 1;
10202 /* suppress the jack-detection */
10203 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
10204 const struct hda_fixup *fix, int action)
10206 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10207 codec->no_jack_detect = 1;
10210 static const struct hda_fixup alc861_fixups[] = {
10211 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
10212 .type = HDA_FIXUP_PINS,
10213 .v.pins = (const struct hda_pintbl[]) {
10214 { 0x0b, 0x0221101f }, /* HP */
10215 { 0x0f, 0x90170310 }, /* speaker */
10219 [ALC861_FIXUP_AMP_VREF_0F] = {
10220 .type = HDA_FIXUP_FUNC,
10221 .v.func = alc861_fixup_asus_amp_vref_0f,
10223 [ALC861_FIXUP_NO_JACK_DETECT] = {
10224 .type = HDA_FIXUP_FUNC,
10225 .v.func = alc_fixup_no_jack_detect,
10227 [ALC861_FIXUP_ASUS_A6RP] = {
10228 .type = HDA_FIXUP_FUNC,
10229 .v.func = alc861_fixup_asus_amp_vref_0f,
10231 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
10233 [ALC660_FIXUP_ASUS_W7J] = {
10234 .type = HDA_FIXUP_VERBS,
10235 .v.verbs = (const struct hda_verb[]) {
10236 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10237 * for enabling outputs
10239 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10245 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
10246 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
10247 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
10248 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10249 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10250 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
10251 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
10252 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
10258 static int patch_alc861(struct hda_codec *codec)
10260 struct alc_spec *spec;
10263 err = alc_alloc_spec(codec, 0x15);
10267 spec = codec->spec;
10268 if (has_cdefine_beep(codec))
10269 spec->gen.beep_nid = 0x23;
10272 spec->power_hook = alc_power_eapd;
10275 alc_pre_init(codec);
10277 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10278 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10280 /* automatic parse from the BIOS config */
10281 err = alc861_parse_auto_config(codec);
10285 if (!spec->gen.no_analog) {
10286 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10291 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10301 * ALC861-VD support
10305 * In addition, an independent DAC
10307 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10309 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10310 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10311 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10315 ALC660VD_FIX_ASUS_GPIO1,
10316 ALC861VD_FIX_DALLAS,
10319 /* exclude VREF80 */
10320 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10321 const struct hda_fixup *fix, int action)
10323 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10324 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10325 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10330 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10331 const struct hda_fixup *fix, int action)
10333 struct alc_spec *spec = codec->spec;
10335 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10336 spec->gpio_mask |= 0x02;
10337 alc_fixup_gpio(codec, action, 0x01);
10340 static const struct hda_fixup alc861vd_fixups[] = {
10341 [ALC660VD_FIX_ASUS_GPIO1] = {
10342 .type = HDA_FIXUP_FUNC,
10343 .v.func = alc660vd_fixup_asus_gpio1,
10345 [ALC861VD_FIX_DALLAS] = {
10346 .type = HDA_FIXUP_FUNC,
10347 .v.func = alc861vd_fixup_dallas,
10351 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10352 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10353 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10354 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10360 static int patch_alc861vd(struct hda_codec *codec)
10362 struct alc_spec *spec;
10365 err = alc_alloc_spec(codec, 0x0b);
10369 spec = codec->spec;
10370 if (has_cdefine_beep(codec))
10371 spec->gen.beep_nid = 0x23;
10373 spec->shutup = alc_eapd_shutup;
10375 alc_pre_init(codec);
10377 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10378 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10380 /* automatic parse from the BIOS config */
10381 err = alc861vd_parse_auto_config(codec);
10385 if (!spec->gen.no_analog) {
10386 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10391 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10403 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10404 * configuration. Each pin widget can choose any input DACs and a mixer.
10405 * Each ADC is connected from a mixer of all inputs. This makes possible
10406 * 6-channel independent captures.
10408 * In addition, an independent DAC for the multi-playback (not used in this
10413 * BIOS auto configuration
10416 static int alc662_parse_auto_config(struct hda_codec *codec)
10418 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
10419 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10420 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10421 const hda_nid_t *ssids;
10423 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10424 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10425 codec->core.vendor_id == 0x10ec0671)
10426 ssids = alc663_ssids;
10428 ssids = alc662_ssids;
10429 return alc_parse_auto_config(codec, alc662_ignore, ssids);
10432 static void alc272_fixup_mario(struct hda_codec *codec,
10433 const struct hda_fixup *fix, int action)
10435 if (action != HDA_FIXUP_ACT_PRE_PROBE)
10437 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10438 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10439 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10440 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10441 (0 << AC_AMPCAP_MUTE_SHIFT)))
10442 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
10445 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10447 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10449 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10450 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10454 /* override the 2.1 chmap */
10455 static void alc_fixup_bass_chmap(struct hda_codec *codec,
10456 const struct hda_fixup *fix, int action)
10458 if (action == HDA_FIXUP_ACT_BUILD) {
10459 struct alc_spec *spec = codec->spec;
10460 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
10464 /* avoid D3 for keeping GPIO up */
10465 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10467 unsigned int power_state)
10469 struct alc_spec *spec = codec->spec;
10470 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
10471 return AC_PWRST_D0;
10472 return power_state;
10475 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10476 const struct hda_fixup *fix, int action)
10478 struct alc_spec *spec = codec->spec;
10480 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
10481 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10482 spec->mute_led_polarity = 1;
10483 codec->power_filter = gpio_led_power_filter;
10487 static void alc662_usi_automute_hook(struct hda_codec *codec,
10488 struct hda_jack_callback *jack)
10490 struct alc_spec *spec = codec->spec;
10493 snd_hda_gen_hp_automute(codec, jack);
10495 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10497 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10501 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10502 const struct hda_fixup *fix, int action)
10504 struct alc_spec *spec = codec->spec;
10505 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10506 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10507 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10511 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10512 struct hda_jack_callback *cb)
10514 /* surround speakers at 0x1b already get muted automatically when
10515 * headphones are plugged in, but we have to mute/unmute the remaining
10516 * channels manually:
10517 * 0x15 - front left/front right
10518 * 0x18 - front center/ LFE
10520 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10521 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10522 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10524 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10525 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10529 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10530 const struct hda_fixup *fix, int action)
10532 /* Pin 0x1b: shared headphones jack and surround speakers */
10533 if (!is_jack_detectable(codec, 0x1b))
10537 case HDA_FIXUP_ACT_PRE_PROBE:
10538 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10539 alc662_aspire_ethos_mute_speakers);
10540 /* subwoofer needs an extra GPIO setting to become audible */
10541 alc_setup_gpio(codec, 0x02);
10543 case HDA_FIXUP_ACT_INIT:
10544 /* Make sure to start in a correct state, i.e. if
10545 * headphones have been plugged in before powering up the system
10547 alc662_aspire_ethos_mute_speakers(codec, NULL);
10552 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10553 const struct hda_fixup *fix, int action)
10555 struct alc_spec *spec = codec->spec;
10557 static const struct hda_pintbl pincfgs[] = {
10558 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10559 { 0x1b, 0x0181304f },
10564 case HDA_FIXUP_ACT_PRE_PROBE:
10565 spec->gen.mixer_nid = 0;
10566 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10567 snd_hda_apply_pincfgs(codec, pincfgs);
10569 case HDA_FIXUP_ACT_INIT:
10570 alc_write_coef_idx(codec, 0x19, 0xa054);
10575 static void alc897_hp_automute_hook(struct hda_codec *codec,
10576 struct hda_jack_callback *jack)
10578 struct alc_spec *spec = codec->spec;
10581 snd_hda_gen_hp_automute(codec, jack);
10582 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10583 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10587 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10588 const struct hda_fixup *fix, int action)
10590 struct alc_spec *spec = codec->spec;
10591 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10592 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10596 static const struct coef_fw alc668_coefs[] = {
10597 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10598 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10599 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10600 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10601 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10602 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10603 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10604 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10605 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10606 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10607 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10608 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10609 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10610 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10611 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10612 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10613 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10614 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10615 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10616 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10620 static void alc668_restore_default_value(struct hda_codec *codec)
10622 alc_process_coef_fw(codec, alc668_coefs);
10626 ALC662_FIXUP_ASPIRE,
10627 ALC662_FIXUP_LED_GPIO1,
10628 ALC662_FIXUP_IDEAPAD,
10629 ALC272_FIXUP_MARIO,
10630 ALC662_FIXUP_CZC_ET26,
10631 ALC662_FIXUP_CZC_P10T,
10632 ALC662_FIXUP_SKU_IGNORE,
10633 ALC662_FIXUP_HP_RP5800,
10634 ALC662_FIXUP_ASUS_MODE1,
10635 ALC662_FIXUP_ASUS_MODE2,
10636 ALC662_FIXUP_ASUS_MODE3,
10637 ALC662_FIXUP_ASUS_MODE4,
10638 ALC662_FIXUP_ASUS_MODE5,
10639 ALC662_FIXUP_ASUS_MODE6,
10640 ALC662_FIXUP_ASUS_MODE7,
10641 ALC662_FIXUP_ASUS_MODE8,
10642 ALC662_FIXUP_NO_JACK_DETECT,
10643 ALC662_FIXUP_ZOTAC_Z68,
10644 ALC662_FIXUP_INV_DMIC,
10645 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10646 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10647 ALC662_FIXUP_HEADSET_MODE,
10648 ALC668_FIXUP_HEADSET_MODE,
10649 ALC662_FIXUP_BASS_MODE4_CHMAP,
10650 ALC662_FIXUP_BASS_16,
10651 ALC662_FIXUP_BASS_1A,
10652 ALC662_FIXUP_BASS_CHMAP,
10653 ALC668_FIXUP_AUTO_MUTE,
10654 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10655 ALC668_FIXUP_DELL_XPS13,
10656 ALC662_FIXUP_ASUS_Nx50,
10657 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10658 ALC668_FIXUP_ASUS_Nx51,
10659 ALC668_FIXUP_MIC_COEF,
10660 ALC668_FIXUP_ASUS_G751,
10661 ALC891_FIXUP_HEADSET_MODE,
10662 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10663 ALC662_FIXUP_ACER_VERITON,
10664 ALC892_FIXUP_ASROCK_MOBO,
10665 ALC662_FIXUP_USI_FUNC,
10666 ALC662_FIXUP_USI_HEADSET_MODE,
10667 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10668 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10669 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10670 ALC671_FIXUP_HP_HEADSET_MIC2,
10671 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10672 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10673 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10674 ALC668_FIXUP_HEADSET_MIC,
10675 ALC668_FIXUP_MIC_DET_COEF,
10676 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10677 ALC897_FIXUP_HEADSET_MIC_PIN,
10678 ALC897_FIXUP_HP_HSMIC_VERB,
10681 static const struct hda_fixup alc662_fixups[] = {
10682 [ALC662_FIXUP_ASPIRE] = {
10683 .type = HDA_FIXUP_PINS,
10684 .v.pins = (const struct hda_pintbl[]) {
10685 { 0x15, 0x99130112 }, /* subwoofer */
10689 [ALC662_FIXUP_LED_GPIO1] = {
10690 .type = HDA_FIXUP_FUNC,
10691 .v.func = alc662_fixup_led_gpio1,
10693 [ALC662_FIXUP_IDEAPAD] = {
10694 .type = HDA_FIXUP_PINS,
10695 .v.pins = (const struct hda_pintbl[]) {
10696 { 0x17, 0x99130112 }, /* subwoofer */
10700 .chain_id = ALC662_FIXUP_LED_GPIO1,
10702 [ALC272_FIXUP_MARIO] = {
10703 .type = HDA_FIXUP_FUNC,
10704 .v.func = alc272_fixup_mario,
10706 [ALC662_FIXUP_CZC_ET26] = {
10707 .type = HDA_FIXUP_PINS,
10708 .v.pins = (const struct hda_pintbl[]) {
10709 {0x12, 0x403cc000},
10710 {0x14, 0x90170110}, /* speaker */
10711 {0x15, 0x411111f0},
10712 {0x16, 0x411111f0},
10713 {0x18, 0x01a19030}, /* mic */
10714 {0x19, 0x90a7013f}, /* int-mic */
10715 {0x1a, 0x01014020},
10716 {0x1b, 0x0121401f},
10717 {0x1c, 0x411111f0},
10718 {0x1d, 0x411111f0},
10719 {0x1e, 0x40478e35},
10723 .chain_id = ALC662_FIXUP_SKU_IGNORE
10725 [ALC662_FIXUP_CZC_P10T] = {
10726 .type = HDA_FIXUP_VERBS,
10727 .v.verbs = (const struct hda_verb[]) {
10728 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10732 [ALC662_FIXUP_SKU_IGNORE] = {
10733 .type = HDA_FIXUP_FUNC,
10734 .v.func = alc_fixup_sku_ignore,
10736 [ALC662_FIXUP_HP_RP5800] = {
10737 .type = HDA_FIXUP_PINS,
10738 .v.pins = (const struct hda_pintbl[]) {
10739 { 0x14, 0x0221201f }, /* HP out */
10743 .chain_id = ALC662_FIXUP_SKU_IGNORE
10745 [ALC662_FIXUP_ASUS_MODE1] = {
10746 .type = HDA_FIXUP_PINS,
10747 .v.pins = (const struct hda_pintbl[]) {
10748 { 0x14, 0x99130110 }, /* speaker */
10749 { 0x18, 0x01a19c20 }, /* mic */
10750 { 0x19, 0x99a3092f }, /* int-mic */
10751 { 0x21, 0x0121401f }, /* HP out */
10755 .chain_id = ALC662_FIXUP_SKU_IGNORE
10757 [ALC662_FIXUP_ASUS_MODE2] = {
10758 .type = HDA_FIXUP_PINS,
10759 .v.pins = (const struct hda_pintbl[]) {
10760 { 0x14, 0x99130110 }, /* speaker */
10761 { 0x18, 0x01a19820 }, /* mic */
10762 { 0x19, 0x99a3092f }, /* int-mic */
10763 { 0x1b, 0x0121401f }, /* HP out */
10767 .chain_id = ALC662_FIXUP_SKU_IGNORE
10769 [ALC662_FIXUP_ASUS_MODE3] = {
10770 .type = HDA_FIXUP_PINS,
10771 .v.pins = (const struct hda_pintbl[]) {
10772 { 0x14, 0x99130110 }, /* speaker */
10773 { 0x15, 0x0121441f }, /* HP */
10774 { 0x18, 0x01a19840 }, /* mic */
10775 { 0x19, 0x99a3094f }, /* int-mic */
10776 { 0x21, 0x01211420 }, /* HP2 */
10780 .chain_id = ALC662_FIXUP_SKU_IGNORE
10782 [ALC662_FIXUP_ASUS_MODE4] = {
10783 .type = HDA_FIXUP_PINS,
10784 .v.pins = (const struct hda_pintbl[]) {
10785 { 0x14, 0x99130110 }, /* speaker */
10786 { 0x16, 0x99130111 }, /* speaker */
10787 { 0x18, 0x01a19840 }, /* mic */
10788 { 0x19, 0x99a3094f }, /* int-mic */
10789 { 0x21, 0x0121441f }, /* HP */
10793 .chain_id = ALC662_FIXUP_SKU_IGNORE
10795 [ALC662_FIXUP_ASUS_MODE5] = {
10796 .type = HDA_FIXUP_PINS,
10797 .v.pins = (const struct hda_pintbl[]) {
10798 { 0x14, 0x99130110 }, /* speaker */
10799 { 0x15, 0x0121441f }, /* HP */
10800 { 0x16, 0x99130111 }, /* speaker */
10801 { 0x18, 0x01a19840 }, /* mic */
10802 { 0x19, 0x99a3094f }, /* int-mic */
10806 .chain_id = ALC662_FIXUP_SKU_IGNORE
10808 [ALC662_FIXUP_ASUS_MODE6] = {
10809 .type = HDA_FIXUP_PINS,
10810 .v.pins = (const struct hda_pintbl[]) {
10811 { 0x14, 0x99130110 }, /* speaker */
10812 { 0x15, 0x01211420 }, /* HP2 */
10813 { 0x18, 0x01a19840 }, /* mic */
10814 { 0x19, 0x99a3094f }, /* int-mic */
10815 { 0x1b, 0x0121441f }, /* HP */
10819 .chain_id = ALC662_FIXUP_SKU_IGNORE
10821 [ALC662_FIXUP_ASUS_MODE7] = {
10822 .type = HDA_FIXUP_PINS,
10823 .v.pins = (const struct hda_pintbl[]) {
10824 { 0x14, 0x99130110 }, /* speaker */
10825 { 0x17, 0x99130111 }, /* speaker */
10826 { 0x18, 0x01a19840 }, /* mic */
10827 { 0x19, 0x99a3094f }, /* int-mic */
10828 { 0x1b, 0x01214020 }, /* HP */
10829 { 0x21, 0x0121401f }, /* HP */
10833 .chain_id = ALC662_FIXUP_SKU_IGNORE
10835 [ALC662_FIXUP_ASUS_MODE8] = {
10836 .type = HDA_FIXUP_PINS,
10837 .v.pins = (const struct hda_pintbl[]) {
10838 { 0x14, 0x99130110 }, /* speaker */
10839 { 0x12, 0x99a30970 }, /* int-mic */
10840 { 0x15, 0x01214020 }, /* HP */
10841 { 0x17, 0x99130111 }, /* speaker */
10842 { 0x18, 0x01a19840 }, /* mic */
10843 { 0x21, 0x0121401f }, /* HP */
10847 .chain_id = ALC662_FIXUP_SKU_IGNORE
10849 [ALC662_FIXUP_NO_JACK_DETECT] = {
10850 .type = HDA_FIXUP_FUNC,
10851 .v.func = alc_fixup_no_jack_detect,
10853 [ALC662_FIXUP_ZOTAC_Z68] = {
10854 .type = HDA_FIXUP_PINS,
10855 .v.pins = (const struct hda_pintbl[]) {
10856 { 0x1b, 0x02214020 }, /* Front HP */
10860 [ALC662_FIXUP_INV_DMIC] = {
10861 .type = HDA_FIXUP_FUNC,
10862 .v.func = alc_fixup_inv_dmic,
10864 [ALC668_FIXUP_DELL_XPS13] = {
10865 .type = HDA_FIXUP_FUNC,
10866 .v.func = alc_fixup_dell_xps13,
10868 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10870 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10871 .type = HDA_FIXUP_FUNC,
10872 .v.func = alc_fixup_disable_aamix,
10874 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10876 [ALC668_FIXUP_AUTO_MUTE] = {
10877 .type = HDA_FIXUP_FUNC,
10878 .v.func = alc_fixup_auto_mute_via_amp,
10880 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10882 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10883 .type = HDA_FIXUP_PINS,
10884 .v.pins = (const struct hda_pintbl[]) {
10885 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10886 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10890 .chain_id = ALC662_FIXUP_HEADSET_MODE
10892 [ALC662_FIXUP_HEADSET_MODE] = {
10893 .type = HDA_FIXUP_FUNC,
10894 .v.func = alc_fixup_headset_mode_alc662,
10896 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10897 .type = HDA_FIXUP_PINS,
10898 .v.pins = (const struct hda_pintbl[]) {
10899 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10900 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10904 .chain_id = ALC668_FIXUP_HEADSET_MODE
10906 [ALC668_FIXUP_HEADSET_MODE] = {
10907 .type = HDA_FIXUP_FUNC,
10908 .v.func = alc_fixup_headset_mode_alc668,
10910 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
10911 .type = HDA_FIXUP_FUNC,
10912 .v.func = alc_fixup_bass_chmap,
10914 .chain_id = ALC662_FIXUP_ASUS_MODE4
10916 [ALC662_FIXUP_BASS_16] = {
10917 .type = HDA_FIXUP_PINS,
10918 .v.pins = (const struct hda_pintbl[]) {
10919 {0x16, 0x80106111}, /* bass speaker */
10923 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10925 [ALC662_FIXUP_BASS_1A] = {
10926 .type = HDA_FIXUP_PINS,
10927 .v.pins = (const struct hda_pintbl[]) {
10928 {0x1a, 0x80106111}, /* bass speaker */
10932 .chain_id = ALC662_FIXUP_BASS_CHMAP,
10934 [ALC662_FIXUP_BASS_CHMAP] = {
10935 .type = HDA_FIXUP_FUNC,
10936 .v.func = alc_fixup_bass_chmap,
10938 [ALC662_FIXUP_ASUS_Nx50] = {
10939 .type = HDA_FIXUP_FUNC,
10940 .v.func = alc_fixup_auto_mute_via_amp,
10942 .chain_id = ALC662_FIXUP_BASS_1A
10944 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
10945 .type = HDA_FIXUP_FUNC,
10946 .v.func = alc_fixup_headset_mode_alc668,
10947 .chain_id = ALC662_FIXUP_BASS_CHMAP
10949 [ALC668_FIXUP_ASUS_Nx51] = {
10950 .type = HDA_FIXUP_PINS,
10951 .v.pins = (const struct hda_pintbl[]) {
10952 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10953 { 0x1a, 0x90170151 }, /* bass speaker */
10954 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10958 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10960 [ALC668_FIXUP_MIC_COEF] = {
10961 .type = HDA_FIXUP_VERBS,
10962 .v.verbs = (const struct hda_verb[]) {
10963 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
10964 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
10968 [ALC668_FIXUP_ASUS_G751] = {
10969 .type = HDA_FIXUP_PINS,
10970 .v.pins = (const struct hda_pintbl[]) {
10971 { 0x16, 0x0421101f }, /* HP */
10975 .chain_id = ALC668_FIXUP_MIC_COEF
10977 [ALC891_FIXUP_HEADSET_MODE] = {
10978 .type = HDA_FIXUP_FUNC,
10979 .v.func = alc_fixup_headset_mode,
10981 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
10982 .type = HDA_FIXUP_PINS,
10983 .v.pins = (const struct hda_pintbl[]) {
10984 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10985 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10989 .chain_id = ALC891_FIXUP_HEADSET_MODE
10991 [ALC662_FIXUP_ACER_VERITON] = {
10992 .type = HDA_FIXUP_PINS,
10993 .v.pins = (const struct hda_pintbl[]) {
10994 { 0x15, 0x50170120 }, /* no internal speaker */
10998 [ALC892_FIXUP_ASROCK_MOBO] = {
10999 .type = HDA_FIXUP_PINS,
11000 .v.pins = (const struct hda_pintbl[]) {
11001 { 0x15, 0x40f000f0 }, /* disabled */
11002 { 0x16, 0x40f000f0 }, /* disabled */
11006 [ALC662_FIXUP_USI_FUNC] = {
11007 .type = HDA_FIXUP_FUNC,
11008 .v.func = alc662_fixup_usi_headset_mic,
11010 [ALC662_FIXUP_USI_HEADSET_MODE] = {
11011 .type = HDA_FIXUP_PINS,
11012 .v.pins = (const struct hda_pintbl[]) {
11013 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11014 { 0x18, 0x01a1903d },
11018 .chain_id = ALC662_FIXUP_USI_FUNC
11020 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11021 .type = HDA_FIXUP_FUNC,
11022 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11024 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11025 .type = HDA_FIXUP_FUNC,
11026 .v.func = alc662_fixup_aspire_ethos_hp,
11028 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11029 .type = HDA_FIXUP_PINS,
11030 .v.pins = (const struct hda_pintbl[]) {
11031 { 0x15, 0x92130110 }, /* front speakers */
11032 { 0x18, 0x99130111 }, /* center/subwoofer */
11033 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
11037 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
11039 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
11040 .type = HDA_FIXUP_FUNC,
11041 .v.func = alc671_fixup_hp_headset_mic2,
11043 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11044 .type = HDA_FIXUP_PINS,
11045 .v.pins = (const struct hda_pintbl[]) {
11046 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11050 .chain_id = ALC662_FIXUP_USI_FUNC
11052 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11053 .type = HDA_FIXUP_PINS,
11054 .v.pins = (const struct hda_pintbl[]) {
11055 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11056 { 0x1b, 0x0221144f },
11060 .chain_id = ALC662_FIXUP_USI_FUNC
11062 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11063 .type = HDA_FIXUP_PINS,
11064 .v.pins = (const struct hda_pintbl[]) {
11065 { 0x1b, 0x04a1112c },
11069 .chain_id = ALC668_FIXUP_HEADSET_MIC
11071 [ALC668_FIXUP_HEADSET_MIC] = {
11072 .type = HDA_FIXUP_FUNC,
11073 .v.func = alc269_fixup_headset_mic,
11075 .chain_id = ALC668_FIXUP_MIC_DET_COEF
11077 [ALC668_FIXUP_MIC_DET_COEF] = {
11078 .type = HDA_FIXUP_VERBS,
11079 .v.verbs = (const struct hda_verb[]) {
11080 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11081 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11085 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11086 .type = HDA_FIXUP_FUNC,
11087 .v.func = alc897_fixup_lenovo_headset_mic,
11089 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
11090 .type = HDA_FIXUP_PINS,
11091 .v.pins = (const struct hda_pintbl[]) {
11092 { 0x1a, 0x03a11050 },
11096 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11098 [ALC897_FIXUP_HP_HSMIC_VERB] = {
11099 .type = HDA_FIXUP_PINS,
11100 .v.pins = (const struct hda_pintbl[]) {
11101 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11107 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
11108 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
11109 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
11110 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
11111 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
11112 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
11113 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
11114 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
11115 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
11116 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
11117 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
11118 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
11119 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11120 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11121 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
11122 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
11123 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
11124 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11125 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11126 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11127 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11128 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11129 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11130 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11131 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
11132 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
11133 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
11134 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
11135 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
11136 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11137 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
11138 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
11139 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11140 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
11141 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11142 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
11143 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
11144 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
11145 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
11146 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11147 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
11148 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
11149 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
11150 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
11151 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
11152 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
11153 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11154 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11155 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11156 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
11157 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
11158 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
11159 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
11160 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
11161 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
11162 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
11163 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11166 /* Below is a quirk table taken from the old code.
11167 * Basically the device should work as is without the fixup table.
11168 * If BIOS doesn't give a proper info, enable the corresponding
11171 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11172 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11173 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11174 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11175 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11176 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11177 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11178 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11179 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11180 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11181 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11182 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11183 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11184 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11185 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11186 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11187 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11188 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11189 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11190 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11191 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11192 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11193 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11194 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11195 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11196 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11197 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11198 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11199 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11200 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11201 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11202 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11203 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11204 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11205 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11206 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11207 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11208 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11209 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11210 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11211 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11212 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11213 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11214 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11215 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11216 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11217 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11218 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11219 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11220 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11225 static const struct hda_model_fixup alc662_fixup_models[] = {
11226 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11227 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
11228 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
11229 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
11230 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11231 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11232 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11233 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11234 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11235 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11236 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11237 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
11238 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
11239 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
11240 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
11241 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11242 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11243 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11244 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11245 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11246 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11247 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11248 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11249 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
11250 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
11251 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11252 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11253 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11254 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11255 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
11256 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11257 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
11261 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
11262 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11263 {0x17, 0x02211010},
11264 {0x18, 0x01a19030},
11265 {0x1a, 0x01813040},
11266 {0x21, 0x01014020}),
11267 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11268 {0x16, 0x01813030},
11269 {0x17, 0x02211010},
11270 {0x18, 0x01a19040},
11271 {0x21, 0x01014020}),
11272 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11273 {0x14, 0x01014010},
11274 {0x18, 0x01a19020},
11275 {0x1a, 0x0181302f},
11276 {0x1b, 0x0221401f}),
11277 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11278 {0x12, 0x99a30130},
11279 {0x14, 0x90170110},
11280 {0x15, 0x0321101f},
11281 {0x16, 0x03011020}),
11282 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11283 {0x12, 0x99a30140},
11284 {0x14, 0x90170110},
11285 {0x15, 0x0321101f},
11286 {0x16, 0x03011020}),
11287 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11288 {0x12, 0x99a30150},
11289 {0x14, 0x90170110},
11290 {0x15, 0x0321101f},
11291 {0x16, 0x03011020}),
11292 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11293 {0x14, 0x90170110},
11294 {0x15, 0x0321101f},
11295 {0x16, 0x03011020}),
11296 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11297 {0x12, 0x90a60130},
11298 {0x14, 0x90170110},
11299 {0x15, 0x0321101f}),
11300 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11301 {0x14, 0x01014010},
11302 {0x17, 0x90170150},
11303 {0x19, 0x02a11060},
11304 {0x1b, 0x01813030},
11305 {0x21, 0x02211020}),
11306 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11307 {0x14, 0x01014010},
11308 {0x18, 0x01a19040},
11309 {0x1b, 0x01813030},
11310 {0x21, 0x02211020}),
11311 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11312 {0x14, 0x01014020},
11313 {0x17, 0x90170110},
11314 {0x18, 0x01a19050},
11315 {0x1b, 0x01813040},
11316 {0x21, 0x02211030}),
11322 static int patch_alc662(struct hda_codec *codec)
11324 struct alc_spec *spec;
11327 err = alc_alloc_spec(codec, 0x0b);
11331 spec = codec->spec;
11333 spec->shutup = alc_eapd_shutup;
11335 /* handle multiple HPs as is */
11336 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11338 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11340 switch (codec->core.vendor_id) {
11342 spec->init_hook = alc668_restore_default_value;
11346 alc_pre_init(codec);
11348 snd_hda_pick_fixup(codec, alc662_fixup_models,
11349 alc662_fixup_tbl, alc662_fixups);
11350 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
11351 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11353 alc_auto_parse_customize_define(codec);
11355 if (has_cdefine_beep(codec))
11356 spec->gen.beep_nid = 0x01;
11358 if ((alc_get_coef0(codec) & (1 << 14)) &&
11359 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
11360 spec->cdefine.platform_type == 1) {
11361 err = alc_codec_rename(codec, "ALC272X");
11366 /* automatic parse from the BIOS config */
11367 err = alc662_parse_auto_config(codec);
11371 if (!spec->gen.no_analog && spec->gen.beep_nid) {
11372 switch (codec->core.vendor_id) {
11374 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11380 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
11383 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
11390 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11403 static int alc680_parse_auto_config(struct hda_codec *codec)
11405 return alc_parse_auto_config(codec, NULL, NULL);
11410 static int patch_alc680(struct hda_codec *codec)
11414 /* ALC680 has no aa-loopback mixer */
11415 err = alc_alloc_spec(codec, 0);
11419 /* automatic parse from the BIOS config */
11420 err = alc680_parse_auto_config(codec);
11432 static const struct hda_device_id snd_hda_id_realtek[] = {
11433 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
11434 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
11435 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
11436 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
11437 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
11438 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11439 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
11440 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
11441 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
11442 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
11443 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
11444 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11445 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
11446 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
11447 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11448 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11449 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11450 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11451 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11452 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11453 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
11454 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
11455 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11456 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11457 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11458 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11459 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11460 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
11461 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
11462 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
11463 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
11464 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
11465 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
11466 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11467 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11468 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
11469 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
11470 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
11471 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
11472 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
11473 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
11474 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
11475 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11476 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11477 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11478 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11479 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11480 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11481 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11482 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11483 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11484 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11485 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11486 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11487 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11488 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
11489 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11490 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11491 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
11492 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
11493 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
11494 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11495 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11496 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11497 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11498 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11499 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11500 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11501 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11502 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11503 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11504 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
11505 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
11506 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11507 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
11508 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
11509 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
11510 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
11511 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
11512 {} /* terminator */
11514 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
11516 MODULE_LICENSE("GPL");
11517 MODULE_DESCRIPTION("Realtek HD-audio codec");
11519 static struct hda_codec_driver realtek_driver = {
11520 .id = snd_hda_id_realtek,
11523 module_hda_codec_driver(realtek_driver);