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);
3561 if (spec->ultra_low_power) {
3562 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3563 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3564 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3565 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3566 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3575 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3580 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3582 snd_hda_codec_write(codec, hp_pin, 0,
3583 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3585 if (hp_pin_sense || spec->ultra_low_power)
3588 snd_hda_codec_write(codec, hp_pin, 0,
3589 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3591 if (hp_pin_sense || spec->ultra_low_power)
3594 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3595 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3596 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3597 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3599 * Expose headphone mic (or possibly Line In on some machines) instead
3600 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3601 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3604 alc_write_coef_idx(codec, 0x36, 0x5757);
3607 static void alc256_shutup(struct hda_codec *codec)
3609 struct alc_spec *spec = codec->spec;
3610 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3616 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3621 snd_hda_codec_write(codec, hp_pin, 0,
3622 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3624 if (hp_pin_sense || spec->ultra_low_power)
3627 /* 3k pull low control for Headset jack. */
3628 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3629 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3630 * when booting with headset plugged. So skip setting it for the codec alc257
3632 if (codec->core.vendor_id != 0x10ec0236 &&
3633 codec->core.vendor_id != 0x10ec0257)
3634 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3636 if (!spec->no_shutup_pins)
3637 snd_hda_codec_write(codec, hp_pin, 0,
3638 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3640 if (hp_pin_sense || spec->ultra_low_power)
3643 alc_auto_setup_eapd(codec, false);
3644 alc_shutup_pins(codec);
3645 if (spec->ultra_low_power) {
3647 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3648 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3649 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3650 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3651 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3656 static void alc285_hp_init(struct hda_codec *codec)
3658 struct alc_spec *spec = codec->spec;
3659 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3661 int coef38, coef0d, coef36;
3663 alc_update_coef_idx(codec, 0x4a, 1<<15, 1<<15); /* Reset HP JD */
3664 coef38 = alc_read_coef_idx(codec, 0x38); /* Amp control */
3665 coef0d = alc_read_coef_idx(codec, 0x0d); /* Digital Misc control */
3666 coef36 = alc_read_coef_idx(codec, 0x36); /* Passthrough Control */
3667 alc_update_coef_idx(codec, 0x38, 1<<4, 0x0);
3668 alc_update_coef_idx(codec, 0x0d, 0x110, 0x0);
3670 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
3673 snd_hda_codec_write(codec, hp_pin, 0,
3674 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3677 alc_update_coef_idx(codec, 0x36, 1<<14, 1<<14);
3678 alc_update_coef_idx(codec, 0x36, 1<<13, 0x0);
3681 snd_hda_codec_write(codec, hp_pin, 0,
3682 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3684 alc_write_coef_idx(codec, 0x67, 0x0); /* Set HP depop to manual mode */
3685 alc_write_coefex_idx(codec, 0x58, 0x00, 0x7880);
3686 alc_write_coefex_idx(codec, 0x58, 0x0f, 0xf049);
3687 alc_update_coefex_idx(codec, 0x58, 0x03, 0x00f0, 0x00c0);
3689 alc_write_coefex_idx(codec, 0x58, 0x00, 0xf888); /* HP depop procedure start */
3690 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3691 for (i = 0; i < 20 && val & 0x8000; i++) {
3693 val = alc_read_coefex_idx(codec, 0x58, 0x00);
3694 } /* Wait for depop procedure finish */
3696 alc_write_coefex_idx(codec, 0x58, 0x00, val); /* write back the result */
3697 alc_update_coef_idx(codec, 0x38, 1<<4, coef38);
3698 alc_update_coef_idx(codec, 0x0d, 0x110, coef0d);
3699 alc_update_coef_idx(codec, 0x36, 3<<13, coef36);
3702 alc_update_coef_idx(codec, 0x4a, 1<<15, 0);
3705 static void alc225_init(struct hda_codec *codec)
3707 struct alc_spec *spec = codec->spec;
3708 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3709 bool hp1_pin_sense, hp2_pin_sense;
3711 if (spec->ultra_low_power) {
3712 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3713 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3714 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3718 if (spec->codec_variant != ALC269_TYPE_ALC287 &&
3719 spec->codec_variant != ALC269_TYPE_ALC245)
3720 /* required only at boot or S3 and S4 resume time */
3721 if (!spec->done_hp_init ||
3722 is_s3_resume(codec) ||
3723 is_s4_resume(codec)) {
3724 alc285_hp_init(codec);
3725 spec->done_hp_init = true;
3732 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3733 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3735 if (hp1_pin_sense || hp2_pin_sense)
3738 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3740 if (hp1_pin_sense || spec->ultra_low_power)
3741 snd_hda_codec_write(codec, hp_pin, 0,
3742 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3744 snd_hda_codec_write(codec, 0x16, 0,
3745 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3747 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3750 if (hp1_pin_sense || spec->ultra_low_power)
3751 snd_hda_codec_write(codec, hp_pin, 0,
3752 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3754 snd_hda_codec_write(codec, 0x16, 0,
3755 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3757 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3760 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3761 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3764 static void alc225_shutup(struct hda_codec *codec)
3766 struct alc_spec *spec = codec->spec;
3767 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3768 bool hp1_pin_sense, hp2_pin_sense;
3773 alc_disable_headset_jack_key(codec);
3774 /* 3k pull low control for Headset jack. */
3775 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3777 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3778 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3780 if (hp1_pin_sense || hp2_pin_sense)
3783 if (hp1_pin_sense || spec->ultra_low_power)
3784 snd_hda_codec_write(codec, hp_pin, 0,
3785 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3787 snd_hda_codec_write(codec, 0x16, 0,
3788 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3790 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3793 if (hp1_pin_sense || spec->ultra_low_power)
3794 snd_hda_codec_write(codec, hp_pin, 0,
3795 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3797 snd_hda_codec_write(codec, 0x16, 0,
3798 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3800 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3803 alc_auto_setup_eapd(codec, false);
3804 alc_shutup_pins(codec);
3805 if (spec->ultra_low_power) {
3807 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3808 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3809 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3810 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3814 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3815 alc_enable_headset_jack_key(codec);
3818 static void alc_default_init(struct hda_codec *codec)
3820 struct alc_spec *spec = codec->spec;
3821 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3829 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3834 snd_hda_codec_write(codec, hp_pin, 0,
3835 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3840 snd_hda_codec_write(codec, hp_pin, 0,
3841 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3847 static void alc_default_shutup(struct hda_codec *codec)
3849 struct alc_spec *spec = codec->spec;
3850 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3854 alc269_shutup(codec);
3858 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3863 snd_hda_codec_write(codec, hp_pin, 0,
3864 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3869 if (!spec->no_shutup_pins)
3870 snd_hda_codec_write(codec, hp_pin, 0,
3871 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3876 alc_auto_setup_eapd(codec, false);
3877 alc_shutup_pins(codec);
3880 static void alc294_hp_init(struct hda_codec *codec)
3882 struct alc_spec *spec = codec->spec;
3883 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3889 snd_hda_codec_write(codec, hp_pin, 0,
3890 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3894 if (!spec->no_shutup_pins)
3895 snd_hda_codec_write(codec, hp_pin, 0,
3896 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3898 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3899 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3901 /* Wait for depop procedure finish */
3902 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3903 for (i = 0; i < 20 && val & 0x0080; i++) {
3905 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3907 /* Set HP depop to auto mode */
3908 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3912 static void alc294_init(struct hda_codec *codec)
3914 struct alc_spec *spec = codec->spec;
3916 /* required only at boot or S4 resume time */
3917 if (!spec->done_hp_init ||
3918 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3919 alc294_hp_init(codec);
3920 spec->done_hp_init = true;
3922 alc_default_init(codec);
3925 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3928 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3929 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3930 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3933 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3937 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3938 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3940 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3945 static void alc5505_dsp_halt(struct hda_codec *codec)
3949 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3950 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3951 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3952 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3953 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3954 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3955 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3956 val = alc5505_coef_get(codec, 0x6220);
3957 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3960 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3962 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3963 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3964 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3965 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3966 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3967 alc5505_coef_set(codec, 0x880c, 0x00000004);
3970 static void alc5505_dsp_init(struct hda_codec *codec)
3974 alc5505_dsp_halt(codec);
3975 alc5505_dsp_back_from_halt(codec);
3976 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3977 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3978 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3979 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3980 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3981 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3982 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3983 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3984 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3985 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3986 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3987 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3988 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3990 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3992 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3994 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3996 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3997 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3998 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3999 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
4000 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
4001 alc5505_coef_set(codec, 0x880c, 0x00000003);
4002 alc5505_coef_set(codec, 0x880c, 0x00000010);
4004 #ifdef HALT_REALTEK_ALC5505
4005 alc5505_dsp_halt(codec);
4009 #ifdef HALT_REALTEK_ALC5505
4010 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
4011 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
4013 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
4014 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
4018 static int alc269_suspend(struct hda_codec *codec)
4020 struct alc_spec *spec = codec->spec;
4022 if (spec->has_alc5505_dsp)
4023 alc5505_dsp_suspend(codec);
4024 return alc_suspend(codec);
4027 static int alc269_resume(struct hda_codec *codec)
4029 struct alc_spec *spec = codec->spec;
4031 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4032 alc269vb_toggle_power_output(codec, 0);
4033 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4034 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
4038 codec->patch_ops.init(codec);
4040 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
4041 alc269vb_toggle_power_output(codec, 1);
4042 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
4043 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
4047 snd_hda_regmap_sync(codec);
4048 hda_call_check_power_status(codec, 0x01);
4050 /* on some machine, the BIOS will clear the codec gpio data when enter
4051 * suspend, and won't restore the data after resume, so we restore it
4054 if (spec->gpio_data)
4055 alc_write_gpio_data(codec);
4057 if (spec->has_alc5505_dsp)
4058 alc5505_dsp_resume(codec);
4062 #endif /* CONFIG_PM */
4064 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
4065 const struct hda_fixup *fix, int action)
4067 struct alc_spec *spec = codec->spec;
4069 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4070 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
4073 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
4074 const struct hda_fixup *fix,
4077 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
4078 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
4080 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
4081 snd_hda_codec_set_pincfg(codec, 0x19,
4082 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
4083 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
4086 static void alc269_fixup_hweq(struct hda_codec *codec,
4087 const struct hda_fixup *fix, int action)
4089 if (action == HDA_FIXUP_ACT_INIT)
4090 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
4093 static void alc269_fixup_headset_mic(struct hda_codec *codec,
4094 const struct hda_fixup *fix, int action)
4096 struct alc_spec *spec = codec->spec;
4098 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4099 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4102 static void alc271_fixup_dmic(struct hda_codec *codec,
4103 const struct hda_fixup *fix, int action)
4105 static const struct hda_verb verbs[] = {
4106 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
4107 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
4112 if (strcmp(codec->core.chip_name, "ALC271X") &&
4113 strcmp(codec->core.chip_name, "ALC269VB"))
4115 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
4116 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
4117 snd_hda_sequence_write(codec, verbs);
4120 /* Fix the speaker amp after resume, etc */
4121 static void alc269vb_fixup_aspire_e1_coef(struct hda_codec *codec,
4122 const struct hda_fixup *fix,
4125 if (action == HDA_FIXUP_ACT_INIT)
4126 alc_update_coef_idx(codec, 0x0d, 0x6000, 0x6000);
4129 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
4130 const struct hda_fixup *fix, int action)
4132 struct alc_spec *spec = codec->spec;
4134 if (action != HDA_FIXUP_ACT_PROBE)
4137 /* Due to a hardware problem on Lenovo Ideadpad, we need to
4138 * fix the sample rate of analog I/O to 44.1kHz
4140 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
4141 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
4144 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
4145 const struct hda_fixup *fix, int action)
4147 /* The digital-mic unit sends PDM (differential signal) instead of
4148 * the standard PCM, thus you can't record a valid mono stream as is.
4149 * Below is a workaround specific to ALC269 to control the dmic
4150 * signal source as mono.
4152 if (action == HDA_FIXUP_ACT_INIT)
4153 alc_update_coef_idx(codec, 0x07, 0, 0x80);
4156 static void alc269_quanta_automute(struct hda_codec *codec)
4158 snd_hda_gen_update_outputs(codec);
4160 alc_write_coef_idx(codec, 0x0c, 0x680);
4161 alc_write_coef_idx(codec, 0x0c, 0x480);
4164 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
4165 const struct hda_fixup *fix, int action)
4167 struct alc_spec *spec = codec->spec;
4168 if (action != HDA_FIXUP_ACT_PROBE)
4170 spec->gen.automute_hook = alc269_quanta_automute;
4173 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
4174 struct hda_jack_callback *jack)
4176 struct alc_spec *spec = codec->spec;
4179 snd_hda_gen_hp_automute(codec, jack);
4181 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
4183 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4186 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
4191 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
4193 struct hda_alc298_mbxinit {
4194 unsigned char value_0x23;
4195 unsigned char value_0x25;
4198 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
4199 const struct hda_alc298_mbxinit *initval,
4202 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
4203 alc_write_coef_idx(codec, 0x26, 0xb000);
4206 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
4208 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4209 alc_write_coef_idx(codec, 0x26, 0xf000);
4210 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
4212 if (initval->value_0x23 != 0x1e)
4213 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
4215 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4216 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4219 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
4220 const struct hda_fixup *fix,
4223 /* Initialization magic */
4224 static const struct hda_alc298_mbxinit dac_init[] = {
4225 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4226 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4227 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4228 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4229 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4230 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4232 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4233 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4234 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4237 const struct hda_alc298_mbxinit *seq;
4239 if (action != HDA_FIXUP_ACT_INIT)
4243 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
4244 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
4245 alc_write_coef_idx(codec, 0x26, 0xf000);
4246 alc_write_coef_idx(codec, 0x22, 0x31);
4247 alc_write_coef_idx(codec, 0x23, 0x0b);
4248 alc_write_coef_idx(codec, 0x25, 0x00);
4249 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
4250 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
4252 for (seq = dac_init; seq->value_0x23; seq++)
4253 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
4256 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
4257 const struct hda_fixup *fix, int action)
4259 struct alc_spec *spec = codec->spec;
4260 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4261 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4262 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
4266 static void alc_update_vref_led(struct hda_codec *codec, hda_nid_t pin,
4267 bool polarity, bool on)
4269 unsigned int pinval;
4275 pinval = snd_hda_codec_get_pin_target(codec, pin);
4276 pinval &= ~AC_PINCTL_VREFEN;
4277 pinval |= on ? AC_PINCTL_VREF_80 : AC_PINCTL_VREF_HIZ;
4278 /* temporarily power up/down for setting VREF */
4279 snd_hda_power_up_pm(codec);
4280 snd_hda_set_pin_ctl_cache(codec, pin, pinval);
4281 snd_hda_power_down_pm(codec);
4284 /* update mute-LED according to the speaker mute state via mic VREF pin */
4285 static int vref_mute_led_set(struct led_classdev *led_cdev,
4286 enum led_brightness brightness)
4288 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4289 struct alc_spec *spec = codec->spec;
4291 alc_update_vref_led(codec, spec->mute_led_nid,
4292 spec->mute_led_polarity, brightness);
4296 /* Make sure the led works even in runtime suspend */
4297 static unsigned int led_power_filter(struct hda_codec *codec,
4299 unsigned int power_state)
4301 struct alc_spec *spec = codec->spec;
4303 if (power_state != AC_PWRST_D3 || nid == 0 ||
4304 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4307 /* Set pin ctl again, it might have just been set to 0 */
4308 snd_hda_set_pin_ctl(codec, nid,
4309 snd_hda_codec_get_pin_target(codec, nid));
4311 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4314 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4315 const struct hda_fixup *fix, int action)
4317 struct alc_spec *spec = codec->spec;
4318 const struct dmi_device *dev = NULL;
4320 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4323 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4325 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4327 if (pin < 0x0a || pin >= 0x10)
4329 spec->mute_led_polarity = pol;
4330 spec->mute_led_nid = pin - 0x0a + 0x18;
4331 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4332 codec->power_filter = led_power_filter;
4334 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4335 spec->mute_led_polarity);
4340 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4341 const struct hda_fixup *fix,
4342 int action, hda_nid_t pin)
4344 struct alc_spec *spec = codec->spec;
4346 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4347 spec->mute_led_polarity = 0;
4348 spec->mute_led_nid = pin;
4349 snd_hda_gen_add_mute_led_cdev(codec, vref_mute_led_set);
4350 codec->power_filter = led_power_filter;
4354 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4355 const struct hda_fixup *fix, int action)
4357 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4360 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4361 const struct hda_fixup *fix, int action)
4363 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4366 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4367 const struct hda_fixup *fix, int action)
4369 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4372 /* update LED status via GPIO */
4373 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4374 int polarity, bool enabled)
4378 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4381 /* turn on/off mute LED via GPIO per vmaster hook */
4382 static int gpio_mute_led_set(struct led_classdev *led_cdev,
4383 enum led_brightness brightness)
4385 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4386 struct alc_spec *spec = codec->spec;
4388 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4389 spec->mute_led_polarity, !brightness);
4393 /* turn on/off mic-mute LED via GPIO per capture hook */
4394 static int micmute_led_set(struct led_classdev *led_cdev,
4395 enum led_brightness brightness)
4397 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4398 struct alc_spec *spec = codec->spec;
4400 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4401 spec->micmute_led_polarity, !brightness);
4405 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4406 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4408 unsigned int mute_mask,
4409 unsigned int micmute_mask)
4411 struct alc_spec *spec = codec->spec;
4413 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4415 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4418 spec->gpio_mute_led_mask = mute_mask;
4419 snd_hda_gen_add_mute_led_cdev(codec, gpio_mute_led_set);
4422 spec->gpio_mic_led_mask = micmute_mask;
4423 snd_hda_gen_add_micmute_led_cdev(codec, micmute_led_set);
4427 static void alc236_fixup_hp_gpio_led(struct hda_codec *codec,
4428 const struct hda_fixup *fix, int action)
4430 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x01);
4433 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4434 const struct hda_fixup *fix, int action)
4436 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4439 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4440 const struct hda_fixup *fix, int action)
4442 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4445 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4446 const struct hda_fixup *fix, int action)
4448 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4451 static void alc287_fixup_hp_gpio_led(struct hda_codec *codec,
4452 const struct hda_fixup *fix, int action)
4454 alc_fixup_hp_gpio_led(codec, action, 0x10, 0);
4457 static void alc245_fixup_hp_gpio_led(struct hda_codec *codec,
4458 const struct hda_fixup *fix, int action)
4460 struct alc_spec *spec = codec->spec;
4462 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4463 spec->micmute_led_polarity = 1;
4464 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4467 /* turn on/off mic-mute LED per capture hook via VREF change */
4468 static int vref_micmute_led_set(struct led_classdev *led_cdev,
4469 enum led_brightness brightness)
4471 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4472 struct alc_spec *spec = codec->spec;
4474 alc_update_vref_led(codec, spec->cap_mute_led_nid,
4475 spec->micmute_led_polarity, brightness);
4479 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4480 const struct hda_fixup *fix, int action)
4482 struct alc_spec *spec = codec->spec;
4484 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4485 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4486 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4487 * enable headphone amp
4489 spec->gpio_mask |= 0x10;
4490 spec->gpio_dir |= 0x10;
4491 spec->cap_mute_led_nid = 0x18;
4492 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4493 codec->power_filter = led_power_filter;
4497 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4498 const struct hda_fixup *fix, int action)
4500 struct alc_spec *spec = codec->spec;
4502 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4503 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4504 spec->cap_mute_led_nid = 0x18;
4505 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4506 codec->power_filter = led_power_filter;
4510 /* HP Spectre x360 14 model needs a unique workaround for enabling the amp;
4511 * it needs to toggle the GPIO0 once on and off at each time (bko#210633)
4513 static void alc245_fixup_hp_x360_amp(struct hda_codec *codec,
4514 const struct hda_fixup *fix, int action)
4516 struct alc_spec *spec = codec->spec;
4519 case HDA_FIXUP_ACT_PRE_PROBE:
4520 spec->gpio_mask |= 0x01;
4521 spec->gpio_dir |= 0x01;
4523 case HDA_FIXUP_ACT_INIT:
4524 /* need to toggle GPIO to enable the amp */
4525 alc_update_gpio_data(codec, 0x01, true);
4527 alc_update_gpio_data(codec, 0x01, false);
4532 /* toggle GPIO2 at each time stream is started; we use PREPARE state instead */
4533 static void alc274_hp_envy_pcm_hook(struct hda_pcm_stream *hinfo,
4534 struct hda_codec *codec,
4535 struct snd_pcm_substream *substream,
4539 case HDA_GEN_PCM_ACT_PREPARE:
4540 alc_update_gpio_data(codec, 0x04, true);
4542 case HDA_GEN_PCM_ACT_CLEANUP:
4543 alc_update_gpio_data(codec, 0x04, false);
4548 static void alc274_fixup_hp_envy_gpio(struct hda_codec *codec,
4549 const struct hda_fixup *fix,
4552 struct alc_spec *spec = codec->spec;
4554 if (action == HDA_FIXUP_ACT_PROBE) {
4555 spec->gpio_mask |= 0x04;
4556 spec->gpio_dir |= 0x04;
4557 spec->gen.pcm_playback_hook = alc274_hp_envy_pcm_hook;
4561 static void alc_update_coef_led(struct hda_codec *codec,
4562 struct alc_coef_led *led,
4563 bool polarity, bool on)
4567 /* temporarily power up/down for setting COEF bit */
4568 alc_update_coef_idx(codec, led->idx, led->mask,
4569 on ? led->on : led->off);
4572 /* update mute-LED according to the speaker mute state via COEF bit */
4573 static int coef_mute_led_set(struct led_classdev *led_cdev,
4574 enum led_brightness brightness)
4576 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4577 struct alc_spec *spec = codec->spec;
4579 alc_update_coef_led(codec, &spec->mute_led_coef,
4580 spec->mute_led_polarity, brightness);
4584 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4585 const struct hda_fixup *fix,
4588 struct alc_spec *spec = codec->spec;
4590 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4591 spec->mute_led_polarity = 0;
4592 spec->mute_led_coef.idx = 0x0b;
4593 spec->mute_led_coef.mask = 1 << 3;
4594 spec->mute_led_coef.on = 1 << 3;
4595 spec->mute_led_coef.off = 0;
4596 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4600 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4601 const struct hda_fixup *fix,
4604 struct alc_spec *spec = codec->spec;
4606 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4607 spec->mute_led_polarity = 0;
4608 spec->mute_led_coef.idx = 0x34;
4609 spec->mute_led_coef.mask = 1 << 5;
4610 spec->mute_led_coef.on = 0;
4611 spec->mute_led_coef.off = 1 << 5;
4612 snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
4616 /* turn on/off mic-mute LED per capture hook by coef bit */
4617 static int coef_micmute_led_set(struct led_classdev *led_cdev,
4618 enum led_brightness brightness)
4620 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4621 struct alc_spec *spec = codec->spec;
4623 alc_update_coef_led(codec, &spec->mic_led_coef,
4624 spec->micmute_led_polarity, brightness);
4628 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4629 const struct hda_fixup *fix, int action)
4631 struct alc_spec *spec = codec->spec;
4633 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4634 spec->mic_led_coef.idx = 0x19;
4635 spec->mic_led_coef.mask = 1 << 13;
4636 spec->mic_led_coef.on = 1 << 13;
4637 spec->mic_led_coef.off = 0;
4638 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4642 static void alc285_fixup_hp_gpio_micmute_led(struct hda_codec *codec,
4643 const struct hda_fixup *fix, int action)
4645 struct alc_spec *spec = codec->spec;
4647 if (action == HDA_FIXUP_ACT_PRE_PROBE)
4648 spec->micmute_led_polarity = 1;
4649 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4652 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4653 const struct hda_fixup *fix, int action)
4655 struct alc_spec *spec = codec->spec;
4657 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4658 spec->mic_led_coef.idx = 0x35;
4659 spec->mic_led_coef.mask = 3 << 2;
4660 spec->mic_led_coef.on = 2 << 2;
4661 spec->mic_led_coef.off = 1 << 2;
4662 snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
4666 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4667 const struct hda_fixup *fix, int action)
4669 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4670 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4673 static void alc285_fixup_hp_spectre_x360_mute_led(struct hda_codec *codec,
4674 const struct hda_fixup *fix, int action)
4676 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4677 alc285_fixup_hp_gpio_micmute_led(codec, fix, action);
4680 static void alc236_fixup_hp_mute_led(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_coef_micmute_led(codec, fix, action);
4687 static void alc236_fixup_hp_micmute_led_vref(struct hda_codec *codec,
4688 const struct hda_fixup *fix, int action)
4690 struct alc_spec *spec = codec->spec;
4692 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4693 spec->cap_mute_led_nid = 0x1a;
4694 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4695 codec->power_filter = led_power_filter;
4699 static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
4700 const struct hda_fixup *fix, int action)
4702 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4703 alc236_fixup_hp_micmute_led_vref(codec, fix, action);
4706 static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
4707 const unsigned short coefs[2])
4709 alc_write_coef_idx(codec, 0x23, coefs[0]);
4710 alc_write_coef_idx(codec, 0x25, coefs[1]);
4711 alc_write_coef_idx(codec, 0x26, 0xb011);
4714 struct alc298_samsung_amp_desc {
4716 unsigned short init_seq[2][2];
4719 static void alc298_fixup_samsung_amp(struct hda_codec *codec,
4720 const struct hda_fixup *fix, int action)
4723 static const unsigned short init_seq[][2] = {
4724 { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
4725 { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
4726 { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
4727 { 0x41, 0x07 }, { 0x400, 0x1 }
4729 static const struct alc298_samsung_amp_desc amps[] = {
4730 { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
4731 { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
4734 if (action != HDA_FIXUP_ACT_INIT)
4737 for (i = 0; i < ARRAY_SIZE(amps); i++) {
4738 alc_write_coef_idx(codec, 0x22, amps[i].nid);
4740 for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
4741 alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
4743 for (j = 0; j < ARRAY_SIZE(init_seq); j++)
4744 alc298_samsung_write_coef_pack(codec, init_seq[j]);
4748 #if IS_REACHABLE(CONFIG_INPUT)
4749 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4750 struct hda_jack_callback *event)
4752 struct alc_spec *spec = codec->spec;
4754 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4755 send both key on and key off event for every interrupt. */
4756 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4757 input_sync(spec->kb_dev);
4758 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4759 input_sync(spec->kb_dev);
4762 static int alc_register_micmute_input_device(struct hda_codec *codec)
4764 struct alc_spec *spec = codec->spec;
4767 spec->kb_dev = input_allocate_device();
4768 if (!spec->kb_dev) {
4769 codec_err(codec, "Out of memory (input_allocate_device)\n");
4773 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4775 spec->kb_dev->name = "Microphone Mute Button";
4776 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4777 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4778 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4779 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4780 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4781 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4783 if (input_register_device(spec->kb_dev)) {
4784 codec_err(codec, "input_register_device failed\n");
4785 input_free_device(spec->kb_dev);
4786 spec->kb_dev = NULL;
4793 /* GPIO1 = set according to SKU external amp
4794 * GPIO2 = mic mute hotkey
4796 * GPIO4 = mic mute LED
4798 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4799 const struct hda_fixup *fix, int action)
4801 struct alc_spec *spec = codec->spec;
4803 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4804 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4805 spec->init_amp = ALC_INIT_DEFAULT;
4806 if (alc_register_micmute_input_device(codec) != 0)
4809 spec->gpio_mask |= 0x06;
4810 spec->gpio_dir |= 0x02;
4811 spec->gpio_data |= 0x02;
4812 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4813 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4814 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4815 gpio2_mic_hotkey_event);
4823 case HDA_FIXUP_ACT_FREE:
4824 input_unregister_device(spec->kb_dev);
4825 spec->kb_dev = NULL;
4829 /* Line2 = mic mute hotkey
4830 * GPIO2 = mic mute LED
4832 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4833 const struct hda_fixup *fix, int action)
4835 struct alc_spec *spec = codec->spec;
4837 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4838 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4839 spec->init_amp = ALC_INIT_DEFAULT;
4840 if (alc_register_micmute_input_device(codec) != 0)
4843 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4844 gpio2_mic_hotkey_event);
4852 case HDA_FIXUP_ACT_FREE:
4853 input_unregister_device(spec->kb_dev);
4854 spec->kb_dev = NULL;
4858 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4859 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4862 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4863 const struct hda_fixup *fix, int action)
4865 struct alc_spec *spec = codec->spec;
4867 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4868 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4869 spec->cap_mute_led_nid = 0x18;
4870 snd_hda_gen_add_micmute_led_cdev(codec, vref_micmute_led_set);
4874 static const struct coef_fw alc225_pre_hsmode[] = {
4875 UPDATE_COEF(0x4a, 1<<8, 0),
4876 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4877 UPDATE_COEF(0x63, 3<<14, 3<<14),
4878 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4879 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4880 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4881 UPDATE_COEF(0x4a, 3<<10, 0),
4885 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4887 struct alc_spec *spec = codec->spec;
4888 static const struct coef_fw coef0255[] = {
4889 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4890 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4891 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4892 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4893 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4896 static const struct coef_fw coef0256[] = {
4897 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4898 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4899 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4900 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4901 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4904 static const struct coef_fw coef0233[] = {
4905 WRITE_COEF(0x1b, 0x0c0b),
4906 WRITE_COEF(0x45, 0xc429),
4907 UPDATE_COEF(0x35, 0x4000, 0),
4908 WRITE_COEF(0x06, 0x2104),
4909 WRITE_COEF(0x1a, 0x0001),
4910 WRITE_COEF(0x26, 0x0004),
4911 WRITE_COEF(0x32, 0x42a3),
4914 static const struct coef_fw coef0288[] = {
4915 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4916 UPDATE_COEF(0x50, 0x2000, 0x2000),
4917 UPDATE_COEF(0x56, 0x0006, 0x0006),
4918 UPDATE_COEF(0x66, 0x0008, 0),
4919 UPDATE_COEF(0x67, 0x2000, 0),
4922 static const struct coef_fw coef0298[] = {
4923 UPDATE_COEF(0x19, 0x1300, 0x0300),
4926 static const struct coef_fw coef0292[] = {
4927 WRITE_COEF(0x76, 0x000e),
4928 WRITE_COEF(0x6c, 0x2400),
4929 WRITE_COEF(0x18, 0x7308),
4930 WRITE_COEF(0x6b, 0xc429),
4933 static const struct coef_fw coef0293[] = {
4934 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4935 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4936 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4937 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4938 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4939 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4942 static const struct coef_fw coef0668[] = {
4943 WRITE_COEF(0x15, 0x0d40),
4944 WRITE_COEF(0xb7, 0x802b),
4947 static const struct coef_fw coef0225[] = {
4948 UPDATE_COEF(0x63, 3<<14, 0),
4951 static const struct coef_fw coef0274[] = {
4952 UPDATE_COEF(0x4a, 0x0100, 0),
4953 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4954 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4955 UPDATE_COEF(0x4a, 0x0010, 0),
4956 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4957 WRITE_COEF(0x45, 0x5289),
4958 UPDATE_COEF(0x4a, 0x0c00, 0),
4962 if (spec->no_internal_mic_pin) {
4963 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
4967 switch (codec->core.vendor_id) {
4969 alc_process_coef_fw(codec, coef0255);
4975 alc_process_coef_fw(codec, coef0256);
4980 alc_process_coef_fw(codec, coef0274);
4984 alc_process_coef_fw(codec, coef0233);
4988 alc_process_coef_fw(codec, coef0288);
4991 alc_process_coef_fw(codec, coef0298);
4992 alc_process_coef_fw(codec, coef0288);
4995 alc_process_coef_fw(codec, coef0292);
4998 alc_process_coef_fw(codec, coef0293);
5001 alc_process_coef_fw(codec, coef0668);
5009 alc_process_coef_fw(codec, alc225_pre_hsmode);
5010 alc_process_coef_fw(codec, coef0225);
5013 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5016 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
5020 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
5023 static const struct coef_fw coef0255[] = {
5024 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
5025 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5028 static const struct coef_fw coef0256[] = {
5029 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
5030 WRITE_COEFEX(0x57, 0x03, 0x09a3),
5031 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
5034 static const struct coef_fw coef0233[] = {
5035 UPDATE_COEF(0x35, 0, 1<<14),
5036 WRITE_COEF(0x06, 0x2100),
5037 WRITE_COEF(0x1a, 0x0021),
5038 WRITE_COEF(0x26, 0x008c),
5041 static const struct coef_fw coef0288[] = {
5042 UPDATE_COEF(0x4f, 0x00c0, 0),
5043 UPDATE_COEF(0x50, 0x2000, 0),
5044 UPDATE_COEF(0x56, 0x0006, 0),
5045 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
5046 UPDATE_COEF(0x66, 0x0008, 0x0008),
5047 UPDATE_COEF(0x67, 0x2000, 0x2000),
5050 static const struct coef_fw coef0292[] = {
5051 WRITE_COEF(0x19, 0xa208),
5052 WRITE_COEF(0x2e, 0xacf0),
5055 static const struct coef_fw coef0293[] = {
5056 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
5057 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
5058 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5061 static const struct coef_fw coef0688[] = {
5062 WRITE_COEF(0xb7, 0x802b),
5063 WRITE_COEF(0xb5, 0x1040),
5064 UPDATE_COEF(0xc3, 0, 1<<12),
5067 static const struct coef_fw coef0225[] = {
5068 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
5069 UPDATE_COEF(0x4a, 3<<4, 2<<4),
5070 UPDATE_COEF(0x63, 3<<14, 0),
5073 static const struct coef_fw coef0274[] = {
5074 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
5075 UPDATE_COEF(0x4a, 0x0010, 0),
5076 UPDATE_COEF(0x6b, 0xf000, 0),
5080 switch (codec->core.vendor_id) {
5082 alc_write_coef_idx(codec, 0x45, 0xc489);
5083 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5084 alc_process_coef_fw(codec, coef0255);
5085 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5091 alc_write_coef_idx(codec, 0x45, 0xc489);
5092 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5093 alc_process_coef_fw(codec, coef0256);
5094 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5099 alc_write_coef_idx(codec, 0x45, 0x4689);
5100 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5101 alc_process_coef_fw(codec, coef0274);
5102 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5106 alc_write_coef_idx(codec, 0x45, 0xc429);
5107 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5108 alc_process_coef_fw(codec, coef0233);
5109 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5114 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5115 alc_process_coef_fw(codec, coef0288);
5116 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5119 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5120 alc_process_coef_fw(codec, coef0292);
5123 /* Set to TRS mode */
5124 alc_write_coef_idx(codec, 0x45, 0xc429);
5125 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5126 alc_process_coef_fw(codec, coef0293);
5127 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5130 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
5134 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5135 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5138 alc_write_coef_idx(codec, 0x11, 0x0001);
5139 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5140 alc_process_coef_fw(codec, coef0688);
5141 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5149 alc_process_coef_fw(codec, alc225_pre_hsmode);
5150 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
5151 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
5152 alc_process_coef_fw(codec, coef0225);
5153 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
5156 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
5159 static void alc_headset_mode_default(struct hda_codec *codec)
5161 static const struct coef_fw coef0225[] = {
5162 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
5163 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
5164 UPDATE_COEF(0x49, 3<<8, 0<<8),
5165 UPDATE_COEF(0x4a, 3<<4, 3<<4),
5166 UPDATE_COEF(0x63, 3<<14, 0),
5167 UPDATE_COEF(0x67, 0xf000, 0x3000),
5170 static const struct coef_fw coef0255[] = {
5171 WRITE_COEF(0x45, 0xc089),
5172 WRITE_COEF(0x45, 0xc489),
5173 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5174 WRITE_COEF(0x49, 0x0049),
5177 static const struct coef_fw coef0256[] = {
5178 WRITE_COEF(0x45, 0xc489),
5179 WRITE_COEFEX(0x57, 0x03, 0x0da3),
5180 WRITE_COEF(0x49, 0x0049),
5181 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
5182 WRITE_COEF(0x06, 0x6100),
5185 static const struct coef_fw coef0233[] = {
5186 WRITE_COEF(0x06, 0x2100),
5187 WRITE_COEF(0x32, 0x4ea3),
5190 static const struct coef_fw coef0288[] = {
5191 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
5192 UPDATE_COEF(0x50, 0x2000, 0x2000),
5193 UPDATE_COEF(0x56, 0x0006, 0x0006),
5194 UPDATE_COEF(0x66, 0x0008, 0),
5195 UPDATE_COEF(0x67, 0x2000, 0),
5198 static const struct coef_fw coef0292[] = {
5199 WRITE_COEF(0x76, 0x000e),
5200 WRITE_COEF(0x6c, 0x2400),
5201 WRITE_COEF(0x6b, 0xc429),
5202 WRITE_COEF(0x18, 0x7308),
5205 static const struct coef_fw coef0293[] = {
5206 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
5207 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
5208 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
5211 static const struct coef_fw coef0688[] = {
5212 WRITE_COEF(0x11, 0x0041),
5213 WRITE_COEF(0x15, 0x0d40),
5214 WRITE_COEF(0xb7, 0x802b),
5217 static const struct coef_fw coef0274[] = {
5218 WRITE_COEF(0x45, 0x4289),
5219 UPDATE_COEF(0x4a, 0x0010, 0x0010),
5220 UPDATE_COEF(0x6b, 0x0f00, 0),
5221 UPDATE_COEF(0x49, 0x0300, 0x0300),
5225 switch (codec->core.vendor_id) {
5232 alc_process_coef_fw(codec, alc225_pre_hsmode);
5233 alc_process_coef_fw(codec, coef0225);
5236 alc_process_coef_fw(codec, coef0255);
5242 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5243 alc_write_coef_idx(codec, 0x45, 0xc089);
5245 alc_process_coef_fw(codec, coef0256);
5250 alc_process_coef_fw(codec, coef0274);
5254 alc_process_coef_fw(codec, coef0233);
5259 alc_process_coef_fw(codec, coef0288);
5262 alc_process_coef_fw(codec, coef0292);
5265 alc_process_coef_fw(codec, coef0293);
5268 alc_process_coef_fw(codec, coef0688);
5271 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5274 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
5278 static void alc_headset_mode_ctia(struct hda_codec *codec)
5282 static const struct coef_fw coef0255[] = {
5283 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5284 WRITE_COEF(0x1b, 0x0c2b),
5285 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5288 static const struct coef_fw coef0256[] = {
5289 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
5290 WRITE_COEF(0x1b, 0x0e6b),
5293 static const struct coef_fw coef0233[] = {
5294 WRITE_COEF(0x45, 0xd429),
5295 WRITE_COEF(0x1b, 0x0c2b),
5296 WRITE_COEF(0x32, 0x4ea3),
5299 static const struct coef_fw coef0288[] = {
5300 UPDATE_COEF(0x50, 0x2000, 0x2000),
5301 UPDATE_COEF(0x56, 0x0006, 0x0006),
5302 UPDATE_COEF(0x66, 0x0008, 0),
5303 UPDATE_COEF(0x67, 0x2000, 0),
5306 static const struct coef_fw coef0292[] = {
5307 WRITE_COEF(0x6b, 0xd429),
5308 WRITE_COEF(0x76, 0x0008),
5309 WRITE_COEF(0x18, 0x7388),
5312 static const struct coef_fw coef0293[] = {
5313 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
5314 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5317 static const struct coef_fw coef0688[] = {
5318 WRITE_COEF(0x11, 0x0001),
5319 WRITE_COEF(0x15, 0x0d60),
5320 WRITE_COEF(0xc3, 0x0000),
5323 static const struct coef_fw coef0225_1[] = {
5324 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5325 UPDATE_COEF(0x63, 3<<14, 2<<14),
5328 static const struct coef_fw coef0225_2[] = {
5329 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
5330 UPDATE_COEF(0x63, 3<<14, 1<<14),
5334 switch (codec->core.vendor_id) {
5336 alc_process_coef_fw(codec, coef0255);
5342 alc_process_coef_fw(codec, coef0256);
5347 alc_write_coef_idx(codec, 0x45, 0xd689);
5351 alc_process_coef_fw(codec, coef0233);
5354 val = alc_read_coef_idx(codec, 0x50);
5355 if (val & (1 << 12)) {
5356 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5357 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5360 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5361 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5367 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
5369 alc_process_coef_fw(codec, coef0288);
5372 alc_process_coef_fw(codec, coef0292);
5375 alc_process_coef_fw(codec, coef0293);
5378 alc_process_coef_fw(codec, coef0688);
5386 val = alc_read_coef_idx(codec, 0x45);
5388 alc_process_coef_fw(codec, coef0225_2);
5390 alc_process_coef_fw(codec, coef0225_1);
5393 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5396 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
5400 static void alc_headset_mode_omtp(struct hda_codec *codec)
5402 static const struct coef_fw coef0255[] = {
5403 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5404 WRITE_COEF(0x1b, 0x0c2b),
5405 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5408 static const struct coef_fw coef0256[] = {
5409 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5410 WRITE_COEF(0x1b, 0x0e6b),
5413 static const struct coef_fw coef0233[] = {
5414 WRITE_COEF(0x45, 0xe429),
5415 WRITE_COEF(0x1b, 0x0c2b),
5416 WRITE_COEF(0x32, 0x4ea3),
5419 static const struct coef_fw coef0288[] = {
5420 UPDATE_COEF(0x50, 0x2000, 0x2000),
5421 UPDATE_COEF(0x56, 0x0006, 0x0006),
5422 UPDATE_COEF(0x66, 0x0008, 0),
5423 UPDATE_COEF(0x67, 0x2000, 0),
5426 static const struct coef_fw coef0292[] = {
5427 WRITE_COEF(0x6b, 0xe429),
5428 WRITE_COEF(0x76, 0x0008),
5429 WRITE_COEF(0x18, 0x7388),
5432 static const struct coef_fw coef0293[] = {
5433 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5434 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5437 static const struct coef_fw coef0688[] = {
5438 WRITE_COEF(0x11, 0x0001),
5439 WRITE_COEF(0x15, 0x0d50),
5440 WRITE_COEF(0xc3, 0x0000),
5443 static const struct coef_fw coef0225[] = {
5444 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5445 UPDATE_COEF(0x63, 3<<14, 2<<14),
5449 switch (codec->core.vendor_id) {
5451 alc_process_coef_fw(codec, coef0255);
5457 alc_process_coef_fw(codec, coef0256);
5462 alc_write_coef_idx(codec, 0x45, 0xe689);
5466 alc_process_coef_fw(codec, coef0233);
5469 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5470 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5475 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5477 alc_process_coef_fw(codec, coef0288);
5480 alc_process_coef_fw(codec, coef0292);
5483 alc_process_coef_fw(codec, coef0293);
5486 alc_process_coef_fw(codec, coef0688);
5494 alc_process_coef_fw(codec, coef0225);
5497 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5500 static void alc_determine_headset_type(struct hda_codec *codec)
5503 bool is_ctia = false;
5504 struct alc_spec *spec = codec->spec;
5505 static const struct coef_fw coef0255[] = {
5506 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5507 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5511 static const struct coef_fw coef0288[] = {
5512 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5515 static const struct coef_fw coef0298[] = {
5516 UPDATE_COEF(0x50, 0x2000, 0x2000),
5517 UPDATE_COEF(0x56, 0x0006, 0x0006),
5518 UPDATE_COEF(0x66, 0x0008, 0),
5519 UPDATE_COEF(0x67, 0x2000, 0),
5520 UPDATE_COEF(0x19, 0x1300, 0x1300),
5523 static const struct coef_fw coef0293[] = {
5524 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5525 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5528 static const struct coef_fw coef0688[] = {
5529 WRITE_COEF(0x11, 0x0001),
5530 WRITE_COEF(0xb7, 0x802b),
5531 WRITE_COEF(0x15, 0x0d60),
5532 WRITE_COEF(0xc3, 0x0c00),
5535 static const struct coef_fw coef0274[] = {
5536 UPDATE_COEF(0x4a, 0x0010, 0),
5537 UPDATE_COEF(0x4a, 0x8000, 0),
5538 WRITE_COEF(0x45, 0xd289),
5539 UPDATE_COEF(0x49, 0x0300, 0x0300),
5543 if (spec->no_internal_mic_pin) {
5544 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
5548 switch (codec->core.vendor_id) {
5550 alc_process_coef_fw(codec, coef0255);
5552 val = alc_read_coef_idx(codec, 0x46);
5553 is_ctia = (val & 0x0070) == 0x0070;
5559 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5560 alc_write_coef_idx(codec, 0x06, 0x6104);
5561 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5563 snd_hda_codec_write(codec, 0x21, 0,
5564 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5566 snd_hda_codec_write(codec, 0x21, 0,
5567 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5569 alc_process_coef_fw(codec, coef0255);
5571 val = alc_read_coef_idx(codec, 0x46);
5572 is_ctia = (val & 0x0070) == 0x0070;
5574 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5575 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5577 snd_hda_codec_write(codec, 0x21, 0,
5578 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5580 snd_hda_codec_write(codec, 0x21, 0,
5581 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5586 alc_process_coef_fw(codec, coef0274);
5588 val = alc_read_coef_idx(codec, 0x46);
5589 is_ctia = (val & 0x00f0) == 0x00f0;
5593 alc_write_coef_idx(codec, 0x45, 0xd029);
5595 val = alc_read_coef_idx(codec, 0x46);
5596 is_ctia = (val & 0x0070) == 0x0070;
5599 snd_hda_codec_write(codec, 0x21, 0,
5600 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5602 snd_hda_codec_write(codec, 0x21, 0,
5603 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5606 val = alc_read_coef_idx(codec, 0x50);
5607 if (val & (1 << 12)) {
5608 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5609 alc_process_coef_fw(codec, coef0288);
5611 val = alc_read_coef_idx(codec, 0x50);
5612 is_ctia = (val & 0x0070) == 0x0070;
5614 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5615 alc_process_coef_fw(codec, coef0288);
5617 val = alc_read_coef_idx(codec, 0x50);
5618 is_ctia = (val & 0x0070) == 0x0070;
5620 alc_process_coef_fw(codec, coef0298);
5621 snd_hda_codec_write(codec, 0x21, 0,
5622 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5624 snd_hda_codec_write(codec, 0x21, 0,
5625 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5629 alc_process_coef_fw(codec, coef0288);
5631 val = alc_read_coef_idx(codec, 0x50);
5632 is_ctia = (val & 0x0070) == 0x0070;
5635 alc_write_coef_idx(codec, 0x6b, 0xd429);
5637 val = alc_read_coef_idx(codec, 0x6c);
5638 is_ctia = (val & 0x001c) == 0x001c;
5641 alc_process_coef_fw(codec, coef0293);
5643 val = alc_read_coef_idx(codec, 0x46);
5644 is_ctia = (val & 0x0070) == 0x0070;
5647 alc_process_coef_fw(codec, coef0688);
5649 val = alc_read_coef_idx(codec, 0xbe);
5650 is_ctia = (val & 0x1c02) == 0x1c02;
5658 snd_hda_codec_write(codec, 0x21, 0,
5659 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5661 snd_hda_codec_write(codec, 0x21, 0,
5662 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5664 alc_process_coef_fw(codec, alc225_pre_hsmode);
5665 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5666 val = alc_read_coef_idx(codec, 0x45);
5667 if (val & (1 << 9)) {
5668 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5669 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5671 val = alc_read_coef_idx(codec, 0x46);
5672 is_ctia = (val & 0x00f0) == 0x00f0;
5674 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5675 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5677 val = alc_read_coef_idx(codec, 0x46);
5678 is_ctia = (val & 0x00f0) == 0x00f0;
5680 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5681 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5682 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5684 snd_hda_codec_write(codec, 0x21, 0,
5685 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5687 snd_hda_codec_write(codec, 0x21, 0,
5688 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5695 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5696 is_ctia ? "yes" : "no");
5697 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5700 static void alc_update_headset_mode(struct hda_codec *codec)
5702 struct alc_spec *spec = codec->spec;
5704 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5705 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5707 int new_headset_mode;
5709 if (!snd_hda_jack_detect(codec, hp_pin))
5710 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5711 else if (mux_pin == spec->headset_mic_pin)
5712 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5713 else if (mux_pin == spec->headphone_mic_pin)
5714 new_headset_mode = ALC_HEADSET_MODE_MIC;
5716 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5718 if (new_headset_mode == spec->current_headset_mode) {
5719 snd_hda_gen_update_outputs(codec);
5723 switch (new_headset_mode) {
5724 case ALC_HEADSET_MODE_UNPLUGGED:
5725 alc_headset_mode_unplugged(codec);
5726 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5727 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5728 spec->gen.hp_jack_present = false;
5730 case ALC_HEADSET_MODE_HEADSET:
5731 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5732 alc_determine_headset_type(codec);
5733 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5734 alc_headset_mode_ctia(codec);
5735 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5736 alc_headset_mode_omtp(codec);
5737 spec->gen.hp_jack_present = true;
5739 case ALC_HEADSET_MODE_MIC:
5740 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5741 spec->gen.hp_jack_present = false;
5743 case ALC_HEADSET_MODE_HEADPHONE:
5744 alc_headset_mode_default(codec);
5745 spec->gen.hp_jack_present = true;
5748 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5749 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5750 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5751 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5752 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5755 spec->current_headset_mode = new_headset_mode;
5757 snd_hda_gen_update_outputs(codec);
5760 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5761 struct snd_kcontrol *kcontrol,
5762 struct snd_ctl_elem_value *ucontrol)
5764 alc_update_headset_mode(codec);
5767 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5768 struct hda_jack_callback *jack)
5770 snd_hda_gen_hp_automute(codec, jack);
5771 alc_update_headset_mode(codec);
5774 static void alc_probe_headset_mode(struct hda_codec *codec)
5777 struct alc_spec *spec = codec->spec;
5778 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5781 for (i = 0; i < cfg->num_inputs; i++) {
5782 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5783 spec->headset_mic_pin = cfg->inputs[i].pin;
5784 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5785 spec->headphone_mic_pin = cfg->inputs[i].pin;
5788 WARN_ON(spec->gen.cap_sync_hook);
5789 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5790 spec->gen.automute_hook = alc_update_headset_mode;
5791 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5794 static void alc_fixup_headset_mode(struct hda_codec *codec,
5795 const struct hda_fixup *fix, int action)
5797 struct alc_spec *spec = codec->spec;
5800 case HDA_FIXUP_ACT_PRE_PROBE:
5801 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5803 case HDA_FIXUP_ACT_PROBE:
5804 alc_probe_headset_mode(codec);
5806 case HDA_FIXUP_ACT_INIT:
5807 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5808 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5809 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5811 alc_update_headset_mode(codec);
5816 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5817 const struct hda_fixup *fix, int action)
5819 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5820 struct alc_spec *spec = codec->spec;
5821 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5824 alc_fixup_headset_mode(codec, fix, action);
5827 static void alc255_set_default_jack_type(struct hda_codec *codec)
5829 /* Set to iphone type */
5830 static const struct coef_fw alc255fw[] = {
5831 WRITE_COEF(0x1b, 0x880b),
5832 WRITE_COEF(0x45, 0xd089),
5833 WRITE_COEF(0x1b, 0x080b),
5834 WRITE_COEF(0x46, 0x0004),
5835 WRITE_COEF(0x1b, 0x0c0b),
5838 static const struct coef_fw alc256fw[] = {
5839 WRITE_COEF(0x1b, 0x884b),
5840 WRITE_COEF(0x45, 0xd089),
5841 WRITE_COEF(0x1b, 0x084b),
5842 WRITE_COEF(0x46, 0x0004),
5843 WRITE_COEF(0x1b, 0x0c4b),
5846 switch (codec->core.vendor_id) {
5848 alc_process_coef_fw(codec, alc255fw);
5854 alc_process_coef_fw(codec, alc256fw);
5860 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5861 const struct hda_fixup *fix, int action)
5863 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5864 alc255_set_default_jack_type(codec);
5866 alc_fixup_headset_mode(codec, fix, action);
5869 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5870 const struct hda_fixup *fix, int action)
5872 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5873 struct alc_spec *spec = codec->spec;
5874 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5875 alc255_set_default_jack_type(codec);
5878 alc_fixup_headset_mode(codec, fix, action);
5881 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5882 struct hda_jack_callback *jack)
5884 struct alc_spec *spec = codec->spec;
5886 alc_update_headset_jack_cb(codec, jack);
5887 /* Headset Mic enable or disable, only for Dell Dino */
5888 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5891 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5892 const struct hda_fixup *fix, int action)
5894 alc_fixup_headset_mode(codec, fix, action);
5895 if (action == HDA_FIXUP_ACT_PROBE) {
5896 struct alc_spec *spec = codec->spec;
5897 /* toggled via hp_automute_hook */
5898 spec->gpio_mask |= 0x40;
5899 spec->gpio_dir |= 0x40;
5900 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5904 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5905 const struct hda_fixup *fix, int action)
5907 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5908 struct alc_spec *spec = codec->spec;
5909 spec->gen.auto_mute_via_amp = 1;
5913 static void alc_fixup_no_shutup(struct hda_codec *codec,
5914 const struct hda_fixup *fix, int action)
5916 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5917 struct alc_spec *spec = codec->spec;
5918 spec->no_shutup_pins = 1;
5922 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5923 const struct hda_fixup *fix, int action)
5925 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5926 struct alc_spec *spec = codec->spec;
5927 /* Disable AA-loopback as it causes white noise */
5928 spec->gen.mixer_nid = 0;
5932 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5933 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5934 const struct hda_fixup *fix, int action)
5936 static const struct hda_pintbl pincfgs[] = {
5937 { 0x16, 0x21211010 }, /* dock headphone */
5938 { 0x19, 0x21a11010 }, /* dock mic */
5941 struct alc_spec *spec = codec->spec;
5943 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5944 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5945 codec->power_save_node = 0; /* avoid click noises */
5946 snd_hda_apply_pincfgs(codec, pincfgs);
5950 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5951 const struct hda_fixup *fix, int action)
5953 static const struct hda_pintbl pincfgs[] = {
5954 { 0x17, 0x21211010 }, /* dock headphone */
5955 { 0x19, 0x21a11010 }, /* dock mic */
5958 struct alc_spec *spec = codec->spec;
5960 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5961 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5962 snd_hda_apply_pincfgs(codec, pincfgs);
5963 } else if (action == HDA_FIXUP_ACT_INIT) {
5964 /* Enable DOCK device */
5965 snd_hda_codec_write(codec, 0x17, 0,
5966 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5967 /* Enable DOCK device */
5968 snd_hda_codec_write(codec, 0x19, 0,
5969 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5973 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5974 const struct hda_fixup *fix, int action)
5976 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5977 * the speaker output becomes too low by some reason on Thinkpads with
5980 static const hda_nid_t preferred_pairs[] = {
5981 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5984 struct alc_spec *spec = codec->spec;
5986 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5987 spec->gen.preferred_dacs = preferred_pairs;
5990 static void alc295_fixup_asus_dacs(struct hda_codec *codec,
5991 const struct hda_fixup *fix, int action)
5993 static const hda_nid_t preferred_pairs[] = {
5994 0x17, 0x02, 0x21, 0x03, 0
5996 struct alc_spec *spec = codec->spec;
5998 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5999 spec->gen.preferred_dacs = preferred_pairs;
6002 static void alc_shutup_dell_xps13(struct hda_codec *codec)
6004 struct alc_spec *spec = codec->spec;
6005 int hp_pin = alc_get_hp_pin(spec);
6007 /* Prevent pop noises when headphones are plugged in */
6008 snd_hda_codec_write(codec, hp_pin, 0,
6009 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
6013 static void alc_fixup_dell_xps13(struct hda_codec *codec,
6014 const struct hda_fixup *fix, int action)
6016 struct alc_spec *spec = codec->spec;
6017 struct hda_input_mux *imux = &spec->gen.input_mux;
6021 case HDA_FIXUP_ACT_PRE_PROBE:
6022 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
6023 * it causes a click noise at start up
6025 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6026 spec->shutup = alc_shutup_dell_xps13;
6028 case HDA_FIXUP_ACT_PROBE:
6029 /* Make the internal mic the default input source. */
6030 for (i = 0; i < imux->num_items; i++) {
6031 if (spec->gen.imux_pins[i] == 0x12) {
6032 spec->gen.cur_mux[0] = i;
6040 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
6041 const struct hda_fixup *fix, int action)
6043 struct alc_spec *spec = codec->spec;
6045 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6046 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
6047 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
6049 /* Disable boost for mic-in permanently. (This code is only called
6050 from quirks that guarantee that the headphone is at NID 0x1b.) */
6051 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
6052 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
6054 alc_fixup_headset_mode(codec, fix, action);
6057 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
6058 const struct hda_fixup *fix, int action)
6060 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6061 alc_write_coef_idx(codec, 0xc4, 0x8000);
6062 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
6063 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
6065 alc_fixup_headset_mode(codec, fix, action);
6068 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
6069 static int find_ext_mic_pin(struct hda_codec *codec)
6071 struct alc_spec *spec = codec->spec;
6072 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6074 unsigned int defcfg;
6077 for (i = 0; i < cfg->num_inputs; i++) {
6078 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6080 nid = cfg->inputs[i].pin;
6081 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6082 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
6090 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
6091 const struct hda_fixup *fix,
6094 struct alc_spec *spec = codec->spec;
6096 if (action == HDA_FIXUP_ACT_PROBE) {
6097 int mic_pin = find_ext_mic_pin(codec);
6098 int hp_pin = alc_get_hp_pin(spec);
6100 if (snd_BUG_ON(!mic_pin || !hp_pin))
6102 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
6106 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
6107 const struct hda_fixup *fix,
6110 struct alc_spec *spec = codec->spec;
6111 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
6114 /* The mic boosts on level 2 and 3 are too noisy
6115 on the internal mic input.
6116 Therefore limit the boost to 0 or 1. */
6118 if (action != HDA_FIXUP_ACT_PROBE)
6121 for (i = 0; i < cfg->num_inputs; i++) {
6122 hda_nid_t nid = cfg->inputs[i].pin;
6123 unsigned int defcfg;
6124 if (cfg->inputs[i].type != AUTO_PIN_MIC)
6126 defcfg = snd_hda_codec_get_pincfg(codec, nid);
6127 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
6130 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
6131 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
6132 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
6133 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
6134 (0 << AC_AMPCAP_MUTE_SHIFT));
6138 static void alc283_hp_automute_hook(struct hda_codec *codec,
6139 struct hda_jack_callback *jack)
6141 struct alc_spec *spec = codec->spec;
6145 snd_hda_gen_hp_automute(codec, jack);
6147 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
6150 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
6154 static void alc283_fixup_chromebook(struct hda_codec *codec,
6155 const struct hda_fixup *fix, int action)
6157 struct alc_spec *spec = codec->spec;
6160 case HDA_FIXUP_ACT_PRE_PROBE:
6161 snd_hda_override_wcaps(codec, 0x03, 0);
6162 /* Disable AA-loopback as it causes white noise */
6163 spec->gen.mixer_nid = 0;
6165 case HDA_FIXUP_ACT_INIT:
6166 /* MIC2-VREF control */
6167 /* Set to manual mode */
6168 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6169 /* Enable Line1 input control by verb */
6170 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
6175 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
6176 const struct hda_fixup *fix, int action)
6178 struct alc_spec *spec = codec->spec;
6181 case HDA_FIXUP_ACT_PRE_PROBE:
6182 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
6184 case HDA_FIXUP_ACT_INIT:
6185 /* MIC2-VREF control */
6186 /* Set to manual mode */
6187 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
6192 /* mute tablet speaker pin (0x14) via dock plugging in addition */
6193 static void asus_tx300_automute(struct hda_codec *codec)
6195 struct alc_spec *spec = codec->spec;
6196 snd_hda_gen_update_outputs(codec);
6197 if (snd_hda_jack_detect(codec, 0x1b))
6198 spec->gen.mute_bits |= (1ULL << 0x14);
6201 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
6202 const struct hda_fixup *fix, int action)
6204 struct alc_spec *spec = codec->spec;
6205 static const struct hda_pintbl dock_pins[] = {
6206 { 0x1b, 0x21114000 }, /* dock speaker pin */
6211 case HDA_FIXUP_ACT_PRE_PROBE:
6212 spec->init_amp = ALC_INIT_DEFAULT;
6213 /* TX300 needs to set up GPIO2 for the speaker amp */
6214 alc_setup_gpio(codec, 0x04);
6215 snd_hda_apply_pincfgs(codec, dock_pins);
6216 spec->gen.auto_mute_via_amp = 1;
6217 spec->gen.automute_hook = asus_tx300_automute;
6218 snd_hda_jack_detect_enable_callback(codec, 0x1b,
6219 snd_hda_gen_hp_automute);
6221 case HDA_FIXUP_ACT_PROBE:
6222 spec->init_amp = ALC_INIT_DEFAULT;
6224 case HDA_FIXUP_ACT_BUILD:
6225 /* this is a bit tricky; give more sane names for the main
6226 * (tablet) speaker and the dock speaker, respectively
6228 rename_ctl(codec, "Speaker Playback Switch",
6229 "Dock Speaker Playback Switch");
6230 rename_ctl(codec, "Bass Speaker Playback Switch",
6231 "Speaker Playback Switch");
6236 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
6237 const struct hda_fixup *fix, int action)
6239 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6240 /* DAC node 0x03 is giving mono output. We therefore want to
6241 make sure 0x14 (front speaker) and 0x15 (headphones) use the
6242 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
6243 static const hda_nid_t conn1[] = { 0x0c };
6244 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
6245 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
6249 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
6250 const struct hda_fixup *fix, int action)
6252 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6253 /* The speaker is routed to the Node 0x06 by a mistake, as a result
6254 we can't adjust the speaker's volume since this node does not has
6255 Amp-out capability. we change the speaker's route to:
6256 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
6257 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
6258 speaker's volume now. */
6260 static const hda_nid_t conn1[] = { 0x0c };
6261 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
6265 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
6266 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
6267 const struct hda_fixup *fix, int action)
6269 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6270 static const hda_nid_t conn[] = { 0x02, 0x03 };
6271 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6275 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
6276 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
6277 const struct hda_fixup *fix, int action)
6279 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6280 static const hda_nid_t conn[] = { 0x02 };
6281 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6285 /* Hook to update amp GPIO4 for automute */
6286 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
6287 struct hda_jack_callback *jack)
6289 struct alc_spec *spec = codec->spec;
6291 snd_hda_gen_hp_automute(codec, jack);
6292 /* mute_led_polarity is set to 0, so we pass inverted value here */
6293 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
6294 !spec->gen.hp_jack_present);
6297 /* Manage GPIOs for HP EliteBook Folio 9480m.
6299 * GPIO4 is the headphone amplifier power control
6300 * GPIO3 is the audio output mute indicator LED
6303 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
6304 const struct hda_fixup *fix,
6307 struct alc_spec *spec = codec->spec;
6309 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
6310 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6311 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
6312 spec->gpio_mask |= 0x10;
6313 spec->gpio_dir |= 0x10;
6314 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
6318 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
6319 const struct hda_fixup *fix,
6322 struct alc_spec *spec = codec->spec;
6324 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6325 spec->gpio_mask |= 0x04;
6326 spec->gpio_dir |= 0x04;
6327 /* set data bit low */
6331 /* Quirk for Thinkpad X1 7th and 8th Gen
6332 * The following fixed routing needed
6333 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
6334 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
6335 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
6337 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec *codec,
6338 const struct hda_fixup *fix, int action)
6340 static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */
6341 static const hda_nid_t preferred_pairs[] = {
6342 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
6344 struct alc_spec *spec = codec->spec;
6347 case HDA_FIXUP_ACT_PRE_PROBE:
6348 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6349 spec->gen.preferred_dacs = preferred_pairs;
6351 case HDA_FIXUP_ACT_BUILD:
6352 /* The generic parser creates somewhat unintuitive volume ctls
6353 * with the fixed routing above, and the shared DAC2 may be
6355 * Rename those to unique names so that PA doesn't touch them
6356 * and use only Master volume.
6358 rename_ctl(codec, "Front Playback Volume", "DAC1 Playback Volume");
6359 rename_ctl(codec, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
6364 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
6365 const struct hda_fixup *fix,
6368 alc_fixup_dual_codecs(codec, fix, action);
6370 case HDA_FIXUP_ACT_PRE_PROBE:
6371 /* override card longname to provide a unique UCM profile */
6372 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
6374 case HDA_FIXUP_ACT_BUILD:
6375 /* rename Capture controls depending on the codec */
6376 rename_ctl(codec, "Capture Volume",
6378 "Rear-Panel Capture Volume" :
6379 "Front-Panel Capture Volume");
6380 rename_ctl(codec, "Capture Switch",
6382 "Rear-Panel Capture Switch" :
6383 "Front-Panel Capture Switch");
6388 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
6389 const struct hda_fixup *fix, int action)
6391 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6394 codec->power_save_node = 1;
6397 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
6398 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
6399 const struct hda_fixup *fix, int action)
6401 struct alc_spec *spec = codec->spec;
6402 static const hda_nid_t preferred_pairs[] = {
6403 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
6407 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6410 spec->gen.preferred_dacs = preferred_pairs;
6411 spec->gen.auto_mute_via_amp = 1;
6412 codec->power_save_node = 0;
6415 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */
6416 static void alc289_fixup_asus_ga401(struct hda_codec *codec,
6417 const struct hda_fixup *fix, int action)
6419 static const hda_nid_t preferred_pairs[] = {
6420 0x14, 0x02, 0x17, 0x02, 0x21, 0x03, 0
6422 struct alc_spec *spec = codec->spec;
6424 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
6425 spec->gen.preferred_dacs = preferred_pairs;
6426 spec->gen.obey_preferred_dacs = 1;
6430 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6431 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
6432 const struct hda_fixup *fix, int action)
6434 if (action != HDA_FIXUP_ACT_PRE_PROBE)
6437 snd_hda_override_wcaps(codec, 0x03, 0);
6440 static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
6442 switch (codec->core.vendor_id) {
6448 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6449 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
6457 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6458 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
6463 static void alc295_fixup_chromebook(struct hda_codec *codec,
6464 const struct hda_fixup *fix, int action)
6466 struct alc_spec *spec = codec->spec;
6469 case HDA_FIXUP_ACT_PRE_PROBE:
6470 spec->ultra_low_power = true;
6472 case HDA_FIXUP_ACT_INIT:
6473 alc_combo_jack_hp_jd_restart(codec);
6478 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
6479 const struct hda_fixup *fix, int action)
6481 if (action == HDA_FIXUP_ACT_PRE_PROBE)
6482 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
6486 static void alc294_gx502_toggle_output(struct hda_codec *codec,
6487 struct hda_jack_callback *cb)
6489 /* The Windows driver sets the codec up in a very different way where
6490 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6492 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6493 alc_write_coef_idx(codec, 0x10, 0x8a20);
6495 alc_write_coef_idx(codec, 0x10, 0x0a20);
6498 static void alc294_fixup_gx502_hp(struct hda_codec *codec,
6499 const struct hda_fixup *fix, int action)
6501 /* Pin 0x21: headphones/headset mic */
6502 if (!is_jack_detectable(codec, 0x21))
6506 case HDA_FIXUP_ACT_PRE_PROBE:
6507 snd_hda_jack_detect_enable_callback(codec, 0x21,
6508 alc294_gx502_toggle_output);
6510 case HDA_FIXUP_ACT_INIT:
6511 /* Make sure to start in a correct state, i.e. if
6512 * headphones have been plugged in before powering up the system
6514 alc294_gx502_toggle_output(codec, NULL);
6519 static void alc294_gu502_toggle_output(struct hda_codec *codec,
6520 struct hda_jack_callback *cb)
6522 /* Windows sets 0x10 to 0x8420 for Node 0x20 which is
6523 * responsible from changes between speakers and headphones
6525 if (snd_hda_jack_detect_state(codec, 0x21) == HDA_JACK_PRESENT)
6526 alc_write_coef_idx(codec, 0x10, 0x8420);
6528 alc_write_coef_idx(codec, 0x10, 0x0a20);
6531 static void alc294_fixup_gu502_hp(struct hda_codec *codec,
6532 const struct hda_fixup *fix, int action)
6534 if (!is_jack_detectable(codec, 0x21))
6538 case HDA_FIXUP_ACT_PRE_PROBE:
6539 snd_hda_jack_detect_enable_callback(codec, 0x21,
6540 alc294_gu502_toggle_output);
6542 case HDA_FIXUP_ACT_INIT:
6543 alc294_gu502_toggle_output(codec, NULL);
6548 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
6549 const struct hda_fixup *fix, int action)
6551 if (action != HDA_FIXUP_ACT_INIT)
6555 alc_write_coef_idx(codec, 0x65, 0x0);
6558 static void alc274_fixup_hp_headset_mic(struct hda_codec *codec,
6559 const struct hda_fixup *fix, int action)
6562 case HDA_FIXUP_ACT_INIT:
6563 alc_combo_jack_hp_jd_restart(codec);
6568 static void alc_fixup_no_int_mic(struct hda_codec *codec,
6569 const struct hda_fixup *fix, int action)
6571 struct alc_spec *spec = codec->spec;
6574 case HDA_FIXUP_ACT_PRE_PROBE:
6575 /* Mic RING SLEEVE swap for combo jack */
6576 alc_update_coef_idx(codec, 0x45, 0xf<<12 | 1<<10, 5<<12);
6577 spec->no_internal_mic_pin = true;
6579 case HDA_FIXUP_ACT_INIT:
6580 alc_combo_jack_hp_jd_restart(codec);
6585 /* GPIO1 = amplifier on/off
6586 * GPIO3 = mic mute LED
6588 static void alc285_fixup_hp_spectre_x360_eb1(struct hda_codec *codec,
6589 const struct hda_fixup *fix, int action)
6591 static const hda_nid_t conn[] = { 0x02 };
6593 struct alc_spec *spec = codec->spec;
6594 static const struct hda_pintbl pincfgs[] = {
6595 { 0x14, 0x90170110 }, /* front/high speakers */
6596 { 0x17, 0x90170130 }, /* back/bass speakers */
6600 //enable micmute led
6601 alc_fixup_hp_gpio_led(codec, action, 0x00, 0x04);
6604 case HDA_FIXUP_ACT_PRE_PROBE:
6605 spec->micmute_led_polarity = 1;
6606 /* needed for amp of back speakers */
6607 spec->gpio_mask |= 0x01;
6608 spec->gpio_dir |= 0x01;
6609 snd_hda_apply_pincfgs(codec, pincfgs);
6610 /* share DAC to have unified volume control */
6611 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
6612 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6614 case HDA_FIXUP_ACT_INIT:
6615 /* need to toggle GPIO to enable the amp of back speakers */
6616 alc_update_gpio_data(codec, 0x01, true);
6618 alc_update_gpio_data(codec, 0x01, false);
6623 static void alc285_fixup_hp_spectre_x360(struct hda_codec *codec,
6624 const struct hda_fixup *fix, int action)
6626 static const hda_nid_t conn[] = { 0x02 };
6627 static const struct hda_pintbl pincfgs[] = {
6628 { 0x14, 0x90170110 }, /* rear speaker */
6633 case HDA_FIXUP_ACT_PRE_PROBE:
6634 snd_hda_apply_pincfgs(codec, pincfgs);
6635 /* force front speaker to DAC1 */
6636 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6641 /* for hda_fixup_thinkpad_acpi() */
6642 #include "thinkpad_helper.c"
6644 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
6645 const struct hda_fixup *fix, int action)
6647 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
6648 hda_fixup_thinkpad_acpi(codec, fix, action);
6651 /* Fixup for Lenovo Legion 15IMHg05 speaker output on headset removal. */
6652 static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
6653 const struct hda_fixup *fix,
6656 struct alc_spec *spec = codec->spec;
6659 case HDA_FIXUP_ACT_PRE_PROBE:
6660 spec->gen.suppress_auto_mute = 1;
6665 /* for alc295_fixup_hp_top_speakers */
6666 #include "hp_x360_helper.c"
6668 /* for alc285_fixup_ideapad_s740_coef() */
6669 #include "ideapad_s740_helper.c"
6671 static const struct coef_fw alc256_fixup_set_coef_defaults_coefs[] = {
6672 WRITE_COEF(0x10, 0x0020), WRITE_COEF(0x24, 0x0000),
6673 WRITE_COEF(0x26, 0x0000), WRITE_COEF(0x29, 0x3000),
6674 WRITE_COEF(0x37, 0xfe05), WRITE_COEF(0x45, 0x5089),
6678 static void alc256_fixup_set_coef_defaults(struct hda_codec *codec,
6679 const struct hda_fixup *fix,
6683 * A certain other OS sets these coeffs to different values. On at least
6684 * one TongFang barebone these settings might survive even a cold
6685 * reboot. So to restore a clean slate the values are explicitly reset
6686 * to default here. Without this, the external microphone is always in a
6687 * plugged-in state, while the internal microphone is always in an
6688 * unplugged state, breaking the ability to use the internal microphone.
6690 alc_process_coef_fw(codec, alc256_fixup_set_coef_defaults_coefs);
6693 static const struct coef_fw alc233_fixup_no_audio_jack_coefs[] = {
6694 WRITE_COEF(0x1a, 0x9003), WRITE_COEF(0x1b, 0x0e2b), WRITE_COEF(0x37, 0xfe06),
6695 WRITE_COEF(0x38, 0x4981), WRITE_COEF(0x45, 0xd489), WRITE_COEF(0x46, 0x0074),
6696 WRITE_COEF(0x49, 0x0149),
6700 static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
6701 const struct hda_fixup *fix,
6705 * The audio jack input and output is not detected on the ASRock NUC Box
6706 * 1100 series when cold booting without this fix. Warm rebooting from a
6707 * certain other OS makes the audio functional, as COEF settings are
6708 * preserved in this case. This fix sets these altered COEF values as
6711 alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
6714 static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6715 const struct hda_fixup *fix,
6719 * The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6720 * but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6721 * needs an additional quirk for sound working after suspend and resume.
6723 if (codec->core.vendor_id == 0x10ec0256) {
6724 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6725 snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6727 snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6731 static void alc295_fixup_dell_inspiron_top_speakers(struct hda_codec *codec,
6732 const struct hda_fixup *fix, int action)
6734 static const struct hda_pintbl pincfgs[] = {
6735 { 0x14, 0x90170151 },
6736 { 0x17, 0x90170150 },
6739 static const hda_nid_t conn[] = { 0x02, 0x03 };
6740 static const hda_nid_t preferred_pairs[] = {
6746 struct alc_spec *spec = codec->spec;
6748 alc_fixup_no_shutup(codec, fix, action);
6751 case HDA_FIXUP_ACT_PRE_PROBE:
6752 snd_hda_apply_pincfgs(codec, pincfgs);
6753 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
6754 spec->gen.preferred_dacs = preferred_pairs;
6761 ALC269_FIXUP_SONY_VAIO,
6762 ALC275_FIXUP_SONY_VAIO_GPIO2,
6763 ALC269_FIXUP_DELL_M101Z,
6764 ALC269_FIXUP_SKU_IGNORE,
6765 ALC269_FIXUP_ASUS_G73JW,
6766 ALC269_FIXUP_LENOVO_EAPD,
6767 ALC275_FIXUP_SONY_HWEQ,
6768 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6770 ALC269_FIXUP_PCM_44K,
6771 ALC269_FIXUP_STEREO_DMIC,
6772 ALC269_FIXUP_HEADSET_MIC,
6773 ALC269_FIXUP_QUANTA_MUTE,
6774 ALC269_FIXUP_LIFEBOOK,
6775 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6776 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6777 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6778 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6781 ALC269VB_FIXUP_AMIC,
6782 ALC269VB_FIXUP_DMIC,
6783 ALC269_FIXUP_HP_MUTE_LED,
6784 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6785 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6786 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6787 ALC269_FIXUP_HP_GPIO_LED,
6788 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6789 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6790 ALC269_FIXUP_INV_DMIC,
6791 ALC269_FIXUP_LENOVO_DOCK,
6792 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6793 ALC269_FIXUP_NO_SHUTUP,
6794 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6795 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6796 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6797 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6798 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6799 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6800 ALC269_FIXUP_HEADSET_MODE,
6801 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6802 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6803 ALC269_FIXUP_ASUS_X101_FUNC,
6804 ALC269_FIXUP_ASUS_X101_VERB,
6805 ALC269_FIXUP_ASUS_X101,
6806 ALC271_FIXUP_AMIC_MIC2,
6807 ALC271_FIXUP_HP_GATE_MIC_JACK,
6808 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6809 ALC269_FIXUP_ACER_AC700,
6810 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6811 ALC269VB_FIXUP_ASUS_ZENBOOK,
6812 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6813 ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE,
6814 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6815 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6816 ALC283_FIXUP_CHROME_BOOK,
6817 ALC283_FIXUP_SENSE_COMBO_JACK,
6818 ALC282_FIXUP_ASUS_TX300,
6819 ALC283_FIXUP_INT_MIC,
6820 ALC290_FIXUP_MONO_SPEAKERS,
6821 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6822 ALC290_FIXUP_SUBWOOFER,
6823 ALC290_FIXUP_SUBWOOFER_HSJACK,
6824 ALC269_FIXUP_THINKPAD_ACPI,
6825 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6826 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6827 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6828 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6829 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6830 ALC255_FIXUP_HEADSET_MODE,
6831 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6832 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6833 ALC292_FIXUP_TPT440_DOCK,
6834 ALC292_FIXUP_TPT440,
6835 ALC283_FIXUP_HEADSET_MIC,
6836 ALC255_FIXUP_MIC_MUTE_LED,
6837 ALC282_FIXUP_ASPIRE_V5_PINS,
6838 ALC269VB_FIXUP_ASPIRE_E1_COEF,
6839 ALC280_FIXUP_HP_GPIO4,
6840 ALC286_FIXUP_HP_GPIO_LED,
6841 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6842 ALC280_FIXUP_HP_DOCK_PINS,
6843 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6844 ALC280_FIXUP_HP_9480M,
6845 ALC245_FIXUP_HP_X360_AMP,
6846 ALC285_FIXUP_HP_SPECTRE_X360_EB1,
6847 ALC288_FIXUP_DELL_HEADSET_MODE,
6848 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6849 ALC288_FIXUP_DELL_XPS_13,
6850 ALC288_FIXUP_DISABLE_AAMIX,
6851 ALC292_FIXUP_DELL_E7X_AAMIX,
6852 ALC292_FIXUP_DELL_E7X,
6853 ALC292_FIXUP_DISABLE_AAMIX,
6854 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6855 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6856 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6857 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6858 ALC275_FIXUP_DELL_XPS,
6859 ALC293_FIXUP_LENOVO_SPK_NOISE,
6860 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6861 ALC255_FIXUP_DELL_SPK_NOISE,
6862 ALC225_FIXUP_DISABLE_MIC_VREF,
6863 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6864 ALC295_FIXUP_DISABLE_DAC3,
6865 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6866 ALC280_FIXUP_HP_HEADSET_MIC,
6867 ALC221_FIXUP_HP_FRONT_MIC,
6868 ALC292_FIXUP_TPT460,
6869 ALC298_FIXUP_SPK_VOLUME,
6870 ALC298_FIXUP_LENOVO_SPK_VOLUME,
6871 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6872 ALC269_FIXUP_ATIV_BOOK_8,
6873 ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE,
6874 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6875 ALC256_FIXUP_ASUS_HEADSET_MODE,
6876 ALC256_FIXUP_ASUS_MIC,
6877 ALC256_FIXUP_ASUS_AIO_GPIO2,
6878 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6879 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6880 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6881 ALC233_FIXUP_ACER_HEADSET_MIC,
6882 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6883 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6884 ALC225_FIXUP_S3_POP_NOISE,
6885 ALC700_FIXUP_INTEL_REFERENCE,
6886 ALC274_FIXUP_DELL_BIND_DACS,
6887 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6888 ALC298_FIXUP_TPT470_DOCK_FIX,
6889 ALC298_FIXUP_TPT470_DOCK,
6890 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6891 ALC255_FIXUP_DELL_HEADSET_MIC,
6892 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6893 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6894 ALC295_FIXUP_HP_X360,
6895 ALC221_FIXUP_HP_HEADSET_MIC,
6896 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6897 ALC295_FIXUP_HP_AUTO_MUTE,
6898 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6899 ALC294_FIXUP_ASUS_MIC,
6900 ALC294_FIXUP_ASUS_HEADSET_MIC,
6901 ALC294_FIXUP_ASUS_SPK,
6902 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6903 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6904 ALC255_FIXUP_ACER_HEADSET_MIC,
6905 ALC295_FIXUP_CHROME_BOOK,
6906 ALC225_FIXUP_HEADSET_JACK,
6907 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6908 ALC225_FIXUP_WYSE_AUTO_MUTE,
6909 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6910 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6911 ALC256_FIXUP_ASUS_HEADSET_MIC,
6912 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6913 ALC299_FIXUP_PREDATOR_SPK,
6914 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6915 ALC289_FIXUP_DELL_SPK2,
6916 ALC289_FIXUP_DUAL_SPK,
6917 ALC294_FIXUP_SPK2_TO_DAC1,
6918 ALC294_FIXUP_ASUS_DUAL_SPK,
6919 ALC285_FIXUP_THINKPAD_X1_GEN7,
6920 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6921 ALC294_FIXUP_ASUS_HPE,
6922 ALC294_FIXUP_ASUS_COEF_1B,
6923 ALC294_FIXUP_ASUS_GX502_HP,
6924 ALC294_FIXUP_ASUS_GX502_PINS,
6925 ALC294_FIXUP_ASUS_GX502_VERBS,
6926 ALC294_FIXUP_ASUS_GU502_HP,
6927 ALC294_FIXUP_ASUS_GU502_PINS,
6928 ALC294_FIXUP_ASUS_GU502_VERBS,
6929 ALC294_FIXUP_ASUS_G513_PINS,
6930 ALC285_FIXUP_ASUS_G533Z_PINS,
6931 ALC285_FIXUP_HP_GPIO_LED,
6932 ALC285_FIXUP_HP_MUTE_LED,
6933 ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED,
6934 ALC236_FIXUP_HP_GPIO_LED,
6935 ALC236_FIXUP_HP_MUTE_LED,
6936 ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
6937 ALC298_FIXUP_SAMSUNG_AMP,
6938 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6939 ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6940 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6941 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6942 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6943 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6944 ALC289_FIXUP_ASUS_GA401,
6945 ALC289_FIXUP_ASUS_GA502,
6946 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6947 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6948 ALC269_FIXUP_CZC_B20,
6949 ALC269_FIXUP_CZC_TMI,
6950 ALC269_FIXUP_CZC_L101,
6951 ALC269_FIXUP_LEMOTE_A1802,
6952 ALC269_FIXUP_LEMOTE_A190X,
6953 ALC256_FIXUP_INTEL_NUC8_RUGGED,
6954 ALC233_FIXUP_INTEL_NUC8_DMIC,
6955 ALC233_FIXUP_INTEL_NUC8_BOOST,
6956 ALC256_FIXUP_INTEL_NUC10,
6957 ALC255_FIXUP_XIAOMI_HEADSET_MIC,
6958 ALC274_FIXUP_HP_MIC,
6959 ALC274_FIXUP_HP_HEADSET_MIC,
6960 ALC274_FIXUP_HP_ENVY_GPIO,
6961 ALC256_FIXUP_ASUS_HPE,
6962 ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
6963 ALC287_FIXUP_HP_GPIO_LED,
6964 ALC256_FIXUP_HP_HEADSET_MIC,
6965 ALC245_FIXUP_HP_GPIO_LED,
6966 ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
6967 ALC282_FIXUP_ACER_DISABLE_LINEOUT,
6968 ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST,
6969 ALC256_FIXUP_ACER_HEADSET_MIC,
6970 ALC285_FIXUP_IDEAPAD_S740_COEF,
6971 ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6972 ALC295_FIXUP_ASUS_DACS,
6973 ALC295_FIXUP_HP_OMEN,
6974 ALC285_FIXUP_HP_SPECTRE_X360,
6975 ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP,
6976 ALC623_FIXUP_LENOVO_THINKSTATION_P340,
6977 ALC255_FIXUP_ACER_HEADPHONE_AND_MIC,
6978 ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST,
6979 ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
6980 ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
6981 ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
6982 ALC298_FIXUP_LENOVO_C940_DUET7,
6983 ALC287_FIXUP_13S_GEN2_SPEAKERS,
6984 ALC256_FIXUP_SET_COEF_DEFAULTS,
6985 ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6986 ALC233_FIXUP_NO_AUDIO_JACK,
6987 ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
6988 ALC285_FIXUP_LEGION_Y9000X_SPEAKERS,
6989 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
6990 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED,
6991 ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS,
6992 ALC236_FIXUP_DELL_DUAL_CODECS,
6995 /* A special fixup for Lenovo C940 and Yoga Duet 7;
6996 * both have the very same PCI SSID, and we need to apply different fixups
6997 * depending on the codec ID
6999 static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
7000 const struct hda_fixup *fix,
7005 if (codec->core.vendor_id == 0x10ec0298)
7006 id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
7008 id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
7009 __snd_hda_apply_fixup(codec, id, action, 0);
7012 static const struct hda_fixup alc269_fixups[] = {
7013 [ALC269_FIXUP_GPIO2] = {
7014 .type = HDA_FIXUP_FUNC,
7015 .v.func = alc_fixup_gpio2,
7017 [ALC269_FIXUP_SONY_VAIO] = {
7018 .type = HDA_FIXUP_PINCTLS,
7019 .v.pins = (const struct hda_pintbl[]) {
7020 {0x19, PIN_VREFGRD},
7024 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
7025 .type = HDA_FIXUP_FUNC,
7026 .v.func = alc275_fixup_gpio4_off,
7028 .chain_id = ALC269_FIXUP_SONY_VAIO
7030 [ALC269_FIXUP_DELL_M101Z] = {
7031 .type = HDA_FIXUP_VERBS,
7032 .v.verbs = (const struct hda_verb[]) {
7033 /* Enables internal speaker */
7034 {0x20, AC_VERB_SET_COEF_INDEX, 13},
7035 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
7039 [ALC269_FIXUP_SKU_IGNORE] = {
7040 .type = HDA_FIXUP_FUNC,
7041 .v.func = alc_fixup_sku_ignore,
7043 [ALC269_FIXUP_ASUS_G73JW] = {
7044 .type = HDA_FIXUP_PINS,
7045 .v.pins = (const struct hda_pintbl[]) {
7046 { 0x17, 0x99130111 }, /* subwoofer */
7050 [ALC269_FIXUP_LENOVO_EAPD] = {
7051 .type = HDA_FIXUP_VERBS,
7052 .v.verbs = (const struct hda_verb[]) {
7053 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
7057 [ALC275_FIXUP_SONY_HWEQ] = {
7058 .type = HDA_FIXUP_FUNC,
7059 .v.func = alc269_fixup_hweq,
7061 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
7063 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
7064 .type = HDA_FIXUP_FUNC,
7065 .v.func = alc_fixup_disable_aamix,
7067 .chain_id = ALC269_FIXUP_SONY_VAIO
7069 [ALC271_FIXUP_DMIC] = {
7070 .type = HDA_FIXUP_FUNC,
7071 .v.func = alc271_fixup_dmic,
7073 [ALC269_FIXUP_PCM_44K] = {
7074 .type = HDA_FIXUP_FUNC,
7075 .v.func = alc269_fixup_pcm_44k,
7077 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7079 [ALC269_FIXUP_STEREO_DMIC] = {
7080 .type = HDA_FIXUP_FUNC,
7081 .v.func = alc269_fixup_stereo_dmic,
7083 [ALC269_FIXUP_HEADSET_MIC] = {
7084 .type = HDA_FIXUP_FUNC,
7085 .v.func = alc269_fixup_headset_mic,
7087 [ALC269_FIXUP_QUANTA_MUTE] = {
7088 .type = HDA_FIXUP_FUNC,
7089 .v.func = alc269_fixup_quanta_mute,
7091 [ALC269_FIXUP_LIFEBOOK] = {
7092 .type = HDA_FIXUP_PINS,
7093 .v.pins = (const struct hda_pintbl[]) {
7094 { 0x1a, 0x2101103f }, /* dock line-out */
7095 { 0x1b, 0x23a11040 }, /* dock mic-in */
7099 .chain_id = ALC269_FIXUP_QUANTA_MUTE
7101 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
7102 .type = HDA_FIXUP_PINS,
7103 .v.pins = (const struct hda_pintbl[]) {
7104 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
7108 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
7109 .type = HDA_FIXUP_PINS,
7110 .v.pins = (const struct hda_pintbl[]) {
7111 { 0x21, 0x0221102f }, /* HP out */
7115 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
7116 .type = HDA_FIXUP_FUNC,
7117 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7119 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
7120 .type = HDA_FIXUP_FUNC,
7121 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
7123 [ALC269_FIXUP_AMIC] = {
7124 .type = HDA_FIXUP_PINS,
7125 .v.pins = (const struct hda_pintbl[]) {
7126 { 0x14, 0x99130110 }, /* speaker */
7127 { 0x15, 0x0121401f }, /* HP out */
7128 { 0x18, 0x01a19c20 }, /* mic */
7129 { 0x19, 0x99a3092f }, /* int-mic */
7133 [ALC269_FIXUP_DMIC] = {
7134 .type = HDA_FIXUP_PINS,
7135 .v.pins = (const struct hda_pintbl[]) {
7136 { 0x12, 0x99a3092f }, /* int-mic */
7137 { 0x14, 0x99130110 }, /* speaker */
7138 { 0x15, 0x0121401f }, /* HP out */
7139 { 0x18, 0x01a19c20 }, /* mic */
7143 [ALC269VB_FIXUP_AMIC] = {
7144 .type = HDA_FIXUP_PINS,
7145 .v.pins = (const struct hda_pintbl[]) {
7146 { 0x14, 0x99130110 }, /* speaker */
7147 { 0x18, 0x01a19c20 }, /* mic */
7148 { 0x19, 0x99a3092f }, /* int-mic */
7149 { 0x21, 0x0121401f }, /* HP out */
7153 [ALC269VB_FIXUP_DMIC] = {
7154 .type = HDA_FIXUP_PINS,
7155 .v.pins = (const struct hda_pintbl[]) {
7156 { 0x12, 0x99a3092f }, /* int-mic */
7157 { 0x14, 0x99130110 }, /* speaker */
7158 { 0x18, 0x01a19c20 }, /* mic */
7159 { 0x21, 0x0121401f }, /* HP out */
7163 [ALC269_FIXUP_HP_MUTE_LED] = {
7164 .type = HDA_FIXUP_FUNC,
7165 .v.func = alc269_fixup_hp_mute_led,
7167 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
7168 .type = HDA_FIXUP_FUNC,
7169 .v.func = alc269_fixup_hp_mute_led_mic1,
7171 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
7172 .type = HDA_FIXUP_FUNC,
7173 .v.func = alc269_fixup_hp_mute_led_mic2,
7175 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
7176 .type = HDA_FIXUP_FUNC,
7177 .v.func = alc269_fixup_hp_mute_led_mic3,
7179 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
7181 [ALC269_FIXUP_HP_GPIO_LED] = {
7182 .type = HDA_FIXUP_FUNC,
7183 .v.func = alc269_fixup_hp_gpio_led,
7185 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
7186 .type = HDA_FIXUP_FUNC,
7187 .v.func = alc269_fixup_hp_gpio_mic1_led,
7189 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
7190 .type = HDA_FIXUP_FUNC,
7191 .v.func = alc269_fixup_hp_line1_mic1_led,
7193 [ALC269_FIXUP_INV_DMIC] = {
7194 .type = HDA_FIXUP_FUNC,
7195 .v.func = alc_fixup_inv_dmic,
7197 [ALC269_FIXUP_NO_SHUTUP] = {
7198 .type = HDA_FIXUP_FUNC,
7199 .v.func = alc_fixup_no_shutup,
7201 [ALC269_FIXUP_LENOVO_DOCK] = {
7202 .type = HDA_FIXUP_PINS,
7203 .v.pins = (const struct hda_pintbl[]) {
7204 { 0x19, 0x23a11040 }, /* dock mic */
7205 { 0x1b, 0x2121103f }, /* dock headphone */
7209 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
7211 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
7212 .type = HDA_FIXUP_FUNC,
7213 .v.func = alc269_fixup_limit_int_mic_boost,
7215 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
7217 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
7218 .type = HDA_FIXUP_FUNC,
7219 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
7221 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7223 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7224 .type = HDA_FIXUP_PINS,
7225 .v.pins = (const struct hda_pintbl[]) {
7226 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7227 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7231 .chain_id = ALC269_FIXUP_HEADSET_MODE
7233 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7234 .type = HDA_FIXUP_PINS,
7235 .v.pins = (const struct hda_pintbl[]) {
7236 { 0x16, 0x21014020 }, /* dock line out */
7237 { 0x19, 0x21a19030 }, /* dock mic */
7238 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7242 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7244 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
7245 .type = HDA_FIXUP_PINS,
7246 .v.pins = (const struct hda_pintbl[]) {
7247 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7251 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7253 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
7254 .type = HDA_FIXUP_PINS,
7255 .v.pins = (const struct hda_pintbl[]) {
7256 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7257 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7261 .chain_id = ALC269_FIXUP_HEADSET_MODE
7263 [ALC269_FIXUP_HEADSET_MODE] = {
7264 .type = HDA_FIXUP_FUNC,
7265 .v.func = alc_fixup_headset_mode,
7267 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7269 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7270 .type = HDA_FIXUP_FUNC,
7271 .v.func = alc_fixup_headset_mode_no_hp_mic,
7273 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
7274 .type = HDA_FIXUP_PINS,
7275 .v.pins = (const struct hda_pintbl[]) {
7276 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
7280 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7282 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
7283 .type = HDA_FIXUP_PINS,
7284 .v.pins = (const struct hda_pintbl[]) {
7285 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7289 .chain_id = ALC269_FIXUP_HEADSET_MIC
7291 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
7292 .type = HDA_FIXUP_PINS,
7293 .v.pins = (const struct hda_pintbl[]) {
7307 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7309 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
7310 .type = HDA_FIXUP_FUNC,
7311 .v.func = alc298_fixup_huawei_mbx_stereo,
7313 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7315 [ALC269_FIXUP_ASUS_X101_FUNC] = {
7316 .type = HDA_FIXUP_FUNC,
7317 .v.func = alc269_fixup_x101_headset_mic,
7319 [ALC269_FIXUP_ASUS_X101_VERB] = {
7320 .type = HDA_FIXUP_VERBS,
7321 .v.verbs = (const struct hda_verb[]) {
7322 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
7323 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
7324 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
7328 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
7330 [ALC269_FIXUP_ASUS_X101] = {
7331 .type = HDA_FIXUP_PINS,
7332 .v.pins = (const struct hda_pintbl[]) {
7333 { 0x18, 0x04a1182c }, /* Headset mic */
7337 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
7339 [ALC271_FIXUP_AMIC_MIC2] = {
7340 .type = HDA_FIXUP_PINS,
7341 .v.pins = (const struct hda_pintbl[]) {
7342 { 0x14, 0x99130110 }, /* speaker */
7343 { 0x19, 0x01a19c20 }, /* mic */
7344 { 0x1b, 0x99a7012f }, /* int-mic */
7345 { 0x21, 0x0121401f }, /* HP out */
7349 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
7350 .type = HDA_FIXUP_FUNC,
7351 .v.func = alc271_hp_gate_mic_jack,
7353 .chain_id = ALC271_FIXUP_AMIC_MIC2,
7355 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
7356 .type = HDA_FIXUP_FUNC,
7357 .v.func = alc269_fixup_limit_int_mic_boost,
7359 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
7361 [ALC269_FIXUP_ACER_AC700] = {
7362 .type = HDA_FIXUP_PINS,
7363 .v.pins = (const struct hda_pintbl[]) {
7364 { 0x12, 0x99a3092f }, /* int-mic */
7365 { 0x14, 0x99130110 }, /* speaker */
7366 { 0x18, 0x03a11c20 }, /* mic */
7367 { 0x1e, 0x0346101e }, /* SPDIF1 */
7368 { 0x21, 0x0321101f }, /* HP out */
7372 .chain_id = ALC271_FIXUP_DMIC,
7374 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
7375 .type = HDA_FIXUP_FUNC,
7376 .v.func = alc269_fixup_limit_int_mic_boost,
7378 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7380 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
7381 .type = HDA_FIXUP_FUNC,
7382 .v.func = alc269_fixup_limit_int_mic_boost,
7384 .chain_id = ALC269VB_FIXUP_DMIC,
7386 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
7387 .type = HDA_FIXUP_VERBS,
7388 .v.verbs = (const struct hda_verb[]) {
7389 /* class-D output amp +5dB */
7390 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
7391 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
7395 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
7397 [ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7398 .type = HDA_FIXUP_PINS,
7399 .v.pins = (const struct hda_pintbl[]) {
7400 { 0x18, 0x01a110f0 }, /* use as headset mic */
7404 .chain_id = ALC269_FIXUP_HEADSET_MIC
7406 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
7407 .type = HDA_FIXUP_FUNC,
7408 .v.func = alc269_fixup_limit_int_mic_boost,
7410 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
7412 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
7413 .type = HDA_FIXUP_PINS,
7414 .v.pins = (const struct hda_pintbl[]) {
7415 { 0x12, 0x99a3092f }, /* int-mic */
7416 { 0x18, 0x03a11d20 }, /* mic */
7417 { 0x19, 0x411111f0 }, /* Unused bogus pin */
7421 [ALC283_FIXUP_CHROME_BOOK] = {
7422 .type = HDA_FIXUP_FUNC,
7423 .v.func = alc283_fixup_chromebook,
7425 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
7426 .type = HDA_FIXUP_FUNC,
7427 .v.func = alc283_fixup_sense_combo_jack,
7429 .chain_id = ALC283_FIXUP_CHROME_BOOK,
7431 [ALC282_FIXUP_ASUS_TX300] = {
7432 .type = HDA_FIXUP_FUNC,
7433 .v.func = alc282_fixup_asus_tx300,
7435 [ALC283_FIXUP_INT_MIC] = {
7436 .type = HDA_FIXUP_VERBS,
7437 .v.verbs = (const struct hda_verb[]) {
7438 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
7439 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
7443 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7445 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
7446 .type = HDA_FIXUP_PINS,
7447 .v.pins = (const struct hda_pintbl[]) {
7448 { 0x17, 0x90170112 }, /* subwoofer */
7452 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
7454 [ALC290_FIXUP_SUBWOOFER] = {
7455 .type = HDA_FIXUP_PINS,
7456 .v.pins = (const struct hda_pintbl[]) {
7457 { 0x17, 0x90170112 }, /* subwoofer */
7461 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
7463 [ALC290_FIXUP_MONO_SPEAKERS] = {
7464 .type = HDA_FIXUP_FUNC,
7465 .v.func = alc290_fixup_mono_speakers,
7467 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
7468 .type = HDA_FIXUP_FUNC,
7469 .v.func = alc290_fixup_mono_speakers,
7471 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7473 [ALC269_FIXUP_THINKPAD_ACPI] = {
7474 .type = HDA_FIXUP_FUNC,
7475 .v.func = alc_fixup_thinkpad_acpi,
7477 .chain_id = ALC269_FIXUP_SKU_IGNORE,
7479 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
7480 .type = HDA_FIXUP_FUNC,
7481 .v.func = alc_fixup_inv_dmic,
7483 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
7485 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
7486 .type = HDA_FIXUP_PINS,
7487 .v.pins = (const struct hda_pintbl[]) {
7488 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7492 .chain_id = ALC255_FIXUP_HEADSET_MODE
7494 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7495 .type = HDA_FIXUP_PINS,
7496 .v.pins = (const struct hda_pintbl[]) {
7497 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7501 .chain_id = ALC255_FIXUP_HEADSET_MODE
7503 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7504 .type = HDA_FIXUP_PINS,
7505 .v.pins = (const struct hda_pintbl[]) {
7506 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7507 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7511 .chain_id = ALC255_FIXUP_HEADSET_MODE
7513 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
7514 .type = HDA_FIXUP_PINS,
7515 .v.pins = (const struct hda_pintbl[]) {
7516 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7520 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7522 [ALC255_FIXUP_HEADSET_MODE] = {
7523 .type = HDA_FIXUP_FUNC,
7524 .v.func = alc_fixup_headset_mode_alc255,
7526 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7528 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
7529 .type = HDA_FIXUP_FUNC,
7530 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
7532 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7533 .type = HDA_FIXUP_PINS,
7534 .v.pins = (const struct hda_pintbl[]) {
7535 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7536 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7540 .chain_id = ALC269_FIXUP_HEADSET_MODE
7542 [ALC292_FIXUP_TPT440_DOCK] = {
7543 .type = HDA_FIXUP_FUNC,
7544 .v.func = alc_fixup_tpt440_dock,
7546 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
7548 [ALC292_FIXUP_TPT440] = {
7549 .type = HDA_FIXUP_FUNC,
7550 .v.func = alc_fixup_disable_aamix,
7552 .chain_id = ALC292_FIXUP_TPT440_DOCK,
7554 [ALC283_FIXUP_HEADSET_MIC] = {
7555 .type = HDA_FIXUP_PINS,
7556 .v.pins = (const struct hda_pintbl[]) {
7557 { 0x19, 0x04a110f0 },
7561 [ALC255_FIXUP_MIC_MUTE_LED] = {
7562 .type = HDA_FIXUP_FUNC,
7563 .v.func = alc_fixup_micmute_led,
7565 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
7566 .type = HDA_FIXUP_PINS,
7567 .v.pins = (const struct hda_pintbl[]) {
7568 { 0x12, 0x90a60130 },
7569 { 0x14, 0x90170110 },
7570 { 0x17, 0x40000008 },
7571 { 0x18, 0x411111f0 },
7572 { 0x19, 0x01a1913c },
7573 { 0x1a, 0x411111f0 },
7574 { 0x1b, 0x411111f0 },
7575 { 0x1d, 0x40f89b2d },
7576 { 0x1e, 0x411111f0 },
7577 { 0x21, 0x0321101f },
7581 [ALC269VB_FIXUP_ASPIRE_E1_COEF] = {
7582 .type = HDA_FIXUP_FUNC,
7583 .v.func = alc269vb_fixup_aspire_e1_coef,
7585 [ALC280_FIXUP_HP_GPIO4] = {
7586 .type = HDA_FIXUP_FUNC,
7587 .v.func = alc280_fixup_hp_gpio4,
7589 [ALC286_FIXUP_HP_GPIO_LED] = {
7590 .type = HDA_FIXUP_FUNC,
7591 .v.func = alc286_fixup_hp_gpio_led,
7593 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
7594 .type = HDA_FIXUP_FUNC,
7595 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
7597 [ALC280_FIXUP_HP_DOCK_PINS] = {
7598 .type = HDA_FIXUP_PINS,
7599 .v.pins = (const struct hda_pintbl[]) {
7600 { 0x1b, 0x21011020 }, /* line-out */
7601 { 0x1a, 0x01a1903c }, /* headset mic */
7602 { 0x18, 0x2181103f }, /* line-in */
7606 .chain_id = ALC280_FIXUP_HP_GPIO4
7608 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
7609 .type = HDA_FIXUP_PINS,
7610 .v.pins = (const struct hda_pintbl[]) {
7611 { 0x1b, 0x21011020 }, /* line-out */
7612 { 0x18, 0x2181103f }, /* line-in */
7616 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
7618 [ALC280_FIXUP_HP_9480M] = {
7619 .type = HDA_FIXUP_FUNC,
7620 .v.func = alc280_fixup_hp_9480m,
7622 [ALC245_FIXUP_HP_X360_AMP] = {
7623 .type = HDA_FIXUP_FUNC,
7624 .v.func = alc245_fixup_hp_x360_amp,
7626 .chain_id = ALC245_FIXUP_HP_GPIO_LED
7628 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
7629 .type = HDA_FIXUP_FUNC,
7630 .v.func = alc_fixup_headset_mode_dell_alc288,
7632 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
7634 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7635 .type = HDA_FIXUP_PINS,
7636 .v.pins = (const struct hda_pintbl[]) {
7637 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7638 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7642 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
7644 [ALC288_FIXUP_DISABLE_AAMIX] = {
7645 .type = HDA_FIXUP_FUNC,
7646 .v.func = alc_fixup_disable_aamix,
7648 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
7650 [ALC288_FIXUP_DELL_XPS_13] = {
7651 .type = HDA_FIXUP_FUNC,
7652 .v.func = alc_fixup_dell_xps13,
7654 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
7656 [ALC292_FIXUP_DISABLE_AAMIX] = {
7657 .type = HDA_FIXUP_FUNC,
7658 .v.func = alc_fixup_disable_aamix,
7660 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
7662 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
7663 .type = HDA_FIXUP_FUNC,
7664 .v.func = alc_fixup_disable_aamix,
7666 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
7668 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
7669 .type = HDA_FIXUP_FUNC,
7670 .v.func = alc_fixup_dell_xps13,
7672 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
7674 [ALC292_FIXUP_DELL_E7X] = {
7675 .type = HDA_FIXUP_FUNC,
7676 .v.func = alc_fixup_micmute_led,
7677 /* micmute fixup must be applied at last */
7678 .chained_before = true,
7679 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
7681 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
7682 .type = HDA_FIXUP_PINS,
7683 .v.pins = (const struct hda_pintbl[]) {
7684 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
7687 .chained_before = true,
7688 .chain_id = ALC269_FIXUP_HEADSET_MODE,
7690 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7691 .type = HDA_FIXUP_PINS,
7692 .v.pins = (const struct hda_pintbl[]) {
7693 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7694 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7698 .chain_id = ALC269_FIXUP_HEADSET_MODE
7700 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
7701 .type = HDA_FIXUP_PINS,
7702 .v.pins = (const struct hda_pintbl[]) {
7703 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7707 .chain_id = ALC269_FIXUP_HEADSET_MODE
7709 [ALC275_FIXUP_DELL_XPS] = {
7710 .type = HDA_FIXUP_VERBS,
7711 .v.verbs = (const struct hda_verb[]) {
7712 /* Enables internal speaker */
7713 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
7714 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
7715 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
7716 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
7720 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
7721 .type = HDA_FIXUP_FUNC,
7722 .v.func = alc_fixup_disable_aamix,
7724 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7726 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
7727 .type = HDA_FIXUP_FUNC,
7728 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
7730 [ALC233_FIXUP_INTEL_NUC8_DMIC] = {
7731 .type = HDA_FIXUP_FUNC,
7732 .v.func = alc_fixup_inv_dmic,
7734 .chain_id = ALC233_FIXUP_INTEL_NUC8_BOOST,
7736 [ALC233_FIXUP_INTEL_NUC8_BOOST] = {
7737 .type = HDA_FIXUP_FUNC,
7738 .v.func = alc269_fixup_limit_int_mic_boost
7740 [ALC255_FIXUP_DELL_SPK_NOISE] = {
7741 .type = HDA_FIXUP_FUNC,
7742 .v.func = alc_fixup_disable_aamix,
7744 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7746 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
7747 .type = HDA_FIXUP_FUNC,
7748 .v.func = alc_fixup_disable_mic_vref,
7750 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7752 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
7753 .type = HDA_FIXUP_VERBS,
7754 .v.verbs = (const struct hda_verb[]) {
7755 /* Disable pass-through path for FRONT 14h */
7756 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7757 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7761 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
7763 [ALC280_FIXUP_HP_HEADSET_MIC] = {
7764 .type = HDA_FIXUP_FUNC,
7765 .v.func = alc_fixup_disable_aamix,
7767 .chain_id = ALC269_FIXUP_HEADSET_MIC,
7769 [ALC221_FIXUP_HP_FRONT_MIC] = {
7770 .type = HDA_FIXUP_PINS,
7771 .v.pins = (const struct hda_pintbl[]) {
7772 { 0x19, 0x02a19020 }, /* Front Mic */
7776 [ALC292_FIXUP_TPT460] = {
7777 .type = HDA_FIXUP_FUNC,
7778 .v.func = alc_fixup_tpt440_dock,
7780 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
7782 [ALC298_FIXUP_SPK_VOLUME] = {
7783 .type = HDA_FIXUP_FUNC,
7784 .v.func = alc298_fixup_speaker_volume,
7786 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
7788 [ALC298_FIXUP_LENOVO_SPK_VOLUME] = {
7789 .type = HDA_FIXUP_FUNC,
7790 .v.func = alc298_fixup_speaker_volume,
7792 [ALC295_FIXUP_DISABLE_DAC3] = {
7793 .type = HDA_FIXUP_FUNC,
7794 .v.func = alc295_fixup_disable_dac3,
7796 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
7797 .type = HDA_FIXUP_FUNC,
7798 .v.func = alc285_fixup_speaker2_to_dac1,
7800 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7802 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
7803 .type = HDA_FIXUP_PINS,
7804 .v.pins = (const struct hda_pintbl[]) {
7805 { 0x1b, 0x90170151 },
7809 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7811 [ALC269_FIXUP_ATIV_BOOK_8] = {
7812 .type = HDA_FIXUP_FUNC,
7813 .v.func = alc_fixup_auto_mute_via_amp,
7815 .chain_id = ALC269_FIXUP_NO_SHUTUP
7817 [ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE] = {
7818 .type = HDA_FIXUP_PINS,
7819 .v.pins = (const struct hda_pintbl[]) {
7820 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7821 { 0x1a, 0x01813030 }, /* use as headphone mic, without its own jack detect */
7825 .chain_id = ALC269_FIXUP_HEADSET_MODE
7827 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
7828 .type = HDA_FIXUP_PINS,
7829 .v.pins = (const struct hda_pintbl[]) {
7830 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7831 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7835 .chain_id = ALC269_FIXUP_HEADSET_MODE
7837 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
7838 .type = HDA_FIXUP_FUNC,
7839 .v.func = alc_fixup_headset_mode,
7841 [ALC256_FIXUP_ASUS_MIC] = {
7842 .type = HDA_FIXUP_PINS,
7843 .v.pins = (const struct hda_pintbl[]) {
7844 { 0x13, 0x90a60160 }, /* use as internal mic */
7845 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7849 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7851 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
7852 .type = HDA_FIXUP_FUNC,
7853 /* Set up GPIO2 for the speaker amp */
7854 .v.func = alc_fixup_gpio4,
7856 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7857 .type = HDA_FIXUP_PINS,
7858 .v.pins = (const struct hda_pintbl[]) {
7859 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7863 .chain_id = ALC269_FIXUP_HEADSET_MIC
7865 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
7866 .type = HDA_FIXUP_VERBS,
7867 .v.verbs = (const struct hda_verb[]) {
7868 /* Enables internal speaker */
7869 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
7870 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
7874 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7876 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
7877 .type = HDA_FIXUP_FUNC,
7878 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
7880 .chain_id = ALC269_FIXUP_GPIO2
7882 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
7883 .type = HDA_FIXUP_VERBS,
7884 .v.verbs = (const struct hda_verb[]) {
7885 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7886 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7890 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7892 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7893 .type = HDA_FIXUP_PINS,
7894 .v.pins = (const struct hda_pintbl[]) {
7895 /* Change the mic location from front to right, otherwise there are
7896 two front mics with the same name, pulseaudio can't handle them.
7897 This is just a temporary workaround, after applying this fixup,
7898 there will be one "Front Mic" and one "Mic" in this machine.
7900 { 0x1a, 0x04a19040 },
7904 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7905 .type = HDA_FIXUP_PINS,
7906 .v.pins = (const struct hda_pintbl[]) {
7907 { 0x16, 0x0101102f }, /* Rear Headset HP */
7908 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7909 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7910 { 0x1b, 0x02011020 },
7914 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7916 [ALC225_FIXUP_S3_POP_NOISE] = {
7917 .type = HDA_FIXUP_FUNC,
7918 .v.func = alc225_fixup_s3_pop_noise,
7920 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7922 [ALC700_FIXUP_INTEL_REFERENCE] = {
7923 .type = HDA_FIXUP_VERBS,
7924 .v.verbs = (const struct hda_verb[]) {
7925 /* Enables internal speaker */
7926 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7927 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7928 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7929 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7930 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7931 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7932 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7933 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7937 [ALC274_FIXUP_DELL_BIND_DACS] = {
7938 .type = HDA_FIXUP_FUNC,
7939 .v.func = alc274_fixup_bind_dacs,
7941 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7943 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7944 .type = HDA_FIXUP_PINS,
7945 .v.pins = (const struct hda_pintbl[]) {
7946 { 0x1b, 0x0401102f },
7950 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7952 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7953 .type = HDA_FIXUP_FUNC,
7954 .v.func = alc_fixup_tpt470_dock,
7956 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7958 [ALC298_FIXUP_TPT470_DOCK] = {
7959 .type = HDA_FIXUP_FUNC,
7960 .v.func = alc_fixup_tpt470_dacs,
7962 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7964 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7965 .type = HDA_FIXUP_PINS,
7966 .v.pins = (const struct hda_pintbl[]) {
7967 { 0x14, 0x0201101f },
7971 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7973 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7974 .type = HDA_FIXUP_PINS,
7975 .v.pins = (const struct hda_pintbl[]) {
7976 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7980 .chain_id = ALC269_FIXUP_HEADSET_MIC
7982 [ALC295_FIXUP_HP_X360] = {
7983 .type = HDA_FIXUP_FUNC,
7984 .v.func = alc295_fixup_hp_top_speakers,
7986 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7988 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7989 .type = HDA_FIXUP_PINS,
7990 .v.pins = (const struct hda_pintbl[]) {
7991 { 0x19, 0x0181313f},
7995 .chain_id = ALC269_FIXUP_HEADSET_MIC
7997 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7998 .type = HDA_FIXUP_FUNC,
7999 .v.func = alc285_fixup_invalidate_dacs,
8001 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8003 [ALC295_FIXUP_HP_AUTO_MUTE] = {
8004 .type = HDA_FIXUP_FUNC,
8005 .v.func = alc_fixup_auto_mute_via_amp,
8007 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
8008 .type = HDA_FIXUP_PINS,
8009 .v.pins = (const struct hda_pintbl[]) {
8010 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8014 .chain_id = ALC269_FIXUP_HEADSET_MIC
8016 [ALC294_FIXUP_ASUS_MIC] = {
8017 .type = HDA_FIXUP_PINS,
8018 .v.pins = (const struct hda_pintbl[]) {
8019 { 0x13, 0x90a60160 }, /* use as internal mic */
8020 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8024 .chain_id = ALC269_FIXUP_HEADSET_MIC
8026 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
8027 .type = HDA_FIXUP_PINS,
8028 .v.pins = (const struct hda_pintbl[]) {
8029 { 0x19, 0x01a1103c }, /* use as headset mic */
8033 .chain_id = ALC269_FIXUP_HEADSET_MIC
8035 [ALC294_FIXUP_ASUS_SPK] = {
8036 .type = HDA_FIXUP_VERBS,
8037 .v.verbs = (const struct hda_verb[]) {
8039 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
8040 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
8041 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8042 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8046 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8048 [ALC295_FIXUP_CHROME_BOOK] = {
8049 .type = HDA_FIXUP_FUNC,
8050 .v.func = alc295_fixup_chromebook,
8052 .chain_id = ALC225_FIXUP_HEADSET_JACK
8054 [ALC225_FIXUP_HEADSET_JACK] = {
8055 .type = HDA_FIXUP_FUNC,
8056 .v.func = alc_fixup_headset_jack,
8058 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8059 .type = HDA_FIXUP_PINS,
8060 .v.pins = (const struct hda_pintbl[]) {
8061 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8065 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8067 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
8068 .type = HDA_FIXUP_VERBS,
8069 .v.verbs = (const struct hda_verb[]) {
8070 /* Disable PCBEEP-IN passthrough */
8071 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
8072 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
8076 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
8078 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
8079 .type = HDA_FIXUP_PINS,
8080 .v.pins = (const struct hda_pintbl[]) {
8081 { 0x19, 0x03a11130 },
8082 { 0x1a, 0x90a60140 }, /* use as internal mic */
8086 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
8088 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
8089 .type = HDA_FIXUP_PINS,
8090 .v.pins = (const struct hda_pintbl[]) {
8091 { 0x16, 0x01011020 }, /* Rear Line out */
8092 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
8096 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
8098 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
8099 .type = HDA_FIXUP_FUNC,
8100 .v.func = alc_fixup_auto_mute_via_amp,
8102 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
8104 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
8105 .type = HDA_FIXUP_FUNC,
8106 .v.func = alc_fixup_disable_mic_vref,
8108 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8110 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
8111 .type = HDA_FIXUP_VERBS,
8112 .v.verbs = (const struct hda_verb[]) {
8113 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
8114 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
8118 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
8120 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
8121 .type = HDA_FIXUP_PINS,
8122 .v.pins = (const struct hda_pintbl[]) {
8123 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8127 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8129 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8130 .type = HDA_FIXUP_PINS,
8131 .v.pins = (const struct hda_pintbl[]) {
8132 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
8136 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8138 [ALC299_FIXUP_PREDATOR_SPK] = {
8139 .type = HDA_FIXUP_PINS,
8140 .v.pins = (const struct hda_pintbl[]) {
8141 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
8145 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
8146 .type = HDA_FIXUP_PINS,
8147 .v.pins = (const struct hda_pintbl[]) {
8148 { 0x19, 0x04a11040 },
8149 { 0x21, 0x04211020 },
8153 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8155 [ALC289_FIXUP_DELL_SPK2] = {
8156 .type = HDA_FIXUP_PINS,
8157 .v.pins = (const struct hda_pintbl[]) {
8158 { 0x17, 0x90170130 }, /* bass spk */
8162 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
8164 [ALC289_FIXUP_DUAL_SPK] = {
8165 .type = HDA_FIXUP_FUNC,
8166 .v.func = alc285_fixup_speaker2_to_dac1,
8168 .chain_id = ALC289_FIXUP_DELL_SPK2
8170 [ALC294_FIXUP_SPK2_TO_DAC1] = {
8171 .type = HDA_FIXUP_FUNC,
8172 .v.func = alc285_fixup_speaker2_to_dac1,
8174 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8176 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
8177 .type = HDA_FIXUP_FUNC,
8178 /* The GPIO must be pulled to initialize the AMP */
8179 .v.func = alc_fixup_gpio4,
8181 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
8183 [ALC285_FIXUP_THINKPAD_X1_GEN7] = {
8184 .type = HDA_FIXUP_FUNC,
8185 .v.func = alc285_fixup_thinkpad_x1_gen7,
8187 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8189 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
8190 .type = HDA_FIXUP_FUNC,
8191 .v.func = alc_fixup_headset_jack,
8193 .chain_id = ALC285_FIXUP_THINKPAD_X1_GEN7
8195 [ALC294_FIXUP_ASUS_HPE] = {
8196 .type = HDA_FIXUP_VERBS,
8197 .v.verbs = (const struct hda_verb[]) {
8199 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8200 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
8204 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8206 [ALC294_FIXUP_ASUS_GX502_PINS] = {
8207 .type = HDA_FIXUP_PINS,
8208 .v.pins = (const struct hda_pintbl[]) {
8209 { 0x19, 0x03a11050 }, /* front HP mic */
8210 { 0x1a, 0x01a11830 }, /* rear external mic */
8211 { 0x21, 0x03211020 }, /* front HP out */
8215 .chain_id = ALC294_FIXUP_ASUS_GX502_VERBS
8217 [ALC294_FIXUP_ASUS_GX502_VERBS] = {
8218 .type = HDA_FIXUP_VERBS,
8219 .v.verbs = (const struct hda_verb[]) {
8220 /* set 0x15 to HP-OUT ctrl */
8221 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8222 /* unmute the 0x15 amp */
8223 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8227 .chain_id = ALC294_FIXUP_ASUS_GX502_HP
8229 [ALC294_FIXUP_ASUS_GX502_HP] = {
8230 .type = HDA_FIXUP_FUNC,
8231 .v.func = alc294_fixup_gx502_hp,
8233 [ALC294_FIXUP_ASUS_GU502_PINS] = {
8234 .type = HDA_FIXUP_PINS,
8235 .v.pins = (const struct hda_pintbl[]) {
8236 { 0x19, 0x01a11050 }, /* rear HP mic */
8237 { 0x1a, 0x01a11830 }, /* rear external mic */
8238 { 0x21, 0x012110f0 }, /* rear HP out */
8242 .chain_id = ALC294_FIXUP_ASUS_GU502_VERBS
8244 [ALC294_FIXUP_ASUS_GU502_VERBS] = {
8245 .type = HDA_FIXUP_VERBS,
8246 .v.verbs = (const struct hda_verb[]) {
8247 /* set 0x15 to HP-OUT ctrl */
8248 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0 },
8249 /* unmute the 0x15 amp */
8250 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000 },
8251 /* set 0x1b to HP-OUT */
8252 { 0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24 },
8256 .chain_id = ALC294_FIXUP_ASUS_GU502_HP
8258 [ALC294_FIXUP_ASUS_GU502_HP] = {
8259 .type = HDA_FIXUP_FUNC,
8260 .v.func = alc294_fixup_gu502_hp,
8262 [ALC294_FIXUP_ASUS_G513_PINS] = {
8263 .type = HDA_FIXUP_PINS,
8264 .v.pins = (const struct hda_pintbl[]) {
8265 { 0x19, 0x03a11050 }, /* front HP mic */
8266 { 0x1a, 0x03a11c30 }, /* rear external mic */
8267 { 0x21, 0x03211420 }, /* front HP out */
8271 [ALC285_FIXUP_ASUS_G533Z_PINS] = {
8272 .type = HDA_FIXUP_PINS,
8273 .v.pins = (const struct hda_pintbl[]) {
8274 { 0x14, 0x90170152 }, /* Speaker Surround Playback Switch */
8275 { 0x19, 0x03a19020 }, /* Mic Boost Volume */
8276 { 0x1a, 0x03a11c30 }, /* Mic Boost Volume */
8277 { 0x1e, 0x90170151 }, /* Rear jack, IN OUT EAPD Detect */
8278 { 0x21, 0x03211420 },
8282 [ALC294_FIXUP_ASUS_COEF_1B] = {
8283 .type = HDA_FIXUP_VERBS,
8284 .v.verbs = (const struct hda_verb[]) {
8285 /* Set bit 10 to correct noisy output after reboot from
8286 * Windows 10 (due to pop noise reduction?)
8288 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
8289 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
8293 .chain_id = ALC289_FIXUP_ASUS_GA401,
8295 [ALC285_FIXUP_HP_GPIO_LED] = {
8296 .type = HDA_FIXUP_FUNC,
8297 .v.func = alc285_fixup_hp_gpio_led,
8299 [ALC285_FIXUP_HP_MUTE_LED] = {
8300 .type = HDA_FIXUP_FUNC,
8301 .v.func = alc285_fixup_hp_mute_led,
8303 [ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED] = {
8304 .type = HDA_FIXUP_FUNC,
8305 .v.func = alc285_fixup_hp_spectre_x360_mute_led,
8307 [ALC236_FIXUP_HP_GPIO_LED] = {
8308 .type = HDA_FIXUP_FUNC,
8309 .v.func = alc236_fixup_hp_gpio_led,
8311 [ALC236_FIXUP_HP_MUTE_LED] = {
8312 .type = HDA_FIXUP_FUNC,
8313 .v.func = alc236_fixup_hp_mute_led,
8315 [ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF] = {
8316 .type = HDA_FIXUP_FUNC,
8317 .v.func = alc236_fixup_hp_mute_led_micmute_vref,
8319 [ALC298_FIXUP_SAMSUNG_AMP] = {
8320 .type = HDA_FIXUP_FUNC,
8321 .v.func = alc298_fixup_samsung_amp,
8323 .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
8325 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8326 .type = HDA_FIXUP_VERBS,
8327 .v.verbs = (const struct hda_verb[]) {
8328 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
8332 [ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
8333 .type = HDA_FIXUP_VERBS,
8334 .v.verbs = (const struct hda_verb[]) {
8335 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08},
8336 { 0x20, AC_VERB_SET_PROC_COEF, 0x2fcf},
8340 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
8341 .type = HDA_FIXUP_PINS,
8342 .v.pins = (const struct hda_pintbl[]) {
8343 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8347 .chain_id = ALC269_FIXUP_HEADSET_MODE
8349 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
8350 .type = HDA_FIXUP_PINS,
8351 .v.pins = (const struct hda_pintbl[]) {
8352 { 0x14, 0x90100120 }, /* use as internal speaker */
8353 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
8354 { 0x1a, 0x01011020 }, /* use as line out */
8358 .chain_id = ALC269_FIXUP_HEADSET_MIC
8360 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
8361 .type = HDA_FIXUP_PINS,
8362 .v.pins = (const struct hda_pintbl[]) {
8363 { 0x18, 0x02a11030 }, /* use as headset mic */
8367 .chain_id = ALC269_FIXUP_HEADSET_MIC
8369 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
8370 .type = HDA_FIXUP_PINS,
8371 .v.pins = (const struct hda_pintbl[]) {
8372 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
8376 .chain_id = ALC269_FIXUP_HEADSET_MIC
8378 [ALC289_FIXUP_ASUS_GA401] = {
8379 .type = HDA_FIXUP_FUNC,
8380 .v.func = alc289_fixup_asus_ga401,
8382 .chain_id = ALC289_FIXUP_ASUS_GA502,
8384 [ALC289_FIXUP_ASUS_GA502] = {
8385 .type = HDA_FIXUP_PINS,
8386 .v.pins = (const struct hda_pintbl[]) {
8387 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
8391 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
8392 .type = HDA_FIXUP_PINS,
8393 .v.pins = (const struct hda_pintbl[]) {
8394 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
8398 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
8400 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
8401 .type = HDA_FIXUP_FUNC,
8402 .v.func = alc285_fixup_hp_gpio_amp_init,
8404 .chain_id = ALC285_FIXUP_HP_GPIO_LED
8406 [ALC269_FIXUP_CZC_B20] = {
8407 .type = HDA_FIXUP_PINS,
8408 .v.pins = (const struct hda_pintbl[]) {
8409 { 0x12, 0x411111f0 },
8410 { 0x14, 0x90170110 }, /* speaker */
8411 { 0x15, 0x032f1020 }, /* HP out */
8412 { 0x17, 0x411111f0 },
8413 { 0x18, 0x03ab1040 }, /* mic */
8414 { 0x19, 0xb7a7013f },
8415 { 0x1a, 0x0181305f },
8416 { 0x1b, 0x411111f0 },
8417 { 0x1d, 0x411111f0 },
8418 { 0x1e, 0x411111f0 },
8421 .chain_id = ALC269_FIXUP_DMIC,
8423 [ALC269_FIXUP_CZC_TMI] = {
8424 .type = HDA_FIXUP_PINS,
8425 .v.pins = (const struct hda_pintbl[]) {
8426 { 0x12, 0x4000c000 },
8427 { 0x14, 0x90170110 }, /* speaker */
8428 { 0x15, 0x0421401f }, /* HP out */
8429 { 0x17, 0x411111f0 },
8430 { 0x18, 0x04a19020 }, /* mic */
8431 { 0x19, 0x411111f0 },
8432 { 0x1a, 0x411111f0 },
8433 { 0x1b, 0x411111f0 },
8434 { 0x1d, 0x40448505 },
8435 { 0x1e, 0x411111f0 },
8436 { 0x20, 0x8000ffff },
8439 .chain_id = ALC269_FIXUP_DMIC,
8441 [ALC269_FIXUP_CZC_L101] = {
8442 .type = HDA_FIXUP_PINS,
8443 .v.pins = (const struct hda_pintbl[]) {
8444 { 0x12, 0x40000000 },
8445 { 0x14, 0x01014010 }, /* speaker */
8446 { 0x15, 0x411111f0 }, /* HP out */
8447 { 0x16, 0x411111f0 },
8448 { 0x18, 0x01a19020 }, /* mic */
8449 { 0x19, 0x02a19021 },
8450 { 0x1a, 0x0181302f },
8451 { 0x1b, 0x0221401f },
8452 { 0x1c, 0x411111f0 },
8453 { 0x1d, 0x4044c601 },
8454 { 0x1e, 0x411111f0 },
8457 .chain_id = ALC269_FIXUP_DMIC,
8459 [ALC269_FIXUP_LEMOTE_A1802] = {
8460 .type = HDA_FIXUP_PINS,
8461 .v.pins = (const struct hda_pintbl[]) {
8462 { 0x12, 0x40000000 },
8463 { 0x14, 0x90170110 }, /* speaker */
8464 { 0x17, 0x411111f0 },
8465 { 0x18, 0x03a19040 }, /* mic1 */
8466 { 0x19, 0x90a70130 }, /* mic2 */
8467 { 0x1a, 0x411111f0 },
8468 { 0x1b, 0x411111f0 },
8469 { 0x1d, 0x40489d2d },
8470 { 0x1e, 0x411111f0 },
8471 { 0x20, 0x0003ffff },
8472 { 0x21, 0x03214020 },
8475 .chain_id = ALC269_FIXUP_DMIC,
8477 [ALC269_FIXUP_LEMOTE_A190X] = {
8478 .type = HDA_FIXUP_PINS,
8479 .v.pins = (const struct hda_pintbl[]) {
8480 { 0x14, 0x99130110 }, /* speaker */
8481 { 0x15, 0x0121401f }, /* HP out */
8482 { 0x18, 0x01a19c20 }, /* rear mic */
8483 { 0x19, 0x99a3092f }, /* front mic */
8484 { 0x1b, 0x0201401f }, /* front lineout */
8487 .chain_id = ALC269_FIXUP_DMIC,
8489 [ALC256_FIXUP_INTEL_NUC8_RUGGED] = {
8490 .type = HDA_FIXUP_PINS,
8491 .v.pins = (const struct hda_pintbl[]) {
8492 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8496 .chain_id = ALC269_FIXUP_HEADSET_MODE
8498 [ALC256_FIXUP_INTEL_NUC10] = {
8499 .type = HDA_FIXUP_PINS,
8500 .v.pins = (const struct hda_pintbl[]) {
8501 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8505 .chain_id = ALC269_FIXUP_HEADSET_MODE
8507 [ALC255_FIXUP_XIAOMI_HEADSET_MIC] = {
8508 .type = HDA_FIXUP_VERBS,
8509 .v.verbs = (const struct hda_verb[]) {
8510 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8511 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8515 .chain_id = ALC289_FIXUP_ASUS_GA502
8517 [ALC274_FIXUP_HP_MIC] = {
8518 .type = HDA_FIXUP_VERBS,
8519 .v.verbs = (const struct hda_verb[]) {
8520 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
8521 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
8525 [ALC274_FIXUP_HP_HEADSET_MIC] = {
8526 .type = HDA_FIXUP_FUNC,
8527 .v.func = alc274_fixup_hp_headset_mic,
8529 .chain_id = ALC274_FIXUP_HP_MIC
8531 [ALC274_FIXUP_HP_ENVY_GPIO] = {
8532 .type = HDA_FIXUP_FUNC,
8533 .v.func = alc274_fixup_hp_envy_gpio,
8535 [ALC256_FIXUP_ASUS_HPE] = {
8536 .type = HDA_FIXUP_VERBS,
8537 .v.verbs = (const struct hda_verb[]) {
8539 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
8540 { 0x20, AC_VERB_SET_PROC_COEF, 0x7778 },
8544 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
8546 [ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK] = {
8547 .type = HDA_FIXUP_FUNC,
8548 .v.func = alc_fixup_headset_jack,
8550 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
8552 [ALC287_FIXUP_HP_GPIO_LED] = {
8553 .type = HDA_FIXUP_FUNC,
8554 .v.func = alc287_fixup_hp_gpio_led,
8556 [ALC256_FIXUP_HP_HEADSET_MIC] = {
8557 .type = HDA_FIXUP_FUNC,
8558 .v.func = alc274_fixup_hp_headset_mic,
8560 [ALC236_FIXUP_DELL_AIO_HEADSET_MIC] = {
8561 .type = HDA_FIXUP_FUNC,
8562 .v.func = alc_fixup_no_int_mic,
8564 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
8566 [ALC282_FIXUP_ACER_DISABLE_LINEOUT] = {
8567 .type = HDA_FIXUP_PINS,
8568 .v.pins = (const struct hda_pintbl[]) {
8569 { 0x1b, 0x411111f0 },
8570 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
8574 .chain_id = ALC269_FIXUP_HEADSET_MODE
8576 [ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST] = {
8577 .type = HDA_FIXUP_FUNC,
8578 .v.func = alc269_fixup_limit_int_mic_boost,
8580 .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8582 [ALC256_FIXUP_ACER_HEADSET_MIC] = {
8583 .type = HDA_FIXUP_PINS,
8584 .v.pins = (const struct hda_pintbl[]) {
8585 { 0x19, 0x02a1113c }, /* use as headset mic, without its own jack detect */
8586 { 0x1a, 0x90a1092f }, /* use as internal mic */
8590 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8592 [ALC285_FIXUP_IDEAPAD_S740_COEF] = {
8593 .type = HDA_FIXUP_FUNC,
8594 .v.func = alc285_fixup_ideapad_s740_coef,
8596 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8598 [ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8599 .type = HDA_FIXUP_FUNC,
8600 .v.func = alc269_fixup_limit_int_mic_boost,
8602 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8604 [ALC295_FIXUP_ASUS_DACS] = {
8605 .type = HDA_FIXUP_FUNC,
8606 .v.func = alc295_fixup_asus_dacs,
8608 [ALC295_FIXUP_HP_OMEN] = {
8609 .type = HDA_FIXUP_PINS,
8610 .v.pins = (const struct hda_pintbl[]) {
8611 { 0x12, 0xb7a60130 },
8612 { 0x13, 0x40000000 },
8613 { 0x14, 0x411111f0 },
8614 { 0x16, 0x411111f0 },
8615 { 0x17, 0x90170110 },
8616 { 0x18, 0x411111f0 },
8617 { 0x19, 0x02a11030 },
8618 { 0x1a, 0x411111f0 },
8619 { 0x1b, 0x04a19030 },
8620 { 0x1d, 0x40600001 },
8621 { 0x1e, 0x411111f0 },
8622 { 0x21, 0x03211020 },
8626 .chain_id = ALC269_FIXUP_HP_LINE1_MIC1_LED,
8628 [ALC285_FIXUP_HP_SPECTRE_X360] = {
8629 .type = HDA_FIXUP_FUNC,
8630 .v.func = alc285_fixup_hp_spectre_x360,
8632 [ALC285_FIXUP_HP_SPECTRE_X360_EB1] = {
8633 .type = HDA_FIXUP_FUNC,
8634 .v.func = alc285_fixup_hp_spectre_x360_eb1
8636 [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = {
8637 .type = HDA_FIXUP_FUNC,
8638 .v.func = alc285_fixup_ideapad_s740_coef,
8640 .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
8642 [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = {
8643 .type = HDA_FIXUP_FUNC,
8644 .v.func = alc_fixup_no_shutup,
8646 .chain_id = ALC283_FIXUP_HEADSET_MIC,
8648 [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = {
8649 .type = HDA_FIXUP_PINS,
8650 .v.pins = (const struct hda_pintbl[]) {
8651 { 0x21, 0x03211030 }, /* Change the Headphone location to Left */
8655 .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC
8657 [ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST] = {
8658 .type = HDA_FIXUP_FUNC,
8659 .v.func = alc269_fixup_limit_int_mic_boost,
8661 .chain_id = ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
8663 [ALC285_FIXUP_LEGION_Y9000X_SPEAKERS] = {
8664 .type = HDA_FIXUP_FUNC,
8665 .v.func = alc285_fixup_ideapad_s740_coef,
8667 .chain_id = ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE,
8669 [ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE] = {
8670 .type = HDA_FIXUP_FUNC,
8671 .v.func = alc287_fixup_legion_15imhg05_speakers,
8673 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
8675 [ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS] = {
8676 .type = HDA_FIXUP_VERBS,
8677 //.v.verbs = legion_15imhg05_coefs,
8678 .v.verbs = (const struct hda_verb[]) {
8679 // set left speaker Legion 7i.
8680 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8681 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8683 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8684 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8685 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8686 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8687 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8689 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8690 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8691 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8692 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8693 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8695 // set right speaker Legion 7i.
8696 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8697 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8699 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8700 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8701 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8702 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8703 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8705 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8706 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8707 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8708 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8709 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8713 .chain_id = ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
8715 [ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE] = {
8716 .type = HDA_FIXUP_FUNC,
8717 .v.func = alc287_fixup_legion_15imhg05_speakers,
8719 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8721 [ALC287_FIXUP_YOGA7_14ITL_SPEAKERS] = {
8722 .type = HDA_FIXUP_VERBS,
8723 .v.verbs = (const struct hda_verb[]) {
8724 // set left speaker Yoga 7i.
8725 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8726 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8728 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8729 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8730 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8731 { 0x20, AC_VERB_SET_PROC_COEF, 0x1a },
8732 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8734 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8735 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8736 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8737 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8738 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8740 // set right speaker Yoga 7i.
8741 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8742 { 0x20, AC_VERB_SET_PROC_COEF, 0x46 },
8744 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8745 { 0x20, AC_VERB_SET_PROC_COEF, 0xc },
8746 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8747 { 0x20, AC_VERB_SET_PROC_COEF, 0x2a },
8748 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8750 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8751 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8752 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8753 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8754 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8758 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8760 [ALC298_FIXUP_LENOVO_C940_DUET7] = {
8761 .type = HDA_FIXUP_FUNC,
8762 .v.func = alc298_fixup_lenovo_c940_duet7,
8764 [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
8765 .type = HDA_FIXUP_VERBS,
8766 .v.verbs = (const struct hda_verb[]) {
8767 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8768 { 0x20, AC_VERB_SET_PROC_COEF, 0x41 },
8769 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8770 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8771 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8772 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8773 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8774 { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 },
8775 { 0x20, AC_VERB_SET_PROC_COEF, 0x42 },
8776 { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 },
8777 { 0x20, AC_VERB_SET_PROC_COEF, 0x2 },
8778 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8779 { 0x20, AC_VERB_SET_PROC_COEF, 0x0 },
8780 { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 },
8784 .chain_id = ALC269_FIXUP_HEADSET_MODE,
8786 [ALC256_FIXUP_SET_COEF_DEFAULTS] = {
8787 .type = HDA_FIXUP_FUNC,
8788 .v.func = alc256_fixup_set_coef_defaults,
8790 [ALC245_FIXUP_HP_GPIO_LED] = {
8791 .type = HDA_FIXUP_FUNC,
8792 .v.func = alc245_fixup_hp_gpio_led,
8794 [ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
8795 .type = HDA_FIXUP_PINS,
8796 .v.pins = (const struct hda_pintbl[]) {
8797 { 0x19, 0x03a11120 }, /* use as headset mic, without its own jack detect */
8801 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
8803 [ALC233_FIXUP_NO_AUDIO_JACK] = {
8804 .type = HDA_FIXUP_FUNC,
8805 .v.func = alc233_fixup_no_audio_jack,
8807 [ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8808 .type = HDA_FIXUP_FUNC,
8809 .v.func = alc256_fixup_mic_no_presence_and_resume,
8811 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8813 [ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED] = {
8814 .type = HDA_FIXUP_VERBS,
8815 .v.verbs = (const struct hda_verb[]) {
8816 { 0x20, AC_VERB_SET_COEF_INDEX, 0x19 },
8817 { 0x20, AC_VERB_SET_PROC_COEF, 0x8e11 },
8821 .chain_id = ALC285_FIXUP_HP_MUTE_LED,
8823 [ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS] = {
8824 .type = HDA_FIXUP_FUNC,
8825 .v.func = alc295_fixup_dell_inspiron_top_speakers,
8827 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8829 [ALC236_FIXUP_DELL_DUAL_CODECS] = {
8830 .type = HDA_FIXUP_PINS,
8831 .v.func = alc1220_fixup_gb_dual_codecs,
8833 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8837 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
8838 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
8839 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
8840 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
8841 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
8842 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8843 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
8844 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
8845 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8846 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
8847 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
8848 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
8849 SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
8850 SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
8851 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
8852 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
8853 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
8854 SND_PCI_QUIRK(0x1025, 0x1094, "Acer Aspire E5-575T", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
8855 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8856 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8857 SND_PCI_QUIRK(0x1025, 0x1166, "Acer Veriton N4640G", ALC269_FIXUP_LIFEBOOK),
8858 SND_PCI_QUIRK(0x1025, 0x1167, "Acer Veriton N6640G", ALC269_FIXUP_LIFEBOOK),
8859 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
8860 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
8861 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
8862 SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC),
8863 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8864 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8865 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8866 SND_PCI_QUIRK(0x1025, 0x129c, "Acer SWIFT SF314-55", ALC256_FIXUP_ACER_HEADSET_MIC),
8867 SND_PCI_QUIRK(0x1025, 0x129d, "Acer SWIFT SF313-51", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8868 SND_PCI_QUIRK(0x1025, 0x1300, "Acer SWIFT SF314-56", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8869 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
8870 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
8871 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
8872 SND_PCI_QUIRK(0x1025, 0x141f, "Acer Spin SP513-54N", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8873 SND_PCI_QUIRK(0x1025, 0x142b, "Acer Swift SF314-42", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
8874 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
8875 SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC),
8876 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
8877 SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X),
8878 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
8879 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
8880 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
8881 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
8882 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
8883 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
8884 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8885 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8886 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
8887 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8888 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
8889 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
8890 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
8891 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
8892 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8893 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8894 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
8895 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8896 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
8897 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
8898 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8899 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8900 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8901 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8902 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8903 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8904 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
8905 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8906 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
8907 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
8908 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
8909 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
8910 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
8911 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
8912 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
8913 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8914 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8915 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8916 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
8917 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
8918 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
8919 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
8920 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
8921 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8922 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
8923 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8924 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
8925 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8926 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC),
8927 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC),
8928 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK),
8929 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK),
8930 SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8931 SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8932 SND_PCI_QUIRK(0x1028, 0x0b19, "Dell XPS 15 9520", ALC289_FIXUP_DUAL_SPK),
8933 SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
8934 SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
8935 SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
8936 SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
8937 SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
8938 SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
8939 SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
8940 SND_PCI_QUIRK(0x1028, 0x0c1c, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
8941 SND_PCI_QUIRK(0x1028, 0x0c1d, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
8942 SND_PCI_QUIRK(0x1028, 0x0c1e, "Dell Precision 3540", ALC236_FIXUP_DELL_DUAL_CODECS),
8943 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8944 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
8945 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
8946 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
8947 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
8948 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8949 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8950 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8951 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8952 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
8953 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8954 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8955 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8956 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8957 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8958 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8959 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
8960 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8961 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8962 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8963 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8964 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8965 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8966 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
8967 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
8968 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8969 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8970 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8971 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8972 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8973 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8974 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8975 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8976 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
8977 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8978 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8979 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8980 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
8981 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8982 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8983 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8984 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8985 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8986 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8987 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8988 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8989 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8990 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8991 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8992 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8993 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8994 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8995 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
8996 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8997 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
8998 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
8999 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9000 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9001 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
9002 SND_PCI_QUIRK(0x103c, 0x2b5e, "HP 288 Pro G2 MT", ALC221_FIXUP_HP_288PRO_MIC_NO_PRESENCE),
9003 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9004 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9005 SND_PCI_QUIRK(0x103c, 0x8077, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9006 SND_PCI_QUIRK(0x103c, 0x8158, "HP", ALC256_FIXUP_HP_HEADSET_MIC),
9007 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9008 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
9009 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
9010 SND_PCI_QUIRK(0x103c, 0x827f, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9011 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9012 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
9013 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9014 SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9015 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9016 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
9017 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
9018 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
9019 SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9020 SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9021 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9022 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
9023 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9024 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9025 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED),
9026 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9027 SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9028 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED),
9029 SND_PCI_QUIRK(0x103c, 0x8728, "HP EliteBook 840 G7", ALC285_FIXUP_HP_GPIO_LED),
9030 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
9031 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9032 SND_PCI_QUIRK(0x103c, 0x8735, "HP ProBook 435 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9033 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9034 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED),
9035 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
9036 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
9037 SND_PCI_QUIRK(0x103c, 0x8780, "HP ZBook Fury 17 G7 Mobile Workstation",
9038 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9039 SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
9040 ALC285_FIXUP_HP_GPIO_AMP_INIT),
9041 SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9042 SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9043 SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
9044 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
9045 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9046 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9047 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9048 SND_PCI_QUIRK(0x103c, 0x87f2, "HP ProBook 640 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9049 SND_PCI_QUIRK(0x103c, 0x87f4, "HP", ALC287_FIXUP_HP_GPIO_LED),
9050 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED),
9051 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9052 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP),
9053 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
9054 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9055 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9056 SND_PCI_QUIRK(0x103c, 0x8812, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1),
9057 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9058 SND_PCI_QUIRK(0x103c, 0x8847, "HP EliteBook x360 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9059 SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9060 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED),
9061 SND_PCI_QUIRK(0x103c, 0x8862, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9062 SND_PCI_QUIRK(0x103c, 0x8863, "HP ProBook 445 G8 Notebook PC", ALC236_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9063 SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9064 SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9065 SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT),
9066 SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED),
9067 SND_PCI_QUIRK(0x103c, 0x8895, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED),
9068 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
9069 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9070 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
9071 SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED),
9072 SND_PCI_QUIRK(0x103c, 0x89c3, "HP", ALC285_FIXUP_HP_GPIO_LED),
9073 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
9074 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
9075 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED),
9076 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED),
9077 SND_PCI_QUIRK(0x103c, 0x8aa8, "HP EliteBook 640 G9 (MB 8AA6)", ALC236_FIXUP_HP_GPIO_LED),
9078 SND_PCI_QUIRK(0x103c, 0x8aab, "HP EliteBook 650 G9 (MB 8AA9)", ALC236_FIXUP_HP_GPIO_LED),
9079 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9080 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
9081 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9082 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
9083 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
9084 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9085 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9086 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9087 SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9088 SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9089 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9090 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
9091 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
9092 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
9093 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE),
9094 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
9095 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
9096 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
9097 SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK),
9098 SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
9099 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
9100 SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS),
9101 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
9102 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS),
9103 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
9104 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
9105 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
9106 SND_PCI_QUIRK(0x1043, 0x1970, "ASUS UX550VE", ALC289_FIXUP_ASUS_GA401),
9107 SND_PCI_QUIRK(0x1043, 0x1982, "ASUS B1400CEPE", ALC256_FIXUP_ASUS_HPE),
9108 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
9109 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
9110 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
9111 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
9112 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
9113 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
9114 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
9115 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9116 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS),
9117 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
9118 SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401),
9119 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
9120 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
9121 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
9122 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS),
9123 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
9124 SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401),
9125 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
9126 SND_PCI_QUIRK(0x1043, 0x1f92, "ASUS ROG Flow X16", ALC289_FIXUP_ASUS_GA401),
9127 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
9128 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
9129 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
9130 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9131 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
9132 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
9133 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
9134 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9135 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
9136 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
9137 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9138 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
9139 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
9140 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
9141 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9142 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
9143 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
9144 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
9145 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
9146 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
9147 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9148 SND_PCI_QUIRK(0x10ec, 0x124c, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9149 SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9150 SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
9151 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
9152 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
9153 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9154 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
9155 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
9156 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
9157 SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
9158 SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP),
9159 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
9160 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
9161 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
9162 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
9163 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
9164 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
9165 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
9166 SND_PCI_QUIRK(0x152d, 0x1082, "Quanta NL3", ALC269_FIXUP_LIFEBOOK),
9167 SND_PCI_QUIRK(0x1558, 0x1323, "Clevo N130ZU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9168 SND_PCI_QUIRK(0x1558, 0x1325, "Clevo N15[01][CW]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9169 SND_PCI_QUIRK(0x1558, 0x1401, "Clevo L140[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9170 SND_PCI_QUIRK(0x1558, 0x1403, "Clevo N140CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9171 SND_PCI_QUIRK(0x1558, 0x1404, "Clevo N150CU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9172 SND_PCI_QUIRK(0x1558, 0x14a1, "Clevo L141MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9173 SND_PCI_QUIRK(0x1558, 0x4018, "Clevo NV40M[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9174 SND_PCI_QUIRK(0x1558, 0x4019, "Clevo NV40MZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9175 SND_PCI_QUIRK(0x1558, 0x4020, "Clevo NV40MB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9176 SND_PCI_QUIRK(0x1558, 0x4041, "Clevo NV4[15]PZ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9177 SND_PCI_QUIRK(0x1558, 0x40a1, "Clevo NL40GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9178 SND_PCI_QUIRK(0x1558, 0x40c1, "Clevo NL40[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9179 SND_PCI_QUIRK(0x1558, 0x40d1, "Clevo NL41DU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9180 SND_PCI_QUIRK(0x1558, 0x5015, "Clevo NH5[58]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9181 SND_PCI_QUIRK(0x1558, 0x5017, "Clevo NH7[79]H[HJK]Q", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9182 SND_PCI_QUIRK(0x1558, 0x50a3, "Clevo NJ51GU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9183 SND_PCI_QUIRK(0x1558, 0x50b3, "Clevo NK50S[BEZ]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9184 SND_PCI_QUIRK(0x1558, 0x50b6, "Clevo NK50S5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9185 SND_PCI_QUIRK(0x1558, 0x50b8, "Clevo NK50SZ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9186 SND_PCI_QUIRK(0x1558, 0x50d5, "Clevo NP50D5", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9187 SND_PCI_QUIRK(0x1558, 0x50e1, "Clevo NH5[58]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9188 SND_PCI_QUIRK(0x1558, 0x50e2, "Clevo NH7[79]HPQ", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9189 SND_PCI_QUIRK(0x1558, 0x50f0, "Clevo NH50A[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9190 SND_PCI_QUIRK(0x1558, 0x50f2, "Clevo NH50E[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9191 SND_PCI_QUIRK(0x1558, 0x50f3, "Clevo NH58DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9192 SND_PCI_QUIRK(0x1558, 0x50f5, "Clevo NH55EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9193 SND_PCI_QUIRK(0x1558, 0x50f6, "Clevo NH55DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9194 SND_PCI_QUIRK(0x1558, 0x5101, "Clevo S510WU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9195 SND_PCI_QUIRK(0x1558, 0x5157, "Clevo W517GU1", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9196 SND_PCI_QUIRK(0x1558, 0x51a1, "Clevo NS50MU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9197 SND_PCI_QUIRK(0x1558, 0x70a1, "Clevo NB70T[HJK]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9198 SND_PCI_QUIRK(0x1558, 0x70b3, "Clevo NK70SB", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9199 SND_PCI_QUIRK(0x1558, 0x70f2, "Clevo NH79EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9200 SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9201 SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9202 SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9203 SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9204 SND_PCI_QUIRK(0x1558, 0x7717, "Clevo NS70PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9205 SND_PCI_QUIRK(0x1558, 0x7718, "Clevo L140PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9206 SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9207 SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9208 SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9209 SND_PCI_QUIRK(0x1558, 0x8535, "Clevo NH50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9210 SND_PCI_QUIRK(0x1558, 0x8536, "Clevo NH79D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9211 SND_PCI_QUIRK(0x1558, 0x8550, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9212 SND_PCI_QUIRK(0x1558, 0x8551, "Clevo NH[57][0-9][ER][ACDH]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9213 SND_PCI_QUIRK(0x1558, 0x8560, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9214 SND_PCI_QUIRK(0x1558, 0x8561, "Clevo NH[57][0-9][ER][ACDH]Q", ALC269_FIXUP_HEADSET_MIC),
9215 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
9216 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9217 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9218 SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9219 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9220 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9221 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
9222 SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9223 SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9224 SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9225 SND_PCI_QUIRK(0x1558, 0x951d, "Clevo N950T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9226 SND_PCI_QUIRK(0x1558, 0x9600, "Clevo N960K[PR]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9227 SND_PCI_QUIRK(0x1558, 0x961d, "Clevo N960S[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9228 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9229 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9230 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9231 SND_PCI_QUIRK(0x1558, 0xb018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9232 SND_PCI_QUIRK(0x1558, 0xb019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9233 SND_PCI_QUIRK(0x1558, 0xb022, "Clevo NH77D[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9234 SND_PCI_QUIRK(0x1558, 0xc018, "Clevo NP50D[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9235 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9236 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
9237 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
9238 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9239 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
9240 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
9241 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
9242 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
9243 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
9244 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
9245 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
9246 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
9247 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
9248 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
9249 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
9250 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
9251 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
9252 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
9253 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
9254 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
9255 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
9256 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9257 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
9258 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
9259 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
9260 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9261 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9262 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
9263 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
9264 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
9265 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9266 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9267 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
9268 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9269 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9270 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9271 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9272 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9273 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
9274 SND_PCI_QUIRK(0x17aa, 0x22c1, "Thinkpad P1 Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9275 SND_PCI_QUIRK(0x17aa, 0x22c2, "Thinkpad X1 Extreme Gen 3", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK),
9276 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9277 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
9278 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9279 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9280 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9281 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9282 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
9283 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9284 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9285 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
9286 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
9287 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9288 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9289 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
9290 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
9291 SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9292 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9293 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF),
9294 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9295 SND_PCI_QUIRK(0x17aa, 0x383d, "Legion Y9000X 2019", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
9296 SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP),
9297 SND_PCI_QUIRK(0x17aa, 0x384a, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9298 SND_PCI_QUIRK(0x17aa, 0x3852, "Lenovo Yoga 7 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9299 SND_PCI_QUIRK(0x17aa, 0x3853, "Lenovo Yoga 7 15ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
9300 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9301 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
9302 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
9303 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
9304 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9305 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
9306 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
9307 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9308 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
9309 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
9310 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
9311 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
9312 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
9313 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
9314 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
9315 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
9316 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9317 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9318 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9319 SND_PCI_QUIRK(0x17aa, 0x508b, "Thinkpad X12 Gen 1", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
9320 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
9321 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9322 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
9323 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
9324 SND_PCI_QUIRK(0x1849, 0x1233, "ASRock NUC Box 1100", ALC233_FIXUP_NO_AUDIO_JACK),
9325 SND_PCI_QUIRK(0x1849, 0xa233, "Positivo Master C6300", ALC269_FIXUP_HEADSET_MIC),
9326 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
9327 SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
9328 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
9329 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
9330 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
9331 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
9332 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
9333 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
9334 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),
9335 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP),
9336 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
9337 SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9338 SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9339 SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP),
9340 SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9341 SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP),
9342 SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP),
9343 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9344 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE),
9345 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
9346 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
9347 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
9348 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC),
9349 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED),
9350 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
9353 /* Below is a quirk table taken from the old code.
9354 * Basically the device should work as is without the fixup table.
9355 * If BIOS doesn't give a proper info, enable the corresponding
9358 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
9360 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
9361 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
9362 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
9363 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
9364 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
9365 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
9366 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
9367 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
9368 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
9369 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
9370 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
9371 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
9372 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
9373 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
9374 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
9375 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
9376 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
9377 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
9378 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
9379 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
9380 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
9381 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
9382 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
9383 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
9384 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
9385 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
9386 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
9387 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
9388 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
9389 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
9390 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
9391 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
9392 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
9393 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
9394 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
9395 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
9396 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
9397 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
9398 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
9403 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
9404 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
9405 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
9406 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
9407 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
9408 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
9412 static const struct hda_model_fixup alc269_fixup_models[] = {
9413 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
9414 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
9415 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
9416 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
9417 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
9418 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
9419 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
9420 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
9421 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
9422 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
9423 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9424 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
9425 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9426 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
9427 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
9428 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
9429 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
9430 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
9431 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
9432 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
9433 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
9434 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
9435 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
9436 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9437 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
9438 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
9439 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
9440 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
9441 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
9442 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
9443 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
9444 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
9445 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
9446 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
9447 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
9448 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
9449 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
9450 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
9451 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
9452 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
9453 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
9454 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
9455 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
9456 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
9457 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
9458 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
9459 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
9460 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
9461 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
9462 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
9463 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
9464 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
9465 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
9466 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
9467 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
9468 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
9469 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
9470 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
9471 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
9472 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
9473 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
9474 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
9475 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
9476 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
9477 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
9478 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
9479 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
9480 {.id = ALC269VB_FIXUP_ASPIRE_E1_COEF, .name = "aspire-e1-coef"},
9481 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
9482 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
9483 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
9484 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
9485 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
9486 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
9487 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
9488 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
9489 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
9490 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
9491 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
9492 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
9493 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
9494 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
9495 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
9496 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
9497 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
9498 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
9499 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
9500 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
9501 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
9502 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
9503 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
9504 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
9505 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
9506 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
9507 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
9508 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
9509 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
9510 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
9511 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
9512 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
9513 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
9514 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
9515 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
9516 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
9517 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
9518 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
9519 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
9520 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
9521 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
9522 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
9523 {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
9524 {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
9525 {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
9526 {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},
9527 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"},
9528 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"},
9529 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"},
9530 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"},
9531 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
9532 {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
9533 {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9534 {.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
9537 #define ALC225_STANDARD_PINS \
9540 #define ALC256_STANDARD_PINS \
9541 {0x12, 0x90a60140}, \
9542 {0x14, 0x90170110}, \
9545 #define ALC282_STANDARD_PINS \
9548 #define ALC290_STANDARD_PINS \
9551 #define ALC292_STANDARD_PINS \
9552 {0x14, 0x90170110}, \
9555 #define ALC295_STANDARD_PINS \
9556 {0x12, 0xb7a60130}, \
9557 {0x14, 0x90170110}, \
9560 #define ALC298_STANDARD_PINS \
9561 {0x12, 0x90a60130}, \
9564 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
9565 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
9570 {0x21, 0x0221102f}),
9571 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
9574 {0x21, 0x02211030}),
9575 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9578 {0x21, 0x03211020}),
9579 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
9582 {0x21, 0x03211020}),
9583 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9584 ALC225_STANDARD_PINS,
9586 {0x14, 0x901701a0}),
9587 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9588 ALC225_STANDARD_PINS,
9590 {0x14, 0x901701b0}),
9591 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9592 ALC225_STANDARD_PINS,
9594 {0x14, 0x901701a0}),
9595 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9596 ALC225_STANDARD_PINS,
9598 {0x14, 0x901701b0}),
9599 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
9600 ALC225_STANDARD_PINS,
9602 {0x1b, 0x90170110}),
9603 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9606 {0x21, 0x02211020}),
9607 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
9611 {0x21, 0x02211020}),
9612 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9617 {0x21, 0x0221101f}),
9618 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9623 {0x21, 0x0221101f}),
9624 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
9628 {0x21, 0x0221101f}),
9629 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC,
9630 {0x21, 0x02211010}),
9631 SND_HDA_PIN_QUIRK(0x10ec0236, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9634 {0x21, 0x02211030}),
9635 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
9637 {0x21, 0x02211020}),
9638 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9640 {0x21, 0x02211040}),
9641 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9644 {0x21, 0x02211020}),
9645 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9648 {0x21, 0x02211030}),
9649 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9652 {0x21, 0x0221101f}),
9653 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9656 {0x21, 0x0221101f}),
9657 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9660 {0x21, 0x0221103f}),
9661 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9664 {0x21, 0x0221103f}),
9665 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9668 {0x21, 0x0221103f}),
9669 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9672 {0x21, 0x0221105f}),
9673 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9676 {0x21, 0x0221101f}),
9677 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9681 {0x21, 0x0321102f}),
9682 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9685 {0x21, 0x02211040}),
9686 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9689 {0x21, 0x02211050}),
9690 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9693 {0x21, 0x02211030}),
9694 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9697 {0x21, 0x02211040}),
9698 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9701 {0x21, 0x02211040}),
9702 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9705 {0x21, 0x02211050}),
9706 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9709 {0x21, 0x02211040}),
9710 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9713 {0x21, 0x02211030}),
9714 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9716 {0x21, 0x02211010}),
9717 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9720 {0x21, 0x04211020}),
9721 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
9724 {0x21, 0x03211020}),
9725 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9728 {0x21, 0x03211020}),
9729 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9732 {0x21, 0x04211020}),
9733 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
9736 {0x21, 0x03211020}),
9737 SND_HDA_PIN_QUIRK(0x10ec0256, 0x103c, "HP", ALC256_FIXUP_HP_HEADSET_MIC,
9740 {0x21, 0x0221101f}),
9741 SND_HDA_PIN_QUIRK(0x10ec0274, 0x103c, "HP", ALC274_FIXUP_HP_HEADSET_MIC,
9744 {0x21, 0x03211020}),
9745 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
9749 {0x1a, 0x04a11020}),
9750 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
9756 {0x1b, 0x02011020}),
9757 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9758 ALC282_STANDARD_PINS,
9761 {0x21, 0x0321101f}),
9762 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9763 ALC282_STANDARD_PINS,
9766 {0x21, 0x03211040}),
9767 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9768 ALC282_STANDARD_PINS,
9771 {0x21, 0x03211020}),
9772 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9773 ALC282_STANDARD_PINS,
9776 {0x21, 0x0421101f}),
9777 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
9778 ALC282_STANDARD_PINS,
9781 {0x21, 0x04211020}),
9782 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9783 ALC282_STANDARD_PINS,
9789 {0x21, 0x0321101f}),
9790 SND_HDA_PIN_QUIRK(0x10ec0282, 0x1025, "Acer", ALC282_FIXUP_ACER_DISABLE_LINEOUT,
9791 ALC282_STANDARD_PINS,
9797 {0x21, 0x0321101f}),
9798 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9799 ALC282_STANDARD_PINS,
9801 {0x21, 0x0321101f}),
9802 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9805 {0x21, 0x02211030}),
9806 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9807 ALC282_STANDARD_PINS,
9810 {0x21, 0x0321101f}),
9811 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9815 {0x21, 0x04211020}),
9816 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
9820 {0x21, 0x04211020}),
9821 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
9824 {0x21, 0x04211020}),
9825 SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
9829 {0x21, 0x03211020}),
9830 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
9833 {0x21, 0x02211020}),
9834 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
9837 {0x21, 0x0321101f}),
9838 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9839 ALC290_STANDARD_PINS,
9842 {0x1a, 0x04a11020}),
9843 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9844 ALC290_STANDARD_PINS,
9847 {0x1a, 0x04a11020}),
9848 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9849 ALC290_STANDARD_PINS,
9851 {0x1a, 0x04a11020}),
9852 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9853 ALC290_STANDARD_PINS,
9855 {0x1a, 0x04a11040}),
9856 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9857 ALC290_STANDARD_PINS,
9860 {0x1a, 0x04a11040}),
9861 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9862 ALC290_STANDARD_PINS,
9865 {0x1a, 0x04a11020}),
9866 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
9867 ALC290_STANDARD_PINS,
9870 {0x1a, 0x04a11020}),
9871 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9872 ALC292_STANDARD_PINS,
9875 {0x19, 0x01a19030}),
9876 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
9877 ALC292_STANDARD_PINS,
9881 {0x19, 0x01a1903e}),
9882 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
9883 ALC292_STANDARD_PINS,
9884 {0x12, 0x90a60140}),
9885 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9886 ALC292_STANDARD_PINS,
9889 {0x19, 0x21a19030}),
9890 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
9891 ALC292_STANDARD_PINS,
9892 {0x13, 0x90a60140}),
9893 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_HPE,
9895 {0x21, 0x04211020}),
9896 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
9899 {0x21, 0x04211020}),
9900 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9903 {0x21, 0x03211020}),
9904 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9907 {0x21, 0x04211020}),
9908 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
9911 {0x21, 0x03211020}),
9912 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9915 {0x21, 0x04211030}),
9916 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9919 {0x21, 0x03211020}),
9920 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
9923 {0x21, 0x03211020}),
9924 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9926 {0x21, 0x04211020}),
9927 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9929 {0x21, 0x04211030}),
9930 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9931 ALC295_STANDARD_PINS,
9933 {0x18, 0x21a19030}),
9934 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9935 ALC295_STANDARD_PINS,
9937 {0x18, 0x21a19050}),
9938 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
9939 ALC295_STANDARD_PINS),
9940 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9941 ALC298_STANDARD_PINS,
9942 {0x17, 0x90170110}),
9943 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9944 ALC298_STANDARD_PINS,
9945 {0x17, 0x90170140}),
9946 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
9947 ALC298_STANDARD_PINS,
9948 {0x17, 0x90170150}),
9949 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
9954 {0x21, 0x03211030}),
9955 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
9959 {0x21, 0x03211020}),
9960 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9961 ALC225_STANDARD_PINS,
9963 {0x17, 0x90170110}),
9964 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
9969 {0x21, 0x0221101f}),
9973 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
9974 * more machines, don't need to match all valid pins, just need to match
9975 * all the pins defined in the tbl. Just because of this reason, it is possible
9976 * that a single machine matches multiple tbls, so there is one limitation:
9977 * at most one tbl is allowed to define for the same vendor and same codec
9979 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
9980 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
9982 {0x1b, 0x40000000}),
9983 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9985 {0x1a, 0x40000000}),
9986 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
9988 {0x1a, 0x40000000}),
9989 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
9991 {0x1a, 0x40000000}),
9995 static void alc269_fill_coef(struct hda_codec *codec)
9997 struct alc_spec *spec = codec->spec;
10000 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
10003 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
10004 alc_write_coef_idx(codec, 0xf, 0x960b);
10005 alc_write_coef_idx(codec, 0xe, 0x8817);
10008 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
10009 alc_write_coef_idx(codec, 0xf, 0x960b);
10010 alc_write_coef_idx(codec, 0xe, 0x8814);
10013 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
10014 /* Power up output pin */
10015 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
10018 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
10019 val = alc_read_coef_idx(codec, 0xd);
10020 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
10021 /* Capless ramp up clock control */
10022 alc_write_coef_idx(codec, 0xd, val | (1<<10));
10024 val = alc_read_coef_idx(codec, 0x17);
10025 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
10026 /* Class D power on reset */
10027 alc_write_coef_idx(codec, 0x17, val | (1<<7));
10032 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
10037 static int patch_alc269(struct hda_codec *codec)
10039 struct alc_spec *spec;
10042 err = alc_alloc_spec(codec, 0x0b);
10046 spec = codec->spec;
10047 spec->gen.shared_mic_vref_pin = 0x18;
10048 codec->power_save_node = 0;
10051 codec->patch_ops.suspend = alc269_suspend;
10052 codec->patch_ops.resume = alc269_resume;
10054 spec->shutup = alc_default_shutup;
10055 spec->init_hook = alc_default_init;
10057 switch (codec->core.vendor_id) {
10059 spec->codec_variant = ALC269_TYPE_ALC269VA;
10060 switch (alc_get_coef0(codec) & 0x00f0) {
10062 if (codec->bus->pci &&
10063 codec->bus->pci->subsystem_vendor == 0x1025 &&
10064 spec->cdefine.platform_type == 1)
10065 err = alc_codec_rename(codec, "ALC271X");
10066 spec->codec_variant = ALC269_TYPE_ALC269VB;
10069 if (codec->bus->pci &&
10070 codec->bus->pci->subsystem_vendor == 0x17aa &&
10071 codec->bus->pci->subsystem_device == 0x21f3)
10072 err = alc_codec_rename(codec, "ALC3202");
10073 spec->codec_variant = ALC269_TYPE_ALC269VC;
10076 spec->codec_variant = ALC269_TYPE_ALC269VD;
10079 alc_fix_pll_init(codec, 0x20, 0x04, 15);
10083 spec->shutup = alc269_shutup;
10084 spec->init_hook = alc269_fill_coef;
10085 alc269_fill_coef(codec);
10090 spec->codec_variant = ALC269_TYPE_ALC280;
10093 spec->codec_variant = ALC269_TYPE_ALC282;
10094 spec->shutup = alc282_shutup;
10095 spec->init_hook = alc282_init;
10099 spec->codec_variant = ALC269_TYPE_ALC283;
10100 spec->shutup = alc283_shutup;
10101 spec->init_hook = alc283_init;
10105 spec->codec_variant = ALC269_TYPE_ALC284;
10108 spec->codec_variant = ALC269_TYPE_ALC293;
10112 spec->codec_variant = ALC269_TYPE_ALC286;
10115 spec->codec_variant = ALC269_TYPE_ALC298;
10119 spec->codec_variant = ALC269_TYPE_ALC255;
10120 spec->shutup = alc256_shutup;
10121 spec->init_hook = alc256_init;
10127 spec->codec_variant = ALC269_TYPE_ALC256;
10128 spec->shutup = alc256_shutup;
10129 spec->init_hook = alc256_init;
10130 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
10133 spec->codec_variant = ALC269_TYPE_ALC257;
10134 spec->shutup = alc256_shutup;
10135 spec->init_hook = alc256_init;
10136 spec->gen.mixer_nid = 0;
10142 if (alc_get_coef0(codec) & 0x0010)
10143 spec->codec_variant = ALC269_TYPE_ALC245;
10145 spec->codec_variant = ALC269_TYPE_ALC215;
10146 spec->shutup = alc225_shutup;
10147 spec->init_hook = alc225_init;
10148 spec->gen.mixer_nid = 0;
10153 spec->codec_variant = ALC269_TYPE_ALC225;
10154 spec->shutup = alc225_shutup;
10155 spec->init_hook = alc225_init;
10156 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
10159 spec->codec_variant = ALC269_TYPE_ALC287;
10160 spec->shutup = alc225_shutup;
10161 spec->init_hook = alc225_init;
10162 spec->gen.mixer_nid = 0; /* no loopback on ALC287 */
10167 spec->codec_variant = ALC269_TYPE_ALC294;
10168 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
10169 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
10170 spec->init_hook = alc294_init;
10173 spec->codec_variant = ALC269_TYPE_ALC300;
10174 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
10177 spec->codec_variant = ALC269_TYPE_ALC623;
10183 spec->codec_variant = ALC269_TYPE_ALC700;
10184 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
10185 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
10186 spec->init_hook = alc294_init;
10191 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
10192 spec->has_alc5505_dsp = 1;
10193 spec->init_hook = alc5505_dsp_init;
10196 alc_pre_init(codec);
10198 snd_hda_pick_fixup(codec, alc269_fixup_models,
10199 alc269_fixup_tbl, alc269_fixups);
10200 /* FIXME: both TX300 and ROG Strix G17 have the same SSID, and
10201 * the quirk breaks the latter (bko#214101).
10202 * Clear the wrong entry.
10204 if (codec->fixup_id == ALC282_FIXUP_ASUS_TX300 &&
10205 codec->core.vendor_id == 0x10ec0294) {
10206 codec_dbg(codec, "Clear wrong fixup for ASUS ROG Strix G17\n");
10207 codec->fixup_id = HDA_FIXUP_ID_NOT_SET;
10210 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
10211 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
10212 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
10214 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10216 alc_auto_parse_customize_define(codec);
10218 if (has_cdefine_beep(codec))
10219 spec->gen.beep_nid = 0x01;
10221 /* automatic parse from the BIOS config */
10222 err = alc269_parse_auto_config(codec);
10226 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
10227 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
10232 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10245 static int alc861_parse_auto_config(struct hda_codec *codec)
10247 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
10248 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
10249 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
10252 /* Pin config fixes */
10254 ALC861_FIXUP_FSC_AMILO_PI1505,
10255 ALC861_FIXUP_AMP_VREF_0F,
10256 ALC861_FIXUP_NO_JACK_DETECT,
10257 ALC861_FIXUP_ASUS_A6RP,
10258 ALC660_FIXUP_ASUS_W7J,
10261 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
10262 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
10263 const struct hda_fixup *fix, int action)
10265 struct alc_spec *spec = codec->spec;
10268 if (action != HDA_FIXUP_ACT_INIT)
10270 val = snd_hda_codec_get_pin_target(codec, 0x0f);
10271 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
10272 val |= AC_PINCTL_IN_EN;
10273 val |= AC_PINCTL_VREF_50;
10274 snd_hda_set_pin_ctl(codec, 0x0f, val);
10275 spec->gen.keep_vref_in_automute = 1;
10278 /* suppress the jack-detection */
10279 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
10280 const struct hda_fixup *fix, int action)
10282 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10283 codec->no_jack_detect = 1;
10286 static const struct hda_fixup alc861_fixups[] = {
10287 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
10288 .type = HDA_FIXUP_PINS,
10289 .v.pins = (const struct hda_pintbl[]) {
10290 { 0x0b, 0x0221101f }, /* HP */
10291 { 0x0f, 0x90170310 }, /* speaker */
10295 [ALC861_FIXUP_AMP_VREF_0F] = {
10296 .type = HDA_FIXUP_FUNC,
10297 .v.func = alc861_fixup_asus_amp_vref_0f,
10299 [ALC861_FIXUP_NO_JACK_DETECT] = {
10300 .type = HDA_FIXUP_FUNC,
10301 .v.func = alc_fixup_no_jack_detect,
10303 [ALC861_FIXUP_ASUS_A6RP] = {
10304 .type = HDA_FIXUP_FUNC,
10305 .v.func = alc861_fixup_asus_amp_vref_0f,
10307 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
10309 [ALC660_FIXUP_ASUS_W7J] = {
10310 .type = HDA_FIXUP_VERBS,
10311 .v.verbs = (const struct hda_verb[]) {
10312 /* ASUS W7J needs a magic pin setup on unused NID 0x10
10313 * for enabling outputs
10315 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
10321 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
10322 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
10323 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
10324 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
10325 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
10326 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
10327 SND_PCI_QUIRK_VENDOR(0x1584, "Haier/Uniwill", ALC861_FIXUP_AMP_VREF_0F),
10328 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
10334 static int patch_alc861(struct hda_codec *codec)
10336 struct alc_spec *spec;
10339 err = alc_alloc_spec(codec, 0x15);
10343 spec = codec->spec;
10344 if (has_cdefine_beep(codec))
10345 spec->gen.beep_nid = 0x23;
10348 spec->power_hook = alc_power_eapd;
10351 alc_pre_init(codec);
10353 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
10354 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10356 /* automatic parse from the BIOS config */
10357 err = alc861_parse_auto_config(codec);
10361 if (!spec->gen.no_analog) {
10362 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
10367 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10377 * ALC861-VD support
10381 * In addition, an independent DAC
10383 static int alc861vd_parse_auto_config(struct hda_codec *codec)
10385 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
10386 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10387 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
10391 ALC660VD_FIX_ASUS_GPIO1,
10392 ALC861VD_FIX_DALLAS,
10395 /* exclude VREF80 */
10396 static void alc861vd_fixup_dallas(struct hda_codec *codec,
10397 const struct hda_fixup *fix, int action)
10399 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10400 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
10401 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
10406 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
10407 const struct hda_fixup *fix, int action)
10409 struct alc_spec *spec = codec->spec;
10411 if (action == HDA_FIXUP_ACT_PRE_PROBE)
10412 spec->gpio_mask |= 0x02;
10413 alc_fixup_gpio(codec, action, 0x01);
10416 static const struct hda_fixup alc861vd_fixups[] = {
10417 [ALC660VD_FIX_ASUS_GPIO1] = {
10418 .type = HDA_FIXUP_FUNC,
10419 .v.func = alc660vd_fixup_asus_gpio1,
10421 [ALC861VD_FIX_DALLAS] = {
10422 .type = HDA_FIXUP_FUNC,
10423 .v.func = alc861vd_fixup_dallas,
10427 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
10428 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
10429 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
10430 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
10436 static int patch_alc861vd(struct hda_codec *codec)
10438 struct alc_spec *spec;
10441 err = alc_alloc_spec(codec, 0x0b);
10445 spec = codec->spec;
10446 if (has_cdefine_beep(codec))
10447 spec->gen.beep_nid = 0x23;
10449 spec->shutup = alc_eapd_shutup;
10451 alc_pre_init(codec);
10453 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
10454 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
10456 /* automatic parse from the BIOS config */
10457 err = alc861vd_parse_auto_config(codec);
10461 if (!spec->gen.no_analog) {
10462 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10467 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
10479 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
10480 * configuration. Each pin widget can choose any input DACs and a mixer.
10481 * Each ADC is connected from a mixer of all inputs. This makes possible
10482 * 6-channel independent captures.
10484 * In addition, an independent DAC for the multi-playback (not used in this
10489 * BIOS auto configuration
10492 static int alc662_parse_auto_config(struct hda_codec *codec)
10494 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
10495 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
10496 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
10497 const hda_nid_t *ssids;
10499 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
10500 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
10501 codec->core.vendor_id == 0x10ec0671)
10502 ssids = alc663_ssids;
10504 ssids = alc662_ssids;
10505 return alc_parse_auto_config(codec, alc662_ignore, ssids);
10508 static void alc272_fixup_mario(struct hda_codec *codec,
10509 const struct hda_fixup *fix, int action)
10511 if (action != HDA_FIXUP_ACT_PRE_PROBE)
10513 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
10514 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
10515 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
10516 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
10517 (0 << AC_AMPCAP_MUTE_SHIFT)))
10518 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
10521 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
10523 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
10525 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
10526 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
10530 /* override the 2.1 chmap */
10531 static void alc_fixup_bass_chmap(struct hda_codec *codec,
10532 const struct hda_fixup *fix, int action)
10534 if (action == HDA_FIXUP_ACT_BUILD) {
10535 struct alc_spec *spec = codec->spec;
10536 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
10540 /* avoid D3 for keeping GPIO up */
10541 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
10543 unsigned int power_state)
10545 struct alc_spec *spec = codec->spec;
10546 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
10547 return AC_PWRST_D0;
10548 return power_state;
10551 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
10552 const struct hda_fixup *fix, int action)
10554 struct alc_spec *spec = codec->spec;
10556 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
10557 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10558 spec->mute_led_polarity = 1;
10559 codec->power_filter = gpio_led_power_filter;
10563 static void alc662_usi_automute_hook(struct hda_codec *codec,
10564 struct hda_jack_callback *jack)
10566 struct alc_spec *spec = codec->spec;
10569 snd_hda_gen_hp_automute(codec, jack);
10571 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
10573 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10577 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
10578 const struct hda_fixup *fix, int action)
10580 struct alc_spec *spec = codec->spec;
10581 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10582 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10583 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
10587 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
10588 struct hda_jack_callback *cb)
10590 /* surround speakers at 0x1b already get muted automatically when
10591 * headphones are plugged in, but we have to mute/unmute the remaining
10592 * channels manually:
10593 * 0x15 - front left/front right
10594 * 0x18 - front center/ LFE
10596 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
10597 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
10598 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
10600 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
10601 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
10605 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
10606 const struct hda_fixup *fix, int action)
10608 /* Pin 0x1b: shared headphones jack and surround speakers */
10609 if (!is_jack_detectable(codec, 0x1b))
10613 case HDA_FIXUP_ACT_PRE_PROBE:
10614 snd_hda_jack_detect_enable_callback(codec, 0x1b,
10615 alc662_aspire_ethos_mute_speakers);
10616 /* subwoofer needs an extra GPIO setting to become audible */
10617 alc_setup_gpio(codec, 0x02);
10619 case HDA_FIXUP_ACT_INIT:
10620 /* Make sure to start in a correct state, i.e. if
10621 * headphones have been plugged in before powering up the system
10623 alc662_aspire_ethos_mute_speakers(codec, NULL);
10628 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
10629 const struct hda_fixup *fix, int action)
10631 struct alc_spec *spec = codec->spec;
10633 static const struct hda_pintbl pincfgs[] = {
10634 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
10635 { 0x1b, 0x0181304f },
10640 case HDA_FIXUP_ACT_PRE_PROBE:
10641 spec->gen.mixer_nid = 0;
10642 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10643 snd_hda_apply_pincfgs(codec, pincfgs);
10645 case HDA_FIXUP_ACT_INIT:
10646 alc_write_coef_idx(codec, 0x19, 0xa054);
10651 static void alc897_hp_automute_hook(struct hda_codec *codec,
10652 struct hda_jack_callback *jack)
10654 struct alc_spec *spec = codec->spec;
10657 snd_hda_gen_hp_automute(codec, jack);
10658 vref = spec->gen.hp_jack_present ? (PIN_HP | AC_PINCTL_VREF_100) : PIN_HP;
10659 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
10663 static void alc897_fixup_lenovo_headset_mic(struct hda_codec *codec,
10664 const struct hda_fixup *fix, int action)
10666 struct alc_spec *spec = codec->spec;
10667 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10668 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10672 static void alc897_fixup_lenovo_headset_mode(struct hda_codec *codec,
10673 const struct hda_fixup *fix, int action)
10675 struct alc_spec *spec = codec->spec;
10677 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
10678 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
10679 spec->gen.hp_automute_hook = alc897_hp_automute_hook;
10683 static const struct coef_fw alc668_coefs[] = {
10684 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
10685 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
10686 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
10687 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
10688 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
10689 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
10690 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
10691 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
10692 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
10693 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
10694 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
10695 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
10696 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
10697 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
10698 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
10699 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
10700 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
10701 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
10702 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
10703 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
10707 static void alc668_restore_default_value(struct hda_codec *codec)
10709 alc_process_coef_fw(codec, alc668_coefs);
10713 ALC662_FIXUP_ASPIRE,
10714 ALC662_FIXUP_LED_GPIO1,
10715 ALC662_FIXUP_IDEAPAD,
10716 ALC272_FIXUP_MARIO,
10717 ALC662_FIXUP_CZC_ET26,
10718 ALC662_FIXUP_CZC_P10T,
10719 ALC662_FIXUP_SKU_IGNORE,
10720 ALC662_FIXUP_HP_RP5800,
10721 ALC662_FIXUP_ASUS_MODE1,
10722 ALC662_FIXUP_ASUS_MODE2,
10723 ALC662_FIXUP_ASUS_MODE3,
10724 ALC662_FIXUP_ASUS_MODE4,
10725 ALC662_FIXUP_ASUS_MODE5,
10726 ALC662_FIXUP_ASUS_MODE6,
10727 ALC662_FIXUP_ASUS_MODE7,
10728 ALC662_FIXUP_ASUS_MODE8,
10729 ALC662_FIXUP_NO_JACK_DETECT,
10730 ALC662_FIXUP_ZOTAC_Z68,
10731 ALC662_FIXUP_INV_DMIC,
10732 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
10733 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
10734 ALC662_FIXUP_HEADSET_MODE,
10735 ALC668_FIXUP_HEADSET_MODE,
10736 ALC662_FIXUP_BASS_MODE4_CHMAP,
10737 ALC662_FIXUP_BASS_16,
10738 ALC662_FIXUP_BASS_1A,
10739 ALC662_FIXUP_BASS_CHMAP,
10740 ALC668_FIXUP_AUTO_MUTE,
10741 ALC668_FIXUP_DELL_DISABLE_AAMIX,
10742 ALC668_FIXUP_DELL_XPS13,
10743 ALC662_FIXUP_ASUS_Nx50,
10744 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
10745 ALC668_FIXUP_ASUS_Nx51,
10746 ALC668_FIXUP_MIC_COEF,
10747 ALC668_FIXUP_ASUS_G751,
10748 ALC891_FIXUP_HEADSET_MODE,
10749 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
10750 ALC662_FIXUP_ACER_VERITON,
10751 ALC892_FIXUP_ASROCK_MOBO,
10752 ALC662_FIXUP_USI_FUNC,
10753 ALC662_FIXUP_USI_HEADSET_MODE,
10754 ALC662_FIXUP_LENOVO_MULTI_CODECS,
10755 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
10756 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
10757 ALC671_FIXUP_HP_HEADSET_MIC2,
10758 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
10759 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
10760 ALC668_FIXUP_ASUS_NO_HEADSET_MIC,
10761 ALC668_FIXUP_HEADSET_MIC,
10762 ALC668_FIXUP_MIC_DET_COEF,
10763 ALC897_FIXUP_LENOVO_HEADSET_MIC,
10764 ALC897_FIXUP_HEADSET_MIC_PIN,
10765 ALC897_FIXUP_HP_HSMIC_VERB,
10766 ALC897_FIXUP_LENOVO_HEADSET_MODE,
10767 ALC897_FIXUP_HEADSET_MIC_PIN2,
10770 static const struct hda_fixup alc662_fixups[] = {
10771 [ALC662_FIXUP_ASPIRE] = {
10772 .type = HDA_FIXUP_PINS,
10773 .v.pins = (const struct hda_pintbl[]) {
10774 { 0x15, 0x99130112 }, /* subwoofer */
10778 [ALC662_FIXUP_LED_GPIO1] = {
10779 .type = HDA_FIXUP_FUNC,
10780 .v.func = alc662_fixup_led_gpio1,
10782 [ALC662_FIXUP_IDEAPAD] = {
10783 .type = HDA_FIXUP_PINS,
10784 .v.pins = (const struct hda_pintbl[]) {
10785 { 0x17, 0x99130112 }, /* subwoofer */
10789 .chain_id = ALC662_FIXUP_LED_GPIO1,
10791 [ALC272_FIXUP_MARIO] = {
10792 .type = HDA_FIXUP_FUNC,
10793 .v.func = alc272_fixup_mario,
10795 [ALC662_FIXUP_CZC_ET26] = {
10796 .type = HDA_FIXUP_PINS,
10797 .v.pins = (const struct hda_pintbl[]) {
10798 {0x12, 0x403cc000},
10799 {0x14, 0x90170110}, /* speaker */
10800 {0x15, 0x411111f0},
10801 {0x16, 0x411111f0},
10802 {0x18, 0x01a19030}, /* mic */
10803 {0x19, 0x90a7013f}, /* int-mic */
10804 {0x1a, 0x01014020},
10805 {0x1b, 0x0121401f},
10806 {0x1c, 0x411111f0},
10807 {0x1d, 0x411111f0},
10808 {0x1e, 0x40478e35},
10812 .chain_id = ALC662_FIXUP_SKU_IGNORE
10814 [ALC662_FIXUP_CZC_P10T] = {
10815 .type = HDA_FIXUP_VERBS,
10816 .v.verbs = (const struct hda_verb[]) {
10817 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
10821 [ALC662_FIXUP_SKU_IGNORE] = {
10822 .type = HDA_FIXUP_FUNC,
10823 .v.func = alc_fixup_sku_ignore,
10825 [ALC662_FIXUP_HP_RP5800] = {
10826 .type = HDA_FIXUP_PINS,
10827 .v.pins = (const struct hda_pintbl[]) {
10828 { 0x14, 0x0221201f }, /* HP out */
10832 .chain_id = ALC662_FIXUP_SKU_IGNORE
10834 [ALC662_FIXUP_ASUS_MODE1] = {
10835 .type = HDA_FIXUP_PINS,
10836 .v.pins = (const struct hda_pintbl[]) {
10837 { 0x14, 0x99130110 }, /* speaker */
10838 { 0x18, 0x01a19c20 }, /* mic */
10839 { 0x19, 0x99a3092f }, /* int-mic */
10840 { 0x21, 0x0121401f }, /* HP out */
10844 .chain_id = ALC662_FIXUP_SKU_IGNORE
10846 [ALC662_FIXUP_ASUS_MODE2] = {
10847 .type = HDA_FIXUP_PINS,
10848 .v.pins = (const struct hda_pintbl[]) {
10849 { 0x14, 0x99130110 }, /* speaker */
10850 { 0x18, 0x01a19820 }, /* mic */
10851 { 0x19, 0x99a3092f }, /* int-mic */
10852 { 0x1b, 0x0121401f }, /* HP out */
10856 .chain_id = ALC662_FIXUP_SKU_IGNORE
10858 [ALC662_FIXUP_ASUS_MODE3] = {
10859 .type = HDA_FIXUP_PINS,
10860 .v.pins = (const struct hda_pintbl[]) {
10861 { 0x14, 0x99130110 }, /* speaker */
10862 { 0x15, 0x0121441f }, /* HP */
10863 { 0x18, 0x01a19840 }, /* mic */
10864 { 0x19, 0x99a3094f }, /* int-mic */
10865 { 0x21, 0x01211420 }, /* HP2 */
10869 .chain_id = ALC662_FIXUP_SKU_IGNORE
10871 [ALC662_FIXUP_ASUS_MODE4] = {
10872 .type = HDA_FIXUP_PINS,
10873 .v.pins = (const struct hda_pintbl[]) {
10874 { 0x14, 0x99130110 }, /* speaker */
10875 { 0x16, 0x99130111 }, /* speaker */
10876 { 0x18, 0x01a19840 }, /* mic */
10877 { 0x19, 0x99a3094f }, /* int-mic */
10878 { 0x21, 0x0121441f }, /* HP */
10882 .chain_id = ALC662_FIXUP_SKU_IGNORE
10884 [ALC662_FIXUP_ASUS_MODE5] = {
10885 .type = HDA_FIXUP_PINS,
10886 .v.pins = (const struct hda_pintbl[]) {
10887 { 0x14, 0x99130110 }, /* speaker */
10888 { 0x15, 0x0121441f }, /* HP */
10889 { 0x16, 0x99130111 }, /* speaker */
10890 { 0x18, 0x01a19840 }, /* mic */
10891 { 0x19, 0x99a3094f }, /* int-mic */
10895 .chain_id = ALC662_FIXUP_SKU_IGNORE
10897 [ALC662_FIXUP_ASUS_MODE6] = {
10898 .type = HDA_FIXUP_PINS,
10899 .v.pins = (const struct hda_pintbl[]) {
10900 { 0x14, 0x99130110 }, /* speaker */
10901 { 0x15, 0x01211420 }, /* HP2 */
10902 { 0x18, 0x01a19840 }, /* mic */
10903 { 0x19, 0x99a3094f }, /* int-mic */
10904 { 0x1b, 0x0121441f }, /* HP */
10908 .chain_id = ALC662_FIXUP_SKU_IGNORE
10910 [ALC662_FIXUP_ASUS_MODE7] = {
10911 .type = HDA_FIXUP_PINS,
10912 .v.pins = (const struct hda_pintbl[]) {
10913 { 0x14, 0x99130110 }, /* speaker */
10914 { 0x17, 0x99130111 }, /* speaker */
10915 { 0x18, 0x01a19840 }, /* mic */
10916 { 0x19, 0x99a3094f }, /* int-mic */
10917 { 0x1b, 0x01214020 }, /* HP */
10918 { 0x21, 0x0121401f }, /* HP */
10922 .chain_id = ALC662_FIXUP_SKU_IGNORE
10924 [ALC662_FIXUP_ASUS_MODE8] = {
10925 .type = HDA_FIXUP_PINS,
10926 .v.pins = (const struct hda_pintbl[]) {
10927 { 0x14, 0x99130110 }, /* speaker */
10928 { 0x12, 0x99a30970 }, /* int-mic */
10929 { 0x15, 0x01214020 }, /* HP */
10930 { 0x17, 0x99130111 }, /* speaker */
10931 { 0x18, 0x01a19840 }, /* mic */
10932 { 0x21, 0x0121401f }, /* HP */
10936 .chain_id = ALC662_FIXUP_SKU_IGNORE
10938 [ALC662_FIXUP_NO_JACK_DETECT] = {
10939 .type = HDA_FIXUP_FUNC,
10940 .v.func = alc_fixup_no_jack_detect,
10942 [ALC662_FIXUP_ZOTAC_Z68] = {
10943 .type = HDA_FIXUP_PINS,
10944 .v.pins = (const struct hda_pintbl[]) {
10945 { 0x1b, 0x02214020 }, /* Front HP */
10949 [ALC662_FIXUP_INV_DMIC] = {
10950 .type = HDA_FIXUP_FUNC,
10951 .v.func = alc_fixup_inv_dmic,
10953 [ALC668_FIXUP_DELL_XPS13] = {
10954 .type = HDA_FIXUP_FUNC,
10955 .v.func = alc_fixup_dell_xps13,
10957 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
10959 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
10960 .type = HDA_FIXUP_FUNC,
10961 .v.func = alc_fixup_disable_aamix,
10963 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10965 [ALC668_FIXUP_AUTO_MUTE] = {
10966 .type = HDA_FIXUP_FUNC,
10967 .v.func = alc_fixup_auto_mute_via_amp,
10969 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
10971 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
10972 .type = HDA_FIXUP_PINS,
10973 .v.pins = (const struct hda_pintbl[]) {
10974 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10975 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
10979 .chain_id = ALC662_FIXUP_HEADSET_MODE
10981 [ALC662_FIXUP_HEADSET_MODE] = {
10982 .type = HDA_FIXUP_FUNC,
10983 .v.func = alc_fixup_headset_mode_alc662,
10985 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
10986 .type = HDA_FIXUP_PINS,
10987 .v.pins = (const struct hda_pintbl[]) {
10988 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
10989 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
10993 .chain_id = ALC668_FIXUP_HEADSET_MODE
10995 [ALC668_FIXUP_HEADSET_MODE] = {
10996 .type = HDA_FIXUP_FUNC,
10997 .v.func = alc_fixup_headset_mode_alc668,
10999 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
11000 .type = HDA_FIXUP_FUNC,
11001 .v.func = alc_fixup_bass_chmap,
11003 .chain_id = ALC662_FIXUP_ASUS_MODE4
11005 [ALC662_FIXUP_BASS_16] = {
11006 .type = HDA_FIXUP_PINS,
11007 .v.pins = (const struct hda_pintbl[]) {
11008 {0x16, 0x80106111}, /* bass speaker */
11012 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11014 [ALC662_FIXUP_BASS_1A] = {
11015 .type = HDA_FIXUP_PINS,
11016 .v.pins = (const struct hda_pintbl[]) {
11017 {0x1a, 0x80106111}, /* bass speaker */
11021 .chain_id = ALC662_FIXUP_BASS_CHMAP,
11023 [ALC662_FIXUP_BASS_CHMAP] = {
11024 .type = HDA_FIXUP_FUNC,
11025 .v.func = alc_fixup_bass_chmap,
11027 [ALC662_FIXUP_ASUS_Nx50] = {
11028 .type = HDA_FIXUP_FUNC,
11029 .v.func = alc_fixup_auto_mute_via_amp,
11031 .chain_id = ALC662_FIXUP_BASS_1A
11033 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
11034 .type = HDA_FIXUP_FUNC,
11035 .v.func = alc_fixup_headset_mode_alc668,
11036 .chain_id = ALC662_FIXUP_BASS_CHMAP
11038 [ALC668_FIXUP_ASUS_Nx51] = {
11039 .type = HDA_FIXUP_PINS,
11040 .v.pins = (const struct hda_pintbl[]) {
11041 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11042 { 0x1a, 0x90170151 }, /* bass speaker */
11043 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11047 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
11049 [ALC668_FIXUP_MIC_COEF] = {
11050 .type = HDA_FIXUP_VERBS,
11051 .v.verbs = (const struct hda_verb[]) {
11052 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
11053 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
11057 [ALC668_FIXUP_ASUS_G751] = {
11058 .type = HDA_FIXUP_PINS,
11059 .v.pins = (const struct hda_pintbl[]) {
11060 { 0x16, 0x0421101f }, /* HP */
11064 .chain_id = ALC668_FIXUP_MIC_COEF
11066 [ALC891_FIXUP_HEADSET_MODE] = {
11067 .type = HDA_FIXUP_FUNC,
11068 .v.func = alc_fixup_headset_mode,
11070 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
11071 .type = HDA_FIXUP_PINS,
11072 .v.pins = (const struct hda_pintbl[]) {
11073 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
11074 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
11078 .chain_id = ALC891_FIXUP_HEADSET_MODE
11080 [ALC662_FIXUP_ACER_VERITON] = {
11081 .type = HDA_FIXUP_PINS,
11082 .v.pins = (const struct hda_pintbl[]) {
11083 { 0x15, 0x50170120 }, /* no internal speaker */
11087 [ALC892_FIXUP_ASROCK_MOBO] = {
11088 .type = HDA_FIXUP_PINS,
11089 .v.pins = (const struct hda_pintbl[]) {
11090 { 0x15, 0x40f000f0 }, /* disabled */
11091 { 0x16, 0x40f000f0 }, /* disabled */
11095 [ALC662_FIXUP_USI_FUNC] = {
11096 .type = HDA_FIXUP_FUNC,
11097 .v.func = alc662_fixup_usi_headset_mic,
11099 [ALC662_FIXUP_USI_HEADSET_MODE] = {
11100 .type = HDA_FIXUP_PINS,
11101 .v.pins = (const struct hda_pintbl[]) {
11102 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
11103 { 0x18, 0x01a1903d },
11107 .chain_id = ALC662_FIXUP_USI_FUNC
11109 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
11110 .type = HDA_FIXUP_FUNC,
11111 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
11113 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
11114 .type = HDA_FIXUP_FUNC,
11115 .v.func = alc662_fixup_aspire_ethos_hp,
11117 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
11118 .type = HDA_FIXUP_PINS,
11119 .v.pins = (const struct hda_pintbl[]) {
11120 { 0x15, 0x92130110 }, /* front speakers */
11121 { 0x18, 0x99130111 }, /* center/subwoofer */
11122 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
11126 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
11128 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
11129 .type = HDA_FIXUP_FUNC,
11130 .v.func = alc671_fixup_hp_headset_mic2,
11132 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
11133 .type = HDA_FIXUP_PINS,
11134 .v.pins = (const struct hda_pintbl[]) {
11135 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
11139 .chain_id = ALC662_FIXUP_USI_FUNC
11141 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
11142 .type = HDA_FIXUP_PINS,
11143 .v.pins = (const struct hda_pintbl[]) {
11144 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11145 { 0x1b, 0x0221144f },
11149 .chain_id = ALC662_FIXUP_USI_FUNC
11151 [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = {
11152 .type = HDA_FIXUP_PINS,
11153 .v.pins = (const struct hda_pintbl[]) {
11154 { 0x1b, 0x04a1112c },
11158 .chain_id = ALC668_FIXUP_HEADSET_MIC
11160 [ALC668_FIXUP_HEADSET_MIC] = {
11161 .type = HDA_FIXUP_FUNC,
11162 .v.func = alc269_fixup_headset_mic,
11164 .chain_id = ALC668_FIXUP_MIC_DET_COEF
11166 [ALC668_FIXUP_MIC_DET_COEF] = {
11167 .type = HDA_FIXUP_VERBS,
11168 .v.verbs = (const struct hda_verb[]) {
11169 { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 },
11170 { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 },
11174 [ALC897_FIXUP_LENOVO_HEADSET_MIC] = {
11175 .type = HDA_FIXUP_FUNC,
11176 .v.func = alc897_fixup_lenovo_headset_mic,
11178 [ALC897_FIXUP_HEADSET_MIC_PIN] = {
11179 .type = HDA_FIXUP_PINS,
11180 .v.pins = (const struct hda_pintbl[]) {
11181 { 0x1a, 0x03a11050 },
11185 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
11187 [ALC897_FIXUP_HP_HSMIC_VERB] = {
11188 .type = HDA_FIXUP_PINS,
11189 .v.pins = (const struct hda_pintbl[]) {
11190 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
11194 [ALC897_FIXUP_LENOVO_HEADSET_MODE] = {
11195 .type = HDA_FIXUP_FUNC,
11196 .v.func = alc897_fixup_lenovo_headset_mode,
11198 [ALC897_FIXUP_HEADSET_MIC_PIN2] = {
11199 .type = HDA_FIXUP_PINS,
11200 .v.pins = (const struct hda_pintbl[]) {
11201 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
11205 .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MODE
11209 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
11210 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
11211 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
11212 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
11213 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
11214 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
11215 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
11216 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
11217 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
11218 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
11219 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
11220 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
11221 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11222 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11223 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
11224 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
11225 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
11226 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11227 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11228 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11229 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11230 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
11231 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
11232 SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
11233 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
11234 SND_PCI_QUIRK(0x103c, 0x877e, "HP 288 Pro G6", ALC671_FIXUP_HP_HEADSET_MIC2),
11235 SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
11236 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
11237 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
11238 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
11239 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
11240 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
11241 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11242 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
11243 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
11244 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
11245 SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC),
11246 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
11247 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
11248 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
11249 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
11250 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
11251 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
11252 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
11253 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
11254 SND_PCI_QUIRK(0x17aa, 0x1057, "Lenovo P360", ALC897_FIXUP_HEADSET_MIC_PIN),
11255 SND_PCI_QUIRK(0x17aa, 0x32ca, "Lenovo ThinkCentre M80", ALC897_FIXUP_HEADSET_MIC_PIN),
11256 SND_PCI_QUIRK(0x17aa, 0x32cb, "Lenovo ThinkCentre M70", ALC897_FIXUP_HEADSET_MIC_PIN),
11257 SND_PCI_QUIRK(0x17aa, 0x32cf, "Lenovo ThinkCentre M950", ALC897_FIXUP_HEADSET_MIC_PIN),
11258 SND_PCI_QUIRK(0x17aa, 0x32f7, "Lenovo ThinkCentre M90", ALC897_FIXUP_HEADSET_MIC_PIN),
11259 SND_PCI_QUIRK(0x17aa, 0x3742, "Lenovo TianYi510Pro-14IOB", ALC897_FIXUP_HEADSET_MIC_PIN2),
11260 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
11261 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
11262 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
11263 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
11264 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
11265 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
11266 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
11269 /* Below is a quirk table taken from the old code.
11270 * Basically the device should work as is without the fixup table.
11271 * If BIOS doesn't give a proper info, enable the corresponding
11274 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
11275 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
11276 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
11277 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
11278 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11279 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11280 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11281 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
11282 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
11283 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11284 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
11285 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
11286 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
11287 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
11288 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
11289 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11290 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
11291 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
11292 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11293 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11294 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11295 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11296 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
11297 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
11298 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
11299 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11300 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
11301 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
11302 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11303 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
11304 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11305 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11306 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
11307 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
11308 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
11309 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
11310 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
11311 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
11312 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
11313 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
11314 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
11315 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
11316 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11317 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
11318 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
11319 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
11320 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
11321 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
11322 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
11323 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
11328 static const struct hda_model_fixup alc662_fixup_models[] = {
11329 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
11330 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
11331 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
11332 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
11333 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
11334 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
11335 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
11336 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
11337 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
11338 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
11339 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
11340 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
11341 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
11342 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
11343 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
11344 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
11345 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
11346 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
11347 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
11348 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
11349 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
11350 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
11351 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
11352 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
11353 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
11354 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
11355 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
11356 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
11357 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
11358 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
11359 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
11360 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
11364 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
11365 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11366 {0x17, 0x02211010},
11367 {0x18, 0x01a19030},
11368 {0x1a, 0x01813040},
11369 {0x21, 0x01014020}),
11370 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
11371 {0x16, 0x01813030},
11372 {0x17, 0x02211010},
11373 {0x18, 0x01a19040},
11374 {0x21, 0x01014020}),
11375 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
11376 {0x14, 0x01014010},
11377 {0x18, 0x01a19020},
11378 {0x1a, 0x0181302f},
11379 {0x1b, 0x0221401f}),
11380 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11381 {0x12, 0x99a30130},
11382 {0x14, 0x90170110},
11383 {0x15, 0x0321101f},
11384 {0x16, 0x03011020}),
11385 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11386 {0x12, 0x99a30140},
11387 {0x14, 0x90170110},
11388 {0x15, 0x0321101f},
11389 {0x16, 0x03011020}),
11390 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11391 {0x12, 0x99a30150},
11392 {0x14, 0x90170110},
11393 {0x15, 0x0321101f},
11394 {0x16, 0x03011020}),
11395 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
11396 {0x14, 0x90170110},
11397 {0x15, 0x0321101f},
11398 {0x16, 0x03011020}),
11399 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
11400 {0x12, 0x90a60130},
11401 {0x14, 0x90170110},
11402 {0x15, 0x0321101f}),
11403 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11404 {0x14, 0x01014010},
11405 {0x17, 0x90170150},
11406 {0x19, 0x02a11060},
11407 {0x1b, 0x01813030},
11408 {0x21, 0x02211020}),
11409 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11410 {0x14, 0x01014010},
11411 {0x18, 0x01a19040},
11412 {0x1b, 0x01813030},
11413 {0x21, 0x02211020}),
11414 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
11415 {0x14, 0x01014020},
11416 {0x17, 0x90170110},
11417 {0x18, 0x01a19050},
11418 {0x1b, 0x01813040},
11419 {0x21, 0x02211030}),
11425 static int patch_alc662(struct hda_codec *codec)
11427 struct alc_spec *spec;
11430 err = alc_alloc_spec(codec, 0x0b);
11434 spec = codec->spec;
11436 spec->shutup = alc_eapd_shutup;
11438 /* handle multiple HPs as is */
11439 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
11441 alc_fix_pll_init(codec, 0x20, 0x04, 15);
11443 switch (codec->core.vendor_id) {
11445 spec->init_hook = alc668_restore_default_value;
11449 alc_pre_init(codec);
11451 snd_hda_pick_fixup(codec, alc662_fixup_models,
11452 alc662_fixup_tbl, alc662_fixups);
11453 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
11454 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
11456 alc_auto_parse_customize_define(codec);
11458 if (has_cdefine_beep(codec))
11459 spec->gen.beep_nid = 0x01;
11461 if ((alc_get_coef0(codec) & (1 << 14)) &&
11462 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
11463 spec->cdefine.platform_type == 1) {
11464 err = alc_codec_rename(codec, "ALC272X");
11469 /* automatic parse from the BIOS config */
11470 err = alc662_parse_auto_config(codec);
11474 if (!spec->gen.no_analog && spec->gen.beep_nid) {
11475 switch (codec->core.vendor_id) {
11477 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
11483 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
11486 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
11493 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
11506 static int alc680_parse_auto_config(struct hda_codec *codec)
11508 return alc_parse_auto_config(codec, NULL, NULL);
11513 static int patch_alc680(struct hda_codec *codec)
11517 /* ALC680 has no aa-loopback mixer */
11518 err = alc_alloc_spec(codec, 0);
11522 /* automatic parse from the BIOS config */
11523 err = alc680_parse_auto_config(codec);
11535 static const struct hda_device_id snd_hda_id_realtek[] = {
11536 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
11537 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
11538 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
11539 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
11540 HDA_CODEC_ENTRY(0x10ec0230, "ALC236", patch_alc269),
11541 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
11542 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
11543 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
11544 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
11545 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
11546 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
11547 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
11548 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
11549 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
11550 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
11551 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
11552 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
11553 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
11554 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
11555 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
11556 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
11557 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
11558 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
11559 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
11560 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
11561 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
11562 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
11563 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
11564 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
11565 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
11566 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
11567 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
11568 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
11569 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
11570 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
11571 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
11572 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
11573 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
11574 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
11575 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
11576 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
11577 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
11578 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
11579 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
11580 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
11581 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
11582 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
11583 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
11584 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
11585 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
11586 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
11587 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
11588 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
11589 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
11590 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
11591 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
11592 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
11593 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
11594 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
11595 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
11596 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
11597 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
11598 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
11599 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
11600 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
11601 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
11602 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
11603 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
11604 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
11605 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
11606 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
11607 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
11608 HDA_CODEC_ENTRY(0x10ec0897, "ALC897", patch_alc662),
11609 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
11610 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
11611 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
11612 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
11613 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
11614 HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
11615 {} /* terminator */
11617 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
11619 MODULE_LICENSE("GPL");
11620 MODULE_DESCRIPTION("Realtek HD-audio codec");
11622 static struct hda_codec_driver realtek_driver = {
11623 .id = snd_hda_id_realtek,
11626 module_hda_codec_driver(realtek_driver);