1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <sound/core.h>
21 #include <sound/jack.h>
22 #include <sound/hda_codec.h>
23 #include "hda_local.h"
24 #include "hda_auto_parser.h"
26 #include "hda_generic.h"
28 /* keep halting ALC5505 DSP, for power saving */
29 #define HALT_REALTEK_ALC5505
31 /* extra amp-initialization sequence types */
39 ALC_HEADSET_MODE_UNKNOWN,
40 ALC_HEADSET_MODE_UNPLUGGED,
41 ALC_HEADSET_MODE_HEADSET,
43 ALC_HEADSET_MODE_HEADPHONE,
47 ALC_HEADSET_TYPE_UNKNOWN,
48 ALC_HEADSET_TYPE_CTIA,
49 ALC_HEADSET_TYPE_OMTP,
53 ALC_KEY_MICMUTE_INDEX,
56 struct alc_customize_define {
58 unsigned char port_connectivity;
59 unsigned char check_sum;
60 unsigned char customization;
61 unsigned char external_amp;
62 unsigned int enable_pcbeep:1;
63 unsigned int platform_type:1;
65 unsigned int override:1;
66 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
70 struct hda_gen_spec gen; /* must be at head */
72 /* codec parameterization */
73 struct alc_customize_define cdefine;
74 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
77 unsigned int gpio_mask;
78 unsigned int gpio_dir;
79 unsigned int gpio_data;
80 bool gpio_write_delay; /* add a delay before writing gpio_data */
82 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
83 int mute_led_polarity;
84 hda_nid_t mute_led_nid;
85 hda_nid_t cap_mute_led_nid;
87 unsigned int gpio_mute_led_mask;
88 unsigned int gpio_mic_led_mask;
89 unsigned int mute_led_coef_idx;
90 unsigned int mute_led_coefbit_mask;
91 unsigned int mute_led_coefbit_on;
92 unsigned int mute_led_coefbit_off;
93 unsigned int mic_led_coef_idx;
94 unsigned int mic_led_coefbit_mask;
95 unsigned int mic_led_coefbit_on;
96 unsigned int mic_led_coefbit_off;
98 hda_nid_t headset_mic_pin;
99 hda_nid_t headphone_mic_pin;
100 int current_headset_mode;
101 int current_headset_type;
104 void (*init_hook)(struct hda_codec *codec);
106 void (*power_hook)(struct hda_codec *codec);
108 void (*shutup)(struct hda_codec *codec);
109 void (*reboot_notify)(struct hda_codec *codec);
112 int codec_variant; /* flag for other variants */
113 unsigned int has_alc5505_dsp:1;
114 unsigned int no_depop_delay:1;
115 unsigned int done_hp_init:1;
116 unsigned int no_shutup_pins:1;
117 unsigned int ultra_low_power:1;
118 unsigned int has_hs_key:1;
122 unsigned int pll_coef_idx, pll_coef_bit;
124 struct input_dev *kb_dev;
125 u8 alc_mute_keycode_map[1];
129 * COEF access helper functions
132 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
133 unsigned int coef_idx)
137 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
138 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
142 #define alc_read_coef_idx(codec, coef_idx) \
143 alc_read_coefex_idx(codec, 0x20, coef_idx)
145 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
146 unsigned int coef_idx, unsigned int coef_val)
148 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
149 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
152 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
153 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
155 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
156 unsigned int coef_idx, unsigned int mask,
157 unsigned int bits_set)
159 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
162 alc_write_coefex_idx(codec, nid, coef_idx,
163 (val & ~mask) | bits_set);
166 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
167 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
169 /* a special bypass for COEF 0; read the cached value at the second time */
170 static unsigned int alc_get_coef0(struct hda_codec *codec)
172 struct alc_spec *spec = codec->spec;
175 spec->coef0 = alc_read_coef_idx(codec, 0);
179 /* coef writes/updates batch */
187 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
188 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
189 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
190 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
191 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
193 static void alc_process_coef_fw(struct hda_codec *codec,
194 const struct coef_fw *fw)
196 for (; fw->nid; fw++) {
197 if (fw->mask == (unsigned short)-1)
198 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
200 alc_update_coefex_idx(codec, fw->nid, fw->idx,
206 * GPIO setup tables, used in initialization
209 /* Enable GPIO mask and set output */
210 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
212 struct alc_spec *spec = codec->spec;
214 spec->gpio_mask |= mask;
215 spec->gpio_dir |= mask;
216 spec->gpio_data |= mask;
219 static void alc_write_gpio_data(struct hda_codec *codec)
221 struct alc_spec *spec = codec->spec;
223 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
227 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
230 struct alc_spec *spec = codec->spec;
231 unsigned int oldval = spec->gpio_data;
234 spec->gpio_data |= mask;
236 spec->gpio_data &= ~mask;
237 if (oldval != spec->gpio_data)
238 alc_write_gpio_data(codec);
241 static void alc_write_gpio(struct hda_codec *codec)
243 struct alc_spec *spec = codec->spec;
245 if (!spec->gpio_mask)
248 snd_hda_codec_write(codec, codec->core.afg, 0,
249 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
250 snd_hda_codec_write(codec, codec->core.afg, 0,
251 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
252 if (spec->gpio_write_delay)
254 alc_write_gpio_data(codec);
257 static void alc_fixup_gpio(struct hda_codec *codec, int action,
260 if (action == HDA_FIXUP_ACT_PRE_PROBE)
261 alc_setup_gpio(codec, mask);
264 static void alc_fixup_gpio1(struct hda_codec *codec,
265 const struct hda_fixup *fix, int action)
267 alc_fixup_gpio(codec, action, 0x01);
270 static void alc_fixup_gpio2(struct hda_codec *codec,
271 const struct hda_fixup *fix, int action)
273 alc_fixup_gpio(codec, action, 0x02);
276 static void alc_fixup_gpio3(struct hda_codec *codec,
277 const struct hda_fixup *fix, int action)
279 alc_fixup_gpio(codec, action, 0x03);
282 static void alc_fixup_gpio4(struct hda_codec *codec,
283 const struct hda_fixup *fix, int action)
285 alc_fixup_gpio(codec, action, 0x04);
289 * Fix hardware PLL issue
290 * On some codecs, the analog PLL gating control must be off while
291 * the default value is 1.
293 static void alc_fix_pll(struct hda_codec *codec)
295 struct alc_spec *spec = codec->spec;
298 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
299 1 << spec->pll_coef_bit, 0);
302 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
303 unsigned int coef_idx, unsigned int coef_bit)
305 struct alc_spec *spec = codec->spec;
307 spec->pll_coef_idx = coef_idx;
308 spec->pll_coef_bit = coef_bit;
312 /* update the master volume per volume-knob's unsol event */
313 static void alc_update_knob_master(struct hda_codec *codec,
314 struct hda_jack_callback *jack)
317 struct snd_kcontrol *kctl;
318 struct snd_ctl_elem_value *uctl;
320 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
323 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
326 val = snd_hda_codec_read(codec, jack->nid, 0,
327 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
328 val &= HDA_AMP_VOLMASK;
329 uctl->value.integer.value[0] = val;
330 uctl->value.integer.value[1] = val;
331 kctl->put(kctl, uctl);
335 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
337 /* For some reason, the res given from ALC880 is broken.
338 Here we adjust it properly. */
339 snd_hda_jack_unsol_event(codec, res >> 2);
342 /* Change EAPD to verb control */
343 static void alc_fill_eapd_coef(struct hda_codec *codec)
347 coef = alc_get_coef0(codec);
349 switch (codec->core.vendor_id) {
351 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
355 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
358 if ((coef & 0x00f0) == 0x0010)
359 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
360 if ((coef & 0x00f0) == 0x0020)
361 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
362 if ((coef & 0x00f0) == 0x0030)
363 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
369 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
374 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
391 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
394 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
397 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
406 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
409 if ((coef & 0x00f0) == 0x0030)
410 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
419 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
423 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
426 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
429 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
432 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
433 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
436 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
443 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
448 /* additional initialization for ALC888 variants */
449 static void alc888_coef_init(struct hda_codec *codec)
451 switch (alc_get_coef0(codec) & 0x00f0) {
456 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
461 /* turn on/off EAPD control (only if available) */
462 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
464 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
466 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
467 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
471 /* turn on/off EAPD controls of the codec */
472 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
474 /* We currently only handle front, HP */
475 static const hda_nid_t pins[] = {
476 0x0f, 0x10, 0x14, 0x15, 0x17, 0
479 for (p = pins; *p; p++)
480 set_eapd(codec, *p, on);
483 static int find_ext_mic_pin(struct hda_codec *codec);
485 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
487 const struct hda_pincfg *pin;
488 int mic_pin = find_ext_mic_pin(codec);
491 /* don't shut up pins when unloading the driver; otherwise it breaks
492 * the default pin setup at the next load of the driver
494 if (codec->bus->shutdown)
497 snd_array_for_each(&codec->init_pins, i, pin) {
498 /* use read here for syncing after issuing each verb */
499 if (pin->nid != mic_pin)
500 snd_hda_codec_read(codec, pin->nid, 0,
501 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
504 codec->pins_shutup = 1;
507 static void alc_shutup_pins(struct hda_codec *codec)
509 struct alc_spec *spec = codec->spec;
511 switch (codec->core.vendor_id) {
516 alc_headset_mic_no_shutup(codec);
519 if (!spec->no_shutup_pins)
520 snd_hda_shutup_pins(codec);
525 /* generic shutup callback;
526 * just turning off EAPD and a little pause for avoiding pop-noise
528 static void alc_eapd_shutup(struct hda_codec *codec)
530 struct alc_spec *spec = codec->spec;
532 alc_auto_setup_eapd(codec, false);
533 if (!spec->no_depop_delay)
535 alc_shutup_pins(codec);
538 /* generic EAPD initialization */
539 static void alc_auto_init_amp(struct hda_codec *codec, int type)
541 alc_auto_setup_eapd(codec, true);
542 alc_write_gpio(codec);
544 case ALC_INIT_DEFAULT:
545 switch (codec->core.vendor_id) {
547 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
553 alc_update_coef_idx(codec, 7, 0, 0x2030);
556 alc888_coef_init(codec);
563 /* get a primary headphone pin if available */
564 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
566 if (spec->gen.autocfg.hp_pins[0])
567 return spec->gen.autocfg.hp_pins[0];
568 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
569 return spec->gen.autocfg.line_out_pins[0];
574 * Realtek SSID verification
577 /* Could be any non-zero and even value. When used as fixup, tells
578 * the driver to ignore any present sku defines.
580 #define ALC_FIXUP_SKU_IGNORE (2)
582 static void alc_fixup_sku_ignore(struct hda_codec *codec,
583 const struct hda_fixup *fix, int action)
585 struct alc_spec *spec = codec->spec;
586 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
587 spec->cdefine.fixup = 1;
588 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
592 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
593 const struct hda_fixup *fix, int action)
595 struct alc_spec *spec = codec->spec;
597 if (action == HDA_FIXUP_ACT_PROBE) {
598 spec->no_depop_delay = 1;
599 codec->depop_delay = 0;
603 static int alc_auto_parse_customize_define(struct hda_codec *codec)
605 unsigned int ass, tmp, i;
607 struct alc_spec *spec = codec->spec;
609 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
611 if (spec->cdefine.fixup) {
612 ass = spec->cdefine.sku_cfg;
613 if (ass == ALC_FIXUP_SKU_IGNORE)
618 if (!codec->bus->pci)
620 ass = codec->core.subsystem_id & 0xffff;
621 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
625 if (codec->core.vendor_id == 0x10ec0260)
627 ass = snd_hda_codec_get_pincfg(codec, nid);
630 codec_info(codec, "%s: SKU not ready 0x%08x\n",
631 codec->core.chip_name, ass);
637 for (i = 1; i < 16; i++) {
641 if (((ass >> 16) & 0xf) != tmp)
644 spec->cdefine.port_connectivity = ass >> 30;
645 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
646 spec->cdefine.check_sum = (ass >> 16) & 0xf;
647 spec->cdefine.customization = ass >> 8;
649 spec->cdefine.sku_cfg = ass;
650 spec->cdefine.external_amp = (ass & 0x38) >> 3;
651 spec->cdefine.platform_type = (ass & 0x4) >> 2;
652 spec->cdefine.swap = (ass & 0x2) >> 1;
653 spec->cdefine.override = ass & 0x1;
655 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
656 nid, spec->cdefine.sku_cfg);
657 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
658 spec->cdefine.port_connectivity);
659 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
660 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
661 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
662 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
663 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
664 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
665 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
670 /* return the position of NID in the list, or -1 if not found */
671 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
674 for (i = 0; i < nums; i++)
679 /* return true if the given NID is found in the list */
680 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
682 return find_idx_in_nid_list(nid, list, nums) >= 0;
685 /* check subsystem ID and set up device-specific initialization;
686 * return 1 if initialized, 0 if invalid SSID
688 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
689 * 31 ~ 16 : Manufacture ID
691 * 7 ~ 0 : Assembly ID
692 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
694 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
696 unsigned int ass, tmp, i;
698 struct alc_spec *spec = codec->spec;
700 if (spec->cdefine.fixup) {
701 ass = spec->cdefine.sku_cfg;
702 if (ass == ALC_FIXUP_SKU_IGNORE)
707 ass = codec->core.subsystem_id & 0xffff;
708 if (codec->bus->pci &&
709 ass != codec->bus->pci->subsystem_device && (ass & 1))
712 /* invalid SSID, check the special NID pin defcfg instead */
714 * 31~30 : port connectivity
717 * 19~16 : Check sum (15:1)
722 if (codec->core.vendor_id == 0x10ec0260)
724 ass = snd_hda_codec_get_pincfg(codec, nid);
726 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
730 if ((ass >> 30) != 1) /* no physical connection */
735 for (i = 1; i < 16; i++) {
739 if (((ass >> 16) & 0xf) != tmp)
742 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
743 ass & 0xffff, codec->core.vendor_id);
747 * 2 : 0 --> Desktop, 1 --> Laptop
748 * 3~5 : External Amplifier control
751 tmp = (ass & 0x38) >> 3; /* external Amp control */
752 if (spec->init_amp == ALC_INIT_UNDEFINED) {
755 alc_setup_gpio(codec, 0x01);
758 alc_setup_gpio(codec, 0x02);
761 alc_setup_gpio(codec, 0x03);
765 spec->init_amp = ALC_INIT_DEFAULT;
770 /* is laptop or Desktop and enable the function "Mute internal speaker
771 * when the external headphone out jack is plugged"
776 * 10~8 : Jack location
777 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
779 * 15 : 1 --> enable the function "Mute internal speaker
780 * when the external headphone out jack is plugged"
782 if (!alc_get_hp_pin(spec)) {
784 tmp = (ass >> 11) & 0x3; /* HP to chassis */
786 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
787 spec->gen.autocfg.line_outs))
789 spec->gen.autocfg.hp_pins[0] = nid;
794 /* Check the validity of ALC subsystem-id
795 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
796 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
798 if (!alc_subsystem_id(codec, ports)) {
799 struct alc_spec *spec = codec->spec;
801 "realtek: Enable default setup for auto mode as fallback\n");
802 spec->init_amp = ALC_INIT_DEFAULT;
809 static void alc_fixup_inv_dmic(struct hda_codec *codec,
810 const struct hda_fixup *fix, int action)
812 struct alc_spec *spec = codec->spec;
814 spec->gen.inv_dmic_split = 1;
818 static int alc_build_controls(struct hda_codec *codec)
822 err = snd_hda_gen_build_controls(codec);
826 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
835 static void alc_pre_init(struct hda_codec *codec)
837 alc_fill_eapd_coef(codec);
840 #define is_s3_resume(codec) \
841 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
842 #define is_s4_resume(codec) \
843 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
845 static int alc_init(struct hda_codec *codec)
847 struct alc_spec *spec = codec->spec;
849 /* hibernation resume needs the full chip initialization */
850 if (is_s4_resume(codec))
854 spec->init_hook(codec);
856 spec->gen.skip_verbs = 1; /* applied in below */
857 snd_hda_gen_init(codec);
859 alc_auto_init_amp(codec, spec->init_amp);
860 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
862 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
867 static inline void alc_shutup(struct hda_codec *codec)
869 struct alc_spec *spec = codec->spec;
871 if (!snd_hda_get_bool_hint(codec, "shutup"))
872 return; /* disabled explicitly by hints */
874 if (spec && spec->shutup)
877 alc_shutup_pins(codec);
880 static void alc_reboot_notify(struct hda_codec *codec)
882 struct alc_spec *spec = codec->spec;
884 if (spec && spec->reboot_notify)
885 spec->reboot_notify(codec);
890 #define alc_free snd_hda_gen_free
893 static void alc_power_eapd(struct hda_codec *codec)
895 alc_auto_setup_eapd(codec, false);
898 static int alc_suspend(struct hda_codec *codec)
900 struct alc_spec *spec = codec->spec;
902 if (spec && spec->power_hook)
903 spec->power_hook(codec);
909 static int alc_resume(struct hda_codec *codec)
911 struct alc_spec *spec = codec->spec;
913 if (!spec->no_depop_delay)
914 msleep(150); /* to avoid pop noise */
915 codec->patch_ops.init(codec);
916 snd_hda_regmap_sync(codec);
917 hda_call_check_power_status(codec, 0x01);
924 static const struct hda_codec_ops alc_patch_ops = {
925 .build_controls = alc_build_controls,
926 .build_pcms = snd_hda_gen_build_pcms,
929 .unsol_event = snd_hda_jack_unsol_event,
931 .resume = alc_resume,
932 .suspend = alc_suspend,
933 .check_power_status = snd_hda_gen_check_power_status,
935 .reboot_notify = alc_reboot_notify,
939 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
942 * Rename codecs appropriately from COEF value or subvendor id
944 struct alc_codec_rename_table {
945 unsigned int vendor_id;
946 unsigned short coef_mask;
947 unsigned short coef_bits;
951 struct alc_codec_rename_pci_table {
952 unsigned int codec_vendor_id;
953 unsigned short pci_subvendor;
954 unsigned short pci_subdevice;
958 static const struct alc_codec_rename_table rename_tbl[] = {
959 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
960 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
961 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
962 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
963 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
964 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
965 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
966 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
967 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
968 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
969 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
970 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
971 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
972 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
973 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
974 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
975 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
979 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
980 { 0x10ec0280, 0x1028, 0, "ALC3220" },
981 { 0x10ec0282, 0x1028, 0, "ALC3221" },
982 { 0x10ec0283, 0x1028, 0, "ALC3223" },
983 { 0x10ec0288, 0x1028, 0, "ALC3263" },
984 { 0x10ec0292, 0x1028, 0, "ALC3226" },
985 { 0x10ec0293, 0x1028, 0, "ALC3235" },
986 { 0x10ec0255, 0x1028, 0, "ALC3234" },
987 { 0x10ec0668, 0x1028, 0, "ALC3661" },
988 { 0x10ec0275, 0x1028, 0, "ALC3260" },
989 { 0x10ec0899, 0x1028, 0, "ALC3861" },
990 { 0x10ec0298, 0x1028, 0, "ALC3266" },
991 { 0x10ec0236, 0x1028, 0, "ALC3204" },
992 { 0x10ec0256, 0x1028, 0, "ALC3246" },
993 { 0x10ec0225, 0x1028, 0, "ALC3253" },
994 { 0x10ec0295, 0x1028, 0, "ALC3254" },
995 { 0x10ec0299, 0x1028, 0, "ALC3271" },
996 { 0x10ec0670, 0x1025, 0, "ALC669X" },
997 { 0x10ec0676, 0x1025, 0, "ALC679X" },
998 { 0x10ec0282, 0x1043, 0, "ALC3229" },
999 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1000 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1001 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1002 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1003 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1004 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1005 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1006 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1007 { } /* terminator */
1010 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1012 const struct alc_codec_rename_table *p;
1013 const struct alc_codec_rename_pci_table *q;
1015 for (p = rename_tbl; p->vendor_id; p++) {
1016 if (p->vendor_id != codec->core.vendor_id)
1018 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1019 return alc_codec_rename(codec, p->name);
1022 if (!codec->bus->pci)
1024 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1025 if (q->codec_vendor_id != codec->core.vendor_id)
1027 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1029 if (!q->pci_subdevice ||
1030 q->pci_subdevice == codec->bus->pci->subsystem_device)
1031 return alc_codec_rename(codec, q->name);
1039 * Digital-beep handlers
1041 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1043 /* additional beep mixers; private_value will be overwritten */
1044 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1045 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1046 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1049 /* set up and create beep controls */
1050 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1053 struct snd_kcontrol_new *knew;
1054 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1057 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1058 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1059 &alc_beep_mixer[i]);
1062 knew->private_value = beep_amp;
1067 static const struct snd_pci_quirk beep_white_list[] = {
1068 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1069 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1070 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1071 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1072 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1073 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1074 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1075 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1076 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1077 /* blacklist -- no beep available */
1078 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1079 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1083 static inline int has_cdefine_beep(struct hda_codec *codec)
1085 struct alc_spec *spec = codec->spec;
1086 const struct snd_pci_quirk *q;
1087 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
1090 return spec->cdefine.enable_pcbeep;
1093 #define set_beep_amp(spec, nid, idx, dir) 0
1094 #define has_cdefine_beep(codec) 0
1097 /* parse the BIOS configuration and set up the alc_spec */
1098 /* return 1 if successful, 0 if the proper config is not found,
1099 * or a negative error code
1101 static int alc_parse_auto_config(struct hda_codec *codec,
1102 const hda_nid_t *ignore_nids,
1103 const hda_nid_t *ssid_nids)
1105 struct alc_spec *spec = codec->spec;
1106 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1109 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1115 alc_ssid_check(codec, ssid_nids);
1117 err = snd_hda_gen_parse_auto_config(codec, cfg);
1124 /* common preparation job for alc_spec */
1125 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1127 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1133 snd_hda_gen_spec_init(&spec->gen);
1134 spec->gen.mixer_nid = mixer_nid;
1135 spec->gen.own_eapd_ctl = 1;
1136 codec->single_adc_amp = 1;
1137 /* FIXME: do we need this for all Realtek codec models? */
1138 codec->spdif_status_reset = 1;
1139 codec->patch_ops = alc_patch_ops;
1141 err = alc_codec_rename_from_preset(codec);
1149 static int alc880_parse_auto_config(struct hda_codec *codec)
1151 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1152 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1153 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1162 ALC880_FIXUP_MEDION_RIM,
1164 ALC880_FIXUP_LG_LW25,
1166 ALC880_FIXUP_EAPD_COEF,
1167 ALC880_FIXUP_TCL_S700,
1168 ALC880_FIXUP_VOL_KNOB,
1169 ALC880_FIXUP_FUJITSU,
1171 ALC880_FIXUP_UNIWILL,
1172 ALC880_FIXUP_UNIWILL_DIG,
1174 ALC880_FIXUP_ASUS_W5A,
1175 ALC880_FIXUP_3ST_BASE,
1177 ALC880_FIXUP_3ST_DIG,
1178 ALC880_FIXUP_5ST_BASE,
1180 ALC880_FIXUP_5ST_DIG,
1181 ALC880_FIXUP_6ST_BASE,
1183 ALC880_FIXUP_6ST_DIG,
1184 ALC880_FIXUP_6ST_AUTOMUTE,
1187 /* enable the volume-knob widget support on NID 0x21 */
1188 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1189 const struct hda_fixup *fix, int action)
1191 if (action == HDA_FIXUP_ACT_PROBE)
1192 snd_hda_jack_detect_enable_callback(codec, 0x21,
1193 alc_update_knob_master);
1196 static const struct hda_fixup alc880_fixups[] = {
1197 [ALC880_FIXUP_GPIO1] = {
1198 .type = HDA_FIXUP_FUNC,
1199 .v.func = alc_fixup_gpio1,
1201 [ALC880_FIXUP_GPIO2] = {
1202 .type = HDA_FIXUP_FUNC,
1203 .v.func = alc_fixup_gpio2,
1205 [ALC880_FIXUP_MEDION_RIM] = {
1206 .type = HDA_FIXUP_VERBS,
1207 .v.verbs = (const struct hda_verb[]) {
1208 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1209 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1213 .chain_id = ALC880_FIXUP_GPIO2,
1215 [ALC880_FIXUP_LG] = {
1216 .type = HDA_FIXUP_PINS,
1217 .v.pins = (const struct hda_pintbl[]) {
1218 /* disable bogus unused pins */
1219 { 0x16, 0x411111f0 },
1220 { 0x18, 0x411111f0 },
1221 { 0x1a, 0x411111f0 },
1225 [ALC880_FIXUP_LG_LW25] = {
1226 .type = HDA_FIXUP_PINS,
1227 .v.pins = (const struct hda_pintbl[]) {
1228 { 0x1a, 0x0181344f }, /* line-in */
1229 { 0x1b, 0x0321403f }, /* headphone */
1233 [ALC880_FIXUP_W810] = {
1234 .type = HDA_FIXUP_PINS,
1235 .v.pins = (const struct hda_pintbl[]) {
1236 /* disable bogus unused pins */
1237 { 0x17, 0x411111f0 },
1241 .chain_id = ALC880_FIXUP_GPIO2,
1243 [ALC880_FIXUP_EAPD_COEF] = {
1244 .type = HDA_FIXUP_VERBS,
1245 .v.verbs = (const struct hda_verb[]) {
1246 /* change to EAPD mode */
1247 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1248 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1252 [ALC880_FIXUP_TCL_S700] = {
1253 .type = HDA_FIXUP_VERBS,
1254 .v.verbs = (const struct hda_verb[]) {
1255 /* change to EAPD mode */
1256 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1257 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1261 .chain_id = ALC880_FIXUP_GPIO2,
1263 [ALC880_FIXUP_VOL_KNOB] = {
1264 .type = HDA_FIXUP_FUNC,
1265 .v.func = alc880_fixup_vol_knob,
1267 [ALC880_FIXUP_FUJITSU] = {
1268 /* override all pins as BIOS on old Amilo is broken */
1269 .type = HDA_FIXUP_PINS,
1270 .v.pins = (const struct hda_pintbl[]) {
1271 { 0x14, 0x0121401f }, /* HP */
1272 { 0x15, 0x99030120 }, /* speaker */
1273 { 0x16, 0x99030130 }, /* bass speaker */
1274 { 0x17, 0x411111f0 }, /* N/A */
1275 { 0x18, 0x411111f0 }, /* N/A */
1276 { 0x19, 0x01a19950 }, /* mic-in */
1277 { 0x1a, 0x411111f0 }, /* N/A */
1278 { 0x1b, 0x411111f0 }, /* N/A */
1279 { 0x1c, 0x411111f0 }, /* N/A */
1280 { 0x1d, 0x411111f0 }, /* N/A */
1281 { 0x1e, 0x01454140 }, /* SPDIF out */
1285 .chain_id = ALC880_FIXUP_VOL_KNOB,
1287 [ALC880_FIXUP_F1734] = {
1288 /* almost compatible with FUJITSU, but no bass and SPDIF */
1289 .type = HDA_FIXUP_PINS,
1290 .v.pins = (const struct hda_pintbl[]) {
1291 { 0x14, 0x0121401f }, /* HP */
1292 { 0x15, 0x99030120 }, /* speaker */
1293 { 0x16, 0x411111f0 }, /* N/A */
1294 { 0x17, 0x411111f0 }, /* N/A */
1295 { 0x18, 0x411111f0 }, /* N/A */
1296 { 0x19, 0x01a19950 }, /* mic-in */
1297 { 0x1a, 0x411111f0 }, /* N/A */
1298 { 0x1b, 0x411111f0 }, /* N/A */
1299 { 0x1c, 0x411111f0 }, /* N/A */
1300 { 0x1d, 0x411111f0 }, /* N/A */
1301 { 0x1e, 0x411111f0 }, /* N/A */
1305 .chain_id = ALC880_FIXUP_VOL_KNOB,
1307 [ALC880_FIXUP_UNIWILL] = {
1308 /* need to fix HP and speaker pins to be parsed correctly */
1309 .type = HDA_FIXUP_PINS,
1310 .v.pins = (const struct hda_pintbl[]) {
1311 { 0x14, 0x0121411f }, /* HP */
1312 { 0x15, 0x99030120 }, /* speaker */
1313 { 0x16, 0x99030130 }, /* bass speaker */
1317 [ALC880_FIXUP_UNIWILL_DIG] = {
1318 .type = HDA_FIXUP_PINS,
1319 .v.pins = (const struct hda_pintbl[]) {
1320 /* disable bogus unused pins */
1321 { 0x17, 0x411111f0 },
1322 { 0x19, 0x411111f0 },
1323 { 0x1b, 0x411111f0 },
1324 { 0x1f, 0x411111f0 },
1328 [ALC880_FIXUP_Z71V] = {
1329 .type = HDA_FIXUP_PINS,
1330 .v.pins = (const struct hda_pintbl[]) {
1331 /* set up the whole pins as BIOS is utterly broken */
1332 { 0x14, 0x99030120 }, /* speaker */
1333 { 0x15, 0x0121411f }, /* HP */
1334 { 0x16, 0x411111f0 }, /* N/A */
1335 { 0x17, 0x411111f0 }, /* N/A */
1336 { 0x18, 0x01a19950 }, /* mic-in */
1337 { 0x19, 0x411111f0 }, /* N/A */
1338 { 0x1a, 0x01813031 }, /* line-in */
1339 { 0x1b, 0x411111f0 }, /* N/A */
1340 { 0x1c, 0x411111f0 }, /* N/A */
1341 { 0x1d, 0x411111f0 }, /* N/A */
1342 { 0x1e, 0x0144111e }, /* SPDIF */
1346 [ALC880_FIXUP_ASUS_W5A] = {
1347 .type = HDA_FIXUP_PINS,
1348 .v.pins = (const struct hda_pintbl[]) {
1349 /* set up the whole pins as BIOS is utterly broken */
1350 { 0x14, 0x0121411f }, /* HP */
1351 { 0x15, 0x411111f0 }, /* N/A */
1352 { 0x16, 0x411111f0 }, /* N/A */
1353 { 0x17, 0x411111f0 }, /* N/A */
1354 { 0x18, 0x90a60160 }, /* mic */
1355 { 0x19, 0x411111f0 }, /* N/A */
1356 { 0x1a, 0x411111f0 }, /* N/A */
1357 { 0x1b, 0x411111f0 }, /* N/A */
1358 { 0x1c, 0x411111f0 }, /* N/A */
1359 { 0x1d, 0x411111f0 }, /* N/A */
1360 { 0x1e, 0xb743111e }, /* SPDIF out */
1364 .chain_id = ALC880_FIXUP_GPIO1,
1366 [ALC880_FIXUP_3ST_BASE] = {
1367 .type = HDA_FIXUP_PINS,
1368 .v.pins = (const struct hda_pintbl[]) {
1369 { 0x14, 0x01014010 }, /* line-out */
1370 { 0x15, 0x411111f0 }, /* N/A */
1371 { 0x16, 0x411111f0 }, /* N/A */
1372 { 0x17, 0x411111f0 }, /* N/A */
1373 { 0x18, 0x01a19c30 }, /* mic-in */
1374 { 0x19, 0x0121411f }, /* HP */
1375 { 0x1a, 0x01813031 }, /* line-in */
1376 { 0x1b, 0x02a19c40 }, /* front-mic */
1377 { 0x1c, 0x411111f0 }, /* N/A */
1378 { 0x1d, 0x411111f0 }, /* N/A */
1379 /* 0x1e is filled in below */
1380 { 0x1f, 0x411111f0 }, /* N/A */
1384 [ALC880_FIXUP_3ST] = {
1385 .type = HDA_FIXUP_PINS,
1386 .v.pins = (const struct hda_pintbl[]) {
1387 { 0x1e, 0x411111f0 }, /* N/A */
1391 .chain_id = ALC880_FIXUP_3ST_BASE,
1393 [ALC880_FIXUP_3ST_DIG] = {
1394 .type = HDA_FIXUP_PINS,
1395 .v.pins = (const struct hda_pintbl[]) {
1396 { 0x1e, 0x0144111e }, /* SPDIF */
1400 .chain_id = ALC880_FIXUP_3ST_BASE,
1402 [ALC880_FIXUP_5ST_BASE] = {
1403 .type = HDA_FIXUP_PINS,
1404 .v.pins = (const struct hda_pintbl[]) {
1405 { 0x14, 0x01014010 }, /* front */
1406 { 0x15, 0x411111f0 }, /* N/A */
1407 { 0x16, 0x01011411 }, /* CLFE */
1408 { 0x17, 0x01016412 }, /* surr */
1409 { 0x18, 0x01a19c30 }, /* mic-in */
1410 { 0x19, 0x0121411f }, /* HP */
1411 { 0x1a, 0x01813031 }, /* line-in */
1412 { 0x1b, 0x02a19c40 }, /* front-mic */
1413 { 0x1c, 0x411111f0 }, /* N/A */
1414 { 0x1d, 0x411111f0 }, /* N/A */
1415 /* 0x1e is filled in below */
1416 { 0x1f, 0x411111f0 }, /* N/A */
1420 [ALC880_FIXUP_5ST] = {
1421 .type = HDA_FIXUP_PINS,
1422 .v.pins = (const struct hda_pintbl[]) {
1423 { 0x1e, 0x411111f0 }, /* N/A */
1427 .chain_id = ALC880_FIXUP_5ST_BASE,
1429 [ALC880_FIXUP_5ST_DIG] = {
1430 .type = HDA_FIXUP_PINS,
1431 .v.pins = (const struct hda_pintbl[]) {
1432 { 0x1e, 0x0144111e }, /* SPDIF */
1436 .chain_id = ALC880_FIXUP_5ST_BASE,
1438 [ALC880_FIXUP_6ST_BASE] = {
1439 .type = HDA_FIXUP_PINS,
1440 .v.pins = (const struct hda_pintbl[]) {
1441 { 0x14, 0x01014010 }, /* front */
1442 { 0x15, 0x01016412 }, /* surr */
1443 { 0x16, 0x01011411 }, /* CLFE */
1444 { 0x17, 0x01012414 }, /* side */
1445 { 0x18, 0x01a19c30 }, /* mic-in */
1446 { 0x19, 0x02a19c40 }, /* front-mic */
1447 { 0x1a, 0x01813031 }, /* line-in */
1448 { 0x1b, 0x0121411f }, /* HP */
1449 { 0x1c, 0x411111f0 }, /* N/A */
1450 { 0x1d, 0x411111f0 }, /* N/A */
1451 /* 0x1e is filled in below */
1452 { 0x1f, 0x411111f0 }, /* N/A */
1456 [ALC880_FIXUP_6ST] = {
1457 .type = HDA_FIXUP_PINS,
1458 .v.pins = (const struct hda_pintbl[]) {
1459 { 0x1e, 0x411111f0 }, /* N/A */
1463 .chain_id = ALC880_FIXUP_6ST_BASE,
1465 [ALC880_FIXUP_6ST_DIG] = {
1466 .type = HDA_FIXUP_PINS,
1467 .v.pins = (const struct hda_pintbl[]) {
1468 { 0x1e, 0x0144111e }, /* SPDIF */
1472 .chain_id = ALC880_FIXUP_6ST_BASE,
1474 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1475 .type = HDA_FIXUP_PINS,
1476 .v.pins = (const struct hda_pintbl[]) {
1477 { 0x1b, 0x0121401f }, /* HP with jack detect */
1480 .chained_before = true,
1481 .chain_id = ALC880_FIXUP_6ST_BASE,
1485 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1486 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1487 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1488 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1489 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1490 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1491 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1492 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1493 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1494 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1495 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1496 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1497 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1498 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1499 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1500 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1501 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1502 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1503 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1504 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1505 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1506 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1507 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1508 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1510 /* Below is the copied entries from alc880_quirks.c.
1511 * It's not quite sure whether BIOS sets the correct pin-config table
1512 * on these machines, thus they are kept to be compatible with
1513 * the old static quirks. Once when it's confirmed to work without
1514 * these overrides, it'd be better to remove.
1516 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1517 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1518 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1519 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1520 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1521 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1522 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1523 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1524 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1525 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1526 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1527 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1528 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1529 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1530 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1531 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1532 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1533 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1534 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1535 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1536 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1537 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1538 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1539 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1540 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1541 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1542 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1543 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1544 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1545 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1546 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1547 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1548 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1550 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1551 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1552 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1556 static const struct hda_model_fixup alc880_fixup_models[] = {
1557 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1558 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1559 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1560 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1561 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1562 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1563 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1569 * OK, here we have finally the patch for ALC880
1571 static int patch_alc880(struct hda_codec *codec)
1573 struct alc_spec *spec;
1576 err = alc_alloc_spec(codec, 0x0b);
1581 spec->gen.need_dac_fix = 1;
1582 spec->gen.beep_nid = 0x01;
1584 codec->patch_ops.unsol_event = alc880_unsol_event;
1586 alc_pre_init(codec);
1588 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1590 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1592 /* automatic parse from the BIOS config */
1593 err = alc880_parse_auto_config(codec);
1597 if (!spec->gen.no_analog) {
1598 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1603 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1616 static int alc260_parse_auto_config(struct hda_codec *codec)
1618 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1619 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1620 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1627 ALC260_FIXUP_HP_DC5750,
1628 ALC260_FIXUP_HP_PIN_0F,
1631 ALC260_FIXUP_GPIO1_TOGGLE,
1632 ALC260_FIXUP_REPLACER,
1633 ALC260_FIXUP_HP_B1900,
1635 ALC260_FIXUP_FSC_S7020,
1636 ALC260_FIXUP_FSC_S7020_JWSE,
1637 ALC260_FIXUP_VAIO_PINS,
1640 static void alc260_gpio1_automute(struct hda_codec *codec)
1642 struct alc_spec *spec = codec->spec;
1644 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1647 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1648 const struct hda_fixup *fix, int action)
1650 struct alc_spec *spec = codec->spec;
1651 if (action == HDA_FIXUP_ACT_PROBE) {
1652 /* although the machine has only one output pin, we need to
1653 * toggle GPIO1 according to the jack state
1655 spec->gen.automute_hook = alc260_gpio1_automute;
1656 spec->gen.detect_hp = 1;
1657 spec->gen.automute_speaker = 1;
1658 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1659 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1660 snd_hda_gen_hp_automute);
1661 alc_setup_gpio(codec, 0x01);
1665 static void alc260_fixup_kn1(struct hda_codec *codec,
1666 const struct hda_fixup *fix, int action)
1668 struct alc_spec *spec = codec->spec;
1669 static const struct hda_pintbl pincfgs[] = {
1670 { 0x0f, 0x02214000 }, /* HP/speaker */
1671 { 0x12, 0x90a60160 }, /* int mic */
1672 { 0x13, 0x02a19000 }, /* ext mic */
1673 { 0x18, 0x01446000 }, /* SPDIF out */
1674 /* disable bogus I/O pins */
1675 { 0x10, 0x411111f0 },
1676 { 0x11, 0x411111f0 },
1677 { 0x14, 0x411111f0 },
1678 { 0x15, 0x411111f0 },
1679 { 0x16, 0x411111f0 },
1680 { 0x17, 0x411111f0 },
1681 { 0x19, 0x411111f0 },
1686 case HDA_FIXUP_ACT_PRE_PROBE:
1687 snd_hda_apply_pincfgs(codec, pincfgs);
1688 spec->init_amp = ALC_INIT_NONE;
1693 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1694 const struct hda_fixup *fix, int action)
1696 struct alc_spec *spec = codec->spec;
1697 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1698 spec->init_amp = ALC_INIT_NONE;
1701 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1702 const struct hda_fixup *fix, int action)
1704 struct alc_spec *spec = codec->spec;
1705 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1706 spec->gen.add_jack_modes = 1;
1707 spec->gen.hp_mic = 1;
1711 static const struct hda_fixup alc260_fixups[] = {
1712 [ALC260_FIXUP_HP_DC5750] = {
1713 .type = HDA_FIXUP_PINS,
1714 .v.pins = (const struct hda_pintbl[]) {
1715 { 0x11, 0x90130110 }, /* speaker */
1719 [ALC260_FIXUP_HP_PIN_0F] = {
1720 .type = HDA_FIXUP_PINS,
1721 .v.pins = (const struct hda_pintbl[]) {
1722 { 0x0f, 0x01214000 }, /* HP */
1726 [ALC260_FIXUP_COEF] = {
1727 .type = HDA_FIXUP_VERBS,
1728 .v.verbs = (const struct hda_verb[]) {
1729 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1730 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1734 [ALC260_FIXUP_GPIO1] = {
1735 .type = HDA_FIXUP_FUNC,
1736 .v.func = alc_fixup_gpio1,
1738 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1739 .type = HDA_FIXUP_FUNC,
1740 .v.func = alc260_fixup_gpio1_toggle,
1742 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1744 [ALC260_FIXUP_REPLACER] = {
1745 .type = HDA_FIXUP_VERBS,
1746 .v.verbs = (const struct hda_verb[]) {
1747 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1748 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1752 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1754 [ALC260_FIXUP_HP_B1900] = {
1755 .type = HDA_FIXUP_FUNC,
1756 .v.func = alc260_fixup_gpio1_toggle,
1758 .chain_id = ALC260_FIXUP_COEF,
1760 [ALC260_FIXUP_KN1] = {
1761 .type = HDA_FIXUP_FUNC,
1762 .v.func = alc260_fixup_kn1,
1764 [ALC260_FIXUP_FSC_S7020] = {
1765 .type = HDA_FIXUP_FUNC,
1766 .v.func = alc260_fixup_fsc_s7020,
1768 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1769 .type = HDA_FIXUP_FUNC,
1770 .v.func = alc260_fixup_fsc_s7020_jwse,
1772 .chain_id = ALC260_FIXUP_FSC_S7020,
1774 [ALC260_FIXUP_VAIO_PINS] = {
1775 .type = HDA_FIXUP_PINS,
1776 .v.pins = (const struct hda_pintbl[]) {
1777 /* Pin configs are missing completely on some VAIOs */
1778 { 0x0f, 0x01211020 },
1779 { 0x10, 0x0001003f },
1780 { 0x11, 0x411111f0 },
1781 { 0x12, 0x01a15930 },
1782 { 0x13, 0x411111f0 },
1783 { 0x14, 0x411111f0 },
1784 { 0x15, 0x411111f0 },
1785 { 0x16, 0x411111f0 },
1786 { 0x17, 0x411111f0 },
1787 { 0x18, 0x411111f0 },
1788 { 0x19, 0x411111f0 },
1794 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1795 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1796 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1797 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1798 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1799 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1800 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1801 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1802 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1803 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1804 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1805 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1806 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1810 static const struct hda_model_fixup alc260_fixup_models[] = {
1811 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1812 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1813 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1814 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1820 static int patch_alc260(struct hda_codec *codec)
1822 struct alc_spec *spec;
1825 err = alc_alloc_spec(codec, 0x07);
1830 /* as quite a few machines require HP amp for speaker outputs,
1831 * it's easier to enable it unconditionally; even if it's unneeded,
1832 * it's almost harmless.
1834 spec->gen.prefer_hp_amp = 1;
1835 spec->gen.beep_nid = 0x01;
1837 spec->shutup = alc_eapd_shutup;
1839 alc_pre_init(codec);
1841 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1843 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1845 /* automatic parse from the BIOS config */
1846 err = alc260_parse_auto_config(codec);
1850 if (!spec->gen.no_analog) {
1851 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1856 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1867 * ALC882/883/885/888/889 support
1869 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1870 * configuration. Each pin widget can choose any input DACs and a mixer.
1871 * Each ADC is connected from a mixer of all inputs. This makes possible
1872 * 6-channel independent captures.
1874 * In addition, an independent DAC for the multi-playback (not used in this
1882 ALC882_FIXUP_ABIT_AW9D_MAX,
1883 ALC882_FIXUP_LENOVO_Y530,
1884 ALC882_FIXUP_PB_M5210,
1885 ALC882_FIXUP_ACER_ASPIRE_7736,
1886 ALC882_FIXUP_ASUS_W90V,
1888 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1889 ALC889_FIXUP_VAIO_TT,
1890 ALC888_FIXUP_EEE1601,
1893 ALC883_FIXUP_ACER_EAPD,
1898 ALC882_FIXUP_ASUS_W2JC,
1899 ALC882_FIXUP_ACER_ASPIRE_4930G,
1900 ALC882_FIXUP_ACER_ASPIRE_8930G,
1901 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1902 ALC885_FIXUP_MACPRO_GPIO,
1903 ALC889_FIXUP_DAC_ROUTE,
1904 ALC889_FIXUP_MBP_VREF,
1905 ALC889_FIXUP_IMAC91_VREF,
1906 ALC889_FIXUP_MBA11_VREF,
1907 ALC889_FIXUP_MBA21_VREF,
1908 ALC889_FIXUP_MP11_VREF,
1909 ALC889_FIXUP_MP41_VREF,
1910 ALC882_FIXUP_INV_DMIC,
1911 ALC882_FIXUP_NO_PRIMARY_HP,
1912 ALC887_FIXUP_ASUS_BASS,
1913 ALC887_FIXUP_BASS_CHMAP,
1914 ALC1220_FIXUP_GB_DUAL_CODECS,
1915 ALC1220_FIXUP_CLEVO_P950,
1916 ALC1220_FIXUP_CLEVO_PB51ED,
1917 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1920 static void alc889_fixup_coef(struct hda_codec *codec,
1921 const struct hda_fixup *fix, int action)
1923 if (action != HDA_FIXUP_ACT_INIT)
1925 alc_update_coef_idx(codec, 7, 0, 0x2030);
1928 /* set up GPIO at initialization */
1929 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1930 const struct hda_fixup *fix, int action)
1932 struct alc_spec *spec = codec->spec;
1934 spec->gpio_write_delay = true;
1935 alc_fixup_gpio3(codec, fix, action);
1938 /* Fix the connection of some pins for ALC889:
1939 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1940 * work correctly (bko#42740)
1942 static void alc889_fixup_dac_route(struct hda_codec *codec,
1943 const struct hda_fixup *fix, int action)
1945 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1946 /* fake the connections during parsing the tree */
1947 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1948 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1949 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1950 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1951 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1952 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1953 } else if (action == HDA_FIXUP_ACT_PROBE) {
1954 /* restore the connections */
1955 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1956 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1957 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1958 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1959 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1963 /* Set VREF on HP pin */
1964 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1965 const struct hda_fixup *fix, int action)
1967 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1968 struct alc_spec *spec = codec->spec;
1971 if (action != HDA_FIXUP_ACT_INIT)
1973 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1974 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1975 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1977 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1978 val |= AC_PINCTL_VREF_80;
1979 snd_hda_set_pin_ctl(codec, nids[i], val);
1980 spec->gen.keep_vref_in_automute = 1;
1985 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1986 const hda_nid_t *nids, int num_nids)
1988 struct alc_spec *spec = codec->spec;
1991 for (i = 0; i < num_nids; i++) {
1993 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1994 val |= AC_PINCTL_VREF_50;
1995 snd_hda_set_pin_ctl(codec, nids[i], val);
1997 spec->gen.keep_vref_in_automute = 1;
2000 /* Set VREF on speaker pins on imac91 */
2001 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2002 const struct hda_fixup *fix, int action)
2004 static const hda_nid_t nids[] = { 0x18, 0x1a };
2006 if (action == HDA_FIXUP_ACT_INIT)
2007 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2010 /* Set VREF on speaker pins on mba11 */
2011 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2012 const struct hda_fixup *fix, int action)
2014 static const hda_nid_t nids[] = { 0x18 };
2016 if (action == HDA_FIXUP_ACT_INIT)
2017 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2020 /* Set VREF on speaker pins on mba21 */
2021 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2022 const struct hda_fixup *fix, int action)
2024 static const hda_nid_t nids[] = { 0x18, 0x19 };
2026 if (action == HDA_FIXUP_ACT_INIT)
2027 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2030 /* Don't take HP output as primary
2031 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2032 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2034 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2035 const struct hda_fixup *fix, int action)
2037 struct alc_spec *spec = codec->spec;
2038 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2039 spec->gen.no_primary_hp = 1;
2040 spec->gen.no_multi_io = 1;
2044 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2045 const struct hda_fixup *fix, int action);
2047 /* For dual-codec configuration, we need to disable some features to avoid
2048 * conflicts of kctls and PCM streams
2050 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2051 const struct hda_fixup *fix, int action)
2053 struct alc_spec *spec = codec->spec;
2055 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2057 /* disable vmaster */
2058 spec->gen.suppress_vmaster = 1;
2059 /* auto-mute and auto-mic switch don't work with multiple codecs */
2060 spec->gen.suppress_auto_mute = 1;
2061 spec->gen.suppress_auto_mic = 1;
2062 /* disable aamix as well */
2063 spec->gen.mixer_nid = 0;
2064 /* add location prefix to avoid conflicts */
2065 codec->force_pin_prefix = 1;
2068 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2069 const char *newname)
2071 struct snd_kcontrol *kctl;
2073 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2075 strcpy(kctl->id.name, newname);
2078 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2079 const struct hda_fixup *fix,
2082 alc_fixup_dual_codecs(codec, fix, action);
2084 case HDA_FIXUP_ACT_PRE_PROBE:
2085 /* override card longname to provide a unique UCM profile */
2086 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2088 case HDA_FIXUP_ACT_BUILD:
2089 /* rename Capture controls depending on the codec */
2090 rename_ctl(codec, "Capture Volume",
2092 "Rear-Panel Capture Volume" :
2093 "Front-Panel Capture Volume");
2094 rename_ctl(codec, "Capture Switch",
2096 "Rear-Panel Capture Switch" :
2097 "Front-Panel Capture Switch");
2102 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2103 const struct hda_fixup *fix,
2106 static const hda_nid_t conn1[] = { 0x0c };
2108 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2111 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2112 /* We therefore want to make sure 0x14 (front headphone) and
2113 * 0x1b (speakers) use the stereo DAC 0x02
2115 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2116 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2119 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2120 const struct hda_fixup *fix, int action);
2122 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2123 const struct hda_fixup *fix,
2126 alc1220_fixup_clevo_p950(codec, fix, action);
2127 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2130 static const struct hda_fixup alc882_fixups[] = {
2131 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2132 .type = HDA_FIXUP_PINS,
2133 .v.pins = (const struct hda_pintbl[]) {
2134 { 0x15, 0x01080104 }, /* side */
2135 { 0x16, 0x01011012 }, /* rear */
2136 { 0x17, 0x01016011 }, /* clfe */
2140 [ALC882_FIXUP_LENOVO_Y530] = {
2141 .type = HDA_FIXUP_PINS,
2142 .v.pins = (const struct hda_pintbl[]) {
2143 { 0x15, 0x99130112 }, /* rear int speakers */
2144 { 0x16, 0x99130111 }, /* subwoofer */
2148 [ALC882_FIXUP_PB_M5210] = {
2149 .type = HDA_FIXUP_PINCTLS,
2150 .v.pins = (const struct hda_pintbl[]) {
2151 { 0x19, PIN_VREF50 },
2155 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2156 .type = HDA_FIXUP_FUNC,
2157 .v.func = alc_fixup_sku_ignore,
2159 [ALC882_FIXUP_ASUS_W90V] = {
2160 .type = HDA_FIXUP_PINS,
2161 .v.pins = (const struct hda_pintbl[]) {
2162 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2166 [ALC889_FIXUP_CD] = {
2167 .type = HDA_FIXUP_PINS,
2168 .v.pins = (const struct hda_pintbl[]) {
2169 { 0x1c, 0x993301f0 }, /* CD */
2173 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2174 .type = HDA_FIXUP_PINS,
2175 .v.pins = (const struct hda_pintbl[]) {
2176 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2180 .chain_id = ALC889_FIXUP_CD,
2182 [ALC889_FIXUP_VAIO_TT] = {
2183 .type = HDA_FIXUP_PINS,
2184 .v.pins = (const struct hda_pintbl[]) {
2185 { 0x17, 0x90170111 }, /* hidden surround speaker */
2189 [ALC888_FIXUP_EEE1601] = {
2190 .type = HDA_FIXUP_VERBS,
2191 .v.verbs = (const struct hda_verb[]) {
2192 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2193 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2197 [ALC882_FIXUP_EAPD] = {
2198 .type = HDA_FIXUP_VERBS,
2199 .v.verbs = (const struct hda_verb[]) {
2200 /* change to EAPD mode */
2201 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2202 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2206 [ALC883_FIXUP_EAPD] = {
2207 .type = HDA_FIXUP_VERBS,
2208 .v.verbs = (const struct hda_verb[]) {
2209 /* change to EAPD mode */
2210 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2211 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2215 [ALC883_FIXUP_ACER_EAPD] = {
2216 .type = HDA_FIXUP_VERBS,
2217 .v.verbs = (const struct hda_verb[]) {
2218 /* eanable EAPD on Acer laptops */
2219 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2220 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2224 [ALC882_FIXUP_GPIO1] = {
2225 .type = HDA_FIXUP_FUNC,
2226 .v.func = alc_fixup_gpio1,
2228 [ALC882_FIXUP_GPIO2] = {
2229 .type = HDA_FIXUP_FUNC,
2230 .v.func = alc_fixup_gpio2,
2232 [ALC882_FIXUP_GPIO3] = {
2233 .type = HDA_FIXUP_FUNC,
2234 .v.func = alc_fixup_gpio3,
2236 [ALC882_FIXUP_ASUS_W2JC] = {
2237 .type = HDA_FIXUP_FUNC,
2238 .v.func = alc_fixup_gpio1,
2240 .chain_id = ALC882_FIXUP_EAPD,
2242 [ALC889_FIXUP_COEF] = {
2243 .type = HDA_FIXUP_FUNC,
2244 .v.func = alc889_fixup_coef,
2246 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2247 .type = HDA_FIXUP_PINS,
2248 .v.pins = (const struct hda_pintbl[]) {
2249 { 0x16, 0x99130111 }, /* CLFE speaker */
2250 { 0x17, 0x99130112 }, /* surround speaker */
2254 .chain_id = ALC882_FIXUP_GPIO1,
2256 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2257 .type = HDA_FIXUP_PINS,
2258 .v.pins = (const struct hda_pintbl[]) {
2259 { 0x16, 0x99130111 }, /* CLFE speaker */
2260 { 0x1b, 0x99130112 }, /* surround speaker */
2264 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2266 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2267 /* additional init verbs for Acer Aspire 8930G */
2268 .type = HDA_FIXUP_VERBS,
2269 .v.verbs = (const struct hda_verb[]) {
2270 /* Enable all DACs */
2271 /* DAC DISABLE/MUTE 1? */
2272 /* setting bits 1-5 disables DAC nids 0x02-0x06
2273 * apparently. Init=0x38 */
2274 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2275 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2276 /* DAC DISABLE/MUTE 2? */
2277 /* some bit here disables the other DACs.
2279 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2280 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2282 * This laptop has a stereo digital microphone.
2283 * The mics are only 1cm apart which makes the stereo
2284 * useless. However, either the mic or the ALC889
2285 * makes the signal become a difference/sum signal
2286 * instead of standard stereo, which is annoying.
2287 * So instead we flip this bit which makes the
2288 * codec replicate the sum signal to both channels,
2289 * turning it into a normal mono mic.
2291 /* DMIC_CONTROL? Init value = 0x0001 */
2292 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2293 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2294 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2295 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2299 .chain_id = ALC882_FIXUP_GPIO1,
2301 [ALC885_FIXUP_MACPRO_GPIO] = {
2302 .type = HDA_FIXUP_FUNC,
2303 .v.func = alc885_fixup_macpro_gpio,
2305 [ALC889_FIXUP_DAC_ROUTE] = {
2306 .type = HDA_FIXUP_FUNC,
2307 .v.func = alc889_fixup_dac_route,
2309 [ALC889_FIXUP_MBP_VREF] = {
2310 .type = HDA_FIXUP_FUNC,
2311 .v.func = alc889_fixup_mbp_vref,
2313 .chain_id = ALC882_FIXUP_GPIO1,
2315 [ALC889_FIXUP_IMAC91_VREF] = {
2316 .type = HDA_FIXUP_FUNC,
2317 .v.func = alc889_fixup_imac91_vref,
2319 .chain_id = ALC882_FIXUP_GPIO1,
2321 [ALC889_FIXUP_MBA11_VREF] = {
2322 .type = HDA_FIXUP_FUNC,
2323 .v.func = alc889_fixup_mba11_vref,
2325 .chain_id = ALC889_FIXUP_MBP_VREF,
2327 [ALC889_FIXUP_MBA21_VREF] = {
2328 .type = HDA_FIXUP_FUNC,
2329 .v.func = alc889_fixup_mba21_vref,
2331 .chain_id = ALC889_FIXUP_MBP_VREF,
2333 [ALC889_FIXUP_MP11_VREF] = {
2334 .type = HDA_FIXUP_FUNC,
2335 .v.func = alc889_fixup_mba11_vref,
2337 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2339 [ALC889_FIXUP_MP41_VREF] = {
2340 .type = HDA_FIXUP_FUNC,
2341 .v.func = alc889_fixup_mbp_vref,
2343 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2345 [ALC882_FIXUP_INV_DMIC] = {
2346 .type = HDA_FIXUP_FUNC,
2347 .v.func = alc_fixup_inv_dmic,
2349 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2350 .type = HDA_FIXUP_FUNC,
2351 .v.func = alc882_fixup_no_primary_hp,
2353 [ALC887_FIXUP_ASUS_BASS] = {
2354 .type = HDA_FIXUP_PINS,
2355 .v.pins = (const struct hda_pintbl[]) {
2356 {0x16, 0x99130130}, /* bass speaker */
2360 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2362 [ALC887_FIXUP_BASS_CHMAP] = {
2363 .type = HDA_FIXUP_FUNC,
2364 .v.func = alc_fixup_bass_chmap,
2366 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2367 .type = HDA_FIXUP_FUNC,
2368 .v.func = alc1220_fixup_gb_dual_codecs,
2370 [ALC1220_FIXUP_CLEVO_P950] = {
2371 .type = HDA_FIXUP_FUNC,
2372 .v.func = alc1220_fixup_clevo_p950,
2374 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2375 .type = HDA_FIXUP_FUNC,
2376 .v.func = alc1220_fixup_clevo_pb51ed,
2378 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2379 .type = HDA_FIXUP_PINS,
2380 .v.pins = (const struct hda_pintbl[]) {
2381 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2385 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2389 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2390 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2391 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2392 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2393 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2394 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2395 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2396 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2397 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2398 ALC882_FIXUP_ACER_ASPIRE_4930G),
2399 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2400 ALC882_FIXUP_ACER_ASPIRE_4930G),
2401 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2402 ALC882_FIXUP_ACER_ASPIRE_8930G),
2403 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2404 ALC882_FIXUP_ACER_ASPIRE_8930G),
2405 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2406 ALC882_FIXUP_ACER_ASPIRE_4930G),
2407 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2408 ALC882_FIXUP_ACER_ASPIRE_4930G),
2409 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2410 ALC882_FIXUP_ACER_ASPIRE_4930G),
2411 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2412 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2413 ALC882_FIXUP_ACER_ASPIRE_4930G),
2414 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2415 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2416 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2417 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2418 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2419 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2420 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2421 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2422 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2423 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2424 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2425 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2426 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2427 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2429 /* All Apple entries are in codec SSIDs */
2430 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2431 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2432 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2433 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2434 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2435 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2436 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2437 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2438 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2439 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2440 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2441 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2442 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2443 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2444 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2445 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2446 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2447 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2448 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2449 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2450 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2451 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2453 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2454 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2455 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2456 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
2457 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2458 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2459 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2460 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2461 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2462 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2463 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2464 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2465 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2466 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2467 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2468 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2469 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2470 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2471 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2472 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2473 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2474 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2475 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2479 static const struct hda_model_fixup alc882_fixup_models[] = {
2480 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2481 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2482 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2483 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2484 {.id = ALC889_FIXUP_CD, .name = "cd"},
2485 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2486 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2487 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2488 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2489 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2490 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2491 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2492 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2493 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2494 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2495 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2496 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2497 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2498 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2499 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2500 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2501 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2502 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2503 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2504 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2505 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2506 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2507 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2508 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2509 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2510 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2515 * BIOS auto configuration
2517 /* almost identical with ALC880 parser... */
2518 static int alc882_parse_auto_config(struct hda_codec *codec)
2520 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2521 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2522 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2527 static int patch_alc882(struct hda_codec *codec)
2529 struct alc_spec *spec;
2532 err = alc_alloc_spec(codec, 0x0b);
2538 switch (codec->core.vendor_id) {
2546 /* ALC883 and variants */
2547 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2551 alc_pre_init(codec);
2553 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2555 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2557 alc_auto_parse_customize_define(codec);
2559 if (has_cdefine_beep(codec))
2560 spec->gen.beep_nid = 0x01;
2562 /* automatic parse from the BIOS config */
2563 err = alc882_parse_auto_config(codec);
2567 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2568 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2573 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2586 static int alc262_parse_auto_config(struct hda_codec *codec)
2588 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2589 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2590 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2597 ALC262_FIXUP_FSC_H270,
2598 ALC262_FIXUP_FSC_S7110,
2599 ALC262_FIXUP_HP_Z200,
2601 ALC262_FIXUP_LENOVO_3000,
2603 ALC262_FIXUP_BENQ_T31,
2604 ALC262_FIXUP_INV_DMIC,
2605 ALC262_FIXUP_INTEL_BAYLEYBAY,
2608 static const struct hda_fixup alc262_fixups[] = {
2609 [ALC262_FIXUP_FSC_H270] = {
2610 .type = HDA_FIXUP_PINS,
2611 .v.pins = (const struct hda_pintbl[]) {
2612 { 0x14, 0x99130110 }, /* speaker */
2613 { 0x15, 0x0221142f }, /* front HP */
2614 { 0x1b, 0x0121141f }, /* rear HP */
2618 [ALC262_FIXUP_FSC_S7110] = {
2619 .type = HDA_FIXUP_PINS,
2620 .v.pins = (const struct hda_pintbl[]) {
2621 { 0x15, 0x90170110 }, /* speaker */
2625 .chain_id = ALC262_FIXUP_BENQ,
2627 [ALC262_FIXUP_HP_Z200] = {
2628 .type = HDA_FIXUP_PINS,
2629 .v.pins = (const struct hda_pintbl[]) {
2630 { 0x16, 0x99130120 }, /* internal speaker */
2634 [ALC262_FIXUP_TYAN] = {
2635 .type = HDA_FIXUP_PINS,
2636 .v.pins = (const struct hda_pintbl[]) {
2637 { 0x14, 0x1993e1f0 }, /* int AUX */
2641 [ALC262_FIXUP_LENOVO_3000] = {
2642 .type = HDA_FIXUP_PINCTLS,
2643 .v.pins = (const struct hda_pintbl[]) {
2644 { 0x19, PIN_VREF50 },
2648 .chain_id = ALC262_FIXUP_BENQ,
2650 [ALC262_FIXUP_BENQ] = {
2651 .type = HDA_FIXUP_VERBS,
2652 .v.verbs = (const struct hda_verb[]) {
2653 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2654 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2658 [ALC262_FIXUP_BENQ_T31] = {
2659 .type = HDA_FIXUP_VERBS,
2660 .v.verbs = (const struct hda_verb[]) {
2661 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2662 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2666 [ALC262_FIXUP_INV_DMIC] = {
2667 .type = HDA_FIXUP_FUNC,
2668 .v.func = alc_fixup_inv_dmic,
2670 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2671 .type = HDA_FIXUP_FUNC,
2672 .v.func = alc_fixup_no_depop_delay,
2676 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2677 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2678 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2679 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2680 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2681 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2682 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2683 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2684 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2685 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2686 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2690 static const struct hda_model_fixup alc262_fixup_models[] = {
2691 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2692 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2693 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2694 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2695 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2696 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2697 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2698 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2699 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2705 static int patch_alc262(struct hda_codec *codec)
2707 struct alc_spec *spec;
2710 err = alc_alloc_spec(codec, 0x0b);
2715 spec->gen.shared_mic_vref_pin = 0x18;
2717 spec->shutup = alc_eapd_shutup;
2720 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2723 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2725 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2727 alc_pre_init(codec);
2729 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2731 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2733 alc_auto_parse_customize_define(codec);
2735 if (has_cdefine_beep(codec))
2736 spec->gen.beep_nid = 0x01;
2738 /* automatic parse from the BIOS config */
2739 err = alc262_parse_auto_config(codec);
2743 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2744 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2749 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2761 /* bind Beep switches of both NID 0x0f and 0x10 */
2762 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2763 struct snd_ctl_elem_value *ucontrol)
2765 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2769 mutex_lock(&codec->control_mutex);
2770 pval = kcontrol->private_value;
2771 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2772 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2774 kcontrol->private_value = (pval & ~0xff) | 0x10;
2775 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2777 kcontrol->private_value = pval;
2778 mutex_unlock(&codec->control_mutex);
2782 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2783 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2785 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2786 .name = "Beep Playback Switch",
2787 .subdevice = HDA_SUBDEV_AMP_FLAG,
2788 .info = snd_hda_mixer_amp_switch_info,
2789 .get = snd_hda_mixer_amp_switch_get,
2790 .put = alc268_beep_switch_put,
2791 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2795 /* set PCBEEP vol = 0, mute connections */
2796 static const struct hda_verb alc268_beep_init_verbs[] = {
2797 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2798 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2799 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2804 ALC268_FIXUP_INV_DMIC,
2805 ALC268_FIXUP_HP_EAPD,
2809 static const struct hda_fixup alc268_fixups[] = {
2810 [ALC268_FIXUP_INV_DMIC] = {
2811 .type = HDA_FIXUP_FUNC,
2812 .v.func = alc_fixup_inv_dmic,
2814 [ALC268_FIXUP_HP_EAPD] = {
2815 .type = HDA_FIXUP_VERBS,
2816 .v.verbs = (const struct hda_verb[]) {
2817 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2821 [ALC268_FIXUP_SPDIF] = {
2822 .type = HDA_FIXUP_PINS,
2823 .v.pins = (const struct hda_pintbl[]) {
2824 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2830 static const struct hda_model_fixup alc268_fixup_models[] = {
2831 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2832 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2833 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2837 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2838 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2839 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2840 /* below is codec SSID since multiple Toshiba laptops have the
2841 * same PCI SSID 1179:ff00
2843 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2848 * BIOS auto configuration
2850 static int alc268_parse_auto_config(struct hda_codec *codec)
2852 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2853 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2858 static int patch_alc268(struct hda_codec *codec)
2860 struct alc_spec *spec;
2863 /* ALC268 has no aa-loopback mixer */
2864 err = alc_alloc_spec(codec, 0);
2869 if (has_cdefine_beep(codec))
2870 spec->gen.beep_nid = 0x01;
2872 spec->shutup = alc_eapd_shutup;
2874 alc_pre_init(codec);
2876 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2877 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2879 /* automatic parse from the BIOS config */
2880 err = alc268_parse_auto_config(codec);
2884 if (err > 0 && !spec->gen.no_analog &&
2885 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2886 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2887 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2888 &alc268_beep_mixer[i])) {
2893 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2894 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2895 /* override the amp caps for beep generator */
2896 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
2897 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
2898 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
2899 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2900 (0 << AC_AMPCAP_MUTE_SHIFT));
2903 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2916 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
2917 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2920 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
2921 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2924 /* different alc269-variants */
2926 ALC269_TYPE_ALC269VA,
2927 ALC269_TYPE_ALC269VB,
2928 ALC269_TYPE_ALC269VC,
2929 ALC269_TYPE_ALC269VD,
2949 * BIOS auto configuration
2951 static int alc269_parse_auto_config(struct hda_codec *codec)
2953 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
2954 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
2955 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2956 struct alc_spec *spec = codec->spec;
2957 const hda_nid_t *ssids;
2959 switch (spec->codec_variant) {
2960 case ALC269_TYPE_ALC269VA:
2961 case ALC269_TYPE_ALC269VC:
2962 case ALC269_TYPE_ALC280:
2963 case ALC269_TYPE_ALC284:
2964 case ALC269_TYPE_ALC293:
2965 ssids = alc269va_ssids;
2967 case ALC269_TYPE_ALC269VB:
2968 case ALC269_TYPE_ALC269VD:
2969 case ALC269_TYPE_ALC282:
2970 case ALC269_TYPE_ALC283:
2971 case ALC269_TYPE_ALC286:
2972 case ALC269_TYPE_ALC298:
2973 case ALC269_TYPE_ALC255:
2974 case ALC269_TYPE_ALC256:
2975 case ALC269_TYPE_ALC257:
2976 case ALC269_TYPE_ALC215:
2977 case ALC269_TYPE_ALC225:
2978 case ALC269_TYPE_ALC294:
2979 case ALC269_TYPE_ALC300:
2980 case ALC269_TYPE_ALC623:
2981 case ALC269_TYPE_ALC700:
2982 ssids = alc269_ssids;
2985 ssids = alc269_ssids;
2989 return alc_parse_auto_config(codec, alc269_ignore, ssids);
2992 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
2993 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
2994 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
2995 { SND_JACK_BTN_2, KEY_VOLUMEUP },
2996 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3000 static void alc_headset_btn_callback(struct hda_codec *codec,
3001 struct hda_jack_callback *jack)
3005 if (jack->unsol_res & (7 << 13))
3006 report |= SND_JACK_BTN_0;
3008 if (jack->unsol_res & (1 << 16 | 3 << 8))
3009 report |= SND_JACK_BTN_1;
3012 if (jack->unsol_res & (7 << 23))
3013 report |= SND_JACK_BTN_2;
3015 /* Volume down key */
3016 if (jack->unsol_res & (7 << 10))
3017 report |= SND_JACK_BTN_3;
3019 jack->jack->button_state = report;
3022 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3024 struct alc_spec *spec = codec->spec;
3026 if (!spec->has_hs_key)
3029 switch (codec->core.vendor_id) {
3036 alc_write_coef_idx(codec, 0x48, 0x0);
3037 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3038 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3042 alc_write_coef_idx(codec, 0x48, 0x0);
3043 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3048 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3050 struct alc_spec *spec = codec->spec;
3052 if (!spec->has_hs_key)
3055 switch (codec->core.vendor_id) {
3062 alc_write_coef_idx(codec, 0x48, 0xd011);
3063 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3064 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3068 alc_write_coef_idx(codec, 0x48, 0xd011);
3069 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3074 static void alc_fixup_headset_jack(struct hda_codec *codec,
3075 const struct hda_fixup *fix, int action)
3077 struct alc_spec *spec = codec->spec;
3080 case HDA_FIXUP_ACT_PRE_PROBE:
3081 spec->has_hs_key = 1;
3082 snd_hda_jack_detect_enable_callback(codec, 0x55,
3083 alc_headset_btn_callback);
3084 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
3085 SND_JACK_HEADSET, alc_headset_btn_keymap);
3087 case HDA_FIXUP_ACT_INIT:
3088 alc_enable_headset_jack_key(codec);
3093 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3095 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3098 static void alc269_shutup(struct hda_codec *codec)
3100 struct alc_spec *spec = codec->spec;
3102 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3103 alc269vb_toggle_power_output(codec, 0);
3104 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3105 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3108 alc_shutup_pins(codec);
3111 static const struct coef_fw alc282_coefs[] = {
3112 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3113 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3114 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3115 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3116 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3117 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3118 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3119 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3120 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3121 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3122 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3123 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3124 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3125 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3126 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3127 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3128 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3129 WRITE_COEF(0x63, 0x2902), /* PLL */
3130 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3131 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3132 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3133 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3134 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3135 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3136 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3137 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3138 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3139 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3140 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3144 static void alc282_restore_default_value(struct hda_codec *codec)
3146 alc_process_coef_fw(codec, alc282_coefs);
3149 static void alc282_init(struct hda_codec *codec)
3151 struct alc_spec *spec = codec->spec;
3152 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3156 alc282_restore_default_value(codec);
3160 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3161 coef78 = alc_read_coef_idx(codec, 0x78);
3163 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3164 /* Headphone capless set to high power mode */
3165 alc_write_coef_idx(codec, 0x78, 0x9004);
3170 snd_hda_codec_write(codec, hp_pin, 0,
3171 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3176 snd_hda_codec_write(codec, hp_pin, 0,
3177 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3182 /* Headphone capless set to normal mode */
3183 alc_write_coef_idx(codec, 0x78, coef78);
3186 static void alc282_shutup(struct hda_codec *codec)
3188 struct alc_spec *spec = codec->spec;
3189 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3194 alc269_shutup(codec);
3198 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3199 coef78 = alc_read_coef_idx(codec, 0x78);
3200 alc_write_coef_idx(codec, 0x78, 0x9004);
3205 snd_hda_codec_write(codec, hp_pin, 0,
3206 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3211 if (!spec->no_shutup_pins)
3212 snd_hda_codec_write(codec, hp_pin, 0,
3213 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3218 alc_auto_setup_eapd(codec, false);
3219 alc_shutup_pins(codec);
3220 alc_write_coef_idx(codec, 0x78, coef78);
3223 static const struct coef_fw alc283_coefs[] = {
3224 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3225 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3226 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3227 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3228 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3229 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3230 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3231 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3232 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3233 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3234 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3235 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3236 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3237 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3238 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3239 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3240 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3241 WRITE_COEF(0x2e, 0x2902), /* PLL */
3242 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3243 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3244 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3245 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3246 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3247 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3248 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3249 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3250 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3251 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3252 WRITE_COEF(0x49, 0x0), /* test mode */
3253 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3254 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3255 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3256 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3260 static void alc283_restore_default_value(struct hda_codec *codec)
3262 alc_process_coef_fw(codec, alc283_coefs);
3265 static void alc283_init(struct hda_codec *codec)
3267 struct alc_spec *spec = codec->spec;
3268 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3271 alc283_restore_default_value(codec);
3277 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3279 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3280 /* Headphone capless set to high power mode */
3281 alc_write_coef_idx(codec, 0x43, 0x9004);
3283 snd_hda_codec_write(codec, hp_pin, 0,
3284 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3289 snd_hda_codec_write(codec, hp_pin, 0,
3290 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3294 /* Index 0x46 Combo jack auto switch control 2 */
3295 /* 3k pull low control for Headset jack. */
3296 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3297 /* Headphone capless set to normal mode */
3298 alc_write_coef_idx(codec, 0x43, 0x9614);
3301 static void alc283_shutup(struct hda_codec *codec)
3303 struct alc_spec *spec = codec->spec;
3304 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3308 alc269_shutup(codec);
3312 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3314 alc_write_coef_idx(codec, 0x43, 0x9004);
3316 /*depop hp during suspend*/
3317 alc_write_coef_idx(codec, 0x06, 0x2100);
3319 snd_hda_codec_write(codec, hp_pin, 0,
3320 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3325 if (!spec->no_shutup_pins)
3326 snd_hda_codec_write(codec, hp_pin, 0,
3327 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3329 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3333 alc_auto_setup_eapd(codec, false);
3334 alc_shutup_pins(codec);
3335 alc_write_coef_idx(codec, 0x43, 0x9614);
3338 static void alc256_init(struct hda_codec *codec)
3340 struct alc_spec *spec = codec->spec;
3341 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3349 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3354 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3355 if (spec->ultra_low_power) {
3356 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3357 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3358 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3359 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3360 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3364 snd_hda_codec_write(codec, hp_pin, 0,
3365 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3367 if (hp_pin_sense || spec->ultra_low_power)
3370 snd_hda_codec_write(codec, hp_pin, 0,
3371 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3373 if (hp_pin_sense || spec->ultra_low_power)
3376 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3377 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3378 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3379 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3381 * Expose headphone mic (or possibly Line In on some machines) instead
3382 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3383 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3386 alc_write_coef_idx(codec, 0x36, 0x5757);
3389 static void alc256_shutup(struct hda_codec *codec)
3391 struct alc_spec *spec = codec->spec;
3392 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3398 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3403 snd_hda_codec_write(codec, hp_pin, 0,
3404 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3406 if (hp_pin_sense || spec->ultra_low_power)
3409 /* 3k pull low control for Headset jack. */
3410 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3411 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3413 if (!spec->no_shutup_pins)
3414 snd_hda_codec_write(codec, hp_pin, 0,
3415 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3417 if (hp_pin_sense || spec->ultra_low_power)
3420 alc_auto_setup_eapd(codec, false);
3421 alc_shutup_pins(codec);
3422 if (spec->ultra_low_power) {
3424 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3425 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3426 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3427 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3428 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3433 static void alc225_init(struct hda_codec *codec)
3435 struct alc_spec *spec = codec->spec;
3436 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3437 bool hp1_pin_sense, hp2_pin_sense;
3443 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3444 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3446 if (hp1_pin_sense || hp2_pin_sense)
3449 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3450 if (spec->ultra_low_power) {
3451 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3452 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3453 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3457 if (hp1_pin_sense || spec->ultra_low_power)
3458 snd_hda_codec_write(codec, hp_pin, 0,
3459 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3461 snd_hda_codec_write(codec, 0x16, 0,
3462 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3464 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3467 if (hp1_pin_sense || spec->ultra_low_power)
3468 snd_hda_codec_write(codec, hp_pin, 0,
3469 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3471 snd_hda_codec_write(codec, 0x16, 0,
3472 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3474 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3477 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3478 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3481 static void alc225_shutup(struct hda_codec *codec)
3483 struct alc_spec *spec = codec->spec;
3484 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3485 bool hp1_pin_sense, hp2_pin_sense;
3490 alc_disable_headset_jack_key(codec);
3491 /* 3k pull low control for Headset jack. */
3492 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3494 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3495 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3497 if (hp1_pin_sense || hp2_pin_sense)
3500 if (hp1_pin_sense || spec->ultra_low_power)
3501 snd_hda_codec_write(codec, hp_pin, 0,
3502 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3504 snd_hda_codec_write(codec, 0x16, 0,
3505 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3507 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3510 if (hp1_pin_sense || spec->ultra_low_power)
3511 snd_hda_codec_write(codec, hp_pin, 0,
3512 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3514 snd_hda_codec_write(codec, 0x16, 0,
3515 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3517 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3520 alc_auto_setup_eapd(codec, false);
3521 alc_shutup_pins(codec);
3522 if (spec->ultra_low_power) {
3524 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3525 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3526 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3527 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3531 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3532 alc_enable_headset_jack_key(codec);
3535 static void alc_default_init(struct hda_codec *codec)
3537 struct alc_spec *spec = codec->spec;
3538 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3546 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3551 snd_hda_codec_write(codec, hp_pin, 0,
3552 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3557 snd_hda_codec_write(codec, hp_pin, 0,
3558 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3564 static void alc_default_shutup(struct hda_codec *codec)
3566 struct alc_spec *spec = codec->spec;
3567 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3571 alc269_shutup(codec);
3575 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3580 snd_hda_codec_write(codec, hp_pin, 0,
3581 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3586 if (!spec->no_shutup_pins)
3587 snd_hda_codec_write(codec, hp_pin, 0,
3588 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3593 alc_auto_setup_eapd(codec, false);
3594 alc_shutup_pins(codec);
3597 static void alc294_hp_init(struct hda_codec *codec)
3599 struct alc_spec *spec = codec->spec;
3600 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3606 snd_hda_codec_write(codec, hp_pin, 0,
3607 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3611 if (!spec->no_shutup_pins)
3612 snd_hda_codec_write(codec, hp_pin, 0,
3613 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3615 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3616 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3618 /* Wait for depop procedure finish */
3619 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3620 for (i = 0; i < 20 && val & 0x0080; i++) {
3622 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3624 /* Set HP depop to auto mode */
3625 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3629 static void alc294_init(struct hda_codec *codec)
3631 struct alc_spec *spec = codec->spec;
3633 /* required only at boot or S4 resume time */
3634 if (!spec->done_hp_init ||
3635 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3636 alc294_hp_init(codec);
3637 spec->done_hp_init = true;
3639 alc_default_init(codec);
3642 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3645 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3646 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3647 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3650 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3654 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3655 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3657 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3662 static void alc5505_dsp_halt(struct hda_codec *codec)
3666 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3667 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3668 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3669 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3670 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3671 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3672 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3673 val = alc5505_coef_get(codec, 0x6220);
3674 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3677 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3679 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3680 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3681 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3682 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3683 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3684 alc5505_coef_set(codec, 0x880c, 0x00000004);
3687 static void alc5505_dsp_init(struct hda_codec *codec)
3691 alc5505_dsp_halt(codec);
3692 alc5505_dsp_back_from_halt(codec);
3693 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3694 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3695 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3696 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3697 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3698 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3699 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3700 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3701 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3702 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3703 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3704 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3705 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3707 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3709 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3711 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3713 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3714 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3715 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3716 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3717 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3718 alc5505_coef_set(codec, 0x880c, 0x00000003);
3719 alc5505_coef_set(codec, 0x880c, 0x00000010);
3721 #ifdef HALT_REALTEK_ALC5505
3722 alc5505_dsp_halt(codec);
3726 #ifdef HALT_REALTEK_ALC5505
3727 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3728 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3730 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3731 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3735 static int alc269_suspend(struct hda_codec *codec)
3737 struct alc_spec *spec = codec->spec;
3739 if (spec->has_alc5505_dsp)
3740 alc5505_dsp_suspend(codec);
3741 return alc_suspend(codec);
3744 static int alc269_resume(struct hda_codec *codec)
3746 struct alc_spec *spec = codec->spec;
3748 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3749 alc269vb_toggle_power_output(codec, 0);
3750 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3751 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3755 codec->patch_ops.init(codec);
3757 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3758 alc269vb_toggle_power_output(codec, 1);
3759 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3760 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3764 snd_hda_regmap_sync(codec);
3765 hda_call_check_power_status(codec, 0x01);
3767 /* on some machine, the BIOS will clear the codec gpio data when enter
3768 * suspend, and won't restore the data after resume, so we restore it
3771 if (spec->gpio_data)
3772 alc_write_gpio_data(codec);
3774 if (spec->has_alc5505_dsp)
3775 alc5505_dsp_resume(codec);
3779 #endif /* CONFIG_PM */
3781 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3782 const struct hda_fixup *fix, int action)
3784 struct alc_spec *spec = codec->spec;
3786 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3787 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3790 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3791 const struct hda_fixup *fix,
3794 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3795 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3797 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3798 snd_hda_codec_set_pincfg(codec, 0x19,
3799 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3800 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3803 static void alc269_fixup_hweq(struct hda_codec *codec,
3804 const struct hda_fixup *fix, int action)
3806 if (action == HDA_FIXUP_ACT_INIT)
3807 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3810 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3811 const struct hda_fixup *fix, int action)
3813 struct alc_spec *spec = codec->spec;
3815 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3816 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3819 static void alc271_fixup_dmic(struct hda_codec *codec,
3820 const struct hda_fixup *fix, int action)
3822 static const struct hda_verb verbs[] = {
3823 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3824 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3829 if (strcmp(codec->core.chip_name, "ALC271X") &&
3830 strcmp(codec->core.chip_name, "ALC269VB"))
3832 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3833 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3834 snd_hda_sequence_write(codec, verbs);
3837 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3838 const struct hda_fixup *fix, int action)
3840 struct alc_spec *spec = codec->spec;
3842 if (action != HDA_FIXUP_ACT_PROBE)
3845 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3846 * fix the sample rate of analog I/O to 44.1kHz
3848 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3849 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3852 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3853 const struct hda_fixup *fix, int action)
3855 /* The digital-mic unit sends PDM (differential signal) instead of
3856 * the standard PCM, thus you can't record a valid mono stream as is.
3857 * Below is a workaround specific to ALC269 to control the dmic
3858 * signal source as mono.
3860 if (action == HDA_FIXUP_ACT_INIT)
3861 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3864 static void alc269_quanta_automute(struct hda_codec *codec)
3866 snd_hda_gen_update_outputs(codec);
3868 alc_write_coef_idx(codec, 0x0c, 0x680);
3869 alc_write_coef_idx(codec, 0x0c, 0x480);
3872 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3873 const struct hda_fixup *fix, int action)
3875 struct alc_spec *spec = codec->spec;
3876 if (action != HDA_FIXUP_ACT_PROBE)
3878 spec->gen.automute_hook = alc269_quanta_automute;
3881 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3882 struct hda_jack_callback *jack)
3884 struct alc_spec *spec = codec->spec;
3887 snd_hda_gen_hp_automute(codec, jack);
3889 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3891 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3894 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3899 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
3901 struct hda_alc298_mbxinit {
3902 unsigned char value_0x23;
3903 unsigned char value_0x25;
3906 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
3907 const struct hda_alc298_mbxinit *initval,
3910 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
3911 alc_write_coef_idx(codec, 0x26, 0xb000);
3914 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
3916 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
3917 alc_write_coef_idx(codec, 0x26, 0xf000);
3918 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
3920 if (initval->value_0x23 != 0x1e)
3921 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
3923 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
3924 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
3927 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
3928 const struct hda_fixup *fix,
3931 /* Initialization magic */
3932 static const struct hda_alc298_mbxinit dac_init[] = {
3933 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
3934 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
3935 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
3936 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
3937 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
3938 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
3940 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
3941 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
3942 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
3945 const struct hda_alc298_mbxinit *seq;
3947 if (action != HDA_FIXUP_ACT_INIT)
3951 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
3952 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
3953 alc_write_coef_idx(codec, 0x26, 0xf000);
3954 alc_write_coef_idx(codec, 0x22, 0x31);
3955 alc_write_coef_idx(codec, 0x23, 0x0b);
3956 alc_write_coef_idx(codec, 0x25, 0x00);
3957 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
3958 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
3960 for (seq = dac_init; seq->value_0x23; seq++)
3961 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
3964 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
3965 const struct hda_fixup *fix, int action)
3967 struct alc_spec *spec = codec->spec;
3968 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3969 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3970 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
3975 /* update mute-LED according to the speaker mute state via mic VREF pin */
3976 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
3978 struct hda_codec *codec = private_data;
3979 struct alc_spec *spec = codec->spec;
3980 unsigned int pinval;
3982 if (spec->mute_led_polarity)
3984 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3985 pinval &= ~AC_PINCTL_VREFEN;
3986 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3987 if (spec->mute_led_nid) {
3988 /* temporarily power up/down for setting VREF */
3989 snd_hda_power_up_pm(codec);
3990 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3991 snd_hda_power_down_pm(codec);
3995 /* Make sure the led works even in runtime suspend */
3996 static unsigned int led_power_filter(struct hda_codec *codec,
3998 unsigned int power_state)
4000 struct alc_spec *spec = codec->spec;
4002 if (power_state != AC_PWRST_D3 || nid == 0 ||
4003 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4006 /* Set pin ctl again, it might have just been set to 0 */
4007 snd_hda_set_pin_ctl(codec, nid,
4008 snd_hda_codec_get_pin_target(codec, nid));
4010 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4013 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4014 const struct hda_fixup *fix, int action)
4016 struct alc_spec *spec = codec->spec;
4017 const struct dmi_device *dev = NULL;
4019 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4022 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4024 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4026 if (pin < 0x0a || pin >= 0x10)
4028 spec->mute_led_polarity = pol;
4029 spec->mute_led_nid = pin - 0x0a + 0x18;
4030 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
4031 spec->gen.vmaster_mute_enum = 1;
4032 codec->power_filter = led_power_filter;
4034 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4035 spec->mute_led_polarity);
4040 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4041 const struct hda_fixup *fix,
4042 int action, hda_nid_t pin)
4044 struct alc_spec *spec = codec->spec;
4046 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4047 spec->mute_led_polarity = 0;
4048 spec->mute_led_nid = pin;
4049 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
4050 spec->gen.vmaster_mute_enum = 1;
4051 codec->power_filter = led_power_filter;
4055 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4056 const struct hda_fixup *fix, int action)
4058 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4061 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4062 const struct hda_fixup *fix, int action)
4064 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4067 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4068 const struct hda_fixup *fix, int action)
4070 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4073 /* update LED status via GPIO */
4074 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4077 struct alc_spec *spec = codec->spec;
4079 if (spec->mute_led_polarity)
4081 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4084 /* turn on/off mute LED via GPIO per vmaster hook */
4085 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
4087 struct hda_codec *codec = private_data;
4088 struct alc_spec *spec = codec->spec;
4090 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled);
4093 /* turn on/off mic-mute LED via GPIO per capture hook */
4094 static void alc_gpio_micmute_update(struct hda_codec *codec)
4096 struct alc_spec *spec = codec->spec;
4098 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4099 spec->gen.micmute_led.led_value);
4102 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4103 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4105 unsigned int mute_mask,
4106 unsigned int micmute_mask)
4108 struct alc_spec *spec = codec->spec;
4110 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4112 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4115 spec->gpio_mute_led_mask = mute_mask;
4116 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
4119 spec->gpio_mic_led_mask = micmute_mask;
4120 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
4124 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4125 const struct hda_fixup *fix, int action)
4127 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4130 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4131 const struct hda_fixup *fix, int action)
4133 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x00);
4136 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4137 const struct hda_fixup *fix, int action)
4139 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4142 /* turn on/off mic-mute LED per capture hook */
4143 static void alc_cap_micmute_update(struct hda_codec *codec)
4145 struct alc_spec *spec = codec->spec;
4146 unsigned int pinval;
4148 if (!spec->cap_mute_led_nid)
4150 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
4151 pinval &= ~AC_PINCTL_VREFEN;
4152 if (spec->gen.micmute_led.led_value)
4153 pinval |= AC_PINCTL_VREF_80;
4155 pinval |= AC_PINCTL_VREF_HIZ;
4156 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
4159 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4160 const struct hda_fixup *fix, int action)
4162 struct alc_spec *spec = codec->spec;
4164 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4165 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4166 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4167 * enable headphone amp
4169 spec->gpio_mask |= 0x10;
4170 spec->gpio_dir |= 0x10;
4171 spec->cap_mute_led_nid = 0x18;
4172 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4173 codec->power_filter = led_power_filter;
4177 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4178 const struct hda_fixup *fix, int action)
4180 struct alc_spec *spec = codec->spec;
4182 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4183 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4184 spec->cap_mute_led_nid = 0x18;
4185 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4186 codec->power_filter = led_power_filter;
4190 /* update mute-LED according to the speaker mute state via COEF bit */
4191 static void alc_fixup_mute_led_coefbit_hook(void *private_data, int enabled)
4193 struct hda_codec *codec = private_data;
4194 struct alc_spec *spec = codec->spec;
4196 if (spec->mute_led_polarity)
4199 /* temporarily power up/down for setting COEF bit */
4200 enabled ? alc_update_coef_idx(codec, spec->mute_led_coef_idx,
4201 spec->mute_led_coefbit_mask, spec->mute_led_coefbit_off) :
4202 alc_update_coef_idx(codec, spec->mute_led_coef_idx,
4203 spec->mute_led_coefbit_mask, spec->mute_led_coefbit_on);
4206 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4207 const struct hda_fixup *fix,
4210 struct alc_spec *spec = codec->spec;
4212 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4213 spec->mute_led_polarity = 0;
4214 spec->mute_led_coef_idx = 0x0b;
4215 spec->mute_led_coefbit_mask = 1<<3;
4216 spec->mute_led_coefbit_on = 1<<3;
4217 spec->mute_led_coefbit_off = 0;
4218 spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4219 spec->gen.vmaster_mute_enum = 1;
4223 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4224 const struct hda_fixup *fix,
4227 struct alc_spec *spec = codec->spec;
4229 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4230 spec->mute_led_polarity = 0;
4231 spec->mute_led_coef_idx = 0x34;
4232 spec->mute_led_coefbit_mask = 1<<5;
4233 spec->mute_led_coefbit_on = 0;
4234 spec->mute_led_coefbit_off = 1<<5;
4235 spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4236 spec->gen.vmaster_mute_enum = 1;
4240 /* turn on/off mic-mute LED per capture hook by coef bit */
4241 static void alc_hp_cap_micmute_update(struct hda_codec *codec)
4243 struct alc_spec *spec = codec->spec;
4245 if (spec->gen.micmute_led.led_value)
4246 alc_update_coef_idx(codec, spec->mic_led_coef_idx,
4247 spec->mic_led_coefbit_mask, spec->mic_led_coefbit_on);
4249 alc_update_coef_idx(codec, spec->mic_led_coef_idx,
4250 spec->mic_led_coefbit_mask, spec->mic_led_coefbit_off);
4253 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4254 const struct hda_fixup *fix, int action)
4256 struct alc_spec *spec = codec->spec;
4258 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4259 spec->mic_led_coef_idx = 0x19;
4260 spec->mic_led_coefbit_mask = 1<<13;
4261 spec->mic_led_coefbit_on = 1<<13;
4262 spec->mic_led_coefbit_off = 0;
4263 snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4267 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4268 const struct hda_fixup *fix, int action)
4270 struct alc_spec *spec = codec->spec;
4272 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4273 spec->mic_led_coef_idx = 0x35;
4274 spec->mic_led_coefbit_mask = 3<<2;
4275 spec->mic_led_coefbit_on = 2<<2;
4276 spec->mic_led_coefbit_off = 1<<2;
4277 snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4281 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4282 const struct hda_fixup *fix, int action)
4284 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4285 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4288 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4289 const struct hda_fixup *fix, int action)
4291 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4292 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4295 #if IS_REACHABLE(CONFIG_INPUT)
4296 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4297 struct hda_jack_callback *event)
4299 struct alc_spec *spec = codec->spec;
4301 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4302 send both key on and key off event for every interrupt. */
4303 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4304 input_sync(spec->kb_dev);
4305 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4306 input_sync(spec->kb_dev);
4309 static int alc_register_micmute_input_device(struct hda_codec *codec)
4311 struct alc_spec *spec = codec->spec;
4314 spec->kb_dev = input_allocate_device();
4315 if (!spec->kb_dev) {
4316 codec_err(codec, "Out of memory (input_allocate_device)\n");
4320 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4322 spec->kb_dev->name = "Microphone Mute Button";
4323 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4324 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4325 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4326 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4327 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4328 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4330 if (input_register_device(spec->kb_dev)) {
4331 codec_err(codec, "input_register_device failed\n");
4332 input_free_device(spec->kb_dev);
4333 spec->kb_dev = NULL;
4340 /* GPIO1 = set according to SKU external amp
4341 * GPIO2 = mic mute hotkey
4343 * GPIO4 = mic mute LED
4345 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4346 const struct hda_fixup *fix, int action)
4348 struct alc_spec *spec = codec->spec;
4350 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4351 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4352 spec->init_amp = ALC_INIT_DEFAULT;
4353 if (alc_register_micmute_input_device(codec) != 0)
4356 spec->gpio_mask |= 0x06;
4357 spec->gpio_dir |= 0x02;
4358 spec->gpio_data |= 0x02;
4359 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4360 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4361 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4362 gpio2_mic_hotkey_event);
4370 case HDA_FIXUP_ACT_FREE:
4371 input_unregister_device(spec->kb_dev);
4372 spec->kb_dev = NULL;
4376 /* Line2 = mic mute hotkey
4377 * GPIO2 = mic mute LED
4379 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4380 const struct hda_fixup *fix, int action)
4382 struct alc_spec *spec = codec->spec;
4384 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4385 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4386 spec->init_amp = ALC_INIT_DEFAULT;
4387 if (alc_register_micmute_input_device(codec) != 0)
4390 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4391 gpio2_mic_hotkey_event);
4399 case HDA_FIXUP_ACT_FREE:
4400 input_unregister_device(spec->kb_dev);
4401 spec->kb_dev = NULL;
4405 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4406 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4409 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4410 const struct hda_fixup *fix, int action)
4412 struct alc_spec *spec = codec->spec;
4414 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4415 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4416 spec->cap_mute_led_nid = 0x18;
4417 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4421 static const struct coef_fw alc225_pre_hsmode[] = {
4422 UPDATE_COEF(0x4a, 1<<8, 0),
4423 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4424 UPDATE_COEF(0x63, 3<<14, 3<<14),
4425 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4426 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4427 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4428 UPDATE_COEF(0x4a, 3<<10, 0),
4432 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4434 static const struct coef_fw coef0255[] = {
4435 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4436 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4437 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4438 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4439 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4442 static const struct coef_fw coef0256[] = {
4443 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4444 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4445 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4446 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4447 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4450 static const struct coef_fw coef0233[] = {
4451 WRITE_COEF(0x1b, 0x0c0b),
4452 WRITE_COEF(0x45, 0xc429),
4453 UPDATE_COEF(0x35, 0x4000, 0),
4454 WRITE_COEF(0x06, 0x2104),
4455 WRITE_COEF(0x1a, 0x0001),
4456 WRITE_COEF(0x26, 0x0004),
4457 WRITE_COEF(0x32, 0x42a3),
4460 static const struct coef_fw coef0288[] = {
4461 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4462 UPDATE_COEF(0x50, 0x2000, 0x2000),
4463 UPDATE_COEF(0x56, 0x0006, 0x0006),
4464 UPDATE_COEF(0x66, 0x0008, 0),
4465 UPDATE_COEF(0x67, 0x2000, 0),
4468 static const struct coef_fw coef0298[] = {
4469 UPDATE_COEF(0x19, 0x1300, 0x0300),
4472 static const struct coef_fw coef0292[] = {
4473 WRITE_COEF(0x76, 0x000e),
4474 WRITE_COEF(0x6c, 0x2400),
4475 WRITE_COEF(0x18, 0x7308),
4476 WRITE_COEF(0x6b, 0xc429),
4479 static const struct coef_fw coef0293[] = {
4480 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4481 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4482 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4483 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4484 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4485 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4488 static const struct coef_fw coef0668[] = {
4489 WRITE_COEF(0x15, 0x0d40),
4490 WRITE_COEF(0xb7, 0x802b),
4493 static const struct coef_fw coef0225[] = {
4494 UPDATE_COEF(0x63, 3<<14, 0),
4497 static const struct coef_fw coef0274[] = {
4498 UPDATE_COEF(0x4a, 0x0100, 0),
4499 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4500 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4501 UPDATE_COEF(0x4a, 0x0010, 0),
4502 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4503 WRITE_COEF(0x45, 0x5289),
4504 UPDATE_COEF(0x4a, 0x0c00, 0),
4508 switch (codec->core.vendor_id) {
4510 alc_process_coef_fw(codec, coef0255);
4514 alc_process_coef_fw(codec, coef0256);
4519 alc_process_coef_fw(codec, coef0274);
4523 alc_process_coef_fw(codec, coef0233);
4527 alc_process_coef_fw(codec, coef0288);
4530 alc_process_coef_fw(codec, coef0298);
4531 alc_process_coef_fw(codec, coef0288);
4534 alc_process_coef_fw(codec, coef0292);
4537 alc_process_coef_fw(codec, coef0293);
4540 alc_process_coef_fw(codec, coef0668);
4548 alc_process_coef_fw(codec, alc225_pre_hsmode);
4549 alc_process_coef_fw(codec, coef0225);
4552 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4555 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4559 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4562 static const struct coef_fw coef0255[] = {
4563 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4564 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4567 static const struct coef_fw coef0256[] = {
4568 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4569 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4570 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4573 static const struct coef_fw coef0233[] = {
4574 UPDATE_COEF(0x35, 0, 1<<14),
4575 WRITE_COEF(0x06, 0x2100),
4576 WRITE_COEF(0x1a, 0x0021),
4577 WRITE_COEF(0x26, 0x008c),
4580 static const struct coef_fw coef0288[] = {
4581 UPDATE_COEF(0x4f, 0x00c0, 0),
4582 UPDATE_COEF(0x50, 0x2000, 0),
4583 UPDATE_COEF(0x56, 0x0006, 0),
4584 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4585 UPDATE_COEF(0x66, 0x0008, 0x0008),
4586 UPDATE_COEF(0x67, 0x2000, 0x2000),
4589 static const struct coef_fw coef0292[] = {
4590 WRITE_COEF(0x19, 0xa208),
4591 WRITE_COEF(0x2e, 0xacf0),
4594 static const struct coef_fw coef0293[] = {
4595 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4596 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4597 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4600 static const struct coef_fw coef0688[] = {
4601 WRITE_COEF(0xb7, 0x802b),
4602 WRITE_COEF(0xb5, 0x1040),
4603 UPDATE_COEF(0xc3, 0, 1<<12),
4606 static const struct coef_fw coef0225[] = {
4607 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4608 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4609 UPDATE_COEF(0x63, 3<<14, 0),
4612 static const struct coef_fw coef0274[] = {
4613 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4614 UPDATE_COEF(0x4a, 0x0010, 0),
4615 UPDATE_COEF(0x6b, 0xf000, 0),
4619 switch (codec->core.vendor_id) {
4621 alc_write_coef_idx(codec, 0x45, 0xc489);
4622 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4623 alc_process_coef_fw(codec, coef0255);
4624 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4628 alc_write_coef_idx(codec, 0x45, 0xc489);
4629 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4630 alc_process_coef_fw(codec, coef0256);
4631 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4636 alc_write_coef_idx(codec, 0x45, 0x4689);
4637 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4638 alc_process_coef_fw(codec, coef0274);
4639 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4643 alc_write_coef_idx(codec, 0x45, 0xc429);
4644 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4645 alc_process_coef_fw(codec, coef0233);
4646 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4651 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4652 alc_process_coef_fw(codec, coef0288);
4653 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4656 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4657 alc_process_coef_fw(codec, coef0292);
4660 /* Set to TRS mode */
4661 alc_write_coef_idx(codec, 0x45, 0xc429);
4662 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4663 alc_process_coef_fw(codec, coef0293);
4664 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4667 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4671 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4672 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4675 alc_write_coef_idx(codec, 0x11, 0x0001);
4676 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4677 alc_process_coef_fw(codec, coef0688);
4678 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4686 alc_process_coef_fw(codec, alc225_pre_hsmode);
4687 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4688 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4689 alc_process_coef_fw(codec, coef0225);
4690 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4693 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4696 static void alc_headset_mode_default(struct hda_codec *codec)
4698 static const struct coef_fw coef0225[] = {
4699 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4700 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4701 UPDATE_COEF(0x49, 3<<8, 0<<8),
4702 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4703 UPDATE_COEF(0x63, 3<<14, 0),
4704 UPDATE_COEF(0x67, 0xf000, 0x3000),
4707 static const struct coef_fw coef0255[] = {
4708 WRITE_COEF(0x45, 0xc089),
4709 WRITE_COEF(0x45, 0xc489),
4710 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4711 WRITE_COEF(0x49, 0x0049),
4714 static const struct coef_fw coef0256[] = {
4715 WRITE_COEF(0x45, 0xc489),
4716 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4717 WRITE_COEF(0x49, 0x0049),
4718 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4719 WRITE_COEF(0x06, 0x6100),
4722 static const struct coef_fw coef0233[] = {
4723 WRITE_COEF(0x06, 0x2100),
4724 WRITE_COEF(0x32, 0x4ea3),
4727 static const struct coef_fw coef0288[] = {
4728 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4729 UPDATE_COEF(0x50, 0x2000, 0x2000),
4730 UPDATE_COEF(0x56, 0x0006, 0x0006),
4731 UPDATE_COEF(0x66, 0x0008, 0),
4732 UPDATE_COEF(0x67, 0x2000, 0),
4735 static const struct coef_fw coef0292[] = {
4736 WRITE_COEF(0x76, 0x000e),
4737 WRITE_COEF(0x6c, 0x2400),
4738 WRITE_COEF(0x6b, 0xc429),
4739 WRITE_COEF(0x18, 0x7308),
4742 static const struct coef_fw coef0293[] = {
4743 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4744 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4745 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4748 static const struct coef_fw coef0688[] = {
4749 WRITE_COEF(0x11, 0x0041),
4750 WRITE_COEF(0x15, 0x0d40),
4751 WRITE_COEF(0xb7, 0x802b),
4754 static const struct coef_fw coef0274[] = {
4755 WRITE_COEF(0x45, 0x4289),
4756 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4757 UPDATE_COEF(0x6b, 0x0f00, 0),
4758 UPDATE_COEF(0x49, 0x0300, 0x0300),
4762 switch (codec->core.vendor_id) {
4769 alc_process_coef_fw(codec, alc225_pre_hsmode);
4770 alc_process_coef_fw(codec, coef0225);
4773 alc_process_coef_fw(codec, coef0255);
4777 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4778 alc_write_coef_idx(codec, 0x45, 0xc089);
4780 alc_process_coef_fw(codec, coef0256);
4785 alc_process_coef_fw(codec, coef0274);
4789 alc_process_coef_fw(codec, coef0233);
4794 alc_process_coef_fw(codec, coef0288);
4797 alc_process_coef_fw(codec, coef0292);
4800 alc_process_coef_fw(codec, coef0293);
4803 alc_process_coef_fw(codec, coef0688);
4806 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4809 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4813 static void alc_headset_mode_ctia(struct hda_codec *codec)
4817 static const struct coef_fw coef0255[] = {
4818 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4819 WRITE_COEF(0x1b, 0x0c2b),
4820 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4823 static const struct coef_fw coef0256[] = {
4824 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4825 WRITE_COEF(0x1b, 0x0e6b),
4828 static const struct coef_fw coef0233[] = {
4829 WRITE_COEF(0x45, 0xd429),
4830 WRITE_COEF(0x1b, 0x0c2b),
4831 WRITE_COEF(0x32, 0x4ea3),
4834 static const struct coef_fw coef0288[] = {
4835 UPDATE_COEF(0x50, 0x2000, 0x2000),
4836 UPDATE_COEF(0x56, 0x0006, 0x0006),
4837 UPDATE_COEF(0x66, 0x0008, 0),
4838 UPDATE_COEF(0x67, 0x2000, 0),
4841 static const struct coef_fw coef0292[] = {
4842 WRITE_COEF(0x6b, 0xd429),
4843 WRITE_COEF(0x76, 0x0008),
4844 WRITE_COEF(0x18, 0x7388),
4847 static const struct coef_fw coef0293[] = {
4848 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4849 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4852 static const struct coef_fw coef0688[] = {
4853 WRITE_COEF(0x11, 0x0001),
4854 WRITE_COEF(0x15, 0x0d60),
4855 WRITE_COEF(0xc3, 0x0000),
4858 static const struct coef_fw coef0225_1[] = {
4859 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4860 UPDATE_COEF(0x63, 3<<14, 2<<14),
4863 static const struct coef_fw coef0225_2[] = {
4864 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4865 UPDATE_COEF(0x63, 3<<14, 1<<14),
4869 switch (codec->core.vendor_id) {
4871 alc_process_coef_fw(codec, coef0255);
4875 alc_process_coef_fw(codec, coef0256);
4880 alc_write_coef_idx(codec, 0x45, 0xd689);
4884 alc_process_coef_fw(codec, coef0233);
4887 val = alc_read_coef_idx(codec, 0x50);
4888 if (val & (1 << 12)) {
4889 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4890 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4893 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4894 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4900 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4902 alc_process_coef_fw(codec, coef0288);
4905 alc_process_coef_fw(codec, coef0292);
4908 alc_process_coef_fw(codec, coef0293);
4911 alc_process_coef_fw(codec, coef0688);
4919 val = alc_read_coef_idx(codec, 0x45);
4921 alc_process_coef_fw(codec, coef0225_2);
4923 alc_process_coef_fw(codec, coef0225_1);
4926 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4929 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
4933 static void alc_headset_mode_omtp(struct hda_codec *codec)
4935 static const struct coef_fw coef0255[] = {
4936 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4937 WRITE_COEF(0x1b, 0x0c2b),
4938 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4941 static const struct coef_fw coef0256[] = {
4942 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4943 WRITE_COEF(0x1b, 0x0e6b),
4946 static const struct coef_fw coef0233[] = {
4947 WRITE_COEF(0x45, 0xe429),
4948 WRITE_COEF(0x1b, 0x0c2b),
4949 WRITE_COEF(0x32, 0x4ea3),
4952 static const struct coef_fw coef0288[] = {
4953 UPDATE_COEF(0x50, 0x2000, 0x2000),
4954 UPDATE_COEF(0x56, 0x0006, 0x0006),
4955 UPDATE_COEF(0x66, 0x0008, 0),
4956 UPDATE_COEF(0x67, 0x2000, 0),
4959 static const struct coef_fw coef0292[] = {
4960 WRITE_COEF(0x6b, 0xe429),
4961 WRITE_COEF(0x76, 0x0008),
4962 WRITE_COEF(0x18, 0x7388),
4965 static const struct coef_fw coef0293[] = {
4966 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4967 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4970 static const struct coef_fw coef0688[] = {
4971 WRITE_COEF(0x11, 0x0001),
4972 WRITE_COEF(0x15, 0x0d50),
4973 WRITE_COEF(0xc3, 0x0000),
4976 static const struct coef_fw coef0225[] = {
4977 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4978 UPDATE_COEF(0x63, 3<<14, 2<<14),
4982 switch (codec->core.vendor_id) {
4984 alc_process_coef_fw(codec, coef0255);
4988 alc_process_coef_fw(codec, coef0256);
4993 alc_write_coef_idx(codec, 0x45, 0xe689);
4997 alc_process_coef_fw(codec, coef0233);
5000 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5001 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5006 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5008 alc_process_coef_fw(codec, coef0288);
5011 alc_process_coef_fw(codec, coef0292);
5014 alc_process_coef_fw(codec, coef0293);
5017 alc_process_coef_fw(codec, coef0688);
5025 alc_process_coef_fw(codec, coef0225);
5028 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5031 static void alc_determine_headset_type(struct hda_codec *codec)
5034 bool is_ctia = false;
5035 struct alc_spec *spec = codec->spec;
5036 static const struct coef_fw coef0255[] = {
5037 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5038 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5042 static const struct coef_fw coef0288[] = {
5043 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5046 static const struct coef_fw coef0298[] = {
5047 UPDATE_COEF(0x50, 0x2000, 0x2000),
5048 UPDATE_COEF(0x56, 0x0006, 0x0006),
5049 UPDATE_COEF(0x66, 0x0008, 0),
5050 UPDATE_COEF(0x67, 0x2000, 0),
5051 UPDATE_COEF(0x19, 0x1300, 0x1300),
5054 static const struct coef_fw coef0293[] = {
5055 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5056 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5059 static const struct coef_fw coef0688[] = {
5060 WRITE_COEF(0x11, 0x0001),
5061 WRITE_COEF(0xb7, 0x802b),
5062 WRITE_COEF(0x15, 0x0d60),
5063 WRITE_COEF(0xc3, 0x0c00),
5066 static const struct coef_fw coef0274[] = {
5067 UPDATE_COEF(0x4a, 0x0010, 0),
5068 UPDATE_COEF(0x4a, 0x8000, 0),
5069 WRITE_COEF(0x45, 0xd289),
5070 UPDATE_COEF(0x49, 0x0300, 0x0300),
5074 switch (codec->core.vendor_id) {
5076 alc_process_coef_fw(codec, coef0255);
5078 val = alc_read_coef_idx(codec, 0x46);
5079 is_ctia = (val & 0x0070) == 0x0070;
5083 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5084 alc_write_coef_idx(codec, 0x06, 0x6104);
5085 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5087 snd_hda_codec_write(codec, 0x21, 0,
5088 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5090 snd_hda_codec_write(codec, 0x21, 0,
5091 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5093 alc_process_coef_fw(codec, coef0255);
5095 val = alc_read_coef_idx(codec, 0x46);
5096 is_ctia = (val & 0x0070) == 0x0070;
5098 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5099 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5101 snd_hda_codec_write(codec, 0x21, 0,
5102 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5104 snd_hda_codec_write(codec, 0x21, 0,
5105 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5110 alc_process_coef_fw(codec, coef0274);
5112 val = alc_read_coef_idx(codec, 0x46);
5113 is_ctia = (val & 0x00f0) == 0x00f0;
5117 alc_write_coef_idx(codec, 0x45, 0xd029);
5119 val = alc_read_coef_idx(codec, 0x46);
5120 is_ctia = (val & 0x0070) == 0x0070;
5123 snd_hda_codec_write(codec, 0x21, 0,
5124 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5126 snd_hda_codec_write(codec, 0x21, 0,
5127 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5130 val = alc_read_coef_idx(codec, 0x50);
5131 if (val & (1 << 12)) {
5132 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5133 alc_process_coef_fw(codec, coef0288);
5135 val = alc_read_coef_idx(codec, 0x50);
5136 is_ctia = (val & 0x0070) == 0x0070;
5138 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5139 alc_process_coef_fw(codec, coef0288);
5141 val = alc_read_coef_idx(codec, 0x50);
5142 is_ctia = (val & 0x0070) == 0x0070;
5144 alc_process_coef_fw(codec, coef0298);
5145 snd_hda_codec_write(codec, 0x21, 0,
5146 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5148 snd_hda_codec_write(codec, 0x21, 0,
5149 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5153 alc_process_coef_fw(codec, coef0288);
5155 val = alc_read_coef_idx(codec, 0x50);
5156 is_ctia = (val & 0x0070) == 0x0070;
5159 alc_write_coef_idx(codec, 0x6b, 0xd429);
5161 val = alc_read_coef_idx(codec, 0x6c);
5162 is_ctia = (val & 0x001c) == 0x001c;
5165 alc_process_coef_fw(codec, coef0293);
5167 val = alc_read_coef_idx(codec, 0x46);
5168 is_ctia = (val & 0x0070) == 0x0070;
5171 alc_process_coef_fw(codec, coef0688);
5173 val = alc_read_coef_idx(codec, 0xbe);
5174 is_ctia = (val & 0x1c02) == 0x1c02;
5182 snd_hda_codec_write(codec, 0x21, 0,
5183 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5185 snd_hda_codec_write(codec, 0x21, 0,
5186 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5188 alc_process_coef_fw(codec, alc225_pre_hsmode);
5189 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5190 val = alc_read_coef_idx(codec, 0x45);
5191 if (val & (1 << 9)) {
5192 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5193 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5195 val = alc_read_coef_idx(codec, 0x46);
5196 is_ctia = (val & 0x00f0) == 0x00f0;
5198 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5199 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5201 val = alc_read_coef_idx(codec, 0x46);
5202 is_ctia = (val & 0x00f0) == 0x00f0;
5204 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5205 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5206 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5208 snd_hda_codec_write(codec, 0x21, 0,
5209 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5211 snd_hda_codec_write(codec, 0x21, 0,
5212 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5219 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5220 is_ctia ? "yes" : "no");
5221 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5224 static void alc_update_headset_mode(struct hda_codec *codec)
5226 struct alc_spec *spec = codec->spec;
5228 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5229 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5231 int new_headset_mode;
5233 if (!snd_hda_jack_detect(codec, hp_pin))
5234 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5235 else if (mux_pin == spec->headset_mic_pin)
5236 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5237 else if (mux_pin == spec->headphone_mic_pin)
5238 new_headset_mode = ALC_HEADSET_MODE_MIC;
5240 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5242 if (new_headset_mode == spec->current_headset_mode) {
5243 snd_hda_gen_update_outputs(codec);
5247 switch (new_headset_mode) {
5248 case ALC_HEADSET_MODE_UNPLUGGED:
5249 alc_headset_mode_unplugged(codec);
5250 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5251 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5252 spec->gen.hp_jack_present = false;
5254 case ALC_HEADSET_MODE_HEADSET:
5255 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5256 alc_determine_headset_type(codec);
5257 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5258 alc_headset_mode_ctia(codec);
5259 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5260 alc_headset_mode_omtp(codec);
5261 spec->gen.hp_jack_present = true;
5263 case ALC_HEADSET_MODE_MIC:
5264 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5265 spec->gen.hp_jack_present = false;
5267 case ALC_HEADSET_MODE_HEADPHONE:
5268 alc_headset_mode_default(codec);
5269 spec->gen.hp_jack_present = true;
5272 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5273 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5274 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5275 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5276 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5279 spec->current_headset_mode = new_headset_mode;
5281 snd_hda_gen_update_outputs(codec);
5284 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5285 struct snd_kcontrol *kcontrol,
5286 struct snd_ctl_elem_value *ucontrol)
5288 alc_update_headset_mode(codec);
5291 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5292 struct hda_jack_callback *jack)
5294 snd_hda_gen_hp_automute(codec, jack);
5297 static void alc_probe_headset_mode(struct hda_codec *codec)
5300 struct alc_spec *spec = codec->spec;
5301 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5304 for (i = 0; i < cfg->num_inputs; i++) {
5305 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5306 spec->headset_mic_pin = cfg->inputs[i].pin;
5307 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5308 spec->headphone_mic_pin = cfg->inputs[i].pin;
5311 WARN_ON(spec->gen.cap_sync_hook);
5312 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5313 spec->gen.automute_hook = alc_update_headset_mode;
5314 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5317 static void alc_fixup_headset_mode(struct hda_codec *codec,
5318 const struct hda_fixup *fix, int action)
5320 struct alc_spec *spec = codec->spec;
5323 case HDA_FIXUP_ACT_PRE_PROBE:
5324 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5326 case HDA_FIXUP_ACT_PROBE:
5327 alc_probe_headset_mode(codec);
5329 case HDA_FIXUP_ACT_INIT:
5330 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5331 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5332 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5334 alc_update_headset_mode(codec);
5339 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5340 const struct hda_fixup *fix, int action)
5342 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5343 struct alc_spec *spec = codec->spec;
5344 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5347 alc_fixup_headset_mode(codec, fix, action);
5350 static void alc255_set_default_jack_type(struct hda_codec *codec)
5352 /* Set to iphone type */
5353 static const struct coef_fw alc255fw[] = {
5354 WRITE_COEF(0x1b, 0x880b),
5355 WRITE_COEF(0x45, 0xd089),
5356 WRITE_COEF(0x1b, 0x080b),
5357 WRITE_COEF(0x46, 0x0004),
5358 WRITE_COEF(0x1b, 0x0c0b),
5361 static const struct coef_fw alc256fw[] = {
5362 WRITE_COEF(0x1b, 0x884b),
5363 WRITE_COEF(0x45, 0xd089),
5364 WRITE_COEF(0x1b, 0x084b),
5365 WRITE_COEF(0x46, 0x0004),
5366 WRITE_COEF(0x1b, 0x0c4b),
5369 switch (codec->core.vendor_id) {
5371 alc_process_coef_fw(codec, alc255fw);
5375 alc_process_coef_fw(codec, alc256fw);
5381 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5382 const struct hda_fixup *fix, int action)
5384 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5385 alc255_set_default_jack_type(codec);
5387 alc_fixup_headset_mode(codec, fix, action);
5390 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5391 const struct hda_fixup *fix, int action)
5393 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5394 struct alc_spec *spec = codec->spec;
5395 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5396 alc255_set_default_jack_type(codec);
5399 alc_fixup_headset_mode(codec, fix, action);
5402 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5403 struct hda_jack_callback *jack)
5405 struct alc_spec *spec = codec->spec;
5407 alc_update_headset_jack_cb(codec, jack);
5408 /* Headset Mic enable or disable, only for Dell Dino */
5409 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5412 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5413 const struct hda_fixup *fix, int action)
5415 alc_fixup_headset_mode(codec, fix, action);
5416 if (action == HDA_FIXUP_ACT_PROBE) {
5417 struct alc_spec *spec = codec->spec;
5418 /* toggled via hp_automute_hook */
5419 spec->gpio_mask |= 0x40;
5420 spec->gpio_dir |= 0x40;
5421 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5425 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5426 const struct hda_fixup *fix, int action)
5428 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5429 struct alc_spec *spec = codec->spec;
5430 spec->gen.auto_mute_via_amp = 1;
5434 static void alc_fixup_no_shutup(struct hda_codec *codec,
5435 const struct hda_fixup *fix, int action)
5437 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5438 struct alc_spec *spec = codec->spec;
5439 spec->no_shutup_pins = 1;
5443 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5444 const struct hda_fixup *fix, int action)
5446 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5447 struct alc_spec *spec = codec->spec;
5448 /* Disable AA-loopback as it causes white noise */
5449 spec->gen.mixer_nid = 0;
5453 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5454 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5455 const struct hda_fixup *fix, int action)
5457 static const struct hda_pintbl pincfgs[] = {
5458 { 0x16, 0x21211010 }, /* dock headphone */
5459 { 0x19, 0x21a11010 }, /* dock mic */
5462 struct alc_spec *spec = codec->spec;
5464 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5465 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5466 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5467 codec->power_save_node = 0; /* avoid click noises */
5468 snd_hda_apply_pincfgs(codec, pincfgs);
5472 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5473 const struct hda_fixup *fix, int action)
5475 static const struct hda_pintbl pincfgs[] = {
5476 { 0x17, 0x21211010 }, /* dock headphone */
5477 { 0x19, 0x21a11010 }, /* dock mic */
5480 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5481 * the speaker output becomes too low by some reason on Thinkpads with
5484 static const hda_nid_t preferred_pairs[] = {
5485 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5488 struct alc_spec *spec = codec->spec;
5490 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5491 spec->gen.preferred_dacs = preferred_pairs;
5492 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5493 snd_hda_apply_pincfgs(codec, pincfgs);
5494 } else if (action == HDA_FIXUP_ACT_INIT) {
5495 /* Enable DOCK device */
5496 snd_hda_codec_write(codec, 0x17, 0,
5497 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5498 /* Enable DOCK device */
5499 snd_hda_codec_write(codec, 0x19, 0,
5500 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5504 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5506 struct alc_spec *spec = codec->spec;
5507 int hp_pin = alc_get_hp_pin(spec);
5509 /* Prevent pop noises when headphones are plugged in */
5510 snd_hda_codec_write(codec, hp_pin, 0,
5511 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5515 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5516 const struct hda_fixup *fix, int action)
5518 struct alc_spec *spec = codec->spec;
5519 struct hda_input_mux *imux = &spec->gen.input_mux;
5523 case HDA_FIXUP_ACT_PRE_PROBE:
5524 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5525 * it causes a click noise at start up
5527 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5528 spec->shutup = alc_shutup_dell_xps13;
5530 case HDA_FIXUP_ACT_PROBE:
5531 /* Make the internal mic the default input source. */
5532 for (i = 0; i < imux->num_items; i++) {
5533 if (spec->gen.imux_pins[i] == 0x12) {
5534 spec->gen.cur_mux[0] = i;
5542 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5543 const struct hda_fixup *fix, int action)
5545 struct alc_spec *spec = codec->spec;
5547 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5548 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5549 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5551 /* Disable boost for mic-in permanently. (This code is only called
5552 from quirks that guarantee that the headphone is at NID 0x1b.) */
5553 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5554 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5556 alc_fixup_headset_mode(codec, fix, action);
5559 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5560 const struct hda_fixup *fix, int action)
5562 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5563 alc_write_coef_idx(codec, 0xc4, 0x8000);
5564 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5565 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5567 alc_fixup_headset_mode(codec, fix, action);
5570 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5571 static int find_ext_mic_pin(struct hda_codec *codec)
5573 struct alc_spec *spec = codec->spec;
5574 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5576 unsigned int defcfg;
5579 for (i = 0; i < cfg->num_inputs; i++) {
5580 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5582 nid = cfg->inputs[i].pin;
5583 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5584 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5592 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5593 const struct hda_fixup *fix,
5596 struct alc_spec *spec = codec->spec;
5598 if (action == HDA_FIXUP_ACT_PROBE) {
5599 int mic_pin = find_ext_mic_pin(codec);
5600 int hp_pin = alc_get_hp_pin(spec);
5602 if (snd_BUG_ON(!mic_pin || !hp_pin))
5604 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5608 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5609 const struct hda_fixup *fix,
5612 struct alc_spec *spec = codec->spec;
5613 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5616 /* The mic boosts on level 2 and 3 are too noisy
5617 on the internal mic input.
5618 Therefore limit the boost to 0 or 1. */
5620 if (action != HDA_FIXUP_ACT_PROBE)
5623 for (i = 0; i < cfg->num_inputs; i++) {
5624 hda_nid_t nid = cfg->inputs[i].pin;
5625 unsigned int defcfg;
5626 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5628 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5629 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5632 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5633 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5634 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5635 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5636 (0 << AC_AMPCAP_MUTE_SHIFT));
5640 static void alc283_hp_automute_hook(struct hda_codec *codec,
5641 struct hda_jack_callback *jack)
5643 struct alc_spec *spec = codec->spec;
5647 snd_hda_gen_hp_automute(codec, jack);
5649 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5652 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5656 static void alc283_fixup_chromebook(struct hda_codec *codec,
5657 const struct hda_fixup *fix, int action)
5659 struct alc_spec *spec = codec->spec;
5662 case HDA_FIXUP_ACT_PRE_PROBE:
5663 snd_hda_override_wcaps(codec, 0x03, 0);
5664 /* Disable AA-loopback as it causes white noise */
5665 spec->gen.mixer_nid = 0;
5667 case HDA_FIXUP_ACT_INIT:
5668 /* MIC2-VREF control */
5669 /* Set to manual mode */
5670 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5671 /* Enable Line1 input control by verb */
5672 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5677 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5678 const struct hda_fixup *fix, int action)
5680 struct alc_spec *spec = codec->spec;
5683 case HDA_FIXUP_ACT_PRE_PROBE:
5684 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5686 case HDA_FIXUP_ACT_INIT:
5687 /* MIC2-VREF control */
5688 /* Set to manual mode */
5689 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5694 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5695 static void asus_tx300_automute(struct hda_codec *codec)
5697 struct alc_spec *spec = codec->spec;
5698 snd_hda_gen_update_outputs(codec);
5699 if (snd_hda_jack_detect(codec, 0x1b))
5700 spec->gen.mute_bits |= (1ULL << 0x14);
5703 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5704 const struct hda_fixup *fix, int action)
5706 struct alc_spec *spec = codec->spec;
5707 static const struct hda_pintbl dock_pins[] = {
5708 { 0x1b, 0x21114000 }, /* dock speaker pin */
5713 case HDA_FIXUP_ACT_PRE_PROBE:
5714 spec->init_amp = ALC_INIT_DEFAULT;
5715 /* TX300 needs to set up GPIO2 for the speaker amp */
5716 alc_setup_gpio(codec, 0x04);
5717 snd_hda_apply_pincfgs(codec, dock_pins);
5718 spec->gen.auto_mute_via_amp = 1;
5719 spec->gen.automute_hook = asus_tx300_automute;
5720 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5721 snd_hda_gen_hp_automute);
5723 case HDA_FIXUP_ACT_PROBE:
5724 spec->init_amp = ALC_INIT_DEFAULT;
5726 case HDA_FIXUP_ACT_BUILD:
5727 /* this is a bit tricky; give more sane names for the main
5728 * (tablet) speaker and the dock speaker, respectively
5730 rename_ctl(codec, "Speaker Playback Switch",
5731 "Dock Speaker Playback Switch");
5732 rename_ctl(codec, "Bass Speaker Playback Switch",
5733 "Speaker Playback Switch");
5738 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5739 const struct hda_fixup *fix, int action)
5741 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5742 /* DAC node 0x03 is giving mono output. We therefore want to
5743 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5744 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5745 static const hda_nid_t conn1[] = { 0x0c };
5746 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
5747 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
5751 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5752 const struct hda_fixup *fix, int action)
5754 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5755 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5756 we can't adjust the speaker's volume since this node does not has
5757 Amp-out capability. we change the speaker's route to:
5758 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5759 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5760 speaker's volume now. */
5762 static const hda_nid_t conn1[] = { 0x0c };
5763 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
5767 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5768 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5769 const struct hda_fixup *fix, int action)
5771 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5772 static const hda_nid_t conn[] = { 0x02, 0x03 };
5773 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5777 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5778 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
5779 const struct hda_fixup *fix, int action)
5781 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5782 static const hda_nid_t conn[] = { 0x02 };
5783 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5787 /* Hook to update amp GPIO4 for automute */
5788 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5789 struct hda_jack_callback *jack)
5791 struct alc_spec *spec = codec->spec;
5793 snd_hda_gen_hp_automute(codec, jack);
5794 /* mute_led_polarity is set to 0, so we pass inverted value here */
5795 alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present);
5798 /* Manage GPIOs for HP EliteBook Folio 9480m.
5800 * GPIO4 is the headphone amplifier power control
5801 * GPIO3 is the audio output mute indicator LED
5804 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5805 const struct hda_fixup *fix,
5808 struct alc_spec *spec = codec->spec;
5810 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5811 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5812 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5813 spec->gpio_mask |= 0x10;
5814 spec->gpio_dir |= 0x10;
5815 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5819 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5820 const struct hda_fixup *fix,
5823 struct alc_spec *spec = codec->spec;
5825 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5826 spec->gpio_mask |= 0x04;
5827 spec->gpio_dir |= 0x04;
5828 /* set data bit low */
5832 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5833 const struct hda_fixup *fix,
5836 alc_fixup_dual_codecs(codec, fix, action);
5838 case HDA_FIXUP_ACT_PRE_PROBE:
5839 /* override card longname to provide a unique UCM profile */
5840 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5842 case HDA_FIXUP_ACT_BUILD:
5843 /* rename Capture controls depending on the codec */
5844 rename_ctl(codec, "Capture Volume",
5846 "Rear-Panel Capture Volume" :
5847 "Front-Panel Capture Volume");
5848 rename_ctl(codec, "Capture Switch",
5850 "Rear-Panel Capture Switch" :
5851 "Front-Panel Capture Switch");
5856 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5857 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
5858 const struct hda_fixup *fix, int action)
5860 struct alc_spec *spec = codec->spec;
5861 static const hda_nid_t preferred_pairs[] = {
5862 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5866 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5869 spec->gen.preferred_dacs = preferred_pairs;
5870 spec->gen.auto_mute_via_amp = 1;
5871 codec->power_save_node = 0;
5874 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5875 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5876 const struct hda_fixup *fix, int action)
5878 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5881 snd_hda_override_wcaps(codec, 0x03, 0);
5884 static void alc295_fixup_chromebook(struct hda_codec *codec,
5885 const struct hda_fixup *fix, int action)
5887 struct alc_spec *spec = codec->spec;
5890 case HDA_FIXUP_ACT_PRE_PROBE:
5891 spec->ultra_low_power = true;
5893 case HDA_FIXUP_ACT_INIT:
5894 switch (codec->core.vendor_id) {
5896 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
5897 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
5900 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
5901 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
5908 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
5909 const struct hda_fixup *fix, int action)
5911 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5912 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5915 /* for hda_fixup_thinkpad_acpi() */
5916 #include "thinkpad_helper.c"
5918 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5919 const struct hda_fixup *fix, int action)
5921 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5922 hda_fixup_thinkpad_acpi(codec, fix, action);
5925 /* for alc295_fixup_hp_top_speakers */
5926 #include "hp_x360_helper.c"
5929 ALC269_FIXUP_SONY_VAIO,
5930 ALC275_FIXUP_SONY_VAIO_GPIO2,
5931 ALC269_FIXUP_DELL_M101Z,
5932 ALC269_FIXUP_SKU_IGNORE,
5933 ALC269_FIXUP_ASUS_G73JW,
5934 ALC269_FIXUP_LENOVO_EAPD,
5935 ALC275_FIXUP_SONY_HWEQ,
5936 ALC275_FIXUP_SONY_DISABLE_AAMIX,
5938 ALC269_FIXUP_PCM_44K,
5939 ALC269_FIXUP_STEREO_DMIC,
5940 ALC269_FIXUP_HEADSET_MIC,
5941 ALC269_FIXUP_QUANTA_MUTE,
5942 ALC269_FIXUP_LIFEBOOK,
5943 ALC269_FIXUP_LIFEBOOK_EXTMIC,
5944 ALC269_FIXUP_LIFEBOOK_HP_PIN,
5945 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5946 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
5949 ALC269VB_FIXUP_AMIC,
5950 ALC269VB_FIXUP_DMIC,
5951 ALC269_FIXUP_HP_MUTE_LED,
5952 ALC269_FIXUP_HP_MUTE_LED_MIC1,
5953 ALC269_FIXUP_HP_MUTE_LED_MIC2,
5954 ALC269_FIXUP_HP_MUTE_LED_MIC3,
5955 ALC269_FIXUP_HP_GPIO_LED,
5956 ALC269_FIXUP_HP_GPIO_MIC1_LED,
5957 ALC269_FIXUP_HP_LINE1_MIC1_LED,
5958 ALC269_FIXUP_INV_DMIC,
5959 ALC269_FIXUP_LENOVO_DOCK,
5960 ALC269_FIXUP_NO_SHUTUP,
5961 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
5962 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
5963 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5964 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
5965 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5966 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
5967 ALC269_FIXUP_HEADSET_MODE,
5968 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
5969 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
5970 ALC269_FIXUP_ASUS_X101_FUNC,
5971 ALC269_FIXUP_ASUS_X101_VERB,
5972 ALC269_FIXUP_ASUS_X101,
5973 ALC271_FIXUP_AMIC_MIC2,
5974 ALC271_FIXUP_HP_GATE_MIC_JACK,
5975 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
5976 ALC269_FIXUP_ACER_AC700,
5977 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
5978 ALC269VB_FIXUP_ASUS_ZENBOOK,
5979 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
5980 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
5981 ALC269VB_FIXUP_ORDISSIMO_EVE2,
5982 ALC283_FIXUP_CHROME_BOOK,
5983 ALC283_FIXUP_SENSE_COMBO_JACK,
5984 ALC282_FIXUP_ASUS_TX300,
5985 ALC283_FIXUP_INT_MIC,
5986 ALC290_FIXUP_MONO_SPEAKERS,
5987 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
5988 ALC290_FIXUP_SUBWOOFER,
5989 ALC290_FIXUP_SUBWOOFER_HSJACK,
5990 ALC269_FIXUP_THINKPAD_ACPI,
5991 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5992 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
5993 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
5994 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5995 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
5996 ALC255_FIXUP_HEADSET_MODE,
5997 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
5998 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5999 ALC292_FIXUP_TPT440_DOCK,
6000 ALC292_FIXUP_TPT440,
6001 ALC283_FIXUP_HEADSET_MIC,
6002 ALC255_FIXUP_MIC_MUTE_LED,
6003 ALC282_FIXUP_ASPIRE_V5_PINS,
6004 ALC280_FIXUP_HP_GPIO4,
6005 ALC286_FIXUP_HP_GPIO_LED,
6006 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6007 ALC280_FIXUP_HP_DOCK_PINS,
6008 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6009 ALC280_FIXUP_HP_9480M,
6010 ALC288_FIXUP_DELL_HEADSET_MODE,
6011 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6012 ALC288_FIXUP_DELL_XPS_13,
6013 ALC288_FIXUP_DISABLE_AAMIX,
6014 ALC292_FIXUP_DELL_E7X_AAMIX,
6015 ALC292_FIXUP_DELL_E7X,
6016 ALC292_FIXUP_DISABLE_AAMIX,
6017 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6018 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6019 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6020 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6021 ALC275_FIXUP_DELL_XPS,
6022 ALC293_FIXUP_LENOVO_SPK_NOISE,
6023 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6024 ALC255_FIXUP_DELL_SPK_NOISE,
6025 ALC225_FIXUP_DISABLE_MIC_VREF,
6026 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6027 ALC295_FIXUP_DISABLE_DAC3,
6028 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6029 ALC280_FIXUP_HP_HEADSET_MIC,
6030 ALC221_FIXUP_HP_FRONT_MIC,
6031 ALC292_FIXUP_TPT460,
6032 ALC298_FIXUP_SPK_VOLUME,
6033 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6034 ALC269_FIXUP_ATIV_BOOK_8,
6035 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6036 ALC256_FIXUP_ASUS_HEADSET_MODE,
6037 ALC256_FIXUP_ASUS_MIC,
6038 ALC256_FIXUP_ASUS_AIO_GPIO2,
6039 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6040 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6041 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6042 ALC233_FIXUP_ACER_HEADSET_MIC,
6043 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6044 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6045 ALC700_FIXUP_INTEL_REFERENCE,
6046 ALC274_FIXUP_DELL_BIND_DACS,
6047 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6048 ALC298_FIXUP_TPT470_DOCK,
6049 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6050 ALC255_FIXUP_DELL_HEADSET_MIC,
6051 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6052 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6053 ALC295_FIXUP_HP_X360,
6054 ALC221_FIXUP_HP_HEADSET_MIC,
6055 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6056 ALC295_FIXUP_HP_AUTO_MUTE,
6057 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6058 ALC294_FIXUP_ASUS_MIC,
6059 ALC294_FIXUP_ASUS_HEADSET_MIC,
6060 ALC294_FIXUP_ASUS_SPK,
6061 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6062 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6063 ALC255_FIXUP_ACER_HEADSET_MIC,
6064 ALC295_FIXUP_CHROME_BOOK,
6065 ALC225_FIXUP_HEADSET_JACK,
6066 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6067 ALC225_FIXUP_WYSE_AUTO_MUTE,
6068 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6069 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6070 ALC256_FIXUP_ASUS_HEADSET_MIC,
6071 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6072 ALC299_FIXUP_PREDATOR_SPK,
6073 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6074 ALC289_FIXUP_DELL_SPK2,
6075 ALC289_FIXUP_DUAL_SPK,
6076 ALC294_FIXUP_SPK2_TO_DAC1,
6077 ALC294_FIXUP_ASUS_DUAL_SPK,
6078 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6079 ALC294_FIXUP_ASUS_HPE,
6080 ALC285_FIXUP_HP_GPIO_LED,
6081 ALC285_FIXUP_HP_MUTE_LED,
6082 ALC236_FIXUP_HP_MUTE_LED,
6085 static const struct hda_fixup alc269_fixups[] = {
6086 [ALC269_FIXUP_SONY_VAIO] = {
6087 .type = HDA_FIXUP_PINCTLS,
6088 .v.pins = (const struct hda_pintbl[]) {
6089 {0x19, PIN_VREFGRD},
6093 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6094 .type = HDA_FIXUP_FUNC,
6095 .v.func = alc275_fixup_gpio4_off,
6097 .chain_id = ALC269_FIXUP_SONY_VAIO
6099 [ALC269_FIXUP_DELL_M101Z] = {
6100 .type = HDA_FIXUP_VERBS,
6101 .v.verbs = (const struct hda_verb[]) {
6102 /* Enables internal speaker */
6103 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6104 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6108 [ALC269_FIXUP_SKU_IGNORE] = {
6109 .type = HDA_FIXUP_FUNC,
6110 .v.func = alc_fixup_sku_ignore,
6112 [ALC269_FIXUP_ASUS_G73JW] = {
6113 .type = HDA_FIXUP_PINS,
6114 .v.pins = (const struct hda_pintbl[]) {
6115 { 0x17, 0x99130111 }, /* subwoofer */
6119 [ALC269_FIXUP_LENOVO_EAPD] = {
6120 .type = HDA_FIXUP_VERBS,
6121 .v.verbs = (const struct hda_verb[]) {
6122 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6126 [ALC275_FIXUP_SONY_HWEQ] = {
6127 .type = HDA_FIXUP_FUNC,
6128 .v.func = alc269_fixup_hweq,
6130 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6132 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6133 .type = HDA_FIXUP_FUNC,
6134 .v.func = alc_fixup_disable_aamix,
6136 .chain_id = ALC269_FIXUP_SONY_VAIO
6138 [ALC271_FIXUP_DMIC] = {
6139 .type = HDA_FIXUP_FUNC,
6140 .v.func = alc271_fixup_dmic,
6142 [ALC269_FIXUP_PCM_44K] = {
6143 .type = HDA_FIXUP_FUNC,
6144 .v.func = alc269_fixup_pcm_44k,
6146 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6148 [ALC269_FIXUP_STEREO_DMIC] = {
6149 .type = HDA_FIXUP_FUNC,
6150 .v.func = alc269_fixup_stereo_dmic,
6152 [ALC269_FIXUP_HEADSET_MIC] = {
6153 .type = HDA_FIXUP_FUNC,
6154 .v.func = alc269_fixup_headset_mic,
6156 [ALC269_FIXUP_QUANTA_MUTE] = {
6157 .type = HDA_FIXUP_FUNC,
6158 .v.func = alc269_fixup_quanta_mute,
6160 [ALC269_FIXUP_LIFEBOOK] = {
6161 .type = HDA_FIXUP_PINS,
6162 .v.pins = (const struct hda_pintbl[]) {
6163 { 0x1a, 0x2101103f }, /* dock line-out */
6164 { 0x1b, 0x23a11040 }, /* dock mic-in */
6168 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6170 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6171 .type = HDA_FIXUP_PINS,
6172 .v.pins = (const struct hda_pintbl[]) {
6173 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6177 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6178 .type = HDA_FIXUP_PINS,
6179 .v.pins = (const struct hda_pintbl[]) {
6180 { 0x21, 0x0221102f }, /* HP out */
6184 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6185 .type = HDA_FIXUP_FUNC,
6186 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6188 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6189 .type = HDA_FIXUP_FUNC,
6190 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6192 [ALC269_FIXUP_AMIC] = {
6193 .type = HDA_FIXUP_PINS,
6194 .v.pins = (const struct hda_pintbl[]) {
6195 { 0x14, 0x99130110 }, /* speaker */
6196 { 0x15, 0x0121401f }, /* HP out */
6197 { 0x18, 0x01a19c20 }, /* mic */
6198 { 0x19, 0x99a3092f }, /* int-mic */
6202 [ALC269_FIXUP_DMIC] = {
6203 .type = HDA_FIXUP_PINS,
6204 .v.pins = (const struct hda_pintbl[]) {
6205 { 0x12, 0x99a3092f }, /* int-mic */
6206 { 0x14, 0x99130110 }, /* speaker */
6207 { 0x15, 0x0121401f }, /* HP out */
6208 { 0x18, 0x01a19c20 }, /* mic */
6212 [ALC269VB_FIXUP_AMIC] = {
6213 .type = HDA_FIXUP_PINS,
6214 .v.pins = (const struct hda_pintbl[]) {
6215 { 0x14, 0x99130110 }, /* speaker */
6216 { 0x18, 0x01a19c20 }, /* mic */
6217 { 0x19, 0x99a3092f }, /* int-mic */
6218 { 0x21, 0x0121401f }, /* HP out */
6222 [ALC269VB_FIXUP_DMIC] = {
6223 .type = HDA_FIXUP_PINS,
6224 .v.pins = (const struct hda_pintbl[]) {
6225 { 0x12, 0x99a3092f }, /* int-mic */
6226 { 0x14, 0x99130110 }, /* speaker */
6227 { 0x18, 0x01a19c20 }, /* mic */
6228 { 0x21, 0x0121401f }, /* HP out */
6232 [ALC269_FIXUP_HP_MUTE_LED] = {
6233 .type = HDA_FIXUP_FUNC,
6234 .v.func = alc269_fixup_hp_mute_led,
6236 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6237 .type = HDA_FIXUP_FUNC,
6238 .v.func = alc269_fixup_hp_mute_led_mic1,
6240 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6241 .type = HDA_FIXUP_FUNC,
6242 .v.func = alc269_fixup_hp_mute_led_mic2,
6244 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6245 .type = HDA_FIXUP_FUNC,
6246 .v.func = alc269_fixup_hp_mute_led_mic3,
6248 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6250 [ALC269_FIXUP_HP_GPIO_LED] = {
6251 .type = HDA_FIXUP_FUNC,
6252 .v.func = alc269_fixup_hp_gpio_led,
6254 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6255 .type = HDA_FIXUP_FUNC,
6256 .v.func = alc269_fixup_hp_gpio_mic1_led,
6258 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6259 .type = HDA_FIXUP_FUNC,
6260 .v.func = alc269_fixup_hp_line1_mic1_led,
6262 [ALC269_FIXUP_INV_DMIC] = {
6263 .type = HDA_FIXUP_FUNC,
6264 .v.func = alc_fixup_inv_dmic,
6266 [ALC269_FIXUP_NO_SHUTUP] = {
6267 .type = HDA_FIXUP_FUNC,
6268 .v.func = alc_fixup_no_shutup,
6270 [ALC269_FIXUP_LENOVO_DOCK] = {
6271 .type = HDA_FIXUP_PINS,
6272 .v.pins = (const struct hda_pintbl[]) {
6273 { 0x19, 0x23a11040 }, /* dock mic */
6274 { 0x1b, 0x2121103f }, /* dock headphone */
6278 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6280 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6281 .type = HDA_FIXUP_FUNC,
6282 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6284 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6286 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6287 .type = HDA_FIXUP_PINS,
6288 .v.pins = (const struct hda_pintbl[]) {
6289 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6290 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6294 .chain_id = ALC269_FIXUP_HEADSET_MODE
6296 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6297 .type = HDA_FIXUP_PINS,
6298 .v.pins = (const struct hda_pintbl[]) {
6299 { 0x16, 0x21014020 }, /* dock line out */
6300 { 0x19, 0x21a19030 }, /* dock mic */
6301 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6305 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6307 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6308 .type = HDA_FIXUP_PINS,
6309 .v.pins = (const struct hda_pintbl[]) {
6310 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6314 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6316 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6317 .type = HDA_FIXUP_PINS,
6318 .v.pins = (const struct hda_pintbl[]) {
6319 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6320 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6324 .chain_id = ALC269_FIXUP_HEADSET_MODE
6326 [ALC269_FIXUP_HEADSET_MODE] = {
6327 .type = HDA_FIXUP_FUNC,
6328 .v.func = alc_fixup_headset_mode,
6330 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6332 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6333 .type = HDA_FIXUP_FUNC,
6334 .v.func = alc_fixup_headset_mode_no_hp_mic,
6336 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6337 .type = HDA_FIXUP_PINS,
6338 .v.pins = (const struct hda_pintbl[]) {
6339 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6343 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6345 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6346 .type = HDA_FIXUP_PINS,
6347 .v.pins = (const struct hda_pintbl[]) {
6348 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6352 .chain_id = ALC269_FIXUP_HEADSET_MIC
6354 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
6355 .type = HDA_FIXUP_PINS,
6356 .v.pins = (const struct hda_pintbl[]) {
6370 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6372 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
6373 .type = HDA_FIXUP_FUNC,
6374 .v.func = alc298_fixup_huawei_mbx_stereo,
6376 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6378 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6379 .type = HDA_FIXUP_FUNC,
6380 .v.func = alc269_fixup_x101_headset_mic,
6382 [ALC269_FIXUP_ASUS_X101_VERB] = {
6383 .type = HDA_FIXUP_VERBS,
6384 .v.verbs = (const struct hda_verb[]) {
6385 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6386 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6387 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6391 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6393 [ALC269_FIXUP_ASUS_X101] = {
6394 .type = HDA_FIXUP_PINS,
6395 .v.pins = (const struct hda_pintbl[]) {
6396 { 0x18, 0x04a1182c }, /* Headset mic */
6400 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6402 [ALC271_FIXUP_AMIC_MIC2] = {
6403 .type = HDA_FIXUP_PINS,
6404 .v.pins = (const struct hda_pintbl[]) {
6405 { 0x14, 0x99130110 }, /* speaker */
6406 { 0x19, 0x01a19c20 }, /* mic */
6407 { 0x1b, 0x99a7012f }, /* int-mic */
6408 { 0x21, 0x0121401f }, /* HP out */
6412 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6413 .type = HDA_FIXUP_FUNC,
6414 .v.func = alc271_hp_gate_mic_jack,
6416 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6418 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6419 .type = HDA_FIXUP_FUNC,
6420 .v.func = alc269_fixup_limit_int_mic_boost,
6422 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6424 [ALC269_FIXUP_ACER_AC700] = {
6425 .type = HDA_FIXUP_PINS,
6426 .v.pins = (const struct hda_pintbl[]) {
6427 { 0x12, 0x99a3092f }, /* int-mic */
6428 { 0x14, 0x99130110 }, /* speaker */
6429 { 0x18, 0x03a11c20 }, /* mic */
6430 { 0x1e, 0x0346101e }, /* SPDIF1 */
6431 { 0x21, 0x0321101f }, /* HP out */
6435 .chain_id = ALC271_FIXUP_DMIC,
6437 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6438 .type = HDA_FIXUP_FUNC,
6439 .v.func = alc269_fixup_limit_int_mic_boost,
6441 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6443 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6444 .type = HDA_FIXUP_FUNC,
6445 .v.func = alc269_fixup_limit_int_mic_boost,
6447 .chain_id = ALC269VB_FIXUP_DMIC,
6449 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6450 .type = HDA_FIXUP_VERBS,
6451 .v.verbs = (const struct hda_verb[]) {
6452 /* class-D output amp +5dB */
6453 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6454 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6458 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6460 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6461 .type = HDA_FIXUP_FUNC,
6462 .v.func = alc269_fixup_limit_int_mic_boost,
6464 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6466 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6467 .type = HDA_FIXUP_PINS,
6468 .v.pins = (const struct hda_pintbl[]) {
6469 { 0x12, 0x99a3092f }, /* int-mic */
6470 { 0x18, 0x03a11d20 }, /* mic */
6471 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6475 [ALC283_FIXUP_CHROME_BOOK] = {
6476 .type = HDA_FIXUP_FUNC,
6477 .v.func = alc283_fixup_chromebook,
6479 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6480 .type = HDA_FIXUP_FUNC,
6481 .v.func = alc283_fixup_sense_combo_jack,
6483 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6485 [ALC282_FIXUP_ASUS_TX300] = {
6486 .type = HDA_FIXUP_FUNC,
6487 .v.func = alc282_fixup_asus_tx300,
6489 [ALC283_FIXUP_INT_MIC] = {
6490 .type = HDA_FIXUP_VERBS,
6491 .v.verbs = (const struct hda_verb[]) {
6492 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6493 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6497 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6499 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6500 .type = HDA_FIXUP_PINS,
6501 .v.pins = (const struct hda_pintbl[]) {
6502 { 0x17, 0x90170112 }, /* subwoofer */
6506 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6508 [ALC290_FIXUP_SUBWOOFER] = {
6509 .type = HDA_FIXUP_PINS,
6510 .v.pins = (const struct hda_pintbl[]) {
6511 { 0x17, 0x90170112 }, /* subwoofer */
6515 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6517 [ALC290_FIXUP_MONO_SPEAKERS] = {
6518 .type = HDA_FIXUP_FUNC,
6519 .v.func = alc290_fixup_mono_speakers,
6521 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6522 .type = HDA_FIXUP_FUNC,
6523 .v.func = alc290_fixup_mono_speakers,
6525 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6527 [ALC269_FIXUP_THINKPAD_ACPI] = {
6528 .type = HDA_FIXUP_FUNC,
6529 .v.func = alc_fixup_thinkpad_acpi,
6531 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6533 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6534 .type = HDA_FIXUP_FUNC,
6535 .v.func = alc_fixup_inv_dmic,
6537 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6539 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6540 .type = HDA_FIXUP_PINS,
6541 .v.pins = (const struct hda_pintbl[]) {
6542 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6546 .chain_id = ALC255_FIXUP_HEADSET_MODE
6548 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6549 .type = HDA_FIXUP_PINS,
6550 .v.pins = (const struct hda_pintbl[]) {
6551 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6555 .chain_id = ALC255_FIXUP_HEADSET_MODE
6557 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6558 .type = HDA_FIXUP_PINS,
6559 .v.pins = (const struct hda_pintbl[]) {
6560 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6561 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6565 .chain_id = ALC255_FIXUP_HEADSET_MODE
6567 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6568 .type = HDA_FIXUP_PINS,
6569 .v.pins = (const struct hda_pintbl[]) {
6570 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6574 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6576 [ALC255_FIXUP_HEADSET_MODE] = {
6577 .type = HDA_FIXUP_FUNC,
6578 .v.func = alc_fixup_headset_mode_alc255,
6580 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6582 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6583 .type = HDA_FIXUP_FUNC,
6584 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6586 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6587 .type = HDA_FIXUP_PINS,
6588 .v.pins = (const struct hda_pintbl[]) {
6589 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6590 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6594 .chain_id = ALC269_FIXUP_HEADSET_MODE
6596 [ALC292_FIXUP_TPT440_DOCK] = {
6597 .type = HDA_FIXUP_FUNC,
6598 .v.func = alc_fixup_tpt440_dock,
6600 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6602 [ALC292_FIXUP_TPT440] = {
6603 .type = HDA_FIXUP_FUNC,
6604 .v.func = alc_fixup_disable_aamix,
6606 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6608 [ALC283_FIXUP_HEADSET_MIC] = {
6609 .type = HDA_FIXUP_PINS,
6610 .v.pins = (const struct hda_pintbl[]) {
6611 { 0x19, 0x04a110f0 },
6615 [ALC255_FIXUP_MIC_MUTE_LED] = {
6616 .type = HDA_FIXUP_FUNC,
6617 .v.func = snd_hda_gen_fixup_micmute_led,
6619 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6620 .type = HDA_FIXUP_PINS,
6621 .v.pins = (const struct hda_pintbl[]) {
6622 { 0x12, 0x90a60130 },
6623 { 0x14, 0x90170110 },
6624 { 0x17, 0x40000008 },
6625 { 0x18, 0x411111f0 },
6626 { 0x19, 0x01a1913c },
6627 { 0x1a, 0x411111f0 },
6628 { 0x1b, 0x411111f0 },
6629 { 0x1d, 0x40f89b2d },
6630 { 0x1e, 0x411111f0 },
6631 { 0x21, 0x0321101f },
6635 [ALC280_FIXUP_HP_GPIO4] = {
6636 .type = HDA_FIXUP_FUNC,
6637 .v.func = alc280_fixup_hp_gpio4,
6639 [ALC286_FIXUP_HP_GPIO_LED] = {
6640 .type = HDA_FIXUP_FUNC,
6641 .v.func = alc286_fixup_hp_gpio_led,
6643 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6644 .type = HDA_FIXUP_FUNC,
6645 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6647 [ALC280_FIXUP_HP_DOCK_PINS] = {
6648 .type = HDA_FIXUP_PINS,
6649 .v.pins = (const struct hda_pintbl[]) {
6650 { 0x1b, 0x21011020 }, /* line-out */
6651 { 0x1a, 0x01a1903c }, /* headset mic */
6652 { 0x18, 0x2181103f }, /* line-in */
6656 .chain_id = ALC280_FIXUP_HP_GPIO4
6658 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6659 .type = HDA_FIXUP_PINS,
6660 .v.pins = (const struct hda_pintbl[]) {
6661 { 0x1b, 0x21011020 }, /* line-out */
6662 { 0x18, 0x2181103f }, /* line-in */
6666 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6668 [ALC280_FIXUP_HP_9480M] = {
6669 .type = HDA_FIXUP_FUNC,
6670 .v.func = alc280_fixup_hp_9480m,
6672 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6673 .type = HDA_FIXUP_FUNC,
6674 .v.func = alc_fixup_headset_mode_dell_alc288,
6676 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6678 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6679 .type = HDA_FIXUP_PINS,
6680 .v.pins = (const struct hda_pintbl[]) {
6681 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6682 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6686 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6688 [ALC288_FIXUP_DISABLE_AAMIX] = {
6689 .type = HDA_FIXUP_FUNC,
6690 .v.func = alc_fixup_disable_aamix,
6692 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6694 [ALC288_FIXUP_DELL_XPS_13] = {
6695 .type = HDA_FIXUP_FUNC,
6696 .v.func = alc_fixup_dell_xps13,
6698 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6700 [ALC292_FIXUP_DISABLE_AAMIX] = {
6701 .type = HDA_FIXUP_FUNC,
6702 .v.func = alc_fixup_disable_aamix,
6704 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6706 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
6707 .type = HDA_FIXUP_FUNC,
6708 .v.func = alc_fixup_disable_aamix,
6710 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6712 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
6713 .type = HDA_FIXUP_FUNC,
6714 .v.func = alc_fixup_dell_xps13,
6716 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
6718 [ALC292_FIXUP_DELL_E7X] = {
6719 .type = HDA_FIXUP_FUNC,
6720 .v.func = snd_hda_gen_fixup_micmute_led,
6721 /* micmute fixup must be applied at last */
6722 .chained_before = true,
6723 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
6725 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
6726 .type = HDA_FIXUP_PINS,
6727 .v.pins = (const struct hda_pintbl[]) {
6728 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
6731 .chained_before = true,
6732 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6734 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6735 .type = HDA_FIXUP_PINS,
6736 .v.pins = (const struct hda_pintbl[]) {
6737 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6738 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6742 .chain_id = ALC269_FIXUP_HEADSET_MODE
6744 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
6745 .type = HDA_FIXUP_PINS,
6746 .v.pins = (const struct hda_pintbl[]) {
6747 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6751 .chain_id = ALC269_FIXUP_HEADSET_MODE
6753 [ALC275_FIXUP_DELL_XPS] = {
6754 .type = HDA_FIXUP_VERBS,
6755 .v.verbs = (const struct hda_verb[]) {
6756 /* Enables internal speaker */
6757 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
6758 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
6759 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
6760 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
6764 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
6765 .type = HDA_FIXUP_FUNC,
6766 .v.func = alc_fixup_disable_aamix,
6768 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6770 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
6771 .type = HDA_FIXUP_FUNC,
6772 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
6774 [ALC255_FIXUP_DELL_SPK_NOISE] = {
6775 .type = HDA_FIXUP_FUNC,
6776 .v.func = alc_fixup_disable_aamix,
6778 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6780 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
6781 .type = HDA_FIXUP_FUNC,
6782 .v.func = alc_fixup_disable_mic_vref,
6784 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6786 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6787 .type = HDA_FIXUP_VERBS,
6788 .v.verbs = (const struct hda_verb[]) {
6789 /* Disable pass-through path for FRONT 14h */
6790 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6791 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6795 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
6797 [ALC280_FIXUP_HP_HEADSET_MIC] = {
6798 .type = HDA_FIXUP_FUNC,
6799 .v.func = alc_fixup_disable_aamix,
6801 .chain_id = ALC269_FIXUP_HEADSET_MIC,
6803 [ALC221_FIXUP_HP_FRONT_MIC] = {
6804 .type = HDA_FIXUP_PINS,
6805 .v.pins = (const struct hda_pintbl[]) {
6806 { 0x19, 0x02a19020 }, /* Front Mic */
6810 [ALC292_FIXUP_TPT460] = {
6811 .type = HDA_FIXUP_FUNC,
6812 .v.func = alc_fixup_tpt440_dock,
6814 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
6816 [ALC298_FIXUP_SPK_VOLUME] = {
6817 .type = HDA_FIXUP_FUNC,
6818 .v.func = alc298_fixup_speaker_volume,
6820 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6822 [ALC295_FIXUP_DISABLE_DAC3] = {
6823 .type = HDA_FIXUP_FUNC,
6824 .v.func = alc295_fixup_disable_dac3,
6826 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
6827 .type = HDA_FIXUP_FUNC,
6828 .v.func = alc285_fixup_speaker2_to_dac1,
6830 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6832 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
6833 .type = HDA_FIXUP_PINS,
6834 .v.pins = (const struct hda_pintbl[]) {
6835 { 0x1b, 0x90170151 },
6839 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6841 [ALC269_FIXUP_ATIV_BOOK_8] = {
6842 .type = HDA_FIXUP_FUNC,
6843 .v.func = alc_fixup_auto_mute_via_amp,
6845 .chain_id = ALC269_FIXUP_NO_SHUTUP
6847 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
6848 .type = HDA_FIXUP_PINS,
6849 .v.pins = (const struct hda_pintbl[]) {
6850 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6851 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6855 .chain_id = ALC269_FIXUP_HEADSET_MODE
6857 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
6858 .type = HDA_FIXUP_FUNC,
6859 .v.func = alc_fixup_headset_mode,
6861 [ALC256_FIXUP_ASUS_MIC] = {
6862 .type = HDA_FIXUP_PINS,
6863 .v.pins = (const struct hda_pintbl[]) {
6864 { 0x13, 0x90a60160 }, /* use as internal mic */
6865 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6869 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6871 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
6872 .type = HDA_FIXUP_FUNC,
6873 /* Set up GPIO2 for the speaker amp */
6874 .v.func = alc_fixup_gpio4,
6876 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6877 .type = HDA_FIXUP_PINS,
6878 .v.pins = (const struct hda_pintbl[]) {
6879 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6883 .chain_id = ALC269_FIXUP_HEADSET_MIC
6885 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
6886 .type = HDA_FIXUP_VERBS,
6887 .v.verbs = (const struct hda_verb[]) {
6888 /* Enables internal speaker */
6889 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
6890 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
6894 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6896 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
6897 .type = HDA_FIXUP_FUNC,
6898 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
6900 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
6901 .type = HDA_FIXUP_VERBS,
6902 .v.verbs = (const struct hda_verb[]) {
6903 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
6904 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
6908 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6910 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
6911 .type = HDA_FIXUP_PINS,
6912 .v.pins = (const struct hda_pintbl[]) {
6913 /* Change the mic location from front to right, otherwise there are
6914 two front mics with the same name, pulseaudio can't handle them.
6915 This is just a temporary workaround, after applying this fixup,
6916 there will be one "Front Mic" and one "Mic" in this machine.
6918 { 0x1a, 0x04a19040 },
6922 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
6923 .type = HDA_FIXUP_PINS,
6924 .v.pins = (const struct hda_pintbl[]) {
6925 { 0x16, 0x0101102f }, /* Rear Headset HP */
6926 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6927 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6928 { 0x1b, 0x02011020 },
6932 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6934 [ALC700_FIXUP_INTEL_REFERENCE] = {
6935 .type = HDA_FIXUP_VERBS,
6936 .v.verbs = (const struct hda_verb[]) {
6937 /* Enables internal speaker */
6938 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
6939 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
6940 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
6941 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
6942 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
6943 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
6944 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
6945 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
6949 [ALC274_FIXUP_DELL_BIND_DACS] = {
6950 .type = HDA_FIXUP_FUNC,
6951 .v.func = alc274_fixup_bind_dacs,
6953 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6955 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
6956 .type = HDA_FIXUP_PINS,
6957 .v.pins = (const struct hda_pintbl[]) {
6958 { 0x1b, 0x0401102f },
6962 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
6964 [ALC298_FIXUP_TPT470_DOCK] = {
6965 .type = HDA_FIXUP_FUNC,
6966 .v.func = alc_fixup_tpt470_dock,
6968 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6970 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
6971 .type = HDA_FIXUP_PINS,
6972 .v.pins = (const struct hda_pintbl[]) {
6973 { 0x14, 0x0201101f },
6977 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6979 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
6980 .type = HDA_FIXUP_PINS,
6981 .v.pins = (const struct hda_pintbl[]) {
6982 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6986 .chain_id = ALC269_FIXUP_HEADSET_MIC
6988 [ALC295_FIXUP_HP_X360] = {
6989 .type = HDA_FIXUP_FUNC,
6990 .v.func = alc295_fixup_hp_top_speakers,
6992 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
6994 [ALC221_FIXUP_HP_HEADSET_MIC] = {
6995 .type = HDA_FIXUP_PINS,
6996 .v.pins = (const struct hda_pintbl[]) {
6997 { 0x19, 0x0181313f},
7001 .chain_id = ALC269_FIXUP_HEADSET_MIC
7003 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7004 .type = HDA_FIXUP_FUNC,
7005 .v.func = alc285_fixup_invalidate_dacs,
7007 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7009 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7010 .type = HDA_FIXUP_FUNC,
7011 .v.func = alc_fixup_auto_mute_via_amp,
7013 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7014 .type = HDA_FIXUP_PINS,
7015 .v.pins = (const struct hda_pintbl[]) {
7016 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7020 .chain_id = ALC269_FIXUP_HEADSET_MIC
7022 [ALC294_FIXUP_ASUS_MIC] = {
7023 .type = HDA_FIXUP_PINS,
7024 .v.pins = (const struct hda_pintbl[]) {
7025 { 0x13, 0x90a60160 }, /* use as internal mic */
7026 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7030 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7032 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7033 .type = HDA_FIXUP_PINS,
7034 .v.pins = (const struct hda_pintbl[]) {
7035 { 0x19, 0x01a1103c }, /* use as headset mic */
7039 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7041 [ALC294_FIXUP_ASUS_SPK] = {
7042 .type = HDA_FIXUP_VERBS,
7043 .v.verbs = (const struct hda_verb[]) {
7045 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7046 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7050 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7052 [ALC295_FIXUP_CHROME_BOOK] = {
7053 .type = HDA_FIXUP_FUNC,
7054 .v.func = alc295_fixup_chromebook,
7056 .chain_id = ALC225_FIXUP_HEADSET_JACK
7058 [ALC225_FIXUP_HEADSET_JACK] = {
7059 .type = HDA_FIXUP_FUNC,
7060 .v.func = alc_fixup_headset_jack,
7062 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7063 .type = HDA_FIXUP_PINS,
7064 .v.pins = (const struct hda_pintbl[]) {
7065 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7069 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7071 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7072 .type = HDA_FIXUP_VERBS,
7073 .v.verbs = (const struct hda_verb[]) {
7074 /* Disable PCBEEP-IN passthrough */
7075 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7076 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7080 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7082 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7083 .type = HDA_FIXUP_PINS,
7084 .v.pins = (const struct hda_pintbl[]) {
7085 { 0x19, 0x03a11130 },
7086 { 0x1a, 0x90a60140 }, /* use as internal mic */
7090 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7092 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7093 .type = HDA_FIXUP_PINS,
7094 .v.pins = (const struct hda_pintbl[]) {
7095 { 0x16, 0x01011020 }, /* Rear Line out */
7096 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7100 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7102 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7103 .type = HDA_FIXUP_FUNC,
7104 .v.func = alc_fixup_auto_mute_via_amp,
7106 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7108 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7109 .type = HDA_FIXUP_FUNC,
7110 .v.func = alc_fixup_disable_mic_vref,
7112 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7114 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7115 .type = HDA_FIXUP_VERBS,
7116 .v.verbs = (const struct hda_verb[]) {
7117 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7118 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7122 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7124 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7125 .type = HDA_FIXUP_PINS,
7126 .v.pins = (const struct hda_pintbl[]) {
7127 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7131 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7133 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7134 .type = HDA_FIXUP_PINS,
7135 .v.pins = (const struct hda_pintbl[]) {
7136 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7140 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7142 [ALC299_FIXUP_PREDATOR_SPK] = {
7143 .type = HDA_FIXUP_PINS,
7144 .v.pins = (const struct hda_pintbl[]) {
7145 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7149 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7150 .type = HDA_FIXUP_PINS,
7151 .v.pins = (const struct hda_pintbl[]) {
7152 { 0x19, 0x04a11040 },
7153 { 0x21, 0x04211020 },
7157 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7159 [ALC289_FIXUP_DELL_SPK2] = {
7160 .type = HDA_FIXUP_PINS,
7161 .v.pins = (const struct hda_pintbl[]) {
7162 { 0x17, 0x90170130 }, /* bass spk */
7166 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7168 [ALC289_FIXUP_DUAL_SPK] = {
7169 .type = HDA_FIXUP_FUNC,
7170 .v.func = alc285_fixup_speaker2_to_dac1,
7172 .chain_id = ALC289_FIXUP_DELL_SPK2
7174 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7175 .type = HDA_FIXUP_FUNC,
7176 .v.func = alc285_fixup_speaker2_to_dac1,
7178 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7180 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7181 .type = HDA_FIXUP_FUNC,
7182 /* The GPIO must be pulled to initialize the AMP */
7183 .v.func = alc_fixup_gpio4,
7185 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7187 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7188 .type = HDA_FIXUP_FUNC,
7189 .v.func = alc_fixup_headset_jack,
7191 .chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1
7193 [ALC294_FIXUP_ASUS_HPE] = {
7194 .type = HDA_FIXUP_VERBS,
7195 .v.verbs = (const struct hda_verb[]) {
7197 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7198 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7202 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7204 [ALC285_FIXUP_HP_GPIO_LED] = {
7205 .type = HDA_FIXUP_FUNC,
7206 .v.func = alc285_fixup_hp_gpio_led,
7208 [ALC285_FIXUP_HP_MUTE_LED] = {
7209 .type = HDA_FIXUP_FUNC,
7210 .v.func = alc285_fixup_hp_mute_led,
7212 [ALC236_FIXUP_HP_MUTE_LED] = {
7213 .type = HDA_FIXUP_FUNC,
7214 .v.func = alc236_fixup_hp_mute_led,
7218 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
7219 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
7220 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
7221 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
7222 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7223 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7224 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7225 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
7226 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
7227 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7228 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7229 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
7230 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
7231 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
7232 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7233 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7234 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
7235 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7236 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7237 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7238 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7239 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
7240 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
7241 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
7242 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
7243 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
7244 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
7245 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
7246 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
7247 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
7248 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7249 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7250 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7251 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7252 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7253 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
7254 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
7255 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
7256 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7257 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7258 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
7259 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7260 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
7261 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7262 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7263 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7264 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7265 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7266 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7267 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7268 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7269 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7270 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
7271 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
7272 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
7273 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
7274 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
7275 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7276 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
7277 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7278 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7279 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7280 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7281 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
7282 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
7283 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
7284 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7285 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7286 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7287 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7288 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7289 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7290 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7291 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
7292 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
7293 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7294 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
7296 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7297 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7298 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7299 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7300 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7301 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7302 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7303 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7304 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7305 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7306 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7307 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7308 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
7309 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7310 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7311 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7312 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7313 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7314 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7315 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7316 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
7317 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7318 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7320 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7321 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7322 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7323 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7324 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7325 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7326 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7327 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7328 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7329 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
7330 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7331 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7332 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7333 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7334 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7335 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7336 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7337 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7338 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7339 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7340 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7341 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7342 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7343 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7344 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7345 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7346 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7347 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7348 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7349 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
7350 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7351 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7352 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7353 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
7354 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
7355 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7356 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7357 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7358 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7359 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7360 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
7361 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
7362 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
7363 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7364 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
7365 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7366 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
7367 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7368 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7369 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7370 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7371 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7372 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7373 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
7374 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
7375 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
7376 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
7377 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
7378 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
7379 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
7380 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
7381 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7382 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
7383 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
7384 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
7385 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7386 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7387 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
7388 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
7389 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
7390 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
7391 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7392 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7393 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
7394 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7395 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7396 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
7397 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7398 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7399 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
7400 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
7401 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
7402 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7403 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7404 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
7405 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
7406 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
7407 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
7408 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
7409 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
7410 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
7411 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
7412 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
7413 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7414 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7415 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7416 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7417 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7418 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
7419 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
7420 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
7421 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
7422 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
7423 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
7424 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
7425 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
7426 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
7427 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
7428 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
7429 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
7430 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
7431 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
7432 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
7433 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
7434 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7435 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
7436 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7437 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
7438 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
7439 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
7440 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7441 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7442 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
7443 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
7444 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
7445 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7446 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7447 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
7448 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7449 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7450 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7451 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7452 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7453 SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7454 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7455 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7456 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7457 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7458 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7459 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7460 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7461 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7462 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7463 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7464 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7465 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7466 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
7467 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7468 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7469 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
7470 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
7471 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7472 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
7473 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
7474 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
7475 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
7476 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
7477 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
7478 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
7479 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
7480 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7481 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7482 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7483 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7484 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7485 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7486 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
7487 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
7488 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
7489 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
7490 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
7491 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
7494 /* Below is a quirk table taken from the old code.
7495 * Basically the device should work as is without the fixup table.
7496 * If BIOS doesn't give a proper info, enable the corresponding
7499 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7501 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
7502 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
7503 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
7504 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
7505 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
7506 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
7507 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
7508 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
7509 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
7510 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
7511 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
7512 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
7513 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
7514 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
7515 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
7516 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
7517 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
7518 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
7519 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
7520 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
7521 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
7522 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
7523 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
7524 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
7525 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
7526 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
7527 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
7528 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
7529 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
7530 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
7531 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
7532 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
7533 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
7534 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
7535 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
7536 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
7537 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
7538 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
7539 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
7544 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
7545 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
7546 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
7547 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
7548 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
7549 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
7553 static const struct hda_model_fixup alc269_fixup_models[] = {
7554 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
7555 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
7556 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
7557 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
7558 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7559 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
7560 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
7561 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
7562 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
7563 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7564 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
7565 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
7566 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
7567 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
7568 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
7569 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
7570 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
7571 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
7572 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
7573 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
7574 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
7575 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
7576 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
7577 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
7578 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
7579 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
7580 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
7581 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
7582 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
7583 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
7584 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
7585 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
7586 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
7587 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
7588 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
7589 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
7590 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
7591 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
7592 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
7593 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
7594 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
7595 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
7596 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
7597 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
7598 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
7599 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
7600 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
7601 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
7602 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
7603 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
7604 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
7605 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
7606 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
7607 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
7608 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
7609 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
7610 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
7611 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
7612 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
7613 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
7614 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
7615 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
7616 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
7617 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
7618 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
7619 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
7620 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7621 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
7622 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
7623 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
7624 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
7625 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
7626 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
7627 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
7628 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
7629 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
7630 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
7631 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
7632 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
7633 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
7634 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
7635 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
7636 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
7637 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
7638 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
7639 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
7640 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
7641 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
7642 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
7643 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
7644 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
7645 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
7646 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
7647 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
7648 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
7649 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
7650 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
7651 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
7652 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
7653 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
7654 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
7655 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
7656 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
7657 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
7658 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
7659 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
7660 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
7663 #define ALC225_STANDARD_PINS \
7666 #define ALC256_STANDARD_PINS \
7667 {0x12, 0x90a60140}, \
7668 {0x14, 0x90170110}, \
7671 #define ALC282_STANDARD_PINS \
7674 #define ALC290_STANDARD_PINS \
7677 #define ALC292_STANDARD_PINS \
7678 {0x14, 0x90170110}, \
7681 #define ALC295_STANDARD_PINS \
7682 {0x12, 0xb7a60130}, \
7683 {0x14, 0x90170110}, \
7686 #define ALC298_STANDARD_PINS \
7687 {0x12, 0x90a60130}, \
7690 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
7691 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
7696 {0x21, 0x0221102f}),
7697 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7700 {0x21, 0x02211030}),
7701 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7704 {0x21, 0x03211020}),
7705 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7708 {0x21, 0x03211020}),
7709 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7710 ALC225_STANDARD_PINS,
7712 {0x14, 0x901701a0}),
7713 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7714 ALC225_STANDARD_PINS,
7716 {0x14, 0x901701b0}),
7717 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7718 ALC225_STANDARD_PINS,
7720 {0x14, 0x901701a0}),
7721 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7722 ALC225_STANDARD_PINS,
7724 {0x14, 0x901701b0}),
7725 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7726 ALC225_STANDARD_PINS,
7728 {0x1b, 0x90170110}),
7729 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7732 {0x21, 0x02211020}),
7733 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7737 {0x21, 0x02211020}),
7738 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7743 {0x21, 0x0221101f}),
7744 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7749 {0x21, 0x0221101f}),
7750 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7754 {0x21, 0x0221101f}),
7755 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7757 {0x21, 0x02211020}),
7758 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7760 {0x21, 0x02211040}),
7761 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7764 {0x21, 0x02211020}),
7765 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7768 {0x21, 0x02211030}),
7769 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7772 {0x21, 0x0221101f}),
7773 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7776 {0x21, 0x0221101f}),
7777 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7780 {0x21, 0x0221103f}),
7781 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7784 {0x21, 0x0221103f}),
7785 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7788 {0x21, 0x0221103f}),
7789 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7792 {0x21, 0x0221105f}),
7793 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7796 {0x21, 0x0221101f}),
7797 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7801 {0x21, 0x0321102f}),
7802 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7805 {0x21, 0x02211040}),
7806 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7809 {0x21, 0x02211050}),
7810 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7813 {0x21, 0x02211030}),
7814 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7817 {0x21, 0x02211040}),
7818 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7821 {0x21, 0x02211040}),
7822 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7825 {0x21, 0x02211050}),
7826 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7829 {0x21, 0x02211040}),
7830 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7833 {0x21, 0x02211030}),
7834 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7836 {0x21, 0x02211010}),
7837 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7840 {0x21, 0x04211020}),
7841 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7844 {0x21, 0x03211020}),
7845 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7848 {0x21, 0x03211020}),
7849 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7852 {0x21, 0x04211020}),
7853 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7856 {0x21, 0x03211020}),
7857 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
7861 {0x1a, 0x04a11020}),
7862 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
7868 {0x1b, 0x02011020}),
7869 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7870 ALC282_STANDARD_PINS,
7873 {0x21, 0x0321101f}),
7874 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7875 ALC282_STANDARD_PINS,
7878 {0x21, 0x03211040}),
7879 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7880 ALC282_STANDARD_PINS,
7883 {0x21, 0x03211020}),
7884 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7885 ALC282_STANDARD_PINS,
7888 {0x21, 0x0421101f}),
7889 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
7890 ALC282_STANDARD_PINS,
7893 {0x21, 0x04211020}),
7894 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7895 ALC282_STANDARD_PINS,
7897 {0x21, 0x0321101f}),
7898 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7901 {0x21, 0x02211030}),
7902 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7903 ALC282_STANDARD_PINS,
7906 {0x21, 0x0321101f}),
7907 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7911 {0x21, 0x04211020}),
7912 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7915 {0x21, 0x02211020}),
7916 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7919 {0x21, 0x0321101f}),
7920 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7921 ALC290_STANDARD_PINS,
7924 {0x1a, 0x04a11020}),
7925 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7926 ALC290_STANDARD_PINS,
7929 {0x1a, 0x04a11020}),
7930 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7931 ALC290_STANDARD_PINS,
7933 {0x1a, 0x04a11020}),
7934 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7935 ALC290_STANDARD_PINS,
7937 {0x1a, 0x04a11040}),
7938 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7939 ALC290_STANDARD_PINS,
7942 {0x1a, 0x04a11040}),
7943 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7944 ALC290_STANDARD_PINS,
7947 {0x1a, 0x04a11020}),
7948 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7949 ALC290_STANDARD_PINS,
7952 {0x1a, 0x04a11020}),
7953 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7954 ALC292_STANDARD_PINS,
7957 {0x19, 0x01a19030}),
7958 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7959 ALC292_STANDARD_PINS,
7963 {0x19, 0x01a1903e}),
7964 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7965 ALC292_STANDARD_PINS,
7966 {0x12, 0x90a60140}),
7967 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7968 ALC292_STANDARD_PINS,
7971 {0x19, 0x21a19030}),
7972 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7973 ALC292_STANDARD_PINS,
7974 {0x13, 0x90a60140}),
7975 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
7978 {0x21, 0x04211020}),
7979 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7982 {0x21, 0x03211020}),
7983 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7986 {0x21, 0x04211020}),
7987 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7990 {0x21, 0x03211020}),
7991 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7993 {0x21, 0x04211020}),
7994 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7996 {0x21, 0x04211030}),
7997 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7998 ALC295_STANDARD_PINS,
8000 {0x18, 0x21a19030}),
8001 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8002 ALC295_STANDARD_PINS,
8004 {0x18, 0x21a19050}),
8005 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8006 ALC295_STANDARD_PINS),
8007 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8008 ALC298_STANDARD_PINS,
8009 {0x17, 0x90170110}),
8010 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8011 ALC298_STANDARD_PINS,
8012 {0x17, 0x90170140}),
8013 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8014 ALC298_STANDARD_PINS,
8015 {0x17, 0x90170150}),
8016 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
8021 {0x21, 0x03211030}),
8022 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
8026 {0x21, 0x03211020}),
8027 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8028 ALC225_STANDARD_PINS,
8030 {0x17, 0x90170110}),
8034 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
8035 * more machines, don't need to match all valid pins, just need to match
8036 * all the pins defined in the tbl. Just because of this reason, it is possible
8037 * that a single machine matches multiple tbls, so there is one limitation:
8038 * at most one tbl is allowed to define for the same vendor and same codec
8040 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
8041 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8043 {0x1b, 0x40000000}),
8044 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8046 {0x1a, 0x40000000}),
8047 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8049 {0x1a, 0x40000000}),
8050 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
8052 {0x1a, 0x40000000}),
8056 static void alc269_fill_coef(struct hda_codec *codec)
8058 struct alc_spec *spec = codec->spec;
8061 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
8064 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
8065 alc_write_coef_idx(codec, 0xf, 0x960b);
8066 alc_write_coef_idx(codec, 0xe, 0x8817);
8069 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
8070 alc_write_coef_idx(codec, 0xf, 0x960b);
8071 alc_write_coef_idx(codec, 0xe, 0x8814);
8074 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
8075 /* Power up output pin */
8076 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
8079 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
8080 val = alc_read_coef_idx(codec, 0xd);
8081 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
8082 /* Capless ramp up clock control */
8083 alc_write_coef_idx(codec, 0xd, val | (1<<10));
8085 val = alc_read_coef_idx(codec, 0x17);
8086 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
8087 /* Class D power on reset */
8088 alc_write_coef_idx(codec, 0x17, val | (1<<7));
8093 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
8098 static int patch_alc269(struct hda_codec *codec)
8100 struct alc_spec *spec;
8103 err = alc_alloc_spec(codec, 0x0b);
8108 spec->gen.shared_mic_vref_pin = 0x18;
8109 codec->power_save_node = 0;
8112 codec->patch_ops.suspend = alc269_suspend;
8113 codec->patch_ops.resume = alc269_resume;
8115 spec->shutup = alc_default_shutup;
8116 spec->init_hook = alc_default_init;
8118 switch (codec->core.vendor_id) {
8120 spec->codec_variant = ALC269_TYPE_ALC269VA;
8121 switch (alc_get_coef0(codec) & 0x00f0) {
8123 if (codec->bus->pci &&
8124 codec->bus->pci->subsystem_vendor == 0x1025 &&
8125 spec->cdefine.platform_type == 1)
8126 err = alc_codec_rename(codec, "ALC271X");
8127 spec->codec_variant = ALC269_TYPE_ALC269VB;
8130 if (codec->bus->pci &&
8131 codec->bus->pci->subsystem_vendor == 0x17aa &&
8132 codec->bus->pci->subsystem_device == 0x21f3)
8133 err = alc_codec_rename(codec, "ALC3202");
8134 spec->codec_variant = ALC269_TYPE_ALC269VC;
8137 spec->codec_variant = ALC269_TYPE_ALC269VD;
8140 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8144 spec->shutup = alc269_shutup;
8145 spec->init_hook = alc269_fill_coef;
8146 alc269_fill_coef(codec);
8151 spec->codec_variant = ALC269_TYPE_ALC280;
8154 spec->codec_variant = ALC269_TYPE_ALC282;
8155 spec->shutup = alc282_shutup;
8156 spec->init_hook = alc282_init;
8160 spec->codec_variant = ALC269_TYPE_ALC283;
8161 spec->shutup = alc283_shutup;
8162 spec->init_hook = alc283_init;
8166 spec->codec_variant = ALC269_TYPE_ALC284;
8169 spec->codec_variant = ALC269_TYPE_ALC293;
8173 spec->codec_variant = ALC269_TYPE_ALC286;
8176 spec->codec_variant = ALC269_TYPE_ALC298;
8180 spec->codec_variant = ALC269_TYPE_ALC255;
8181 spec->shutup = alc256_shutup;
8182 spec->init_hook = alc256_init;
8186 spec->codec_variant = ALC269_TYPE_ALC256;
8187 spec->shutup = alc256_shutup;
8188 spec->init_hook = alc256_init;
8189 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
8192 spec->codec_variant = ALC269_TYPE_ALC257;
8193 spec->shutup = alc256_shutup;
8194 spec->init_hook = alc256_init;
8195 spec->gen.mixer_nid = 0;
8200 spec->codec_variant = ALC269_TYPE_ALC215;
8201 spec->shutup = alc225_shutup;
8202 spec->init_hook = alc225_init;
8203 spec->gen.mixer_nid = 0;
8206 codec->power_save_node = 1;
8210 spec->codec_variant = ALC269_TYPE_ALC225;
8211 spec->shutup = alc225_shutup;
8212 spec->init_hook = alc225_init;
8213 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
8218 spec->codec_variant = ALC269_TYPE_ALC294;
8219 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
8220 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
8221 spec->init_hook = alc294_init;
8224 spec->codec_variant = ALC269_TYPE_ALC300;
8225 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
8228 spec->codec_variant = ALC269_TYPE_ALC623;
8234 spec->codec_variant = ALC269_TYPE_ALC700;
8235 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
8236 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
8237 spec->init_hook = alc294_init;
8242 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
8243 spec->has_alc5505_dsp = 1;
8244 spec->init_hook = alc5505_dsp_init;
8247 alc_pre_init(codec);
8249 snd_hda_pick_fixup(codec, alc269_fixup_models,
8250 alc269_fixup_tbl, alc269_fixups);
8251 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
8252 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
8253 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
8255 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8257 alc_auto_parse_customize_define(codec);
8259 if (has_cdefine_beep(codec))
8260 spec->gen.beep_nid = 0x01;
8262 /* automatic parse from the BIOS config */
8263 err = alc269_parse_auto_config(codec);
8267 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
8268 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
8273 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8286 static int alc861_parse_auto_config(struct hda_codec *codec)
8288 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
8289 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
8290 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
8293 /* Pin config fixes */
8295 ALC861_FIXUP_FSC_AMILO_PI1505,
8296 ALC861_FIXUP_AMP_VREF_0F,
8297 ALC861_FIXUP_NO_JACK_DETECT,
8298 ALC861_FIXUP_ASUS_A6RP,
8299 ALC660_FIXUP_ASUS_W7J,
8302 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
8303 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
8304 const struct hda_fixup *fix, int action)
8306 struct alc_spec *spec = codec->spec;
8309 if (action != HDA_FIXUP_ACT_INIT)
8311 val = snd_hda_codec_get_pin_target(codec, 0x0f);
8312 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
8313 val |= AC_PINCTL_IN_EN;
8314 val |= AC_PINCTL_VREF_50;
8315 snd_hda_set_pin_ctl(codec, 0x0f, val);
8316 spec->gen.keep_vref_in_automute = 1;
8319 /* suppress the jack-detection */
8320 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
8321 const struct hda_fixup *fix, int action)
8323 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8324 codec->no_jack_detect = 1;
8327 static const struct hda_fixup alc861_fixups[] = {
8328 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
8329 .type = HDA_FIXUP_PINS,
8330 .v.pins = (const struct hda_pintbl[]) {
8331 { 0x0b, 0x0221101f }, /* HP */
8332 { 0x0f, 0x90170310 }, /* speaker */
8336 [ALC861_FIXUP_AMP_VREF_0F] = {
8337 .type = HDA_FIXUP_FUNC,
8338 .v.func = alc861_fixup_asus_amp_vref_0f,
8340 [ALC861_FIXUP_NO_JACK_DETECT] = {
8341 .type = HDA_FIXUP_FUNC,
8342 .v.func = alc_fixup_no_jack_detect,
8344 [ALC861_FIXUP_ASUS_A6RP] = {
8345 .type = HDA_FIXUP_FUNC,
8346 .v.func = alc861_fixup_asus_amp_vref_0f,
8348 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
8350 [ALC660_FIXUP_ASUS_W7J] = {
8351 .type = HDA_FIXUP_VERBS,
8352 .v.verbs = (const struct hda_verb[]) {
8353 /* ASUS W7J needs a magic pin setup on unused NID 0x10
8354 * for enabling outputs
8356 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
8362 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
8363 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
8364 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
8365 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
8366 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
8367 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
8368 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F),
8369 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F),
8370 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
8376 static int patch_alc861(struct hda_codec *codec)
8378 struct alc_spec *spec;
8381 err = alc_alloc_spec(codec, 0x15);
8386 if (has_cdefine_beep(codec))
8387 spec->gen.beep_nid = 0x23;
8390 spec->power_hook = alc_power_eapd;
8393 alc_pre_init(codec);
8395 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
8396 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8398 /* automatic parse from the BIOS config */
8399 err = alc861_parse_auto_config(codec);
8403 if (!spec->gen.no_analog) {
8404 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
8409 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8423 * In addition, an independent DAC
8425 static int alc861vd_parse_auto_config(struct hda_codec *codec)
8427 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
8428 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8429 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
8433 ALC660VD_FIX_ASUS_GPIO1,
8434 ALC861VD_FIX_DALLAS,
8437 /* exclude VREF80 */
8438 static void alc861vd_fixup_dallas(struct hda_codec *codec,
8439 const struct hda_fixup *fix, int action)
8441 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8442 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
8443 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8448 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
8449 const struct hda_fixup *fix, int action)
8451 struct alc_spec *spec = codec->spec;
8453 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8454 spec->gpio_mask |= 0x02;
8455 alc_fixup_gpio(codec, action, 0x01);
8458 static const struct hda_fixup alc861vd_fixups[] = {
8459 [ALC660VD_FIX_ASUS_GPIO1] = {
8460 .type = HDA_FIXUP_FUNC,
8461 .v.func = alc660vd_fixup_asus_gpio1,
8463 [ALC861VD_FIX_DALLAS] = {
8464 .type = HDA_FIXUP_FUNC,
8465 .v.func = alc861vd_fixup_dallas,
8469 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8470 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
8471 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8472 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
8478 static int patch_alc861vd(struct hda_codec *codec)
8480 struct alc_spec *spec;
8483 err = alc_alloc_spec(codec, 0x0b);
8488 if (has_cdefine_beep(codec))
8489 spec->gen.beep_nid = 0x23;
8491 spec->shutup = alc_eapd_shutup;
8493 alc_pre_init(codec);
8495 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
8496 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8498 /* automatic parse from the BIOS config */
8499 err = alc861vd_parse_auto_config(codec);
8503 if (!spec->gen.no_analog) {
8504 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
8509 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8521 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8522 * configuration. Each pin widget can choose any input DACs and a mixer.
8523 * Each ADC is connected from a mixer of all inputs. This makes possible
8524 * 6-channel independent captures.
8526 * In addition, an independent DAC for the multi-playback (not used in this
8531 * BIOS auto configuration
8534 static int alc662_parse_auto_config(struct hda_codec *codec)
8536 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
8537 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
8538 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8539 const hda_nid_t *ssids;
8541 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
8542 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
8543 codec->core.vendor_id == 0x10ec0671)
8544 ssids = alc663_ssids;
8546 ssids = alc662_ssids;
8547 return alc_parse_auto_config(codec, alc662_ignore, ssids);
8550 static void alc272_fixup_mario(struct hda_codec *codec,
8551 const struct hda_fixup *fix, int action)
8553 if (action != HDA_FIXUP_ACT_PRE_PROBE)
8555 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
8556 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
8557 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
8558 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
8559 (0 << AC_AMPCAP_MUTE_SHIFT)))
8560 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
8563 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
8565 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
8567 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
8568 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
8572 /* override the 2.1 chmap */
8573 static void alc_fixup_bass_chmap(struct hda_codec *codec,
8574 const struct hda_fixup *fix, int action)
8576 if (action == HDA_FIXUP_ACT_BUILD) {
8577 struct alc_spec *spec = codec->spec;
8578 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8582 /* avoid D3 for keeping GPIO up */
8583 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
8585 unsigned int power_state)
8587 struct alc_spec *spec = codec->spec;
8588 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
8593 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
8594 const struct hda_fixup *fix, int action)
8596 struct alc_spec *spec = codec->spec;
8598 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
8599 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8600 spec->mute_led_polarity = 1;
8601 codec->power_filter = gpio_led_power_filter;
8605 static void alc662_usi_automute_hook(struct hda_codec *codec,
8606 struct hda_jack_callback *jack)
8608 struct alc_spec *spec = codec->spec;
8611 snd_hda_gen_hp_automute(codec, jack);
8613 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
8615 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
8619 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
8620 const struct hda_fixup *fix, int action)
8622 struct alc_spec *spec = codec->spec;
8623 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8624 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8625 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
8629 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
8630 struct hda_jack_callback *cb)
8632 /* surround speakers at 0x1b already get muted automatically when
8633 * headphones are plugged in, but we have to mute/unmute the remaining
8634 * channels manually:
8635 * 0x15 - front left/front right
8636 * 0x18 - front center/ LFE
8638 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
8639 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
8640 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
8642 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
8643 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
8647 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
8648 const struct hda_fixup *fix, int action)
8650 /* Pin 0x1b: shared headphones jack and surround speakers */
8651 if (!is_jack_detectable(codec, 0x1b))
8655 case HDA_FIXUP_ACT_PRE_PROBE:
8656 snd_hda_jack_detect_enable_callback(codec, 0x1b,
8657 alc662_aspire_ethos_mute_speakers);
8658 /* subwoofer needs an extra GPIO setting to become audible */
8659 alc_setup_gpio(codec, 0x02);
8661 case HDA_FIXUP_ACT_INIT:
8662 /* Make sure to start in a correct state, i.e. if
8663 * headphones have been plugged in before powering up the system
8665 alc662_aspire_ethos_mute_speakers(codec, NULL);
8670 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
8671 const struct hda_fixup *fix, int action)
8673 struct alc_spec *spec = codec->spec;
8675 static const struct hda_pintbl pincfgs[] = {
8676 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
8677 { 0x1b, 0x0181304f },
8682 case HDA_FIXUP_ACT_PRE_PROBE:
8683 spec->gen.mixer_nid = 0;
8684 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8685 snd_hda_apply_pincfgs(codec, pincfgs);
8687 case HDA_FIXUP_ACT_INIT:
8688 alc_write_coef_idx(codec, 0x19, 0xa054);
8693 static const struct coef_fw alc668_coefs[] = {
8694 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
8695 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
8696 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
8697 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
8698 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
8699 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
8700 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
8701 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
8702 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
8703 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
8704 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
8705 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8706 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8707 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8708 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8709 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8710 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8711 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8712 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8713 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8717 static void alc668_restore_default_value(struct hda_codec *codec)
8719 alc_process_coef_fw(codec, alc668_coefs);
8723 ALC662_FIXUP_ASPIRE,
8724 ALC662_FIXUP_LED_GPIO1,
8725 ALC662_FIXUP_IDEAPAD,
8727 ALC662_FIXUP_CZC_P10T,
8728 ALC662_FIXUP_SKU_IGNORE,
8729 ALC662_FIXUP_HP_RP5800,
8730 ALC662_FIXUP_ASUS_MODE1,
8731 ALC662_FIXUP_ASUS_MODE2,
8732 ALC662_FIXUP_ASUS_MODE3,
8733 ALC662_FIXUP_ASUS_MODE4,
8734 ALC662_FIXUP_ASUS_MODE5,
8735 ALC662_FIXUP_ASUS_MODE6,
8736 ALC662_FIXUP_ASUS_MODE7,
8737 ALC662_FIXUP_ASUS_MODE8,
8738 ALC662_FIXUP_NO_JACK_DETECT,
8739 ALC662_FIXUP_ZOTAC_Z68,
8740 ALC662_FIXUP_INV_DMIC,
8741 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8742 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
8743 ALC662_FIXUP_HEADSET_MODE,
8744 ALC668_FIXUP_HEADSET_MODE,
8745 ALC662_FIXUP_BASS_MODE4_CHMAP,
8746 ALC662_FIXUP_BASS_16,
8747 ALC662_FIXUP_BASS_1A,
8748 ALC662_FIXUP_BASS_CHMAP,
8749 ALC668_FIXUP_AUTO_MUTE,
8750 ALC668_FIXUP_DELL_DISABLE_AAMIX,
8751 ALC668_FIXUP_DELL_XPS13,
8752 ALC662_FIXUP_ASUS_Nx50,
8753 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8754 ALC668_FIXUP_ASUS_Nx51,
8755 ALC668_FIXUP_MIC_COEF,
8756 ALC668_FIXUP_ASUS_G751,
8757 ALC891_FIXUP_HEADSET_MODE,
8758 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8759 ALC662_FIXUP_ACER_VERITON,
8760 ALC892_FIXUP_ASROCK_MOBO,
8761 ALC662_FIXUP_USI_FUNC,
8762 ALC662_FIXUP_USI_HEADSET_MODE,
8763 ALC662_FIXUP_LENOVO_MULTI_CODECS,
8764 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
8765 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
8766 ALC671_FIXUP_HP_HEADSET_MIC2,
8767 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
8768 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
8771 static const struct hda_fixup alc662_fixups[] = {
8772 [ALC662_FIXUP_ASPIRE] = {
8773 .type = HDA_FIXUP_PINS,
8774 .v.pins = (const struct hda_pintbl[]) {
8775 { 0x15, 0x99130112 }, /* subwoofer */
8779 [ALC662_FIXUP_LED_GPIO1] = {
8780 .type = HDA_FIXUP_FUNC,
8781 .v.func = alc662_fixup_led_gpio1,
8783 [ALC662_FIXUP_IDEAPAD] = {
8784 .type = HDA_FIXUP_PINS,
8785 .v.pins = (const struct hda_pintbl[]) {
8786 { 0x17, 0x99130112 }, /* subwoofer */
8790 .chain_id = ALC662_FIXUP_LED_GPIO1,
8792 [ALC272_FIXUP_MARIO] = {
8793 .type = HDA_FIXUP_FUNC,
8794 .v.func = alc272_fixup_mario,
8796 [ALC662_FIXUP_CZC_P10T] = {
8797 .type = HDA_FIXUP_VERBS,
8798 .v.verbs = (const struct hda_verb[]) {
8799 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
8803 [ALC662_FIXUP_SKU_IGNORE] = {
8804 .type = HDA_FIXUP_FUNC,
8805 .v.func = alc_fixup_sku_ignore,
8807 [ALC662_FIXUP_HP_RP5800] = {
8808 .type = HDA_FIXUP_PINS,
8809 .v.pins = (const struct hda_pintbl[]) {
8810 { 0x14, 0x0221201f }, /* HP out */
8814 .chain_id = ALC662_FIXUP_SKU_IGNORE
8816 [ALC662_FIXUP_ASUS_MODE1] = {
8817 .type = HDA_FIXUP_PINS,
8818 .v.pins = (const struct hda_pintbl[]) {
8819 { 0x14, 0x99130110 }, /* speaker */
8820 { 0x18, 0x01a19c20 }, /* mic */
8821 { 0x19, 0x99a3092f }, /* int-mic */
8822 { 0x21, 0x0121401f }, /* HP out */
8826 .chain_id = ALC662_FIXUP_SKU_IGNORE
8828 [ALC662_FIXUP_ASUS_MODE2] = {
8829 .type = HDA_FIXUP_PINS,
8830 .v.pins = (const struct hda_pintbl[]) {
8831 { 0x14, 0x99130110 }, /* speaker */
8832 { 0x18, 0x01a19820 }, /* mic */
8833 { 0x19, 0x99a3092f }, /* int-mic */
8834 { 0x1b, 0x0121401f }, /* HP out */
8838 .chain_id = ALC662_FIXUP_SKU_IGNORE
8840 [ALC662_FIXUP_ASUS_MODE3] = {
8841 .type = HDA_FIXUP_PINS,
8842 .v.pins = (const struct hda_pintbl[]) {
8843 { 0x14, 0x99130110 }, /* speaker */
8844 { 0x15, 0x0121441f }, /* HP */
8845 { 0x18, 0x01a19840 }, /* mic */
8846 { 0x19, 0x99a3094f }, /* int-mic */
8847 { 0x21, 0x01211420 }, /* HP2 */
8851 .chain_id = ALC662_FIXUP_SKU_IGNORE
8853 [ALC662_FIXUP_ASUS_MODE4] = {
8854 .type = HDA_FIXUP_PINS,
8855 .v.pins = (const struct hda_pintbl[]) {
8856 { 0x14, 0x99130110 }, /* speaker */
8857 { 0x16, 0x99130111 }, /* speaker */
8858 { 0x18, 0x01a19840 }, /* mic */
8859 { 0x19, 0x99a3094f }, /* int-mic */
8860 { 0x21, 0x0121441f }, /* HP */
8864 .chain_id = ALC662_FIXUP_SKU_IGNORE
8866 [ALC662_FIXUP_ASUS_MODE5] = {
8867 .type = HDA_FIXUP_PINS,
8868 .v.pins = (const struct hda_pintbl[]) {
8869 { 0x14, 0x99130110 }, /* speaker */
8870 { 0x15, 0x0121441f }, /* HP */
8871 { 0x16, 0x99130111 }, /* speaker */
8872 { 0x18, 0x01a19840 }, /* mic */
8873 { 0x19, 0x99a3094f }, /* int-mic */
8877 .chain_id = ALC662_FIXUP_SKU_IGNORE
8879 [ALC662_FIXUP_ASUS_MODE6] = {
8880 .type = HDA_FIXUP_PINS,
8881 .v.pins = (const struct hda_pintbl[]) {
8882 { 0x14, 0x99130110 }, /* speaker */
8883 { 0x15, 0x01211420 }, /* HP2 */
8884 { 0x18, 0x01a19840 }, /* mic */
8885 { 0x19, 0x99a3094f }, /* int-mic */
8886 { 0x1b, 0x0121441f }, /* HP */
8890 .chain_id = ALC662_FIXUP_SKU_IGNORE
8892 [ALC662_FIXUP_ASUS_MODE7] = {
8893 .type = HDA_FIXUP_PINS,
8894 .v.pins = (const struct hda_pintbl[]) {
8895 { 0x14, 0x99130110 }, /* speaker */
8896 { 0x17, 0x99130111 }, /* speaker */
8897 { 0x18, 0x01a19840 }, /* mic */
8898 { 0x19, 0x99a3094f }, /* int-mic */
8899 { 0x1b, 0x01214020 }, /* HP */
8900 { 0x21, 0x0121401f }, /* HP */
8904 .chain_id = ALC662_FIXUP_SKU_IGNORE
8906 [ALC662_FIXUP_ASUS_MODE8] = {
8907 .type = HDA_FIXUP_PINS,
8908 .v.pins = (const struct hda_pintbl[]) {
8909 { 0x14, 0x99130110 }, /* speaker */
8910 { 0x12, 0x99a30970 }, /* int-mic */
8911 { 0x15, 0x01214020 }, /* HP */
8912 { 0x17, 0x99130111 }, /* speaker */
8913 { 0x18, 0x01a19840 }, /* mic */
8914 { 0x21, 0x0121401f }, /* HP */
8918 .chain_id = ALC662_FIXUP_SKU_IGNORE
8920 [ALC662_FIXUP_NO_JACK_DETECT] = {
8921 .type = HDA_FIXUP_FUNC,
8922 .v.func = alc_fixup_no_jack_detect,
8924 [ALC662_FIXUP_ZOTAC_Z68] = {
8925 .type = HDA_FIXUP_PINS,
8926 .v.pins = (const struct hda_pintbl[]) {
8927 { 0x1b, 0x02214020 }, /* Front HP */
8931 [ALC662_FIXUP_INV_DMIC] = {
8932 .type = HDA_FIXUP_FUNC,
8933 .v.func = alc_fixup_inv_dmic,
8935 [ALC668_FIXUP_DELL_XPS13] = {
8936 .type = HDA_FIXUP_FUNC,
8937 .v.func = alc_fixup_dell_xps13,
8939 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
8941 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
8942 .type = HDA_FIXUP_FUNC,
8943 .v.func = alc_fixup_disable_aamix,
8945 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8947 [ALC668_FIXUP_AUTO_MUTE] = {
8948 .type = HDA_FIXUP_FUNC,
8949 .v.func = alc_fixup_auto_mute_via_amp,
8951 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8953 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
8954 .type = HDA_FIXUP_PINS,
8955 .v.pins = (const struct hda_pintbl[]) {
8956 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8957 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8961 .chain_id = ALC662_FIXUP_HEADSET_MODE
8963 [ALC662_FIXUP_HEADSET_MODE] = {
8964 .type = HDA_FIXUP_FUNC,
8965 .v.func = alc_fixup_headset_mode_alc662,
8967 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
8968 .type = HDA_FIXUP_PINS,
8969 .v.pins = (const struct hda_pintbl[]) {
8970 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8971 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8975 .chain_id = ALC668_FIXUP_HEADSET_MODE
8977 [ALC668_FIXUP_HEADSET_MODE] = {
8978 .type = HDA_FIXUP_FUNC,
8979 .v.func = alc_fixup_headset_mode_alc668,
8981 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8982 .type = HDA_FIXUP_FUNC,
8983 .v.func = alc_fixup_bass_chmap,
8985 .chain_id = ALC662_FIXUP_ASUS_MODE4
8987 [ALC662_FIXUP_BASS_16] = {
8988 .type = HDA_FIXUP_PINS,
8989 .v.pins = (const struct hda_pintbl[]) {
8990 {0x16, 0x80106111}, /* bass speaker */
8994 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8996 [ALC662_FIXUP_BASS_1A] = {
8997 .type = HDA_FIXUP_PINS,
8998 .v.pins = (const struct hda_pintbl[]) {
8999 {0x1a, 0x80106111}, /* bass speaker */
9003 .chain_id = ALC662_FIXUP_BASS_CHMAP,
9005 [ALC662_FIXUP_BASS_CHMAP] = {
9006 .type = HDA_FIXUP_FUNC,
9007 .v.func = alc_fixup_bass_chmap,
9009 [ALC662_FIXUP_ASUS_Nx50] = {
9010 .type = HDA_FIXUP_FUNC,
9011 .v.func = alc_fixup_auto_mute_via_amp,
9013 .chain_id = ALC662_FIXUP_BASS_1A
9015 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
9016 .type = HDA_FIXUP_FUNC,
9017 .v.func = alc_fixup_headset_mode_alc668,
9018 .chain_id = ALC662_FIXUP_BASS_CHMAP
9020 [ALC668_FIXUP_ASUS_Nx51] = {
9021 .type = HDA_FIXUP_PINS,
9022 .v.pins = (const struct hda_pintbl[]) {
9023 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9024 { 0x1a, 0x90170151 }, /* bass speaker */
9025 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9029 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9031 [ALC668_FIXUP_MIC_COEF] = {
9032 .type = HDA_FIXUP_VERBS,
9033 .v.verbs = (const struct hda_verb[]) {
9034 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
9035 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
9039 [ALC668_FIXUP_ASUS_G751] = {
9040 .type = HDA_FIXUP_PINS,
9041 .v.pins = (const struct hda_pintbl[]) {
9042 { 0x16, 0x0421101f }, /* HP */
9046 .chain_id = ALC668_FIXUP_MIC_COEF
9048 [ALC891_FIXUP_HEADSET_MODE] = {
9049 .type = HDA_FIXUP_FUNC,
9050 .v.func = alc_fixup_headset_mode,
9052 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
9053 .type = HDA_FIXUP_PINS,
9054 .v.pins = (const struct hda_pintbl[]) {
9055 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9056 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9060 .chain_id = ALC891_FIXUP_HEADSET_MODE
9062 [ALC662_FIXUP_ACER_VERITON] = {
9063 .type = HDA_FIXUP_PINS,
9064 .v.pins = (const struct hda_pintbl[]) {
9065 { 0x15, 0x50170120 }, /* no internal speaker */
9069 [ALC892_FIXUP_ASROCK_MOBO] = {
9070 .type = HDA_FIXUP_PINS,
9071 .v.pins = (const struct hda_pintbl[]) {
9072 { 0x15, 0x40f000f0 }, /* disabled */
9073 { 0x16, 0x40f000f0 }, /* disabled */
9077 [ALC662_FIXUP_USI_FUNC] = {
9078 .type = HDA_FIXUP_FUNC,
9079 .v.func = alc662_fixup_usi_headset_mic,
9081 [ALC662_FIXUP_USI_HEADSET_MODE] = {
9082 .type = HDA_FIXUP_PINS,
9083 .v.pins = (const struct hda_pintbl[]) {
9084 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
9085 { 0x18, 0x01a1903d },
9089 .chain_id = ALC662_FIXUP_USI_FUNC
9091 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
9092 .type = HDA_FIXUP_FUNC,
9093 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
9095 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
9096 .type = HDA_FIXUP_FUNC,
9097 .v.func = alc662_fixup_aspire_ethos_hp,
9099 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
9100 .type = HDA_FIXUP_PINS,
9101 .v.pins = (const struct hda_pintbl[]) {
9102 { 0x15, 0x92130110 }, /* front speakers */
9103 { 0x18, 0x99130111 }, /* center/subwoofer */
9104 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
9108 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
9110 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
9111 .type = HDA_FIXUP_FUNC,
9112 .v.func = alc671_fixup_hp_headset_mic2,
9114 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
9115 .type = HDA_FIXUP_PINS,
9116 .v.pins = (const struct hda_pintbl[]) {
9117 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9121 .chain_id = ALC662_FIXUP_USI_FUNC
9123 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
9124 .type = HDA_FIXUP_PINS,
9125 .v.pins = (const struct hda_pintbl[]) {
9126 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
9127 { 0x1b, 0x0221144f },
9131 .chain_id = ALC662_FIXUP_USI_FUNC
9135 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
9136 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
9137 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
9138 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
9139 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
9140 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
9141 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
9142 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
9143 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9144 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
9145 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
9146 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9147 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9148 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
9149 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
9150 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
9151 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9152 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9153 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9154 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9155 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9156 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
9157 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
9158 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9159 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
9160 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
9161 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9162 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9163 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
9164 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
9165 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
9166 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
9167 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
9168 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9169 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
9170 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
9171 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
9172 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
9173 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
9174 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
9175 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
9176 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
9177 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9178 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
9179 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
9180 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
9183 /* Below is a quirk table taken from the old code.
9184 * Basically the device should work as is without the fixup table.
9185 * If BIOS doesn't give a proper info, enable the corresponding
9188 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
9189 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
9190 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
9191 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
9192 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9193 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9194 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9195 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
9196 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
9197 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9198 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
9199 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
9200 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
9201 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
9202 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
9203 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9204 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
9205 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
9206 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9207 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9208 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9209 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9210 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
9211 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
9212 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
9213 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9214 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
9215 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9216 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9217 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
9218 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9219 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9220 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
9221 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
9222 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
9223 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
9224 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
9225 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
9226 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
9227 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9228 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
9229 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
9230 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9231 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
9232 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
9233 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
9234 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
9235 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
9236 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9237 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
9242 static const struct hda_model_fixup alc662_fixup_models[] = {
9243 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
9244 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
9245 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
9246 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
9247 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
9248 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
9249 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
9250 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
9251 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
9252 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
9253 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
9254 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
9255 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
9256 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
9257 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
9258 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9259 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
9260 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
9261 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
9262 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
9263 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
9264 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
9265 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
9266 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
9267 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
9268 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
9269 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
9270 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
9271 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
9272 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
9273 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9274 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
9278 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
9279 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9283 {0x21, 0x01014020}),
9284 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9288 {0x21, 0x01014020}),
9289 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9293 {0x1b, 0x0221401f}),
9294 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9298 {0x16, 0x03011020}),
9299 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9303 {0x16, 0x03011020}),
9304 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9308 {0x16, 0x03011020}),
9309 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9312 {0x16, 0x03011020}),
9313 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
9316 {0x15, 0x0321101f}),
9317 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9322 {0x21, 0x02211020}),
9323 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9327 {0x21, 0x02211020}),
9328 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9333 {0x21, 0x02211030}),
9339 static int patch_alc662(struct hda_codec *codec)
9341 struct alc_spec *spec;
9344 err = alc_alloc_spec(codec, 0x0b);
9350 spec->shutup = alc_eapd_shutup;
9352 /* handle multiple HPs as is */
9353 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
9355 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9357 switch (codec->core.vendor_id) {
9359 spec->init_hook = alc668_restore_default_value;
9363 alc_pre_init(codec);
9365 snd_hda_pick_fixup(codec, alc662_fixup_models,
9366 alc662_fixup_tbl, alc662_fixups);
9367 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
9368 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9370 alc_auto_parse_customize_define(codec);
9372 if (has_cdefine_beep(codec))
9373 spec->gen.beep_nid = 0x01;
9375 if ((alc_get_coef0(codec) & (1 << 14)) &&
9376 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
9377 spec->cdefine.platform_type == 1) {
9378 err = alc_codec_rename(codec, "ALC272X");
9383 /* automatic parse from the BIOS config */
9384 err = alc662_parse_auto_config(codec);
9388 if (!spec->gen.no_analog && spec->gen.beep_nid) {
9389 switch (codec->core.vendor_id) {
9391 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9397 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
9400 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
9407 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9420 static int alc680_parse_auto_config(struct hda_codec *codec)
9422 return alc_parse_auto_config(codec, NULL, NULL);
9427 static int patch_alc680(struct hda_codec *codec)
9431 /* ALC680 has no aa-loopback mixer */
9432 err = alc_alloc_spec(codec, 0);
9436 /* automatic parse from the BIOS config */
9437 err = alc680_parse_auto_config(codec);
9449 static const struct hda_device_id snd_hda_id_realtek[] = {
9450 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
9451 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
9452 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
9453 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
9454 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
9455 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
9456 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
9457 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
9458 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
9459 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
9460 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
9461 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
9462 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
9463 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
9464 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
9465 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
9466 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
9467 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
9468 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
9469 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
9470 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
9471 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
9472 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
9473 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
9474 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
9475 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
9476 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
9477 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
9478 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
9479 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
9480 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
9481 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
9482 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
9483 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
9484 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
9485 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
9486 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
9487 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
9488 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
9489 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
9490 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
9491 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
9492 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
9493 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
9494 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
9495 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
9496 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
9497 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
9498 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
9499 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
9500 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
9501 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
9502 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
9503 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
9504 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
9505 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
9506 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
9507 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
9508 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
9509 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
9510 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
9511 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
9512 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
9513 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
9514 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
9515 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
9516 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
9517 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
9518 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
9519 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
9520 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
9521 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
9522 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
9523 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
9526 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
9528 MODULE_LICENSE("GPL");
9529 MODULE_DESCRIPTION("Realtek HD-audio codec");
9531 static struct hda_codec_driver realtek_driver = {
9532 .id = snd_hda_id_realtek,
9535 module_hda_codec_driver(realtek_driver);