2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for Realtek ALC codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@just42.net>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <linux/dmi.h>
31 #include <linux/module.h>
32 #include <linux/input.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include <sound/hda_codec.h>
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
39 #include "hda_generic.h"
41 /* keep halting ALC5505 DSP, for power saving */
42 #define HALT_REALTEK_ALC5505
44 /* extra amp-initialization sequence types */
52 ALC_HEADSET_MODE_UNKNOWN,
53 ALC_HEADSET_MODE_UNPLUGGED,
54 ALC_HEADSET_MODE_HEADSET,
56 ALC_HEADSET_MODE_HEADPHONE,
60 ALC_HEADSET_TYPE_UNKNOWN,
61 ALC_HEADSET_TYPE_CTIA,
62 ALC_HEADSET_TYPE_OMTP,
66 ALC_KEY_MICMUTE_INDEX,
69 struct alc_customize_define {
71 unsigned char port_connectivity;
72 unsigned char check_sum;
73 unsigned char customization;
74 unsigned char external_amp;
75 unsigned int enable_pcbeep:1;
76 unsigned int platform_type:1;
78 unsigned int override:1;
79 unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
83 struct hda_gen_spec gen; /* must be at head */
85 /* codec parameterization */
86 struct alc_customize_define cdefine;
87 unsigned int parse_flags; /* flag for snd_hda_parse_pin_defcfg() */
90 unsigned int gpio_mask;
91 unsigned int gpio_dir;
92 unsigned int gpio_data;
93 bool gpio_write_delay; /* add a delay before writing gpio_data */
95 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
96 int mute_led_polarity;
97 hda_nid_t mute_led_nid;
98 hda_nid_t cap_mute_led_nid;
100 unsigned int gpio_mute_led_mask;
101 unsigned int gpio_mic_led_mask;
103 hda_nid_t headset_mic_pin;
104 hda_nid_t headphone_mic_pin;
105 int current_headset_mode;
106 int current_headset_type;
109 void (*init_hook)(struct hda_codec *codec);
111 void (*power_hook)(struct hda_codec *codec);
113 void (*shutup)(struct hda_codec *codec);
114 void (*reboot_notify)(struct hda_codec *codec);
117 int codec_variant; /* flag for other variants */
118 unsigned int has_alc5505_dsp:1;
119 unsigned int no_depop_delay:1;
120 unsigned int done_hp_init: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);
393 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
396 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
399 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
407 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
410 if ((coef & 0x00f0) == 0x0030)
411 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
420 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
423 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
426 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
429 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
430 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
433 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
439 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
444 /* additional initialization for ALC888 variants */
445 static void alc888_coef_init(struct hda_codec *codec)
447 switch (alc_get_coef0(codec) & 0x00f0) {
452 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
457 /* turn on/off EAPD control (only if available) */
458 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
460 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
462 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
463 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
467 /* turn on/off EAPD controls of the codec */
468 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
470 /* We currently only handle front, HP */
471 static hda_nid_t pins[] = {
472 0x0f, 0x10, 0x14, 0x15, 0x17, 0
475 for (p = pins; *p; p++)
476 set_eapd(codec, *p, on);
479 /* generic shutup callback;
480 * just turning off EAPD and a little pause for avoiding pop-noise
482 static void alc_eapd_shutup(struct hda_codec *codec)
484 struct alc_spec *spec = codec->spec;
486 alc_auto_setup_eapd(codec, false);
487 if (!spec->no_depop_delay)
489 snd_hda_shutup_pins(codec);
492 /* generic EAPD initialization */
493 static void alc_auto_init_amp(struct hda_codec *codec, int type)
495 alc_fill_eapd_coef(codec);
496 alc_auto_setup_eapd(codec, true);
497 alc_write_gpio(codec);
499 case ALC_INIT_DEFAULT:
500 switch (codec->core.vendor_id) {
502 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
508 alc_update_coef_idx(codec, 7, 0, 0x2030);
511 alc888_coef_init(codec);
518 /* get a primary headphone pin if available */
519 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
521 if (spec->gen.autocfg.hp_pins[0])
522 return spec->gen.autocfg.hp_pins[0];
523 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
524 return spec->gen.autocfg.line_out_pins[0];
529 * Realtek SSID verification
532 /* Could be any non-zero and even value. When used as fixup, tells
533 * the driver to ignore any present sku defines.
535 #define ALC_FIXUP_SKU_IGNORE (2)
537 static void alc_fixup_sku_ignore(struct hda_codec *codec,
538 const struct hda_fixup *fix, int action)
540 struct alc_spec *spec = codec->spec;
541 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
542 spec->cdefine.fixup = 1;
543 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
547 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
548 const struct hda_fixup *fix, int action)
550 struct alc_spec *spec = codec->spec;
552 if (action == HDA_FIXUP_ACT_PROBE) {
553 spec->no_depop_delay = 1;
554 codec->depop_delay = 0;
558 static int alc_auto_parse_customize_define(struct hda_codec *codec)
560 unsigned int ass, tmp, i;
562 struct alc_spec *spec = codec->spec;
564 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
566 if (spec->cdefine.fixup) {
567 ass = spec->cdefine.sku_cfg;
568 if (ass == ALC_FIXUP_SKU_IGNORE)
573 if (!codec->bus->pci)
575 ass = codec->core.subsystem_id & 0xffff;
576 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
580 if (codec->core.vendor_id == 0x10ec0260)
582 ass = snd_hda_codec_get_pincfg(codec, nid);
585 codec_info(codec, "%s: SKU not ready 0x%08x\n",
586 codec->core.chip_name, ass);
592 for (i = 1; i < 16; i++) {
596 if (((ass >> 16) & 0xf) != tmp)
599 spec->cdefine.port_connectivity = ass >> 30;
600 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
601 spec->cdefine.check_sum = (ass >> 16) & 0xf;
602 spec->cdefine.customization = ass >> 8;
604 spec->cdefine.sku_cfg = ass;
605 spec->cdefine.external_amp = (ass & 0x38) >> 3;
606 spec->cdefine.platform_type = (ass & 0x4) >> 2;
607 spec->cdefine.swap = (ass & 0x2) >> 1;
608 spec->cdefine.override = ass & 0x1;
610 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
611 nid, spec->cdefine.sku_cfg);
612 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
613 spec->cdefine.port_connectivity);
614 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
615 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
616 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
617 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
618 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
619 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
620 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
625 /* return the position of NID in the list, or -1 if not found */
626 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
629 for (i = 0; i < nums; i++)
634 /* return true if the given NID is found in the list */
635 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
637 return find_idx_in_nid_list(nid, list, nums) >= 0;
640 /* check subsystem ID and set up device-specific initialization;
641 * return 1 if initialized, 0 if invalid SSID
643 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
644 * 31 ~ 16 : Manufacture ID
646 * 7 ~ 0 : Assembly ID
647 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
649 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
651 unsigned int ass, tmp, i;
653 struct alc_spec *spec = codec->spec;
655 if (spec->cdefine.fixup) {
656 ass = spec->cdefine.sku_cfg;
657 if (ass == ALC_FIXUP_SKU_IGNORE)
662 ass = codec->core.subsystem_id & 0xffff;
663 if (codec->bus->pci &&
664 ass != codec->bus->pci->subsystem_device && (ass & 1))
667 /* invalid SSID, check the special NID pin defcfg instead */
669 * 31~30 : port connectivity
672 * 19~16 : Check sum (15:1)
677 if (codec->core.vendor_id == 0x10ec0260)
679 ass = snd_hda_codec_get_pincfg(codec, nid);
681 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
685 if ((ass >> 30) != 1) /* no physical connection */
690 for (i = 1; i < 16; i++) {
694 if (((ass >> 16) & 0xf) != tmp)
697 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
698 ass & 0xffff, codec->core.vendor_id);
702 * 2 : 0 --> Desktop, 1 --> Laptop
703 * 3~5 : External Amplifier control
706 tmp = (ass & 0x38) >> 3; /* external Amp control */
707 if (spec->init_amp == ALC_INIT_UNDEFINED) {
710 alc_setup_gpio(codec, 0x01);
713 alc_setup_gpio(codec, 0x02);
716 alc_setup_gpio(codec, 0x03);
720 spec->init_amp = ALC_INIT_DEFAULT;
725 /* is laptop or Desktop and enable the function "Mute internal speaker
726 * when the external headphone out jack is plugged"
731 * 10~8 : Jack location
732 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
734 * 15 : 1 --> enable the function "Mute internal speaker
735 * when the external headphone out jack is plugged"
737 if (!alc_get_hp_pin(spec)) {
739 tmp = (ass >> 11) & 0x3; /* HP to chassis */
741 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
742 spec->gen.autocfg.line_outs))
744 spec->gen.autocfg.hp_pins[0] = nid;
749 /* Check the validity of ALC subsystem-id
750 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
751 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
753 if (!alc_subsystem_id(codec, ports)) {
754 struct alc_spec *spec = codec->spec;
756 "realtek: Enable default setup for auto mode as fallback\n");
757 spec->init_amp = ALC_INIT_DEFAULT;
764 static void alc_fixup_inv_dmic(struct hda_codec *codec,
765 const struct hda_fixup *fix, int action)
767 struct alc_spec *spec = codec->spec;
769 spec->gen.inv_dmic_split = 1;
773 static int alc_build_controls(struct hda_codec *codec)
777 err = snd_hda_gen_build_controls(codec);
781 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
790 static int alc_init(struct hda_codec *codec)
792 struct alc_spec *spec = codec->spec;
795 spec->init_hook(codec);
798 alc_auto_init_amp(codec, spec->init_amp);
800 snd_hda_gen_init(codec);
802 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
807 static inline void alc_shutup(struct hda_codec *codec)
809 struct alc_spec *spec = codec->spec;
811 if (!snd_hda_get_bool_hint(codec, "shutup"))
812 return; /* disabled explicitly by hints */
814 if (spec && spec->shutup)
817 snd_hda_shutup_pins(codec);
820 static void alc_reboot_notify(struct hda_codec *codec)
822 struct alc_spec *spec = codec->spec;
824 if (spec && spec->reboot_notify)
825 spec->reboot_notify(codec);
830 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
831 static void alc_d3_at_reboot(struct hda_codec *codec)
833 snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
834 snd_hda_codec_write(codec, codec->core.afg, 0,
835 AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
839 #define alc_free snd_hda_gen_free
842 static void alc_power_eapd(struct hda_codec *codec)
844 alc_auto_setup_eapd(codec, false);
847 static int alc_suspend(struct hda_codec *codec)
849 struct alc_spec *spec = codec->spec;
851 if (spec && spec->power_hook)
852 spec->power_hook(codec);
858 static int alc_resume(struct hda_codec *codec)
860 struct alc_spec *spec = codec->spec;
862 if (!spec->no_depop_delay)
863 msleep(150); /* to avoid pop noise */
864 codec->patch_ops.init(codec);
865 regcache_sync(codec->core.regmap);
866 hda_call_check_power_status(codec, 0x01);
873 static const struct hda_codec_ops alc_patch_ops = {
874 .build_controls = alc_build_controls,
875 .build_pcms = snd_hda_gen_build_pcms,
878 .unsol_event = snd_hda_jack_unsol_event,
880 .resume = alc_resume,
881 .suspend = alc_suspend,
882 .check_power_status = snd_hda_gen_check_power_status,
884 .reboot_notify = alc_reboot_notify,
888 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
891 * Rename codecs appropriately from COEF value or subvendor id
893 struct alc_codec_rename_table {
894 unsigned int vendor_id;
895 unsigned short coef_mask;
896 unsigned short coef_bits;
900 struct alc_codec_rename_pci_table {
901 unsigned int codec_vendor_id;
902 unsigned short pci_subvendor;
903 unsigned short pci_subdevice;
907 static struct alc_codec_rename_table rename_tbl[] = {
908 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
909 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
910 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
911 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
912 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
913 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
914 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
915 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
916 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
917 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
918 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
919 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
920 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
921 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
922 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
923 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
924 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
928 static struct alc_codec_rename_pci_table rename_pci_tbl[] = {
929 { 0x10ec0280, 0x1028, 0, "ALC3220" },
930 { 0x10ec0282, 0x1028, 0, "ALC3221" },
931 { 0x10ec0283, 0x1028, 0, "ALC3223" },
932 { 0x10ec0288, 0x1028, 0, "ALC3263" },
933 { 0x10ec0292, 0x1028, 0, "ALC3226" },
934 { 0x10ec0293, 0x1028, 0, "ALC3235" },
935 { 0x10ec0255, 0x1028, 0, "ALC3234" },
936 { 0x10ec0668, 0x1028, 0, "ALC3661" },
937 { 0x10ec0275, 0x1028, 0, "ALC3260" },
938 { 0x10ec0899, 0x1028, 0, "ALC3861" },
939 { 0x10ec0298, 0x1028, 0, "ALC3266" },
940 { 0x10ec0236, 0x1028, 0, "ALC3204" },
941 { 0x10ec0256, 0x1028, 0, "ALC3246" },
942 { 0x10ec0225, 0x1028, 0, "ALC3253" },
943 { 0x10ec0295, 0x1028, 0, "ALC3254" },
944 { 0x10ec0299, 0x1028, 0, "ALC3271" },
945 { 0x10ec0670, 0x1025, 0, "ALC669X" },
946 { 0x10ec0676, 0x1025, 0, "ALC679X" },
947 { 0x10ec0282, 0x1043, 0, "ALC3229" },
948 { 0x10ec0233, 0x1043, 0, "ALC3236" },
949 { 0x10ec0280, 0x103c, 0, "ALC3228" },
950 { 0x10ec0282, 0x103c, 0, "ALC3227" },
951 { 0x10ec0286, 0x103c, 0, "ALC3242" },
952 { 0x10ec0290, 0x103c, 0, "ALC3241" },
953 { 0x10ec0668, 0x103c, 0, "ALC3662" },
954 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
955 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
959 static int alc_codec_rename_from_preset(struct hda_codec *codec)
961 const struct alc_codec_rename_table *p;
962 const struct alc_codec_rename_pci_table *q;
964 for (p = rename_tbl; p->vendor_id; p++) {
965 if (p->vendor_id != codec->core.vendor_id)
967 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
968 return alc_codec_rename(codec, p->name);
971 if (!codec->bus->pci)
973 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
974 if (q->codec_vendor_id != codec->core.vendor_id)
976 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
978 if (!q->pci_subdevice ||
979 q->pci_subdevice == codec->bus->pci->subsystem_device)
980 return alc_codec_rename(codec, q->name);
988 * Digital-beep handlers
990 #ifdef CONFIG_SND_HDA_INPUT_BEEP
992 /* additional beep mixers; private_value will be overwritten */
993 static const struct snd_kcontrol_new alc_beep_mixer[] = {
994 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
995 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
998 /* set up and create beep controls */
999 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1002 struct snd_kcontrol_new *knew;
1003 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1006 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1007 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1008 &alc_beep_mixer[i]);
1011 knew->private_value = beep_amp;
1016 static const struct snd_pci_quirk beep_white_list[] = {
1017 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1018 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1019 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1020 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1021 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1022 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1023 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1024 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1025 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1029 static inline int has_cdefine_beep(struct hda_codec *codec)
1031 struct alc_spec *spec = codec->spec;
1032 const struct snd_pci_quirk *q;
1033 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
1036 return spec->cdefine.enable_pcbeep;
1039 #define set_beep_amp(spec, nid, idx, dir) 0
1040 #define has_cdefine_beep(codec) 0
1043 /* parse the BIOS configuration and set up the alc_spec */
1044 /* return 1 if successful, 0 if the proper config is not found,
1045 * or a negative error code
1047 static int alc_parse_auto_config(struct hda_codec *codec,
1048 const hda_nid_t *ignore_nids,
1049 const hda_nid_t *ssid_nids)
1051 struct alc_spec *spec = codec->spec;
1052 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1055 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1061 alc_ssid_check(codec, ssid_nids);
1063 err = snd_hda_gen_parse_auto_config(codec, cfg);
1070 /* common preparation job for alc_spec */
1071 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1073 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1079 snd_hda_gen_spec_init(&spec->gen);
1080 spec->gen.mixer_nid = mixer_nid;
1081 spec->gen.own_eapd_ctl = 1;
1082 codec->single_adc_amp = 1;
1083 /* FIXME: do we need this for all Realtek codec models? */
1084 codec->spdif_status_reset = 1;
1085 codec->patch_ops = alc_patch_ops;
1087 err = alc_codec_rename_from_preset(codec);
1095 static int alc880_parse_auto_config(struct hda_codec *codec)
1097 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1098 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1099 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1108 ALC880_FIXUP_MEDION_RIM,
1110 ALC880_FIXUP_LG_LW25,
1112 ALC880_FIXUP_EAPD_COEF,
1113 ALC880_FIXUP_TCL_S700,
1114 ALC880_FIXUP_VOL_KNOB,
1115 ALC880_FIXUP_FUJITSU,
1117 ALC880_FIXUP_UNIWILL,
1118 ALC880_FIXUP_UNIWILL_DIG,
1120 ALC880_FIXUP_ASUS_W5A,
1121 ALC880_FIXUP_3ST_BASE,
1123 ALC880_FIXUP_3ST_DIG,
1124 ALC880_FIXUP_5ST_BASE,
1126 ALC880_FIXUP_5ST_DIG,
1127 ALC880_FIXUP_6ST_BASE,
1129 ALC880_FIXUP_6ST_DIG,
1130 ALC880_FIXUP_6ST_AUTOMUTE,
1133 /* enable the volume-knob widget support on NID 0x21 */
1134 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1135 const struct hda_fixup *fix, int action)
1137 if (action == HDA_FIXUP_ACT_PROBE)
1138 snd_hda_jack_detect_enable_callback(codec, 0x21,
1139 alc_update_knob_master);
1142 static const struct hda_fixup alc880_fixups[] = {
1143 [ALC880_FIXUP_GPIO1] = {
1144 .type = HDA_FIXUP_FUNC,
1145 .v.func = alc_fixup_gpio1,
1147 [ALC880_FIXUP_GPIO2] = {
1148 .type = HDA_FIXUP_FUNC,
1149 .v.func = alc_fixup_gpio2,
1151 [ALC880_FIXUP_MEDION_RIM] = {
1152 .type = HDA_FIXUP_VERBS,
1153 .v.verbs = (const struct hda_verb[]) {
1154 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1155 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1159 .chain_id = ALC880_FIXUP_GPIO2,
1161 [ALC880_FIXUP_LG] = {
1162 .type = HDA_FIXUP_PINS,
1163 .v.pins = (const struct hda_pintbl[]) {
1164 /* disable bogus unused pins */
1165 { 0x16, 0x411111f0 },
1166 { 0x18, 0x411111f0 },
1167 { 0x1a, 0x411111f0 },
1171 [ALC880_FIXUP_LG_LW25] = {
1172 .type = HDA_FIXUP_PINS,
1173 .v.pins = (const struct hda_pintbl[]) {
1174 { 0x1a, 0x0181344f }, /* line-in */
1175 { 0x1b, 0x0321403f }, /* headphone */
1179 [ALC880_FIXUP_W810] = {
1180 .type = HDA_FIXUP_PINS,
1181 .v.pins = (const struct hda_pintbl[]) {
1182 /* disable bogus unused pins */
1183 { 0x17, 0x411111f0 },
1187 .chain_id = ALC880_FIXUP_GPIO2,
1189 [ALC880_FIXUP_EAPD_COEF] = {
1190 .type = HDA_FIXUP_VERBS,
1191 .v.verbs = (const struct hda_verb[]) {
1192 /* change to EAPD mode */
1193 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1194 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1198 [ALC880_FIXUP_TCL_S700] = {
1199 .type = HDA_FIXUP_VERBS,
1200 .v.verbs = (const struct hda_verb[]) {
1201 /* change to EAPD mode */
1202 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1203 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1207 .chain_id = ALC880_FIXUP_GPIO2,
1209 [ALC880_FIXUP_VOL_KNOB] = {
1210 .type = HDA_FIXUP_FUNC,
1211 .v.func = alc880_fixup_vol_knob,
1213 [ALC880_FIXUP_FUJITSU] = {
1214 /* override all pins as BIOS on old Amilo is broken */
1215 .type = HDA_FIXUP_PINS,
1216 .v.pins = (const struct hda_pintbl[]) {
1217 { 0x14, 0x0121401f }, /* HP */
1218 { 0x15, 0x99030120 }, /* speaker */
1219 { 0x16, 0x99030130 }, /* bass speaker */
1220 { 0x17, 0x411111f0 }, /* N/A */
1221 { 0x18, 0x411111f0 }, /* N/A */
1222 { 0x19, 0x01a19950 }, /* mic-in */
1223 { 0x1a, 0x411111f0 }, /* N/A */
1224 { 0x1b, 0x411111f0 }, /* N/A */
1225 { 0x1c, 0x411111f0 }, /* N/A */
1226 { 0x1d, 0x411111f0 }, /* N/A */
1227 { 0x1e, 0x01454140 }, /* SPDIF out */
1231 .chain_id = ALC880_FIXUP_VOL_KNOB,
1233 [ALC880_FIXUP_F1734] = {
1234 /* almost compatible with FUJITSU, but no bass and SPDIF */
1235 .type = HDA_FIXUP_PINS,
1236 .v.pins = (const struct hda_pintbl[]) {
1237 { 0x14, 0x0121401f }, /* HP */
1238 { 0x15, 0x99030120 }, /* speaker */
1239 { 0x16, 0x411111f0 }, /* N/A */
1240 { 0x17, 0x411111f0 }, /* N/A */
1241 { 0x18, 0x411111f0 }, /* N/A */
1242 { 0x19, 0x01a19950 }, /* mic-in */
1243 { 0x1a, 0x411111f0 }, /* N/A */
1244 { 0x1b, 0x411111f0 }, /* N/A */
1245 { 0x1c, 0x411111f0 }, /* N/A */
1246 { 0x1d, 0x411111f0 }, /* N/A */
1247 { 0x1e, 0x411111f0 }, /* N/A */
1251 .chain_id = ALC880_FIXUP_VOL_KNOB,
1253 [ALC880_FIXUP_UNIWILL] = {
1254 /* need to fix HP and speaker pins to be parsed correctly */
1255 .type = HDA_FIXUP_PINS,
1256 .v.pins = (const struct hda_pintbl[]) {
1257 { 0x14, 0x0121411f }, /* HP */
1258 { 0x15, 0x99030120 }, /* speaker */
1259 { 0x16, 0x99030130 }, /* bass speaker */
1263 [ALC880_FIXUP_UNIWILL_DIG] = {
1264 .type = HDA_FIXUP_PINS,
1265 .v.pins = (const struct hda_pintbl[]) {
1266 /* disable bogus unused pins */
1267 { 0x17, 0x411111f0 },
1268 { 0x19, 0x411111f0 },
1269 { 0x1b, 0x411111f0 },
1270 { 0x1f, 0x411111f0 },
1274 [ALC880_FIXUP_Z71V] = {
1275 .type = HDA_FIXUP_PINS,
1276 .v.pins = (const struct hda_pintbl[]) {
1277 /* set up the whole pins as BIOS is utterly broken */
1278 { 0x14, 0x99030120 }, /* speaker */
1279 { 0x15, 0x0121411f }, /* HP */
1280 { 0x16, 0x411111f0 }, /* N/A */
1281 { 0x17, 0x411111f0 }, /* N/A */
1282 { 0x18, 0x01a19950 }, /* mic-in */
1283 { 0x19, 0x411111f0 }, /* N/A */
1284 { 0x1a, 0x01813031 }, /* line-in */
1285 { 0x1b, 0x411111f0 }, /* N/A */
1286 { 0x1c, 0x411111f0 }, /* N/A */
1287 { 0x1d, 0x411111f0 }, /* N/A */
1288 { 0x1e, 0x0144111e }, /* SPDIF */
1292 [ALC880_FIXUP_ASUS_W5A] = {
1293 .type = HDA_FIXUP_PINS,
1294 .v.pins = (const struct hda_pintbl[]) {
1295 /* set up the whole pins as BIOS is utterly broken */
1296 { 0x14, 0x0121411f }, /* HP */
1297 { 0x15, 0x411111f0 }, /* N/A */
1298 { 0x16, 0x411111f0 }, /* N/A */
1299 { 0x17, 0x411111f0 }, /* N/A */
1300 { 0x18, 0x90a60160 }, /* mic */
1301 { 0x19, 0x411111f0 }, /* N/A */
1302 { 0x1a, 0x411111f0 }, /* N/A */
1303 { 0x1b, 0x411111f0 }, /* N/A */
1304 { 0x1c, 0x411111f0 }, /* N/A */
1305 { 0x1d, 0x411111f0 }, /* N/A */
1306 { 0x1e, 0xb743111e }, /* SPDIF out */
1310 .chain_id = ALC880_FIXUP_GPIO1,
1312 [ALC880_FIXUP_3ST_BASE] = {
1313 .type = HDA_FIXUP_PINS,
1314 .v.pins = (const struct hda_pintbl[]) {
1315 { 0x14, 0x01014010 }, /* line-out */
1316 { 0x15, 0x411111f0 }, /* N/A */
1317 { 0x16, 0x411111f0 }, /* N/A */
1318 { 0x17, 0x411111f0 }, /* N/A */
1319 { 0x18, 0x01a19c30 }, /* mic-in */
1320 { 0x19, 0x0121411f }, /* HP */
1321 { 0x1a, 0x01813031 }, /* line-in */
1322 { 0x1b, 0x02a19c40 }, /* front-mic */
1323 { 0x1c, 0x411111f0 }, /* N/A */
1324 { 0x1d, 0x411111f0 }, /* N/A */
1325 /* 0x1e is filled in below */
1326 { 0x1f, 0x411111f0 }, /* N/A */
1330 [ALC880_FIXUP_3ST] = {
1331 .type = HDA_FIXUP_PINS,
1332 .v.pins = (const struct hda_pintbl[]) {
1333 { 0x1e, 0x411111f0 }, /* N/A */
1337 .chain_id = ALC880_FIXUP_3ST_BASE,
1339 [ALC880_FIXUP_3ST_DIG] = {
1340 .type = HDA_FIXUP_PINS,
1341 .v.pins = (const struct hda_pintbl[]) {
1342 { 0x1e, 0x0144111e }, /* SPDIF */
1346 .chain_id = ALC880_FIXUP_3ST_BASE,
1348 [ALC880_FIXUP_5ST_BASE] = {
1349 .type = HDA_FIXUP_PINS,
1350 .v.pins = (const struct hda_pintbl[]) {
1351 { 0x14, 0x01014010 }, /* front */
1352 { 0x15, 0x411111f0 }, /* N/A */
1353 { 0x16, 0x01011411 }, /* CLFE */
1354 { 0x17, 0x01016412 }, /* surr */
1355 { 0x18, 0x01a19c30 }, /* mic-in */
1356 { 0x19, 0x0121411f }, /* HP */
1357 { 0x1a, 0x01813031 }, /* line-in */
1358 { 0x1b, 0x02a19c40 }, /* front-mic */
1359 { 0x1c, 0x411111f0 }, /* N/A */
1360 { 0x1d, 0x411111f0 }, /* N/A */
1361 /* 0x1e is filled in below */
1362 { 0x1f, 0x411111f0 }, /* N/A */
1366 [ALC880_FIXUP_5ST] = {
1367 .type = HDA_FIXUP_PINS,
1368 .v.pins = (const struct hda_pintbl[]) {
1369 { 0x1e, 0x411111f0 }, /* N/A */
1373 .chain_id = ALC880_FIXUP_5ST_BASE,
1375 [ALC880_FIXUP_5ST_DIG] = {
1376 .type = HDA_FIXUP_PINS,
1377 .v.pins = (const struct hda_pintbl[]) {
1378 { 0x1e, 0x0144111e }, /* SPDIF */
1382 .chain_id = ALC880_FIXUP_5ST_BASE,
1384 [ALC880_FIXUP_6ST_BASE] = {
1385 .type = HDA_FIXUP_PINS,
1386 .v.pins = (const struct hda_pintbl[]) {
1387 { 0x14, 0x01014010 }, /* front */
1388 { 0x15, 0x01016412 }, /* surr */
1389 { 0x16, 0x01011411 }, /* CLFE */
1390 { 0x17, 0x01012414 }, /* side */
1391 { 0x18, 0x01a19c30 }, /* mic-in */
1392 { 0x19, 0x02a19c40 }, /* front-mic */
1393 { 0x1a, 0x01813031 }, /* line-in */
1394 { 0x1b, 0x0121411f }, /* HP */
1395 { 0x1c, 0x411111f0 }, /* N/A */
1396 { 0x1d, 0x411111f0 }, /* N/A */
1397 /* 0x1e is filled in below */
1398 { 0x1f, 0x411111f0 }, /* N/A */
1402 [ALC880_FIXUP_6ST] = {
1403 .type = HDA_FIXUP_PINS,
1404 .v.pins = (const struct hda_pintbl[]) {
1405 { 0x1e, 0x411111f0 }, /* N/A */
1409 .chain_id = ALC880_FIXUP_6ST_BASE,
1411 [ALC880_FIXUP_6ST_DIG] = {
1412 .type = HDA_FIXUP_PINS,
1413 .v.pins = (const struct hda_pintbl[]) {
1414 { 0x1e, 0x0144111e }, /* SPDIF */
1418 .chain_id = ALC880_FIXUP_6ST_BASE,
1420 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1421 .type = HDA_FIXUP_PINS,
1422 .v.pins = (const struct hda_pintbl[]) {
1423 { 0x1b, 0x0121401f }, /* HP with jack detect */
1426 .chained_before = true,
1427 .chain_id = ALC880_FIXUP_6ST_BASE,
1431 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1432 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1433 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1434 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1435 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1436 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1437 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1438 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1439 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1440 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1441 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1442 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1443 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1444 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1445 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1446 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1447 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1448 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1449 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1450 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1451 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1452 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1453 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1454 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1456 /* Below is the copied entries from alc880_quirks.c.
1457 * It's not quite sure whether BIOS sets the correct pin-config table
1458 * on these machines, thus they are kept to be compatible with
1459 * the old static quirks. Once when it's confirmed to work without
1460 * these overrides, it'd be better to remove.
1462 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1463 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1464 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1465 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1466 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1467 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1468 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1469 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1470 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1471 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1472 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1473 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1474 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1475 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1476 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1477 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1478 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1479 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1480 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1481 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1482 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1483 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1484 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1485 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1486 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1487 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1488 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1489 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1490 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1491 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1492 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1493 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1494 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1496 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1497 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1498 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1502 static const struct hda_model_fixup alc880_fixup_models[] = {
1503 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1504 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1505 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1506 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1507 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1508 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1509 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1515 * OK, here we have finally the patch for ALC880
1517 static int patch_alc880(struct hda_codec *codec)
1519 struct alc_spec *spec;
1522 err = alc_alloc_spec(codec, 0x0b);
1527 spec->gen.need_dac_fix = 1;
1528 spec->gen.beep_nid = 0x01;
1530 codec->patch_ops.unsol_event = alc880_unsol_event;
1532 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1534 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1536 /* automatic parse from the BIOS config */
1537 err = alc880_parse_auto_config(codec);
1541 if (!spec->gen.no_analog) {
1542 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1547 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1560 static int alc260_parse_auto_config(struct hda_codec *codec)
1562 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1563 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1564 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1571 ALC260_FIXUP_HP_DC5750,
1572 ALC260_FIXUP_HP_PIN_0F,
1575 ALC260_FIXUP_GPIO1_TOGGLE,
1576 ALC260_FIXUP_REPLACER,
1577 ALC260_FIXUP_HP_B1900,
1579 ALC260_FIXUP_FSC_S7020,
1580 ALC260_FIXUP_FSC_S7020_JWSE,
1581 ALC260_FIXUP_VAIO_PINS,
1584 static void alc260_gpio1_automute(struct hda_codec *codec)
1586 struct alc_spec *spec = codec->spec;
1588 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1591 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1592 const struct hda_fixup *fix, int action)
1594 struct alc_spec *spec = codec->spec;
1595 if (action == HDA_FIXUP_ACT_PROBE) {
1596 /* although the machine has only one output pin, we need to
1597 * toggle GPIO1 according to the jack state
1599 spec->gen.automute_hook = alc260_gpio1_automute;
1600 spec->gen.detect_hp = 1;
1601 spec->gen.automute_speaker = 1;
1602 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1603 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1604 snd_hda_gen_hp_automute);
1605 alc_setup_gpio(codec, 0x01);
1609 static void alc260_fixup_kn1(struct hda_codec *codec,
1610 const struct hda_fixup *fix, int action)
1612 struct alc_spec *spec = codec->spec;
1613 static const struct hda_pintbl pincfgs[] = {
1614 { 0x0f, 0x02214000 }, /* HP/speaker */
1615 { 0x12, 0x90a60160 }, /* int mic */
1616 { 0x13, 0x02a19000 }, /* ext mic */
1617 { 0x18, 0x01446000 }, /* SPDIF out */
1618 /* disable bogus I/O pins */
1619 { 0x10, 0x411111f0 },
1620 { 0x11, 0x411111f0 },
1621 { 0x14, 0x411111f0 },
1622 { 0x15, 0x411111f0 },
1623 { 0x16, 0x411111f0 },
1624 { 0x17, 0x411111f0 },
1625 { 0x19, 0x411111f0 },
1630 case HDA_FIXUP_ACT_PRE_PROBE:
1631 snd_hda_apply_pincfgs(codec, pincfgs);
1632 spec->init_amp = ALC_INIT_NONE;
1637 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1638 const struct hda_fixup *fix, int action)
1640 struct alc_spec *spec = codec->spec;
1641 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1642 spec->init_amp = ALC_INIT_NONE;
1645 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1646 const struct hda_fixup *fix, int action)
1648 struct alc_spec *spec = codec->spec;
1649 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1650 spec->gen.add_jack_modes = 1;
1651 spec->gen.hp_mic = 1;
1655 static const struct hda_fixup alc260_fixups[] = {
1656 [ALC260_FIXUP_HP_DC5750] = {
1657 .type = HDA_FIXUP_PINS,
1658 .v.pins = (const struct hda_pintbl[]) {
1659 { 0x11, 0x90130110 }, /* speaker */
1663 [ALC260_FIXUP_HP_PIN_0F] = {
1664 .type = HDA_FIXUP_PINS,
1665 .v.pins = (const struct hda_pintbl[]) {
1666 { 0x0f, 0x01214000 }, /* HP */
1670 [ALC260_FIXUP_COEF] = {
1671 .type = HDA_FIXUP_VERBS,
1672 .v.verbs = (const struct hda_verb[]) {
1673 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1674 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1678 [ALC260_FIXUP_GPIO1] = {
1679 .type = HDA_FIXUP_FUNC,
1680 .v.func = alc_fixup_gpio1,
1682 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1683 .type = HDA_FIXUP_FUNC,
1684 .v.func = alc260_fixup_gpio1_toggle,
1686 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1688 [ALC260_FIXUP_REPLACER] = {
1689 .type = HDA_FIXUP_VERBS,
1690 .v.verbs = (const struct hda_verb[]) {
1691 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1692 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1696 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1698 [ALC260_FIXUP_HP_B1900] = {
1699 .type = HDA_FIXUP_FUNC,
1700 .v.func = alc260_fixup_gpio1_toggle,
1702 .chain_id = ALC260_FIXUP_COEF,
1704 [ALC260_FIXUP_KN1] = {
1705 .type = HDA_FIXUP_FUNC,
1706 .v.func = alc260_fixup_kn1,
1708 [ALC260_FIXUP_FSC_S7020] = {
1709 .type = HDA_FIXUP_FUNC,
1710 .v.func = alc260_fixup_fsc_s7020,
1712 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1713 .type = HDA_FIXUP_FUNC,
1714 .v.func = alc260_fixup_fsc_s7020_jwse,
1716 .chain_id = ALC260_FIXUP_FSC_S7020,
1718 [ALC260_FIXUP_VAIO_PINS] = {
1719 .type = HDA_FIXUP_PINS,
1720 .v.pins = (const struct hda_pintbl[]) {
1721 /* Pin configs are missing completely on some VAIOs */
1722 { 0x0f, 0x01211020 },
1723 { 0x10, 0x0001003f },
1724 { 0x11, 0x411111f0 },
1725 { 0x12, 0x01a15930 },
1726 { 0x13, 0x411111f0 },
1727 { 0x14, 0x411111f0 },
1728 { 0x15, 0x411111f0 },
1729 { 0x16, 0x411111f0 },
1730 { 0x17, 0x411111f0 },
1731 { 0x18, 0x411111f0 },
1732 { 0x19, 0x411111f0 },
1738 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1739 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1740 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1741 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1742 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1743 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1744 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1745 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1746 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1747 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1748 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1749 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1750 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1754 static const struct hda_model_fixup alc260_fixup_models[] = {
1755 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1756 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1757 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1758 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1764 static int patch_alc260(struct hda_codec *codec)
1766 struct alc_spec *spec;
1769 err = alc_alloc_spec(codec, 0x07);
1774 /* as quite a few machines require HP amp for speaker outputs,
1775 * it's easier to enable it unconditionally; even if it's unneeded,
1776 * it's almost harmless.
1778 spec->gen.prefer_hp_amp = 1;
1779 spec->gen.beep_nid = 0x01;
1781 spec->shutup = alc_eapd_shutup;
1783 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1785 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1787 /* automatic parse from the BIOS config */
1788 err = alc260_parse_auto_config(codec);
1792 if (!spec->gen.no_analog) {
1793 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1798 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1809 * ALC882/883/885/888/889 support
1811 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1812 * configuration. Each pin widget can choose any input DACs and a mixer.
1813 * Each ADC is connected from a mixer of all inputs. This makes possible
1814 * 6-channel independent captures.
1816 * In addition, an independent DAC for the multi-playback (not used in this
1824 ALC882_FIXUP_ABIT_AW9D_MAX,
1825 ALC882_FIXUP_LENOVO_Y530,
1826 ALC882_FIXUP_PB_M5210,
1827 ALC882_FIXUP_ACER_ASPIRE_7736,
1828 ALC882_FIXUP_ASUS_W90V,
1830 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1831 ALC889_FIXUP_VAIO_TT,
1832 ALC888_FIXUP_EEE1601,
1835 ALC883_FIXUP_ACER_EAPD,
1840 ALC882_FIXUP_ASUS_W2JC,
1841 ALC882_FIXUP_ACER_ASPIRE_4930G,
1842 ALC882_FIXUP_ACER_ASPIRE_8930G,
1843 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1844 ALC885_FIXUP_MACPRO_GPIO,
1845 ALC889_FIXUP_DAC_ROUTE,
1846 ALC889_FIXUP_MBP_VREF,
1847 ALC889_FIXUP_IMAC91_VREF,
1848 ALC889_FIXUP_MBA11_VREF,
1849 ALC889_FIXUP_MBA21_VREF,
1850 ALC889_FIXUP_MP11_VREF,
1851 ALC889_FIXUP_MP41_VREF,
1852 ALC882_FIXUP_INV_DMIC,
1853 ALC882_FIXUP_NO_PRIMARY_HP,
1854 ALC887_FIXUP_ASUS_BASS,
1855 ALC887_FIXUP_BASS_CHMAP,
1856 ALC1220_FIXUP_GB_DUAL_CODECS,
1857 ALC1220_FIXUP_CLEVO_P950,
1858 ALC1220_FIXUP_SYSTEM76_ORYP5,
1859 ALC1220_FIXUP_SYSTEM76_ORYP5_PINS,
1862 static void alc889_fixup_coef(struct hda_codec *codec,
1863 const struct hda_fixup *fix, int action)
1865 if (action != HDA_FIXUP_ACT_INIT)
1867 alc_update_coef_idx(codec, 7, 0, 0x2030);
1870 /* set up GPIO at initialization */
1871 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1872 const struct hda_fixup *fix, int action)
1874 struct alc_spec *spec = codec->spec;
1876 spec->gpio_write_delay = true;
1877 alc_fixup_gpio3(codec, fix, action);
1880 /* Fix the connection of some pins for ALC889:
1881 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1882 * work correctly (bko#42740)
1884 static void alc889_fixup_dac_route(struct hda_codec *codec,
1885 const struct hda_fixup *fix, int action)
1887 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1888 /* fake the connections during parsing the tree */
1889 hda_nid_t conn1[2] = { 0x0c, 0x0d };
1890 hda_nid_t conn2[2] = { 0x0e, 0x0f };
1891 snd_hda_override_conn_list(codec, 0x14, 2, conn1);
1892 snd_hda_override_conn_list(codec, 0x15, 2, conn1);
1893 snd_hda_override_conn_list(codec, 0x18, 2, conn2);
1894 snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
1895 } else if (action == HDA_FIXUP_ACT_PROBE) {
1896 /* restore the connections */
1897 hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1898 snd_hda_override_conn_list(codec, 0x14, 5, conn);
1899 snd_hda_override_conn_list(codec, 0x15, 5, conn);
1900 snd_hda_override_conn_list(codec, 0x18, 5, conn);
1901 snd_hda_override_conn_list(codec, 0x1a, 5, conn);
1905 /* Set VREF on HP pin */
1906 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1907 const struct hda_fixup *fix, int action)
1909 struct alc_spec *spec = codec->spec;
1910 static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 };
1913 if (action != HDA_FIXUP_ACT_INIT)
1915 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1916 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1917 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1919 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1920 val |= AC_PINCTL_VREF_80;
1921 snd_hda_set_pin_ctl(codec, nids[i], val);
1922 spec->gen.keep_vref_in_automute = 1;
1927 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1928 const hda_nid_t *nids, int num_nids)
1930 struct alc_spec *spec = codec->spec;
1933 for (i = 0; i < num_nids; i++) {
1935 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1936 val |= AC_PINCTL_VREF_50;
1937 snd_hda_set_pin_ctl(codec, nids[i], val);
1939 spec->gen.keep_vref_in_automute = 1;
1942 /* Set VREF on speaker pins on imac91 */
1943 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1944 const struct hda_fixup *fix, int action)
1946 static hda_nid_t nids[2] = { 0x18, 0x1a };
1948 if (action == HDA_FIXUP_ACT_INIT)
1949 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1952 /* Set VREF on speaker pins on mba11 */
1953 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
1954 const struct hda_fixup *fix, int action)
1956 static hda_nid_t nids[1] = { 0x18 };
1958 if (action == HDA_FIXUP_ACT_INIT)
1959 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1962 /* Set VREF on speaker pins on mba21 */
1963 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
1964 const struct hda_fixup *fix, int action)
1966 static hda_nid_t nids[2] = { 0x18, 0x19 };
1968 if (action == HDA_FIXUP_ACT_INIT)
1969 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1972 /* Don't take HP output as primary
1973 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1974 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
1976 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
1977 const struct hda_fixup *fix, int action)
1979 struct alc_spec *spec = codec->spec;
1980 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1981 spec->gen.no_primary_hp = 1;
1982 spec->gen.no_multi_io = 1;
1986 static void alc_fixup_bass_chmap(struct hda_codec *codec,
1987 const struct hda_fixup *fix, int action);
1989 /* For dual-codec configuration, we need to disable some features to avoid
1990 * conflicts of kctls and PCM streams
1992 static void alc_fixup_dual_codecs(struct hda_codec *codec,
1993 const struct hda_fixup *fix, int action)
1995 struct alc_spec *spec = codec->spec;
1997 if (action != HDA_FIXUP_ACT_PRE_PROBE)
1999 /* disable vmaster */
2000 spec->gen.suppress_vmaster = 1;
2001 /* auto-mute and auto-mic switch don't work with multiple codecs */
2002 spec->gen.suppress_auto_mute = 1;
2003 spec->gen.suppress_auto_mic = 1;
2004 /* disable aamix as well */
2005 spec->gen.mixer_nid = 0;
2006 /* add location prefix to avoid conflicts */
2007 codec->force_pin_prefix = 1;
2010 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2011 const char *newname)
2013 struct snd_kcontrol *kctl;
2015 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2017 strcpy(kctl->id.name, newname);
2020 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2021 const struct hda_fixup *fix,
2024 alc_fixup_dual_codecs(codec, fix, action);
2026 case HDA_FIXUP_ACT_PRE_PROBE:
2027 /* override card longname to provide a unique UCM profile */
2028 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2030 case HDA_FIXUP_ACT_BUILD:
2031 /* rename Capture controls depending on the codec */
2032 rename_ctl(codec, "Capture Volume",
2034 "Rear-Panel Capture Volume" :
2035 "Front-Panel Capture Volume");
2036 rename_ctl(codec, "Capture Switch",
2038 "Rear-Panel Capture Switch" :
2039 "Front-Panel Capture Switch");
2044 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2045 const struct hda_fixup *fix,
2048 hda_nid_t conn1[1] = { 0x0c };
2050 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2053 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2054 /* We therefore want to make sure 0x14 (front headphone) and
2055 * 0x1b (speakers) use the stereo DAC 0x02
2057 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
2058 snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
2061 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2062 const struct hda_fixup *fix, int action);
2064 static void alc1220_fixup_system76_oryp5(struct hda_codec *codec,
2065 const struct hda_fixup *fix,
2068 alc1220_fixup_clevo_p950(codec, fix, action);
2069 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2072 static const struct hda_fixup alc882_fixups[] = {
2073 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2074 .type = HDA_FIXUP_PINS,
2075 .v.pins = (const struct hda_pintbl[]) {
2076 { 0x15, 0x01080104 }, /* side */
2077 { 0x16, 0x01011012 }, /* rear */
2078 { 0x17, 0x01016011 }, /* clfe */
2082 [ALC882_FIXUP_LENOVO_Y530] = {
2083 .type = HDA_FIXUP_PINS,
2084 .v.pins = (const struct hda_pintbl[]) {
2085 { 0x15, 0x99130112 }, /* rear int speakers */
2086 { 0x16, 0x99130111 }, /* subwoofer */
2090 [ALC882_FIXUP_PB_M5210] = {
2091 .type = HDA_FIXUP_PINCTLS,
2092 .v.pins = (const struct hda_pintbl[]) {
2093 { 0x19, PIN_VREF50 },
2097 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2098 .type = HDA_FIXUP_FUNC,
2099 .v.func = alc_fixup_sku_ignore,
2101 [ALC882_FIXUP_ASUS_W90V] = {
2102 .type = HDA_FIXUP_PINS,
2103 .v.pins = (const struct hda_pintbl[]) {
2104 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2108 [ALC889_FIXUP_CD] = {
2109 .type = HDA_FIXUP_PINS,
2110 .v.pins = (const struct hda_pintbl[]) {
2111 { 0x1c, 0x993301f0 }, /* CD */
2115 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2116 .type = HDA_FIXUP_PINS,
2117 .v.pins = (const struct hda_pintbl[]) {
2118 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2122 .chain_id = ALC889_FIXUP_CD,
2124 [ALC889_FIXUP_VAIO_TT] = {
2125 .type = HDA_FIXUP_PINS,
2126 .v.pins = (const struct hda_pintbl[]) {
2127 { 0x17, 0x90170111 }, /* hidden surround speaker */
2131 [ALC888_FIXUP_EEE1601] = {
2132 .type = HDA_FIXUP_VERBS,
2133 .v.verbs = (const struct hda_verb[]) {
2134 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2135 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2139 [ALC882_FIXUP_EAPD] = {
2140 .type = HDA_FIXUP_VERBS,
2141 .v.verbs = (const struct hda_verb[]) {
2142 /* change to EAPD mode */
2143 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2144 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2148 [ALC883_FIXUP_EAPD] = {
2149 .type = HDA_FIXUP_VERBS,
2150 .v.verbs = (const struct hda_verb[]) {
2151 /* change to EAPD mode */
2152 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2153 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2157 [ALC883_FIXUP_ACER_EAPD] = {
2158 .type = HDA_FIXUP_VERBS,
2159 .v.verbs = (const struct hda_verb[]) {
2160 /* eanable EAPD on Acer laptops */
2161 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2162 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2166 [ALC882_FIXUP_GPIO1] = {
2167 .type = HDA_FIXUP_FUNC,
2168 .v.func = alc_fixup_gpio1,
2170 [ALC882_FIXUP_GPIO2] = {
2171 .type = HDA_FIXUP_FUNC,
2172 .v.func = alc_fixup_gpio2,
2174 [ALC882_FIXUP_GPIO3] = {
2175 .type = HDA_FIXUP_FUNC,
2176 .v.func = alc_fixup_gpio3,
2178 [ALC882_FIXUP_ASUS_W2JC] = {
2179 .type = HDA_FIXUP_FUNC,
2180 .v.func = alc_fixup_gpio1,
2182 .chain_id = ALC882_FIXUP_EAPD,
2184 [ALC889_FIXUP_COEF] = {
2185 .type = HDA_FIXUP_FUNC,
2186 .v.func = alc889_fixup_coef,
2188 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2189 .type = HDA_FIXUP_PINS,
2190 .v.pins = (const struct hda_pintbl[]) {
2191 { 0x16, 0x99130111 }, /* CLFE speaker */
2192 { 0x17, 0x99130112 }, /* surround speaker */
2196 .chain_id = ALC882_FIXUP_GPIO1,
2198 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2199 .type = HDA_FIXUP_PINS,
2200 .v.pins = (const struct hda_pintbl[]) {
2201 { 0x16, 0x99130111 }, /* CLFE speaker */
2202 { 0x1b, 0x99130112 }, /* surround speaker */
2206 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2208 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2209 /* additional init verbs for Acer Aspire 8930G */
2210 .type = HDA_FIXUP_VERBS,
2211 .v.verbs = (const struct hda_verb[]) {
2212 /* Enable all DACs */
2213 /* DAC DISABLE/MUTE 1? */
2214 /* setting bits 1-5 disables DAC nids 0x02-0x06
2215 * apparently. Init=0x38 */
2216 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2217 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2218 /* DAC DISABLE/MUTE 2? */
2219 /* some bit here disables the other DACs.
2221 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2222 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2224 * This laptop has a stereo digital microphone.
2225 * The mics are only 1cm apart which makes the stereo
2226 * useless. However, either the mic or the ALC889
2227 * makes the signal become a difference/sum signal
2228 * instead of standard stereo, which is annoying.
2229 * So instead we flip this bit which makes the
2230 * codec replicate the sum signal to both channels,
2231 * turning it into a normal mono mic.
2233 /* DMIC_CONTROL? Init value = 0x0001 */
2234 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2235 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2236 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2237 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2241 .chain_id = ALC882_FIXUP_GPIO1,
2243 [ALC885_FIXUP_MACPRO_GPIO] = {
2244 .type = HDA_FIXUP_FUNC,
2245 .v.func = alc885_fixup_macpro_gpio,
2247 [ALC889_FIXUP_DAC_ROUTE] = {
2248 .type = HDA_FIXUP_FUNC,
2249 .v.func = alc889_fixup_dac_route,
2251 [ALC889_FIXUP_MBP_VREF] = {
2252 .type = HDA_FIXUP_FUNC,
2253 .v.func = alc889_fixup_mbp_vref,
2255 .chain_id = ALC882_FIXUP_GPIO1,
2257 [ALC889_FIXUP_IMAC91_VREF] = {
2258 .type = HDA_FIXUP_FUNC,
2259 .v.func = alc889_fixup_imac91_vref,
2261 .chain_id = ALC882_FIXUP_GPIO1,
2263 [ALC889_FIXUP_MBA11_VREF] = {
2264 .type = HDA_FIXUP_FUNC,
2265 .v.func = alc889_fixup_mba11_vref,
2267 .chain_id = ALC889_FIXUP_MBP_VREF,
2269 [ALC889_FIXUP_MBA21_VREF] = {
2270 .type = HDA_FIXUP_FUNC,
2271 .v.func = alc889_fixup_mba21_vref,
2273 .chain_id = ALC889_FIXUP_MBP_VREF,
2275 [ALC889_FIXUP_MP11_VREF] = {
2276 .type = HDA_FIXUP_FUNC,
2277 .v.func = alc889_fixup_mba11_vref,
2279 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2281 [ALC889_FIXUP_MP41_VREF] = {
2282 .type = HDA_FIXUP_FUNC,
2283 .v.func = alc889_fixup_mbp_vref,
2285 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2287 [ALC882_FIXUP_INV_DMIC] = {
2288 .type = HDA_FIXUP_FUNC,
2289 .v.func = alc_fixup_inv_dmic,
2291 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2292 .type = HDA_FIXUP_FUNC,
2293 .v.func = alc882_fixup_no_primary_hp,
2295 [ALC887_FIXUP_ASUS_BASS] = {
2296 .type = HDA_FIXUP_PINS,
2297 .v.pins = (const struct hda_pintbl[]) {
2298 {0x16, 0x99130130}, /* bass speaker */
2302 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2304 [ALC887_FIXUP_BASS_CHMAP] = {
2305 .type = HDA_FIXUP_FUNC,
2306 .v.func = alc_fixup_bass_chmap,
2308 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2309 .type = HDA_FIXUP_FUNC,
2310 .v.func = alc1220_fixup_gb_dual_codecs,
2312 [ALC1220_FIXUP_CLEVO_P950] = {
2313 .type = HDA_FIXUP_FUNC,
2314 .v.func = alc1220_fixup_clevo_p950,
2316 [ALC1220_FIXUP_SYSTEM76_ORYP5] = {
2317 .type = HDA_FIXUP_FUNC,
2318 .v.func = alc1220_fixup_system76_oryp5,
2320 [ALC1220_FIXUP_SYSTEM76_ORYP5_PINS] = {
2321 .type = HDA_FIXUP_PINS,
2322 .v.pins = (const struct hda_pintbl[]) {
2323 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2327 .chain_id = ALC1220_FIXUP_SYSTEM76_ORYP5,
2331 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2332 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2333 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2334 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2335 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2336 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2337 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2338 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2339 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2340 ALC882_FIXUP_ACER_ASPIRE_4930G),
2341 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2342 ALC882_FIXUP_ACER_ASPIRE_4930G),
2343 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2344 ALC882_FIXUP_ACER_ASPIRE_8930G),
2345 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2346 ALC882_FIXUP_ACER_ASPIRE_8930G),
2347 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2348 ALC882_FIXUP_ACER_ASPIRE_4930G),
2349 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2350 ALC882_FIXUP_ACER_ASPIRE_4930G),
2351 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2352 ALC882_FIXUP_ACER_ASPIRE_4930G),
2353 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2354 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2355 ALC882_FIXUP_ACER_ASPIRE_4930G),
2356 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2357 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2358 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2359 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2360 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2361 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2362 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2363 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2364 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2365 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2366 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2367 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2368 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2369 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2371 /* All Apple entries are in codec SSIDs */
2372 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2373 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2374 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2375 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2376 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2377 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2378 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2379 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2380 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2381 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2382 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2383 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2384 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2385 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2386 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2387 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2388 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2389 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2390 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2391 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2392 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2393 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2395 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2396 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2397 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2398 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2399 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2400 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2401 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2402 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2403 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2404 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2405 SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS),
2406 SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS),
2407 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2408 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2409 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2410 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2414 static const struct hda_model_fixup alc882_fixup_models[] = {
2415 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2416 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2417 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2418 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2419 {.id = ALC889_FIXUP_CD, .name = "cd"},
2420 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2421 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2422 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2423 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2424 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2425 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2426 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2427 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2428 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2429 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2430 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2431 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2432 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2433 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2434 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2435 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2436 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2437 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2438 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2439 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2440 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2441 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2442 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2443 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2444 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2445 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2450 * BIOS auto configuration
2452 /* almost identical with ALC880 parser... */
2453 static int alc882_parse_auto_config(struct hda_codec *codec)
2455 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2456 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2457 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2462 static int patch_alc882(struct hda_codec *codec)
2464 struct alc_spec *spec;
2467 err = alc_alloc_spec(codec, 0x0b);
2473 switch (codec->core.vendor_id) {
2480 /* ALC883 and variants */
2481 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2485 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2487 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2489 alc_auto_parse_customize_define(codec);
2491 if (has_cdefine_beep(codec))
2492 spec->gen.beep_nid = 0x01;
2494 /* automatic parse from the BIOS config */
2495 err = alc882_parse_auto_config(codec);
2499 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2500 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2505 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2518 static int alc262_parse_auto_config(struct hda_codec *codec)
2520 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2521 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2522 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2529 ALC262_FIXUP_FSC_H270,
2530 ALC262_FIXUP_FSC_S7110,
2531 ALC262_FIXUP_HP_Z200,
2533 ALC262_FIXUP_LENOVO_3000,
2535 ALC262_FIXUP_BENQ_T31,
2536 ALC262_FIXUP_INV_DMIC,
2537 ALC262_FIXUP_INTEL_BAYLEYBAY,
2540 static const struct hda_fixup alc262_fixups[] = {
2541 [ALC262_FIXUP_FSC_H270] = {
2542 .type = HDA_FIXUP_PINS,
2543 .v.pins = (const struct hda_pintbl[]) {
2544 { 0x14, 0x99130110 }, /* speaker */
2545 { 0x15, 0x0221142f }, /* front HP */
2546 { 0x1b, 0x0121141f }, /* rear HP */
2550 [ALC262_FIXUP_FSC_S7110] = {
2551 .type = HDA_FIXUP_PINS,
2552 .v.pins = (const struct hda_pintbl[]) {
2553 { 0x15, 0x90170110 }, /* speaker */
2557 .chain_id = ALC262_FIXUP_BENQ,
2559 [ALC262_FIXUP_HP_Z200] = {
2560 .type = HDA_FIXUP_PINS,
2561 .v.pins = (const struct hda_pintbl[]) {
2562 { 0x16, 0x99130120 }, /* internal speaker */
2566 [ALC262_FIXUP_TYAN] = {
2567 .type = HDA_FIXUP_PINS,
2568 .v.pins = (const struct hda_pintbl[]) {
2569 { 0x14, 0x1993e1f0 }, /* int AUX */
2573 [ALC262_FIXUP_LENOVO_3000] = {
2574 .type = HDA_FIXUP_PINCTLS,
2575 .v.pins = (const struct hda_pintbl[]) {
2576 { 0x19, PIN_VREF50 },
2580 .chain_id = ALC262_FIXUP_BENQ,
2582 [ALC262_FIXUP_BENQ] = {
2583 .type = HDA_FIXUP_VERBS,
2584 .v.verbs = (const struct hda_verb[]) {
2585 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2586 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2590 [ALC262_FIXUP_BENQ_T31] = {
2591 .type = HDA_FIXUP_VERBS,
2592 .v.verbs = (const struct hda_verb[]) {
2593 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2594 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2598 [ALC262_FIXUP_INV_DMIC] = {
2599 .type = HDA_FIXUP_FUNC,
2600 .v.func = alc_fixup_inv_dmic,
2602 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2603 .type = HDA_FIXUP_FUNC,
2604 .v.func = alc_fixup_no_depop_delay,
2608 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2609 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2610 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2611 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2612 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2613 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2614 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2615 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2616 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2617 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2618 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2622 static const struct hda_model_fixup alc262_fixup_models[] = {
2623 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2624 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2625 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2626 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2627 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2628 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2629 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2630 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2631 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2637 static int patch_alc262(struct hda_codec *codec)
2639 struct alc_spec *spec;
2642 err = alc_alloc_spec(codec, 0x0b);
2647 spec->gen.shared_mic_vref_pin = 0x18;
2649 spec->shutup = alc_eapd_shutup;
2652 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2655 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2657 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2659 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2661 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2663 alc_auto_parse_customize_define(codec);
2665 if (has_cdefine_beep(codec))
2666 spec->gen.beep_nid = 0x01;
2668 /* automatic parse from the BIOS config */
2669 err = alc262_parse_auto_config(codec);
2673 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2674 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2679 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2691 /* bind Beep switches of both NID 0x0f and 0x10 */
2692 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2693 struct snd_ctl_elem_value *ucontrol)
2695 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2699 mutex_lock(&codec->control_mutex);
2700 pval = kcontrol->private_value;
2701 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2702 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2704 kcontrol->private_value = (pval & ~0xff) | 0x10;
2705 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2707 kcontrol->private_value = pval;
2708 mutex_unlock(&codec->control_mutex);
2712 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2713 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2715 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2716 .name = "Beep Playback Switch",
2717 .subdevice = HDA_SUBDEV_AMP_FLAG,
2718 .info = snd_hda_mixer_amp_switch_info,
2719 .get = snd_hda_mixer_amp_switch_get,
2720 .put = alc268_beep_switch_put,
2721 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2725 /* set PCBEEP vol = 0, mute connections */
2726 static const struct hda_verb alc268_beep_init_verbs[] = {
2727 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2728 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2729 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2734 ALC268_FIXUP_INV_DMIC,
2735 ALC268_FIXUP_HP_EAPD,
2739 static const struct hda_fixup alc268_fixups[] = {
2740 [ALC268_FIXUP_INV_DMIC] = {
2741 .type = HDA_FIXUP_FUNC,
2742 .v.func = alc_fixup_inv_dmic,
2744 [ALC268_FIXUP_HP_EAPD] = {
2745 .type = HDA_FIXUP_VERBS,
2746 .v.verbs = (const struct hda_verb[]) {
2747 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2751 [ALC268_FIXUP_SPDIF] = {
2752 .type = HDA_FIXUP_PINS,
2753 .v.pins = (const struct hda_pintbl[]) {
2754 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2760 static const struct hda_model_fixup alc268_fixup_models[] = {
2761 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2762 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2763 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2767 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2768 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2769 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2770 /* below is codec SSID since multiple Toshiba laptops have the
2771 * same PCI SSID 1179:ff00
2773 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2778 * BIOS auto configuration
2780 static int alc268_parse_auto_config(struct hda_codec *codec)
2782 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2783 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2788 static int patch_alc268(struct hda_codec *codec)
2790 struct alc_spec *spec;
2793 /* ALC268 has no aa-loopback mixer */
2794 err = alc_alloc_spec(codec, 0);
2799 spec->gen.beep_nid = 0x01;
2801 spec->shutup = alc_eapd_shutup;
2803 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2804 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2806 /* automatic parse from the BIOS config */
2807 err = alc268_parse_auto_config(codec);
2811 if (err > 0 && !spec->gen.no_analog &&
2812 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2813 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2814 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2815 &alc268_beep_mixer[i])) {
2820 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2821 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2822 /* override the amp caps for beep generator */
2823 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
2824 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
2825 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
2826 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2827 (0 << AC_AMPCAP_MUTE_SHIFT));
2830 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2843 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
2844 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2847 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
2848 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2851 /* different alc269-variants */
2853 ALC269_TYPE_ALC269VA,
2854 ALC269_TYPE_ALC269VB,
2855 ALC269_TYPE_ALC269VC,
2856 ALC269_TYPE_ALC269VD,
2875 * BIOS auto configuration
2877 static int alc269_parse_auto_config(struct hda_codec *codec)
2879 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
2880 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
2881 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2882 struct alc_spec *spec = codec->spec;
2883 const hda_nid_t *ssids;
2885 switch (spec->codec_variant) {
2886 case ALC269_TYPE_ALC269VA:
2887 case ALC269_TYPE_ALC269VC:
2888 case ALC269_TYPE_ALC280:
2889 case ALC269_TYPE_ALC284:
2890 case ALC269_TYPE_ALC293:
2891 ssids = alc269va_ssids;
2893 case ALC269_TYPE_ALC269VB:
2894 case ALC269_TYPE_ALC269VD:
2895 case ALC269_TYPE_ALC282:
2896 case ALC269_TYPE_ALC283:
2897 case ALC269_TYPE_ALC286:
2898 case ALC269_TYPE_ALC298:
2899 case ALC269_TYPE_ALC255:
2900 case ALC269_TYPE_ALC256:
2901 case ALC269_TYPE_ALC257:
2902 case ALC269_TYPE_ALC215:
2903 case ALC269_TYPE_ALC225:
2904 case ALC269_TYPE_ALC294:
2905 case ALC269_TYPE_ALC300:
2906 case ALC269_TYPE_ALC700:
2907 ssids = alc269_ssids;
2910 ssids = alc269_ssids;
2914 return alc_parse_auto_config(codec, alc269_ignore, ssids);
2917 static int find_ext_mic_pin(struct hda_codec *codec);
2919 static void alc286_shutup(struct hda_codec *codec)
2921 const struct hda_pincfg *pin;
2923 int mic_pin = find_ext_mic_pin(codec);
2924 /* don't shut up pins when unloading the driver; otherwise it breaks
2925 * the default pin setup at the next load of the driver
2927 if (codec->bus->shutdown)
2929 snd_array_for_each(&codec->init_pins, i, pin) {
2930 /* use read here for syncing after issuing each verb */
2931 if (pin->nid != mic_pin)
2932 snd_hda_codec_read(codec, pin->nid, 0,
2933 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
2935 codec->pins_shutup = 1;
2938 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
2940 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
2943 static void alc269_shutup(struct hda_codec *codec)
2945 struct alc_spec *spec = codec->spec;
2947 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
2948 alc269vb_toggle_power_output(codec, 0);
2949 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
2950 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
2953 snd_hda_shutup_pins(codec);
2956 static struct coef_fw alc282_coefs[] = {
2957 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2958 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2959 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2960 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2961 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2962 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2963 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2964 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2965 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2966 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2967 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2968 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2969 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2970 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2971 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2972 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2973 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2974 WRITE_COEF(0x63, 0x2902), /* PLL */
2975 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2976 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2977 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2978 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2979 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2980 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2981 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2982 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2983 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2984 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2985 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2989 static void alc282_restore_default_value(struct hda_codec *codec)
2991 alc_process_coef_fw(codec, alc282_coefs);
2994 static void alc282_init(struct hda_codec *codec)
2996 struct alc_spec *spec = codec->spec;
2997 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3001 alc282_restore_default_value(codec);
3005 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3006 coef78 = alc_read_coef_idx(codec, 0x78);
3008 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3009 /* Headphone capless set to high power mode */
3010 alc_write_coef_idx(codec, 0x78, 0x9004);
3015 snd_hda_codec_write(codec, hp_pin, 0,
3016 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3021 snd_hda_codec_write(codec, hp_pin, 0,
3022 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3027 /* Headphone capless set to normal mode */
3028 alc_write_coef_idx(codec, 0x78, coef78);
3031 static void alc282_shutup(struct hda_codec *codec)
3033 struct alc_spec *spec = codec->spec;
3034 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3039 alc269_shutup(codec);
3043 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3044 coef78 = alc_read_coef_idx(codec, 0x78);
3045 alc_write_coef_idx(codec, 0x78, 0x9004);
3050 snd_hda_codec_write(codec, hp_pin, 0,
3051 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3056 snd_hda_codec_write(codec, hp_pin, 0,
3057 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3062 alc_auto_setup_eapd(codec, false);
3063 snd_hda_shutup_pins(codec);
3064 alc_write_coef_idx(codec, 0x78, coef78);
3067 static struct coef_fw alc283_coefs[] = {
3068 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3069 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3070 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3071 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3072 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3073 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3074 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3075 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3076 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3077 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3078 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3079 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3080 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3081 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3082 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3083 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3084 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3085 WRITE_COEF(0x2e, 0x2902), /* PLL */
3086 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3087 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3088 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3089 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3090 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3091 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3092 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3093 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3094 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3095 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3096 WRITE_COEF(0x49, 0x0), /* test mode */
3097 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3098 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3099 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3100 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3104 static void alc283_restore_default_value(struct hda_codec *codec)
3106 alc_process_coef_fw(codec, alc283_coefs);
3109 static void alc283_init(struct hda_codec *codec)
3111 struct alc_spec *spec = codec->spec;
3112 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3115 alc283_restore_default_value(codec);
3121 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3123 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3124 /* Headphone capless set to high power mode */
3125 alc_write_coef_idx(codec, 0x43, 0x9004);
3127 snd_hda_codec_write(codec, hp_pin, 0,
3128 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3133 snd_hda_codec_write(codec, hp_pin, 0,
3134 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3138 /* Index 0x46 Combo jack auto switch control 2 */
3139 /* 3k pull low control for Headset jack. */
3140 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3141 /* Headphone capless set to normal mode */
3142 alc_write_coef_idx(codec, 0x43, 0x9614);
3145 static void alc283_shutup(struct hda_codec *codec)
3147 struct alc_spec *spec = codec->spec;
3148 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3152 alc269_shutup(codec);
3156 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3158 alc_write_coef_idx(codec, 0x43, 0x9004);
3160 /*depop hp during suspend*/
3161 alc_write_coef_idx(codec, 0x06, 0x2100);
3163 snd_hda_codec_write(codec, hp_pin, 0,
3164 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3169 snd_hda_codec_write(codec, hp_pin, 0,
3170 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3172 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3176 alc_auto_setup_eapd(codec, false);
3177 snd_hda_shutup_pins(codec);
3178 alc_write_coef_idx(codec, 0x43, 0x9614);
3181 static void alc256_init(struct hda_codec *codec)
3183 struct alc_spec *spec = codec->spec;
3184 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3192 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3197 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3199 snd_hda_codec_write(codec, hp_pin, 0,
3200 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3205 snd_hda_codec_write(codec, hp_pin, 0,
3206 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3211 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3212 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3213 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3214 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3217 static void alc256_shutup(struct hda_codec *codec)
3219 struct alc_spec *spec = codec->spec;
3220 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3224 alc269_shutup(codec);
3228 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3233 snd_hda_codec_write(codec, hp_pin, 0,
3234 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3239 /* 3k pull low control for Headset jack. */
3240 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3241 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3243 snd_hda_codec_write(codec, hp_pin, 0,
3244 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3249 alc_auto_setup_eapd(codec, false);
3250 snd_hda_shutup_pins(codec);
3253 static void alc225_init(struct hda_codec *codec)
3255 struct alc_spec *spec = codec->spec;
3256 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3257 bool hp1_pin_sense, hp2_pin_sense;
3264 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3265 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3267 if (hp1_pin_sense || hp2_pin_sense)
3270 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3273 snd_hda_codec_write(codec, hp_pin, 0,
3274 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3276 snd_hda_codec_write(codec, 0x16, 0,
3277 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3279 if (hp1_pin_sense || hp2_pin_sense)
3283 snd_hda_codec_write(codec, hp_pin, 0,
3284 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3286 snd_hda_codec_write(codec, 0x16, 0,
3287 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3289 if (hp1_pin_sense || hp2_pin_sense)
3292 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3293 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3296 static void alc225_shutup(struct hda_codec *codec)
3298 struct alc_spec *spec = codec->spec;
3299 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3300 bool hp1_pin_sense, hp2_pin_sense;
3303 alc269_shutup(codec);
3307 /* 3k pull low control for Headset jack. */
3308 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3310 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3311 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3313 if (hp1_pin_sense || hp2_pin_sense)
3317 snd_hda_codec_write(codec, hp_pin, 0,
3318 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3320 snd_hda_codec_write(codec, 0x16, 0,
3321 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3323 if (hp1_pin_sense || hp2_pin_sense)
3327 snd_hda_codec_write(codec, hp_pin, 0,
3328 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3330 snd_hda_codec_write(codec, 0x16, 0,
3331 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3333 if (hp1_pin_sense || hp2_pin_sense)
3336 alc_auto_setup_eapd(codec, false);
3337 snd_hda_shutup_pins(codec);
3340 static void alc_default_init(struct hda_codec *codec)
3342 struct alc_spec *spec = codec->spec;
3343 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3351 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3356 snd_hda_codec_write(codec, hp_pin, 0,
3357 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3362 snd_hda_codec_write(codec, hp_pin, 0,
3363 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3369 static void alc_default_shutup(struct hda_codec *codec)
3371 struct alc_spec *spec = codec->spec;
3372 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3376 alc269_shutup(codec);
3380 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3385 snd_hda_codec_write(codec, hp_pin, 0,
3386 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3391 snd_hda_codec_write(codec, hp_pin, 0,
3392 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3397 alc_auto_setup_eapd(codec, false);
3398 snd_hda_shutup_pins(codec);
3401 static void alc294_hp_init(struct hda_codec *codec)
3403 struct alc_spec *spec = codec->spec;
3404 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3410 snd_hda_codec_write(codec, hp_pin, 0,
3411 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3415 snd_hda_codec_write(codec, hp_pin, 0,
3416 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3418 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3419 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3421 /* Wait for depop procedure finish */
3422 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3423 for (i = 0; i < 20 && val & 0x0080; i++) {
3425 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3427 /* Set HP depop to auto mode */
3428 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3432 static void alc294_init(struct hda_codec *codec)
3434 struct alc_spec *spec = codec->spec;
3436 if (!spec->done_hp_init) {
3437 alc294_hp_init(codec);
3438 spec->done_hp_init = true;
3440 alc_default_init(codec);
3443 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3446 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3447 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3448 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3451 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3455 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3456 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3458 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3463 static void alc5505_dsp_halt(struct hda_codec *codec)
3467 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3468 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3469 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3470 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3471 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3472 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3473 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3474 val = alc5505_coef_get(codec, 0x6220);
3475 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3478 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3480 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3481 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3482 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3483 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3484 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3485 alc5505_coef_set(codec, 0x880c, 0x00000004);
3488 static void alc5505_dsp_init(struct hda_codec *codec)
3492 alc5505_dsp_halt(codec);
3493 alc5505_dsp_back_from_halt(codec);
3494 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3495 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3496 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3497 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3498 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3499 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3500 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3501 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3502 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3503 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3504 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3505 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3506 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3508 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3510 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3512 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3514 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3515 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3516 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3517 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3518 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3519 alc5505_coef_set(codec, 0x880c, 0x00000003);
3520 alc5505_coef_set(codec, 0x880c, 0x00000010);
3522 #ifdef HALT_REALTEK_ALC5505
3523 alc5505_dsp_halt(codec);
3527 #ifdef HALT_REALTEK_ALC5505
3528 #define alc5505_dsp_suspend(codec) /* NOP */
3529 #define alc5505_dsp_resume(codec) /* NOP */
3531 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3532 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3536 static int alc269_suspend(struct hda_codec *codec)
3538 struct alc_spec *spec = codec->spec;
3540 if (spec->has_alc5505_dsp)
3541 alc5505_dsp_suspend(codec);
3542 return alc_suspend(codec);
3545 static int alc269_resume(struct hda_codec *codec)
3547 struct alc_spec *spec = codec->spec;
3549 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3550 alc269vb_toggle_power_output(codec, 0);
3551 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3552 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3556 codec->patch_ops.init(codec);
3558 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3559 alc269vb_toggle_power_output(codec, 1);
3560 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3561 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3565 regcache_sync(codec->core.regmap);
3566 hda_call_check_power_status(codec, 0x01);
3568 /* on some machine, the BIOS will clear the codec gpio data when enter
3569 * suspend, and won't restore the data after resume, so we restore it
3572 if (spec->gpio_data)
3573 alc_write_gpio_data(codec);
3575 if (spec->has_alc5505_dsp)
3576 alc5505_dsp_resume(codec);
3580 #endif /* CONFIG_PM */
3582 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3583 const struct hda_fixup *fix, int action)
3585 struct alc_spec *spec = codec->spec;
3587 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3588 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3591 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3592 const struct hda_fixup *fix,
3595 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3596 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3598 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3599 snd_hda_codec_set_pincfg(codec, 0x19,
3600 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3601 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3604 static void alc269_fixup_hweq(struct hda_codec *codec,
3605 const struct hda_fixup *fix, int action)
3607 if (action == HDA_FIXUP_ACT_INIT)
3608 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3611 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3612 const struct hda_fixup *fix, int action)
3614 struct alc_spec *spec = codec->spec;
3616 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3617 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3620 static void alc271_fixup_dmic(struct hda_codec *codec,
3621 const struct hda_fixup *fix, int action)
3623 static const struct hda_verb verbs[] = {
3624 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3625 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3630 if (strcmp(codec->core.chip_name, "ALC271X") &&
3631 strcmp(codec->core.chip_name, "ALC269VB"))
3633 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3634 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3635 snd_hda_sequence_write(codec, verbs);
3638 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3639 const struct hda_fixup *fix, int action)
3641 struct alc_spec *spec = codec->spec;
3643 if (action != HDA_FIXUP_ACT_PROBE)
3646 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3647 * fix the sample rate of analog I/O to 44.1kHz
3649 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3650 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3653 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3654 const struct hda_fixup *fix, int action)
3656 /* The digital-mic unit sends PDM (differential signal) instead of
3657 * the standard PCM, thus you can't record a valid mono stream as is.
3658 * Below is a workaround specific to ALC269 to control the dmic
3659 * signal source as mono.
3661 if (action == HDA_FIXUP_ACT_INIT)
3662 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3665 static void alc269_quanta_automute(struct hda_codec *codec)
3667 snd_hda_gen_update_outputs(codec);
3669 alc_write_coef_idx(codec, 0x0c, 0x680);
3670 alc_write_coef_idx(codec, 0x0c, 0x480);
3673 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3674 const struct hda_fixup *fix, int action)
3676 struct alc_spec *spec = codec->spec;
3677 if (action != HDA_FIXUP_ACT_PROBE)
3679 spec->gen.automute_hook = alc269_quanta_automute;
3682 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3683 struct hda_jack_callback *jack)
3685 struct alc_spec *spec = codec->spec;
3688 snd_hda_gen_hp_automute(codec, jack);
3690 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3692 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3695 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3699 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
3700 const struct hda_fixup *fix, int action)
3702 struct alc_spec *spec = codec->spec;
3703 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3704 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3705 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
3710 /* update mute-LED according to the speaker mute state via mic VREF pin */
3711 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
3713 struct hda_codec *codec = private_data;
3714 struct alc_spec *spec = codec->spec;
3715 unsigned int pinval;
3717 if (spec->mute_led_polarity)
3719 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3720 pinval &= ~AC_PINCTL_VREFEN;
3721 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3722 if (spec->mute_led_nid) {
3723 /* temporarily power up/down for setting VREF */
3724 snd_hda_power_up_pm(codec);
3725 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3726 snd_hda_power_down_pm(codec);
3730 /* Make sure the led works even in runtime suspend */
3731 static unsigned int led_power_filter(struct hda_codec *codec,
3733 unsigned int power_state)
3735 struct alc_spec *spec = codec->spec;
3737 if (power_state != AC_PWRST_D3 || nid == 0 ||
3738 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
3741 /* Set pin ctl again, it might have just been set to 0 */
3742 snd_hda_set_pin_ctl(codec, nid,
3743 snd_hda_codec_get_pin_target(codec, nid));
3745 return snd_hda_gen_path_power_filter(codec, nid, power_state);
3748 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
3749 const struct hda_fixup *fix, int action)
3751 struct alc_spec *spec = codec->spec;
3752 const struct dmi_device *dev = NULL;
3754 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3757 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
3759 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
3761 if (pin < 0x0a || pin >= 0x10)
3763 spec->mute_led_polarity = pol;
3764 spec->mute_led_nid = pin - 0x0a + 0x18;
3765 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3766 spec->gen.vmaster_mute_enum = 1;
3767 codec->power_filter = led_power_filter;
3769 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
3770 spec->mute_led_polarity);
3775 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
3776 const struct hda_fixup *fix,
3777 int action, hda_nid_t pin)
3779 struct alc_spec *spec = codec->spec;
3781 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3782 spec->mute_led_polarity = 0;
3783 spec->mute_led_nid = pin;
3784 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3785 spec->gen.vmaster_mute_enum = 1;
3786 codec->power_filter = led_power_filter;
3790 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
3791 const struct hda_fixup *fix, int action)
3793 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
3796 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
3797 const struct hda_fixup *fix, int action)
3799 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
3802 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
3803 const struct hda_fixup *fix, int action)
3805 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
3808 /* update LED status via GPIO */
3809 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
3812 struct alc_spec *spec = codec->spec;
3814 if (spec->mute_led_polarity)
3816 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
3819 /* turn on/off mute LED via GPIO per vmaster hook */
3820 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
3822 struct hda_codec *codec = private_data;
3823 struct alc_spec *spec = codec->spec;
3825 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled);
3828 /* turn on/off mic-mute LED via GPIO per capture hook */
3829 static void alc_gpio_micmute_update(struct hda_codec *codec)
3831 struct alc_spec *spec = codec->spec;
3833 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
3834 spec->gen.micmute_led.led_value);
3837 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
3838 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
3840 unsigned int mute_mask,
3841 unsigned int micmute_mask)
3843 struct alc_spec *spec = codec->spec;
3845 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
3847 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3850 spec->gpio_mute_led_mask = mute_mask;
3851 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
3854 spec->gpio_mic_led_mask = micmute_mask;
3855 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
3859 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
3860 const struct hda_fixup *fix, int action)
3862 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
3865 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
3866 const struct hda_fixup *fix, int action)
3868 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
3871 /* turn on/off mic-mute LED per capture hook */
3872 static void alc_cap_micmute_update(struct hda_codec *codec)
3874 struct alc_spec *spec = codec->spec;
3875 unsigned int pinval;
3877 if (!spec->cap_mute_led_nid)
3879 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
3880 pinval &= ~AC_PINCTL_VREFEN;
3881 if (spec->gen.micmute_led.led_value)
3882 pinval |= AC_PINCTL_VREF_80;
3884 pinval |= AC_PINCTL_VREF_HIZ;
3885 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
3888 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
3889 const struct hda_fixup *fix, int action)
3891 struct alc_spec *spec = codec->spec;
3893 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
3894 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3895 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
3896 * enable headphone amp
3898 spec->gpio_mask |= 0x10;
3899 spec->gpio_dir |= 0x10;
3900 spec->cap_mute_led_nid = 0x18;
3901 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
3902 codec->power_filter = led_power_filter;
3906 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
3907 const struct hda_fixup *fix, int action)
3909 struct alc_spec *spec = codec->spec;
3911 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
3912 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3913 spec->cap_mute_led_nid = 0x18;
3914 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
3915 codec->power_filter = led_power_filter;
3919 #if IS_REACHABLE(CONFIG_INPUT)
3920 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
3921 struct hda_jack_callback *event)
3923 struct alc_spec *spec = codec->spec;
3925 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3926 send both key on and key off event for every interrupt. */
3927 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
3928 input_sync(spec->kb_dev);
3929 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
3930 input_sync(spec->kb_dev);
3933 static int alc_register_micmute_input_device(struct hda_codec *codec)
3935 struct alc_spec *spec = codec->spec;
3938 spec->kb_dev = input_allocate_device();
3939 if (!spec->kb_dev) {
3940 codec_err(codec, "Out of memory (input_allocate_device)\n");
3944 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
3946 spec->kb_dev->name = "Microphone Mute Button";
3947 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
3948 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
3949 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
3950 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
3951 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
3952 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3954 if (input_register_device(spec->kb_dev)) {
3955 codec_err(codec, "input_register_device failed\n");
3956 input_free_device(spec->kb_dev);
3957 spec->kb_dev = NULL;
3964 /* GPIO1 = set according to SKU external amp
3965 * GPIO2 = mic mute hotkey
3967 * GPIO4 = mic mute LED
3969 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
3970 const struct hda_fixup *fix, int action)
3972 struct alc_spec *spec = codec->spec;
3974 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
3975 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3976 spec->init_amp = ALC_INIT_DEFAULT;
3977 if (alc_register_micmute_input_device(codec) != 0)
3980 spec->gpio_mask |= 0x06;
3981 spec->gpio_dir |= 0x02;
3982 spec->gpio_data |= 0x02;
3983 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
3984 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
3985 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
3986 gpio2_mic_hotkey_event);
3994 case HDA_FIXUP_ACT_FREE:
3995 input_unregister_device(spec->kb_dev);
3996 spec->kb_dev = NULL;
4000 /* Line2 = mic mute hotkey
4001 * GPIO2 = mic mute LED
4003 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4004 const struct hda_fixup *fix, int action)
4006 struct alc_spec *spec = codec->spec;
4008 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4009 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4010 spec->init_amp = ALC_INIT_DEFAULT;
4011 if (alc_register_micmute_input_device(codec) != 0)
4014 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4015 gpio2_mic_hotkey_event);
4023 case HDA_FIXUP_ACT_FREE:
4024 input_unregister_device(spec->kb_dev);
4025 spec->kb_dev = NULL;
4029 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4030 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4033 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4034 const struct hda_fixup *fix, int action)
4036 struct alc_spec *spec = codec->spec;
4038 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4039 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4040 spec->cap_mute_led_nid = 0x18;
4041 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4045 static struct coef_fw alc225_pre_hsmode[] = {
4046 UPDATE_COEF(0x4a, 1<<8, 0),
4047 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4048 UPDATE_COEF(0x63, 3<<14, 3<<14),
4049 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4050 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4051 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4052 UPDATE_COEF(0x4a, 3<<10, 0),
4056 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4058 static struct coef_fw coef0255[] = {
4059 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4060 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4061 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4062 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4065 static struct coef_fw coef0255_1[] = {
4066 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4069 static struct coef_fw coef0256[] = {
4070 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4073 static struct coef_fw coef0233[] = {
4074 WRITE_COEF(0x1b, 0x0c0b),
4075 WRITE_COEF(0x45, 0xc429),
4076 UPDATE_COEF(0x35, 0x4000, 0),
4077 WRITE_COEF(0x06, 0x2104),
4078 WRITE_COEF(0x1a, 0x0001),
4079 WRITE_COEF(0x26, 0x0004),
4080 WRITE_COEF(0x32, 0x42a3),
4083 static struct coef_fw coef0288[] = {
4084 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4085 UPDATE_COEF(0x50, 0x2000, 0x2000),
4086 UPDATE_COEF(0x56, 0x0006, 0x0006),
4087 UPDATE_COEF(0x66, 0x0008, 0),
4088 UPDATE_COEF(0x67, 0x2000, 0),
4091 static struct coef_fw coef0298[] = {
4092 UPDATE_COEF(0x19, 0x1300, 0x0300),
4095 static struct coef_fw coef0292[] = {
4096 WRITE_COEF(0x76, 0x000e),
4097 WRITE_COEF(0x6c, 0x2400),
4098 WRITE_COEF(0x18, 0x7308),
4099 WRITE_COEF(0x6b, 0xc429),
4102 static struct coef_fw coef0293[] = {
4103 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4104 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4105 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4106 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4107 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4108 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4111 static struct coef_fw coef0668[] = {
4112 WRITE_COEF(0x15, 0x0d40),
4113 WRITE_COEF(0xb7, 0x802b),
4116 static struct coef_fw coef0225[] = {
4117 UPDATE_COEF(0x63, 3<<14, 0),
4120 static struct coef_fw coef0274[] = {
4121 UPDATE_COEF(0x4a, 0x0100, 0),
4122 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4123 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4124 UPDATE_COEF(0x4a, 0x0010, 0),
4125 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4126 WRITE_COEF(0x45, 0x5289),
4127 UPDATE_COEF(0x4a, 0x0c00, 0),
4131 switch (codec->core.vendor_id) {
4133 alc_process_coef_fw(codec, coef0255_1);
4134 alc_process_coef_fw(codec, coef0255);
4138 alc_process_coef_fw(codec, coef0256);
4139 alc_process_coef_fw(codec, coef0255);
4144 alc_process_coef_fw(codec, coef0274);
4148 alc_process_coef_fw(codec, coef0233);
4152 alc_process_coef_fw(codec, coef0288);
4155 alc_process_coef_fw(codec, coef0298);
4156 alc_process_coef_fw(codec, coef0288);
4159 alc_process_coef_fw(codec, coef0292);
4162 alc_process_coef_fw(codec, coef0293);
4165 alc_process_coef_fw(codec, coef0668);
4173 alc_process_coef_fw(codec, alc225_pre_hsmode);
4174 alc_process_coef_fw(codec, coef0225);
4177 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4180 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4184 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4187 static struct coef_fw coef0255[] = {
4188 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4189 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4192 static struct coef_fw coef0233[] = {
4193 UPDATE_COEF(0x35, 0, 1<<14),
4194 WRITE_COEF(0x06, 0x2100),
4195 WRITE_COEF(0x1a, 0x0021),
4196 WRITE_COEF(0x26, 0x008c),
4199 static struct coef_fw coef0288[] = {
4200 UPDATE_COEF(0x4f, 0x00c0, 0),
4201 UPDATE_COEF(0x50, 0x2000, 0),
4202 UPDATE_COEF(0x56, 0x0006, 0),
4203 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4204 UPDATE_COEF(0x66, 0x0008, 0x0008),
4205 UPDATE_COEF(0x67, 0x2000, 0x2000),
4208 static struct coef_fw coef0292[] = {
4209 WRITE_COEF(0x19, 0xa208),
4210 WRITE_COEF(0x2e, 0xacf0),
4213 static struct coef_fw coef0293[] = {
4214 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4215 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4216 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4219 static struct coef_fw coef0688[] = {
4220 WRITE_COEF(0xb7, 0x802b),
4221 WRITE_COEF(0xb5, 0x1040),
4222 UPDATE_COEF(0xc3, 0, 1<<12),
4225 static struct coef_fw coef0225[] = {
4226 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4227 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4228 UPDATE_COEF(0x63, 3<<14, 0),
4231 static struct coef_fw coef0274[] = {
4232 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4233 UPDATE_COEF(0x4a, 0x0010, 0),
4234 UPDATE_COEF(0x6b, 0xf000, 0),
4238 switch (codec->core.vendor_id) {
4242 alc_write_coef_idx(codec, 0x45, 0xc489);
4243 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4244 alc_process_coef_fw(codec, coef0255);
4245 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4250 alc_write_coef_idx(codec, 0x45, 0x4689);
4251 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4252 alc_process_coef_fw(codec, coef0274);
4253 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4257 alc_write_coef_idx(codec, 0x45, 0xc429);
4258 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4259 alc_process_coef_fw(codec, coef0233);
4260 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4265 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4266 alc_process_coef_fw(codec, coef0288);
4267 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4270 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4271 alc_process_coef_fw(codec, coef0292);
4274 /* Set to TRS mode */
4275 alc_write_coef_idx(codec, 0x45, 0xc429);
4276 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4277 alc_process_coef_fw(codec, coef0293);
4278 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4281 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4285 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4286 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4289 alc_write_coef_idx(codec, 0x11, 0x0001);
4290 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4291 alc_process_coef_fw(codec, coef0688);
4292 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4300 alc_process_coef_fw(codec, alc225_pre_hsmode);
4301 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4302 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4303 alc_process_coef_fw(codec, coef0225);
4304 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4307 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4310 static void alc_headset_mode_default(struct hda_codec *codec)
4312 static struct coef_fw coef0225[] = {
4313 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4314 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4315 UPDATE_COEF(0x49, 3<<8, 0<<8),
4316 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4317 UPDATE_COEF(0x63, 3<<14, 0),
4318 UPDATE_COEF(0x67, 0xf000, 0x3000),
4321 static struct coef_fw coef0255[] = {
4322 WRITE_COEF(0x45, 0xc089),
4323 WRITE_COEF(0x45, 0xc489),
4324 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4325 WRITE_COEF(0x49, 0x0049),
4328 static struct coef_fw coef0233[] = {
4329 WRITE_COEF(0x06, 0x2100),
4330 WRITE_COEF(0x32, 0x4ea3),
4333 static struct coef_fw coef0288[] = {
4334 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4335 UPDATE_COEF(0x50, 0x2000, 0x2000),
4336 UPDATE_COEF(0x56, 0x0006, 0x0006),
4337 UPDATE_COEF(0x66, 0x0008, 0),
4338 UPDATE_COEF(0x67, 0x2000, 0),
4341 static struct coef_fw coef0292[] = {
4342 WRITE_COEF(0x76, 0x000e),
4343 WRITE_COEF(0x6c, 0x2400),
4344 WRITE_COEF(0x6b, 0xc429),
4345 WRITE_COEF(0x18, 0x7308),
4348 static struct coef_fw coef0293[] = {
4349 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4350 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4351 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4354 static struct coef_fw coef0688[] = {
4355 WRITE_COEF(0x11, 0x0041),
4356 WRITE_COEF(0x15, 0x0d40),
4357 WRITE_COEF(0xb7, 0x802b),
4360 static struct coef_fw coef0274[] = {
4361 WRITE_COEF(0x45, 0x4289),
4362 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4363 UPDATE_COEF(0x6b, 0x0f00, 0),
4364 UPDATE_COEF(0x49, 0x0300, 0x0300),
4368 switch (codec->core.vendor_id) {
4375 alc_process_coef_fw(codec, alc225_pre_hsmode);
4376 alc_process_coef_fw(codec, coef0225);
4381 alc_process_coef_fw(codec, coef0255);
4386 alc_process_coef_fw(codec, coef0274);
4390 alc_process_coef_fw(codec, coef0233);
4395 alc_process_coef_fw(codec, coef0288);
4398 alc_process_coef_fw(codec, coef0292);
4401 alc_process_coef_fw(codec, coef0293);
4404 alc_process_coef_fw(codec, coef0688);
4407 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4410 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4414 static void alc_headset_mode_ctia(struct hda_codec *codec)
4418 static struct coef_fw coef0255[] = {
4419 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4420 WRITE_COEF(0x1b, 0x0c2b),
4421 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4424 static struct coef_fw coef0256[] = {
4425 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4426 WRITE_COEF(0x1b, 0x0c6b),
4427 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4430 static struct coef_fw coef0233[] = {
4431 WRITE_COEF(0x45, 0xd429),
4432 WRITE_COEF(0x1b, 0x0c2b),
4433 WRITE_COEF(0x32, 0x4ea3),
4436 static struct coef_fw coef0288[] = {
4437 UPDATE_COEF(0x50, 0x2000, 0x2000),
4438 UPDATE_COEF(0x56, 0x0006, 0x0006),
4439 UPDATE_COEF(0x66, 0x0008, 0),
4440 UPDATE_COEF(0x67, 0x2000, 0),
4443 static struct coef_fw coef0292[] = {
4444 WRITE_COEF(0x6b, 0xd429),
4445 WRITE_COEF(0x76, 0x0008),
4446 WRITE_COEF(0x18, 0x7388),
4449 static struct coef_fw coef0293[] = {
4450 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4451 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4454 static struct coef_fw coef0688[] = {
4455 WRITE_COEF(0x11, 0x0001),
4456 WRITE_COEF(0x15, 0x0d60),
4457 WRITE_COEF(0xc3, 0x0000),
4460 static struct coef_fw coef0225_1[] = {
4461 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4462 UPDATE_COEF(0x63, 3<<14, 2<<14),
4465 static struct coef_fw coef0225_2[] = {
4466 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4467 UPDATE_COEF(0x63, 3<<14, 1<<14),
4471 switch (codec->core.vendor_id) {
4473 alc_process_coef_fw(codec, coef0255);
4477 alc_process_coef_fw(codec, coef0256);
4482 alc_write_coef_idx(codec, 0x45, 0xd689);
4486 alc_process_coef_fw(codec, coef0233);
4489 val = alc_read_coef_idx(codec, 0x50);
4490 if (val & (1 << 12)) {
4491 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4492 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4495 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4496 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4502 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4504 alc_process_coef_fw(codec, coef0288);
4507 alc_process_coef_fw(codec, coef0292);
4510 alc_process_coef_fw(codec, coef0293);
4513 alc_process_coef_fw(codec, coef0688);
4521 val = alc_read_coef_idx(codec, 0x45);
4523 alc_process_coef_fw(codec, coef0225_2);
4525 alc_process_coef_fw(codec, coef0225_1);
4528 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4531 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
4535 static void alc_headset_mode_omtp(struct hda_codec *codec)
4537 static struct coef_fw coef0255[] = {
4538 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4539 WRITE_COEF(0x1b, 0x0c2b),
4540 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4543 static struct coef_fw coef0256[] = {
4544 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4545 WRITE_COEF(0x1b, 0x0c6b),
4546 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4549 static struct coef_fw coef0233[] = {
4550 WRITE_COEF(0x45, 0xe429),
4551 WRITE_COEF(0x1b, 0x0c2b),
4552 WRITE_COEF(0x32, 0x4ea3),
4555 static struct coef_fw coef0288[] = {
4556 UPDATE_COEF(0x50, 0x2000, 0x2000),
4557 UPDATE_COEF(0x56, 0x0006, 0x0006),
4558 UPDATE_COEF(0x66, 0x0008, 0),
4559 UPDATE_COEF(0x67, 0x2000, 0),
4562 static struct coef_fw coef0292[] = {
4563 WRITE_COEF(0x6b, 0xe429),
4564 WRITE_COEF(0x76, 0x0008),
4565 WRITE_COEF(0x18, 0x7388),
4568 static struct coef_fw coef0293[] = {
4569 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4570 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4573 static struct coef_fw coef0688[] = {
4574 WRITE_COEF(0x11, 0x0001),
4575 WRITE_COEF(0x15, 0x0d50),
4576 WRITE_COEF(0xc3, 0x0000),
4579 static struct coef_fw coef0225[] = {
4580 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4581 UPDATE_COEF(0x63, 3<<14, 2<<14),
4585 switch (codec->core.vendor_id) {
4587 alc_process_coef_fw(codec, coef0255);
4591 alc_process_coef_fw(codec, coef0256);
4596 alc_write_coef_idx(codec, 0x45, 0xe689);
4600 alc_process_coef_fw(codec, coef0233);
4603 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4604 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4609 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4611 alc_process_coef_fw(codec, coef0288);
4614 alc_process_coef_fw(codec, coef0292);
4617 alc_process_coef_fw(codec, coef0293);
4620 alc_process_coef_fw(codec, coef0688);
4628 alc_process_coef_fw(codec, coef0225);
4631 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
4634 static void alc_determine_headset_type(struct hda_codec *codec)
4637 bool is_ctia = false;
4638 struct alc_spec *spec = codec->spec;
4639 static struct coef_fw coef0255[] = {
4640 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4641 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4645 static struct coef_fw coef0288[] = {
4646 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4649 static struct coef_fw coef0298[] = {
4650 UPDATE_COEF(0x50, 0x2000, 0x2000),
4651 UPDATE_COEF(0x56, 0x0006, 0x0006),
4652 UPDATE_COEF(0x66, 0x0008, 0),
4653 UPDATE_COEF(0x67, 0x2000, 0),
4654 UPDATE_COEF(0x19, 0x1300, 0x1300),
4657 static struct coef_fw coef0293[] = {
4658 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4659 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4662 static struct coef_fw coef0688[] = {
4663 WRITE_COEF(0x11, 0x0001),
4664 WRITE_COEF(0xb7, 0x802b),
4665 WRITE_COEF(0x15, 0x0d60),
4666 WRITE_COEF(0xc3, 0x0c00),
4669 static struct coef_fw coef0274[] = {
4670 UPDATE_COEF(0x4a, 0x0010, 0),
4671 UPDATE_COEF(0x4a, 0x8000, 0),
4672 WRITE_COEF(0x45, 0xd289),
4673 UPDATE_COEF(0x49, 0x0300, 0x0300),
4677 switch (codec->core.vendor_id) {
4681 alc_process_coef_fw(codec, coef0255);
4683 val = alc_read_coef_idx(codec, 0x46);
4684 is_ctia = (val & 0x0070) == 0x0070;
4689 alc_process_coef_fw(codec, coef0274);
4691 val = alc_read_coef_idx(codec, 0x46);
4692 is_ctia = (val & 0x00f0) == 0x00f0;
4696 alc_write_coef_idx(codec, 0x45, 0xd029);
4698 val = alc_read_coef_idx(codec, 0x46);
4699 is_ctia = (val & 0x0070) == 0x0070;
4702 snd_hda_codec_write(codec, 0x21, 0,
4703 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4705 snd_hda_codec_write(codec, 0x21, 0,
4706 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4709 val = alc_read_coef_idx(codec, 0x50);
4710 if (val & (1 << 12)) {
4711 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4712 alc_process_coef_fw(codec, coef0288);
4714 val = alc_read_coef_idx(codec, 0x50);
4715 is_ctia = (val & 0x0070) == 0x0070;
4717 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4718 alc_process_coef_fw(codec, coef0288);
4720 val = alc_read_coef_idx(codec, 0x50);
4721 is_ctia = (val & 0x0070) == 0x0070;
4723 alc_process_coef_fw(codec, coef0298);
4724 snd_hda_codec_write(codec, 0x21, 0,
4725 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
4727 snd_hda_codec_write(codec, 0x21, 0,
4728 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4732 alc_process_coef_fw(codec, coef0288);
4734 val = alc_read_coef_idx(codec, 0x50);
4735 is_ctia = (val & 0x0070) == 0x0070;
4738 alc_write_coef_idx(codec, 0x6b, 0xd429);
4740 val = alc_read_coef_idx(codec, 0x6c);
4741 is_ctia = (val & 0x001c) == 0x001c;
4744 alc_process_coef_fw(codec, coef0293);
4746 val = alc_read_coef_idx(codec, 0x46);
4747 is_ctia = (val & 0x0070) == 0x0070;
4750 alc_process_coef_fw(codec, coef0688);
4752 val = alc_read_coef_idx(codec, 0xbe);
4753 is_ctia = (val & 0x1c02) == 0x1c02;
4761 snd_hda_codec_write(codec, 0x21, 0,
4762 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4764 snd_hda_codec_write(codec, 0x21, 0,
4765 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4767 alc_process_coef_fw(codec, alc225_pre_hsmode);
4768 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
4769 val = alc_read_coef_idx(codec, 0x45);
4770 if (val & (1 << 9)) {
4771 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
4772 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
4774 val = alc_read_coef_idx(codec, 0x46);
4775 is_ctia = (val & 0x00f0) == 0x00f0;
4777 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
4778 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
4780 val = alc_read_coef_idx(codec, 0x46);
4781 is_ctia = (val & 0x00f0) == 0x00f0;
4783 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
4784 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
4785 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
4787 snd_hda_codec_write(codec, 0x21, 0,
4788 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
4790 snd_hda_codec_write(codec, 0x21, 0,
4791 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4798 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
4799 is_ctia ? "yes" : "no");
4800 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
4803 static void alc_update_headset_mode(struct hda_codec *codec)
4805 struct alc_spec *spec = codec->spec;
4807 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
4808 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4810 int new_headset_mode;
4812 if (!snd_hda_jack_detect(codec, hp_pin))
4813 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
4814 else if (mux_pin == spec->headset_mic_pin)
4815 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
4816 else if (mux_pin == spec->headphone_mic_pin)
4817 new_headset_mode = ALC_HEADSET_MODE_MIC;
4819 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
4821 if (new_headset_mode == spec->current_headset_mode) {
4822 snd_hda_gen_update_outputs(codec);
4826 switch (new_headset_mode) {
4827 case ALC_HEADSET_MODE_UNPLUGGED:
4828 alc_headset_mode_unplugged(codec);
4829 spec->gen.hp_jack_present = false;
4831 case ALC_HEADSET_MODE_HEADSET:
4832 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
4833 alc_determine_headset_type(codec);
4834 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
4835 alc_headset_mode_ctia(codec);
4836 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
4837 alc_headset_mode_omtp(codec);
4838 spec->gen.hp_jack_present = true;
4840 case ALC_HEADSET_MODE_MIC:
4841 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
4842 spec->gen.hp_jack_present = false;
4844 case ALC_HEADSET_MODE_HEADPHONE:
4845 alc_headset_mode_default(codec);
4846 spec->gen.hp_jack_present = true;
4849 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
4850 snd_hda_set_pin_ctl_cache(codec, hp_pin,
4851 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
4852 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
4853 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
4856 spec->current_headset_mode = new_headset_mode;
4858 snd_hda_gen_update_outputs(codec);
4861 static void alc_update_headset_mode_hook(struct hda_codec *codec,
4862 struct snd_kcontrol *kcontrol,
4863 struct snd_ctl_elem_value *ucontrol)
4865 alc_update_headset_mode(codec);
4868 static void alc_update_headset_jack_cb(struct hda_codec *codec,
4869 struct hda_jack_callback *jack)
4871 struct alc_spec *spec = codec->spec;
4872 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
4873 snd_hda_gen_hp_automute(codec, jack);
4876 static void alc_probe_headset_mode(struct hda_codec *codec)
4879 struct alc_spec *spec = codec->spec;
4880 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
4883 for (i = 0; i < cfg->num_inputs; i++) {
4884 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
4885 spec->headset_mic_pin = cfg->inputs[i].pin;
4886 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
4887 spec->headphone_mic_pin = cfg->inputs[i].pin;
4890 WARN_ON(spec->gen.cap_sync_hook);
4891 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
4892 spec->gen.automute_hook = alc_update_headset_mode;
4893 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
4896 static void alc_fixup_headset_mode(struct hda_codec *codec,
4897 const struct hda_fixup *fix, int action)
4899 struct alc_spec *spec = codec->spec;
4902 case HDA_FIXUP_ACT_PRE_PROBE:
4903 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
4905 case HDA_FIXUP_ACT_PROBE:
4906 alc_probe_headset_mode(codec);
4908 case HDA_FIXUP_ACT_INIT:
4909 spec->current_headset_mode = 0;
4910 alc_update_headset_mode(codec);
4915 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
4916 const struct hda_fixup *fix, int action)
4918 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4919 struct alc_spec *spec = codec->spec;
4920 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4923 alc_fixup_headset_mode(codec, fix, action);
4926 static void alc255_set_default_jack_type(struct hda_codec *codec)
4928 /* Set to iphone type */
4929 static struct coef_fw alc255fw[] = {
4930 WRITE_COEF(0x1b, 0x880b),
4931 WRITE_COEF(0x45, 0xd089),
4932 WRITE_COEF(0x1b, 0x080b),
4933 WRITE_COEF(0x46, 0x0004),
4934 WRITE_COEF(0x1b, 0x0c0b),
4937 static struct coef_fw alc256fw[] = {
4938 WRITE_COEF(0x1b, 0x884b),
4939 WRITE_COEF(0x45, 0xd089),
4940 WRITE_COEF(0x1b, 0x084b),
4941 WRITE_COEF(0x46, 0x0004),
4942 WRITE_COEF(0x1b, 0x0c4b),
4945 switch (codec->core.vendor_id) {
4947 alc_process_coef_fw(codec, alc255fw);
4951 alc_process_coef_fw(codec, alc256fw);
4957 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
4958 const struct hda_fixup *fix, int action)
4960 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4961 alc255_set_default_jack_type(codec);
4963 alc_fixup_headset_mode(codec, fix, action);
4966 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
4967 const struct hda_fixup *fix, int action)
4969 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4970 struct alc_spec *spec = codec->spec;
4971 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4972 alc255_set_default_jack_type(codec);
4975 alc_fixup_headset_mode(codec, fix, action);
4978 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
4979 struct hda_jack_callback *jack)
4981 struct alc_spec *spec = codec->spec;
4983 alc_update_headset_jack_cb(codec, jack);
4984 /* Headset Mic enable or disable, only for Dell Dino */
4985 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
4988 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
4989 const struct hda_fixup *fix, int action)
4991 alc_fixup_headset_mode(codec, fix, action);
4992 if (action == HDA_FIXUP_ACT_PROBE) {
4993 struct alc_spec *spec = codec->spec;
4994 /* toggled via hp_automute_hook */
4995 spec->gpio_mask |= 0x40;
4996 spec->gpio_dir |= 0x40;
4997 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5001 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5002 const struct hda_fixup *fix, int action)
5004 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5005 struct alc_spec *spec = codec->spec;
5006 spec->gen.auto_mute_via_amp = 1;
5010 static void alc_no_shutup(struct hda_codec *codec)
5014 static void alc_fixup_no_shutup(struct hda_codec *codec,
5015 const struct hda_fixup *fix, int action)
5017 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5018 struct alc_spec *spec = codec->spec;
5019 spec->shutup = alc_no_shutup;
5023 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5024 const struct hda_fixup *fix, int action)
5026 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5027 struct alc_spec *spec = codec->spec;
5028 /* Disable AA-loopback as it causes white noise */
5029 spec->gen.mixer_nid = 0;
5033 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5034 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5035 const struct hda_fixup *fix, int action)
5037 static const struct hda_pintbl pincfgs[] = {
5038 { 0x16, 0x21211010 }, /* dock headphone */
5039 { 0x19, 0x21a11010 }, /* dock mic */
5042 struct alc_spec *spec = codec->spec;
5044 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5045 spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */
5046 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5047 codec->power_save_node = 0; /* avoid click noises */
5048 snd_hda_apply_pincfgs(codec, pincfgs);
5052 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5053 const struct hda_fixup *fix, int action)
5055 static const struct hda_pintbl pincfgs[] = {
5056 { 0x17, 0x21211010 }, /* dock headphone */
5057 { 0x19, 0x21a11010 }, /* dock mic */
5060 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5061 * the speaker output becomes too low by some reason on Thinkpads with
5064 static hda_nid_t preferred_pairs[] = {
5065 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5068 struct alc_spec *spec = codec->spec;
5070 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5071 spec->gen.preferred_dacs = preferred_pairs;
5072 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5073 snd_hda_apply_pincfgs(codec, pincfgs);
5074 } else if (action == HDA_FIXUP_ACT_INIT) {
5075 /* Enable DOCK device */
5076 snd_hda_codec_write(codec, 0x17, 0,
5077 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5078 /* Enable DOCK device */
5079 snd_hda_codec_write(codec, 0x19, 0,
5080 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5084 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5086 struct alc_spec *spec = codec->spec;
5087 int hp_pin = alc_get_hp_pin(spec);
5089 /* Prevent pop noises when headphones are plugged in */
5090 snd_hda_codec_write(codec, hp_pin, 0,
5091 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5095 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5096 const struct hda_fixup *fix, int action)
5098 struct alc_spec *spec = codec->spec;
5099 struct hda_input_mux *imux = &spec->gen.input_mux;
5103 case HDA_FIXUP_ACT_PRE_PROBE:
5104 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5105 * it causes a click noise at start up
5107 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5108 spec->shutup = alc_shutup_dell_xps13;
5110 case HDA_FIXUP_ACT_PROBE:
5111 /* Make the internal mic the default input source. */
5112 for (i = 0; i < imux->num_items; i++) {
5113 if (spec->gen.imux_pins[i] == 0x12) {
5114 spec->gen.cur_mux[0] = i;
5122 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5123 const struct hda_fixup *fix, int action)
5125 struct alc_spec *spec = codec->spec;
5127 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5128 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5129 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5131 /* Disable boost for mic-in permanently. (This code is only called
5132 from quirks that guarantee that the headphone is at NID 0x1b.) */
5133 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5134 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5136 alc_fixup_headset_mode(codec, fix, action);
5139 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5140 const struct hda_fixup *fix, int action)
5142 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5143 alc_write_coef_idx(codec, 0xc4, 0x8000);
5144 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5145 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5147 alc_fixup_headset_mode(codec, fix, action);
5150 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5151 static int find_ext_mic_pin(struct hda_codec *codec)
5153 struct alc_spec *spec = codec->spec;
5154 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5156 unsigned int defcfg;
5159 for (i = 0; i < cfg->num_inputs; i++) {
5160 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5162 nid = cfg->inputs[i].pin;
5163 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5164 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5172 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5173 const struct hda_fixup *fix,
5176 struct alc_spec *spec = codec->spec;
5178 if (action == HDA_FIXUP_ACT_PROBE) {
5179 int mic_pin = find_ext_mic_pin(codec);
5180 int hp_pin = alc_get_hp_pin(spec);
5182 if (snd_BUG_ON(!mic_pin || !hp_pin))
5184 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5188 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5189 const struct hda_fixup *fix,
5192 struct alc_spec *spec = codec->spec;
5193 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5196 /* The mic boosts on level 2 and 3 are too noisy
5197 on the internal mic input.
5198 Therefore limit the boost to 0 or 1. */
5200 if (action != HDA_FIXUP_ACT_PROBE)
5203 for (i = 0; i < cfg->num_inputs; i++) {
5204 hda_nid_t nid = cfg->inputs[i].pin;
5205 unsigned int defcfg;
5206 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5208 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5209 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5212 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5213 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5214 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5215 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5216 (0 << AC_AMPCAP_MUTE_SHIFT));
5220 static void alc283_hp_automute_hook(struct hda_codec *codec,
5221 struct hda_jack_callback *jack)
5223 struct alc_spec *spec = codec->spec;
5227 snd_hda_gen_hp_automute(codec, jack);
5229 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5232 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5236 static void alc283_fixup_chromebook(struct hda_codec *codec,
5237 const struct hda_fixup *fix, int action)
5239 struct alc_spec *spec = codec->spec;
5242 case HDA_FIXUP_ACT_PRE_PROBE:
5243 snd_hda_override_wcaps(codec, 0x03, 0);
5244 /* Disable AA-loopback as it causes white noise */
5245 spec->gen.mixer_nid = 0;
5247 case HDA_FIXUP_ACT_INIT:
5248 /* MIC2-VREF control */
5249 /* Set to manual mode */
5250 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5251 /* Enable Line1 input control by verb */
5252 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5257 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5258 const struct hda_fixup *fix, int action)
5260 struct alc_spec *spec = codec->spec;
5263 case HDA_FIXUP_ACT_PRE_PROBE:
5264 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5266 case HDA_FIXUP_ACT_INIT:
5267 /* MIC2-VREF control */
5268 /* Set to manual mode */
5269 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5274 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5275 static void asus_tx300_automute(struct hda_codec *codec)
5277 struct alc_spec *spec = codec->spec;
5278 snd_hda_gen_update_outputs(codec);
5279 if (snd_hda_jack_detect(codec, 0x1b))
5280 spec->gen.mute_bits |= (1ULL << 0x14);
5283 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5284 const struct hda_fixup *fix, int action)
5286 struct alc_spec *spec = codec->spec;
5287 static const struct hda_pintbl dock_pins[] = {
5288 { 0x1b, 0x21114000 }, /* dock speaker pin */
5293 case HDA_FIXUP_ACT_PRE_PROBE:
5294 spec->init_amp = ALC_INIT_DEFAULT;
5295 /* TX300 needs to set up GPIO2 for the speaker amp */
5296 alc_setup_gpio(codec, 0x04);
5297 snd_hda_apply_pincfgs(codec, dock_pins);
5298 spec->gen.auto_mute_via_amp = 1;
5299 spec->gen.automute_hook = asus_tx300_automute;
5300 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5301 snd_hda_gen_hp_automute);
5303 case HDA_FIXUP_ACT_PROBE:
5304 spec->init_amp = ALC_INIT_DEFAULT;
5306 case HDA_FIXUP_ACT_BUILD:
5307 /* this is a bit tricky; give more sane names for the main
5308 * (tablet) speaker and the dock speaker, respectively
5310 rename_ctl(codec, "Speaker Playback Switch",
5311 "Dock Speaker Playback Switch");
5312 rename_ctl(codec, "Bass Speaker Playback Switch",
5313 "Speaker Playback Switch");
5318 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5319 const struct hda_fixup *fix, int action)
5321 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5322 /* DAC node 0x03 is giving mono output. We therefore want to
5323 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5324 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5325 hda_nid_t conn1[2] = { 0x0c };
5326 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
5327 snd_hda_override_conn_list(codec, 0x15, 1, conn1);
5331 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5332 const struct hda_fixup *fix, int action)
5334 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5335 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5336 we can't adjust the speaker's volume since this node does not has
5337 Amp-out capability. we change the speaker's route to:
5338 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5339 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5340 speaker's volume now. */
5342 hda_nid_t conn1[1] = { 0x0c };
5343 snd_hda_override_conn_list(codec, 0x17, 1, conn1);
5347 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5348 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5349 const struct hda_fixup *fix, int action)
5351 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5352 hda_nid_t conn[2] = { 0x02, 0x03 };
5353 snd_hda_override_conn_list(codec, 0x17, 2, conn);
5357 /* Hook to update amp GPIO4 for automute */
5358 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5359 struct hda_jack_callback *jack)
5361 struct alc_spec *spec = codec->spec;
5363 snd_hda_gen_hp_automute(codec, jack);
5364 /* mute_led_polarity is set to 0, so we pass inverted value here */
5365 alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present);
5368 /* Manage GPIOs for HP EliteBook Folio 9480m.
5370 * GPIO4 is the headphone amplifier power control
5371 * GPIO3 is the audio output mute indicator LED
5374 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5375 const struct hda_fixup *fix,
5378 struct alc_spec *spec = codec->spec;
5380 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5381 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5382 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5383 spec->gpio_mask |= 0x10;
5384 spec->gpio_dir |= 0x10;
5385 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5389 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5390 const struct hda_fixup *fix,
5393 struct alc_spec *spec = codec->spec;
5395 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5396 spec->gpio_mask |= 0x04;
5397 spec->gpio_dir |= 0x04;
5398 /* set data bit low */
5402 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5403 const struct hda_fixup *fix,
5406 alc_fixup_dual_codecs(codec, fix, action);
5408 case HDA_FIXUP_ACT_PRE_PROBE:
5409 /* override card longname to provide a unique UCM profile */
5410 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5412 case HDA_FIXUP_ACT_BUILD:
5413 /* rename Capture controls depending on the codec */
5414 rename_ctl(codec, "Capture Volume",
5416 "Rear-Panel Capture Volume" :
5417 "Front-Panel Capture Volume");
5418 rename_ctl(codec, "Capture Switch",
5420 "Rear-Panel Capture Switch" :
5421 "Front-Panel Capture Switch");
5426 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5427 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
5428 const struct hda_fixup *fix, int action)
5430 struct alc_spec *spec = codec->spec;
5431 static hda_nid_t preferred_pairs[] = {
5432 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5436 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5439 spec->gen.preferred_dacs = preferred_pairs;
5442 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5443 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5444 const struct hda_fixup *fix, int action)
5446 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5449 snd_hda_override_wcaps(codec, 0x03, 0);
5452 static const struct hda_jack_keymap alc_headset_btn_keymap[] = {
5453 { SND_JACK_BTN_0, KEY_PLAYPAUSE },
5454 { SND_JACK_BTN_1, KEY_VOICECOMMAND },
5455 { SND_JACK_BTN_2, KEY_VOLUMEUP },
5456 { SND_JACK_BTN_3, KEY_VOLUMEDOWN },
5460 static void alc_headset_btn_callback(struct hda_codec *codec,
5461 struct hda_jack_callback *jack)
5465 if (jack->unsol_res & (7 << 13))
5466 report |= SND_JACK_BTN_0;
5468 if (jack->unsol_res & (1 << 16 | 3 << 8))
5469 report |= SND_JACK_BTN_1;
5472 if (jack->unsol_res & (7 << 23))
5473 report |= SND_JACK_BTN_2;
5475 /* Volume down key */
5476 if (jack->unsol_res & (7 << 10))
5477 report |= SND_JACK_BTN_3;
5479 jack->jack->button_state = report;
5482 static void alc_fixup_headset_jack(struct hda_codec *codec,
5483 const struct hda_fixup *fix, int action)
5487 case HDA_FIXUP_ACT_PRE_PROBE:
5488 snd_hda_jack_detect_enable_callback(codec, 0x55,
5489 alc_headset_btn_callback);
5490 snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false,
5491 SND_JACK_HEADSET, alc_headset_btn_keymap);
5493 case HDA_FIXUP_ACT_INIT:
5494 switch (codec->core.vendor_id) {
5498 alc_write_coef_idx(codec, 0x48, 0xd011);
5499 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
5500 alc_update_coef_idx(codec, 0x44, 0x007f << 8, 0x0045 << 8);
5504 alc_write_coef_idx(codec, 0x48, 0xd011);
5505 alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
5512 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
5513 const struct hda_fixup *fix, int action)
5515 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5516 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5519 /* for hda_fixup_thinkpad_acpi() */
5520 #include "thinkpad_helper.c"
5522 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5523 const struct hda_fixup *fix, int action)
5525 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5526 hda_fixup_thinkpad_acpi(codec, fix, action);
5529 /* for alc295_fixup_hp_top_speakers */
5530 #include "hp_x360_helper.c"
5533 ALC269_FIXUP_SONY_VAIO,
5534 ALC275_FIXUP_SONY_VAIO_GPIO2,
5535 ALC269_FIXUP_DELL_M101Z,
5536 ALC269_FIXUP_SKU_IGNORE,
5537 ALC269_FIXUP_ASUS_G73JW,
5538 ALC269_FIXUP_LENOVO_EAPD,
5539 ALC275_FIXUP_SONY_HWEQ,
5540 ALC275_FIXUP_SONY_DISABLE_AAMIX,
5542 ALC269_FIXUP_PCM_44K,
5543 ALC269_FIXUP_STEREO_DMIC,
5544 ALC269_FIXUP_HEADSET_MIC,
5545 ALC269_FIXUP_QUANTA_MUTE,
5546 ALC269_FIXUP_LIFEBOOK,
5547 ALC269_FIXUP_LIFEBOOK_EXTMIC,
5548 ALC269_FIXUP_LIFEBOOK_HP_PIN,
5549 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5550 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
5553 ALC269VB_FIXUP_AMIC,
5554 ALC269VB_FIXUP_DMIC,
5555 ALC269_FIXUP_HP_MUTE_LED,
5556 ALC269_FIXUP_HP_MUTE_LED_MIC1,
5557 ALC269_FIXUP_HP_MUTE_LED_MIC2,
5558 ALC269_FIXUP_HP_MUTE_LED_MIC3,
5559 ALC269_FIXUP_HP_GPIO_LED,
5560 ALC269_FIXUP_HP_GPIO_MIC1_LED,
5561 ALC269_FIXUP_HP_LINE1_MIC1_LED,
5562 ALC269_FIXUP_INV_DMIC,
5563 ALC269_FIXUP_LENOVO_DOCK,
5564 ALC269_FIXUP_NO_SHUTUP,
5565 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
5566 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
5567 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5568 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
5569 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5570 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
5571 ALC269_FIXUP_HEADSET_MODE,
5572 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
5573 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
5574 ALC269_FIXUP_ASUS_X101_FUNC,
5575 ALC269_FIXUP_ASUS_X101_VERB,
5576 ALC269_FIXUP_ASUS_X101,
5577 ALC271_FIXUP_AMIC_MIC2,
5578 ALC271_FIXUP_HP_GATE_MIC_JACK,
5579 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
5580 ALC269_FIXUP_ACER_AC700,
5581 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
5582 ALC269VB_FIXUP_ASUS_ZENBOOK,
5583 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
5584 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
5585 ALC269VB_FIXUP_ORDISSIMO_EVE2,
5586 ALC283_FIXUP_CHROME_BOOK,
5587 ALC283_FIXUP_SENSE_COMBO_JACK,
5588 ALC282_FIXUP_ASUS_TX300,
5589 ALC283_FIXUP_INT_MIC,
5590 ALC290_FIXUP_MONO_SPEAKERS,
5591 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
5592 ALC290_FIXUP_SUBWOOFER,
5593 ALC290_FIXUP_SUBWOOFER_HSJACK,
5594 ALC269_FIXUP_THINKPAD_ACPI,
5595 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5596 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
5597 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
5598 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5599 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
5600 ALC255_FIXUP_HEADSET_MODE,
5601 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
5602 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5603 ALC292_FIXUP_TPT440_DOCK,
5604 ALC292_FIXUP_TPT440,
5605 ALC283_FIXUP_HEADSET_MIC,
5606 ALC255_FIXUP_MIC_MUTE_LED,
5607 ALC282_FIXUP_ASPIRE_V5_PINS,
5608 ALC280_FIXUP_HP_GPIO4,
5609 ALC286_FIXUP_HP_GPIO_LED,
5610 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
5611 ALC280_FIXUP_HP_DOCK_PINS,
5612 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
5613 ALC280_FIXUP_HP_9480M,
5614 ALC288_FIXUP_DELL_HEADSET_MODE,
5615 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
5616 ALC288_FIXUP_DELL_XPS_13,
5617 ALC288_FIXUP_DISABLE_AAMIX,
5618 ALC292_FIXUP_DELL_E7X,
5619 ALC292_FIXUP_DISABLE_AAMIX,
5620 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
5621 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
5622 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
5623 ALC275_FIXUP_DELL_XPS,
5624 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE,
5625 ALC293_FIXUP_LENOVO_SPK_NOISE,
5626 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
5627 ALC255_FIXUP_DELL_SPK_NOISE,
5628 ALC225_FIXUP_DISABLE_MIC_VREF,
5629 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
5630 ALC295_FIXUP_DISABLE_DAC3,
5631 ALC280_FIXUP_HP_HEADSET_MIC,
5632 ALC221_FIXUP_HP_FRONT_MIC,
5633 ALC292_FIXUP_TPT460,
5634 ALC298_FIXUP_SPK_VOLUME,
5635 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
5636 ALC269_FIXUP_ATIV_BOOK_8,
5637 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
5638 ALC256_FIXUP_ASUS_HEADSET_MODE,
5639 ALC256_FIXUP_ASUS_MIC,
5640 ALC256_FIXUP_ASUS_AIO_GPIO2,
5641 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
5642 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
5643 ALC233_FIXUP_LENOVO_MULTI_CODECS,
5644 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5645 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
5646 ALC700_FIXUP_INTEL_REFERENCE,
5647 ALC274_FIXUP_DELL_BIND_DACS,
5648 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
5649 ALC298_FIXUP_TPT470_DOCK,
5650 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
5651 ALC255_FIXUP_DELL_HEADSET_MIC,
5652 ALC256_FIXUP_HUAWEI_MBXP_PINS,
5653 ALC295_FIXUP_HP_X360,
5654 ALC221_FIXUP_HP_HEADSET_MIC,
5655 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
5656 ALC295_FIXUP_HP_AUTO_MUTE,
5657 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
5658 ALC294_FIXUP_ASUS_MIC,
5659 ALC294_FIXUP_ASUS_HEADSET_MIC,
5660 ALC294_FIXUP_ASUS_SPK,
5661 ALC225_FIXUP_HEADSET_JACK,
5662 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
5663 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
5666 static const struct hda_fixup alc269_fixups[] = {
5667 [ALC269_FIXUP_SONY_VAIO] = {
5668 .type = HDA_FIXUP_PINCTLS,
5669 .v.pins = (const struct hda_pintbl[]) {
5670 {0x19, PIN_VREFGRD},
5674 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
5675 .type = HDA_FIXUP_FUNC,
5676 .v.func = alc275_fixup_gpio4_off,
5678 .chain_id = ALC269_FIXUP_SONY_VAIO
5680 [ALC269_FIXUP_DELL_M101Z] = {
5681 .type = HDA_FIXUP_VERBS,
5682 .v.verbs = (const struct hda_verb[]) {
5683 /* Enables internal speaker */
5684 {0x20, AC_VERB_SET_COEF_INDEX, 13},
5685 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
5689 [ALC269_FIXUP_SKU_IGNORE] = {
5690 .type = HDA_FIXUP_FUNC,
5691 .v.func = alc_fixup_sku_ignore,
5693 [ALC269_FIXUP_ASUS_G73JW] = {
5694 .type = HDA_FIXUP_PINS,
5695 .v.pins = (const struct hda_pintbl[]) {
5696 { 0x17, 0x99130111 }, /* subwoofer */
5700 [ALC269_FIXUP_LENOVO_EAPD] = {
5701 .type = HDA_FIXUP_VERBS,
5702 .v.verbs = (const struct hda_verb[]) {
5703 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
5707 [ALC275_FIXUP_SONY_HWEQ] = {
5708 .type = HDA_FIXUP_FUNC,
5709 .v.func = alc269_fixup_hweq,
5711 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
5713 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
5714 .type = HDA_FIXUP_FUNC,
5715 .v.func = alc_fixup_disable_aamix,
5717 .chain_id = ALC269_FIXUP_SONY_VAIO
5719 [ALC271_FIXUP_DMIC] = {
5720 .type = HDA_FIXUP_FUNC,
5721 .v.func = alc271_fixup_dmic,
5723 [ALC269_FIXUP_PCM_44K] = {
5724 .type = HDA_FIXUP_FUNC,
5725 .v.func = alc269_fixup_pcm_44k,
5727 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5729 [ALC269_FIXUP_STEREO_DMIC] = {
5730 .type = HDA_FIXUP_FUNC,
5731 .v.func = alc269_fixup_stereo_dmic,
5733 [ALC269_FIXUP_HEADSET_MIC] = {
5734 .type = HDA_FIXUP_FUNC,
5735 .v.func = alc269_fixup_headset_mic,
5737 [ALC269_FIXUP_QUANTA_MUTE] = {
5738 .type = HDA_FIXUP_FUNC,
5739 .v.func = alc269_fixup_quanta_mute,
5741 [ALC269_FIXUP_LIFEBOOK] = {
5742 .type = HDA_FIXUP_PINS,
5743 .v.pins = (const struct hda_pintbl[]) {
5744 { 0x1a, 0x2101103f }, /* dock line-out */
5745 { 0x1b, 0x23a11040 }, /* dock mic-in */
5749 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5751 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
5752 .type = HDA_FIXUP_PINS,
5753 .v.pins = (const struct hda_pintbl[]) {
5754 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5758 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
5759 .type = HDA_FIXUP_PINS,
5760 .v.pins = (const struct hda_pintbl[]) {
5761 { 0x21, 0x0221102f }, /* HP out */
5765 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
5766 .type = HDA_FIXUP_FUNC,
5767 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5769 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
5770 .type = HDA_FIXUP_FUNC,
5771 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
5773 [ALC269_FIXUP_AMIC] = {
5774 .type = HDA_FIXUP_PINS,
5775 .v.pins = (const struct hda_pintbl[]) {
5776 { 0x14, 0x99130110 }, /* speaker */
5777 { 0x15, 0x0121401f }, /* HP out */
5778 { 0x18, 0x01a19c20 }, /* mic */
5779 { 0x19, 0x99a3092f }, /* int-mic */
5783 [ALC269_FIXUP_DMIC] = {
5784 .type = HDA_FIXUP_PINS,
5785 .v.pins = (const struct hda_pintbl[]) {
5786 { 0x12, 0x99a3092f }, /* int-mic */
5787 { 0x14, 0x99130110 }, /* speaker */
5788 { 0x15, 0x0121401f }, /* HP out */
5789 { 0x18, 0x01a19c20 }, /* mic */
5793 [ALC269VB_FIXUP_AMIC] = {
5794 .type = HDA_FIXUP_PINS,
5795 .v.pins = (const struct hda_pintbl[]) {
5796 { 0x14, 0x99130110 }, /* speaker */
5797 { 0x18, 0x01a19c20 }, /* mic */
5798 { 0x19, 0x99a3092f }, /* int-mic */
5799 { 0x21, 0x0121401f }, /* HP out */
5803 [ALC269VB_FIXUP_DMIC] = {
5804 .type = HDA_FIXUP_PINS,
5805 .v.pins = (const struct hda_pintbl[]) {
5806 { 0x12, 0x99a3092f }, /* int-mic */
5807 { 0x14, 0x99130110 }, /* speaker */
5808 { 0x18, 0x01a19c20 }, /* mic */
5809 { 0x21, 0x0121401f }, /* HP out */
5813 [ALC269_FIXUP_HP_MUTE_LED] = {
5814 .type = HDA_FIXUP_FUNC,
5815 .v.func = alc269_fixup_hp_mute_led,
5817 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
5818 .type = HDA_FIXUP_FUNC,
5819 .v.func = alc269_fixup_hp_mute_led_mic1,
5821 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
5822 .type = HDA_FIXUP_FUNC,
5823 .v.func = alc269_fixup_hp_mute_led_mic2,
5825 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
5826 .type = HDA_FIXUP_FUNC,
5827 .v.func = alc269_fixup_hp_mute_led_mic3,
5829 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
5831 [ALC269_FIXUP_HP_GPIO_LED] = {
5832 .type = HDA_FIXUP_FUNC,
5833 .v.func = alc269_fixup_hp_gpio_led,
5835 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
5836 .type = HDA_FIXUP_FUNC,
5837 .v.func = alc269_fixup_hp_gpio_mic1_led,
5839 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
5840 .type = HDA_FIXUP_FUNC,
5841 .v.func = alc269_fixup_hp_line1_mic1_led,
5843 [ALC269_FIXUP_INV_DMIC] = {
5844 .type = HDA_FIXUP_FUNC,
5845 .v.func = alc_fixup_inv_dmic,
5847 [ALC269_FIXUP_NO_SHUTUP] = {
5848 .type = HDA_FIXUP_FUNC,
5849 .v.func = alc_fixup_no_shutup,
5851 [ALC269_FIXUP_LENOVO_DOCK] = {
5852 .type = HDA_FIXUP_PINS,
5853 .v.pins = (const struct hda_pintbl[]) {
5854 { 0x19, 0x23a11040 }, /* dock mic */
5855 { 0x1b, 0x2121103f }, /* dock headphone */
5859 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5861 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
5862 .type = HDA_FIXUP_FUNC,
5863 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5865 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
5867 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
5868 .type = HDA_FIXUP_PINS,
5869 .v.pins = (const struct hda_pintbl[]) {
5870 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5871 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5875 .chain_id = ALC269_FIXUP_HEADSET_MODE
5877 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
5878 .type = HDA_FIXUP_PINS,
5879 .v.pins = (const struct hda_pintbl[]) {
5880 { 0x16, 0x21014020 }, /* dock line out */
5881 { 0x19, 0x21a19030 }, /* dock mic */
5882 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5886 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5888 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
5889 .type = HDA_FIXUP_PINS,
5890 .v.pins = (const struct hda_pintbl[]) {
5891 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5895 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5897 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
5898 .type = HDA_FIXUP_PINS,
5899 .v.pins = (const struct hda_pintbl[]) {
5900 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5901 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5905 .chain_id = ALC269_FIXUP_HEADSET_MODE
5907 [ALC269_FIXUP_HEADSET_MODE] = {
5908 .type = HDA_FIXUP_FUNC,
5909 .v.func = alc_fixup_headset_mode,
5911 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
5913 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
5914 .type = HDA_FIXUP_FUNC,
5915 .v.func = alc_fixup_headset_mode_no_hp_mic,
5917 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
5918 .type = HDA_FIXUP_PINS,
5919 .v.pins = (const struct hda_pintbl[]) {
5920 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5924 .chain_id = ALC269_FIXUP_HEADSET_MODE,
5926 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
5927 .type = HDA_FIXUP_PINS,
5928 .v.pins = (const struct hda_pintbl[]) {
5929 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5933 .chain_id = ALC269_FIXUP_HEADSET_MIC
5935 [ALC256_FIXUP_HUAWEI_MBXP_PINS] = {
5936 .type = HDA_FIXUP_PINS,
5937 .v.pins = (const struct hda_pintbl[]) {
5951 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
5953 [ALC269_FIXUP_ASUS_X101_FUNC] = {
5954 .type = HDA_FIXUP_FUNC,
5955 .v.func = alc269_fixup_x101_headset_mic,
5957 [ALC269_FIXUP_ASUS_X101_VERB] = {
5958 .type = HDA_FIXUP_VERBS,
5959 .v.verbs = (const struct hda_verb[]) {
5960 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5961 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
5962 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
5966 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
5968 [ALC269_FIXUP_ASUS_X101] = {
5969 .type = HDA_FIXUP_PINS,
5970 .v.pins = (const struct hda_pintbl[]) {
5971 { 0x18, 0x04a1182c }, /* Headset mic */
5975 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
5977 [ALC271_FIXUP_AMIC_MIC2] = {
5978 .type = HDA_FIXUP_PINS,
5979 .v.pins = (const struct hda_pintbl[]) {
5980 { 0x14, 0x99130110 }, /* speaker */
5981 { 0x19, 0x01a19c20 }, /* mic */
5982 { 0x1b, 0x99a7012f }, /* int-mic */
5983 { 0x21, 0x0121401f }, /* HP out */
5987 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
5988 .type = HDA_FIXUP_FUNC,
5989 .v.func = alc271_hp_gate_mic_jack,
5991 .chain_id = ALC271_FIXUP_AMIC_MIC2,
5993 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
5994 .type = HDA_FIXUP_FUNC,
5995 .v.func = alc269_fixup_limit_int_mic_boost,
5997 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
5999 [ALC269_FIXUP_ACER_AC700] = {
6000 .type = HDA_FIXUP_PINS,
6001 .v.pins = (const struct hda_pintbl[]) {
6002 { 0x12, 0x99a3092f }, /* int-mic */
6003 { 0x14, 0x99130110 }, /* speaker */
6004 { 0x18, 0x03a11c20 }, /* mic */
6005 { 0x1e, 0x0346101e }, /* SPDIF1 */
6006 { 0x21, 0x0321101f }, /* HP out */
6010 .chain_id = ALC271_FIXUP_DMIC,
6012 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6013 .type = HDA_FIXUP_FUNC,
6014 .v.func = alc269_fixup_limit_int_mic_boost,
6016 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6018 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6019 .type = HDA_FIXUP_FUNC,
6020 .v.func = alc269_fixup_limit_int_mic_boost,
6022 .chain_id = ALC269VB_FIXUP_DMIC,
6024 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6025 .type = HDA_FIXUP_VERBS,
6026 .v.verbs = (const struct hda_verb[]) {
6027 /* class-D output amp +5dB */
6028 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6029 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6033 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6035 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6036 .type = HDA_FIXUP_FUNC,
6037 .v.func = alc269_fixup_limit_int_mic_boost,
6039 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6041 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6042 .type = HDA_FIXUP_PINS,
6043 .v.pins = (const struct hda_pintbl[]) {
6044 { 0x12, 0x99a3092f }, /* int-mic */
6045 { 0x18, 0x03a11d20 }, /* mic */
6046 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6050 [ALC283_FIXUP_CHROME_BOOK] = {
6051 .type = HDA_FIXUP_FUNC,
6052 .v.func = alc283_fixup_chromebook,
6054 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6055 .type = HDA_FIXUP_FUNC,
6056 .v.func = alc283_fixup_sense_combo_jack,
6058 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6060 [ALC282_FIXUP_ASUS_TX300] = {
6061 .type = HDA_FIXUP_FUNC,
6062 .v.func = alc282_fixup_asus_tx300,
6064 [ALC283_FIXUP_INT_MIC] = {
6065 .type = HDA_FIXUP_VERBS,
6066 .v.verbs = (const struct hda_verb[]) {
6067 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6068 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6072 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6074 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6075 .type = HDA_FIXUP_PINS,
6076 .v.pins = (const struct hda_pintbl[]) {
6077 { 0x17, 0x90170112 }, /* subwoofer */
6081 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6083 [ALC290_FIXUP_SUBWOOFER] = {
6084 .type = HDA_FIXUP_PINS,
6085 .v.pins = (const struct hda_pintbl[]) {
6086 { 0x17, 0x90170112 }, /* subwoofer */
6090 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6092 [ALC290_FIXUP_MONO_SPEAKERS] = {
6093 .type = HDA_FIXUP_FUNC,
6094 .v.func = alc290_fixup_mono_speakers,
6096 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6097 .type = HDA_FIXUP_FUNC,
6098 .v.func = alc290_fixup_mono_speakers,
6100 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6102 [ALC269_FIXUP_THINKPAD_ACPI] = {
6103 .type = HDA_FIXUP_FUNC,
6104 .v.func = alc_fixup_thinkpad_acpi,
6106 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6108 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6109 .type = HDA_FIXUP_FUNC,
6110 .v.func = alc_fixup_inv_dmic,
6112 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6114 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6115 .type = HDA_FIXUP_PINS,
6116 .v.pins = (const struct hda_pintbl[]) {
6117 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6121 .chain_id = ALC255_FIXUP_HEADSET_MODE
6123 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6124 .type = HDA_FIXUP_PINS,
6125 .v.pins = (const struct hda_pintbl[]) {
6126 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6130 .chain_id = ALC255_FIXUP_HEADSET_MODE
6132 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6133 .type = HDA_FIXUP_PINS,
6134 .v.pins = (const struct hda_pintbl[]) {
6135 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6136 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6140 .chain_id = ALC255_FIXUP_HEADSET_MODE
6142 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6143 .type = HDA_FIXUP_PINS,
6144 .v.pins = (const struct hda_pintbl[]) {
6145 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6149 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6151 [ALC255_FIXUP_HEADSET_MODE] = {
6152 .type = HDA_FIXUP_FUNC,
6153 .v.func = alc_fixup_headset_mode_alc255,
6155 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6157 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6158 .type = HDA_FIXUP_FUNC,
6159 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6161 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6162 .type = HDA_FIXUP_PINS,
6163 .v.pins = (const struct hda_pintbl[]) {
6164 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6165 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6169 .chain_id = ALC269_FIXUP_HEADSET_MODE
6171 [ALC292_FIXUP_TPT440_DOCK] = {
6172 .type = HDA_FIXUP_FUNC,
6173 .v.func = alc_fixup_tpt440_dock,
6175 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6177 [ALC292_FIXUP_TPT440] = {
6178 .type = HDA_FIXUP_FUNC,
6179 .v.func = alc_fixup_disable_aamix,
6181 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6183 [ALC283_FIXUP_HEADSET_MIC] = {
6184 .type = HDA_FIXUP_PINS,
6185 .v.pins = (const struct hda_pintbl[]) {
6186 { 0x19, 0x04a110f0 },
6190 [ALC255_FIXUP_MIC_MUTE_LED] = {
6191 .type = HDA_FIXUP_FUNC,
6192 .v.func = snd_hda_gen_fixup_micmute_led,
6194 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6195 .type = HDA_FIXUP_PINS,
6196 .v.pins = (const struct hda_pintbl[]) {
6197 { 0x12, 0x90a60130 },
6198 { 0x14, 0x90170110 },
6199 { 0x17, 0x40000008 },
6200 { 0x18, 0x411111f0 },
6201 { 0x19, 0x01a1913c },
6202 { 0x1a, 0x411111f0 },
6203 { 0x1b, 0x411111f0 },
6204 { 0x1d, 0x40f89b2d },
6205 { 0x1e, 0x411111f0 },
6206 { 0x21, 0x0321101f },
6210 [ALC280_FIXUP_HP_GPIO4] = {
6211 .type = HDA_FIXUP_FUNC,
6212 .v.func = alc280_fixup_hp_gpio4,
6214 [ALC286_FIXUP_HP_GPIO_LED] = {
6215 .type = HDA_FIXUP_FUNC,
6216 .v.func = alc286_fixup_hp_gpio_led,
6218 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6219 .type = HDA_FIXUP_FUNC,
6220 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6222 [ALC280_FIXUP_HP_DOCK_PINS] = {
6223 .type = HDA_FIXUP_PINS,
6224 .v.pins = (const struct hda_pintbl[]) {
6225 { 0x1b, 0x21011020 }, /* line-out */
6226 { 0x1a, 0x01a1903c }, /* headset mic */
6227 { 0x18, 0x2181103f }, /* line-in */
6231 .chain_id = ALC280_FIXUP_HP_GPIO4
6233 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6234 .type = HDA_FIXUP_PINS,
6235 .v.pins = (const struct hda_pintbl[]) {
6236 { 0x1b, 0x21011020 }, /* line-out */
6237 { 0x18, 0x2181103f }, /* line-in */
6241 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6243 [ALC280_FIXUP_HP_9480M] = {
6244 .type = HDA_FIXUP_FUNC,
6245 .v.func = alc280_fixup_hp_9480m,
6247 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6248 .type = HDA_FIXUP_FUNC,
6249 .v.func = alc_fixup_headset_mode_dell_alc288,
6251 .chain_id = ALC255_FIXUP_MIC_MUTE_LED
6253 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6254 .type = HDA_FIXUP_PINS,
6255 .v.pins = (const struct hda_pintbl[]) {
6256 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6257 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6261 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6263 [ALC288_FIXUP_DISABLE_AAMIX] = {
6264 .type = HDA_FIXUP_FUNC,
6265 .v.func = alc_fixup_disable_aamix,
6267 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6269 [ALC288_FIXUP_DELL_XPS_13] = {
6270 .type = HDA_FIXUP_FUNC,
6271 .v.func = alc_fixup_dell_xps13,
6273 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6275 [ALC292_FIXUP_DISABLE_AAMIX] = {
6276 .type = HDA_FIXUP_FUNC,
6277 .v.func = alc_fixup_disable_aamix,
6279 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6281 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
6282 .type = HDA_FIXUP_FUNC,
6283 .v.func = alc_fixup_disable_aamix,
6285 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6287 [ALC292_FIXUP_DELL_E7X] = {
6288 .type = HDA_FIXUP_FUNC,
6289 .v.func = alc_fixup_dell_xps13,
6291 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
6293 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6294 .type = HDA_FIXUP_PINS,
6295 .v.pins = (const struct hda_pintbl[]) {
6296 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6297 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6301 .chain_id = ALC269_FIXUP_HEADSET_MODE
6303 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
6304 .type = HDA_FIXUP_PINS,
6305 .v.pins = (const struct hda_pintbl[]) {
6306 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6310 .chain_id = ALC269_FIXUP_HEADSET_MODE
6312 [ALC275_FIXUP_DELL_XPS] = {
6313 .type = HDA_FIXUP_VERBS,
6314 .v.verbs = (const struct hda_verb[]) {
6315 /* Enables internal speaker */
6316 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
6317 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
6318 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
6319 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
6323 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = {
6324 .type = HDA_FIXUP_VERBS,
6325 .v.verbs = (const struct hda_verb[]) {
6326 /* Disable pass-through path for FRONT 14h */
6327 {0x20, AC_VERB_SET_COEF_INDEX, 0x36},
6328 {0x20, AC_VERB_SET_PROC_COEF, 0x1737},
6332 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6334 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
6335 .type = HDA_FIXUP_FUNC,
6336 .v.func = alc_fixup_disable_aamix,
6338 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6340 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
6341 .type = HDA_FIXUP_FUNC,
6342 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
6344 [ALC255_FIXUP_DELL_SPK_NOISE] = {
6345 .type = HDA_FIXUP_FUNC,
6346 .v.func = alc_fixup_disable_aamix,
6348 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6350 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
6351 .type = HDA_FIXUP_FUNC,
6352 .v.func = alc_fixup_disable_mic_vref,
6354 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6356 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6357 .type = HDA_FIXUP_VERBS,
6358 .v.verbs = (const struct hda_verb[]) {
6359 /* Disable pass-through path for FRONT 14h */
6360 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6361 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6365 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
6367 [ALC280_FIXUP_HP_HEADSET_MIC] = {
6368 .type = HDA_FIXUP_FUNC,
6369 .v.func = alc_fixup_disable_aamix,
6371 .chain_id = ALC269_FIXUP_HEADSET_MIC,
6373 [ALC221_FIXUP_HP_FRONT_MIC] = {
6374 .type = HDA_FIXUP_PINS,
6375 .v.pins = (const struct hda_pintbl[]) {
6376 { 0x19, 0x02a19020 }, /* Front Mic */
6380 [ALC292_FIXUP_TPT460] = {
6381 .type = HDA_FIXUP_FUNC,
6382 .v.func = alc_fixup_tpt440_dock,
6384 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
6386 [ALC298_FIXUP_SPK_VOLUME] = {
6387 .type = HDA_FIXUP_FUNC,
6388 .v.func = alc298_fixup_speaker_volume,
6390 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6392 [ALC295_FIXUP_DISABLE_DAC3] = {
6393 .type = HDA_FIXUP_FUNC,
6394 .v.func = alc295_fixup_disable_dac3,
6396 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
6397 .type = HDA_FIXUP_PINS,
6398 .v.pins = (const struct hda_pintbl[]) {
6399 { 0x1b, 0x90170151 },
6403 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6405 [ALC269_FIXUP_ATIV_BOOK_8] = {
6406 .type = HDA_FIXUP_FUNC,
6407 .v.func = alc_fixup_auto_mute_via_amp,
6409 .chain_id = ALC269_FIXUP_NO_SHUTUP
6411 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
6412 .type = HDA_FIXUP_PINS,
6413 .v.pins = (const struct hda_pintbl[]) {
6414 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6415 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6419 .chain_id = ALC269_FIXUP_HEADSET_MODE
6421 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
6422 .type = HDA_FIXUP_FUNC,
6423 .v.func = alc_fixup_headset_mode,
6425 [ALC256_FIXUP_ASUS_MIC] = {
6426 .type = HDA_FIXUP_PINS,
6427 .v.pins = (const struct hda_pintbl[]) {
6428 { 0x13, 0x90a60160 }, /* use as internal mic */
6429 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6433 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6435 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
6436 .type = HDA_FIXUP_FUNC,
6437 /* Set up GPIO2 for the speaker amp */
6438 .v.func = alc_fixup_gpio4,
6440 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6441 .type = HDA_FIXUP_PINS,
6442 .v.pins = (const struct hda_pintbl[]) {
6443 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6447 .chain_id = ALC269_FIXUP_HEADSET_MIC
6449 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
6450 .type = HDA_FIXUP_VERBS,
6451 .v.verbs = (const struct hda_verb[]) {
6452 /* Enables internal speaker */
6453 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
6454 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
6458 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6460 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
6461 .type = HDA_FIXUP_FUNC,
6462 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
6464 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
6465 .type = HDA_FIXUP_PINS,
6466 .v.pins = (const struct hda_pintbl[]) {
6467 /* Change the mic location from front to right, otherwise there are
6468 two front mics with the same name, pulseaudio can't handle them.
6469 This is just a temporary workaround, after applying this fixup,
6470 there will be one "Front Mic" and one "Mic" in this machine.
6472 { 0x1a, 0x04a19040 },
6476 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
6477 .type = HDA_FIXUP_PINS,
6478 .v.pins = (const struct hda_pintbl[]) {
6479 { 0x16, 0x0101102f }, /* Rear Headset HP */
6480 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6481 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6482 { 0x1b, 0x02011020 },
6486 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6488 [ALC700_FIXUP_INTEL_REFERENCE] = {
6489 .type = HDA_FIXUP_VERBS,
6490 .v.verbs = (const struct hda_verb[]) {
6491 /* Enables internal speaker */
6492 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
6493 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
6494 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
6495 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
6496 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
6497 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
6498 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
6499 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
6503 [ALC274_FIXUP_DELL_BIND_DACS] = {
6504 .type = HDA_FIXUP_FUNC,
6505 .v.func = alc274_fixup_bind_dacs,
6507 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6509 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
6510 .type = HDA_FIXUP_PINS,
6511 .v.pins = (const struct hda_pintbl[]) {
6512 { 0x1b, 0x0401102f },
6516 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
6518 [ALC298_FIXUP_TPT470_DOCK] = {
6519 .type = HDA_FIXUP_FUNC,
6520 .v.func = alc_fixup_tpt470_dock,
6522 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6524 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
6525 .type = HDA_FIXUP_PINS,
6526 .v.pins = (const struct hda_pintbl[]) {
6527 { 0x14, 0x0201101f },
6531 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6533 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
6534 .type = HDA_FIXUP_PINS,
6535 .v.pins = (const struct hda_pintbl[]) {
6536 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6540 .chain_id = ALC269_FIXUP_HEADSET_MIC
6542 [ALC295_FIXUP_HP_X360] = {
6543 .type = HDA_FIXUP_FUNC,
6544 .v.func = alc295_fixup_hp_top_speakers,
6546 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
6548 [ALC221_FIXUP_HP_HEADSET_MIC] = {
6549 .type = HDA_FIXUP_PINS,
6550 .v.pins = (const struct hda_pintbl[]) {
6551 { 0x19, 0x0181313f},
6555 .chain_id = ALC269_FIXUP_HEADSET_MIC
6557 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
6558 .type = HDA_FIXUP_FUNC,
6559 .v.func = alc285_fixup_invalidate_dacs,
6561 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6563 [ALC295_FIXUP_HP_AUTO_MUTE] = {
6564 .type = HDA_FIXUP_FUNC,
6565 .v.func = alc_fixup_auto_mute_via_amp,
6567 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
6568 .type = HDA_FIXUP_PINS,
6569 .v.pins = (const struct hda_pintbl[]) {
6570 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6574 .chain_id = ALC269_FIXUP_HEADSET_MIC
6576 [ALC294_FIXUP_ASUS_MIC] = {
6577 .type = HDA_FIXUP_PINS,
6578 .v.pins = (const struct hda_pintbl[]) {
6579 { 0x13, 0x90a60160 }, /* use as internal mic */
6580 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6584 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6586 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
6587 .type = HDA_FIXUP_PINS,
6588 .v.pins = (const struct hda_pintbl[]) {
6589 { 0x19, 0x01a1103c }, /* use as headset mic */
6593 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6595 [ALC294_FIXUP_ASUS_SPK] = {
6596 .type = HDA_FIXUP_VERBS,
6597 .v.verbs = (const struct hda_verb[]) {
6599 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
6600 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
6604 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
6606 [ALC225_FIXUP_HEADSET_JACK] = {
6607 .type = HDA_FIXUP_FUNC,
6608 .v.func = alc_fixup_headset_jack,
6610 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
6611 .type = HDA_FIXUP_PINS,
6612 .v.pins = (const struct hda_pintbl[]) {
6613 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6617 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6619 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
6620 .type = HDA_FIXUP_VERBS,
6621 .v.verbs = (const struct hda_verb[]) {
6622 /* Disable PCBEEP-IN passthrough */
6623 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6624 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6628 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6632 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6633 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
6634 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
6635 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
6636 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
6637 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
6638 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
6639 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
6640 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
6641 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
6642 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
6643 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
6644 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6645 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
6646 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6647 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6648 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6649 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
6650 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
6651 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
6652 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
6653 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
6654 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
6655 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
6656 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
6657 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
6658 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
6659 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
6660 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
6661 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
6662 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
6663 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
6664 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6665 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6666 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
6667 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
6668 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
6669 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
6670 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6671 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6672 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6673 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6674 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6675 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6676 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6677 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6678 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
6679 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
6680 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6681 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
6682 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
6683 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
6684 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
6685 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
6686 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6687 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6688 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6689 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
6690 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
6691 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
6692 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6693 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6694 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6695 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
6696 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
6697 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
6698 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
6700 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6701 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6702 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6703 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6704 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6705 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6706 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6707 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6708 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6709 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6710 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6711 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6712 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
6713 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
6714 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
6715 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6716 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6717 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6718 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6719 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6720 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
6721 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6722 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6724 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6725 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6726 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6727 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6728 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6729 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6730 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6731 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6732 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6733 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
6734 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6735 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6736 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6737 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6738 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6739 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6740 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6741 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6742 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6743 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6744 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6745 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6746 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6747 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6748 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6749 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6750 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6751 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6752 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6753 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
6754 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
6755 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
6756 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
6757 SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
6758 SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
6759 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
6760 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
6761 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
6762 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6763 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
6764 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
6765 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
6766 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6767 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
6768 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
6769 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
6770 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
6771 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
6772 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
6773 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
6774 SND_PCI_QUIRK(0x1043, 0x14a1, "ASUS UX533FD", ALC294_FIXUP_ASUS_SPK),
6775 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
6776 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
6777 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
6778 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
6779 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
6780 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
6781 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6782 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
6783 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
6784 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
6785 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
6786 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
6787 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
6788 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
6789 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
6790 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
6791 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
6792 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
6793 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
6794 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
6795 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
6796 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
6797 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6798 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6799 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
6800 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
6801 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
6802 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
6803 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
6804 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
6805 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
6806 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
6807 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6808 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
6809 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
6810 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
6811 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
6812 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
6813 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
6814 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
6815 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
6816 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
6817 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
6818 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
6819 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
6820 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
6821 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
6822 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
6823 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
6824 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6825 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
6826 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
6827 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6828 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
6829 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
6830 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
6831 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6832 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6833 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
6834 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
6835 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
6836 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6837 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6838 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
6839 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6840 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6841 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6842 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6843 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6844 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6845 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6846 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6847 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6848 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6849 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
6850 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
6851 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
6852 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6853 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
6854 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
6855 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6856 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
6857 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
6858 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
6859 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
6860 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
6861 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
6862 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
6863 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
6864 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6865 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6866 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6867 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6868 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6869 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6870 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
6871 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
6872 SND_PCI_QUIRK(0x19e5, 0x3200, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED),
6873 SND_PCI_QUIRK(0x19e5, 0x3201, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED),
6874 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS),
6875 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
6878 /* Below is a quirk table taken from the old code.
6879 * Basically the device should work as is without the fixup table.
6880 * If BIOS doesn't give a proper info, enable the corresponding
6883 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
6885 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
6886 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
6887 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
6888 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
6889 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
6890 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
6891 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
6892 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
6893 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
6894 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
6895 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
6896 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
6897 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
6898 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
6899 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
6900 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
6901 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
6902 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
6903 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
6904 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
6905 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
6906 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
6907 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
6908 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
6909 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
6910 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
6911 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
6912 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
6913 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
6914 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
6915 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
6916 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
6917 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
6918 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
6919 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
6920 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
6921 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
6922 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
6923 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
6928 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
6929 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
6930 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
6931 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
6932 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
6936 static const struct hda_model_fixup alc269_fixup_models[] = {
6937 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
6938 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6939 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
6940 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
6941 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
6942 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
6943 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
6944 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
6945 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
6946 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
6947 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
6948 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
6949 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
6950 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
6951 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
6952 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
6953 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
6954 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
6955 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
6956 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
6957 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
6958 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
6959 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
6960 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
6961 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
6962 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
6963 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
6964 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
6965 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
6966 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
6967 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
6968 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
6969 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
6970 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
6971 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
6972 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
6973 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
6974 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
6975 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
6976 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
6977 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
6978 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
6979 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
6980 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
6981 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
6982 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
6983 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
6984 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
6985 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
6986 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
6987 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
6988 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
6989 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
6990 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
6991 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
6992 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
6993 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
6994 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
6995 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
6996 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
6997 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
6998 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
6999 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
7000 {.id = ALC255_FIXUP_MIC_MUTE_LED, .name = "alc255-dell-mute"},
7001 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
7002 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
7003 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7004 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
7005 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
7006 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
7007 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
7008 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
7009 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
7010 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
7011 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
7012 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
7013 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
7014 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
7015 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
7016 {.id = ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, .name = "alc256-dell-xps13"},
7017 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
7018 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
7019 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
7020 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
7021 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
7022 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
7023 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
7024 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
7025 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
7026 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
7027 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
7028 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
7029 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
7030 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
7031 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
7032 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
7033 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
7034 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
7035 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
7036 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
7037 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
7038 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
7039 {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-sense-combo"},
7042 #define ALC225_STANDARD_PINS \
7045 #define ALC256_STANDARD_PINS \
7046 {0x12, 0x90a60140}, \
7047 {0x14, 0x90170110}, \
7050 #define ALC282_STANDARD_PINS \
7053 #define ALC290_STANDARD_PINS \
7056 #define ALC292_STANDARD_PINS \
7057 {0x14, 0x90170110}, \
7060 #define ALC295_STANDARD_PINS \
7061 {0x12, 0xb7a60130}, \
7062 {0x14, 0x90170110}, \
7065 #define ALC298_STANDARD_PINS \
7066 {0x12, 0x90a60130}, \
7069 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
7070 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
7075 {0x21, 0x0221102f}),
7076 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7079 {0x21, 0x02211030}),
7080 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7083 {0x21, 0x03211020}),
7084 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7087 {0x21, 0x03211020}),
7088 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7089 ALC225_STANDARD_PINS,
7091 {0x14, 0x901701a0}),
7092 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7093 ALC225_STANDARD_PINS,
7095 {0x14, 0x901701b0}),
7096 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7097 ALC225_STANDARD_PINS,
7099 {0x14, 0x901701a0}),
7100 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7101 ALC225_STANDARD_PINS,
7103 {0x14, 0x901701b0}),
7104 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7105 ALC225_STANDARD_PINS,
7107 {0x1b, 0x90170110}),
7108 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7111 {0x21, 0x02211020}),
7112 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7116 {0x21, 0x02211020}),
7117 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7122 {0x21, 0x0221101f}),
7123 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7128 {0x21, 0x0221101f}),
7129 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7133 {0x21, 0x0221101f}),
7134 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7137 {0x21, 0x02211020}),
7138 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7141 {0x21, 0x02211020}),
7142 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7144 {0x21, 0x02211020}),
7145 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7147 {0x21, 0x02211040}),
7148 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7151 {0x21, 0x02211020}),
7152 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7155 {0x21, 0x02211030}),
7156 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7159 {0x21, 0x0221101f}),
7160 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7163 {0x21, 0x0221101f}),
7164 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7167 {0x21, 0x0221103f}),
7168 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7171 {0x21, 0x0221103f}),
7172 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7175 {0x21, 0x0221103f}),
7176 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7179 {0x21, 0x0221105f}),
7180 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7183 {0x21, 0x0221101f}),
7184 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7188 {0x21, 0x0321102f}),
7189 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7192 {0x21, 0x02211040}),
7193 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7196 {0x21, 0x02211050}),
7197 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7200 {0x21, 0x02211030}),
7201 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7204 {0x21, 0x02211040}),
7205 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7208 {0x21, 0x02211040}),
7209 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7212 {0x21, 0x02211050}),
7213 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7216 {0x21, 0x02211040}),
7217 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7220 {0x21, 0x02211030}),
7221 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7223 {0x21, 0x02211010}),
7224 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7228 {0x21, 0x0221101f}),
7229 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7232 {0x21, 0x02211030}),
7233 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7236 {0x21, 0x02211030}),
7237 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7240 {0x21, 0x02211030}),
7241 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7244 {0x21, 0x02211020}),
7245 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7249 {0x21, 0x0221101f}),
7250 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7251 ALC256_STANDARD_PINS),
7252 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7255 {0x21, 0x04211020}),
7256 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7259 {0x21, 0x03211020}),
7260 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7264 {0x21, 0x04211020}),
7265 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
7269 {0x1a, 0x04a11020}),
7270 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
7276 {0x1b, 0x02011020}),
7277 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7278 ALC282_STANDARD_PINS,
7281 {0x21, 0x0321101f}),
7282 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7283 ALC282_STANDARD_PINS,
7286 {0x21, 0x03211040}),
7287 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7288 ALC282_STANDARD_PINS,
7291 {0x21, 0x03211020}),
7292 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7293 ALC282_STANDARD_PINS,
7296 {0x21, 0x0421101f}),
7297 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
7298 ALC282_STANDARD_PINS,
7301 {0x21, 0x04211020}),
7302 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7303 ALC282_STANDARD_PINS,
7305 {0x21, 0x0321101f}),
7306 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7309 {0x21, 0x02211030}),
7310 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7311 ALC282_STANDARD_PINS,
7314 {0x21, 0x0321101f}),
7315 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7319 {0x21, 0x04211020}),
7320 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7323 {0x21, 0x02211020}),
7324 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7327 {0x21, 0x0321101f}),
7328 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7331 {0x21, 0x04211020}),
7332 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7333 ALC290_STANDARD_PINS,
7336 {0x1a, 0x04a11020}),
7337 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7338 ALC290_STANDARD_PINS,
7341 {0x1a, 0x04a11020}),
7342 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7343 ALC290_STANDARD_PINS,
7345 {0x1a, 0x04a11020}),
7346 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7347 ALC290_STANDARD_PINS,
7349 {0x1a, 0x04a11040}),
7350 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7351 ALC290_STANDARD_PINS,
7354 {0x1a, 0x04a11040}),
7355 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7356 ALC290_STANDARD_PINS,
7359 {0x1a, 0x04a11020}),
7360 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7361 ALC290_STANDARD_PINS,
7364 {0x1a, 0x04a11020}),
7365 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7366 ALC292_STANDARD_PINS,
7369 {0x19, 0x01a19030}),
7370 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7371 ALC292_STANDARD_PINS,
7375 {0x19, 0x01a1903e}),
7376 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7377 ALC292_STANDARD_PINS,
7378 {0x12, 0x90a60140}),
7379 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7380 ALC292_STANDARD_PINS,
7383 {0x19, 0x21a19030}),
7384 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7385 ALC292_STANDARD_PINS,
7386 {0x13, 0x90a60140}),
7387 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
7390 {0x21, 0x04211020}),
7391 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7394 {0x21, 0x04211020}),
7395 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7396 ALC295_STANDARD_PINS,
7398 {0x18, 0x21a19030}),
7399 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7400 ALC295_STANDARD_PINS,
7402 {0x18, 0x21a19050}),
7403 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7404 ALC295_STANDARD_PINS),
7405 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7406 ALC298_STANDARD_PINS,
7407 {0x17, 0x90170110}),
7408 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7409 ALC298_STANDARD_PINS,
7410 {0x17, 0x90170140}),
7411 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7412 ALC298_STANDARD_PINS,
7413 {0x17, 0x90170150}),
7414 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
7419 {0x21, 0x03211030}),
7420 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7421 ALC225_STANDARD_PINS,
7423 {0x17, 0x90170110}),
7427 static void alc269_fill_coef(struct hda_codec *codec)
7429 struct alc_spec *spec = codec->spec;
7432 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
7435 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
7436 alc_write_coef_idx(codec, 0xf, 0x960b);
7437 alc_write_coef_idx(codec, 0xe, 0x8817);
7440 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
7441 alc_write_coef_idx(codec, 0xf, 0x960b);
7442 alc_write_coef_idx(codec, 0xe, 0x8814);
7445 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
7446 /* Power up output pin */
7447 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
7450 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
7451 val = alc_read_coef_idx(codec, 0xd);
7452 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
7453 /* Capless ramp up clock control */
7454 alc_write_coef_idx(codec, 0xd, val | (1<<10));
7456 val = alc_read_coef_idx(codec, 0x17);
7457 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
7458 /* Class D power on reset */
7459 alc_write_coef_idx(codec, 0x17, val | (1<<7));
7464 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
7469 static int patch_alc269(struct hda_codec *codec)
7471 struct alc_spec *spec;
7474 err = alc_alloc_spec(codec, 0x0b);
7479 spec->gen.shared_mic_vref_pin = 0x18;
7480 codec->power_save_node = 1;
7483 codec->patch_ops.suspend = alc269_suspend;
7484 codec->patch_ops.resume = alc269_resume;
7486 spec->shutup = alc_default_shutup;
7487 spec->init_hook = alc_default_init;
7489 switch (codec->core.vendor_id) {
7491 spec->codec_variant = ALC269_TYPE_ALC269VA;
7492 switch (alc_get_coef0(codec) & 0x00f0) {
7494 if (codec->bus->pci &&
7495 codec->bus->pci->subsystem_vendor == 0x1025 &&
7496 spec->cdefine.platform_type == 1)
7497 err = alc_codec_rename(codec, "ALC271X");
7498 spec->codec_variant = ALC269_TYPE_ALC269VB;
7501 if (codec->bus->pci &&
7502 codec->bus->pci->subsystem_vendor == 0x17aa &&
7503 codec->bus->pci->subsystem_device == 0x21f3)
7504 err = alc_codec_rename(codec, "ALC3202");
7505 spec->codec_variant = ALC269_TYPE_ALC269VC;
7508 spec->codec_variant = ALC269_TYPE_ALC269VD;
7511 alc_fix_pll_init(codec, 0x20, 0x04, 15);
7515 spec->shutup = alc269_shutup;
7516 spec->init_hook = alc269_fill_coef;
7517 alc269_fill_coef(codec);
7522 spec->codec_variant = ALC269_TYPE_ALC280;
7525 spec->codec_variant = ALC269_TYPE_ALC282;
7526 spec->shutup = alc282_shutup;
7527 spec->init_hook = alc282_init;
7531 spec->codec_variant = ALC269_TYPE_ALC283;
7532 spec->shutup = alc283_shutup;
7533 spec->init_hook = alc283_init;
7537 spec->codec_variant = ALC269_TYPE_ALC284;
7540 spec->codec_variant = ALC269_TYPE_ALC293;
7544 spec->codec_variant = ALC269_TYPE_ALC286;
7545 spec->shutup = alc286_shutup;
7548 spec->codec_variant = ALC269_TYPE_ALC298;
7552 spec->codec_variant = ALC269_TYPE_ALC255;
7553 spec->shutup = alc256_shutup;
7554 spec->init_hook = alc256_init;
7558 spec->codec_variant = ALC269_TYPE_ALC256;
7559 spec->shutup = alc256_shutup;
7560 spec->init_hook = alc256_init;
7561 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
7562 alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
7565 spec->codec_variant = ALC269_TYPE_ALC257;
7566 spec->shutup = alc256_shutup;
7567 spec->init_hook = alc256_init;
7568 spec->gen.mixer_nid = 0;
7573 spec->codec_variant = ALC269_TYPE_ALC215;
7574 spec->shutup = alc225_shutup;
7575 spec->init_hook = alc225_init;
7576 spec->gen.mixer_nid = 0;
7581 spec->codec_variant = ALC269_TYPE_ALC225;
7582 spec->shutup = alc225_shutup;
7583 spec->init_hook = alc225_init;
7584 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
7589 spec->codec_variant = ALC269_TYPE_ALC294;
7590 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
7591 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7592 spec->init_hook = alc294_init;
7595 spec->codec_variant = ALC269_TYPE_ALC300;
7596 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
7601 spec->codec_variant = ALC269_TYPE_ALC700;
7602 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
7603 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7604 spec->init_hook = alc294_init;
7609 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
7610 spec->has_alc5505_dsp = 1;
7611 spec->init_hook = alc5505_dsp_init;
7614 snd_hda_pick_fixup(codec, alc269_fixup_models,
7615 alc269_fixup_tbl, alc269_fixups);
7616 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
7617 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
7619 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
7621 alc_auto_parse_customize_define(codec);
7623 if (has_cdefine_beep(codec))
7624 spec->gen.beep_nid = 0x01;
7626 /* automatic parse from the BIOS config */
7627 err = alc269_parse_auto_config(codec);
7631 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
7632 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
7637 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
7650 static int alc861_parse_auto_config(struct hda_codec *codec)
7652 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
7653 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
7654 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
7657 /* Pin config fixes */
7659 ALC861_FIXUP_FSC_AMILO_PI1505,
7660 ALC861_FIXUP_AMP_VREF_0F,
7661 ALC861_FIXUP_NO_JACK_DETECT,
7662 ALC861_FIXUP_ASUS_A6RP,
7663 ALC660_FIXUP_ASUS_W7J,
7666 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7667 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
7668 const struct hda_fixup *fix, int action)
7670 struct alc_spec *spec = codec->spec;
7673 if (action != HDA_FIXUP_ACT_INIT)
7675 val = snd_hda_codec_get_pin_target(codec, 0x0f);
7676 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
7677 val |= AC_PINCTL_IN_EN;
7678 val |= AC_PINCTL_VREF_50;
7679 snd_hda_set_pin_ctl(codec, 0x0f, val);
7680 spec->gen.keep_vref_in_automute = 1;
7683 /* suppress the jack-detection */
7684 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
7685 const struct hda_fixup *fix, int action)
7687 if (action == HDA_FIXUP_ACT_PRE_PROBE)
7688 codec->no_jack_detect = 1;
7691 static const struct hda_fixup alc861_fixups[] = {
7692 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
7693 .type = HDA_FIXUP_PINS,
7694 .v.pins = (const struct hda_pintbl[]) {
7695 { 0x0b, 0x0221101f }, /* HP */
7696 { 0x0f, 0x90170310 }, /* speaker */
7700 [ALC861_FIXUP_AMP_VREF_0F] = {
7701 .type = HDA_FIXUP_FUNC,
7702 .v.func = alc861_fixup_asus_amp_vref_0f,
7704 [ALC861_FIXUP_NO_JACK_DETECT] = {
7705 .type = HDA_FIXUP_FUNC,
7706 .v.func = alc_fixup_no_jack_detect,
7708 [ALC861_FIXUP_ASUS_A6RP] = {
7709 .type = HDA_FIXUP_FUNC,
7710 .v.func = alc861_fixup_asus_amp_vref_0f,
7712 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
7714 [ALC660_FIXUP_ASUS_W7J] = {
7715 .type = HDA_FIXUP_VERBS,
7716 .v.verbs = (const struct hda_verb[]) {
7717 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7718 * for enabling outputs
7720 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
7726 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
7727 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
7728 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
7729 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
7730 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
7731 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
7732 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F),
7733 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F),
7734 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
7740 static int patch_alc861(struct hda_codec *codec)
7742 struct alc_spec *spec;
7745 err = alc_alloc_spec(codec, 0x15);
7750 spec->gen.beep_nid = 0x23;
7753 spec->power_hook = alc_power_eapd;
7756 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
7757 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
7759 /* automatic parse from the BIOS config */
7760 err = alc861_parse_auto_config(codec);
7764 if (!spec->gen.no_analog) {
7765 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
7770 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
7784 * In addition, an independent DAC
7786 static int alc861vd_parse_auto_config(struct hda_codec *codec)
7788 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
7789 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7790 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
7794 ALC660VD_FIX_ASUS_GPIO1,
7795 ALC861VD_FIX_DALLAS,
7798 /* exclude VREF80 */
7799 static void alc861vd_fixup_dallas(struct hda_codec *codec,
7800 const struct hda_fixup *fix, int action)
7802 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7803 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
7804 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
7809 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
7810 const struct hda_fixup *fix, int action)
7812 struct alc_spec *spec = codec->spec;
7814 if (action == HDA_FIXUP_ACT_PRE_PROBE)
7815 spec->gpio_mask |= 0x02;
7816 alc_fixup_gpio(codec, action, 0x01);
7819 static const struct hda_fixup alc861vd_fixups[] = {
7820 [ALC660VD_FIX_ASUS_GPIO1] = {
7821 .type = HDA_FIXUP_FUNC,
7822 .v.func = alc660vd_fixup_asus_gpio1,
7824 [ALC861VD_FIX_DALLAS] = {
7825 .type = HDA_FIXUP_FUNC,
7826 .v.func = alc861vd_fixup_dallas,
7830 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
7831 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
7832 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
7833 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
7839 static int patch_alc861vd(struct hda_codec *codec)
7841 struct alc_spec *spec;
7844 err = alc_alloc_spec(codec, 0x0b);
7849 spec->gen.beep_nid = 0x23;
7851 spec->shutup = alc_eapd_shutup;
7853 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
7854 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
7856 /* automatic parse from the BIOS config */
7857 err = alc861vd_parse_auto_config(codec);
7861 if (!spec->gen.no_analog) {
7862 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
7867 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
7879 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
7880 * configuration. Each pin widget can choose any input DACs and a mixer.
7881 * Each ADC is connected from a mixer of all inputs. This makes possible
7882 * 6-channel independent captures.
7884 * In addition, an independent DAC for the multi-playback (not used in this
7889 * BIOS auto configuration
7892 static int alc662_parse_auto_config(struct hda_codec *codec)
7894 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
7895 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
7896 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7897 const hda_nid_t *ssids;
7899 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
7900 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
7901 codec->core.vendor_id == 0x10ec0671)
7902 ssids = alc663_ssids;
7904 ssids = alc662_ssids;
7905 return alc_parse_auto_config(codec, alc662_ignore, ssids);
7908 static void alc272_fixup_mario(struct hda_codec *codec,
7909 const struct hda_fixup *fix, int action)
7911 if (action != HDA_FIXUP_ACT_PRE_PROBE)
7913 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
7914 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
7915 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
7916 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
7917 (0 << AC_AMPCAP_MUTE_SHIFT)))
7918 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
7921 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
7923 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
7925 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
7926 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
7930 /* override the 2.1 chmap */
7931 static void alc_fixup_bass_chmap(struct hda_codec *codec,
7932 const struct hda_fixup *fix, int action)
7934 if (action == HDA_FIXUP_ACT_BUILD) {
7935 struct alc_spec *spec = codec->spec;
7936 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
7940 /* avoid D3 for keeping GPIO up */
7941 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
7943 unsigned int power_state)
7945 struct alc_spec *spec = codec->spec;
7946 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
7951 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
7952 const struct hda_fixup *fix, int action)
7954 struct alc_spec *spec = codec->spec;
7956 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
7957 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7958 spec->mute_led_polarity = 1;
7959 codec->power_filter = gpio_led_power_filter;
7963 static void alc662_usi_automute_hook(struct hda_codec *codec,
7964 struct hda_jack_callback *jack)
7966 struct alc_spec *spec = codec->spec;
7969 snd_hda_gen_hp_automute(codec, jack);
7971 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
7973 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
7977 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
7978 const struct hda_fixup *fix, int action)
7980 struct alc_spec *spec = codec->spec;
7981 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7982 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
7983 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
7987 static struct coef_fw alc668_coefs[] = {
7988 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
7989 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
7990 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
7991 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
7992 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
7993 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
7994 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
7995 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
7996 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
7997 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
7998 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
7999 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8000 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8001 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8002 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8003 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8004 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8005 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8006 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8007 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8011 static void alc668_restore_default_value(struct hda_codec *codec)
8013 alc_process_coef_fw(codec, alc668_coefs);
8017 ALC662_FIXUP_ASPIRE,
8018 ALC662_FIXUP_LED_GPIO1,
8019 ALC662_FIXUP_IDEAPAD,
8021 ALC662_FIXUP_CZC_P10T,
8022 ALC662_FIXUP_SKU_IGNORE,
8023 ALC662_FIXUP_HP_RP5800,
8024 ALC662_FIXUP_ASUS_MODE1,
8025 ALC662_FIXUP_ASUS_MODE2,
8026 ALC662_FIXUP_ASUS_MODE3,
8027 ALC662_FIXUP_ASUS_MODE4,
8028 ALC662_FIXUP_ASUS_MODE5,
8029 ALC662_FIXUP_ASUS_MODE6,
8030 ALC662_FIXUP_ASUS_MODE7,
8031 ALC662_FIXUP_ASUS_MODE8,
8032 ALC662_FIXUP_NO_JACK_DETECT,
8033 ALC662_FIXUP_ZOTAC_Z68,
8034 ALC662_FIXUP_INV_DMIC,
8035 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8036 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
8037 ALC662_FIXUP_HEADSET_MODE,
8038 ALC668_FIXUP_HEADSET_MODE,
8039 ALC662_FIXUP_BASS_MODE4_CHMAP,
8040 ALC662_FIXUP_BASS_16,
8041 ALC662_FIXUP_BASS_1A,
8042 ALC662_FIXUP_BASS_CHMAP,
8043 ALC668_FIXUP_AUTO_MUTE,
8044 ALC668_FIXUP_DELL_DISABLE_AAMIX,
8045 ALC668_FIXUP_DELL_XPS13,
8046 ALC662_FIXUP_ASUS_Nx50,
8047 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8048 ALC668_FIXUP_ASUS_Nx51,
8049 ALC668_FIXUP_MIC_COEF,
8050 ALC668_FIXUP_ASUS_G751,
8051 ALC891_FIXUP_HEADSET_MODE,
8052 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8053 ALC662_FIXUP_ACER_VERITON,
8054 ALC892_FIXUP_ASROCK_MOBO,
8055 ALC662_FIXUP_USI_FUNC,
8056 ALC662_FIXUP_USI_HEADSET_MODE,
8057 ALC662_FIXUP_LENOVO_MULTI_CODECS,
8060 static const struct hda_fixup alc662_fixups[] = {
8061 [ALC662_FIXUP_ASPIRE] = {
8062 .type = HDA_FIXUP_PINS,
8063 .v.pins = (const struct hda_pintbl[]) {
8064 { 0x15, 0x99130112 }, /* subwoofer */
8068 [ALC662_FIXUP_LED_GPIO1] = {
8069 .type = HDA_FIXUP_FUNC,
8070 .v.func = alc662_fixup_led_gpio1,
8072 [ALC662_FIXUP_IDEAPAD] = {
8073 .type = HDA_FIXUP_PINS,
8074 .v.pins = (const struct hda_pintbl[]) {
8075 { 0x17, 0x99130112 }, /* subwoofer */
8079 .chain_id = ALC662_FIXUP_LED_GPIO1,
8081 [ALC272_FIXUP_MARIO] = {
8082 .type = HDA_FIXUP_FUNC,
8083 .v.func = alc272_fixup_mario,
8085 [ALC662_FIXUP_CZC_P10T] = {
8086 .type = HDA_FIXUP_VERBS,
8087 .v.verbs = (const struct hda_verb[]) {
8088 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
8092 [ALC662_FIXUP_SKU_IGNORE] = {
8093 .type = HDA_FIXUP_FUNC,
8094 .v.func = alc_fixup_sku_ignore,
8096 [ALC662_FIXUP_HP_RP5800] = {
8097 .type = HDA_FIXUP_PINS,
8098 .v.pins = (const struct hda_pintbl[]) {
8099 { 0x14, 0x0221201f }, /* HP out */
8103 .chain_id = ALC662_FIXUP_SKU_IGNORE
8105 [ALC662_FIXUP_ASUS_MODE1] = {
8106 .type = HDA_FIXUP_PINS,
8107 .v.pins = (const struct hda_pintbl[]) {
8108 { 0x14, 0x99130110 }, /* speaker */
8109 { 0x18, 0x01a19c20 }, /* mic */
8110 { 0x19, 0x99a3092f }, /* int-mic */
8111 { 0x21, 0x0121401f }, /* HP out */
8115 .chain_id = ALC662_FIXUP_SKU_IGNORE
8117 [ALC662_FIXUP_ASUS_MODE2] = {
8118 .type = HDA_FIXUP_PINS,
8119 .v.pins = (const struct hda_pintbl[]) {
8120 { 0x14, 0x99130110 }, /* speaker */
8121 { 0x18, 0x01a19820 }, /* mic */
8122 { 0x19, 0x99a3092f }, /* int-mic */
8123 { 0x1b, 0x0121401f }, /* HP out */
8127 .chain_id = ALC662_FIXUP_SKU_IGNORE
8129 [ALC662_FIXUP_ASUS_MODE3] = {
8130 .type = HDA_FIXUP_PINS,
8131 .v.pins = (const struct hda_pintbl[]) {
8132 { 0x14, 0x99130110 }, /* speaker */
8133 { 0x15, 0x0121441f }, /* HP */
8134 { 0x18, 0x01a19840 }, /* mic */
8135 { 0x19, 0x99a3094f }, /* int-mic */
8136 { 0x21, 0x01211420 }, /* HP2 */
8140 .chain_id = ALC662_FIXUP_SKU_IGNORE
8142 [ALC662_FIXUP_ASUS_MODE4] = {
8143 .type = HDA_FIXUP_PINS,
8144 .v.pins = (const struct hda_pintbl[]) {
8145 { 0x14, 0x99130110 }, /* speaker */
8146 { 0x16, 0x99130111 }, /* speaker */
8147 { 0x18, 0x01a19840 }, /* mic */
8148 { 0x19, 0x99a3094f }, /* int-mic */
8149 { 0x21, 0x0121441f }, /* HP */
8153 .chain_id = ALC662_FIXUP_SKU_IGNORE
8155 [ALC662_FIXUP_ASUS_MODE5] = {
8156 .type = HDA_FIXUP_PINS,
8157 .v.pins = (const struct hda_pintbl[]) {
8158 { 0x14, 0x99130110 }, /* speaker */
8159 { 0x15, 0x0121441f }, /* HP */
8160 { 0x16, 0x99130111 }, /* speaker */
8161 { 0x18, 0x01a19840 }, /* mic */
8162 { 0x19, 0x99a3094f }, /* int-mic */
8166 .chain_id = ALC662_FIXUP_SKU_IGNORE
8168 [ALC662_FIXUP_ASUS_MODE6] = {
8169 .type = HDA_FIXUP_PINS,
8170 .v.pins = (const struct hda_pintbl[]) {
8171 { 0x14, 0x99130110 }, /* speaker */
8172 { 0x15, 0x01211420 }, /* HP2 */
8173 { 0x18, 0x01a19840 }, /* mic */
8174 { 0x19, 0x99a3094f }, /* int-mic */
8175 { 0x1b, 0x0121441f }, /* HP */
8179 .chain_id = ALC662_FIXUP_SKU_IGNORE
8181 [ALC662_FIXUP_ASUS_MODE7] = {
8182 .type = HDA_FIXUP_PINS,
8183 .v.pins = (const struct hda_pintbl[]) {
8184 { 0x14, 0x99130110 }, /* speaker */
8185 { 0x17, 0x99130111 }, /* speaker */
8186 { 0x18, 0x01a19840 }, /* mic */
8187 { 0x19, 0x99a3094f }, /* int-mic */
8188 { 0x1b, 0x01214020 }, /* HP */
8189 { 0x21, 0x0121401f }, /* HP */
8193 .chain_id = ALC662_FIXUP_SKU_IGNORE
8195 [ALC662_FIXUP_ASUS_MODE8] = {
8196 .type = HDA_FIXUP_PINS,
8197 .v.pins = (const struct hda_pintbl[]) {
8198 { 0x14, 0x99130110 }, /* speaker */
8199 { 0x12, 0x99a30970 }, /* int-mic */
8200 { 0x15, 0x01214020 }, /* HP */
8201 { 0x17, 0x99130111 }, /* speaker */
8202 { 0x18, 0x01a19840 }, /* mic */
8203 { 0x21, 0x0121401f }, /* HP */
8207 .chain_id = ALC662_FIXUP_SKU_IGNORE
8209 [ALC662_FIXUP_NO_JACK_DETECT] = {
8210 .type = HDA_FIXUP_FUNC,
8211 .v.func = alc_fixup_no_jack_detect,
8213 [ALC662_FIXUP_ZOTAC_Z68] = {
8214 .type = HDA_FIXUP_PINS,
8215 .v.pins = (const struct hda_pintbl[]) {
8216 { 0x1b, 0x02214020 }, /* Front HP */
8220 [ALC662_FIXUP_INV_DMIC] = {
8221 .type = HDA_FIXUP_FUNC,
8222 .v.func = alc_fixup_inv_dmic,
8224 [ALC668_FIXUP_DELL_XPS13] = {
8225 .type = HDA_FIXUP_FUNC,
8226 .v.func = alc_fixup_dell_xps13,
8228 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
8230 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
8231 .type = HDA_FIXUP_FUNC,
8232 .v.func = alc_fixup_disable_aamix,
8234 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8236 [ALC668_FIXUP_AUTO_MUTE] = {
8237 .type = HDA_FIXUP_FUNC,
8238 .v.func = alc_fixup_auto_mute_via_amp,
8240 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8242 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
8243 .type = HDA_FIXUP_PINS,
8244 .v.pins = (const struct hda_pintbl[]) {
8245 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8246 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8250 .chain_id = ALC662_FIXUP_HEADSET_MODE
8252 [ALC662_FIXUP_HEADSET_MODE] = {
8253 .type = HDA_FIXUP_FUNC,
8254 .v.func = alc_fixup_headset_mode_alc662,
8256 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
8257 .type = HDA_FIXUP_PINS,
8258 .v.pins = (const struct hda_pintbl[]) {
8259 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8260 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8264 .chain_id = ALC668_FIXUP_HEADSET_MODE
8266 [ALC668_FIXUP_HEADSET_MODE] = {
8267 .type = HDA_FIXUP_FUNC,
8268 .v.func = alc_fixup_headset_mode_alc668,
8270 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8271 .type = HDA_FIXUP_FUNC,
8272 .v.func = alc_fixup_bass_chmap,
8274 .chain_id = ALC662_FIXUP_ASUS_MODE4
8276 [ALC662_FIXUP_BASS_16] = {
8277 .type = HDA_FIXUP_PINS,
8278 .v.pins = (const struct hda_pintbl[]) {
8279 {0x16, 0x80106111}, /* bass speaker */
8283 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8285 [ALC662_FIXUP_BASS_1A] = {
8286 .type = HDA_FIXUP_PINS,
8287 .v.pins = (const struct hda_pintbl[]) {
8288 {0x1a, 0x80106111}, /* bass speaker */
8292 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8294 [ALC662_FIXUP_BASS_CHMAP] = {
8295 .type = HDA_FIXUP_FUNC,
8296 .v.func = alc_fixup_bass_chmap,
8298 [ALC662_FIXUP_ASUS_Nx50] = {
8299 .type = HDA_FIXUP_FUNC,
8300 .v.func = alc_fixup_auto_mute_via_amp,
8302 .chain_id = ALC662_FIXUP_BASS_1A
8304 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
8305 .type = HDA_FIXUP_FUNC,
8306 .v.func = alc_fixup_headset_mode_alc668,
8307 .chain_id = ALC662_FIXUP_BASS_CHMAP
8309 [ALC668_FIXUP_ASUS_Nx51] = {
8310 .type = HDA_FIXUP_PINS,
8311 .v.pins = (const struct hda_pintbl[]) {
8312 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8313 { 0x1a, 0x90170151 }, /* bass speaker */
8314 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8318 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8320 [ALC668_FIXUP_MIC_COEF] = {
8321 .type = HDA_FIXUP_VERBS,
8322 .v.verbs = (const struct hda_verb[]) {
8323 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
8324 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
8328 [ALC668_FIXUP_ASUS_G751] = {
8329 .type = HDA_FIXUP_PINS,
8330 .v.pins = (const struct hda_pintbl[]) {
8331 { 0x16, 0x0421101f }, /* HP */
8335 .chain_id = ALC668_FIXUP_MIC_COEF
8337 [ALC891_FIXUP_HEADSET_MODE] = {
8338 .type = HDA_FIXUP_FUNC,
8339 .v.func = alc_fixup_headset_mode,
8341 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
8342 .type = HDA_FIXUP_PINS,
8343 .v.pins = (const struct hda_pintbl[]) {
8344 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8345 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8349 .chain_id = ALC891_FIXUP_HEADSET_MODE
8351 [ALC662_FIXUP_ACER_VERITON] = {
8352 .type = HDA_FIXUP_PINS,
8353 .v.pins = (const struct hda_pintbl[]) {
8354 { 0x15, 0x50170120 }, /* no internal speaker */
8358 [ALC892_FIXUP_ASROCK_MOBO] = {
8359 .type = HDA_FIXUP_PINS,
8360 .v.pins = (const struct hda_pintbl[]) {
8361 { 0x15, 0x40f000f0 }, /* disabled */
8362 { 0x16, 0x40f000f0 }, /* disabled */
8366 [ALC662_FIXUP_USI_FUNC] = {
8367 .type = HDA_FIXUP_FUNC,
8368 .v.func = alc662_fixup_usi_headset_mic,
8370 [ALC662_FIXUP_USI_HEADSET_MODE] = {
8371 .type = HDA_FIXUP_PINS,
8372 .v.pins = (const struct hda_pintbl[]) {
8373 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8374 { 0x18, 0x01a1903d },
8378 .chain_id = ALC662_FIXUP_USI_FUNC
8380 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
8381 .type = HDA_FIXUP_FUNC,
8382 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8386 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
8387 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
8388 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
8389 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
8390 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
8391 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
8392 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
8393 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
8394 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
8395 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8396 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8397 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
8398 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
8399 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
8400 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8401 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8402 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8403 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8404 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8405 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
8406 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
8407 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
8408 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8409 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
8410 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
8411 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
8412 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
8413 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
8414 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
8415 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
8416 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8417 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
8418 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
8419 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
8420 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
8421 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
8422 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
8423 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
8424 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
8425 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
8426 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
8427 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
8428 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
8431 /* Below is a quirk table taken from the old code.
8432 * Basically the device should work as is without the fixup table.
8433 * If BIOS doesn't give a proper info, enable the corresponding
8436 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
8437 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
8438 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
8439 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
8440 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8441 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8442 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8443 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
8444 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
8445 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8446 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
8447 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
8448 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
8449 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
8450 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
8451 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8452 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
8453 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
8454 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8455 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8456 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8457 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8458 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
8459 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
8460 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
8461 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8462 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
8463 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8464 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8465 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
8466 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8467 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8468 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
8469 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
8470 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
8471 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
8472 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
8473 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
8474 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
8475 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8476 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
8477 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
8478 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8479 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
8480 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
8481 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
8482 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
8483 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
8484 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8485 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
8490 static const struct hda_model_fixup alc662_fixup_models[] = {
8491 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
8492 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
8493 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
8494 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
8495 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
8496 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
8497 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
8498 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
8499 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
8500 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
8501 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
8502 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
8503 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
8504 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
8505 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
8506 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
8507 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
8508 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
8509 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
8510 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
8511 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
8512 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
8513 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
8514 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
8515 {.id = ALC668_FIXUP_ASUS_G751, .name = "asus-g751"},
8516 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
8517 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
8518 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
8519 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
8520 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
8521 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
8525 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
8526 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8530 {0x21, 0x01014020}),
8531 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8535 {0x1b, 0x0221401f}),
8536 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8540 {0x16, 0x03011020}),
8541 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8545 {0x16, 0x03011020}),
8546 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8550 {0x16, 0x03011020}),
8551 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8554 {0x16, 0x03011020}),
8555 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
8558 {0x15, 0x0321101f}),
8564 static int patch_alc662(struct hda_codec *codec)
8566 struct alc_spec *spec;
8569 err = alc_alloc_spec(codec, 0x0b);
8575 spec->shutup = alc_eapd_shutup;
8577 /* handle multiple HPs as is */
8578 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
8580 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8582 switch (codec->core.vendor_id) {
8584 spec->init_hook = alc668_restore_default_value;
8588 snd_hda_pick_fixup(codec, alc662_fixup_models,
8589 alc662_fixup_tbl, alc662_fixups);
8590 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
8591 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8593 alc_auto_parse_customize_define(codec);
8595 if (has_cdefine_beep(codec))
8596 spec->gen.beep_nid = 0x01;
8598 if ((alc_get_coef0(codec) & (1 << 14)) &&
8599 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
8600 spec->cdefine.platform_type == 1) {
8601 err = alc_codec_rename(codec, "ALC272X");
8606 /* automatic parse from the BIOS config */
8607 err = alc662_parse_auto_config(codec);
8611 if (!spec->gen.no_analog && spec->gen.beep_nid) {
8612 switch (codec->core.vendor_id) {
8614 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
8620 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
8623 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
8630 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8643 static int alc680_parse_auto_config(struct hda_codec *codec)
8645 return alc_parse_auto_config(codec, NULL, NULL);
8650 static int patch_alc680(struct hda_codec *codec)
8654 /* ALC680 has no aa-loopback mixer */
8655 err = alc_alloc_spec(codec, 0);
8659 /* automatic parse from the BIOS config */
8660 err = alc680_parse_auto_config(codec);
8672 static const struct hda_device_id snd_hda_id_realtek[] = {
8673 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
8674 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
8675 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
8676 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
8677 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
8678 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
8679 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
8680 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
8681 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
8682 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
8683 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
8684 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
8685 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
8686 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
8687 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
8688 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
8689 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
8690 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
8691 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
8692 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
8693 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
8694 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
8695 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
8696 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
8697 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
8698 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
8699 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
8700 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
8701 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
8702 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
8703 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
8704 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
8705 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
8706 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
8707 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
8708 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
8709 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
8710 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
8711 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
8712 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
8713 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
8714 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
8715 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
8716 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
8717 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
8718 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
8719 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
8720 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
8721 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
8722 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
8723 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
8724 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
8725 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
8726 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
8727 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
8728 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
8729 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
8730 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
8731 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
8732 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
8733 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
8734 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
8735 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
8736 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
8737 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
8738 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
8739 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
8740 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
8741 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
8742 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
8745 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
8747 MODULE_LICENSE("GPL");
8748 MODULE_DESCRIPTION("Realtek HD-audio codec");
8750 static struct hda_codec_driver realtek_driver = {
8751 .id = snd_hda_id_realtek,
8754 module_hda_codec_driver(realtek_driver);