1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN,
41 ALC_HEADSET_MODE_UNPLUGGED,
42 ALC_HEADSET_MODE_HEADSET,
44 ALC_HEADSET_MODE_HEADPHONE,
48 ALC_HEADSET_TYPE_UNKNOWN,
49 ALC_HEADSET_TYPE_CTIA,
50 ALC_HEADSET_TYPE_OMTP,
54 ALC_KEY_MICMUTE_INDEX,
57 struct alc_customize_define {
59 unsigned char port_connectivity;
60 unsigned char check_sum;
61 unsigned char customization;
62 unsigned char external_amp;
63 unsigned int enable_pcbeep:1;
64 unsigned int platform_type:1;
66 unsigned int override:1;
67 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
71 struct hda_gen_spec gen; /* must be at head */
73 /* codec parameterization */
74 struct alc_customize_define cdefine;
75 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
78 unsigned int gpio_mask;
79 unsigned int gpio_dir;
80 unsigned int gpio_data;
81 bool gpio_write_delay; /* add a delay before writing gpio_data */
83 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
84 int mute_led_polarity;
85 int micmute_led_polarity;
86 hda_nid_t mute_led_nid;
87 hda_nid_t cap_mute_led_nid;
89 unsigned int gpio_mute_led_mask;
90 unsigned int gpio_mic_led_mask;
91 unsigned int mute_led_coef_idx;
92 unsigned int mute_led_coefbit_mask;
93 unsigned int mute_led_coefbit_on;
94 unsigned int mute_led_coefbit_off;
95 unsigned int mic_led_coef_idx;
96 unsigned int mic_led_coefbit_mask;
97 unsigned int mic_led_coefbit_on;
98 unsigned int mic_led_coefbit_off;
100 hda_nid_t headset_mic_pin;
101 hda_nid_t headphone_mic_pin;
102 int current_headset_mode;
103 int current_headset_type;
106 void (*init_hook)(struct hda_codec *codec);
108 void (*power_hook)(struct hda_codec *codec);
110 void (*shutup)(struct hda_codec *codec);
111 void (*reboot_notify)(struct hda_codec *codec);
114 int codec_variant; /* flag for other variants */
115 unsigned int has_alc5505_dsp:1;
116 unsigned int no_depop_delay:1;
117 unsigned int done_hp_init:1;
118 unsigned int no_shutup_pins:1;
119 unsigned int ultra_low_power:1;
120 unsigned int has_hs_key:1;
124 unsigned int pll_coef_idx, pll_coef_bit;
126 struct input_dev *kb_dev;
127 u8 alc_mute_keycode_map[1];
131 * COEF access helper functions
134 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
135 unsigned int coef_idx)
139 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
140 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
144 #define alc_read_coef_idx(codec, coef_idx) \
145 alc_read_coefex_idx(codec, 0x20, coef_idx)
147 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
148 unsigned int coef_idx, unsigned int coef_val)
150 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
151 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
154 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
155 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
157 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
158 unsigned int coef_idx, unsigned int mask,
159 unsigned int bits_set)
161 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
164 alc_write_coefex_idx(codec, nid, coef_idx,
165 (val & ~mask) | bits_set);
168 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
169 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
171 /* a special bypass for COEF 0; read the cached value at the second time */
172 static unsigned int alc_get_coef0(struct hda_codec *codec)
174 struct alc_spec *spec = codec->spec;
177 spec->coef0 = alc_read_coef_idx(codec, 0);
181 /* coef writes/updates batch */
189 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
190 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
191 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
192 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
193 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
195 static void alc_process_coef_fw(struct hda_codec *codec,
196 const struct coef_fw *fw)
198 for (; fw->nid; fw++) {
199 if (fw->mask == (unsigned short)-1)
200 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
202 alc_update_coefex_idx(codec, fw->nid, fw->idx,
208 * GPIO setup tables, used in initialization
211 /* Enable GPIO mask and set output */
212 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
214 struct alc_spec *spec = codec->spec;
216 spec->gpio_mask |= mask;
217 spec->gpio_dir |= mask;
218 spec->gpio_data |= mask;
221 static void alc_write_gpio_data(struct hda_codec *codec)
223 struct alc_spec *spec = codec->spec;
225 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
229 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
232 struct alc_spec *spec = codec->spec;
233 unsigned int oldval = spec->gpio_data;
236 spec->gpio_data |= mask;
238 spec->gpio_data &= ~mask;
239 if (oldval != spec->gpio_data)
240 alc_write_gpio_data(codec);
243 static void alc_write_gpio(struct hda_codec *codec)
245 struct alc_spec *spec = codec->spec;
247 if (!spec->gpio_mask)
250 snd_hda_codec_write(codec, codec->core.afg, 0,
251 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
252 snd_hda_codec_write(codec, codec->core.afg, 0,
253 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
254 if (spec->gpio_write_delay)
256 alc_write_gpio_data(codec);
259 static void alc_fixup_gpio(struct hda_codec *codec, int action,
262 if (action == HDA_FIXUP_ACT_PRE_PROBE)
263 alc_setup_gpio(codec, mask);
266 static void alc_fixup_gpio1(struct hda_codec *codec,
267 const struct hda_fixup *fix, int action)
269 alc_fixup_gpio(codec, action, 0x01);
272 static void alc_fixup_gpio2(struct hda_codec *codec,
273 const struct hda_fixup *fix, int action)
275 alc_fixup_gpio(codec, action, 0x02);
278 static void alc_fixup_gpio3(struct hda_codec *codec,
279 const struct hda_fixup *fix, int action)
281 alc_fixup_gpio(codec, action, 0x03);
284 static void alc_fixup_gpio4(struct hda_codec *codec,
285 const struct hda_fixup *fix, int action)
287 alc_fixup_gpio(codec, action, 0x04);
291 * Fix hardware PLL issue
292 * On some codecs, the analog PLL gating control must be off while
293 * the default value is 1.
295 static void alc_fix_pll(struct hda_codec *codec)
297 struct alc_spec *spec = codec->spec;
300 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
301 1 << spec->pll_coef_bit, 0);
304 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
305 unsigned int coef_idx, unsigned int coef_bit)
307 struct alc_spec *spec = codec->spec;
309 spec->pll_coef_idx = coef_idx;
310 spec->pll_coef_bit = coef_bit;
314 /* update the master volume per volume-knob's unsol event */
315 static void alc_update_knob_master(struct hda_codec *codec,
316 struct hda_jack_callback *jack)
319 struct snd_kcontrol *kctl;
320 struct snd_ctl_elem_value *uctl;
322 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
325 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
328 val = snd_hda_codec_read(codec, jack->nid, 0,
329 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
330 val &= HDA_AMP_VOLMASK;
331 uctl->value.integer.value[0] = val;
332 uctl->value.integer.value[1] = val;
333 kctl->put(kctl, uctl);
337 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
339 /* For some reason, the res given from ALC880 is broken.
340 Here we adjust it properly. */
341 snd_hda_jack_unsol_event(codec, res >> 2);
344 /* Change EAPD to verb control */
345 static void alc_fill_eapd_coef(struct hda_codec *codec)
349 coef = alc_get_coef0(codec);
351 switch (codec->core.vendor_id) {
353 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
357 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
360 if ((coef & 0x00f0) == 0x0010)
361 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
362 if ((coef & 0x00f0) == 0x0020)
363 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
364 if ((coef & 0x00f0) == 0x0030)
365 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
371 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
376 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
395 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
398 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
401 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
410 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
413 if ((coef & 0x00f0) == 0x0030)
414 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
423 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
427 alc_update_coef_idx(codec, 0x19, 1<<13, 0);
430 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
433 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
436 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
437 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
440 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
447 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
452 /* additional initialization for ALC888 variants */
453 static void alc888_coef_init(struct hda_codec *codec)
455 switch (alc_get_coef0(codec) & 0x00f0) {
460 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
465 /* turn on/off EAPD control (only if available) */
466 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
468 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
470 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
471 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
475 /* turn on/off EAPD controls of the codec */
476 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
478 /* We currently only handle front, HP */
479 static const hda_nid_t pins[] = {
480 0x0f, 0x10, 0x14, 0x15, 0x17, 0
483 for (p = pins; *p; p++)
484 set_eapd(codec, *p, on);
487 static int find_ext_mic_pin(struct hda_codec *codec);
489 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
491 const struct hda_pincfg *pin;
492 int mic_pin = find_ext_mic_pin(codec);
495 /* don't shut up pins when unloading the driver; otherwise it breaks
496 * the default pin setup at the next load of the driver
498 if (codec->bus->shutdown)
501 snd_array_for_each(&codec->init_pins, i, pin) {
502 /* use read here for syncing after issuing each verb */
503 if (pin->nid != mic_pin)
504 snd_hda_codec_read(codec, pin->nid, 0,
505 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
508 codec->pins_shutup = 1;
511 static void alc_shutup_pins(struct hda_codec *codec)
513 struct alc_spec *spec = codec->spec;
515 switch (codec->core.vendor_id) {
520 alc_headset_mic_no_shutup(codec);
523 if (!spec->no_shutup_pins)
524 snd_hda_shutup_pins(codec);
529 /* generic shutup callback;
530 * just turning off EAPD and a little pause for avoiding pop-noise
532 static void alc_eapd_shutup(struct hda_codec *codec)
534 struct alc_spec *spec = codec->spec;
536 alc_auto_setup_eapd(codec, false);
537 if (!spec->no_depop_delay)
539 alc_shutup_pins(codec);
542 /* generic EAPD initialization */
543 static void alc_auto_init_amp(struct hda_codec *codec, int type)
545 alc_auto_setup_eapd(codec, true);
546 alc_write_gpio(codec);
548 case ALC_INIT_DEFAULT:
549 switch (codec->core.vendor_id) {
551 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
557 alc_update_coef_idx(codec, 7, 0, 0x2030);
560 alc888_coef_init(codec);
567 /* get a primary headphone pin if available */
568 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
570 if (spec->gen.autocfg.hp_pins[0])
571 return spec->gen.autocfg.hp_pins[0];
572 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
573 return spec->gen.autocfg.line_out_pins[0];
578 * Realtek SSID verification
581 /* Could be any non-zero and even value. When used as fixup, tells
582 * the driver to ignore any present sku defines.
584 #define ALC_FIXUP_SKU_IGNORE (2)
586 static void alc_fixup_sku_ignore(struct hda_codec *codec,
587 const struct hda_fixup *fix, int action)
589 struct alc_spec *spec = codec->spec;
590 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
591 spec->cdefine.fixup = 1;
592 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
596 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
597 const struct hda_fixup *fix, int action)
599 struct alc_spec *spec = codec->spec;
601 if (action == HDA_FIXUP_ACT_PROBE) {
602 spec->no_depop_delay = 1;
603 codec->depop_delay = 0;
607 static int alc_auto_parse_customize_define(struct hda_codec *codec)
609 unsigned int ass, tmp, i;
611 struct alc_spec *spec = codec->spec;
613 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
615 if (spec->cdefine.fixup) {
616 ass = spec->cdefine.sku_cfg;
617 if (ass == ALC_FIXUP_SKU_IGNORE)
622 if (!codec->bus->pci)
624 ass = codec->core.subsystem_id & 0xffff;
625 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
629 if (codec->core.vendor_id == 0x10ec0260)
631 ass = snd_hda_codec_get_pincfg(codec, nid);
634 codec_info(codec, "%s: SKU not ready 0x%08x\n",
635 codec->core.chip_name, ass);
641 for (i = 1; i < 16; i++) {
645 if (((ass >> 16) & 0xf) != tmp)
648 spec->cdefine.port_connectivity = ass >> 30;
649 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
650 spec->cdefine.check_sum = (ass >> 16) & 0xf;
651 spec->cdefine.customization = ass >> 8;
653 spec->cdefine.sku_cfg = ass;
654 spec->cdefine.external_amp = (ass & 0x38) >> 3;
655 spec->cdefine.platform_type = (ass & 0x4) >> 2;
656 spec->cdefine.swap = (ass & 0x2) >> 1;
657 spec->cdefine.override = ass & 0x1;
659 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
660 nid, spec->cdefine.sku_cfg);
661 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
662 spec->cdefine.port_connectivity);
663 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
664 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
665 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
666 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
667 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
668 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
669 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
674 /* return the position of NID in the list, or -1 if not found */
675 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
678 for (i = 0; i < nums; i++)
683 /* return true if the given NID is found in the list */
684 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
686 return find_idx_in_nid_list(nid, list, nums) >= 0;
689 /* check subsystem ID and set up device-specific initialization;
690 * return 1 if initialized, 0 if invalid SSID
692 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
693 * 31 ~ 16 : Manufacture ID
695 * 7 ~ 0 : Assembly ID
696 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
698 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
700 unsigned int ass, tmp, i;
702 struct alc_spec *spec = codec->spec;
704 if (spec->cdefine.fixup) {
705 ass = spec->cdefine.sku_cfg;
706 if (ass == ALC_FIXUP_SKU_IGNORE)
711 ass = codec->core.subsystem_id & 0xffff;
712 if (codec->bus->pci &&
713 ass != codec->bus->pci->subsystem_device && (ass & 1))
716 /* invalid SSID, check the special NID pin defcfg instead */
718 * 31~30 : port connectivity
721 * 19~16 : Check sum (15:1)
726 if (codec->core.vendor_id == 0x10ec0260)
728 ass = snd_hda_codec_get_pincfg(codec, nid);
730 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
734 if ((ass >> 30) != 1) /* no physical connection */
739 for (i = 1; i < 16; i++) {
743 if (((ass >> 16) & 0xf) != tmp)
746 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
747 ass & 0xffff, codec->core.vendor_id);
751 * 2 : 0 --> Desktop, 1 --> Laptop
752 * 3~5 : External Amplifier control
755 tmp = (ass & 0x38) >> 3; /* external Amp control */
756 if (spec->init_amp == ALC_INIT_UNDEFINED) {
759 alc_setup_gpio(codec, 0x01);
762 alc_setup_gpio(codec, 0x02);
765 alc_setup_gpio(codec, 0x03);
769 spec->init_amp = ALC_INIT_DEFAULT;
774 /* is laptop or Desktop and enable the function "Mute internal speaker
775 * when the external headphone out jack is plugged"
780 * 10~8 : Jack location
781 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
783 * 15 : 1 --> enable the function "Mute internal speaker
784 * when the external headphone out jack is plugged"
786 if (!alc_get_hp_pin(spec)) {
788 tmp = (ass >> 11) & 0x3; /* HP to chassis */
790 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
791 spec->gen.autocfg.line_outs))
793 spec->gen.autocfg.hp_pins[0] = nid;
798 /* Check the validity of ALC subsystem-id
799 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
800 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
802 if (!alc_subsystem_id(codec, ports)) {
803 struct alc_spec *spec = codec->spec;
804 if (spec->init_amp == ALC_INIT_UNDEFINED) {
806 "realtek: Enable default setup for auto mode as fallback\n");
807 spec->init_amp = ALC_INIT_DEFAULT;
815 static void alc_fixup_inv_dmic(struct hda_codec *codec,
816 const struct hda_fixup *fix, int action)
818 struct alc_spec *spec = codec->spec;
820 spec->gen.inv_dmic_split = 1;
824 static int alc_build_controls(struct hda_codec *codec)
828 err = snd_hda_gen_build_controls(codec);
832 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
841 static void alc_pre_init(struct hda_codec *codec)
843 alc_fill_eapd_coef(codec);
846 #define is_s3_resume(codec) \
847 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
848 #define is_s4_resume(codec) \
849 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
851 static int alc_init(struct hda_codec *codec)
853 struct alc_spec *spec = codec->spec;
855 /* hibernation resume needs the full chip initialization */
856 if (is_s4_resume(codec))
860 spec->init_hook(codec);
862 spec->gen.skip_verbs = 1; /* applied in below */
863 snd_hda_gen_init(codec);
865 alc_auto_init_amp(codec, spec->init_amp);
866 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
868 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
873 static inline void alc_shutup(struct hda_codec *codec)
875 struct alc_spec *spec = codec->spec;
877 if (!snd_hda_get_bool_hint(codec, "shutup"))
878 return; /* disabled explicitly by hints */
880 if (spec && spec->shutup)
883 alc_shutup_pins(codec);
886 static void alc_reboot_notify(struct hda_codec *codec)
888 struct alc_spec *spec = codec->spec;
890 if (spec && spec->reboot_notify)
891 spec->reboot_notify(codec);
896 #define alc_free snd_hda_gen_free
899 static void alc_power_eapd(struct hda_codec *codec)
901 alc_auto_setup_eapd(codec, false);
904 static int alc_suspend(struct hda_codec *codec)
906 struct alc_spec *spec = codec->spec;
908 if (spec && spec->power_hook)
909 spec->power_hook(codec);
915 static int alc_resume(struct hda_codec *codec)
917 struct alc_spec *spec = codec->spec;
919 if (!spec->no_depop_delay)
920 msleep(150); /* to avoid pop noise */
921 codec->patch_ops.init(codec);
922 snd_hda_regmap_sync(codec);
923 hda_call_check_power_status(codec, 0x01);
930 static const struct hda_codec_ops alc_patch_ops = {
931 .build_controls = alc_build_controls,
932 .build_pcms = snd_hda_gen_build_pcms,
935 .unsol_event = snd_hda_jack_unsol_event,
937 .resume = alc_resume,
938 .suspend = alc_suspend,
939 .check_power_status = snd_hda_gen_check_power_status,
941 .reboot_notify = alc_reboot_notify,
945 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
948 * Rename codecs appropriately from COEF value or subvendor id
950 struct alc_codec_rename_table {
951 unsigned int vendor_id;
952 unsigned short coef_mask;
953 unsigned short coef_bits;
957 struct alc_codec_rename_pci_table {
958 unsigned int codec_vendor_id;
959 unsigned short pci_subvendor;
960 unsigned short pci_subdevice;
964 static const struct alc_codec_rename_table rename_tbl[] = {
965 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
966 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
967 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
968 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
969 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
970 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
971 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
972 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
973 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
974 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
975 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
976 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
977 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
978 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
979 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
980 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
981 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
985 static const struct alc_codec_rename_pci_table rename_pci_tbl[] = {
986 { 0x10ec0280, 0x1028, 0, "ALC3220" },
987 { 0x10ec0282, 0x1028, 0, "ALC3221" },
988 { 0x10ec0283, 0x1028, 0, "ALC3223" },
989 { 0x10ec0288, 0x1028, 0, "ALC3263" },
990 { 0x10ec0292, 0x1028, 0, "ALC3226" },
991 { 0x10ec0293, 0x1028, 0, "ALC3235" },
992 { 0x10ec0255, 0x1028, 0, "ALC3234" },
993 { 0x10ec0668, 0x1028, 0, "ALC3661" },
994 { 0x10ec0275, 0x1028, 0, "ALC3260" },
995 { 0x10ec0899, 0x1028, 0, "ALC3861" },
996 { 0x10ec0298, 0x1028, 0, "ALC3266" },
997 { 0x10ec0236, 0x1028, 0, "ALC3204" },
998 { 0x10ec0256, 0x1028, 0, "ALC3246" },
999 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1000 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1001 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1002 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1003 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1004 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1005 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1006 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1007 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1008 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1009 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1010 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1011 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1012 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1013 { } /* terminator */
1016 static int alc_codec_rename_from_preset(struct hda_codec *codec)
1018 const struct alc_codec_rename_table *p;
1019 const struct alc_codec_rename_pci_table *q;
1021 for (p = rename_tbl; p->vendor_id; p++) {
1022 if (p->vendor_id != codec->core.vendor_id)
1024 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1025 return alc_codec_rename(codec, p->name);
1028 if (!codec->bus->pci)
1030 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1031 if (q->codec_vendor_id != codec->core.vendor_id)
1033 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1035 if (!q->pci_subdevice ||
1036 q->pci_subdevice == codec->bus->pci->subsystem_device)
1037 return alc_codec_rename(codec, q->name);
1045 * Digital-beep handlers
1047 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1049 /* additional beep mixers; private_value will be overwritten */
1050 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1051 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1052 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1055 /* set up and create beep controls */
1056 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1059 struct snd_kcontrol_new *knew;
1060 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1063 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1064 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1065 &alc_beep_mixer[i]);
1068 knew->private_value = beep_amp;
1073 static const struct snd_pci_quirk beep_white_list[] = {
1074 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1075 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1076 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1077 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1078 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1079 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1080 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1081 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1082 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1083 /* blacklist -- no beep available */
1084 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1085 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1089 static inline int has_cdefine_beep(struct hda_codec *codec)
1091 struct alc_spec *spec = codec->spec;
1092 const struct snd_pci_quirk *q;
1093 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
1096 return spec->cdefine.enable_pcbeep;
1099 #define set_beep_amp(spec, nid, idx, dir) 0
1100 #define has_cdefine_beep(codec) 0
1103 /* parse the BIOS configuration and set up the alc_spec */
1104 /* return 1 if successful, 0 if the proper config is not found,
1105 * or a negative error code
1107 static int alc_parse_auto_config(struct hda_codec *codec,
1108 const hda_nid_t *ignore_nids,
1109 const hda_nid_t *ssid_nids)
1111 struct alc_spec *spec = codec->spec;
1112 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1115 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1121 alc_ssid_check(codec, ssid_nids);
1123 err = snd_hda_gen_parse_auto_config(codec, cfg);
1130 /* common preparation job for alc_spec */
1131 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1133 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1139 snd_hda_gen_spec_init(&spec->gen);
1140 spec->gen.mixer_nid = mixer_nid;
1141 spec->gen.own_eapd_ctl = 1;
1142 codec->single_adc_amp = 1;
1143 /* FIXME: do we need this for all Realtek codec models? */
1144 codec->spdif_status_reset = 1;
1145 codec->patch_ops = alc_patch_ops;
1147 err = alc_codec_rename_from_preset(codec);
1155 static int alc880_parse_auto_config(struct hda_codec *codec)
1157 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1158 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1159 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1168 ALC880_FIXUP_MEDION_RIM,
1170 ALC880_FIXUP_LG_LW25,
1172 ALC880_FIXUP_EAPD_COEF,
1173 ALC880_FIXUP_TCL_S700,
1174 ALC880_FIXUP_VOL_KNOB,
1175 ALC880_FIXUP_FUJITSU,
1177 ALC880_FIXUP_UNIWILL,
1178 ALC880_FIXUP_UNIWILL_DIG,
1180 ALC880_FIXUP_ASUS_W5A,
1181 ALC880_FIXUP_3ST_BASE,
1183 ALC880_FIXUP_3ST_DIG,
1184 ALC880_FIXUP_5ST_BASE,
1186 ALC880_FIXUP_5ST_DIG,
1187 ALC880_FIXUP_6ST_BASE,
1189 ALC880_FIXUP_6ST_DIG,
1190 ALC880_FIXUP_6ST_AUTOMUTE,
1193 /* enable the volume-knob widget support on NID 0x21 */
1194 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1195 const struct hda_fixup *fix, int action)
1197 if (action == HDA_FIXUP_ACT_PROBE)
1198 snd_hda_jack_detect_enable_callback(codec, 0x21,
1199 alc_update_knob_master);
1202 static const struct hda_fixup alc880_fixups[] = {
1203 [ALC880_FIXUP_GPIO1] = {
1204 .type = HDA_FIXUP_FUNC,
1205 .v.func = alc_fixup_gpio1,
1207 [ALC880_FIXUP_GPIO2] = {
1208 .type = HDA_FIXUP_FUNC,
1209 .v.func = alc_fixup_gpio2,
1211 [ALC880_FIXUP_MEDION_RIM] = {
1212 .type = HDA_FIXUP_VERBS,
1213 .v.verbs = (const struct hda_verb[]) {
1214 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1215 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1219 .chain_id = ALC880_FIXUP_GPIO2,
1221 [ALC880_FIXUP_LG] = {
1222 .type = HDA_FIXUP_PINS,
1223 .v.pins = (const struct hda_pintbl[]) {
1224 /* disable bogus unused pins */
1225 { 0x16, 0x411111f0 },
1226 { 0x18, 0x411111f0 },
1227 { 0x1a, 0x411111f0 },
1231 [ALC880_FIXUP_LG_LW25] = {
1232 .type = HDA_FIXUP_PINS,
1233 .v.pins = (const struct hda_pintbl[]) {
1234 { 0x1a, 0x0181344f }, /* line-in */
1235 { 0x1b, 0x0321403f }, /* headphone */
1239 [ALC880_FIXUP_W810] = {
1240 .type = HDA_FIXUP_PINS,
1241 .v.pins = (const struct hda_pintbl[]) {
1242 /* disable bogus unused pins */
1243 { 0x17, 0x411111f0 },
1247 .chain_id = ALC880_FIXUP_GPIO2,
1249 [ALC880_FIXUP_EAPD_COEF] = {
1250 .type = HDA_FIXUP_VERBS,
1251 .v.verbs = (const struct hda_verb[]) {
1252 /* change to EAPD mode */
1253 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1254 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1258 [ALC880_FIXUP_TCL_S700] = {
1259 .type = HDA_FIXUP_VERBS,
1260 .v.verbs = (const struct hda_verb[]) {
1261 /* change to EAPD mode */
1262 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1263 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1267 .chain_id = ALC880_FIXUP_GPIO2,
1269 [ALC880_FIXUP_VOL_KNOB] = {
1270 .type = HDA_FIXUP_FUNC,
1271 .v.func = alc880_fixup_vol_knob,
1273 [ALC880_FIXUP_FUJITSU] = {
1274 /* override all pins as BIOS on old Amilo is broken */
1275 .type = HDA_FIXUP_PINS,
1276 .v.pins = (const struct hda_pintbl[]) {
1277 { 0x14, 0x0121401f }, /* HP */
1278 { 0x15, 0x99030120 }, /* speaker */
1279 { 0x16, 0x99030130 }, /* bass speaker */
1280 { 0x17, 0x411111f0 }, /* N/A */
1281 { 0x18, 0x411111f0 }, /* N/A */
1282 { 0x19, 0x01a19950 }, /* mic-in */
1283 { 0x1a, 0x411111f0 }, /* N/A */
1284 { 0x1b, 0x411111f0 }, /* N/A */
1285 { 0x1c, 0x411111f0 }, /* N/A */
1286 { 0x1d, 0x411111f0 }, /* N/A */
1287 { 0x1e, 0x01454140 }, /* SPDIF out */
1291 .chain_id = ALC880_FIXUP_VOL_KNOB,
1293 [ALC880_FIXUP_F1734] = {
1294 /* almost compatible with FUJITSU, but no bass and SPDIF */
1295 .type = HDA_FIXUP_PINS,
1296 .v.pins = (const struct hda_pintbl[]) {
1297 { 0x14, 0x0121401f }, /* HP */
1298 { 0x15, 0x99030120 }, /* speaker */
1299 { 0x16, 0x411111f0 }, /* N/A */
1300 { 0x17, 0x411111f0 }, /* N/A */
1301 { 0x18, 0x411111f0 }, /* N/A */
1302 { 0x19, 0x01a19950 }, /* mic-in */
1303 { 0x1a, 0x411111f0 }, /* N/A */
1304 { 0x1b, 0x411111f0 }, /* N/A */
1305 { 0x1c, 0x411111f0 }, /* N/A */
1306 { 0x1d, 0x411111f0 }, /* N/A */
1307 { 0x1e, 0x411111f0 }, /* N/A */
1311 .chain_id = ALC880_FIXUP_VOL_KNOB,
1313 [ALC880_FIXUP_UNIWILL] = {
1314 /* need to fix HP and speaker pins to be parsed correctly */
1315 .type = HDA_FIXUP_PINS,
1316 .v.pins = (const struct hda_pintbl[]) {
1317 { 0x14, 0x0121411f }, /* HP */
1318 { 0x15, 0x99030120 }, /* speaker */
1319 { 0x16, 0x99030130 }, /* bass speaker */
1323 [ALC880_FIXUP_UNIWILL_DIG] = {
1324 .type = HDA_FIXUP_PINS,
1325 .v.pins = (const struct hda_pintbl[]) {
1326 /* disable bogus unused pins */
1327 { 0x17, 0x411111f0 },
1328 { 0x19, 0x411111f0 },
1329 { 0x1b, 0x411111f0 },
1330 { 0x1f, 0x411111f0 },
1334 [ALC880_FIXUP_Z71V] = {
1335 .type = HDA_FIXUP_PINS,
1336 .v.pins = (const struct hda_pintbl[]) {
1337 /* set up the whole pins as BIOS is utterly broken */
1338 { 0x14, 0x99030120 }, /* speaker */
1339 { 0x15, 0x0121411f }, /* HP */
1340 { 0x16, 0x411111f0 }, /* N/A */
1341 { 0x17, 0x411111f0 }, /* N/A */
1342 { 0x18, 0x01a19950 }, /* mic-in */
1343 { 0x19, 0x411111f0 }, /* N/A */
1344 { 0x1a, 0x01813031 }, /* line-in */
1345 { 0x1b, 0x411111f0 }, /* N/A */
1346 { 0x1c, 0x411111f0 }, /* N/A */
1347 { 0x1d, 0x411111f0 }, /* N/A */
1348 { 0x1e, 0x0144111e }, /* SPDIF */
1352 [ALC880_FIXUP_ASUS_W5A] = {
1353 .type = HDA_FIXUP_PINS,
1354 .v.pins = (const struct hda_pintbl[]) {
1355 /* set up the whole pins as BIOS is utterly broken */
1356 { 0x14, 0x0121411f }, /* HP */
1357 { 0x15, 0x411111f0 }, /* N/A */
1358 { 0x16, 0x411111f0 }, /* N/A */
1359 { 0x17, 0x411111f0 }, /* N/A */
1360 { 0x18, 0x90a60160 }, /* mic */
1361 { 0x19, 0x411111f0 }, /* N/A */
1362 { 0x1a, 0x411111f0 }, /* N/A */
1363 { 0x1b, 0x411111f0 }, /* N/A */
1364 { 0x1c, 0x411111f0 }, /* N/A */
1365 { 0x1d, 0x411111f0 }, /* N/A */
1366 { 0x1e, 0xb743111e }, /* SPDIF out */
1370 .chain_id = ALC880_FIXUP_GPIO1,
1372 [ALC880_FIXUP_3ST_BASE] = {
1373 .type = HDA_FIXUP_PINS,
1374 .v.pins = (const struct hda_pintbl[]) {
1375 { 0x14, 0x01014010 }, /* line-out */
1376 { 0x15, 0x411111f0 }, /* N/A */
1377 { 0x16, 0x411111f0 }, /* N/A */
1378 { 0x17, 0x411111f0 }, /* N/A */
1379 { 0x18, 0x01a19c30 }, /* mic-in */
1380 { 0x19, 0x0121411f }, /* HP */
1381 { 0x1a, 0x01813031 }, /* line-in */
1382 { 0x1b, 0x02a19c40 }, /* front-mic */
1383 { 0x1c, 0x411111f0 }, /* N/A */
1384 { 0x1d, 0x411111f0 }, /* N/A */
1385 /* 0x1e is filled in below */
1386 { 0x1f, 0x411111f0 }, /* N/A */
1390 [ALC880_FIXUP_3ST] = {
1391 .type = HDA_FIXUP_PINS,
1392 .v.pins = (const struct hda_pintbl[]) {
1393 { 0x1e, 0x411111f0 }, /* N/A */
1397 .chain_id = ALC880_FIXUP_3ST_BASE,
1399 [ALC880_FIXUP_3ST_DIG] = {
1400 .type = HDA_FIXUP_PINS,
1401 .v.pins = (const struct hda_pintbl[]) {
1402 { 0x1e, 0x0144111e }, /* SPDIF */
1406 .chain_id = ALC880_FIXUP_3ST_BASE,
1408 [ALC880_FIXUP_5ST_BASE] = {
1409 .type = HDA_FIXUP_PINS,
1410 .v.pins = (const struct hda_pintbl[]) {
1411 { 0x14, 0x01014010 }, /* front */
1412 { 0x15, 0x411111f0 }, /* N/A */
1413 { 0x16, 0x01011411 }, /* CLFE */
1414 { 0x17, 0x01016412 }, /* surr */
1415 { 0x18, 0x01a19c30 }, /* mic-in */
1416 { 0x19, 0x0121411f }, /* HP */
1417 { 0x1a, 0x01813031 }, /* line-in */
1418 { 0x1b, 0x02a19c40 }, /* front-mic */
1419 { 0x1c, 0x411111f0 }, /* N/A */
1420 { 0x1d, 0x411111f0 }, /* N/A */
1421 /* 0x1e is filled in below */
1422 { 0x1f, 0x411111f0 }, /* N/A */
1426 [ALC880_FIXUP_5ST] = {
1427 .type = HDA_FIXUP_PINS,
1428 .v.pins = (const struct hda_pintbl[]) {
1429 { 0x1e, 0x411111f0 }, /* N/A */
1433 .chain_id = ALC880_FIXUP_5ST_BASE,
1435 [ALC880_FIXUP_5ST_DIG] = {
1436 .type = HDA_FIXUP_PINS,
1437 .v.pins = (const struct hda_pintbl[]) {
1438 { 0x1e, 0x0144111e }, /* SPDIF */
1442 .chain_id = ALC880_FIXUP_5ST_BASE,
1444 [ALC880_FIXUP_6ST_BASE] = {
1445 .type = HDA_FIXUP_PINS,
1446 .v.pins = (const struct hda_pintbl[]) {
1447 { 0x14, 0x01014010 }, /* front */
1448 { 0x15, 0x01016412 }, /* surr */
1449 { 0x16, 0x01011411 }, /* CLFE */
1450 { 0x17, 0x01012414 }, /* side */
1451 { 0x18, 0x01a19c30 }, /* mic-in */
1452 { 0x19, 0x02a19c40 }, /* front-mic */
1453 { 0x1a, 0x01813031 }, /* line-in */
1454 { 0x1b, 0x0121411f }, /* HP */
1455 { 0x1c, 0x411111f0 }, /* N/A */
1456 { 0x1d, 0x411111f0 }, /* N/A */
1457 /* 0x1e is filled in below */
1458 { 0x1f, 0x411111f0 }, /* N/A */
1462 [ALC880_FIXUP_6ST] = {
1463 .type = HDA_FIXUP_PINS,
1464 .v.pins = (const struct hda_pintbl[]) {
1465 { 0x1e, 0x411111f0 }, /* N/A */
1469 .chain_id = ALC880_FIXUP_6ST_BASE,
1471 [ALC880_FIXUP_6ST_DIG] = {
1472 .type = HDA_FIXUP_PINS,
1473 .v.pins = (const struct hda_pintbl[]) {
1474 { 0x1e, 0x0144111e }, /* SPDIF */
1478 .chain_id = ALC880_FIXUP_6ST_BASE,
1480 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1481 .type = HDA_FIXUP_PINS,
1482 .v.pins = (const struct hda_pintbl[]) {
1483 { 0x1b, 0x0121401f }, /* HP with jack detect */
1486 .chained_before = true,
1487 .chain_id = ALC880_FIXUP_6ST_BASE,
1491 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1492 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1493 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1494 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1495 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1496 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1497 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1498 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1499 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1500 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1501 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1502 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1503 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1504 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1505 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1506 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1507 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1508 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1509 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1510 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1511 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1512 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1513 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1514 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1516 /* Below is the copied entries from alc880_quirks.c.
1517 * It's not quite sure whether BIOS sets the correct pin-config table
1518 * on these machines, thus they are kept to be compatible with
1519 * the old static quirks. Once when it's confirmed to work without
1520 * these overrides, it'd be better to remove.
1522 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1523 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1524 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1525 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1526 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1527 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1528 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1529 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1530 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1531 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1532 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1533 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1534 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1535 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1536 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1537 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1538 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1539 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1540 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1541 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1542 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1543 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1544 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1545 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1546 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1547 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1548 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1549 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1550 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1551 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1552 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1553 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1554 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1556 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1557 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1558 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1562 static const struct hda_model_fixup alc880_fixup_models[] = {
1563 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1564 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1565 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1566 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1567 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1568 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1569 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1575 * OK, here we have finally the patch for ALC880
1577 static int patch_alc880(struct hda_codec *codec)
1579 struct alc_spec *spec;
1582 err = alc_alloc_spec(codec, 0x0b);
1587 spec->gen.need_dac_fix = 1;
1588 spec->gen.beep_nid = 0x01;
1590 codec->patch_ops.unsol_event = alc880_unsol_event;
1592 alc_pre_init(codec);
1594 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1596 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1598 /* automatic parse from the BIOS config */
1599 err = alc880_parse_auto_config(codec);
1603 if (!spec->gen.no_analog) {
1604 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1609 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1622 static int alc260_parse_auto_config(struct hda_codec *codec)
1624 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1625 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1626 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1633 ALC260_FIXUP_HP_DC5750,
1634 ALC260_FIXUP_HP_PIN_0F,
1637 ALC260_FIXUP_GPIO1_TOGGLE,
1638 ALC260_FIXUP_REPLACER,
1639 ALC260_FIXUP_HP_B1900,
1641 ALC260_FIXUP_FSC_S7020,
1642 ALC260_FIXUP_FSC_S7020_JWSE,
1643 ALC260_FIXUP_VAIO_PINS,
1646 static void alc260_gpio1_automute(struct hda_codec *codec)
1648 struct alc_spec *spec = codec->spec;
1650 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1653 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1654 const struct hda_fixup *fix, int action)
1656 struct alc_spec *spec = codec->spec;
1657 if (action == HDA_FIXUP_ACT_PROBE) {
1658 /* although the machine has only one output pin, we need to
1659 * toggle GPIO1 according to the jack state
1661 spec->gen.automute_hook = alc260_gpio1_automute;
1662 spec->gen.detect_hp = 1;
1663 spec->gen.automute_speaker = 1;
1664 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1665 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1666 snd_hda_gen_hp_automute);
1667 alc_setup_gpio(codec, 0x01);
1671 static void alc260_fixup_kn1(struct hda_codec *codec,
1672 const struct hda_fixup *fix, int action)
1674 struct alc_spec *spec = codec->spec;
1675 static const struct hda_pintbl pincfgs[] = {
1676 { 0x0f, 0x02214000 }, /* HP/speaker */
1677 { 0x12, 0x90a60160 }, /* int mic */
1678 { 0x13, 0x02a19000 }, /* ext mic */
1679 { 0x18, 0x01446000 }, /* SPDIF out */
1680 /* disable bogus I/O pins */
1681 { 0x10, 0x411111f0 },
1682 { 0x11, 0x411111f0 },
1683 { 0x14, 0x411111f0 },
1684 { 0x15, 0x411111f0 },
1685 { 0x16, 0x411111f0 },
1686 { 0x17, 0x411111f0 },
1687 { 0x19, 0x411111f0 },
1692 case HDA_FIXUP_ACT_PRE_PROBE:
1693 snd_hda_apply_pincfgs(codec, pincfgs);
1694 spec->init_amp = ALC_INIT_NONE;
1699 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1700 const struct hda_fixup *fix, int action)
1702 struct alc_spec *spec = codec->spec;
1703 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1704 spec->init_amp = ALC_INIT_NONE;
1707 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1708 const struct hda_fixup *fix, int action)
1710 struct alc_spec *spec = codec->spec;
1711 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1712 spec->gen.add_jack_modes = 1;
1713 spec->gen.hp_mic = 1;
1717 static const struct hda_fixup alc260_fixups[] = {
1718 [ALC260_FIXUP_HP_DC5750] = {
1719 .type = HDA_FIXUP_PINS,
1720 .v.pins = (const struct hda_pintbl[]) {
1721 { 0x11, 0x90130110 }, /* speaker */
1725 [ALC260_FIXUP_HP_PIN_0F] = {
1726 .type = HDA_FIXUP_PINS,
1727 .v.pins = (const struct hda_pintbl[]) {
1728 { 0x0f, 0x01214000 }, /* HP */
1732 [ALC260_FIXUP_COEF] = {
1733 .type = HDA_FIXUP_VERBS,
1734 .v.verbs = (const struct hda_verb[]) {
1735 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1736 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1740 [ALC260_FIXUP_GPIO1] = {
1741 .type = HDA_FIXUP_FUNC,
1742 .v.func = alc_fixup_gpio1,
1744 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1745 .type = HDA_FIXUP_FUNC,
1746 .v.func = alc260_fixup_gpio1_toggle,
1748 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1750 [ALC260_FIXUP_REPLACER] = {
1751 .type = HDA_FIXUP_VERBS,
1752 .v.verbs = (const struct hda_verb[]) {
1753 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1754 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1758 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1760 [ALC260_FIXUP_HP_B1900] = {
1761 .type = HDA_FIXUP_FUNC,
1762 .v.func = alc260_fixup_gpio1_toggle,
1764 .chain_id = ALC260_FIXUP_COEF,
1766 [ALC260_FIXUP_KN1] = {
1767 .type = HDA_FIXUP_FUNC,
1768 .v.func = alc260_fixup_kn1,
1770 [ALC260_FIXUP_FSC_S7020] = {
1771 .type = HDA_FIXUP_FUNC,
1772 .v.func = alc260_fixup_fsc_s7020,
1774 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1775 .type = HDA_FIXUP_FUNC,
1776 .v.func = alc260_fixup_fsc_s7020_jwse,
1778 .chain_id = ALC260_FIXUP_FSC_S7020,
1780 [ALC260_FIXUP_VAIO_PINS] = {
1781 .type = HDA_FIXUP_PINS,
1782 .v.pins = (const struct hda_pintbl[]) {
1783 /* Pin configs are missing completely on some VAIOs */
1784 { 0x0f, 0x01211020 },
1785 { 0x10, 0x0001003f },
1786 { 0x11, 0x411111f0 },
1787 { 0x12, 0x01a15930 },
1788 { 0x13, 0x411111f0 },
1789 { 0x14, 0x411111f0 },
1790 { 0x15, 0x411111f0 },
1791 { 0x16, 0x411111f0 },
1792 { 0x17, 0x411111f0 },
1793 { 0x18, 0x411111f0 },
1794 { 0x19, 0x411111f0 },
1800 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1801 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1802 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1803 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1804 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1805 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1806 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1807 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1808 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1809 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1810 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1811 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1812 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1816 static const struct hda_model_fixup alc260_fixup_models[] = {
1817 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1818 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1819 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1820 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1826 static int patch_alc260(struct hda_codec *codec)
1828 struct alc_spec *spec;
1831 err = alc_alloc_spec(codec, 0x07);
1836 /* as quite a few machines require HP amp for speaker outputs,
1837 * it's easier to enable it unconditionally; even if it's unneeded,
1838 * it's almost harmless.
1840 spec->gen.prefer_hp_amp = 1;
1841 spec->gen.beep_nid = 0x01;
1843 spec->shutup = alc_eapd_shutup;
1845 alc_pre_init(codec);
1847 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1849 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1851 /* automatic parse from the BIOS config */
1852 err = alc260_parse_auto_config(codec);
1856 if (!spec->gen.no_analog) {
1857 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1862 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1873 * ALC882/883/885/888/889 support
1875 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1876 * configuration. Each pin widget can choose any input DACs and a mixer.
1877 * Each ADC is connected from a mixer of all inputs. This makes possible
1878 * 6-channel independent captures.
1880 * In addition, an independent DAC for the multi-playback (not used in this
1888 ALC882_FIXUP_ABIT_AW9D_MAX,
1889 ALC882_FIXUP_LENOVO_Y530,
1890 ALC882_FIXUP_PB_M5210,
1891 ALC882_FIXUP_ACER_ASPIRE_7736,
1892 ALC882_FIXUP_ASUS_W90V,
1894 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1895 ALC889_FIXUP_VAIO_TT,
1896 ALC888_FIXUP_EEE1601,
1899 ALC883_FIXUP_ACER_EAPD,
1904 ALC882_FIXUP_ASUS_W2JC,
1905 ALC882_FIXUP_ACER_ASPIRE_4930G,
1906 ALC882_FIXUP_ACER_ASPIRE_8930G,
1907 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1908 ALC885_FIXUP_MACPRO_GPIO,
1909 ALC889_FIXUP_DAC_ROUTE,
1910 ALC889_FIXUP_MBP_VREF,
1911 ALC889_FIXUP_IMAC91_VREF,
1912 ALC889_FIXUP_MBA11_VREF,
1913 ALC889_FIXUP_MBA21_VREF,
1914 ALC889_FIXUP_MP11_VREF,
1915 ALC889_FIXUP_MP41_VREF,
1916 ALC882_FIXUP_INV_DMIC,
1917 ALC882_FIXUP_NO_PRIMARY_HP,
1918 ALC887_FIXUP_ASUS_BASS,
1919 ALC887_FIXUP_BASS_CHMAP,
1920 ALC1220_FIXUP_GB_DUAL_CODECS,
1921 ALC1220_FIXUP_CLEVO_P950,
1922 ALC1220_FIXUP_CLEVO_PB51ED,
1923 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1926 static void alc889_fixup_coef(struct hda_codec *codec,
1927 const struct hda_fixup *fix, int action)
1929 if (action != HDA_FIXUP_ACT_INIT)
1931 alc_update_coef_idx(codec, 7, 0, 0x2030);
1934 /* set up GPIO at initialization */
1935 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1936 const struct hda_fixup *fix, int action)
1938 struct alc_spec *spec = codec->spec;
1940 spec->gpio_write_delay = true;
1941 alc_fixup_gpio3(codec, fix, action);
1944 /* Fix the connection of some pins for ALC889:
1945 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1946 * work correctly (bko#42740)
1948 static void alc889_fixup_dac_route(struct hda_codec *codec,
1949 const struct hda_fixup *fix, int action)
1951 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1952 /* fake the connections during parsing the tree */
1953 static const hda_nid_t conn1[] = { 0x0c, 0x0d };
1954 static const hda_nid_t conn2[] = { 0x0e, 0x0f };
1955 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
1956 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
1957 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn2), conn2);
1958 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn2), conn2);
1959 } else if (action == HDA_FIXUP_ACT_PROBE) {
1960 /* restore the connections */
1961 static const hda_nid_t conn[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1962 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn);
1963 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn), conn);
1964 snd_hda_override_conn_list(codec, 0x18, ARRAY_SIZE(conn), conn);
1965 snd_hda_override_conn_list(codec, 0x1a, ARRAY_SIZE(conn), conn);
1969 /* Set VREF on HP pin */
1970 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1971 const struct hda_fixup *fix, int action)
1973 static const hda_nid_t nids[] = { 0x14, 0x15, 0x19 };
1974 struct alc_spec *spec = codec->spec;
1977 if (action != HDA_FIXUP_ACT_INIT)
1979 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1980 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1981 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1983 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1984 val |= AC_PINCTL_VREF_80;
1985 snd_hda_set_pin_ctl(codec, nids[i], val);
1986 spec->gen.keep_vref_in_automute = 1;
1991 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1992 const hda_nid_t *nids, int num_nids)
1994 struct alc_spec *spec = codec->spec;
1997 for (i = 0; i < num_nids; i++) {
1999 val = snd_hda_codec_get_pin_target(codec, nids[i]);
2000 val |= AC_PINCTL_VREF_50;
2001 snd_hda_set_pin_ctl(codec, nids[i], val);
2003 spec->gen.keep_vref_in_automute = 1;
2006 /* Set VREF on speaker pins on imac91 */
2007 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
2008 const struct hda_fixup *fix, int action)
2010 static const hda_nid_t nids[] = { 0x18, 0x1a };
2012 if (action == HDA_FIXUP_ACT_INIT)
2013 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2016 /* Set VREF on speaker pins on mba11 */
2017 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
2018 const struct hda_fixup *fix, int action)
2020 static const hda_nid_t nids[] = { 0x18 };
2022 if (action == HDA_FIXUP_ACT_INIT)
2023 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2026 /* Set VREF on speaker pins on mba21 */
2027 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
2028 const struct hda_fixup *fix, int action)
2030 static const hda_nid_t nids[] = { 0x18, 0x19 };
2032 if (action == HDA_FIXUP_ACT_INIT)
2033 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2036 /* Don't take HP output as primary
2037 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2038 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2040 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2041 const struct hda_fixup *fix, int action)
2043 struct alc_spec *spec = codec->spec;
2044 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2045 spec->gen.no_primary_hp = 1;
2046 spec->gen.no_multi_io = 1;
2050 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2051 const struct hda_fixup *fix, int action);
2053 /* For dual-codec configuration, we need to disable some features to avoid
2054 * conflicts of kctls and PCM streams
2056 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2057 const struct hda_fixup *fix, int action)
2059 struct alc_spec *spec = codec->spec;
2061 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2063 /* disable vmaster */
2064 spec->gen.suppress_vmaster = 1;
2065 /* auto-mute and auto-mic switch don't work with multiple codecs */
2066 spec->gen.suppress_auto_mute = 1;
2067 spec->gen.suppress_auto_mic = 1;
2068 /* disable aamix as well */
2069 spec->gen.mixer_nid = 0;
2070 /* add location prefix to avoid conflicts */
2071 codec->force_pin_prefix = 1;
2074 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2075 const char *newname)
2077 struct snd_kcontrol *kctl;
2079 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2081 strcpy(kctl->id.name, newname);
2084 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2085 const struct hda_fixup *fix,
2088 alc_fixup_dual_codecs(codec, fix, action);
2090 case HDA_FIXUP_ACT_PRE_PROBE:
2091 /* override card longname to provide a unique UCM profile */
2092 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2094 case HDA_FIXUP_ACT_BUILD:
2095 /* rename Capture controls depending on the codec */
2096 rename_ctl(codec, "Capture Volume",
2098 "Rear-Panel Capture Volume" :
2099 "Front-Panel Capture Volume");
2100 rename_ctl(codec, "Capture Switch",
2102 "Rear-Panel Capture Switch" :
2103 "Front-Panel Capture Switch");
2108 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2109 const struct hda_fixup *fix,
2112 static const hda_nid_t conn1[] = { 0x0c };
2114 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2117 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2118 /* We therefore want to make sure 0x14 (front headphone) and
2119 * 0x1b (speakers) use the stereo DAC 0x02
2121 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
2122 snd_hda_override_conn_list(codec, 0x1b, ARRAY_SIZE(conn1), conn1);
2125 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2126 const struct hda_fixup *fix, int action);
2128 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2129 const struct hda_fixup *fix,
2132 alc1220_fixup_clevo_p950(codec, fix, action);
2133 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2136 static const struct hda_fixup alc882_fixups[] = {
2137 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2138 .type = HDA_FIXUP_PINS,
2139 .v.pins = (const struct hda_pintbl[]) {
2140 { 0x15, 0x01080104 }, /* side */
2141 { 0x16, 0x01011012 }, /* rear */
2142 { 0x17, 0x01016011 }, /* clfe */
2146 [ALC882_FIXUP_LENOVO_Y530] = {
2147 .type = HDA_FIXUP_PINS,
2148 .v.pins = (const struct hda_pintbl[]) {
2149 { 0x15, 0x99130112 }, /* rear int speakers */
2150 { 0x16, 0x99130111 }, /* subwoofer */
2154 [ALC882_FIXUP_PB_M5210] = {
2155 .type = HDA_FIXUP_PINCTLS,
2156 .v.pins = (const struct hda_pintbl[]) {
2157 { 0x19, PIN_VREF50 },
2161 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2162 .type = HDA_FIXUP_FUNC,
2163 .v.func = alc_fixup_sku_ignore,
2165 [ALC882_FIXUP_ASUS_W90V] = {
2166 .type = HDA_FIXUP_PINS,
2167 .v.pins = (const struct hda_pintbl[]) {
2168 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2172 [ALC889_FIXUP_CD] = {
2173 .type = HDA_FIXUP_PINS,
2174 .v.pins = (const struct hda_pintbl[]) {
2175 { 0x1c, 0x993301f0 }, /* CD */
2179 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2180 .type = HDA_FIXUP_PINS,
2181 .v.pins = (const struct hda_pintbl[]) {
2182 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2186 .chain_id = ALC889_FIXUP_CD,
2188 [ALC889_FIXUP_VAIO_TT] = {
2189 .type = HDA_FIXUP_PINS,
2190 .v.pins = (const struct hda_pintbl[]) {
2191 { 0x17, 0x90170111 }, /* hidden surround speaker */
2195 [ALC888_FIXUP_EEE1601] = {
2196 .type = HDA_FIXUP_VERBS,
2197 .v.verbs = (const struct hda_verb[]) {
2198 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2199 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2203 [ALC882_FIXUP_EAPD] = {
2204 .type = HDA_FIXUP_VERBS,
2205 .v.verbs = (const struct hda_verb[]) {
2206 /* change to EAPD mode */
2207 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2208 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2212 [ALC883_FIXUP_EAPD] = {
2213 .type = HDA_FIXUP_VERBS,
2214 .v.verbs = (const struct hda_verb[]) {
2215 /* change to EAPD mode */
2216 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2217 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2221 [ALC883_FIXUP_ACER_EAPD] = {
2222 .type = HDA_FIXUP_VERBS,
2223 .v.verbs = (const struct hda_verb[]) {
2224 /* eanable EAPD on Acer laptops */
2225 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2226 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2230 [ALC882_FIXUP_GPIO1] = {
2231 .type = HDA_FIXUP_FUNC,
2232 .v.func = alc_fixup_gpio1,
2234 [ALC882_FIXUP_GPIO2] = {
2235 .type = HDA_FIXUP_FUNC,
2236 .v.func = alc_fixup_gpio2,
2238 [ALC882_FIXUP_GPIO3] = {
2239 .type = HDA_FIXUP_FUNC,
2240 .v.func = alc_fixup_gpio3,
2242 [ALC882_FIXUP_ASUS_W2JC] = {
2243 .type = HDA_FIXUP_FUNC,
2244 .v.func = alc_fixup_gpio1,
2246 .chain_id = ALC882_FIXUP_EAPD,
2248 [ALC889_FIXUP_COEF] = {
2249 .type = HDA_FIXUP_FUNC,
2250 .v.func = alc889_fixup_coef,
2252 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2253 .type = HDA_FIXUP_PINS,
2254 .v.pins = (const struct hda_pintbl[]) {
2255 { 0x16, 0x99130111 }, /* CLFE speaker */
2256 { 0x17, 0x99130112 }, /* surround speaker */
2260 .chain_id = ALC882_FIXUP_GPIO1,
2262 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2263 .type = HDA_FIXUP_PINS,
2264 .v.pins = (const struct hda_pintbl[]) {
2265 { 0x16, 0x99130111 }, /* CLFE speaker */
2266 { 0x1b, 0x99130112 }, /* surround speaker */
2270 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2272 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2273 /* additional init verbs for Acer Aspire 8930G */
2274 .type = HDA_FIXUP_VERBS,
2275 .v.verbs = (const struct hda_verb[]) {
2276 /* Enable all DACs */
2277 /* DAC DISABLE/MUTE 1? */
2278 /* setting bits 1-5 disables DAC nids 0x02-0x06
2279 * apparently. Init=0x38 */
2280 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2281 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2282 /* DAC DISABLE/MUTE 2? */
2283 /* some bit here disables the other DACs.
2285 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2286 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2288 * This laptop has a stereo digital microphone.
2289 * The mics are only 1cm apart which makes the stereo
2290 * useless. However, either the mic or the ALC889
2291 * makes the signal become a difference/sum signal
2292 * instead of standard stereo, which is annoying.
2293 * So instead we flip this bit which makes the
2294 * codec replicate the sum signal to both channels,
2295 * turning it into a normal mono mic.
2297 /* DMIC_CONTROL? Init value = 0x0001 */
2298 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2299 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2300 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2301 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2305 .chain_id = ALC882_FIXUP_GPIO1,
2307 [ALC885_FIXUP_MACPRO_GPIO] = {
2308 .type = HDA_FIXUP_FUNC,
2309 .v.func = alc885_fixup_macpro_gpio,
2311 [ALC889_FIXUP_DAC_ROUTE] = {
2312 .type = HDA_FIXUP_FUNC,
2313 .v.func = alc889_fixup_dac_route,
2315 [ALC889_FIXUP_MBP_VREF] = {
2316 .type = HDA_FIXUP_FUNC,
2317 .v.func = alc889_fixup_mbp_vref,
2319 .chain_id = ALC882_FIXUP_GPIO1,
2321 [ALC889_FIXUP_IMAC91_VREF] = {
2322 .type = HDA_FIXUP_FUNC,
2323 .v.func = alc889_fixup_imac91_vref,
2325 .chain_id = ALC882_FIXUP_GPIO1,
2327 [ALC889_FIXUP_MBA11_VREF] = {
2328 .type = HDA_FIXUP_FUNC,
2329 .v.func = alc889_fixup_mba11_vref,
2331 .chain_id = ALC889_FIXUP_MBP_VREF,
2333 [ALC889_FIXUP_MBA21_VREF] = {
2334 .type = HDA_FIXUP_FUNC,
2335 .v.func = alc889_fixup_mba21_vref,
2337 .chain_id = ALC889_FIXUP_MBP_VREF,
2339 [ALC889_FIXUP_MP11_VREF] = {
2340 .type = HDA_FIXUP_FUNC,
2341 .v.func = alc889_fixup_mba11_vref,
2343 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2345 [ALC889_FIXUP_MP41_VREF] = {
2346 .type = HDA_FIXUP_FUNC,
2347 .v.func = alc889_fixup_mbp_vref,
2349 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2351 [ALC882_FIXUP_INV_DMIC] = {
2352 .type = HDA_FIXUP_FUNC,
2353 .v.func = alc_fixup_inv_dmic,
2355 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2356 .type = HDA_FIXUP_FUNC,
2357 .v.func = alc882_fixup_no_primary_hp,
2359 [ALC887_FIXUP_ASUS_BASS] = {
2360 .type = HDA_FIXUP_PINS,
2361 .v.pins = (const struct hda_pintbl[]) {
2362 {0x16, 0x99130130}, /* bass speaker */
2366 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2368 [ALC887_FIXUP_BASS_CHMAP] = {
2369 .type = HDA_FIXUP_FUNC,
2370 .v.func = alc_fixup_bass_chmap,
2372 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2373 .type = HDA_FIXUP_FUNC,
2374 .v.func = alc1220_fixup_gb_dual_codecs,
2376 [ALC1220_FIXUP_CLEVO_P950] = {
2377 .type = HDA_FIXUP_FUNC,
2378 .v.func = alc1220_fixup_clevo_p950,
2380 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2381 .type = HDA_FIXUP_FUNC,
2382 .v.func = alc1220_fixup_clevo_pb51ed,
2384 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2385 .type = HDA_FIXUP_PINS,
2386 .v.pins = (const struct hda_pintbl[]) {
2387 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2391 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2395 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2396 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2397 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2398 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2399 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2400 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2401 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2402 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2403 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2404 ALC882_FIXUP_ACER_ASPIRE_4930G),
2405 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2406 ALC882_FIXUP_ACER_ASPIRE_4930G),
2407 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2408 ALC882_FIXUP_ACER_ASPIRE_8930G),
2409 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2410 ALC882_FIXUP_ACER_ASPIRE_8930G),
2411 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2412 ALC882_FIXUP_ACER_ASPIRE_4930G),
2413 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2414 ALC882_FIXUP_ACER_ASPIRE_4930G),
2415 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2416 ALC882_FIXUP_ACER_ASPIRE_4930G),
2417 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2418 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2419 ALC882_FIXUP_ACER_ASPIRE_4930G),
2420 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2421 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2422 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2423 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2424 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2425 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2426 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2427 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2428 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2429 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2430 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2431 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2432 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2433 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2435 /* All Apple entries are in codec SSIDs */
2436 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2437 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2438 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2439 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2440 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2441 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2442 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2443 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2444 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2445 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2446 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2447 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2448 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2449 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2450 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2451 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2452 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2453 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2454 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2455 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2456 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2457 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2459 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2460 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2461 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2462 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
2463 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
2464 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
2465 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
2466 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
2467 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
2468 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950),
2469 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2470 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2471 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2472 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2473 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2474 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2475 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2476 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2477 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2478 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2479 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2480 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2481 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2482 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2483 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2484 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2485 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2486 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2490 static const struct hda_model_fixup alc882_fixup_models[] = {
2491 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2492 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2493 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2494 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2495 {.id = ALC889_FIXUP_CD, .name = "cd"},
2496 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2497 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2498 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2499 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2500 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2501 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2502 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2503 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2504 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2505 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2506 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2507 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2508 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2509 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2510 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2511 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2512 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2513 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2514 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2515 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2516 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2517 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2518 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2519 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2520 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2521 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2526 * BIOS auto configuration
2528 /* almost identical with ALC880 parser... */
2529 static int alc882_parse_auto_config(struct hda_codec *codec)
2531 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2532 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2533 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2538 static int patch_alc882(struct hda_codec *codec)
2540 struct alc_spec *spec;
2543 err = alc_alloc_spec(codec, 0x0b);
2549 switch (codec->core.vendor_id) {
2557 /* ALC883 and variants */
2558 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2562 alc_pre_init(codec);
2564 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2566 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2568 alc_auto_parse_customize_define(codec);
2570 if (has_cdefine_beep(codec))
2571 spec->gen.beep_nid = 0x01;
2573 /* automatic parse from the BIOS config */
2574 err = alc882_parse_auto_config(codec);
2578 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2579 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2584 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2597 static int alc262_parse_auto_config(struct hda_codec *codec)
2599 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2600 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2601 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2608 ALC262_FIXUP_FSC_H270,
2609 ALC262_FIXUP_FSC_S7110,
2610 ALC262_FIXUP_HP_Z200,
2612 ALC262_FIXUP_LENOVO_3000,
2614 ALC262_FIXUP_BENQ_T31,
2615 ALC262_FIXUP_INV_DMIC,
2616 ALC262_FIXUP_INTEL_BAYLEYBAY,
2619 static const struct hda_fixup alc262_fixups[] = {
2620 [ALC262_FIXUP_FSC_H270] = {
2621 .type = HDA_FIXUP_PINS,
2622 .v.pins = (const struct hda_pintbl[]) {
2623 { 0x14, 0x99130110 }, /* speaker */
2624 { 0x15, 0x0221142f }, /* front HP */
2625 { 0x1b, 0x0121141f }, /* rear HP */
2629 [ALC262_FIXUP_FSC_S7110] = {
2630 .type = HDA_FIXUP_PINS,
2631 .v.pins = (const struct hda_pintbl[]) {
2632 { 0x15, 0x90170110 }, /* speaker */
2636 .chain_id = ALC262_FIXUP_BENQ,
2638 [ALC262_FIXUP_HP_Z200] = {
2639 .type = HDA_FIXUP_PINS,
2640 .v.pins = (const struct hda_pintbl[]) {
2641 { 0x16, 0x99130120 }, /* internal speaker */
2645 [ALC262_FIXUP_TYAN] = {
2646 .type = HDA_FIXUP_PINS,
2647 .v.pins = (const struct hda_pintbl[]) {
2648 { 0x14, 0x1993e1f0 }, /* int AUX */
2652 [ALC262_FIXUP_LENOVO_3000] = {
2653 .type = HDA_FIXUP_PINCTLS,
2654 .v.pins = (const struct hda_pintbl[]) {
2655 { 0x19, PIN_VREF50 },
2659 .chain_id = ALC262_FIXUP_BENQ,
2661 [ALC262_FIXUP_BENQ] = {
2662 .type = HDA_FIXUP_VERBS,
2663 .v.verbs = (const struct hda_verb[]) {
2664 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2665 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2669 [ALC262_FIXUP_BENQ_T31] = {
2670 .type = HDA_FIXUP_VERBS,
2671 .v.verbs = (const struct hda_verb[]) {
2672 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2673 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2677 [ALC262_FIXUP_INV_DMIC] = {
2678 .type = HDA_FIXUP_FUNC,
2679 .v.func = alc_fixup_inv_dmic,
2681 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2682 .type = HDA_FIXUP_FUNC,
2683 .v.func = alc_fixup_no_depop_delay,
2687 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2688 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2689 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2690 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2691 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2692 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2693 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2694 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2695 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2696 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2697 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2701 static const struct hda_model_fixup alc262_fixup_models[] = {
2702 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2703 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2704 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2705 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2706 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2707 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2708 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2709 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2710 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2716 static int patch_alc262(struct hda_codec *codec)
2718 struct alc_spec *spec;
2721 err = alc_alloc_spec(codec, 0x0b);
2726 spec->gen.shared_mic_vref_pin = 0x18;
2728 spec->shutup = alc_eapd_shutup;
2731 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2734 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2736 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2738 alc_pre_init(codec);
2740 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2742 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2744 alc_auto_parse_customize_define(codec);
2746 if (has_cdefine_beep(codec))
2747 spec->gen.beep_nid = 0x01;
2749 /* automatic parse from the BIOS config */
2750 err = alc262_parse_auto_config(codec);
2754 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2755 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2760 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2772 /* bind Beep switches of both NID 0x0f and 0x10 */
2773 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2774 struct snd_ctl_elem_value *ucontrol)
2776 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2780 mutex_lock(&codec->control_mutex);
2781 pval = kcontrol->private_value;
2782 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2783 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2785 kcontrol->private_value = (pval & ~0xff) | 0x10;
2786 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2788 kcontrol->private_value = pval;
2789 mutex_unlock(&codec->control_mutex);
2793 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2794 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2796 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2797 .name = "Beep Playback Switch",
2798 .subdevice = HDA_SUBDEV_AMP_FLAG,
2799 .info = snd_hda_mixer_amp_switch_info,
2800 .get = snd_hda_mixer_amp_switch_get,
2801 .put = alc268_beep_switch_put,
2802 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2806 /* set PCBEEP vol = 0, mute connections */
2807 static const struct hda_verb alc268_beep_init_verbs[] = {
2808 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2809 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2810 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2815 ALC268_FIXUP_INV_DMIC,
2816 ALC268_FIXUP_HP_EAPD,
2820 static const struct hda_fixup alc268_fixups[] = {
2821 [ALC268_FIXUP_INV_DMIC] = {
2822 .type = HDA_FIXUP_FUNC,
2823 .v.func = alc_fixup_inv_dmic,
2825 [ALC268_FIXUP_HP_EAPD] = {
2826 .type = HDA_FIXUP_VERBS,
2827 .v.verbs = (const struct hda_verb[]) {
2828 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2832 [ALC268_FIXUP_SPDIF] = {
2833 .type = HDA_FIXUP_PINS,
2834 .v.pins = (const struct hda_pintbl[]) {
2835 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2841 static const struct hda_model_fixup alc268_fixup_models[] = {
2842 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2843 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2844 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2848 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2849 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2850 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2851 /* below is codec SSID since multiple Toshiba laptops have the
2852 * same PCI SSID 1179:ff00
2854 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2859 * BIOS auto configuration
2861 static int alc268_parse_auto_config(struct hda_codec *codec)
2863 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2864 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2869 static int patch_alc268(struct hda_codec *codec)
2871 struct alc_spec *spec;
2874 /* ALC268 has no aa-loopback mixer */
2875 err = alc_alloc_spec(codec, 0);
2880 if (has_cdefine_beep(codec))
2881 spec->gen.beep_nid = 0x01;
2883 spec->shutup = alc_eapd_shutup;
2885 alc_pre_init(codec);
2887 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2888 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2890 /* automatic parse from the BIOS config */
2891 err = alc268_parse_auto_config(codec);
2895 if (err > 0 && !spec->gen.no_analog &&
2896 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2897 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2898 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2899 &alc268_beep_mixer[i])) {
2904 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2905 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2906 /* override the amp caps for beep generator */
2907 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
2908 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
2909 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
2910 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2911 (0 << AC_AMPCAP_MUTE_SHIFT));
2914 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2927 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
2928 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2931 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
2932 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2935 /* different alc269-variants */
2937 ALC269_TYPE_ALC269VA,
2938 ALC269_TYPE_ALC269VB,
2939 ALC269_TYPE_ALC269VC,
2940 ALC269_TYPE_ALC269VD,
2960 * BIOS auto configuration
2962 static int alc269_parse_auto_config(struct hda_codec *codec)
2964 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
2965 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
2966 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2967 struct alc_spec *spec = codec->spec;
2968 const hda_nid_t *ssids;
2970 switch (spec->codec_variant) {
2971 case ALC269_TYPE_ALC269VA:
2972 case ALC269_TYPE_ALC269VC:
2973 case ALC269_TYPE_ALC280:
2974 case ALC269_TYPE_ALC284:
2975 case ALC269_TYPE_ALC293:
2976 ssids = alc269va_ssids;
2978 case ALC269_TYPE_ALC269VB:
2979 case ALC269_TYPE_ALC269VD:
2980 case ALC269_TYPE_ALC282:
2981 case ALC269_TYPE_ALC283:
2982 case ALC269_TYPE_ALC286:
2983 case ALC269_TYPE_ALC298:
2984 case ALC269_TYPE_ALC255:
2985 case ALC269_TYPE_ALC256:
2986 case ALC269_TYPE_ALC257:
2987 case ALC269_TYPE_ALC215:
2988 case ALC269_TYPE_ALC225:
2989 case ALC269_TYPE_ALC294:
2990 case ALC269_TYPE_ALC300:
2991 case ALC269_TYPE_ALC623:
2992 case ALC269_TYPE_ALC700:
2993 ssids = alc269_ssids;
2996 ssids = alc269_ssids;
3000 return alc_parse_auto_config(codec, alc269_ignore, ssids);
3003 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
3004 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
3005 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
3006 { SND_JACK_BTN_2, KEY_VOLUMEUP },
3007 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
3011 static void alc_headset_btn_callback(struct hda_codec *codec,
3012 struct hda_jack_callback *jack)
3016 if (jack->unsol_res & (7 << 13))
3017 report |= SND_JACK_BTN_0;
3019 if (jack->unsol_res & (1 << 16 | 3 << 8))
3020 report |= SND_JACK_BTN_1;
3023 if (jack->unsol_res & (7 << 23))
3024 report |= SND_JACK_BTN_2;
3026 /* Volume down key */
3027 if (jack->unsol_res & (7 << 10))
3028 report |= SND_JACK_BTN_3;
3030 jack->jack->button_state = report;
3033 static void alc_disable_headset_jack_key(struct hda_codec *codec)
3035 struct alc_spec *spec = codec->spec;
3037 if (!spec->has_hs_key)
3040 switch (codec->core.vendor_id) {
3047 alc_write_coef_idx(codec, 0x48, 0x0);
3048 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3049 alc_update_coef_idx(codec, 0x44, 0x0045 << 8, 0x0);
3053 alc_write_coef_idx(codec, 0x48, 0x0);
3054 alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
3059 static void alc_enable_headset_jack_key(struct hda_codec *codec)
3061 struct alc_spec *spec = codec->spec;
3063 if (!spec->has_hs_key)
3066 switch (codec->core.vendor_id) {
3073 alc_write_coef_idx(codec, 0x48, 0xd011);
3074 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3075 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
3079 alc_write_coef_idx(codec, 0x48, 0xd011);
3080 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
3085 static void alc_fixup_headset_jack(struct hda_codec *codec,
3086 const struct hda_fixup *fix, int action)
3088 struct alc_spec *spec = codec->spec;
3091 case HDA_FIXUP_ACT_PRE_PROBE:
3092 spec->has_hs_key = 1;
3093 snd_hda_jack_detect_enable_callback(codec, 0x55,
3094 alc_headset_btn_callback);
3095 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
3096 SND_JACK_HEADSET, alc_headset_btn_keymap);
3098 case HDA_FIXUP_ACT_INIT:
3099 alc_enable_headset_jack_key(codec);
3104 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
3106 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
3109 static void alc269_shutup(struct hda_codec *codec)
3111 struct alc_spec *spec = codec->spec;
3113 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3114 alc269vb_toggle_power_output(codec, 0);
3115 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3116 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3119 alc_shutup_pins(codec);
3122 static const struct coef_fw alc282_coefs[] = {
3123 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3124 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3125 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3126 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3127 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3128 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3129 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3130 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3131 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3132 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3133 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3134 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3135 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3136 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3137 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3138 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3139 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3140 WRITE_COEF(0x63, 0x2902), /* PLL */
3141 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3142 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3143 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3144 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3145 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3146 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3147 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3148 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3149 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3150 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3151 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3155 static void alc282_restore_default_value(struct hda_codec *codec)
3157 alc_process_coef_fw(codec, alc282_coefs);
3160 static void alc282_init(struct hda_codec *codec)
3162 struct alc_spec *spec = codec->spec;
3163 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3167 alc282_restore_default_value(codec);
3171 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3172 coef78 = alc_read_coef_idx(codec, 0x78);
3174 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3175 /* Headphone capless set to high power mode */
3176 alc_write_coef_idx(codec, 0x78, 0x9004);
3181 snd_hda_codec_write(codec, hp_pin, 0,
3182 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3187 snd_hda_codec_write(codec, hp_pin, 0,
3188 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3193 /* Headphone capless set to normal mode */
3194 alc_write_coef_idx(codec, 0x78, coef78);
3197 static void alc282_shutup(struct hda_codec *codec)
3199 struct alc_spec *spec = codec->spec;
3200 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3205 alc269_shutup(codec);
3209 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3210 coef78 = alc_read_coef_idx(codec, 0x78);
3211 alc_write_coef_idx(codec, 0x78, 0x9004);
3216 snd_hda_codec_write(codec, hp_pin, 0,
3217 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3222 if (!spec->no_shutup_pins)
3223 snd_hda_codec_write(codec, hp_pin, 0,
3224 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3229 alc_auto_setup_eapd(codec, false);
3230 alc_shutup_pins(codec);
3231 alc_write_coef_idx(codec, 0x78, coef78);
3234 static const struct coef_fw alc283_coefs[] = {
3235 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3236 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3237 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3238 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3239 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3240 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3241 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3242 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3243 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3244 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3245 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3246 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3247 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3248 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3249 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3250 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3251 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3252 WRITE_COEF(0x2e, 0x2902), /* PLL */
3253 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3254 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3255 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3256 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3257 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3258 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3259 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3260 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3261 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3262 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3263 WRITE_COEF(0x49, 0x0), /* test mode */
3264 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3265 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3266 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3267 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3271 static void alc283_restore_default_value(struct hda_codec *codec)
3273 alc_process_coef_fw(codec, alc283_coefs);
3276 static void alc283_init(struct hda_codec *codec)
3278 struct alc_spec *spec = codec->spec;
3279 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3282 alc283_restore_default_value(codec);
3288 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3290 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3291 /* Headphone capless set to high power mode */
3292 alc_write_coef_idx(codec, 0x43, 0x9004);
3294 snd_hda_codec_write(codec, hp_pin, 0,
3295 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3300 snd_hda_codec_write(codec, hp_pin, 0,
3301 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3305 /* Index 0x46 Combo jack auto switch control 2 */
3306 /* 3k pull low control for Headset jack. */
3307 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3308 /* Headphone capless set to normal mode */
3309 alc_write_coef_idx(codec, 0x43, 0x9614);
3312 static void alc283_shutup(struct hda_codec *codec)
3314 struct alc_spec *spec = codec->spec;
3315 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3319 alc269_shutup(codec);
3323 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3325 alc_write_coef_idx(codec, 0x43, 0x9004);
3327 /*depop hp during suspend*/
3328 alc_write_coef_idx(codec, 0x06, 0x2100);
3330 snd_hda_codec_write(codec, hp_pin, 0,
3331 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3336 if (!spec->no_shutup_pins)
3337 snd_hda_codec_write(codec, hp_pin, 0,
3338 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3340 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3344 alc_auto_setup_eapd(codec, false);
3345 alc_shutup_pins(codec);
3346 alc_write_coef_idx(codec, 0x43, 0x9614);
3349 static void alc256_init(struct hda_codec *codec)
3351 struct alc_spec *spec = codec->spec;
3352 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3360 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3365 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3366 if (spec->ultra_low_power) {
3367 alc_update_coef_idx(codec, 0x03, 1<<1, 1<<1);
3368 alc_update_coef_idx(codec, 0x08, 3<<2, 3<<2);
3369 alc_update_coef_idx(codec, 0x08, 7<<4, 0);
3370 alc_update_coef_idx(codec, 0x3b, 1<<15, 0);
3371 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3375 snd_hda_codec_write(codec, hp_pin, 0,
3376 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3378 if (hp_pin_sense || spec->ultra_low_power)
3381 snd_hda_codec_write(codec, hp_pin, 0,
3382 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3384 if (hp_pin_sense || spec->ultra_low_power)
3387 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3388 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3389 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3390 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3392 * Expose headphone mic (or possibly Line In on some machines) instead
3393 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3394 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3397 alc_write_coef_idx(codec, 0x36, 0x5757);
3400 static void alc256_shutup(struct hda_codec *codec)
3402 struct alc_spec *spec = codec->spec;
3403 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3409 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3414 snd_hda_codec_write(codec, hp_pin, 0,
3415 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3417 if (hp_pin_sense || spec->ultra_low_power)
3420 /* 3k pull low control for Headset jack. */
3421 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3422 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3424 if (!spec->no_shutup_pins)
3425 snd_hda_codec_write(codec, hp_pin, 0,
3426 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3428 if (hp_pin_sense || spec->ultra_low_power)
3431 alc_auto_setup_eapd(codec, false);
3432 alc_shutup_pins(codec);
3433 if (spec->ultra_low_power) {
3435 alc_update_coef_idx(codec, 0x03, 1<<1, 0);
3436 alc_update_coef_idx(codec, 0x08, 7<<4, 7<<4);
3437 alc_update_coef_idx(codec, 0x08, 3<<2, 0);
3438 alc_update_coef_idx(codec, 0x3b, 1<<15, 1<<15);
3439 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3444 static void alc225_init(struct hda_codec *codec)
3446 struct alc_spec *spec = codec->spec;
3447 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3448 bool hp1_pin_sense, hp2_pin_sense;
3454 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3455 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3457 if (hp1_pin_sense || hp2_pin_sense)
3460 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3461 if (spec->ultra_low_power) {
3462 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 3<<2);
3463 alc_update_coef_idx(codec, 0x0e, 7<<6, 7<<6);
3464 alc_update_coef_idx(codec, 0x33, 1<<11, 0);
3468 if (hp1_pin_sense || spec->ultra_low_power)
3469 snd_hda_codec_write(codec, hp_pin, 0,
3470 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3472 snd_hda_codec_write(codec, 0x16, 0,
3473 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3475 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3478 if (hp1_pin_sense || spec->ultra_low_power)
3479 snd_hda_codec_write(codec, hp_pin, 0,
3480 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3482 snd_hda_codec_write(codec, 0x16, 0,
3483 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3485 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3488 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3489 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3492 static void alc225_shutup(struct hda_codec *codec)
3494 struct alc_spec *spec = codec->spec;
3495 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3496 bool hp1_pin_sense, hp2_pin_sense;
3501 alc_disable_headset_jack_key(codec);
3502 /* 3k pull low control for Headset jack. */
3503 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3505 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3506 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3508 if (hp1_pin_sense || hp2_pin_sense)
3511 if (hp1_pin_sense || spec->ultra_low_power)
3512 snd_hda_codec_write(codec, hp_pin, 0,
3513 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3515 snd_hda_codec_write(codec, 0x16, 0,
3516 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3518 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3521 if (hp1_pin_sense || spec->ultra_low_power)
3522 snd_hda_codec_write(codec, hp_pin, 0,
3523 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3525 snd_hda_codec_write(codec, 0x16, 0,
3526 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3528 if (hp1_pin_sense || hp2_pin_sense || spec->ultra_low_power)
3531 alc_auto_setup_eapd(codec, false);
3532 alc_shutup_pins(codec);
3533 if (spec->ultra_low_power) {
3535 alc_update_coef_idx(codec, 0x08, 0x0f << 2, 0x0c << 2);
3536 alc_update_coef_idx(codec, 0x0e, 7<<6, 0);
3537 alc_update_coef_idx(codec, 0x33, 1<<11, 1<<11);
3538 alc_update_coef_idx(codec, 0x4a, 3<<4, 2<<4);
3542 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3543 alc_enable_headset_jack_key(codec);
3546 static void alc_default_init(struct hda_codec *codec)
3548 struct alc_spec *spec = codec->spec;
3549 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3557 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3562 snd_hda_codec_write(codec, hp_pin, 0,
3563 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3568 snd_hda_codec_write(codec, hp_pin, 0,
3569 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3575 static void alc_default_shutup(struct hda_codec *codec)
3577 struct alc_spec *spec = codec->spec;
3578 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3582 alc269_shutup(codec);
3586 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3591 snd_hda_codec_write(codec, hp_pin, 0,
3592 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3597 if (!spec->no_shutup_pins)
3598 snd_hda_codec_write(codec, hp_pin, 0,
3599 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3604 alc_auto_setup_eapd(codec, false);
3605 alc_shutup_pins(codec);
3608 static void alc294_hp_init(struct hda_codec *codec)
3610 struct alc_spec *spec = codec->spec;
3611 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3617 snd_hda_codec_write(codec, hp_pin, 0,
3618 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3622 if (!spec->no_shutup_pins)
3623 snd_hda_codec_write(codec, hp_pin, 0,
3624 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3626 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3627 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3629 /* Wait for depop procedure finish */
3630 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3631 for (i = 0; i < 20 && val & 0x0080; i++) {
3633 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3635 /* Set HP depop to auto mode */
3636 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3640 static void alc294_init(struct hda_codec *codec)
3642 struct alc_spec *spec = codec->spec;
3644 /* required only at boot or S4 resume time */
3645 if (!spec->done_hp_init ||
3646 codec->core.dev.power.power_state.event == PM_EVENT_RESTORE) {
3647 alc294_hp_init(codec);
3648 spec->done_hp_init = true;
3650 alc_default_init(codec);
3653 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3656 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3657 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3658 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3661 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3665 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3666 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3668 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3673 static void alc5505_dsp_halt(struct hda_codec *codec)
3677 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3678 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3679 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3680 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3681 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3682 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3683 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3684 val = alc5505_coef_get(codec, 0x6220);
3685 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3688 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3690 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3691 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3692 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3693 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3694 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3695 alc5505_coef_set(codec, 0x880c, 0x00000004);
3698 static void alc5505_dsp_init(struct hda_codec *codec)
3702 alc5505_dsp_halt(codec);
3703 alc5505_dsp_back_from_halt(codec);
3704 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3705 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3706 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3707 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3708 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3709 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3710 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3711 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3712 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3713 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3714 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3715 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3716 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3718 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3720 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3722 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3724 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3725 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3726 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3727 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3728 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3729 alc5505_coef_set(codec, 0x880c, 0x00000003);
3730 alc5505_coef_set(codec, 0x880c, 0x00000010);
3732 #ifdef HALT_REALTEK_ALC5505
3733 alc5505_dsp_halt(codec);
3737 #ifdef HALT_REALTEK_ALC5505
3738 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3739 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3741 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3742 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3746 static int alc269_suspend(struct hda_codec *codec)
3748 struct alc_spec *spec = codec->spec;
3750 if (spec->has_alc5505_dsp)
3751 alc5505_dsp_suspend(codec);
3752 return alc_suspend(codec);
3755 static int alc269_resume(struct hda_codec *codec)
3757 struct alc_spec *spec = codec->spec;
3759 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3760 alc269vb_toggle_power_output(codec, 0);
3761 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3762 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3766 codec->patch_ops.init(codec);
3768 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3769 alc269vb_toggle_power_output(codec, 1);
3770 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3771 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3775 snd_hda_regmap_sync(codec);
3776 hda_call_check_power_status(codec, 0x01);
3778 /* on some machine, the BIOS will clear the codec gpio data when enter
3779 * suspend, and won't restore the data after resume, so we restore it
3782 if (spec->gpio_data)
3783 alc_write_gpio_data(codec);
3785 if (spec->has_alc5505_dsp)
3786 alc5505_dsp_resume(codec);
3790 #endif /* CONFIG_PM */
3792 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3793 const struct hda_fixup *fix, int action)
3795 struct alc_spec *spec = codec->spec;
3797 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3798 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3801 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3802 const struct hda_fixup *fix,
3805 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3806 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3808 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3809 snd_hda_codec_set_pincfg(codec, 0x19,
3810 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3811 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3814 static void alc269_fixup_hweq(struct hda_codec *codec,
3815 const struct hda_fixup *fix, int action)
3817 if (action == HDA_FIXUP_ACT_INIT)
3818 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3821 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3822 const struct hda_fixup *fix, int action)
3824 struct alc_spec *spec = codec->spec;
3826 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3827 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3830 static void alc271_fixup_dmic(struct hda_codec *codec,
3831 const struct hda_fixup *fix, int action)
3833 static const struct hda_verb verbs[] = {
3834 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3835 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3840 if (strcmp(codec->core.chip_name, "ALC271X") &&
3841 strcmp(codec->core.chip_name, "ALC269VB"))
3843 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3844 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3845 snd_hda_sequence_write(codec, verbs);
3848 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3849 const struct hda_fixup *fix, int action)
3851 struct alc_spec *spec = codec->spec;
3853 if (action != HDA_FIXUP_ACT_PROBE)
3856 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3857 * fix the sample rate of analog I/O to 44.1kHz
3859 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3860 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3863 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3864 const struct hda_fixup *fix, int action)
3866 /* The digital-mic unit sends PDM (differential signal) instead of
3867 * the standard PCM, thus you can't record a valid mono stream as is.
3868 * Below is a workaround specific to ALC269 to control the dmic
3869 * signal source as mono.
3871 if (action == HDA_FIXUP_ACT_INIT)
3872 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3875 static void alc269_quanta_automute(struct hda_codec *codec)
3877 snd_hda_gen_update_outputs(codec);
3879 alc_write_coef_idx(codec, 0x0c, 0x680);
3880 alc_write_coef_idx(codec, 0x0c, 0x480);
3883 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3884 const struct hda_fixup *fix, int action)
3886 struct alc_spec *spec = codec->spec;
3887 if (action != HDA_FIXUP_ACT_PROBE)
3889 spec->gen.automute_hook = alc269_quanta_automute;
3892 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3893 struct hda_jack_callback *jack)
3895 struct alc_spec *spec = codec->spec;
3898 snd_hda_gen_hp_automute(codec, jack);
3900 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3902 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3905 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3910 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
3912 struct hda_alc298_mbxinit {
3913 unsigned char value_0x23;
3914 unsigned char value_0x25;
3917 static void alc298_huawei_mbx_stereo_seq(struct hda_codec *codec,
3918 const struct hda_alc298_mbxinit *initval,
3921 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x0);
3922 alc_write_coef_idx(codec, 0x26, 0xb000);
3925 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_GET_PIN_SENSE, 0x0);
3927 snd_hda_codec_write(codec, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
3928 alc_write_coef_idx(codec, 0x26, 0xf000);
3929 alc_write_coef_idx(codec, 0x23, initval->value_0x23);
3931 if (initval->value_0x23 != 0x1e)
3932 alc_write_coef_idx(codec, 0x25, initval->value_0x25);
3934 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
3935 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
3938 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec *codec,
3939 const struct hda_fixup *fix,
3942 /* Initialization magic */
3943 static const struct hda_alc298_mbxinit dac_init[] = {
3944 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
3945 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
3946 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
3947 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
3948 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
3949 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
3951 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
3952 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
3953 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
3956 const struct hda_alc298_mbxinit *seq;
3958 if (action != HDA_FIXUP_ACT_INIT)
3962 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x00);
3963 snd_hda_codec_write(codec, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3, 0x80);
3964 alc_write_coef_idx(codec, 0x26, 0xf000);
3965 alc_write_coef_idx(codec, 0x22, 0x31);
3966 alc_write_coef_idx(codec, 0x23, 0x0b);
3967 alc_write_coef_idx(codec, 0x25, 0x00);
3968 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX, 0x26);
3969 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_PROC_COEF, 0xb010);
3971 for (seq = dac_init; seq->value_0x23; seq++)
3972 alc298_huawei_mbx_stereo_seq(codec, seq, seq == dac_init);
3975 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
3976 const struct hda_fixup *fix, int action)
3978 struct alc_spec *spec = codec->spec;
3979 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3980 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3981 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
3986 /* update mute-LED according to the speaker mute state via mic VREF pin */
3987 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
3989 struct hda_codec *codec = private_data;
3990 struct alc_spec *spec = codec->spec;
3991 unsigned int pinval;
3993 if (spec->mute_led_polarity)
3995 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3996 pinval &= ~AC_PINCTL_VREFEN;
3997 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3998 if (spec->mute_led_nid) {
3999 /* temporarily power up/down for setting VREF */
4000 snd_hda_power_up_pm(codec);
4001 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
4002 snd_hda_power_down_pm(codec);
4006 /* Make sure the led works even in runtime suspend */
4007 static unsigned int led_power_filter(struct hda_codec *codec,
4009 unsigned int power_state)
4011 struct alc_spec *spec = codec->spec;
4013 if (power_state != AC_PWRST_D3 || nid == 0 ||
4014 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
4017 /* Set pin ctl again, it might have just been set to 0 */
4018 snd_hda_set_pin_ctl(codec, nid,
4019 snd_hda_codec_get_pin_target(codec, nid));
4021 return snd_hda_gen_path_power_filter(codec, nid, power_state);
4024 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
4025 const struct hda_fixup *fix, int action)
4027 struct alc_spec *spec = codec->spec;
4028 const struct dmi_device *dev = NULL;
4030 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4033 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
4035 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
4037 if (pin < 0x0a || pin >= 0x10)
4039 spec->mute_led_polarity = pol;
4040 spec->mute_led_nid = pin - 0x0a + 0x18;
4041 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
4042 spec->gen.vmaster_mute_enum = 1;
4043 codec->power_filter = led_power_filter;
4045 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
4046 spec->mute_led_polarity);
4051 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
4052 const struct hda_fixup *fix,
4053 int action, hda_nid_t pin)
4055 struct alc_spec *spec = codec->spec;
4057 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4058 spec->mute_led_polarity = 0;
4059 spec->mute_led_nid = pin;
4060 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
4061 spec->gen.vmaster_mute_enum = 1;
4062 codec->power_filter = led_power_filter;
4066 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
4067 const struct hda_fixup *fix, int action)
4069 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
4072 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
4073 const struct hda_fixup *fix, int action)
4075 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
4078 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
4079 const struct hda_fixup *fix, int action)
4081 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
4084 /* update LED status via GPIO */
4085 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
4086 int polarity, bool enabled)
4090 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
4093 /* turn on/off mute LED via GPIO per vmaster hook */
4094 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
4096 struct hda_codec *codec = private_data;
4097 struct alc_spec *spec = codec->spec;
4099 alc_update_gpio_led(codec, spec->gpio_mute_led_mask,
4100 spec->mute_led_polarity, enabled);
4103 /* turn on/off mic-mute LED via GPIO per capture hook */
4104 static void alc_gpio_micmute_update(struct hda_codec *codec)
4106 struct alc_spec *spec = codec->spec;
4108 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4109 spec->micmute_led_polarity,
4110 spec->gen.micmute_led.led_value);
4113 #if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO)
4114 static int micmute_led_set(struct led_classdev *led_cdev,
4115 enum led_brightness brightness)
4117 struct hda_codec *codec = dev_to_hda_codec(led_cdev->dev->parent);
4118 struct alc_spec *spec = codec->spec;
4120 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
4121 spec->micmute_led_polarity, !!brightness);
4125 static struct led_classdev micmute_led_cdev = {
4126 .name = "hda::micmute",
4127 .max_brightness = 1,
4128 .brightness_set_blocking = micmute_led_set,
4129 .default_trigger = "audio-micmute",
4133 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4134 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
4136 unsigned int mute_mask,
4137 unsigned int micmute_mask)
4139 struct alc_spec *spec = codec->spec;
4140 #if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO)
4144 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
4146 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4149 spec->gpio_mute_led_mask = mute_mask;
4150 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
4153 spec->gpio_mic_led_mask = micmute_mask;
4154 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
4156 #if IS_REACHABLE(CONFIG_LEDS_TRIGGER_AUDIO)
4157 micmute_led_cdev.brightness = ledtrig_audio_get(LED_AUDIO_MICMUTE);
4158 err = devm_led_classdev_register(&codec->core.dev, &micmute_led_cdev);
4160 codec_warn(codec, "failed to register micmute LED\n");
4165 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
4166 const struct hda_fixup *fix, int action)
4168 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4171 static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
4172 const struct hda_fixup *fix, int action)
4174 struct alc_spec *spec = codec->spec;
4176 spec->micmute_led_polarity = 1;
4178 alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
4181 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
4182 const struct hda_fixup *fix, int action)
4184 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
4187 /* turn on/off mic-mute LED per capture hook */
4188 static void alc_cap_micmute_update(struct hda_codec *codec)
4190 struct alc_spec *spec = codec->spec;
4191 unsigned int pinval;
4193 if (!spec->cap_mute_led_nid)
4195 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
4196 pinval &= ~AC_PINCTL_VREFEN;
4197 if (spec->gen.micmute_led.led_value)
4198 pinval |= AC_PINCTL_VREF_80;
4200 pinval |= AC_PINCTL_VREF_HIZ;
4201 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
4204 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
4205 const struct hda_fixup *fix, int action)
4207 struct alc_spec *spec = codec->spec;
4209 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4210 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4211 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4212 * enable headphone amp
4214 spec->gpio_mask |= 0x10;
4215 spec->gpio_dir |= 0x10;
4216 spec->cap_mute_led_nid = 0x18;
4217 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4218 codec->power_filter = led_power_filter;
4222 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
4223 const struct hda_fixup *fix, int action)
4225 struct alc_spec *spec = codec->spec;
4227 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
4228 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4229 spec->cap_mute_led_nid = 0x18;
4230 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4231 codec->power_filter = led_power_filter;
4235 /* update mute-LED according to the speaker mute state via COEF bit */
4236 static void alc_fixup_mute_led_coefbit_hook(void *private_data, int enabled)
4238 struct hda_codec *codec = private_data;
4239 struct alc_spec *spec = codec->spec;
4241 if (spec->mute_led_polarity)
4244 /* temporarily power up/down for setting COEF bit */
4245 enabled ? alc_update_coef_idx(codec, spec->mute_led_coef_idx,
4246 spec->mute_led_coefbit_mask, spec->mute_led_coefbit_off) :
4247 alc_update_coef_idx(codec, spec->mute_led_coef_idx,
4248 spec->mute_led_coefbit_mask, spec->mute_led_coefbit_on);
4251 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4252 const struct hda_fixup *fix,
4255 struct alc_spec *spec = codec->spec;
4257 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4258 spec->mute_led_polarity = 0;
4259 spec->mute_led_coef_idx = 0x0b;
4260 spec->mute_led_coefbit_mask = 1<<3;
4261 spec->mute_led_coefbit_on = 1<<3;
4262 spec->mute_led_coefbit_off = 0;
4263 spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4264 spec->gen.vmaster_mute_enum = 1;
4268 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec *codec,
4269 const struct hda_fixup *fix,
4272 struct alc_spec *spec = codec->spec;
4274 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4275 spec->mute_led_polarity = 0;
4276 spec->mute_led_coef_idx = 0x34;
4277 spec->mute_led_coefbit_mask = 1<<5;
4278 spec->mute_led_coefbit_on = 0;
4279 spec->mute_led_coefbit_off = 1<<5;
4280 spec->gen.vmaster_mute.hook = alc_fixup_mute_led_coefbit_hook;
4281 spec->gen.vmaster_mute_enum = 1;
4285 /* turn on/off mic-mute LED per capture hook by coef bit */
4286 static void alc_hp_cap_micmute_update(struct hda_codec *codec)
4288 struct alc_spec *spec = codec->spec;
4290 if (spec->gen.micmute_led.led_value)
4291 alc_update_coef_idx(codec, spec->mic_led_coef_idx,
4292 spec->mic_led_coefbit_mask, spec->mic_led_coefbit_on);
4294 alc_update_coef_idx(codec, spec->mic_led_coef_idx,
4295 spec->mic_led_coefbit_mask, spec->mic_led_coefbit_off);
4298 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4299 const struct hda_fixup *fix, int action)
4301 struct alc_spec *spec = codec->spec;
4303 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4304 spec->mic_led_coef_idx = 0x19;
4305 spec->mic_led_coefbit_mask = 1<<13;
4306 spec->mic_led_coefbit_on = 1<<13;
4307 spec->mic_led_coefbit_off = 0;
4308 snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4312 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec *codec,
4313 const struct hda_fixup *fix, int action)
4315 struct alc_spec *spec = codec->spec;
4317 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4318 spec->mic_led_coef_idx = 0x35;
4319 spec->mic_led_coefbit_mask = 3<<2;
4320 spec->mic_led_coefbit_on = 2<<2;
4321 spec->mic_led_coefbit_off = 1<<2;
4322 snd_hda_gen_add_micmute_led(codec, alc_hp_cap_micmute_update);
4326 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
4327 const struct hda_fixup *fix, int action)
4329 alc285_fixup_hp_mute_led_coefbit(codec, fix, action);
4330 alc285_fixup_hp_coef_micmute_led(codec, fix, action);
4333 static void alc236_fixup_hp_mute_led(struct hda_codec *codec,
4334 const struct hda_fixup *fix, int action)
4336 alc236_fixup_hp_mute_led_coefbit(codec, fix, action);
4337 alc236_fixup_hp_coef_micmute_led(codec, fix, action);
4340 #if IS_REACHABLE(CONFIG_INPUT)
4341 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
4342 struct hda_jack_callback *event)
4344 struct alc_spec *spec = codec->spec;
4346 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4347 send both key on and key off event for every interrupt. */
4348 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
4349 input_sync(spec->kb_dev);
4350 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
4351 input_sync(spec->kb_dev);
4354 static int alc_register_micmute_input_device(struct hda_codec *codec)
4356 struct alc_spec *spec = codec->spec;
4359 spec->kb_dev = input_allocate_device();
4360 if (!spec->kb_dev) {
4361 codec_err(codec, "Out of memory (input_allocate_device)\n");
4365 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
4367 spec->kb_dev->name = "Microphone Mute Button";
4368 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
4369 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
4370 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
4371 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
4372 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
4373 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
4375 if (input_register_device(spec->kb_dev)) {
4376 codec_err(codec, "input_register_device failed\n");
4377 input_free_device(spec->kb_dev);
4378 spec->kb_dev = NULL;
4385 /* GPIO1 = set according to SKU external amp
4386 * GPIO2 = mic mute hotkey
4388 * GPIO4 = mic mute LED
4390 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
4391 const struct hda_fixup *fix, int action)
4393 struct alc_spec *spec = codec->spec;
4395 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
4396 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4397 spec->init_amp = ALC_INIT_DEFAULT;
4398 if (alc_register_micmute_input_device(codec) != 0)
4401 spec->gpio_mask |= 0x06;
4402 spec->gpio_dir |= 0x02;
4403 spec->gpio_data |= 0x02;
4404 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4405 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4406 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4407 gpio2_mic_hotkey_event);
4415 case HDA_FIXUP_ACT_FREE:
4416 input_unregister_device(spec->kb_dev);
4417 spec->kb_dev = NULL;
4421 /* Line2 = mic mute hotkey
4422 * GPIO2 = mic mute LED
4424 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4425 const struct hda_fixup *fix, int action)
4427 struct alc_spec *spec = codec->spec;
4429 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4430 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4431 spec->init_amp = ALC_INIT_DEFAULT;
4432 if (alc_register_micmute_input_device(codec) != 0)
4435 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4436 gpio2_mic_hotkey_event);
4444 case HDA_FIXUP_ACT_FREE:
4445 input_unregister_device(spec->kb_dev);
4446 spec->kb_dev = NULL;
4450 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4451 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4454 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4455 const struct hda_fixup *fix, int action)
4457 struct alc_spec *spec = codec->spec;
4459 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4460 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4461 spec->cap_mute_led_nid = 0x18;
4462 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4466 static const struct coef_fw alc225_pre_hsmode[] = {
4467 UPDATE_COEF(0x4a, 1<<8, 0),
4468 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4469 UPDATE_COEF(0x63, 3<<14, 3<<14),
4470 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4471 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4472 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4473 UPDATE_COEF(0x4a, 3<<10, 0),
4477 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4479 static const struct coef_fw coef0255[] = {
4480 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4481 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4482 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4483 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4484 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4487 static const struct coef_fw coef0256[] = {
4488 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4489 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4490 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4491 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4492 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4495 static const struct coef_fw coef0233[] = {
4496 WRITE_COEF(0x1b, 0x0c0b),
4497 WRITE_COEF(0x45, 0xc429),
4498 UPDATE_COEF(0x35, 0x4000, 0),
4499 WRITE_COEF(0x06, 0x2104),
4500 WRITE_COEF(0x1a, 0x0001),
4501 WRITE_COEF(0x26, 0x0004),
4502 WRITE_COEF(0x32, 0x42a3),
4505 static const struct coef_fw coef0288[] = {
4506 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4507 UPDATE_COEF(0x50, 0x2000, 0x2000),
4508 UPDATE_COEF(0x56, 0x0006, 0x0006),
4509 UPDATE_COEF(0x66, 0x0008, 0),
4510 UPDATE_COEF(0x67, 0x2000, 0),
4513 static const struct coef_fw coef0298[] = {
4514 UPDATE_COEF(0x19, 0x1300, 0x0300),
4517 static const struct coef_fw coef0292[] = {
4518 WRITE_COEF(0x76, 0x000e),
4519 WRITE_COEF(0x6c, 0x2400),
4520 WRITE_COEF(0x18, 0x7308),
4521 WRITE_COEF(0x6b, 0xc429),
4524 static const struct coef_fw coef0293[] = {
4525 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4526 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4527 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4528 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4529 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4530 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4533 static const struct coef_fw coef0668[] = {
4534 WRITE_COEF(0x15, 0x0d40),
4535 WRITE_COEF(0xb7, 0x802b),
4538 static const struct coef_fw coef0225[] = {
4539 UPDATE_COEF(0x63, 3<<14, 0),
4542 static const struct coef_fw coef0274[] = {
4543 UPDATE_COEF(0x4a, 0x0100, 0),
4544 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4545 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4546 UPDATE_COEF(0x4a, 0x0010, 0),
4547 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4548 WRITE_COEF(0x45, 0x5289),
4549 UPDATE_COEF(0x4a, 0x0c00, 0),
4553 switch (codec->core.vendor_id) {
4555 alc_process_coef_fw(codec, coef0255);
4559 alc_process_coef_fw(codec, coef0256);
4564 alc_process_coef_fw(codec, coef0274);
4568 alc_process_coef_fw(codec, coef0233);
4572 alc_process_coef_fw(codec, coef0288);
4575 alc_process_coef_fw(codec, coef0298);
4576 alc_process_coef_fw(codec, coef0288);
4579 alc_process_coef_fw(codec, coef0292);
4582 alc_process_coef_fw(codec, coef0293);
4585 alc_process_coef_fw(codec, coef0668);
4593 alc_process_coef_fw(codec, alc225_pre_hsmode);
4594 alc_process_coef_fw(codec, coef0225);
4597 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4600 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4604 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4607 static const struct coef_fw coef0255[] = {
4608 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4609 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4612 static const struct coef_fw coef0256[] = {
4613 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4614 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4615 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4618 static const struct coef_fw coef0233[] = {
4619 UPDATE_COEF(0x35, 0, 1<<14),
4620 WRITE_COEF(0x06, 0x2100),
4621 WRITE_COEF(0x1a, 0x0021),
4622 WRITE_COEF(0x26, 0x008c),
4625 static const struct coef_fw coef0288[] = {
4626 UPDATE_COEF(0x4f, 0x00c0, 0),
4627 UPDATE_COEF(0x50, 0x2000, 0),
4628 UPDATE_COEF(0x56, 0x0006, 0),
4629 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4630 UPDATE_COEF(0x66, 0x0008, 0x0008),
4631 UPDATE_COEF(0x67, 0x2000, 0x2000),
4634 static const struct coef_fw coef0292[] = {
4635 WRITE_COEF(0x19, 0xa208),
4636 WRITE_COEF(0x2e, 0xacf0),
4639 static const struct coef_fw coef0293[] = {
4640 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4641 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4642 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4645 static const struct coef_fw coef0688[] = {
4646 WRITE_COEF(0xb7, 0x802b),
4647 WRITE_COEF(0xb5, 0x1040),
4648 UPDATE_COEF(0xc3, 0, 1<<12),
4651 static const struct coef_fw coef0225[] = {
4652 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4653 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4654 UPDATE_COEF(0x63, 3<<14, 0),
4657 static const struct coef_fw coef0274[] = {
4658 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4659 UPDATE_COEF(0x4a, 0x0010, 0),
4660 UPDATE_COEF(0x6b, 0xf000, 0),
4664 switch (codec->core.vendor_id) {
4666 alc_write_coef_idx(codec, 0x45, 0xc489);
4667 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4668 alc_process_coef_fw(codec, coef0255);
4669 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4673 alc_write_coef_idx(codec, 0x45, 0xc489);
4674 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4675 alc_process_coef_fw(codec, coef0256);
4676 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4681 alc_write_coef_idx(codec, 0x45, 0x4689);
4682 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4683 alc_process_coef_fw(codec, coef0274);
4684 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4688 alc_write_coef_idx(codec, 0x45, 0xc429);
4689 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4690 alc_process_coef_fw(codec, coef0233);
4691 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4696 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4697 alc_process_coef_fw(codec, coef0288);
4698 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4701 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4702 alc_process_coef_fw(codec, coef0292);
4705 /* Set to TRS mode */
4706 alc_write_coef_idx(codec, 0x45, 0xc429);
4707 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4708 alc_process_coef_fw(codec, coef0293);
4709 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4712 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4716 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4717 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4720 alc_write_coef_idx(codec, 0x11, 0x0001);
4721 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4722 alc_process_coef_fw(codec, coef0688);
4723 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4731 alc_process_coef_fw(codec, alc225_pre_hsmode);
4732 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4733 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4734 alc_process_coef_fw(codec, coef0225);
4735 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4738 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4741 static void alc_headset_mode_default(struct hda_codec *codec)
4743 static const struct coef_fw coef0225[] = {
4744 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4745 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4746 UPDATE_COEF(0x49, 3<<8, 0<<8),
4747 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4748 UPDATE_COEF(0x63, 3<<14, 0),
4749 UPDATE_COEF(0x67, 0xf000, 0x3000),
4752 static const struct coef_fw coef0255[] = {
4753 WRITE_COEF(0x45, 0xc089),
4754 WRITE_COEF(0x45, 0xc489),
4755 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4756 WRITE_COEF(0x49, 0x0049),
4759 static const struct coef_fw coef0256[] = {
4760 WRITE_COEF(0x45, 0xc489),
4761 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4762 WRITE_COEF(0x49, 0x0049),
4763 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4764 WRITE_COEF(0x06, 0x6100),
4767 static const struct coef_fw coef0233[] = {
4768 WRITE_COEF(0x06, 0x2100),
4769 WRITE_COEF(0x32, 0x4ea3),
4772 static const struct coef_fw coef0288[] = {
4773 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4774 UPDATE_COEF(0x50, 0x2000, 0x2000),
4775 UPDATE_COEF(0x56, 0x0006, 0x0006),
4776 UPDATE_COEF(0x66, 0x0008, 0),
4777 UPDATE_COEF(0x67, 0x2000, 0),
4780 static const struct coef_fw coef0292[] = {
4781 WRITE_COEF(0x76, 0x000e),
4782 WRITE_COEF(0x6c, 0x2400),
4783 WRITE_COEF(0x6b, 0xc429),
4784 WRITE_COEF(0x18, 0x7308),
4787 static const struct coef_fw coef0293[] = {
4788 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4789 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4790 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4793 static const struct coef_fw coef0688[] = {
4794 WRITE_COEF(0x11, 0x0041),
4795 WRITE_COEF(0x15, 0x0d40),
4796 WRITE_COEF(0xb7, 0x802b),
4799 static const struct coef_fw coef0274[] = {
4800 WRITE_COEF(0x45, 0x4289),
4801 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4802 UPDATE_COEF(0x6b, 0x0f00, 0),
4803 UPDATE_COEF(0x49, 0x0300, 0x0300),
4807 switch (codec->core.vendor_id) {
4814 alc_process_coef_fw(codec, alc225_pre_hsmode);
4815 alc_process_coef_fw(codec, coef0225);
4818 alc_process_coef_fw(codec, coef0255);
4822 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4823 alc_write_coef_idx(codec, 0x45, 0xc089);
4825 alc_process_coef_fw(codec, coef0256);
4830 alc_process_coef_fw(codec, coef0274);
4834 alc_process_coef_fw(codec, coef0233);
4839 alc_process_coef_fw(codec, coef0288);
4842 alc_process_coef_fw(codec, coef0292);
4845 alc_process_coef_fw(codec, coef0293);
4848 alc_process_coef_fw(codec, coef0688);
4851 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4854 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4858 static void alc_headset_mode_ctia(struct hda_codec *codec)
4862 static const struct coef_fw coef0255[] = {
4863 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4864 WRITE_COEF(0x1b, 0x0c2b),
4865 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4868 static const struct coef_fw coef0256[] = {
4869 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4870 WRITE_COEF(0x1b, 0x0e6b),
4873 static const struct coef_fw coef0233[] = {
4874 WRITE_COEF(0x45, 0xd429),
4875 WRITE_COEF(0x1b, 0x0c2b),
4876 WRITE_COEF(0x32, 0x4ea3),
4879 static const struct coef_fw coef0288[] = {
4880 UPDATE_COEF(0x50, 0x2000, 0x2000),
4881 UPDATE_COEF(0x56, 0x0006, 0x0006),
4882 UPDATE_COEF(0x66, 0x0008, 0),
4883 UPDATE_COEF(0x67, 0x2000, 0),
4886 static const struct coef_fw coef0292[] = {
4887 WRITE_COEF(0x6b, 0xd429),
4888 WRITE_COEF(0x76, 0x0008),
4889 WRITE_COEF(0x18, 0x7388),
4892 static const struct coef_fw coef0293[] = {
4893 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4894 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4897 static const struct coef_fw coef0688[] = {
4898 WRITE_COEF(0x11, 0x0001),
4899 WRITE_COEF(0x15, 0x0d60),
4900 WRITE_COEF(0xc3, 0x0000),
4903 static const struct coef_fw coef0225_1[] = {
4904 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4905 UPDATE_COEF(0x63, 3<<14, 2<<14),
4908 static const struct coef_fw coef0225_2[] = {
4909 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4910 UPDATE_COEF(0x63, 3<<14, 1<<14),
4914 switch (codec->core.vendor_id) {
4916 alc_process_coef_fw(codec, coef0255);
4920 alc_process_coef_fw(codec, coef0256);
4925 alc_write_coef_idx(codec, 0x45, 0xd689);
4929 alc_process_coef_fw(codec, coef0233);
4932 val = alc_read_coef_idx(codec, 0x50);
4933 if (val & (1 << 12)) {
4934 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4935 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4938 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4939 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4945 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4947 alc_process_coef_fw(codec, coef0288);
4950 alc_process_coef_fw(codec, coef0292);
4953 alc_process_coef_fw(codec, coef0293);
4956 alc_process_coef_fw(codec, coef0688);
4964 val = alc_read_coef_idx(codec, 0x45);
4966 alc_process_coef_fw(codec, coef0225_2);
4968 alc_process_coef_fw(codec, coef0225_1);
4971 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4974 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
4978 static void alc_headset_mode_omtp(struct hda_codec *codec)
4980 static const struct coef_fw coef0255[] = {
4981 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4982 WRITE_COEF(0x1b, 0x0c2b),
4983 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4986 static const struct coef_fw coef0256[] = {
4987 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4988 WRITE_COEF(0x1b, 0x0e6b),
4991 static const struct coef_fw coef0233[] = {
4992 WRITE_COEF(0x45, 0xe429),
4993 WRITE_COEF(0x1b, 0x0c2b),
4994 WRITE_COEF(0x32, 0x4ea3),
4997 static const struct coef_fw coef0288[] = {
4998 UPDATE_COEF(0x50, 0x2000, 0x2000),
4999 UPDATE_COEF(0x56, 0x0006, 0x0006),
5000 UPDATE_COEF(0x66, 0x0008, 0),
5001 UPDATE_COEF(0x67, 0x2000, 0),
5004 static const struct coef_fw coef0292[] = {
5005 WRITE_COEF(0x6b, 0xe429),
5006 WRITE_COEF(0x76, 0x0008),
5007 WRITE_COEF(0x18, 0x7388),
5010 static const struct coef_fw coef0293[] = {
5011 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5012 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5015 static const struct coef_fw coef0688[] = {
5016 WRITE_COEF(0x11, 0x0001),
5017 WRITE_COEF(0x15, 0x0d50),
5018 WRITE_COEF(0xc3, 0x0000),
5021 static const struct coef_fw coef0225[] = {
5022 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5023 UPDATE_COEF(0x63, 3<<14, 2<<14),
5027 switch (codec->core.vendor_id) {
5029 alc_process_coef_fw(codec, coef0255);
5033 alc_process_coef_fw(codec, coef0256);
5038 alc_write_coef_idx(codec, 0x45, 0xe689);
5042 alc_process_coef_fw(codec, coef0233);
5045 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5046 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5051 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
5053 alc_process_coef_fw(codec, coef0288);
5056 alc_process_coef_fw(codec, coef0292);
5059 alc_process_coef_fw(codec, coef0293);
5062 alc_process_coef_fw(codec, coef0688);
5070 alc_process_coef_fw(codec, coef0225);
5073 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
5076 static void alc_determine_headset_type(struct hda_codec *codec)
5079 bool is_ctia = false;
5080 struct alc_spec *spec = codec->spec;
5081 static const struct coef_fw coef0255[] = {
5082 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5083 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5087 static const struct coef_fw coef0288[] = {
5088 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5091 static const struct coef_fw coef0298[] = {
5092 UPDATE_COEF(0x50, 0x2000, 0x2000),
5093 UPDATE_COEF(0x56, 0x0006, 0x0006),
5094 UPDATE_COEF(0x66, 0x0008, 0),
5095 UPDATE_COEF(0x67, 0x2000, 0),
5096 UPDATE_COEF(0x19, 0x1300, 0x1300),
5099 static const struct coef_fw coef0293[] = {
5100 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5101 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5104 static const struct coef_fw coef0688[] = {
5105 WRITE_COEF(0x11, 0x0001),
5106 WRITE_COEF(0xb7, 0x802b),
5107 WRITE_COEF(0x15, 0x0d60),
5108 WRITE_COEF(0xc3, 0x0c00),
5111 static const struct coef_fw coef0274[] = {
5112 UPDATE_COEF(0x4a, 0x0010, 0),
5113 UPDATE_COEF(0x4a, 0x8000, 0),
5114 WRITE_COEF(0x45, 0xd289),
5115 UPDATE_COEF(0x49, 0x0300, 0x0300),
5119 switch (codec->core.vendor_id) {
5121 alc_process_coef_fw(codec, coef0255);
5123 val = alc_read_coef_idx(codec, 0x46);
5124 is_ctia = (val & 0x0070) == 0x0070;
5128 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
5129 alc_write_coef_idx(codec, 0x06, 0x6104);
5130 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
5132 snd_hda_codec_write(codec, 0x21, 0,
5133 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5135 snd_hda_codec_write(codec, 0x21, 0,
5136 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5138 alc_process_coef_fw(codec, coef0255);
5140 val = alc_read_coef_idx(codec, 0x46);
5141 is_ctia = (val & 0x0070) == 0x0070;
5143 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
5144 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
5146 snd_hda_codec_write(codec, 0x21, 0,
5147 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5149 snd_hda_codec_write(codec, 0x21, 0,
5150 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5155 alc_process_coef_fw(codec, coef0274);
5157 val = alc_read_coef_idx(codec, 0x46);
5158 is_ctia = (val & 0x00f0) == 0x00f0;
5162 alc_write_coef_idx(codec, 0x45, 0xd029);
5164 val = alc_read_coef_idx(codec, 0x46);
5165 is_ctia = (val & 0x0070) == 0x0070;
5168 snd_hda_codec_write(codec, 0x21, 0,
5169 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5171 snd_hda_codec_write(codec, 0x21, 0,
5172 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5175 val = alc_read_coef_idx(codec, 0x50);
5176 if (val & (1 << 12)) {
5177 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
5178 alc_process_coef_fw(codec, coef0288);
5180 val = alc_read_coef_idx(codec, 0x50);
5181 is_ctia = (val & 0x0070) == 0x0070;
5183 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
5184 alc_process_coef_fw(codec, coef0288);
5186 val = alc_read_coef_idx(codec, 0x50);
5187 is_ctia = (val & 0x0070) == 0x0070;
5189 alc_process_coef_fw(codec, coef0298);
5190 snd_hda_codec_write(codec, 0x21, 0,
5191 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
5193 snd_hda_codec_write(codec, 0x21, 0,
5194 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5198 alc_process_coef_fw(codec, coef0288);
5200 val = alc_read_coef_idx(codec, 0x50);
5201 is_ctia = (val & 0x0070) == 0x0070;
5204 alc_write_coef_idx(codec, 0x6b, 0xd429);
5206 val = alc_read_coef_idx(codec, 0x6c);
5207 is_ctia = (val & 0x001c) == 0x001c;
5210 alc_process_coef_fw(codec, coef0293);
5212 val = alc_read_coef_idx(codec, 0x46);
5213 is_ctia = (val & 0x0070) == 0x0070;
5216 alc_process_coef_fw(codec, coef0688);
5218 val = alc_read_coef_idx(codec, 0xbe);
5219 is_ctia = (val & 0x1c02) == 0x1c02;
5227 snd_hda_codec_write(codec, 0x21, 0,
5228 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5230 snd_hda_codec_write(codec, 0x21, 0,
5231 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
5233 alc_process_coef_fw(codec, alc225_pre_hsmode);
5234 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
5235 val = alc_read_coef_idx(codec, 0x45);
5236 if (val & (1 << 9)) {
5237 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5238 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
5240 val = alc_read_coef_idx(codec, 0x46);
5241 is_ctia = (val & 0x00f0) == 0x00f0;
5243 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
5244 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
5246 val = alc_read_coef_idx(codec, 0x46);
5247 is_ctia = (val & 0x00f0) == 0x00f0;
5249 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
5250 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
5251 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
5253 snd_hda_codec_write(codec, 0x21, 0,
5254 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
5256 snd_hda_codec_write(codec, 0x21, 0,
5257 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
5264 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
5265 is_ctia ? "yes" : "no");
5266 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
5269 static void alc_update_headset_mode(struct hda_codec *codec)
5271 struct alc_spec *spec = codec->spec;
5273 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
5274 hda_nid_t hp_pin = alc_get_hp_pin(spec);
5276 int new_headset_mode;
5278 if (!snd_hda_jack_detect(codec, hp_pin))
5279 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
5280 else if (mux_pin == spec->headset_mic_pin)
5281 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
5282 else if (mux_pin == spec->headphone_mic_pin)
5283 new_headset_mode = ALC_HEADSET_MODE_MIC;
5285 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
5287 if (new_headset_mode == spec->current_headset_mode) {
5288 snd_hda_gen_update_outputs(codec);
5292 switch (new_headset_mode) {
5293 case ALC_HEADSET_MODE_UNPLUGGED:
5294 alc_headset_mode_unplugged(codec);
5295 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5296 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5297 spec->gen.hp_jack_present = false;
5299 case ALC_HEADSET_MODE_HEADSET:
5300 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
5301 alc_determine_headset_type(codec);
5302 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
5303 alc_headset_mode_ctia(codec);
5304 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
5305 alc_headset_mode_omtp(codec);
5306 spec->gen.hp_jack_present = true;
5308 case ALC_HEADSET_MODE_MIC:
5309 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
5310 spec->gen.hp_jack_present = false;
5312 case ALC_HEADSET_MODE_HEADPHONE:
5313 alc_headset_mode_default(codec);
5314 spec->gen.hp_jack_present = true;
5317 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
5318 snd_hda_set_pin_ctl_cache(codec, hp_pin,
5319 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
5320 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
5321 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
5324 spec->current_headset_mode = new_headset_mode;
5326 snd_hda_gen_update_outputs(codec);
5329 static void alc_update_headset_mode_hook(struct hda_codec *codec,
5330 struct snd_kcontrol *kcontrol,
5331 struct snd_ctl_elem_value *ucontrol)
5333 alc_update_headset_mode(codec);
5336 static void alc_update_headset_jack_cb(struct hda_codec *codec,
5337 struct hda_jack_callback *jack)
5339 snd_hda_gen_hp_automute(codec, jack);
5342 static void alc_probe_headset_mode(struct hda_codec *codec)
5345 struct alc_spec *spec = codec->spec;
5346 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5349 for (i = 0; i < cfg->num_inputs; i++) {
5350 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
5351 spec->headset_mic_pin = cfg->inputs[i].pin;
5352 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
5353 spec->headphone_mic_pin = cfg->inputs[i].pin;
5356 WARN_ON(spec->gen.cap_sync_hook);
5357 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
5358 spec->gen.automute_hook = alc_update_headset_mode;
5359 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
5362 static void alc_fixup_headset_mode(struct hda_codec *codec,
5363 const struct hda_fixup *fix, int action)
5365 struct alc_spec *spec = codec->spec;
5368 case HDA_FIXUP_ACT_PRE_PROBE:
5369 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
5371 case HDA_FIXUP_ACT_PROBE:
5372 alc_probe_headset_mode(codec);
5374 case HDA_FIXUP_ACT_INIT:
5375 if (is_s3_resume(codec) || is_s4_resume(codec)) {
5376 spec->current_headset_mode = ALC_HEADSET_MODE_UNKNOWN;
5377 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
5379 alc_update_headset_mode(codec);
5384 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
5385 const struct hda_fixup *fix, int action)
5387 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5388 struct alc_spec *spec = codec->spec;
5389 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5392 alc_fixup_headset_mode(codec, fix, action);
5395 static void alc255_set_default_jack_type(struct hda_codec *codec)
5397 /* Set to iphone type */
5398 static const struct coef_fw alc255fw[] = {
5399 WRITE_COEF(0x1b, 0x880b),
5400 WRITE_COEF(0x45, 0xd089),
5401 WRITE_COEF(0x1b, 0x080b),
5402 WRITE_COEF(0x46, 0x0004),
5403 WRITE_COEF(0x1b, 0x0c0b),
5406 static const struct coef_fw alc256fw[] = {
5407 WRITE_COEF(0x1b, 0x884b),
5408 WRITE_COEF(0x45, 0xd089),
5409 WRITE_COEF(0x1b, 0x084b),
5410 WRITE_COEF(0x46, 0x0004),
5411 WRITE_COEF(0x1b, 0x0c4b),
5414 switch (codec->core.vendor_id) {
5416 alc_process_coef_fw(codec, alc255fw);
5420 alc_process_coef_fw(codec, alc256fw);
5426 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5427 const struct hda_fixup *fix, int action)
5429 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5430 alc255_set_default_jack_type(codec);
5432 alc_fixup_headset_mode(codec, fix, action);
5435 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5436 const struct hda_fixup *fix, int action)
5438 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5439 struct alc_spec *spec = codec->spec;
5440 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5441 alc255_set_default_jack_type(codec);
5444 alc_fixup_headset_mode(codec, fix, action);
5447 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5448 struct hda_jack_callback *jack)
5450 struct alc_spec *spec = codec->spec;
5452 alc_update_headset_jack_cb(codec, jack);
5453 /* Headset Mic enable or disable, only for Dell Dino */
5454 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5457 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5458 const struct hda_fixup *fix, int action)
5460 alc_fixup_headset_mode(codec, fix, action);
5461 if (action == HDA_FIXUP_ACT_PROBE) {
5462 struct alc_spec *spec = codec->spec;
5463 /* toggled via hp_automute_hook */
5464 spec->gpio_mask |= 0x40;
5465 spec->gpio_dir |= 0x40;
5466 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5470 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5471 const struct hda_fixup *fix, int action)
5473 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5474 struct alc_spec *spec = codec->spec;
5475 spec->gen.auto_mute_via_amp = 1;
5479 static void alc_fixup_no_shutup(struct hda_codec *codec,
5480 const struct hda_fixup *fix, int action)
5482 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5483 struct alc_spec *spec = codec->spec;
5484 spec->no_shutup_pins = 1;
5488 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5489 const struct hda_fixup *fix, int action)
5491 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5492 struct alc_spec *spec = codec->spec;
5493 /* Disable AA-loopback as it causes white noise */
5494 spec->gen.mixer_nid = 0;
5498 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5499 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5500 const struct hda_fixup *fix, int action)
5502 static const struct hda_pintbl pincfgs[] = {
5503 { 0x16, 0x21211010 }, /* dock headphone */
5504 { 0x19, 0x21a11010 }, /* dock mic */
5507 struct alc_spec *spec = codec->spec;
5509 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5510 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5511 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5512 codec->power_save_node = 0; /* avoid click noises */
5513 snd_hda_apply_pincfgs(codec, pincfgs);
5517 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5518 const struct hda_fixup *fix, int action)
5520 static const struct hda_pintbl pincfgs[] = {
5521 { 0x17, 0x21211010 }, /* dock headphone */
5522 { 0x19, 0x21a11010 }, /* dock mic */
5525 struct alc_spec *spec = codec->spec;
5527 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5528 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5529 snd_hda_apply_pincfgs(codec, pincfgs);
5530 } else if (action == HDA_FIXUP_ACT_INIT) {
5531 /* Enable DOCK device */
5532 snd_hda_codec_write(codec, 0x17, 0,
5533 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5534 /* Enable DOCK device */
5535 snd_hda_codec_write(codec, 0x19, 0,
5536 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5540 static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
5541 const struct hda_fixup *fix, int action)
5543 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5544 * the speaker output becomes too low by some reason on Thinkpads with
5547 static const hda_nid_t preferred_pairs[] = {
5548 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5551 struct alc_spec *spec = codec->spec;
5553 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5554 spec->gen.preferred_dacs = preferred_pairs;
5557 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5559 struct alc_spec *spec = codec->spec;
5560 int hp_pin = alc_get_hp_pin(spec);
5562 /* Prevent pop noises when headphones are plugged in */
5563 snd_hda_codec_write(codec, hp_pin, 0,
5564 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5568 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5569 const struct hda_fixup *fix, int action)
5571 struct alc_spec *spec = codec->spec;
5572 struct hda_input_mux *imux = &spec->gen.input_mux;
5576 case HDA_FIXUP_ACT_PRE_PROBE:
5577 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5578 * it causes a click noise at start up
5580 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5581 spec->shutup = alc_shutup_dell_xps13;
5583 case HDA_FIXUP_ACT_PROBE:
5584 /* Make the internal mic the default input source. */
5585 for (i = 0; i < imux->num_items; i++) {
5586 if (spec->gen.imux_pins[i] == 0x12) {
5587 spec->gen.cur_mux[0] = i;
5595 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5596 const struct hda_fixup *fix, int action)
5598 struct alc_spec *spec = codec->spec;
5600 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5601 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5602 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5604 /* Disable boost for mic-in permanently. (This code is only called
5605 from quirks that guarantee that the headphone is at NID 0x1b.) */
5606 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5607 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5609 alc_fixup_headset_mode(codec, fix, action);
5612 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5613 const struct hda_fixup *fix, int action)
5615 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5616 alc_write_coef_idx(codec, 0xc4, 0x8000);
5617 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5618 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5620 alc_fixup_headset_mode(codec, fix, action);
5623 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5624 static int find_ext_mic_pin(struct hda_codec *codec)
5626 struct alc_spec *spec = codec->spec;
5627 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5629 unsigned int defcfg;
5632 for (i = 0; i < cfg->num_inputs; i++) {
5633 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5635 nid = cfg->inputs[i].pin;
5636 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5637 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5645 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5646 const struct hda_fixup *fix,
5649 struct alc_spec *spec = codec->spec;
5651 if (action == HDA_FIXUP_ACT_PROBE) {
5652 int mic_pin = find_ext_mic_pin(codec);
5653 int hp_pin = alc_get_hp_pin(spec);
5655 if (snd_BUG_ON(!mic_pin || !hp_pin))
5657 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5661 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5662 const struct hda_fixup *fix,
5665 struct alc_spec *spec = codec->spec;
5666 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5669 /* The mic boosts on level 2 and 3 are too noisy
5670 on the internal mic input.
5671 Therefore limit the boost to 0 or 1. */
5673 if (action != HDA_FIXUP_ACT_PROBE)
5676 for (i = 0; i < cfg->num_inputs; i++) {
5677 hda_nid_t nid = cfg->inputs[i].pin;
5678 unsigned int defcfg;
5679 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5681 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5682 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5685 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5686 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5687 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5688 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5689 (0 << AC_AMPCAP_MUTE_SHIFT));
5693 static void alc283_hp_automute_hook(struct hda_codec *codec,
5694 struct hda_jack_callback *jack)
5696 struct alc_spec *spec = codec->spec;
5700 snd_hda_gen_hp_automute(codec, jack);
5702 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5705 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5709 static void alc283_fixup_chromebook(struct hda_codec *codec,
5710 const struct hda_fixup *fix, int action)
5712 struct alc_spec *spec = codec->spec;
5715 case HDA_FIXUP_ACT_PRE_PROBE:
5716 snd_hda_override_wcaps(codec, 0x03, 0);
5717 /* Disable AA-loopback as it causes white noise */
5718 spec->gen.mixer_nid = 0;
5720 case HDA_FIXUP_ACT_INIT:
5721 /* MIC2-VREF control */
5722 /* Set to manual mode */
5723 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5724 /* Enable Line1 input control by verb */
5725 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5730 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5731 const struct hda_fixup *fix, int action)
5733 struct alc_spec *spec = codec->spec;
5736 case HDA_FIXUP_ACT_PRE_PROBE:
5737 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5739 case HDA_FIXUP_ACT_INIT:
5740 /* MIC2-VREF control */
5741 /* Set to manual mode */
5742 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5747 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5748 static void asus_tx300_automute(struct hda_codec *codec)
5750 struct alc_spec *spec = codec->spec;
5751 snd_hda_gen_update_outputs(codec);
5752 if (snd_hda_jack_detect(codec, 0x1b))
5753 spec->gen.mute_bits |= (1ULL << 0x14);
5756 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5757 const struct hda_fixup *fix, int action)
5759 struct alc_spec *spec = codec->spec;
5760 static const struct hda_pintbl dock_pins[] = {
5761 { 0x1b, 0x21114000 }, /* dock speaker pin */
5766 case HDA_FIXUP_ACT_PRE_PROBE:
5767 spec->init_amp = ALC_INIT_DEFAULT;
5768 /* TX300 needs to set up GPIO2 for the speaker amp */
5769 alc_setup_gpio(codec, 0x04);
5770 snd_hda_apply_pincfgs(codec, dock_pins);
5771 spec->gen.auto_mute_via_amp = 1;
5772 spec->gen.automute_hook = asus_tx300_automute;
5773 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5774 snd_hda_gen_hp_automute);
5776 case HDA_FIXUP_ACT_PROBE:
5777 spec->init_amp = ALC_INIT_DEFAULT;
5779 case HDA_FIXUP_ACT_BUILD:
5780 /* this is a bit tricky; give more sane names for the main
5781 * (tablet) speaker and the dock speaker, respectively
5783 rename_ctl(codec, "Speaker Playback Switch",
5784 "Dock Speaker Playback Switch");
5785 rename_ctl(codec, "Bass Speaker Playback Switch",
5786 "Speaker Playback Switch");
5791 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5792 const struct hda_fixup *fix, int action)
5794 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5795 /* DAC node 0x03 is giving mono output. We therefore want to
5796 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5797 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5798 static const hda_nid_t conn1[] = { 0x0c };
5799 snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn1), conn1);
5800 snd_hda_override_conn_list(codec, 0x15, ARRAY_SIZE(conn1), conn1);
5804 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5805 const struct hda_fixup *fix, int action)
5807 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5808 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5809 we can't adjust the speaker's volume since this node does not has
5810 Amp-out capability. we change the speaker's route to:
5811 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5812 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5813 speaker's volume now. */
5815 static const hda_nid_t conn1[] = { 0x0c };
5816 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn1), conn1);
5820 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5821 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5822 const struct hda_fixup *fix, int action)
5824 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5825 static const hda_nid_t conn[] = { 0x02, 0x03 };
5826 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5830 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5831 static void alc285_fixup_speaker2_to_dac1(struct hda_codec *codec,
5832 const struct hda_fixup *fix, int action)
5834 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5835 static const hda_nid_t conn[] = { 0x02 };
5836 snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn);
5840 /* Hook to update amp GPIO4 for automute */
5841 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5842 struct hda_jack_callback *jack)
5844 struct alc_spec *spec = codec->spec;
5846 snd_hda_gen_hp_automute(codec, jack);
5847 /* mute_led_polarity is set to 0, so we pass inverted value here */
5848 alc_update_gpio_led(codec, 0x10, spec->mute_led_polarity,
5849 !spec->gen.hp_jack_present);
5852 /* Manage GPIOs for HP EliteBook Folio 9480m.
5854 * GPIO4 is the headphone amplifier power control
5855 * GPIO3 is the audio output mute indicator LED
5858 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5859 const struct hda_fixup *fix,
5862 struct alc_spec *spec = codec->spec;
5864 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5865 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5866 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5867 spec->gpio_mask |= 0x10;
5868 spec->gpio_dir |= 0x10;
5869 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5873 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5874 const struct hda_fixup *fix,
5877 struct alc_spec *spec = codec->spec;
5879 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5880 spec->gpio_mask |= 0x04;
5881 spec->gpio_dir |= 0x04;
5882 /* set data bit low */
5886 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5887 const struct hda_fixup *fix,
5890 alc_fixup_dual_codecs(codec, fix, action);
5892 case HDA_FIXUP_ACT_PRE_PROBE:
5893 /* override card longname to provide a unique UCM profile */
5894 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5896 case HDA_FIXUP_ACT_BUILD:
5897 /* rename Capture controls depending on the codec */
5898 rename_ctl(codec, "Capture Volume",
5900 "Rear-Panel Capture Volume" :
5901 "Front-Panel Capture Volume");
5902 rename_ctl(codec, "Capture Switch",
5904 "Rear-Panel Capture Switch" :
5905 "Front-Panel Capture Switch");
5910 static void alc225_fixup_s3_pop_noise(struct hda_codec *codec,
5911 const struct hda_fixup *fix, int action)
5913 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5916 codec->power_save_node = 1;
5919 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5920 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
5921 const struct hda_fixup *fix, int action)
5923 struct alc_spec *spec = codec->spec;
5924 static const hda_nid_t preferred_pairs[] = {
5925 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5929 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5932 spec->gen.preferred_dacs = preferred_pairs;
5933 spec->gen.auto_mute_via_amp = 1;
5934 codec->power_save_node = 0;
5937 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5938 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5939 const struct hda_fixup *fix, int action)
5941 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5944 snd_hda_override_wcaps(codec, 0x03, 0);
5947 static void alc295_fixup_chromebook(struct hda_codec *codec,
5948 const struct hda_fixup *fix, int action)
5950 struct alc_spec *spec = codec->spec;
5953 case HDA_FIXUP_ACT_PRE_PROBE:
5954 spec->ultra_low_power = true;
5956 case HDA_FIXUP_ACT_INIT:
5957 switch (codec->core.vendor_id) {
5959 alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
5960 alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15);
5963 alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
5964 alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
5971 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
5972 const struct hda_fixup *fix, int action)
5974 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5975 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5978 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
5979 const struct hda_fixup *fix, int action)
5981 if (action != HDA_FIXUP_ACT_INIT)
5985 alc_write_coef_idx(codec, 0x65, 0x0);
5988 /* for hda_fixup_thinkpad_acpi() */
5989 #include "thinkpad_helper.c"
5991 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5992 const struct hda_fixup *fix, int action)
5994 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5995 hda_fixup_thinkpad_acpi(codec, fix, action);
5998 /* for alc295_fixup_hp_top_speakers */
5999 #include "hp_x360_helper.c"
6002 ALC269_FIXUP_SONY_VAIO,
6003 ALC275_FIXUP_SONY_VAIO_GPIO2,
6004 ALC269_FIXUP_DELL_M101Z,
6005 ALC269_FIXUP_SKU_IGNORE,
6006 ALC269_FIXUP_ASUS_G73JW,
6007 ALC269_FIXUP_LENOVO_EAPD,
6008 ALC275_FIXUP_SONY_HWEQ,
6009 ALC275_FIXUP_SONY_DISABLE_AAMIX,
6011 ALC269_FIXUP_PCM_44K,
6012 ALC269_FIXUP_STEREO_DMIC,
6013 ALC269_FIXUP_HEADSET_MIC,
6014 ALC269_FIXUP_QUANTA_MUTE,
6015 ALC269_FIXUP_LIFEBOOK,
6016 ALC269_FIXUP_LIFEBOOK_EXTMIC,
6017 ALC269_FIXUP_LIFEBOOK_HP_PIN,
6018 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
6019 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
6022 ALC269VB_FIXUP_AMIC,
6023 ALC269VB_FIXUP_DMIC,
6024 ALC269_FIXUP_HP_MUTE_LED,
6025 ALC269_FIXUP_HP_MUTE_LED_MIC1,
6026 ALC269_FIXUP_HP_MUTE_LED_MIC2,
6027 ALC269_FIXUP_HP_MUTE_LED_MIC3,
6028 ALC269_FIXUP_HP_GPIO_LED,
6029 ALC269_FIXUP_HP_GPIO_MIC1_LED,
6030 ALC269_FIXUP_HP_LINE1_MIC1_LED,
6031 ALC269_FIXUP_INV_DMIC,
6032 ALC269_FIXUP_LENOVO_DOCK,
6033 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
6034 ALC269_FIXUP_NO_SHUTUP,
6035 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
6036 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
6037 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
6038 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
6039 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6040 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
6041 ALC269_FIXUP_HEADSET_MODE,
6042 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
6043 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
6044 ALC269_FIXUP_ASUS_X101_FUNC,
6045 ALC269_FIXUP_ASUS_X101_VERB,
6046 ALC269_FIXUP_ASUS_X101,
6047 ALC271_FIXUP_AMIC_MIC2,
6048 ALC271_FIXUP_HP_GATE_MIC_JACK,
6049 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
6050 ALC269_FIXUP_ACER_AC700,
6051 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6052 ALC269VB_FIXUP_ASUS_ZENBOOK,
6053 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
6054 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
6055 ALC269VB_FIXUP_ORDISSIMO_EVE2,
6056 ALC283_FIXUP_CHROME_BOOK,
6057 ALC283_FIXUP_SENSE_COMBO_JACK,
6058 ALC282_FIXUP_ASUS_TX300,
6059 ALC283_FIXUP_INT_MIC,
6060 ALC290_FIXUP_MONO_SPEAKERS,
6061 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6062 ALC290_FIXUP_SUBWOOFER,
6063 ALC290_FIXUP_SUBWOOFER_HSJACK,
6064 ALC269_FIXUP_THINKPAD_ACPI,
6065 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
6066 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
6067 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
6068 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
6069 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
6070 ALC255_FIXUP_HEADSET_MODE,
6071 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
6072 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
6073 ALC292_FIXUP_TPT440_DOCK,
6074 ALC292_FIXUP_TPT440,
6075 ALC283_FIXUP_HEADSET_MIC,
6076 ALC255_FIXUP_MIC_MUTE_LED,
6077 ALC282_FIXUP_ASPIRE_V5_PINS,
6078 ALC280_FIXUP_HP_GPIO4,
6079 ALC286_FIXUP_HP_GPIO_LED,
6080 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
6081 ALC280_FIXUP_HP_DOCK_PINS,
6082 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
6083 ALC280_FIXUP_HP_9480M,
6084 ALC288_FIXUP_DELL_HEADSET_MODE,
6085 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
6086 ALC288_FIXUP_DELL_XPS_13,
6087 ALC288_FIXUP_DISABLE_AAMIX,
6088 ALC292_FIXUP_DELL_E7X_AAMIX,
6089 ALC292_FIXUP_DELL_E7X,
6090 ALC292_FIXUP_DISABLE_AAMIX,
6091 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
6092 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
6093 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
6094 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6095 ALC275_FIXUP_DELL_XPS,
6096 ALC293_FIXUP_LENOVO_SPK_NOISE,
6097 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
6098 ALC255_FIXUP_DELL_SPK_NOISE,
6099 ALC225_FIXUP_DISABLE_MIC_VREF,
6100 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
6101 ALC295_FIXUP_DISABLE_DAC3,
6102 ALC285_FIXUP_SPEAKER2_TO_DAC1,
6103 ALC280_FIXUP_HP_HEADSET_MIC,
6104 ALC221_FIXUP_HP_FRONT_MIC,
6105 ALC292_FIXUP_TPT460,
6106 ALC298_FIXUP_SPK_VOLUME,
6107 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
6108 ALC269_FIXUP_ATIV_BOOK_8,
6109 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
6110 ALC256_FIXUP_ASUS_HEADSET_MODE,
6111 ALC256_FIXUP_ASUS_MIC,
6112 ALC256_FIXUP_ASUS_AIO_GPIO2,
6113 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
6114 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
6115 ALC233_FIXUP_LENOVO_MULTI_CODECS,
6116 ALC233_FIXUP_ACER_HEADSET_MIC,
6117 ALC294_FIXUP_LENOVO_MIC_LOCATION,
6118 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
6119 ALC225_FIXUP_S3_POP_NOISE,
6120 ALC700_FIXUP_INTEL_REFERENCE,
6121 ALC274_FIXUP_DELL_BIND_DACS,
6122 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
6123 ALC298_FIXUP_TPT470_DOCK_FIX,
6124 ALC298_FIXUP_TPT470_DOCK,
6125 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
6126 ALC255_FIXUP_DELL_HEADSET_MIC,
6127 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS,
6128 ALC298_FIXUP_HUAWEI_MBX_STEREO,
6129 ALC295_FIXUP_HP_X360,
6130 ALC221_FIXUP_HP_HEADSET_MIC,
6131 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
6132 ALC295_FIXUP_HP_AUTO_MUTE,
6133 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
6134 ALC294_FIXUP_ASUS_MIC,
6135 ALC294_FIXUP_ASUS_HEADSET_MIC,
6136 ALC294_FIXUP_ASUS_SPK,
6137 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
6138 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
6139 ALC255_FIXUP_ACER_HEADSET_MIC,
6140 ALC295_FIXUP_CHROME_BOOK,
6141 ALC225_FIXUP_HEADSET_JACK,
6142 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
6143 ALC225_FIXUP_WYSE_AUTO_MUTE,
6144 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
6145 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
6146 ALC256_FIXUP_ASUS_HEADSET_MIC,
6147 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
6148 ALC299_FIXUP_PREDATOR_SPK,
6149 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
6150 ALC289_FIXUP_DELL_SPK2,
6151 ALC289_FIXUP_DUAL_SPK,
6152 ALC294_FIXUP_SPK2_TO_DAC1,
6153 ALC294_FIXUP_ASUS_DUAL_SPK,
6154 ALC285_FIXUP_THINKPAD_HEADSET_JACK,
6155 ALC294_FIXUP_ASUS_HPE,
6156 ALC294_FIXUP_ASUS_COEF_1B,
6157 ALC285_FIXUP_HP_GPIO_LED,
6158 ALC285_FIXUP_HP_MUTE_LED,
6159 ALC236_FIXUP_HP_MUTE_LED,
6160 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
6161 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6162 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6163 ALC269VC_FIXUP_ACER_HEADSET_MIC,
6164 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
6165 ALC289_FIXUP_ASUS_GA401,
6166 ALC289_FIXUP_ASUS_GA502,
6167 ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
6168 ALC285_FIXUP_HP_GPIO_AMP_INIT,
6169 ALC269_FIXUP_CZC_B20,
6170 ALC269_FIXUP_CZC_TMI,
6171 ALC269_FIXUP_CZC_L101,
6172 ALC269_FIXUP_LEMOTE_A1802,
6173 ALC269_FIXUP_LEMOTE_A190X,
6176 static const struct hda_fixup alc269_fixups[] = {
6177 [ALC269_FIXUP_SONY_VAIO] = {
6178 .type = HDA_FIXUP_PINCTLS,
6179 .v.pins = (const struct hda_pintbl[]) {
6180 {0x19, PIN_VREFGRD},
6184 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
6185 .type = HDA_FIXUP_FUNC,
6186 .v.func = alc275_fixup_gpio4_off,
6188 .chain_id = ALC269_FIXUP_SONY_VAIO
6190 [ALC269_FIXUP_DELL_M101Z] = {
6191 .type = HDA_FIXUP_VERBS,
6192 .v.verbs = (const struct hda_verb[]) {
6193 /* Enables internal speaker */
6194 {0x20, AC_VERB_SET_COEF_INDEX, 13},
6195 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
6199 [ALC269_FIXUP_SKU_IGNORE] = {
6200 .type = HDA_FIXUP_FUNC,
6201 .v.func = alc_fixup_sku_ignore,
6203 [ALC269_FIXUP_ASUS_G73JW] = {
6204 .type = HDA_FIXUP_PINS,
6205 .v.pins = (const struct hda_pintbl[]) {
6206 { 0x17, 0x99130111 }, /* subwoofer */
6210 [ALC269_FIXUP_LENOVO_EAPD] = {
6211 .type = HDA_FIXUP_VERBS,
6212 .v.verbs = (const struct hda_verb[]) {
6213 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
6217 [ALC275_FIXUP_SONY_HWEQ] = {
6218 .type = HDA_FIXUP_FUNC,
6219 .v.func = alc269_fixup_hweq,
6221 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
6223 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
6224 .type = HDA_FIXUP_FUNC,
6225 .v.func = alc_fixup_disable_aamix,
6227 .chain_id = ALC269_FIXUP_SONY_VAIO
6229 [ALC271_FIXUP_DMIC] = {
6230 .type = HDA_FIXUP_FUNC,
6231 .v.func = alc271_fixup_dmic,
6233 [ALC269_FIXUP_PCM_44K] = {
6234 .type = HDA_FIXUP_FUNC,
6235 .v.func = alc269_fixup_pcm_44k,
6237 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6239 [ALC269_FIXUP_STEREO_DMIC] = {
6240 .type = HDA_FIXUP_FUNC,
6241 .v.func = alc269_fixup_stereo_dmic,
6243 [ALC269_FIXUP_HEADSET_MIC] = {
6244 .type = HDA_FIXUP_FUNC,
6245 .v.func = alc269_fixup_headset_mic,
6247 [ALC269_FIXUP_QUANTA_MUTE] = {
6248 .type = HDA_FIXUP_FUNC,
6249 .v.func = alc269_fixup_quanta_mute,
6251 [ALC269_FIXUP_LIFEBOOK] = {
6252 .type = HDA_FIXUP_PINS,
6253 .v.pins = (const struct hda_pintbl[]) {
6254 { 0x1a, 0x2101103f }, /* dock line-out */
6255 { 0x1b, 0x23a11040 }, /* dock mic-in */
6259 .chain_id = ALC269_FIXUP_QUANTA_MUTE
6261 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
6262 .type = HDA_FIXUP_PINS,
6263 .v.pins = (const struct hda_pintbl[]) {
6264 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6268 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
6269 .type = HDA_FIXUP_PINS,
6270 .v.pins = (const struct hda_pintbl[]) {
6271 { 0x21, 0x0221102f }, /* HP out */
6275 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
6276 .type = HDA_FIXUP_FUNC,
6277 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6279 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
6280 .type = HDA_FIXUP_FUNC,
6281 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
6283 [ALC269_FIXUP_AMIC] = {
6284 .type = HDA_FIXUP_PINS,
6285 .v.pins = (const struct hda_pintbl[]) {
6286 { 0x14, 0x99130110 }, /* speaker */
6287 { 0x15, 0x0121401f }, /* HP out */
6288 { 0x18, 0x01a19c20 }, /* mic */
6289 { 0x19, 0x99a3092f }, /* int-mic */
6293 [ALC269_FIXUP_DMIC] = {
6294 .type = HDA_FIXUP_PINS,
6295 .v.pins = (const struct hda_pintbl[]) {
6296 { 0x12, 0x99a3092f }, /* int-mic */
6297 { 0x14, 0x99130110 }, /* speaker */
6298 { 0x15, 0x0121401f }, /* HP out */
6299 { 0x18, 0x01a19c20 }, /* mic */
6303 [ALC269VB_FIXUP_AMIC] = {
6304 .type = HDA_FIXUP_PINS,
6305 .v.pins = (const struct hda_pintbl[]) {
6306 { 0x14, 0x99130110 }, /* speaker */
6307 { 0x18, 0x01a19c20 }, /* mic */
6308 { 0x19, 0x99a3092f }, /* int-mic */
6309 { 0x21, 0x0121401f }, /* HP out */
6313 [ALC269VB_FIXUP_DMIC] = {
6314 .type = HDA_FIXUP_PINS,
6315 .v.pins = (const struct hda_pintbl[]) {
6316 { 0x12, 0x99a3092f }, /* int-mic */
6317 { 0x14, 0x99130110 }, /* speaker */
6318 { 0x18, 0x01a19c20 }, /* mic */
6319 { 0x21, 0x0121401f }, /* HP out */
6323 [ALC269_FIXUP_HP_MUTE_LED] = {
6324 .type = HDA_FIXUP_FUNC,
6325 .v.func = alc269_fixup_hp_mute_led,
6327 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
6328 .type = HDA_FIXUP_FUNC,
6329 .v.func = alc269_fixup_hp_mute_led_mic1,
6331 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
6332 .type = HDA_FIXUP_FUNC,
6333 .v.func = alc269_fixup_hp_mute_led_mic2,
6335 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
6336 .type = HDA_FIXUP_FUNC,
6337 .v.func = alc269_fixup_hp_mute_led_mic3,
6339 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
6341 [ALC269_FIXUP_HP_GPIO_LED] = {
6342 .type = HDA_FIXUP_FUNC,
6343 .v.func = alc269_fixup_hp_gpio_led,
6345 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
6346 .type = HDA_FIXUP_FUNC,
6347 .v.func = alc269_fixup_hp_gpio_mic1_led,
6349 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
6350 .type = HDA_FIXUP_FUNC,
6351 .v.func = alc269_fixup_hp_line1_mic1_led,
6353 [ALC269_FIXUP_INV_DMIC] = {
6354 .type = HDA_FIXUP_FUNC,
6355 .v.func = alc_fixup_inv_dmic,
6357 [ALC269_FIXUP_NO_SHUTUP] = {
6358 .type = HDA_FIXUP_FUNC,
6359 .v.func = alc_fixup_no_shutup,
6361 [ALC269_FIXUP_LENOVO_DOCK] = {
6362 .type = HDA_FIXUP_PINS,
6363 .v.pins = (const struct hda_pintbl[]) {
6364 { 0x19, 0x23a11040 }, /* dock mic */
6365 { 0x1b, 0x2121103f }, /* dock headphone */
6369 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6371 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
6372 .type = HDA_FIXUP_FUNC,
6373 .v.func = alc269_fixup_limit_int_mic_boost,
6375 .chain_id = ALC269_FIXUP_LENOVO_DOCK,
6377 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
6378 .type = HDA_FIXUP_FUNC,
6379 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
6381 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6383 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6384 .type = HDA_FIXUP_PINS,
6385 .v.pins = (const struct hda_pintbl[]) {
6386 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6387 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6391 .chain_id = ALC269_FIXUP_HEADSET_MODE
6393 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6394 .type = HDA_FIXUP_PINS,
6395 .v.pins = (const struct hda_pintbl[]) {
6396 { 0x16, 0x21014020 }, /* dock line out */
6397 { 0x19, 0x21a19030 }, /* dock mic */
6398 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6402 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6404 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
6405 .type = HDA_FIXUP_PINS,
6406 .v.pins = (const struct hda_pintbl[]) {
6407 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6411 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6413 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
6414 .type = HDA_FIXUP_PINS,
6415 .v.pins = (const struct hda_pintbl[]) {
6416 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6417 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6421 .chain_id = ALC269_FIXUP_HEADSET_MODE
6423 [ALC269_FIXUP_HEADSET_MODE] = {
6424 .type = HDA_FIXUP_FUNC,
6425 .v.func = alc_fixup_headset_mode,
6427 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6429 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6430 .type = HDA_FIXUP_FUNC,
6431 .v.func = alc_fixup_headset_mode_no_hp_mic,
6433 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
6434 .type = HDA_FIXUP_PINS,
6435 .v.pins = (const struct hda_pintbl[]) {
6436 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6440 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6442 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
6443 .type = HDA_FIXUP_PINS,
6444 .v.pins = (const struct hda_pintbl[]) {
6445 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6449 .chain_id = ALC269_FIXUP_HEADSET_MIC
6451 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS] = {
6452 .type = HDA_FIXUP_PINS,
6453 .v.pins = (const struct hda_pintbl[]) {
6467 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6469 [ALC298_FIXUP_HUAWEI_MBX_STEREO] = {
6470 .type = HDA_FIXUP_FUNC,
6471 .v.func = alc298_fixup_huawei_mbx_stereo,
6473 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6475 [ALC269_FIXUP_ASUS_X101_FUNC] = {
6476 .type = HDA_FIXUP_FUNC,
6477 .v.func = alc269_fixup_x101_headset_mic,
6479 [ALC269_FIXUP_ASUS_X101_VERB] = {
6480 .type = HDA_FIXUP_VERBS,
6481 .v.verbs = (const struct hda_verb[]) {
6482 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
6483 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
6484 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
6488 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
6490 [ALC269_FIXUP_ASUS_X101] = {
6491 .type = HDA_FIXUP_PINS,
6492 .v.pins = (const struct hda_pintbl[]) {
6493 { 0x18, 0x04a1182c }, /* Headset mic */
6497 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
6499 [ALC271_FIXUP_AMIC_MIC2] = {
6500 .type = HDA_FIXUP_PINS,
6501 .v.pins = (const struct hda_pintbl[]) {
6502 { 0x14, 0x99130110 }, /* speaker */
6503 { 0x19, 0x01a19c20 }, /* mic */
6504 { 0x1b, 0x99a7012f }, /* int-mic */
6505 { 0x21, 0x0121401f }, /* HP out */
6509 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6510 .type = HDA_FIXUP_FUNC,
6511 .v.func = alc271_hp_gate_mic_jack,
6513 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6515 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6516 .type = HDA_FIXUP_FUNC,
6517 .v.func = alc269_fixup_limit_int_mic_boost,
6519 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6521 [ALC269_FIXUP_ACER_AC700] = {
6522 .type = HDA_FIXUP_PINS,
6523 .v.pins = (const struct hda_pintbl[]) {
6524 { 0x12, 0x99a3092f }, /* int-mic */
6525 { 0x14, 0x99130110 }, /* speaker */
6526 { 0x18, 0x03a11c20 }, /* mic */
6527 { 0x1e, 0x0346101e }, /* SPDIF1 */
6528 { 0x21, 0x0321101f }, /* HP out */
6532 .chain_id = ALC271_FIXUP_DMIC,
6534 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6535 .type = HDA_FIXUP_FUNC,
6536 .v.func = alc269_fixup_limit_int_mic_boost,
6538 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6540 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6541 .type = HDA_FIXUP_FUNC,
6542 .v.func = alc269_fixup_limit_int_mic_boost,
6544 .chain_id = ALC269VB_FIXUP_DMIC,
6546 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6547 .type = HDA_FIXUP_VERBS,
6548 .v.verbs = (const struct hda_verb[]) {
6549 /* class-D output amp +5dB */
6550 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6551 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6555 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6557 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6558 .type = HDA_FIXUP_FUNC,
6559 .v.func = alc269_fixup_limit_int_mic_boost,
6561 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6563 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6564 .type = HDA_FIXUP_PINS,
6565 .v.pins = (const struct hda_pintbl[]) {
6566 { 0x12, 0x99a3092f }, /* int-mic */
6567 { 0x18, 0x03a11d20 }, /* mic */
6568 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6572 [ALC283_FIXUP_CHROME_BOOK] = {
6573 .type = HDA_FIXUP_FUNC,
6574 .v.func = alc283_fixup_chromebook,
6576 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6577 .type = HDA_FIXUP_FUNC,
6578 .v.func = alc283_fixup_sense_combo_jack,
6580 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6582 [ALC282_FIXUP_ASUS_TX300] = {
6583 .type = HDA_FIXUP_FUNC,
6584 .v.func = alc282_fixup_asus_tx300,
6586 [ALC283_FIXUP_INT_MIC] = {
6587 .type = HDA_FIXUP_VERBS,
6588 .v.verbs = (const struct hda_verb[]) {
6589 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6590 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6594 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6596 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6597 .type = HDA_FIXUP_PINS,
6598 .v.pins = (const struct hda_pintbl[]) {
6599 { 0x17, 0x90170112 }, /* subwoofer */
6603 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6605 [ALC290_FIXUP_SUBWOOFER] = {
6606 .type = HDA_FIXUP_PINS,
6607 .v.pins = (const struct hda_pintbl[]) {
6608 { 0x17, 0x90170112 }, /* subwoofer */
6612 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6614 [ALC290_FIXUP_MONO_SPEAKERS] = {
6615 .type = HDA_FIXUP_FUNC,
6616 .v.func = alc290_fixup_mono_speakers,
6618 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6619 .type = HDA_FIXUP_FUNC,
6620 .v.func = alc290_fixup_mono_speakers,
6622 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6624 [ALC269_FIXUP_THINKPAD_ACPI] = {
6625 .type = HDA_FIXUP_FUNC,
6626 .v.func = alc_fixup_thinkpad_acpi,
6628 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6630 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6631 .type = HDA_FIXUP_FUNC,
6632 .v.func = alc_fixup_inv_dmic,
6634 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6636 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6637 .type = HDA_FIXUP_PINS,
6638 .v.pins = (const struct hda_pintbl[]) {
6639 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6643 .chain_id = ALC255_FIXUP_HEADSET_MODE
6645 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6646 .type = HDA_FIXUP_PINS,
6647 .v.pins = (const struct hda_pintbl[]) {
6648 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6652 .chain_id = ALC255_FIXUP_HEADSET_MODE
6654 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6655 .type = HDA_FIXUP_PINS,
6656 .v.pins = (const struct hda_pintbl[]) {
6657 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6658 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6662 .chain_id = ALC255_FIXUP_HEADSET_MODE
6664 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6665 .type = HDA_FIXUP_PINS,
6666 .v.pins = (const struct hda_pintbl[]) {
6667 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6671 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6673 [ALC255_FIXUP_HEADSET_MODE] = {
6674 .type = HDA_FIXUP_FUNC,
6675 .v.func = alc_fixup_headset_mode_alc255,
6677 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6679 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6680 .type = HDA_FIXUP_FUNC,
6681 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6683 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6684 .type = HDA_FIXUP_PINS,
6685 .v.pins = (const struct hda_pintbl[]) {
6686 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6687 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6691 .chain_id = ALC269_FIXUP_HEADSET_MODE
6693 [ALC292_FIXUP_TPT440_DOCK] = {
6694 .type = HDA_FIXUP_FUNC,
6695 .v.func = alc_fixup_tpt440_dock,
6697 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6699 [ALC292_FIXUP_TPT440] = {
6700 .type = HDA_FIXUP_FUNC,
6701 .v.func = alc_fixup_disable_aamix,
6703 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6705 [ALC283_FIXUP_HEADSET_MIC] = {
6706 .type = HDA_FIXUP_PINS,
6707 .v.pins = (const struct hda_pintbl[]) {
6708 { 0x19, 0x04a110f0 },
6712 [ALC255_FIXUP_MIC_MUTE_LED] = {
6713 .type = HDA_FIXUP_FUNC,
6714 .v.func = snd_hda_gen_fixup_micmute_led,
6716 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6717 .type = HDA_FIXUP_PINS,
6718 .v.pins = (const struct hda_pintbl[]) {
6719 { 0x12, 0x90a60130 },
6720 { 0x14, 0x90170110 },
6721 { 0x17, 0x40000008 },
6722 { 0x18, 0x411111f0 },
6723 { 0x19, 0x01a1913c },
6724 { 0x1a, 0x411111f0 },
6725 { 0x1b, 0x411111f0 },
6726 { 0x1d, 0x40f89b2d },
6727 { 0x1e, 0x411111f0 },
6728 { 0x21, 0x0321101f },
6732 [ALC280_FIXUP_HP_GPIO4] = {
6733 .type = HDA_FIXUP_FUNC,
6734 .v.func = alc280_fixup_hp_gpio4,
6736 [ALC286_FIXUP_HP_GPIO_LED] = {
6737 .type = HDA_FIXUP_FUNC,
6738 .v.func = alc286_fixup_hp_gpio_led,
6740 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6741 .type = HDA_FIXUP_FUNC,
6742 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6744 [ALC280_FIXUP_HP_DOCK_PINS] = {
6745 .type = HDA_FIXUP_PINS,
6746 .v.pins = (const struct hda_pintbl[]) {
6747 { 0x1b, 0x21011020 }, /* line-out */
6748 { 0x1a, 0x01a1903c }, /* headset mic */
6749 { 0x18, 0x2181103f }, /* line-in */
6753 .chain_id = ALC280_FIXUP_HP_GPIO4
6755 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6756 .type = HDA_FIXUP_PINS,
6757 .v.pins = (const struct hda_pintbl[]) {
6758 { 0x1b, 0x21011020 }, /* line-out */
6759 { 0x18, 0x2181103f }, /* line-in */
6763 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6765 [ALC280_FIXUP_HP_9480M] = {
6766 .type = HDA_FIXUP_FUNC,
6767 .v.func = alc280_fixup_hp_9480m,
6769 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6770 .type = HDA_FIXUP_FUNC,
6771 .v.func = alc_fixup_headset_mode_dell_alc288,
6773 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6775 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6776 .type = HDA_FIXUP_PINS,
6777 .v.pins = (const struct hda_pintbl[]) {
6778 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6779 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6783 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6785 [ALC288_FIXUP_DISABLE_AAMIX] = {
6786 .type = HDA_FIXUP_FUNC,
6787 .v.func = alc_fixup_disable_aamix,
6789 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6791 [ALC288_FIXUP_DELL_XPS_13] = {
6792 .type = HDA_FIXUP_FUNC,
6793 .v.func = alc_fixup_dell_xps13,
6795 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6797 [ALC292_FIXUP_DISABLE_AAMIX] = {
6798 .type = HDA_FIXUP_FUNC,
6799 .v.func = alc_fixup_disable_aamix,
6801 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6803 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
6804 .type = HDA_FIXUP_FUNC,
6805 .v.func = alc_fixup_disable_aamix,
6807 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6809 [ALC292_FIXUP_DELL_E7X_AAMIX] = {
6810 .type = HDA_FIXUP_FUNC,
6811 .v.func = alc_fixup_dell_xps13,
6813 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
6815 [ALC292_FIXUP_DELL_E7X] = {
6816 .type = HDA_FIXUP_FUNC,
6817 .v.func = snd_hda_gen_fixup_micmute_led,
6818 /* micmute fixup must be applied at last */
6819 .chained_before = true,
6820 .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX,
6822 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = {
6823 .type = HDA_FIXUP_PINS,
6824 .v.pins = (const struct hda_pintbl[]) {
6825 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
6828 .chained_before = true,
6829 .chain_id = ALC269_FIXUP_HEADSET_MODE,
6831 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6832 .type = HDA_FIXUP_PINS,
6833 .v.pins = (const struct hda_pintbl[]) {
6834 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6835 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6839 .chain_id = ALC269_FIXUP_HEADSET_MODE
6841 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
6842 .type = HDA_FIXUP_PINS,
6843 .v.pins = (const struct hda_pintbl[]) {
6844 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6848 .chain_id = ALC269_FIXUP_HEADSET_MODE
6850 [ALC275_FIXUP_DELL_XPS] = {
6851 .type = HDA_FIXUP_VERBS,
6852 .v.verbs = (const struct hda_verb[]) {
6853 /* Enables internal speaker */
6854 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
6855 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
6856 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
6857 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
6861 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
6862 .type = HDA_FIXUP_FUNC,
6863 .v.func = alc_fixup_disable_aamix,
6865 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6867 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
6868 .type = HDA_FIXUP_FUNC,
6869 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
6871 [ALC255_FIXUP_DELL_SPK_NOISE] = {
6872 .type = HDA_FIXUP_FUNC,
6873 .v.func = alc_fixup_disable_aamix,
6875 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6877 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
6878 .type = HDA_FIXUP_FUNC,
6879 .v.func = alc_fixup_disable_mic_vref,
6881 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6883 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6884 .type = HDA_FIXUP_VERBS,
6885 .v.verbs = (const struct hda_verb[]) {
6886 /* Disable pass-through path for FRONT 14h */
6887 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6888 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6892 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
6894 [ALC280_FIXUP_HP_HEADSET_MIC] = {
6895 .type = HDA_FIXUP_FUNC,
6896 .v.func = alc_fixup_disable_aamix,
6898 .chain_id = ALC269_FIXUP_HEADSET_MIC,
6900 [ALC221_FIXUP_HP_FRONT_MIC] = {
6901 .type = HDA_FIXUP_PINS,
6902 .v.pins = (const struct hda_pintbl[]) {
6903 { 0x19, 0x02a19020 }, /* Front Mic */
6907 [ALC292_FIXUP_TPT460] = {
6908 .type = HDA_FIXUP_FUNC,
6909 .v.func = alc_fixup_tpt440_dock,
6911 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
6913 [ALC298_FIXUP_SPK_VOLUME] = {
6914 .type = HDA_FIXUP_FUNC,
6915 .v.func = alc298_fixup_speaker_volume,
6917 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6919 [ALC295_FIXUP_DISABLE_DAC3] = {
6920 .type = HDA_FIXUP_FUNC,
6921 .v.func = alc295_fixup_disable_dac3,
6923 [ALC285_FIXUP_SPEAKER2_TO_DAC1] = {
6924 .type = HDA_FIXUP_FUNC,
6925 .v.func = alc285_fixup_speaker2_to_dac1,
6927 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6929 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
6930 .type = HDA_FIXUP_PINS,
6931 .v.pins = (const struct hda_pintbl[]) {
6932 { 0x1b, 0x90170151 },
6936 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6938 [ALC269_FIXUP_ATIV_BOOK_8] = {
6939 .type = HDA_FIXUP_FUNC,
6940 .v.func = alc_fixup_auto_mute_via_amp,
6942 .chain_id = ALC269_FIXUP_NO_SHUTUP
6944 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
6945 .type = HDA_FIXUP_PINS,
6946 .v.pins = (const struct hda_pintbl[]) {
6947 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6948 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6952 .chain_id = ALC269_FIXUP_HEADSET_MODE
6954 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
6955 .type = HDA_FIXUP_FUNC,
6956 .v.func = alc_fixup_headset_mode,
6958 [ALC256_FIXUP_ASUS_MIC] = {
6959 .type = HDA_FIXUP_PINS,
6960 .v.pins = (const struct hda_pintbl[]) {
6961 { 0x13, 0x90a60160 }, /* use as internal mic */
6962 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6966 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6968 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
6969 .type = HDA_FIXUP_FUNC,
6970 /* Set up GPIO2 for the speaker amp */
6971 .v.func = alc_fixup_gpio4,
6973 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6974 .type = HDA_FIXUP_PINS,
6975 .v.pins = (const struct hda_pintbl[]) {
6976 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6980 .chain_id = ALC269_FIXUP_HEADSET_MIC
6982 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
6983 .type = HDA_FIXUP_VERBS,
6984 .v.verbs = (const struct hda_verb[]) {
6985 /* Enables internal speaker */
6986 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
6987 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
6991 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6993 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
6994 .type = HDA_FIXUP_FUNC,
6995 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
6997 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
6998 .type = HDA_FIXUP_VERBS,
6999 .v.verbs = (const struct hda_verb[]) {
7000 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
7001 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
7005 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7007 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
7008 .type = HDA_FIXUP_PINS,
7009 .v.pins = (const struct hda_pintbl[]) {
7010 /* Change the mic location from front to right, otherwise there are
7011 two front mics with the same name, pulseaudio can't handle them.
7012 This is just a temporary workaround, after applying this fixup,
7013 there will be one "Front Mic" and one "Mic" in this machine.
7015 { 0x1a, 0x04a19040 },
7019 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
7020 .type = HDA_FIXUP_PINS,
7021 .v.pins = (const struct hda_pintbl[]) {
7022 { 0x16, 0x0101102f }, /* Rear Headset HP */
7023 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7024 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7025 { 0x1b, 0x02011020 },
7029 .chain_id = ALC225_FIXUP_S3_POP_NOISE
7031 [ALC225_FIXUP_S3_POP_NOISE] = {
7032 .type = HDA_FIXUP_FUNC,
7033 .v.func = alc225_fixup_s3_pop_noise,
7035 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7037 [ALC700_FIXUP_INTEL_REFERENCE] = {
7038 .type = HDA_FIXUP_VERBS,
7039 .v.verbs = (const struct hda_verb[]) {
7040 /* Enables internal speaker */
7041 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
7042 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
7043 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
7044 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
7045 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
7046 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
7047 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
7048 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
7052 [ALC274_FIXUP_DELL_BIND_DACS] = {
7053 .type = HDA_FIXUP_FUNC,
7054 .v.func = alc274_fixup_bind_dacs,
7056 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7058 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
7059 .type = HDA_FIXUP_PINS,
7060 .v.pins = (const struct hda_pintbl[]) {
7061 { 0x1b, 0x0401102f },
7065 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
7067 [ALC298_FIXUP_TPT470_DOCK_FIX] = {
7068 .type = HDA_FIXUP_FUNC,
7069 .v.func = alc_fixup_tpt470_dock,
7071 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
7073 [ALC298_FIXUP_TPT470_DOCK] = {
7074 .type = HDA_FIXUP_FUNC,
7075 .v.func = alc_fixup_tpt470_dacs,
7077 .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
7079 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
7080 .type = HDA_FIXUP_PINS,
7081 .v.pins = (const struct hda_pintbl[]) {
7082 { 0x14, 0x0201101f },
7086 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7088 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
7089 .type = HDA_FIXUP_PINS,
7090 .v.pins = (const struct hda_pintbl[]) {
7091 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7095 .chain_id = ALC269_FIXUP_HEADSET_MIC
7097 [ALC295_FIXUP_HP_X360] = {
7098 .type = HDA_FIXUP_FUNC,
7099 .v.func = alc295_fixup_hp_top_speakers,
7101 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
7103 [ALC221_FIXUP_HP_HEADSET_MIC] = {
7104 .type = HDA_FIXUP_PINS,
7105 .v.pins = (const struct hda_pintbl[]) {
7106 { 0x19, 0x0181313f},
7110 .chain_id = ALC269_FIXUP_HEADSET_MIC
7112 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
7113 .type = HDA_FIXUP_FUNC,
7114 .v.func = alc285_fixup_invalidate_dacs,
7116 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
7118 [ALC295_FIXUP_HP_AUTO_MUTE] = {
7119 .type = HDA_FIXUP_FUNC,
7120 .v.func = alc_fixup_auto_mute_via_amp,
7122 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
7123 .type = HDA_FIXUP_PINS,
7124 .v.pins = (const struct hda_pintbl[]) {
7125 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7129 .chain_id = ALC269_FIXUP_HEADSET_MIC
7131 [ALC294_FIXUP_ASUS_MIC] = {
7132 .type = HDA_FIXUP_PINS,
7133 .v.pins = (const struct hda_pintbl[]) {
7134 { 0x13, 0x90a60160 }, /* use as internal mic */
7135 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7139 .chain_id = ALC269_FIXUP_HEADSET_MIC
7141 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
7142 .type = HDA_FIXUP_PINS,
7143 .v.pins = (const struct hda_pintbl[]) {
7144 { 0x19, 0x01a1103c }, /* use as headset mic */
7148 .chain_id = ALC269_FIXUP_HEADSET_MIC
7150 [ALC294_FIXUP_ASUS_SPK] = {
7151 .type = HDA_FIXUP_VERBS,
7152 .v.verbs = (const struct hda_verb[]) {
7154 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
7155 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
7156 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7157 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7161 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7163 [ALC295_FIXUP_CHROME_BOOK] = {
7164 .type = HDA_FIXUP_FUNC,
7165 .v.func = alc295_fixup_chromebook,
7167 .chain_id = ALC225_FIXUP_HEADSET_JACK
7169 [ALC225_FIXUP_HEADSET_JACK] = {
7170 .type = HDA_FIXUP_FUNC,
7171 .v.func = alc_fixup_headset_jack,
7173 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
7174 .type = HDA_FIXUP_PINS,
7175 .v.pins = (const struct hda_pintbl[]) {
7176 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7180 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7182 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
7183 .type = HDA_FIXUP_VERBS,
7184 .v.verbs = (const struct hda_verb[]) {
7185 /* Disable PCBEEP-IN passthrough */
7186 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
7187 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
7191 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7193 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
7194 .type = HDA_FIXUP_PINS,
7195 .v.pins = (const struct hda_pintbl[]) {
7196 { 0x19, 0x03a11130 },
7197 { 0x1a, 0x90a60140 }, /* use as internal mic */
7201 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7203 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
7204 .type = HDA_FIXUP_PINS,
7205 .v.pins = (const struct hda_pintbl[]) {
7206 { 0x16, 0x01011020 }, /* Rear Line out */
7207 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7211 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
7213 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
7214 .type = HDA_FIXUP_FUNC,
7215 .v.func = alc_fixup_auto_mute_via_amp,
7217 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7219 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
7220 .type = HDA_FIXUP_FUNC,
7221 .v.func = alc_fixup_disable_mic_vref,
7223 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7225 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
7226 .type = HDA_FIXUP_VERBS,
7227 .v.verbs = (const struct hda_verb[]) {
7228 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
7229 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
7233 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7235 [ALC256_FIXUP_ASUS_HEADSET_MIC] = {
7236 .type = HDA_FIXUP_PINS,
7237 .v.pins = (const struct hda_pintbl[]) {
7238 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7242 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7244 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7245 .type = HDA_FIXUP_PINS,
7246 .v.pins = (const struct hda_pintbl[]) {
7247 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7251 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7253 [ALC299_FIXUP_PREDATOR_SPK] = {
7254 .type = HDA_FIXUP_PINS,
7255 .v.pins = (const struct hda_pintbl[]) {
7256 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7260 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
7261 .type = HDA_FIXUP_PINS,
7262 .v.pins = (const struct hda_pintbl[]) {
7263 { 0x19, 0x04a11040 },
7264 { 0x21, 0x04211020 },
7268 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7270 [ALC289_FIXUP_DELL_SPK2] = {
7271 .type = HDA_FIXUP_PINS,
7272 .v.pins = (const struct hda_pintbl[]) {
7273 { 0x17, 0x90170130 }, /* bass spk */
7277 .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7279 [ALC289_FIXUP_DUAL_SPK] = {
7280 .type = HDA_FIXUP_FUNC,
7281 .v.func = alc285_fixup_speaker2_to_dac1,
7283 .chain_id = ALC289_FIXUP_DELL_SPK2
7285 [ALC294_FIXUP_SPK2_TO_DAC1] = {
7286 .type = HDA_FIXUP_FUNC,
7287 .v.func = alc285_fixup_speaker2_to_dac1,
7289 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7291 [ALC294_FIXUP_ASUS_DUAL_SPK] = {
7292 .type = HDA_FIXUP_FUNC,
7293 /* The GPIO must be pulled to initialize the AMP */
7294 .v.func = alc_fixup_gpio4,
7296 .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
7298 [ALC285_FIXUP_THINKPAD_HEADSET_JACK] = {
7299 .type = HDA_FIXUP_FUNC,
7300 .v.func = alc_fixup_headset_jack,
7302 .chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1
7304 [ALC294_FIXUP_ASUS_HPE] = {
7305 .type = HDA_FIXUP_VERBS,
7306 .v.verbs = (const struct hda_verb[]) {
7308 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
7309 { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
7313 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
7315 [ALC294_FIXUP_ASUS_COEF_1B] = {
7316 .type = HDA_FIXUP_VERBS,
7317 .v.verbs = (const struct hda_verb[]) {
7318 /* Set bit 10 to correct noisy output after reboot from
7319 * Windows 10 (due to pop noise reduction?)
7321 { 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
7322 { 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
7326 [ALC285_FIXUP_HP_GPIO_LED] = {
7327 .type = HDA_FIXUP_FUNC,
7328 .v.func = alc285_fixup_hp_gpio_led,
7330 [ALC285_FIXUP_HP_MUTE_LED] = {
7331 .type = HDA_FIXUP_FUNC,
7332 .v.func = alc285_fixup_hp_mute_led,
7334 [ALC236_FIXUP_HP_MUTE_LED] = {
7335 .type = HDA_FIXUP_FUNC,
7336 .v.func = alc236_fixup_hp_mute_led,
7338 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
7339 .type = HDA_FIXUP_VERBS,
7340 .v.verbs = (const struct hda_verb[]) {
7341 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc5 },
7345 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE] = {
7346 .type = HDA_FIXUP_PINS,
7347 .v.pins = (const struct hda_pintbl[]) {
7348 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7352 .chain_id = ALC269_FIXUP_HEADSET_MODE
7354 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
7355 .type = HDA_FIXUP_PINS,
7356 .v.pins = (const struct hda_pintbl[]) {
7357 { 0x14, 0x90100120 }, /* use as internal speaker */
7358 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7359 { 0x1a, 0x01011020 }, /* use as line out */
7363 .chain_id = ALC269_FIXUP_HEADSET_MIC
7365 [ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
7366 .type = HDA_FIXUP_PINS,
7367 .v.pins = (const struct hda_pintbl[]) {
7368 { 0x18, 0x02a11030 }, /* use as headset mic */
7372 .chain_id = ALC269_FIXUP_HEADSET_MIC
7374 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
7375 .type = HDA_FIXUP_PINS,
7376 .v.pins = (const struct hda_pintbl[]) {
7377 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7381 .chain_id = ALC269_FIXUP_HEADSET_MIC
7383 [ALC289_FIXUP_ASUS_GA401] = {
7384 .type = HDA_FIXUP_PINS,
7385 .v.pins = (const struct hda_pintbl[]) {
7386 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7390 [ALC289_FIXUP_ASUS_GA502] = {
7391 .type = HDA_FIXUP_PINS,
7392 .v.pins = (const struct hda_pintbl[]) {
7393 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7397 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = {
7398 .type = HDA_FIXUP_PINS,
7399 .v.pins = (const struct hda_pintbl[]) {
7400 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
7404 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
7406 [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
7407 .type = HDA_FIXUP_FUNC,
7408 .v.func = alc285_fixup_hp_gpio_amp_init,
7410 .chain_id = ALC285_FIXUP_HP_GPIO_LED
7412 [ALC269_FIXUP_CZC_B20] = {
7413 .type = HDA_FIXUP_PINS,
7414 .v.pins = (const struct hda_pintbl[]) {
7415 { 0x12, 0x411111f0 },
7416 { 0x14, 0x90170110 }, /* speaker */
7417 { 0x15, 0x032f1020 }, /* HP out */
7418 { 0x17, 0x411111f0 },
7419 { 0x18, 0x03ab1040 }, /* mic */
7420 { 0x19, 0xb7a7013f },
7421 { 0x1a, 0x0181305f },
7422 { 0x1b, 0x411111f0 },
7423 { 0x1d, 0x411111f0 },
7424 { 0x1e, 0x411111f0 },
7427 .chain_id = ALC269_FIXUP_DMIC,
7429 [ALC269_FIXUP_CZC_TMI] = {
7430 .type = HDA_FIXUP_PINS,
7431 .v.pins = (const struct hda_pintbl[]) {
7432 { 0x12, 0x4000c000 },
7433 { 0x14, 0x90170110 }, /* speaker */
7434 { 0x15, 0x0421401f }, /* HP out */
7435 { 0x17, 0x411111f0 },
7436 { 0x18, 0x04a19020 }, /* mic */
7437 { 0x19, 0x411111f0 },
7438 { 0x1a, 0x411111f0 },
7439 { 0x1b, 0x411111f0 },
7440 { 0x1d, 0x40448505 },
7441 { 0x1e, 0x411111f0 },
7442 { 0x20, 0x8000ffff },
7445 .chain_id = ALC269_FIXUP_DMIC,
7447 [ALC269_FIXUP_CZC_L101] = {
7448 .type = HDA_FIXUP_PINS,
7449 .v.pins = (const struct hda_pintbl[]) {
7450 { 0x12, 0x40000000 },
7451 { 0x14, 0x01014010 }, /* speaker */
7452 { 0x15, 0x411111f0 }, /* HP out */
7453 { 0x16, 0x411111f0 },
7454 { 0x18, 0x01a19020 }, /* mic */
7455 { 0x19, 0x02a19021 },
7456 { 0x1a, 0x0181302f },
7457 { 0x1b, 0x0221401f },
7458 { 0x1c, 0x411111f0 },
7459 { 0x1d, 0x4044c601 },
7460 { 0x1e, 0x411111f0 },
7463 .chain_id = ALC269_FIXUP_DMIC,
7465 [ALC269_FIXUP_LEMOTE_A1802] = {
7466 .type = HDA_FIXUP_PINS,
7467 .v.pins = (const struct hda_pintbl[]) {
7468 { 0x12, 0x40000000 },
7469 { 0x14, 0x90170110 }, /* speaker */
7470 { 0x17, 0x411111f0 },
7471 { 0x18, 0x03a19040 }, /* mic1 */
7472 { 0x19, 0x90a70130 }, /* mic2 */
7473 { 0x1a, 0x411111f0 },
7474 { 0x1b, 0x411111f0 },
7475 { 0x1d, 0x40489d2d },
7476 { 0x1e, 0x411111f0 },
7477 { 0x20, 0x0003ffff },
7478 { 0x21, 0x03214020 },
7481 .chain_id = ALC269_FIXUP_DMIC,
7483 [ALC269_FIXUP_LEMOTE_A190X] = {
7484 .type = HDA_FIXUP_PINS,
7485 .v.pins = (const struct hda_pintbl[]) {
7486 { 0x14, 0x99130110 }, /* speaker */
7487 { 0x15, 0x0121401f }, /* HP out */
7488 { 0x18, 0x01a19c20 }, /* rear mic */
7489 { 0x19, 0x99a3092f }, /* front mic */
7490 { 0x1b, 0x0201401f }, /* front lineout */
7493 .chain_id = ALC269_FIXUP_DMIC,
7497 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
7498 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
7499 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
7500 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
7501 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
7502 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7503 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
7504 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
7505 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
7506 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7507 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
7508 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
7509 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
7510 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
7511 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
7512 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7513 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
7514 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
7515 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
7516 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
7517 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7518 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7519 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7520 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
7521 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
7522 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
7523 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE),
7524 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
7525 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
7526 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
7527 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
7528 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
7529 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
7530 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
7531 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7532 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7533 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
7534 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7535 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
7536 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
7537 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
7538 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
7539 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7540 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7541 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
7542 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7543 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
7544 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
7545 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7546 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7547 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7548 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7549 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7550 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7551 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
7552 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7553 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
7554 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
7555 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
7556 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
7557 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
7558 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
7559 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
7560 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7561 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7562 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7563 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
7564 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
7565 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
7566 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
7567 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
7568 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7569 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK),
7570 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7571 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE),
7572 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7573 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
7574 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
7575 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
7576 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
7577 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
7579 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7580 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7581 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7582 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7583 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7584 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7585 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7586 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
7587 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7588 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7589 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7590 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7591 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
7592 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7593 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
7594 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7595 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7596 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7597 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7598 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7599 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
7600 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7601 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7603 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7604 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7605 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7606 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7607 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7608 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7609 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7610 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7611 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7612 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
7613 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7614 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7615 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7616 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7617 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7618 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7619 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
7620 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7621 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7622 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7623 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7624 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7625 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7626 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7627 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7628 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7629 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7630 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7631 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
7632 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
7633 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7634 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7635 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7636 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
7637 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
7638 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7639 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
7640 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7641 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7642 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
7643 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
7644 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
7645 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
7646 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
7647 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
7648 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7649 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
7650 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7651 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
7652 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
7653 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7654 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7655 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7656 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7657 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
7658 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
7659 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
7660 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
7661 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
7662 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
7663 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
7664 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
7665 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
7666 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC),
7667 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE),
7668 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
7669 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE),
7670 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
7671 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
7672 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B),
7673 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
7674 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
7675 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7676 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
7677 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
7678 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
7679 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
7680 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
7681 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
7682 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7683 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
7684 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
7685 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7686 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
7687 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
7688 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7689 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
7690 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
7691 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
7692 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
7693 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7694 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
7695 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
7696 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
7697 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
7698 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
7699 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
7700 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
7701 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
7702 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
7703 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
7704 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
7705 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
7706 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
7707 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
7708 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7709 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7710 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
7711 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7712 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
7713 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
7714 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7715 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
7716 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
7717 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
7718 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
7719 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
7720 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
7721 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
7722 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
7723 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
7724 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
7725 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
7726 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
7727 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
7728 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
7729 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
7730 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
7731 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
7732 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7733 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
7734 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
7735 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
7736 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7737 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7738 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
7739 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
7740 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
7741 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7742 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7743 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
7744 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7745 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7746 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7747 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7748 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7749 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7750 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7751 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
7752 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7753 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7754 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7755 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7756 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
7757 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7758 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7759 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
7760 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7761 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
7762 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7763 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7764 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
7765 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
7766 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7767 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
7768 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
7769 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
7770 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
7771 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
7772 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
7773 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
7774 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
7775 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7776 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7777 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7778 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7779 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7780 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
7781 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
7782 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
7783 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
7784 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20),
7785 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI),
7786 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101),
7787 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
7788 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC),
7789 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
7790 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802),
7791 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X),
7794 /* Below is a quirk table taken from the old code.
7795 * Basically the device should work as is without the fixup table.
7796 * If BIOS doesn't give a proper info, enable the corresponding
7799 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7801 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
7802 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
7803 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
7804 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
7805 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
7806 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
7807 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
7808 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
7809 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
7810 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
7811 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
7812 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
7813 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
7814 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
7815 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
7816 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
7817 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
7818 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
7819 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
7820 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
7821 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
7822 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
7823 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
7824 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
7825 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
7826 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
7827 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
7828 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
7829 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
7830 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
7831 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
7832 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
7833 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
7834 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
7835 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
7836 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
7837 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
7838 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
7839 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
7844 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
7845 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
7846 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
7847 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
7848 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
7849 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED),
7853 static const struct hda_model_fixup alc269_fixup_models[] = {
7854 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
7855 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
7856 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
7857 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
7858 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7859 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
7860 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
7861 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
7862 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
7863 {.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
7864 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7865 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
7866 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
7867 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
7868 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
7869 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
7870 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
7871 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
7872 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
7873 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
7874 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
7875 {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
7876 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
7877 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
7878 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
7879 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
7880 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
7881 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
7882 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
7883 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
7884 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
7885 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
7886 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
7887 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
7888 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
7889 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
7890 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
7891 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
7892 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
7893 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
7894 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
7895 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
7896 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
7897 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
7898 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
7899 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
7900 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
7901 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
7902 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
7903 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
7904 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
7905 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
7906 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
7907 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
7908 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
7909 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
7910 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
7911 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
7912 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
7913 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
7914 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
7915 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
7916 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
7917 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
7918 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
7919 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
7920 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
7921 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
7922 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7923 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
7924 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
7925 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
7926 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
7927 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
7928 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
7929 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
7930 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
7931 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
7932 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
7933 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
7934 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
7935 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
7936 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
7937 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
7938 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
7939 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
7940 {.id = ALC285_FIXUP_SPEAKER2_TO_DAC1, .name = "alc285-speaker2-to-dac1"},
7941 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
7942 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
7943 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
7944 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
7945 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
7946 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
7947 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
7948 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
7949 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
7950 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
7951 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
7952 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
7953 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
7954 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
7955 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
7956 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
7957 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
7958 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
7959 {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
7960 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
7961 {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
7962 {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
7965 #define ALC225_STANDARD_PINS \
7968 #define ALC256_STANDARD_PINS \
7969 {0x12, 0x90a60140}, \
7970 {0x14, 0x90170110}, \
7973 #define ALC282_STANDARD_PINS \
7976 #define ALC290_STANDARD_PINS \
7979 #define ALC292_STANDARD_PINS \
7980 {0x14, 0x90170110}, \
7983 #define ALC295_STANDARD_PINS \
7984 {0x12, 0xb7a60130}, \
7985 {0x14, 0x90170110}, \
7988 #define ALC298_STANDARD_PINS \
7989 {0x12, 0x90a60130}, \
7992 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
7993 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
7998 {0x21, 0x0221102f}),
7999 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
8002 {0x21, 0x02211030}),
8003 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8006 {0x21, 0x03211020}),
8007 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
8010 {0x21, 0x03211020}),
8011 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8012 ALC225_STANDARD_PINS,
8014 {0x14, 0x901701a0}),
8015 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8016 ALC225_STANDARD_PINS,
8018 {0x14, 0x901701b0}),
8019 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8020 ALC225_STANDARD_PINS,
8022 {0x14, 0x901701a0}),
8023 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8024 ALC225_STANDARD_PINS,
8026 {0x14, 0x901701b0}),
8027 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
8028 ALC225_STANDARD_PINS,
8030 {0x1b, 0x90170110}),
8031 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8034 {0x21, 0x02211020}),
8035 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
8039 {0x21, 0x02211020}),
8040 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8045 {0x21, 0x0221101f}),
8046 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8051 {0x21, 0x0221101f}),
8052 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
8056 {0x21, 0x0221101f}),
8057 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
8059 {0x21, 0x02211020}),
8060 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8062 {0x21, 0x02211040}),
8063 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8066 {0x21, 0x02211020}),
8067 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8070 {0x21, 0x02211030}),
8071 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8074 {0x21, 0x0221101f}),
8075 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8078 {0x21, 0x0221101f}),
8079 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8082 {0x21, 0x0221103f}),
8083 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8086 {0x21, 0x0221103f}),
8087 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8090 {0x21, 0x0221103f}),
8091 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8094 {0x21, 0x0221105f}),
8095 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8098 {0x21, 0x0221101f}),
8099 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8103 {0x21, 0x0321102f}),
8104 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8107 {0x21, 0x02211040}),
8108 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8111 {0x21, 0x02211050}),
8112 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8115 {0x21, 0x02211030}),
8116 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8119 {0x21, 0x02211040}),
8120 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8123 {0x21, 0x02211040}),
8124 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8127 {0x21, 0x02211050}),
8128 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8131 {0x21, 0x02211040}),
8132 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8135 {0x21, 0x02211030}),
8136 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8138 {0x21, 0x02211010}),
8139 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8142 {0x21, 0x04211020}),
8143 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
8146 {0x21, 0x03211020}),
8147 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8150 {0x21, 0x03211020}),
8151 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8154 {0x21, 0x04211020}),
8155 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
8158 {0x21, 0x03211020}),
8159 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
8163 {0x1a, 0x04a11020}),
8164 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
8170 {0x1b, 0x02011020}),
8171 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8172 ALC282_STANDARD_PINS,
8175 {0x21, 0x0321101f}),
8176 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8177 ALC282_STANDARD_PINS,
8180 {0x21, 0x03211040}),
8181 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8182 ALC282_STANDARD_PINS,
8185 {0x21, 0x03211020}),
8186 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8187 ALC282_STANDARD_PINS,
8190 {0x21, 0x0421101f}),
8191 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
8192 ALC282_STANDARD_PINS,
8195 {0x21, 0x04211020}),
8196 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8197 ALC282_STANDARD_PINS,
8199 {0x21, 0x0321101f}),
8200 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8203 {0x21, 0x02211030}),
8204 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8205 ALC282_STANDARD_PINS,
8208 {0x21, 0x0321101f}),
8209 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
8213 {0x21, 0x04211020}),
8214 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
8217 {0x21, 0x02211020}),
8218 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
8221 {0x21, 0x0321101f}),
8222 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8223 ALC290_STANDARD_PINS,
8226 {0x1a, 0x04a11020}),
8227 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8228 ALC290_STANDARD_PINS,
8231 {0x1a, 0x04a11020}),
8232 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8233 ALC290_STANDARD_PINS,
8235 {0x1a, 0x04a11020}),
8236 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8237 ALC290_STANDARD_PINS,
8239 {0x1a, 0x04a11040}),
8240 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8241 ALC290_STANDARD_PINS,
8244 {0x1a, 0x04a11040}),
8245 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8246 ALC290_STANDARD_PINS,
8249 {0x1a, 0x04a11020}),
8250 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
8251 ALC290_STANDARD_PINS,
8254 {0x1a, 0x04a11020}),
8255 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
8256 ALC292_STANDARD_PINS,
8259 {0x19, 0x01a19030}),
8260 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
8261 ALC292_STANDARD_PINS,
8265 {0x19, 0x01a1903e}),
8266 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
8267 ALC292_STANDARD_PINS,
8268 {0x12, 0x90a60140}),
8269 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
8270 ALC292_STANDARD_PINS,
8273 {0x19, 0x21a19030}),
8274 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
8275 ALC292_STANDARD_PINS,
8276 {0x13, 0x90a60140}),
8277 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
8280 {0x21, 0x04211020}),
8281 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
8284 {0x21, 0x03211020}),
8285 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
8288 {0x21, 0x04211020}),
8289 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
8292 {0x21, 0x03211020}),
8293 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8296 {0x21, 0x04211030}),
8297 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8300 {0x21, 0x03211020}),
8301 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
8304 {0x21, 0x03211020}),
8305 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8307 {0x21, 0x04211020}),
8308 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8310 {0x21, 0x04211030}),
8311 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8312 ALC295_STANDARD_PINS,
8314 {0x18, 0x21a19030}),
8315 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8316 ALC295_STANDARD_PINS,
8318 {0x18, 0x21a19050}),
8319 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
8320 ALC295_STANDARD_PINS),
8321 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8322 ALC298_STANDARD_PINS,
8323 {0x17, 0x90170110}),
8324 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8325 ALC298_STANDARD_PINS,
8326 {0x17, 0x90170140}),
8327 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
8328 ALC298_STANDARD_PINS,
8329 {0x17, 0x90170150}),
8330 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
8335 {0x21, 0x03211030}),
8336 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE,
8340 {0x21, 0x03211020}),
8341 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8342 ALC225_STANDARD_PINS,
8344 {0x17, 0x90170110}),
8345 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC,
8350 {0x21, 0x0221101f}),
8354 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
8355 * more machines, don't need to match all valid pins, just need to match
8356 * all the pins defined in the tbl. Just because of this reason, it is possible
8357 * that a single machine matches multiple tbls, so there is one limitation:
8358 * at most one tbl is allowed to define for the same vendor and same codec
8360 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = {
8361 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
8363 {0x1b, 0x40000000}),
8364 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8366 {0x1a, 0x40000000}),
8367 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
8369 {0x1a, 0x40000000}),
8370 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
8372 {0x1a, 0x40000000}),
8376 static void alc269_fill_coef(struct hda_codec *codec)
8378 struct alc_spec *spec = codec->spec;
8381 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
8384 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
8385 alc_write_coef_idx(codec, 0xf, 0x960b);
8386 alc_write_coef_idx(codec, 0xe, 0x8817);
8389 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
8390 alc_write_coef_idx(codec, 0xf, 0x960b);
8391 alc_write_coef_idx(codec, 0xe, 0x8814);
8394 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
8395 /* Power up output pin */
8396 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
8399 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
8400 val = alc_read_coef_idx(codec, 0xd);
8401 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
8402 /* Capless ramp up clock control */
8403 alc_write_coef_idx(codec, 0xd, val | (1<<10));
8405 val = alc_read_coef_idx(codec, 0x17);
8406 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
8407 /* Class D power on reset */
8408 alc_write_coef_idx(codec, 0x17, val | (1<<7));
8413 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
8418 static int patch_alc269(struct hda_codec *codec)
8420 struct alc_spec *spec;
8423 err = alc_alloc_spec(codec, 0x0b);
8428 spec->gen.shared_mic_vref_pin = 0x18;
8429 codec->power_save_node = 0;
8432 codec->patch_ops.suspend = alc269_suspend;
8433 codec->patch_ops.resume = alc269_resume;
8435 spec->shutup = alc_default_shutup;
8436 spec->init_hook = alc_default_init;
8438 switch (codec->core.vendor_id) {
8440 spec->codec_variant = ALC269_TYPE_ALC269VA;
8441 switch (alc_get_coef0(codec) & 0x00f0) {
8443 if (codec->bus->pci &&
8444 codec->bus->pci->subsystem_vendor == 0x1025 &&
8445 spec->cdefine.platform_type == 1)
8446 err = alc_codec_rename(codec, "ALC271X");
8447 spec->codec_variant = ALC269_TYPE_ALC269VB;
8450 if (codec->bus->pci &&
8451 codec->bus->pci->subsystem_vendor == 0x17aa &&
8452 codec->bus->pci->subsystem_device == 0x21f3)
8453 err = alc_codec_rename(codec, "ALC3202");
8454 spec->codec_variant = ALC269_TYPE_ALC269VC;
8457 spec->codec_variant = ALC269_TYPE_ALC269VD;
8460 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8464 spec->shutup = alc269_shutup;
8465 spec->init_hook = alc269_fill_coef;
8466 alc269_fill_coef(codec);
8471 spec->codec_variant = ALC269_TYPE_ALC280;
8474 spec->codec_variant = ALC269_TYPE_ALC282;
8475 spec->shutup = alc282_shutup;
8476 spec->init_hook = alc282_init;
8480 spec->codec_variant = ALC269_TYPE_ALC283;
8481 spec->shutup = alc283_shutup;
8482 spec->init_hook = alc283_init;
8486 spec->codec_variant = ALC269_TYPE_ALC284;
8489 spec->codec_variant = ALC269_TYPE_ALC293;
8493 spec->codec_variant = ALC269_TYPE_ALC286;
8496 spec->codec_variant = ALC269_TYPE_ALC298;
8500 spec->codec_variant = ALC269_TYPE_ALC255;
8501 spec->shutup = alc256_shutup;
8502 spec->init_hook = alc256_init;
8506 spec->codec_variant = ALC269_TYPE_ALC256;
8507 spec->shutup = alc256_shutup;
8508 spec->init_hook = alc256_init;
8509 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
8512 spec->codec_variant = ALC269_TYPE_ALC257;
8513 spec->shutup = alc256_shutup;
8514 spec->init_hook = alc256_init;
8515 spec->gen.mixer_nid = 0;
8522 spec->codec_variant = ALC269_TYPE_ALC215;
8523 spec->shutup = alc225_shutup;
8524 spec->init_hook = alc225_init;
8525 spec->gen.mixer_nid = 0;
8530 spec->codec_variant = ALC269_TYPE_ALC225;
8531 spec->shutup = alc225_shutup;
8532 spec->init_hook = alc225_init;
8533 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
8538 spec->codec_variant = ALC269_TYPE_ALC294;
8539 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
8540 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
8541 spec->init_hook = alc294_init;
8544 spec->codec_variant = ALC269_TYPE_ALC300;
8545 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
8548 spec->codec_variant = ALC269_TYPE_ALC623;
8554 spec->codec_variant = ALC269_TYPE_ALC700;
8555 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
8556 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
8557 spec->init_hook = alc294_init;
8562 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
8563 spec->has_alc5505_dsp = 1;
8564 spec->init_hook = alc5505_dsp_init;
8567 alc_pre_init(codec);
8569 snd_hda_pick_fixup(codec, alc269_fixup_models,
8570 alc269_fixup_tbl, alc269_fixups);
8571 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups, true);
8572 snd_hda_pick_pin_fixup(codec, alc269_fallback_pin_fixup_tbl, alc269_fixups, false);
8573 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
8575 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8577 alc_auto_parse_customize_define(codec);
8579 if (has_cdefine_beep(codec))
8580 spec->gen.beep_nid = 0x01;
8582 /* automatic parse from the BIOS config */
8583 err = alc269_parse_auto_config(codec);
8587 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
8588 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
8593 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8606 static int alc861_parse_auto_config(struct hda_codec *codec)
8608 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
8609 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
8610 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
8613 /* Pin config fixes */
8615 ALC861_FIXUP_FSC_AMILO_PI1505,
8616 ALC861_FIXUP_AMP_VREF_0F,
8617 ALC861_FIXUP_NO_JACK_DETECT,
8618 ALC861_FIXUP_ASUS_A6RP,
8619 ALC660_FIXUP_ASUS_W7J,
8622 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
8623 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
8624 const struct hda_fixup *fix, int action)
8626 struct alc_spec *spec = codec->spec;
8629 if (action != HDA_FIXUP_ACT_INIT)
8631 val = snd_hda_codec_get_pin_target(codec, 0x0f);
8632 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
8633 val |= AC_PINCTL_IN_EN;
8634 val |= AC_PINCTL_VREF_50;
8635 snd_hda_set_pin_ctl(codec, 0x0f, val);
8636 spec->gen.keep_vref_in_automute = 1;
8639 /* suppress the jack-detection */
8640 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
8641 const struct hda_fixup *fix, int action)
8643 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8644 codec->no_jack_detect = 1;
8647 static const struct hda_fixup alc861_fixups[] = {
8648 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
8649 .type = HDA_FIXUP_PINS,
8650 .v.pins = (const struct hda_pintbl[]) {
8651 { 0x0b, 0x0221101f }, /* HP */
8652 { 0x0f, 0x90170310 }, /* speaker */
8656 [ALC861_FIXUP_AMP_VREF_0F] = {
8657 .type = HDA_FIXUP_FUNC,
8658 .v.func = alc861_fixup_asus_amp_vref_0f,
8660 [ALC861_FIXUP_NO_JACK_DETECT] = {
8661 .type = HDA_FIXUP_FUNC,
8662 .v.func = alc_fixup_no_jack_detect,
8664 [ALC861_FIXUP_ASUS_A6RP] = {
8665 .type = HDA_FIXUP_FUNC,
8666 .v.func = alc861_fixup_asus_amp_vref_0f,
8668 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
8670 [ALC660_FIXUP_ASUS_W7J] = {
8671 .type = HDA_FIXUP_VERBS,
8672 .v.verbs = (const struct hda_verb[]) {
8673 /* ASUS W7J needs a magic pin setup on unused NID 0x10
8674 * for enabling outputs
8676 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
8682 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
8683 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
8684 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
8685 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
8686 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
8687 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
8688 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F),
8689 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F),
8690 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
8696 static int patch_alc861(struct hda_codec *codec)
8698 struct alc_spec *spec;
8701 err = alc_alloc_spec(codec, 0x15);
8706 if (has_cdefine_beep(codec))
8707 spec->gen.beep_nid = 0x23;
8710 spec->power_hook = alc_power_eapd;
8713 alc_pre_init(codec);
8715 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
8716 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8718 /* automatic parse from the BIOS config */
8719 err = alc861_parse_auto_config(codec);
8723 if (!spec->gen.no_analog) {
8724 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
8729 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8743 * In addition, an independent DAC
8745 static int alc861vd_parse_auto_config(struct hda_codec *codec)
8747 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
8748 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8749 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
8753 ALC660VD_FIX_ASUS_GPIO1,
8754 ALC861VD_FIX_DALLAS,
8757 /* exclude VREF80 */
8758 static void alc861vd_fixup_dallas(struct hda_codec *codec,
8759 const struct hda_fixup *fix, int action)
8761 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8762 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
8763 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
8768 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
8769 const struct hda_fixup *fix, int action)
8771 struct alc_spec *spec = codec->spec;
8773 if (action == HDA_FIXUP_ACT_PRE_PROBE)
8774 spec->gpio_mask |= 0x02;
8775 alc_fixup_gpio(codec, action, 0x01);
8778 static const struct hda_fixup alc861vd_fixups[] = {
8779 [ALC660VD_FIX_ASUS_GPIO1] = {
8780 .type = HDA_FIXUP_FUNC,
8781 .v.func = alc660vd_fixup_asus_gpio1,
8783 [ALC861VD_FIX_DALLAS] = {
8784 .type = HDA_FIXUP_FUNC,
8785 .v.func = alc861vd_fixup_dallas,
8789 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
8790 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
8791 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
8792 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
8798 static int patch_alc861vd(struct hda_codec *codec)
8800 struct alc_spec *spec;
8803 err = alc_alloc_spec(codec, 0x0b);
8808 if (has_cdefine_beep(codec))
8809 spec->gen.beep_nid = 0x23;
8811 spec->shutup = alc_eapd_shutup;
8813 alc_pre_init(codec);
8815 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
8816 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8818 /* automatic parse from the BIOS config */
8819 err = alc861vd_parse_auto_config(codec);
8823 if (!spec->gen.no_analog) {
8824 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
8829 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8841 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8842 * configuration. Each pin widget can choose any input DACs and a mixer.
8843 * Each ADC is connected from a mixer of all inputs. This makes possible
8844 * 6-channel independent captures.
8846 * In addition, an independent DAC for the multi-playback (not used in this
8851 * BIOS auto configuration
8854 static int alc662_parse_auto_config(struct hda_codec *codec)
8856 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
8857 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
8858 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8859 const hda_nid_t *ssids;
8861 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
8862 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
8863 codec->core.vendor_id == 0x10ec0671)
8864 ssids = alc663_ssids;
8866 ssids = alc662_ssids;
8867 return alc_parse_auto_config(codec, alc662_ignore, ssids);
8870 static void alc272_fixup_mario(struct hda_codec *codec,
8871 const struct hda_fixup *fix, int action)
8873 if (action != HDA_FIXUP_ACT_PRE_PROBE)
8875 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
8876 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
8877 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
8878 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
8879 (0 << AC_AMPCAP_MUTE_SHIFT)))
8880 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
8883 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
8885 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
8887 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
8888 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
8892 /* override the 2.1 chmap */
8893 static void alc_fixup_bass_chmap(struct hda_codec *codec,
8894 const struct hda_fixup *fix, int action)
8896 if (action == HDA_FIXUP_ACT_BUILD) {
8897 struct alc_spec *spec = codec->spec;
8898 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8902 /* avoid D3 for keeping GPIO up */
8903 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
8905 unsigned int power_state)
8907 struct alc_spec *spec = codec->spec;
8908 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
8913 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
8914 const struct hda_fixup *fix, int action)
8916 struct alc_spec *spec = codec->spec;
8918 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
8919 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8920 spec->mute_led_polarity = 1;
8921 codec->power_filter = gpio_led_power_filter;
8925 static void alc662_usi_automute_hook(struct hda_codec *codec,
8926 struct hda_jack_callback *jack)
8928 struct alc_spec *spec = codec->spec;
8931 snd_hda_gen_hp_automute(codec, jack);
8933 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
8935 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
8939 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
8940 const struct hda_fixup *fix, int action)
8942 struct alc_spec *spec = codec->spec;
8943 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8944 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8945 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
8949 static void alc662_aspire_ethos_mute_speakers(struct hda_codec *codec,
8950 struct hda_jack_callback *cb)
8952 /* surround speakers at 0x1b already get muted automatically when
8953 * headphones are plugged in, but we have to mute/unmute the remaining
8954 * channels manually:
8955 * 0x15 - front left/front right
8956 * 0x18 - front center/ LFE
8958 if (snd_hda_jack_detect_state(codec, 0x1b) == HDA_JACK_PRESENT) {
8959 snd_hda_set_pin_ctl_cache(codec, 0x15, 0);
8960 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
8962 snd_hda_set_pin_ctl_cache(codec, 0x15, PIN_OUT);
8963 snd_hda_set_pin_ctl_cache(codec, 0x18, PIN_OUT);
8967 static void alc662_fixup_aspire_ethos_hp(struct hda_codec *codec,
8968 const struct hda_fixup *fix, int action)
8970 /* Pin 0x1b: shared headphones jack and surround speakers */
8971 if (!is_jack_detectable(codec, 0x1b))
8975 case HDA_FIXUP_ACT_PRE_PROBE:
8976 snd_hda_jack_detect_enable_callback(codec, 0x1b,
8977 alc662_aspire_ethos_mute_speakers);
8978 /* subwoofer needs an extra GPIO setting to become audible */
8979 alc_setup_gpio(codec, 0x02);
8981 case HDA_FIXUP_ACT_INIT:
8982 /* Make sure to start in a correct state, i.e. if
8983 * headphones have been plugged in before powering up the system
8985 alc662_aspire_ethos_mute_speakers(codec, NULL);
8990 static void alc671_fixup_hp_headset_mic2(struct hda_codec *codec,
8991 const struct hda_fixup *fix, int action)
8993 struct alc_spec *spec = codec->spec;
8995 static const struct hda_pintbl pincfgs[] = {
8996 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
8997 { 0x1b, 0x0181304f },
9002 case HDA_FIXUP_ACT_PRE_PROBE:
9003 spec->gen.mixer_nid = 0;
9004 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
9005 snd_hda_apply_pincfgs(codec, pincfgs);
9007 case HDA_FIXUP_ACT_INIT:
9008 alc_write_coef_idx(codec, 0x19, 0xa054);
9013 static const struct coef_fw alc668_coefs[] = {
9014 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
9015 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
9016 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
9017 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
9018 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
9019 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
9020 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
9021 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
9022 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
9023 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
9024 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
9025 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
9026 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
9027 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
9028 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
9029 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
9030 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
9031 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
9032 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
9033 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
9037 static void alc668_restore_default_value(struct hda_codec *codec)
9039 alc_process_coef_fw(codec, alc668_coefs);
9043 ALC662_FIXUP_ASPIRE,
9044 ALC662_FIXUP_LED_GPIO1,
9045 ALC662_FIXUP_IDEAPAD,
9047 ALC662_FIXUP_CZC_ET26,
9048 ALC662_FIXUP_CZC_P10T,
9049 ALC662_FIXUP_SKU_IGNORE,
9050 ALC662_FIXUP_HP_RP5800,
9051 ALC662_FIXUP_ASUS_MODE1,
9052 ALC662_FIXUP_ASUS_MODE2,
9053 ALC662_FIXUP_ASUS_MODE3,
9054 ALC662_FIXUP_ASUS_MODE4,
9055 ALC662_FIXUP_ASUS_MODE5,
9056 ALC662_FIXUP_ASUS_MODE6,
9057 ALC662_FIXUP_ASUS_MODE7,
9058 ALC662_FIXUP_ASUS_MODE8,
9059 ALC662_FIXUP_NO_JACK_DETECT,
9060 ALC662_FIXUP_ZOTAC_Z68,
9061 ALC662_FIXUP_INV_DMIC,
9062 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9063 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
9064 ALC662_FIXUP_HEADSET_MODE,
9065 ALC668_FIXUP_HEADSET_MODE,
9066 ALC662_FIXUP_BASS_MODE4_CHMAP,
9067 ALC662_FIXUP_BASS_16,
9068 ALC662_FIXUP_BASS_1A,
9069 ALC662_FIXUP_BASS_CHMAP,
9070 ALC668_FIXUP_AUTO_MUTE,
9071 ALC668_FIXUP_DELL_DISABLE_AAMIX,
9072 ALC668_FIXUP_DELL_XPS13,
9073 ALC662_FIXUP_ASUS_Nx50,
9074 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9075 ALC668_FIXUP_ASUS_Nx51,
9076 ALC668_FIXUP_MIC_COEF,
9077 ALC668_FIXUP_ASUS_G751,
9078 ALC891_FIXUP_HEADSET_MODE,
9079 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9080 ALC662_FIXUP_ACER_VERITON,
9081 ALC892_FIXUP_ASROCK_MOBO,
9082 ALC662_FIXUP_USI_FUNC,
9083 ALC662_FIXUP_USI_HEADSET_MODE,
9084 ALC662_FIXUP_LENOVO_MULTI_CODECS,
9085 ALC669_FIXUP_ACER_ASPIRE_ETHOS,
9086 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET,
9087 ALC671_FIXUP_HP_HEADSET_MIC2,
9088 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE,
9089 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE,
9092 static const struct hda_fixup alc662_fixups[] = {
9093 [ALC662_FIXUP_ASPIRE] = {
9094 .type = HDA_FIXUP_PINS,
9095 .v.pins = (const struct hda_pintbl[]) {
9096 { 0x15, 0x99130112 }, /* subwoofer */
9100 [ALC662_FIXUP_LED_GPIO1] = {
9101 .type = HDA_FIXUP_FUNC,
9102 .v.func = alc662_fixup_led_gpio1,
9104 [ALC662_FIXUP_IDEAPAD] = {
9105 .type = HDA_FIXUP_PINS,
9106 .v.pins = (const struct hda_pintbl[]) {
9107 { 0x17, 0x99130112 }, /* subwoofer */
9111 .chain_id = ALC662_FIXUP_LED_GPIO1,
9113 [ALC272_FIXUP_MARIO] = {
9114 .type = HDA_FIXUP_FUNC,
9115 .v.func = alc272_fixup_mario,
9117 [ALC662_FIXUP_CZC_ET26] = {
9118 .type = HDA_FIXUP_PINS,
9119 .v.pins = (const struct hda_pintbl[]) {
9121 {0x14, 0x90170110}, /* speaker */
9124 {0x18, 0x01a19030}, /* mic */
9125 {0x19, 0x90a7013f}, /* int-mic */
9134 .chain_id = ALC662_FIXUP_SKU_IGNORE
9136 [ALC662_FIXUP_CZC_P10T] = {
9137 .type = HDA_FIXUP_VERBS,
9138 .v.verbs = (const struct hda_verb[]) {
9139 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
9143 [ALC662_FIXUP_SKU_IGNORE] = {
9144 .type = HDA_FIXUP_FUNC,
9145 .v.func = alc_fixup_sku_ignore,
9147 [ALC662_FIXUP_HP_RP5800] = {
9148 .type = HDA_FIXUP_PINS,
9149 .v.pins = (const struct hda_pintbl[]) {
9150 { 0x14, 0x0221201f }, /* HP out */
9154 .chain_id = ALC662_FIXUP_SKU_IGNORE
9156 [ALC662_FIXUP_ASUS_MODE1] = {
9157 .type = HDA_FIXUP_PINS,
9158 .v.pins = (const struct hda_pintbl[]) {
9159 { 0x14, 0x99130110 }, /* speaker */
9160 { 0x18, 0x01a19c20 }, /* mic */
9161 { 0x19, 0x99a3092f }, /* int-mic */
9162 { 0x21, 0x0121401f }, /* HP out */
9166 .chain_id = ALC662_FIXUP_SKU_IGNORE
9168 [ALC662_FIXUP_ASUS_MODE2] = {
9169 .type = HDA_FIXUP_PINS,
9170 .v.pins = (const struct hda_pintbl[]) {
9171 { 0x14, 0x99130110 }, /* speaker */
9172 { 0x18, 0x01a19820 }, /* mic */
9173 { 0x19, 0x99a3092f }, /* int-mic */
9174 { 0x1b, 0x0121401f }, /* HP out */
9178 .chain_id = ALC662_FIXUP_SKU_IGNORE
9180 [ALC662_FIXUP_ASUS_MODE3] = {
9181 .type = HDA_FIXUP_PINS,
9182 .v.pins = (const struct hda_pintbl[]) {
9183 { 0x14, 0x99130110 }, /* speaker */
9184 { 0x15, 0x0121441f }, /* HP */
9185 { 0x18, 0x01a19840 }, /* mic */
9186 { 0x19, 0x99a3094f }, /* int-mic */
9187 { 0x21, 0x01211420 }, /* HP2 */
9191 .chain_id = ALC662_FIXUP_SKU_IGNORE
9193 [ALC662_FIXUP_ASUS_MODE4] = {
9194 .type = HDA_FIXUP_PINS,
9195 .v.pins = (const struct hda_pintbl[]) {
9196 { 0x14, 0x99130110 }, /* speaker */
9197 { 0x16, 0x99130111 }, /* speaker */
9198 { 0x18, 0x01a19840 }, /* mic */
9199 { 0x19, 0x99a3094f }, /* int-mic */
9200 { 0x21, 0x0121441f }, /* HP */
9204 .chain_id = ALC662_FIXUP_SKU_IGNORE
9206 [ALC662_FIXUP_ASUS_MODE5] = {
9207 .type = HDA_FIXUP_PINS,
9208 .v.pins = (const struct hda_pintbl[]) {
9209 { 0x14, 0x99130110 }, /* speaker */
9210 { 0x15, 0x0121441f }, /* HP */
9211 { 0x16, 0x99130111 }, /* speaker */
9212 { 0x18, 0x01a19840 }, /* mic */
9213 { 0x19, 0x99a3094f }, /* int-mic */
9217 .chain_id = ALC662_FIXUP_SKU_IGNORE
9219 [ALC662_FIXUP_ASUS_MODE6] = {
9220 .type = HDA_FIXUP_PINS,
9221 .v.pins = (const struct hda_pintbl[]) {
9222 { 0x14, 0x99130110 }, /* speaker */
9223 { 0x15, 0x01211420 }, /* HP2 */
9224 { 0x18, 0x01a19840 }, /* mic */
9225 { 0x19, 0x99a3094f }, /* int-mic */
9226 { 0x1b, 0x0121441f }, /* HP */
9230 .chain_id = ALC662_FIXUP_SKU_IGNORE
9232 [ALC662_FIXUP_ASUS_MODE7] = {
9233 .type = HDA_FIXUP_PINS,
9234 .v.pins = (const struct hda_pintbl[]) {
9235 { 0x14, 0x99130110 }, /* speaker */
9236 { 0x17, 0x99130111 }, /* speaker */
9237 { 0x18, 0x01a19840 }, /* mic */
9238 { 0x19, 0x99a3094f }, /* int-mic */
9239 { 0x1b, 0x01214020 }, /* HP */
9240 { 0x21, 0x0121401f }, /* HP */
9244 .chain_id = ALC662_FIXUP_SKU_IGNORE
9246 [ALC662_FIXUP_ASUS_MODE8] = {
9247 .type = HDA_FIXUP_PINS,
9248 .v.pins = (const struct hda_pintbl[]) {
9249 { 0x14, 0x99130110 }, /* speaker */
9250 { 0x12, 0x99a30970 }, /* int-mic */
9251 { 0x15, 0x01214020 }, /* HP */
9252 { 0x17, 0x99130111 }, /* speaker */
9253 { 0x18, 0x01a19840 }, /* mic */
9254 { 0x21, 0x0121401f }, /* HP */
9258 .chain_id = ALC662_FIXUP_SKU_IGNORE
9260 [ALC662_FIXUP_NO_JACK_DETECT] = {
9261 .type = HDA_FIXUP_FUNC,
9262 .v.func = alc_fixup_no_jack_detect,
9264 [ALC662_FIXUP_ZOTAC_Z68] = {
9265 .type = HDA_FIXUP_PINS,
9266 .v.pins = (const struct hda_pintbl[]) {
9267 { 0x1b, 0x02214020 }, /* Front HP */
9271 [ALC662_FIXUP_INV_DMIC] = {
9272 .type = HDA_FIXUP_FUNC,
9273 .v.func = alc_fixup_inv_dmic,
9275 [ALC668_FIXUP_DELL_XPS13] = {
9276 .type = HDA_FIXUP_FUNC,
9277 .v.func = alc_fixup_dell_xps13,
9279 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
9281 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
9282 .type = HDA_FIXUP_FUNC,
9283 .v.func = alc_fixup_disable_aamix,
9285 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
9287 [ALC668_FIXUP_AUTO_MUTE] = {
9288 .type = HDA_FIXUP_FUNC,
9289 .v.func = alc_fixup_auto_mute_via_amp,
9291 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
9293 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
9294 .type = HDA_FIXUP_PINS,
9295 .v.pins = (const struct hda_pintbl[]) {
9296 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9297 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
9301 .chain_id = ALC662_FIXUP_HEADSET_MODE
9303 [ALC662_FIXUP_HEADSET_MODE] = {
9304 .type = HDA_FIXUP_FUNC,
9305 .v.func = alc_fixup_headset_mode_alc662,
9307 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
9308 .type = HDA_FIXUP_PINS,
9309 .v.pins = (const struct hda_pintbl[]) {
9310 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9311 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9315 .chain_id = ALC668_FIXUP_HEADSET_MODE
9317 [ALC668_FIXUP_HEADSET_MODE] = {
9318 .type = HDA_FIXUP_FUNC,
9319 .v.func = alc_fixup_headset_mode_alc668,
9321 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
9322 .type = HDA_FIXUP_FUNC,
9323 .v.func = alc_fixup_bass_chmap,
9325 .chain_id = ALC662_FIXUP_ASUS_MODE4
9327 [ALC662_FIXUP_BASS_16] = {
9328 .type = HDA_FIXUP_PINS,
9329 .v.pins = (const struct hda_pintbl[]) {
9330 {0x16, 0x80106111}, /* bass speaker */
9334 .chain_id = ALC662_FIXUP_BASS_CHMAP,
9336 [ALC662_FIXUP_BASS_1A] = {
9337 .type = HDA_FIXUP_PINS,
9338 .v.pins = (const struct hda_pintbl[]) {
9339 {0x1a, 0x80106111}, /* bass speaker */
9343 .chain_id = ALC662_FIXUP_BASS_CHMAP,
9345 [ALC662_FIXUP_BASS_CHMAP] = {
9346 .type = HDA_FIXUP_FUNC,
9347 .v.func = alc_fixup_bass_chmap,
9349 [ALC662_FIXUP_ASUS_Nx50] = {
9350 .type = HDA_FIXUP_FUNC,
9351 .v.func = alc_fixup_auto_mute_via_amp,
9353 .chain_id = ALC662_FIXUP_BASS_1A
9355 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
9356 .type = HDA_FIXUP_FUNC,
9357 .v.func = alc_fixup_headset_mode_alc668,
9358 .chain_id = ALC662_FIXUP_BASS_CHMAP
9360 [ALC668_FIXUP_ASUS_Nx51] = {
9361 .type = HDA_FIXUP_PINS,
9362 .v.pins = (const struct hda_pintbl[]) {
9363 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9364 { 0x1a, 0x90170151 }, /* bass speaker */
9365 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9369 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
9371 [ALC668_FIXUP_MIC_COEF] = {
9372 .type = HDA_FIXUP_VERBS,
9373 .v.verbs = (const struct hda_verb[]) {
9374 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
9375 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
9379 [ALC668_FIXUP_ASUS_G751] = {
9380 .type = HDA_FIXUP_PINS,
9381 .v.pins = (const struct hda_pintbl[]) {
9382 { 0x16, 0x0421101f }, /* HP */
9386 .chain_id = ALC668_FIXUP_MIC_COEF
9388 [ALC891_FIXUP_HEADSET_MODE] = {
9389 .type = HDA_FIXUP_FUNC,
9390 .v.func = alc_fixup_headset_mode,
9392 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
9393 .type = HDA_FIXUP_PINS,
9394 .v.pins = (const struct hda_pintbl[]) {
9395 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9396 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9400 .chain_id = ALC891_FIXUP_HEADSET_MODE
9402 [ALC662_FIXUP_ACER_VERITON] = {
9403 .type = HDA_FIXUP_PINS,
9404 .v.pins = (const struct hda_pintbl[]) {
9405 { 0x15, 0x50170120 }, /* no internal speaker */
9409 [ALC892_FIXUP_ASROCK_MOBO] = {
9410 .type = HDA_FIXUP_PINS,
9411 .v.pins = (const struct hda_pintbl[]) {
9412 { 0x15, 0x40f000f0 }, /* disabled */
9413 { 0x16, 0x40f000f0 }, /* disabled */
9417 [ALC662_FIXUP_USI_FUNC] = {
9418 .type = HDA_FIXUP_FUNC,
9419 .v.func = alc662_fixup_usi_headset_mic,
9421 [ALC662_FIXUP_USI_HEADSET_MODE] = {
9422 .type = HDA_FIXUP_PINS,
9423 .v.pins = (const struct hda_pintbl[]) {
9424 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
9425 { 0x18, 0x01a1903d },
9429 .chain_id = ALC662_FIXUP_USI_FUNC
9431 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
9432 .type = HDA_FIXUP_FUNC,
9433 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
9435 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET] = {
9436 .type = HDA_FIXUP_FUNC,
9437 .v.func = alc662_fixup_aspire_ethos_hp,
9439 [ALC669_FIXUP_ACER_ASPIRE_ETHOS] = {
9440 .type = HDA_FIXUP_PINS,
9441 .v.pins = (const struct hda_pintbl[]) {
9442 { 0x15, 0x92130110 }, /* front speakers */
9443 { 0x18, 0x99130111 }, /* center/subwoofer */
9444 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
9448 .chain_id = ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
9450 [ALC671_FIXUP_HP_HEADSET_MIC2] = {
9451 .type = HDA_FIXUP_FUNC,
9452 .v.func = alc671_fixup_hp_headset_mic2,
9454 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE] = {
9455 .type = HDA_FIXUP_PINS,
9456 .v.pins = (const struct hda_pintbl[]) {
9457 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9461 .chain_id = ALC662_FIXUP_USI_FUNC
9463 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE] = {
9464 .type = HDA_FIXUP_PINS,
9465 .v.pins = (const struct hda_pintbl[]) {
9466 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
9467 { 0x1b, 0x0221144f },
9471 .chain_id = ALC662_FIXUP_USI_FUNC
9475 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
9476 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
9477 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
9478 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
9479 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
9480 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
9481 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
9482 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
9483 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
9484 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE),
9485 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE),
9486 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9487 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9488 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
9489 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
9490 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
9491 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9492 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9493 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9494 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9495 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
9496 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
9497 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
9498 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
9499 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
9500 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
9501 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
9502 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9503 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
9504 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
9505 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
9506 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
9507 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
9508 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
9509 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
9510 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
9511 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
9512 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
9513 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
9514 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
9515 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
9516 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
9517 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
9518 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
9519 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26),
9520 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
9521 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS),
9524 /* Below is a quirk table taken from the old code.
9525 * Basically the device should work as is without the fixup table.
9526 * If BIOS doesn't give a proper info, enable the corresponding
9529 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
9530 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
9531 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
9532 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
9533 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9534 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9535 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9536 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
9537 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
9538 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9539 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
9540 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
9541 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
9542 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
9543 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
9544 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9545 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
9546 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
9547 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9548 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9549 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9550 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9551 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
9552 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
9553 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
9554 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9555 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
9556 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
9557 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9558 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
9559 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9560 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9561 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
9562 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
9563 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
9564 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
9565 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
9566 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
9567 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
9568 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
9569 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
9570 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
9571 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9572 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
9573 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
9574 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
9575 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
9576 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
9577 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
9578 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
9583 static const struct hda_model_fixup alc662_fixup_models[] = {
9584 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
9585 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
9586 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
9587 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
9588 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
9589 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
9590 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
9591 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
9592 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
9593 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
9594 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
9595 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
9596 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
9597 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
9598 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
9599 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
9600 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
9601 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
9602 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
9603 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
9604 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
9605 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
9606 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
9607 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
9608 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
9609 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
9610 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
9611 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
9612 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
9613 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
9614 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
9615 {.id = ALC669_FIXUP_ACER_ASPIRE_ETHOS, .name = "aspire-ethos"},
9619 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
9620 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9624 {0x21, 0x01014020}),
9625 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
9629 {0x21, 0x01014020}),
9630 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
9634 {0x1b, 0x0221401f}),
9635 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9639 {0x16, 0x03011020}),
9640 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9644 {0x16, 0x03011020}),
9645 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9649 {0x16, 0x03011020}),
9650 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
9653 {0x16, 0x03011020}),
9654 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
9657 {0x15, 0x0321101f}),
9658 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9663 {0x21, 0x02211020}),
9664 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9668 {0x21, 0x02211020}),
9669 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2,
9674 {0x21, 0x02211030}),
9680 static int patch_alc662(struct hda_codec *codec)
9682 struct alc_spec *spec;
9685 err = alc_alloc_spec(codec, 0x0b);
9691 spec->shutup = alc_eapd_shutup;
9693 /* handle multiple HPs as is */
9694 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
9696 alc_fix_pll_init(codec, 0x20, 0x04, 15);
9698 switch (codec->core.vendor_id) {
9700 spec->init_hook = alc668_restore_default_value;
9704 alc_pre_init(codec);
9706 snd_hda_pick_fixup(codec, alc662_fixup_models,
9707 alc662_fixup_tbl, alc662_fixups);
9708 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups, true);
9709 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
9711 alc_auto_parse_customize_define(codec);
9713 if (has_cdefine_beep(codec))
9714 spec->gen.beep_nid = 0x01;
9716 if ((alc_get_coef0(codec) & (1 << 14)) &&
9717 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
9718 spec->cdefine.platform_type == 1) {
9719 err = alc_codec_rename(codec, "ALC272X");
9724 /* automatic parse from the BIOS config */
9725 err = alc662_parse_auto_config(codec);
9729 if (!spec->gen.no_analog && spec->gen.beep_nid) {
9730 switch (codec->core.vendor_id) {
9732 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
9738 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
9741 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
9748 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
9761 static int alc680_parse_auto_config(struct hda_codec *codec)
9763 return alc_parse_auto_config(codec, NULL, NULL);
9768 static int patch_alc680(struct hda_codec *codec)
9772 /* ALC680 has no aa-loopback mixer */
9773 err = alc_alloc_spec(codec, 0);
9777 /* automatic parse from the BIOS config */
9778 err = alc680_parse_auto_config(codec);
9790 static const struct hda_device_id snd_hda_id_realtek[] = {
9791 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
9792 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
9793 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269),
9794 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
9795 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
9796 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
9797 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
9798 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
9799 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
9800 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269),
9801 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
9802 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
9803 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
9804 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
9805 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
9806 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
9807 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
9808 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
9809 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
9810 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
9811 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
9812 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
9813 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
9814 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
9815 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
9816 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
9817 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
9818 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
9819 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
9820 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
9821 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
9822 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
9823 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
9824 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
9825 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
9826 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
9827 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
9828 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
9829 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
9830 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
9831 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269),
9832 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
9833 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
9834 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
9835 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
9836 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
9837 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
9838 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
9839 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
9840 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
9841 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
9842 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
9843 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
9844 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
9845 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
9846 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
9847 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
9848 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
9849 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269),
9850 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
9851 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
9852 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
9853 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
9854 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
9855 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
9856 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
9857 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
9858 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
9859 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
9860 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
9861 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
9862 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
9863 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
9864 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
9865 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
9866 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
9869 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
9871 MODULE_LICENSE("GPL");
9872 MODULE_DESCRIPTION("Realtek HD-audio codec");
9874 static struct hda_codec_driver realtek_driver = {
9875 .id = snd_hda_id_realtek,
9878 module_hda_codec_driver(realtek_driver);