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 "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;
121 unsigned int no_shutup_pins:1;
125 unsigned int pll_coef_idx, pll_coef_bit;
127 struct input_dev *kb_dev;
128 u8 alc_mute_keycode_map[1];
132 * COEF access helper functions
135 static int alc_read_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
136 unsigned int coef_idx)
140 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
141 val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF, 0);
145 #define alc_read_coef_idx(codec, coef_idx) \
146 alc_read_coefex_idx(codec, 0x20, coef_idx)
148 static void alc_write_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
149 unsigned int coef_idx, unsigned int coef_val)
151 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, coef_idx);
152 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PROC_COEF, coef_val);
155 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
156 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
158 static void alc_update_coefex_idx(struct hda_codec *codec, hda_nid_t nid,
159 unsigned int coef_idx, unsigned int mask,
160 unsigned int bits_set)
162 unsigned int val = alc_read_coefex_idx(codec, nid, coef_idx);
165 alc_write_coefex_idx(codec, nid, coef_idx,
166 (val & ~mask) | bits_set);
169 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
170 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
172 /* a special bypass for COEF 0; read the cached value at the second time */
173 static unsigned int alc_get_coef0(struct hda_codec *codec)
175 struct alc_spec *spec = codec->spec;
178 spec->coef0 = alc_read_coef_idx(codec, 0);
182 /* coef writes/updates batch */
190 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
191 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
192 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
193 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
194 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
196 static void alc_process_coef_fw(struct hda_codec *codec,
197 const struct coef_fw *fw)
199 for (; fw->nid; fw++) {
200 if (fw->mask == (unsigned short)-1)
201 alc_write_coefex_idx(codec, fw->nid, fw->idx, fw->val);
203 alc_update_coefex_idx(codec, fw->nid, fw->idx,
209 * GPIO setup tables, used in initialization
212 /* Enable GPIO mask and set output */
213 static void alc_setup_gpio(struct hda_codec *codec, unsigned int mask)
215 struct alc_spec *spec = codec->spec;
217 spec->gpio_mask |= mask;
218 spec->gpio_dir |= mask;
219 spec->gpio_data |= mask;
222 static void alc_write_gpio_data(struct hda_codec *codec)
224 struct alc_spec *spec = codec->spec;
226 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
230 static void alc_update_gpio_data(struct hda_codec *codec, unsigned int mask,
233 struct alc_spec *spec = codec->spec;
234 unsigned int oldval = spec->gpio_data;
237 spec->gpio_data |= mask;
239 spec->gpio_data &= ~mask;
240 if (oldval != spec->gpio_data)
241 alc_write_gpio_data(codec);
244 static void alc_write_gpio(struct hda_codec *codec)
246 struct alc_spec *spec = codec->spec;
248 if (!spec->gpio_mask)
251 snd_hda_codec_write(codec, codec->core.afg, 0,
252 AC_VERB_SET_GPIO_MASK, spec->gpio_mask);
253 snd_hda_codec_write(codec, codec->core.afg, 0,
254 AC_VERB_SET_GPIO_DIRECTION, spec->gpio_dir);
255 if (spec->gpio_write_delay)
257 alc_write_gpio_data(codec);
260 static void alc_fixup_gpio(struct hda_codec *codec, int action,
263 if (action == HDA_FIXUP_ACT_PRE_PROBE)
264 alc_setup_gpio(codec, mask);
267 static void alc_fixup_gpio1(struct hda_codec *codec,
268 const struct hda_fixup *fix, int action)
270 alc_fixup_gpio(codec, action, 0x01);
273 static void alc_fixup_gpio2(struct hda_codec *codec,
274 const struct hda_fixup *fix, int action)
276 alc_fixup_gpio(codec, action, 0x02);
279 static void alc_fixup_gpio3(struct hda_codec *codec,
280 const struct hda_fixup *fix, int action)
282 alc_fixup_gpio(codec, action, 0x03);
285 static void alc_fixup_gpio4(struct hda_codec *codec,
286 const struct hda_fixup *fix, int action)
288 alc_fixup_gpio(codec, action, 0x04);
292 * Fix hardware PLL issue
293 * On some codecs, the analog PLL gating control must be off while
294 * the default value is 1.
296 static void alc_fix_pll(struct hda_codec *codec)
298 struct alc_spec *spec = codec->spec;
301 alc_update_coefex_idx(codec, spec->pll_nid, spec->pll_coef_idx,
302 1 << spec->pll_coef_bit, 0);
305 static void alc_fix_pll_init(struct hda_codec *codec, hda_nid_t nid,
306 unsigned int coef_idx, unsigned int coef_bit)
308 struct alc_spec *spec = codec->spec;
310 spec->pll_coef_idx = coef_idx;
311 spec->pll_coef_bit = coef_bit;
315 /* update the master volume per volume-knob's unsol event */
316 static void alc_update_knob_master(struct hda_codec *codec,
317 struct hda_jack_callback *jack)
320 struct snd_kcontrol *kctl;
321 struct snd_ctl_elem_value *uctl;
323 kctl = snd_hda_find_mixer_ctl(codec, "Master Playback Volume");
326 uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
329 val = snd_hda_codec_read(codec, jack->nid, 0,
330 AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
331 val &= HDA_AMP_VOLMASK;
332 uctl->value.integer.value[0] = val;
333 uctl->value.integer.value[1] = val;
334 kctl->put(kctl, uctl);
338 static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
340 /* For some reason, the res given from ALC880 is broken.
341 Here we adjust it properly. */
342 snd_hda_jack_unsol_event(codec, res >> 2);
345 /* Change EAPD to verb control */
346 static void alc_fill_eapd_coef(struct hda_codec *codec)
350 coef = alc_get_coef0(codec);
352 switch (codec->core.vendor_id) {
354 alc_update_coef_idx(codec, 0x7, 0, 1<<5);
358 alc_update_coef_idx(codec, 0x7, 0, 1<<13);
361 if ((coef & 0x00f0) == 0x0010)
362 alc_update_coef_idx(codec, 0xd, 0, 1<<14);
363 if ((coef & 0x00f0) == 0x0020)
364 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
365 if ((coef & 0x00f0) == 0x0030)
366 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
372 alc_update_coef_idx(codec, 0x4, 1<<15, 0);
377 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
394 alc_update_coef_idx(codec, 0x10, 1<<9, 0);
397 alc_update_coef_idx(codec, 0xe, 0, 1<<0);
400 alc_update_coef_idx(codec, 0xa, 1<<13, 0);
408 alc_update_coef_idx(codec, 0x10, 1<<15, 0);
411 if ((coef & 0x00f0) == 0x0030)
412 alc_update_coef_idx(codec, 0x4, 1<<10, 0); /* EAPD Ctrl */
421 alc_update_coef_idx(codec, 0xd, 0, 1<<14); /* EAPD Ctrl */
424 alc_update_coef_idx(codec, 0x7, 3<<13, 0);
427 alc_update_coef_idx(codec, 0x4, 1<<10, 0);
430 if ((coef & 0x00f0) == 0x0020 || (coef & 0x00f0) == 0x0030)
431 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
434 alc_update_coef_idx(codec, 0x7, 1<<5, 0);
440 alc_update_coef_idx(codec, 0x7, 1<<1, 0);
445 /* additional initialization for ALC888 variants */
446 static void alc888_coef_init(struct hda_codec *codec)
448 switch (alc_get_coef0(codec) & 0x00f0) {
453 alc_update_coef_idx(codec, 7, 0, 0x2030); /* Turn EAPD to High */
458 /* turn on/off EAPD control (only if available) */
459 static void set_eapd(struct hda_codec *codec, hda_nid_t nid, int on)
461 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
463 if (snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD)
464 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_EAPD_BTLENABLE,
468 /* turn on/off EAPD controls of the codec */
469 static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
471 /* We currently only handle front, HP */
472 static hda_nid_t pins[] = {
473 0x0f, 0x10, 0x14, 0x15, 0x17, 0
476 for (p = pins; *p; p++)
477 set_eapd(codec, *p, on);
480 static int find_ext_mic_pin(struct hda_codec *codec);
482 static void alc_headset_mic_no_shutup(struct hda_codec *codec)
484 const struct hda_pincfg *pin;
485 int mic_pin = find_ext_mic_pin(codec);
488 /* don't shut up pins when unloading the driver; otherwise it breaks
489 * the default pin setup at the next load of the driver
491 if (codec->bus->shutdown)
494 snd_array_for_each(&codec->init_pins, i, pin) {
495 /* use read here for syncing after issuing each verb */
496 if (pin->nid != mic_pin)
497 snd_hda_codec_read(codec, pin->nid, 0,
498 AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
501 codec->pins_shutup = 1;
504 static void alc_shutup_pins(struct hda_codec *codec)
506 struct alc_spec *spec = codec->spec;
508 switch (codec->core.vendor_id) {
512 alc_headset_mic_no_shutup(codec);
515 if (!spec->no_shutup_pins)
516 snd_hda_shutup_pins(codec);
521 /* generic shutup callback;
522 * just turning off EAPD and a little pause for avoiding pop-noise
524 static void alc_eapd_shutup(struct hda_codec *codec)
526 struct alc_spec *spec = codec->spec;
528 alc_auto_setup_eapd(codec, false);
529 if (!spec->no_depop_delay)
531 alc_shutup_pins(codec);
534 /* generic EAPD initialization */
535 static void alc_auto_init_amp(struct hda_codec *codec, int type)
537 alc_fill_eapd_coef(codec);
538 alc_auto_setup_eapd(codec, true);
539 alc_write_gpio(codec);
541 case ALC_INIT_DEFAULT:
542 switch (codec->core.vendor_id) {
544 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x2010);
550 alc_update_coef_idx(codec, 7, 0, 0x2030);
553 alc888_coef_init(codec);
560 /* get a primary headphone pin if available */
561 static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
563 if (spec->gen.autocfg.hp_pins[0])
564 return spec->gen.autocfg.hp_pins[0];
565 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
566 return spec->gen.autocfg.line_out_pins[0];
571 * Realtek SSID verification
574 /* Could be any non-zero and even value. When used as fixup, tells
575 * the driver to ignore any present sku defines.
577 #define ALC_FIXUP_SKU_IGNORE (2)
579 static void alc_fixup_sku_ignore(struct hda_codec *codec,
580 const struct hda_fixup *fix, int action)
582 struct alc_spec *spec = codec->spec;
583 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
584 spec->cdefine.fixup = 1;
585 spec->cdefine.sku_cfg = ALC_FIXUP_SKU_IGNORE;
589 static void alc_fixup_no_depop_delay(struct hda_codec *codec,
590 const struct hda_fixup *fix, int action)
592 struct alc_spec *spec = codec->spec;
594 if (action == HDA_FIXUP_ACT_PROBE) {
595 spec->no_depop_delay = 1;
596 codec->depop_delay = 0;
600 static int alc_auto_parse_customize_define(struct hda_codec *codec)
602 unsigned int ass, tmp, i;
604 struct alc_spec *spec = codec->spec;
606 spec->cdefine.enable_pcbeep = 1; /* assume always enabled */
608 if (spec->cdefine.fixup) {
609 ass = spec->cdefine.sku_cfg;
610 if (ass == ALC_FIXUP_SKU_IGNORE)
615 if (!codec->bus->pci)
617 ass = codec->core.subsystem_id & 0xffff;
618 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
622 if (codec->core.vendor_id == 0x10ec0260)
624 ass = snd_hda_codec_get_pincfg(codec, nid);
627 codec_info(codec, "%s: SKU not ready 0x%08x\n",
628 codec->core.chip_name, ass);
634 for (i = 1; i < 16; i++) {
638 if (((ass >> 16) & 0xf) != tmp)
641 spec->cdefine.port_connectivity = ass >> 30;
642 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
643 spec->cdefine.check_sum = (ass >> 16) & 0xf;
644 spec->cdefine.customization = ass >> 8;
646 spec->cdefine.sku_cfg = ass;
647 spec->cdefine.external_amp = (ass & 0x38) >> 3;
648 spec->cdefine.platform_type = (ass & 0x4) >> 2;
649 spec->cdefine.swap = (ass & 0x2) >> 1;
650 spec->cdefine.override = ass & 0x1;
652 codec_dbg(codec, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
653 nid, spec->cdefine.sku_cfg);
654 codec_dbg(codec, "SKU: port_connectivity=0x%x\n",
655 spec->cdefine.port_connectivity);
656 codec_dbg(codec, "SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
657 codec_dbg(codec, "SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
658 codec_dbg(codec, "SKU: customization=0x%08x\n", spec->cdefine.customization);
659 codec_dbg(codec, "SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
660 codec_dbg(codec, "SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
661 codec_dbg(codec, "SKU: swap=0x%x\n", spec->cdefine.swap);
662 codec_dbg(codec, "SKU: override=0x%x\n", spec->cdefine.override);
667 /* return the position of NID in the list, or -1 if not found */
668 static int find_idx_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
671 for (i = 0; i < nums; i++)
676 /* return true if the given NID is found in the list */
677 static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
679 return find_idx_in_nid_list(nid, list, nums) >= 0;
682 /* check subsystem ID and set up device-specific initialization;
683 * return 1 if initialized, 0 if invalid SSID
685 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
686 * 31 ~ 16 : Manufacture ID
688 * 7 ~ 0 : Assembly ID
689 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
691 static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
693 unsigned int ass, tmp, i;
695 struct alc_spec *spec = codec->spec;
697 if (spec->cdefine.fixup) {
698 ass = spec->cdefine.sku_cfg;
699 if (ass == ALC_FIXUP_SKU_IGNORE)
704 ass = codec->core.subsystem_id & 0xffff;
705 if (codec->bus->pci &&
706 ass != codec->bus->pci->subsystem_device && (ass & 1))
709 /* invalid SSID, check the special NID pin defcfg instead */
711 * 31~30 : port connectivity
714 * 19~16 : Check sum (15:1)
719 if (codec->core.vendor_id == 0x10ec0260)
721 ass = snd_hda_codec_get_pincfg(codec, nid);
723 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
727 if ((ass >> 30) != 1) /* no physical connection */
732 for (i = 1; i < 16; i++) {
736 if (((ass >> 16) & 0xf) != tmp)
739 codec_dbg(codec, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
740 ass & 0xffff, codec->core.vendor_id);
744 * 2 : 0 --> Desktop, 1 --> Laptop
745 * 3~5 : External Amplifier control
748 tmp = (ass & 0x38) >> 3; /* external Amp control */
749 if (spec->init_amp == ALC_INIT_UNDEFINED) {
752 alc_setup_gpio(codec, 0x01);
755 alc_setup_gpio(codec, 0x02);
758 alc_setup_gpio(codec, 0x03);
762 spec->init_amp = ALC_INIT_DEFAULT;
767 /* is laptop or Desktop and enable the function "Mute internal speaker
768 * when the external headphone out jack is plugged"
773 * 10~8 : Jack location
774 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
776 * 15 : 1 --> enable the function "Mute internal speaker
777 * when the external headphone out jack is plugged"
779 if (!alc_get_hp_pin(spec)) {
781 tmp = (ass >> 11) & 0x3; /* HP to chassis */
783 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
784 spec->gen.autocfg.line_outs))
786 spec->gen.autocfg.hp_pins[0] = nid;
791 /* Check the validity of ALC subsystem-id
792 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
793 static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
795 if (!alc_subsystem_id(codec, ports)) {
796 struct alc_spec *spec = codec->spec;
798 "realtek: Enable default setup for auto mode as fallback\n");
799 spec->init_amp = ALC_INIT_DEFAULT;
806 static void alc_fixup_inv_dmic(struct hda_codec *codec,
807 const struct hda_fixup *fix, int action)
809 struct alc_spec *spec = codec->spec;
811 spec->gen.inv_dmic_split = 1;
815 static int alc_build_controls(struct hda_codec *codec)
819 err = snd_hda_gen_build_controls(codec);
823 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_BUILD);
832 static int alc_init(struct hda_codec *codec)
834 struct alc_spec *spec = codec->spec;
837 spec->init_hook(codec);
839 spec->gen.skip_verbs = 1; /* applied in below */
840 snd_hda_gen_init(codec);
842 alc_auto_init_amp(codec, spec->init_amp);
843 snd_hda_apply_verbs(codec); /* apply verbs here after own init */
845 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
850 static inline void alc_shutup(struct hda_codec *codec)
852 struct alc_spec *spec = codec->spec;
854 if (!snd_hda_get_bool_hint(codec, "shutup"))
855 return; /* disabled explicitly by hints */
857 if (spec && spec->shutup)
860 alc_shutup_pins(codec);
863 static void alc_reboot_notify(struct hda_codec *codec)
865 struct alc_spec *spec = codec->spec;
867 if (spec && spec->reboot_notify)
868 spec->reboot_notify(codec);
873 #define alc_free snd_hda_gen_free
876 static void alc_power_eapd(struct hda_codec *codec)
878 alc_auto_setup_eapd(codec, false);
881 static int alc_suspend(struct hda_codec *codec)
883 struct alc_spec *spec = codec->spec;
885 if (spec && spec->power_hook)
886 spec->power_hook(codec);
892 static int alc_resume(struct hda_codec *codec)
894 struct alc_spec *spec = codec->spec;
896 if (!spec->no_depop_delay)
897 msleep(150); /* to avoid pop noise */
898 codec->patch_ops.init(codec);
899 regcache_sync(codec->core.regmap);
900 hda_call_check_power_status(codec, 0x01);
907 static const struct hda_codec_ops alc_patch_ops = {
908 .build_controls = alc_build_controls,
909 .build_pcms = snd_hda_gen_build_pcms,
912 .unsol_event = snd_hda_jack_unsol_event,
914 .resume = alc_resume,
915 .suspend = alc_suspend,
916 .check_power_status = snd_hda_gen_check_power_status,
918 .reboot_notify = alc_reboot_notify,
922 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
925 * Rename codecs appropriately from COEF value or subvendor id
927 struct alc_codec_rename_table {
928 unsigned int vendor_id;
929 unsigned short coef_mask;
930 unsigned short coef_bits;
934 struct alc_codec_rename_pci_table {
935 unsigned int codec_vendor_id;
936 unsigned short pci_subvendor;
937 unsigned short pci_subdevice;
941 static struct alc_codec_rename_table rename_tbl[] = {
942 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
943 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
944 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
945 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
946 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
947 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
948 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
949 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
950 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
951 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
952 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
953 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
954 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
955 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
956 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
957 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
958 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
962 static struct alc_codec_rename_pci_table rename_pci_tbl[] = {
963 { 0x10ec0280, 0x1028, 0, "ALC3220" },
964 { 0x10ec0282, 0x1028, 0, "ALC3221" },
965 { 0x10ec0283, 0x1028, 0, "ALC3223" },
966 { 0x10ec0288, 0x1028, 0, "ALC3263" },
967 { 0x10ec0292, 0x1028, 0, "ALC3226" },
968 { 0x10ec0293, 0x1028, 0, "ALC3235" },
969 { 0x10ec0255, 0x1028, 0, "ALC3234" },
970 { 0x10ec0668, 0x1028, 0, "ALC3661" },
971 { 0x10ec0275, 0x1028, 0, "ALC3260" },
972 { 0x10ec0899, 0x1028, 0, "ALC3861" },
973 { 0x10ec0298, 0x1028, 0, "ALC3266" },
974 { 0x10ec0236, 0x1028, 0, "ALC3204" },
975 { 0x10ec0256, 0x1028, 0, "ALC3246" },
976 { 0x10ec0225, 0x1028, 0, "ALC3253" },
977 { 0x10ec0295, 0x1028, 0, "ALC3254" },
978 { 0x10ec0299, 0x1028, 0, "ALC3271" },
979 { 0x10ec0670, 0x1025, 0, "ALC669X" },
980 { 0x10ec0676, 0x1025, 0, "ALC679X" },
981 { 0x10ec0282, 0x1043, 0, "ALC3229" },
982 { 0x10ec0233, 0x1043, 0, "ALC3236" },
983 { 0x10ec0280, 0x103c, 0, "ALC3228" },
984 { 0x10ec0282, 0x103c, 0, "ALC3227" },
985 { 0x10ec0286, 0x103c, 0, "ALC3242" },
986 { 0x10ec0290, 0x103c, 0, "ALC3241" },
987 { 0x10ec0668, 0x103c, 0, "ALC3662" },
988 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
989 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
993 static int alc_codec_rename_from_preset(struct hda_codec *codec)
995 const struct alc_codec_rename_table *p;
996 const struct alc_codec_rename_pci_table *q;
998 for (p = rename_tbl; p->vendor_id; p++) {
999 if (p->vendor_id != codec->core.vendor_id)
1001 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
1002 return alc_codec_rename(codec, p->name);
1005 if (!codec->bus->pci)
1007 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
1008 if (q->codec_vendor_id != codec->core.vendor_id)
1010 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
1012 if (!q->pci_subdevice ||
1013 q->pci_subdevice == codec->bus->pci->subsystem_device)
1014 return alc_codec_rename(codec, q->name);
1022 * Digital-beep handlers
1024 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1026 /* additional beep mixers; private_value will be overwritten */
1027 static const struct snd_kcontrol_new alc_beep_mixer[] = {
1028 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT),
1029 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT),
1032 /* set up and create beep controls */
1033 static int set_beep_amp(struct alc_spec *spec, hda_nid_t nid,
1036 struct snd_kcontrol_new *knew;
1037 unsigned int beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir);
1040 for (i = 0; i < ARRAY_SIZE(alc_beep_mixer); i++) {
1041 knew = snd_hda_gen_add_kctl(&spec->gen, NULL,
1042 &alc_beep_mixer[i]);
1045 knew->private_value = beep_amp;
1050 static const struct snd_pci_quirk beep_white_list[] = {
1051 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1052 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1053 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1054 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1055 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1056 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1057 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1058 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1059 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1063 static inline int has_cdefine_beep(struct hda_codec *codec)
1065 struct alc_spec *spec = codec->spec;
1066 const struct snd_pci_quirk *q;
1067 q = snd_pci_quirk_lookup(codec->bus->pci, beep_white_list);
1070 return spec->cdefine.enable_pcbeep;
1073 #define set_beep_amp(spec, nid, idx, dir) 0
1074 #define has_cdefine_beep(codec) 0
1077 /* parse the BIOS configuration and set up the alc_spec */
1078 /* return 1 if successful, 0 if the proper config is not found,
1079 * or a negative error code
1081 static int alc_parse_auto_config(struct hda_codec *codec,
1082 const hda_nid_t *ignore_nids,
1083 const hda_nid_t *ssid_nids)
1085 struct alc_spec *spec = codec->spec;
1086 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
1089 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
1095 alc_ssid_check(codec, ssid_nids);
1097 err = snd_hda_gen_parse_auto_config(codec, cfg);
1104 /* common preparation job for alc_spec */
1105 static int alc_alloc_spec(struct hda_codec *codec, hda_nid_t mixer_nid)
1107 struct alc_spec *spec = kzalloc(sizeof(*spec), GFP_KERNEL);
1113 snd_hda_gen_spec_init(&spec->gen);
1114 spec->gen.mixer_nid = mixer_nid;
1115 spec->gen.own_eapd_ctl = 1;
1116 codec->single_adc_amp = 1;
1117 /* FIXME: do we need this for all Realtek codec models? */
1118 codec->spdif_status_reset = 1;
1119 codec->patch_ops = alc_patch_ops;
1121 err = alc_codec_rename_from_preset(codec);
1129 static int alc880_parse_auto_config(struct hda_codec *codec)
1131 static const hda_nid_t alc880_ignore[] = { 0x1d, 0 };
1132 static const hda_nid_t alc880_ssids[] = { 0x15, 0x1b, 0x14, 0 };
1133 return alc_parse_auto_config(codec, alc880_ignore, alc880_ssids);
1142 ALC880_FIXUP_MEDION_RIM,
1144 ALC880_FIXUP_LG_LW25,
1146 ALC880_FIXUP_EAPD_COEF,
1147 ALC880_FIXUP_TCL_S700,
1148 ALC880_FIXUP_VOL_KNOB,
1149 ALC880_FIXUP_FUJITSU,
1151 ALC880_FIXUP_UNIWILL,
1152 ALC880_FIXUP_UNIWILL_DIG,
1154 ALC880_FIXUP_ASUS_W5A,
1155 ALC880_FIXUP_3ST_BASE,
1157 ALC880_FIXUP_3ST_DIG,
1158 ALC880_FIXUP_5ST_BASE,
1160 ALC880_FIXUP_5ST_DIG,
1161 ALC880_FIXUP_6ST_BASE,
1163 ALC880_FIXUP_6ST_DIG,
1164 ALC880_FIXUP_6ST_AUTOMUTE,
1167 /* enable the volume-knob widget support on NID 0x21 */
1168 static void alc880_fixup_vol_knob(struct hda_codec *codec,
1169 const struct hda_fixup *fix, int action)
1171 if (action == HDA_FIXUP_ACT_PROBE)
1172 snd_hda_jack_detect_enable_callback(codec, 0x21,
1173 alc_update_knob_master);
1176 static const struct hda_fixup alc880_fixups[] = {
1177 [ALC880_FIXUP_GPIO1] = {
1178 .type = HDA_FIXUP_FUNC,
1179 .v.func = alc_fixup_gpio1,
1181 [ALC880_FIXUP_GPIO2] = {
1182 .type = HDA_FIXUP_FUNC,
1183 .v.func = alc_fixup_gpio2,
1185 [ALC880_FIXUP_MEDION_RIM] = {
1186 .type = HDA_FIXUP_VERBS,
1187 .v.verbs = (const struct hda_verb[]) {
1188 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1189 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1193 .chain_id = ALC880_FIXUP_GPIO2,
1195 [ALC880_FIXUP_LG] = {
1196 .type = HDA_FIXUP_PINS,
1197 .v.pins = (const struct hda_pintbl[]) {
1198 /* disable bogus unused pins */
1199 { 0x16, 0x411111f0 },
1200 { 0x18, 0x411111f0 },
1201 { 0x1a, 0x411111f0 },
1205 [ALC880_FIXUP_LG_LW25] = {
1206 .type = HDA_FIXUP_PINS,
1207 .v.pins = (const struct hda_pintbl[]) {
1208 { 0x1a, 0x0181344f }, /* line-in */
1209 { 0x1b, 0x0321403f }, /* headphone */
1213 [ALC880_FIXUP_W810] = {
1214 .type = HDA_FIXUP_PINS,
1215 .v.pins = (const struct hda_pintbl[]) {
1216 /* disable bogus unused pins */
1217 { 0x17, 0x411111f0 },
1221 .chain_id = ALC880_FIXUP_GPIO2,
1223 [ALC880_FIXUP_EAPD_COEF] = {
1224 .type = HDA_FIXUP_VERBS,
1225 .v.verbs = (const struct hda_verb[]) {
1226 /* change to EAPD mode */
1227 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1228 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
1232 [ALC880_FIXUP_TCL_S700] = {
1233 .type = HDA_FIXUP_VERBS,
1234 .v.verbs = (const struct hda_verb[]) {
1235 /* change to EAPD mode */
1236 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
1237 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
1241 .chain_id = ALC880_FIXUP_GPIO2,
1243 [ALC880_FIXUP_VOL_KNOB] = {
1244 .type = HDA_FIXUP_FUNC,
1245 .v.func = alc880_fixup_vol_knob,
1247 [ALC880_FIXUP_FUJITSU] = {
1248 /* override all pins as BIOS on old Amilo is broken */
1249 .type = HDA_FIXUP_PINS,
1250 .v.pins = (const struct hda_pintbl[]) {
1251 { 0x14, 0x0121401f }, /* HP */
1252 { 0x15, 0x99030120 }, /* speaker */
1253 { 0x16, 0x99030130 }, /* bass speaker */
1254 { 0x17, 0x411111f0 }, /* N/A */
1255 { 0x18, 0x411111f0 }, /* N/A */
1256 { 0x19, 0x01a19950 }, /* mic-in */
1257 { 0x1a, 0x411111f0 }, /* N/A */
1258 { 0x1b, 0x411111f0 }, /* N/A */
1259 { 0x1c, 0x411111f0 }, /* N/A */
1260 { 0x1d, 0x411111f0 }, /* N/A */
1261 { 0x1e, 0x01454140 }, /* SPDIF out */
1265 .chain_id = ALC880_FIXUP_VOL_KNOB,
1267 [ALC880_FIXUP_F1734] = {
1268 /* almost compatible with FUJITSU, but no bass and SPDIF */
1269 .type = HDA_FIXUP_PINS,
1270 .v.pins = (const struct hda_pintbl[]) {
1271 { 0x14, 0x0121401f }, /* HP */
1272 { 0x15, 0x99030120 }, /* speaker */
1273 { 0x16, 0x411111f0 }, /* N/A */
1274 { 0x17, 0x411111f0 }, /* N/A */
1275 { 0x18, 0x411111f0 }, /* N/A */
1276 { 0x19, 0x01a19950 }, /* mic-in */
1277 { 0x1a, 0x411111f0 }, /* N/A */
1278 { 0x1b, 0x411111f0 }, /* N/A */
1279 { 0x1c, 0x411111f0 }, /* N/A */
1280 { 0x1d, 0x411111f0 }, /* N/A */
1281 { 0x1e, 0x411111f0 }, /* N/A */
1285 .chain_id = ALC880_FIXUP_VOL_KNOB,
1287 [ALC880_FIXUP_UNIWILL] = {
1288 /* need to fix HP and speaker pins to be parsed correctly */
1289 .type = HDA_FIXUP_PINS,
1290 .v.pins = (const struct hda_pintbl[]) {
1291 { 0x14, 0x0121411f }, /* HP */
1292 { 0x15, 0x99030120 }, /* speaker */
1293 { 0x16, 0x99030130 }, /* bass speaker */
1297 [ALC880_FIXUP_UNIWILL_DIG] = {
1298 .type = HDA_FIXUP_PINS,
1299 .v.pins = (const struct hda_pintbl[]) {
1300 /* disable bogus unused pins */
1301 { 0x17, 0x411111f0 },
1302 { 0x19, 0x411111f0 },
1303 { 0x1b, 0x411111f0 },
1304 { 0x1f, 0x411111f0 },
1308 [ALC880_FIXUP_Z71V] = {
1309 .type = HDA_FIXUP_PINS,
1310 .v.pins = (const struct hda_pintbl[]) {
1311 /* set up the whole pins as BIOS is utterly broken */
1312 { 0x14, 0x99030120 }, /* speaker */
1313 { 0x15, 0x0121411f }, /* HP */
1314 { 0x16, 0x411111f0 }, /* N/A */
1315 { 0x17, 0x411111f0 }, /* N/A */
1316 { 0x18, 0x01a19950 }, /* mic-in */
1317 { 0x19, 0x411111f0 }, /* N/A */
1318 { 0x1a, 0x01813031 }, /* line-in */
1319 { 0x1b, 0x411111f0 }, /* N/A */
1320 { 0x1c, 0x411111f0 }, /* N/A */
1321 { 0x1d, 0x411111f0 }, /* N/A */
1322 { 0x1e, 0x0144111e }, /* SPDIF */
1326 [ALC880_FIXUP_ASUS_W5A] = {
1327 .type = HDA_FIXUP_PINS,
1328 .v.pins = (const struct hda_pintbl[]) {
1329 /* set up the whole pins as BIOS is utterly broken */
1330 { 0x14, 0x0121411f }, /* HP */
1331 { 0x15, 0x411111f0 }, /* N/A */
1332 { 0x16, 0x411111f0 }, /* N/A */
1333 { 0x17, 0x411111f0 }, /* N/A */
1334 { 0x18, 0x90a60160 }, /* mic */
1335 { 0x19, 0x411111f0 }, /* N/A */
1336 { 0x1a, 0x411111f0 }, /* N/A */
1337 { 0x1b, 0x411111f0 }, /* N/A */
1338 { 0x1c, 0x411111f0 }, /* N/A */
1339 { 0x1d, 0x411111f0 }, /* N/A */
1340 { 0x1e, 0xb743111e }, /* SPDIF out */
1344 .chain_id = ALC880_FIXUP_GPIO1,
1346 [ALC880_FIXUP_3ST_BASE] = {
1347 .type = HDA_FIXUP_PINS,
1348 .v.pins = (const struct hda_pintbl[]) {
1349 { 0x14, 0x01014010 }, /* line-out */
1350 { 0x15, 0x411111f0 }, /* N/A */
1351 { 0x16, 0x411111f0 }, /* N/A */
1352 { 0x17, 0x411111f0 }, /* N/A */
1353 { 0x18, 0x01a19c30 }, /* mic-in */
1354 { 0x19, 0x0121411f }, /* HP */
1355 { 0x1a, 0x01813031 }, /* line-in */
1356 { 0x1b, 0x02a19c40 }, /* front-mic */
1357 { 0x1c, 0x411111f0 }, /* N/A */
1358 { 0x1d, 0x411111f0 }, /* N/A */
1359 /* 0x1e is filled in below */
1360 { 0x1f, 0x411111f0 }, /* N/A */
1364 [ALC880_FIXUP_3ST] = {
1365 .type = HDA_FIXUP_PINS,
1366 .v.pins = (const struct hda_pintbl[]) {
1367 { 0x1e, 0x411111f0 }, /* N/A */
1371 .chain_id = ALC880_FIXUP_3ST_BASE,
1373 [ALC880_FIXUP_3ST_DIG] = {
1374 .type = HDA_FIXUP_PINS,
1375 .v.pins = (const struct hda_pintbl[]) {
1376 { 0x1e, 0x0144111e }, /* SPDIF */
1380 .chain_id = ALC880_FIXUP_3ST_BASE,
1382 [ALC880_FIXUP_5ST_BASE] = {
1383 .type = HDA_FIXUP_PINS,
1384 .v.pins = (const struct hda_pintbl[]) {
1385 { 0x14, 0x01014010 }, /* front */
1386 { 0x15, 0x411111f0 }, /* N/A */
1387 { 0x16, 0x01011411 }, /* CLFE */
1388 { 0x17, 0x01016412 }, /* surr */
1389 { 0x18, 0x01a19c30 }, /* mic-in */
1390 { 0x19, 0x0121411f }, /* HP */
1391 { 0x1a, 0x01813031 }, /* line-in */
1392 { 0x1b, 0x02a19c40 }, /* front-mic */
1393 { 0x1c, 0x411111f0 }, /* N/A */
1394 { 0x1d, 0x411111f0 }, /* N/A */
1395 /* 0x1e is filled in below */
1396 { 0x1f, 0x411111f0 }, /* N/A */
1400 [ALC880_FIXUP_5ST] = {
1401 .type = HDA_FIXUP_PINS,
1402 .v.pins = (const struct hda_pintbl[]) {
1403 { 0x1e, 0x411111f0 }, /* N/A */
1407 .chain_id = ALC880_FIXUP_5ST_BASE,
1409 [ALC880_FIXUP_5ST_DIG] = {
1410 .type = HDA_FIXUP_PINS,
1411 .v.pins = (const struct hda_pintbl[]) {
1412 { 0x1e, 0x0144111e }, /* SPDIF */
1416 .chain_id = ALC880_FIXUP_5ST_BASE,
1418 [ALC880_FIXUP_6ST_BASE] = {
1419 .type = HDA_FIXUP_PINS,
1420 .v.pins = (const struct hda_pintbl[]) {
1421 { 0x14, 0x01014010 }, /* front */
1422 { 0x15, 0x01016412 }, /* surr */
1423 { 0x16, 0x01011411 }, /* CLFE */
1424 { 0x17, 0x01012414 }, /* side */
1425 { 0x18, 0x01a19c30 }, /* mic-in */
1426 { 0x19, 0x02a19c40 }, /* front-mic */
1427 { 0x1a, 0x01813031 }, /* line-in */
1428 { 0x1b, 0x0121411f }, /* HP */
1429 { 0x1c, 0x411111f0 }, /* N/A */
1430 { 0x1d, 0x411111f0 }, /* N/A */
1431 /* 0x1e is filled in below */
1432 { 0x1f, 0x411111f0 }, /* N/A */
1436 [ALC880_FIXUP_6ST] = {
1437 .type = HDA_FIXUP_PINS,
1438 .v.pins = (const struct hda_pintbl[]) {
1439 { 0x1e, 0x411111f0 }, /* N/A */
1443 .chain_id = ALC880_FIXUP_6ST_BASE,
1445 [ALC880_FIXUP_6ST_DIG] = {
1446 .type = HDA_FIXUP_PINS,
1447 .v.pins = (const struct hda_pintbl[]) {
1448 { 0x1e, 0x0144111e }, /* SPDIF */
1452 .chain_id = ALC880_FIXUP_6ST_BASE,
1454 [ALC880_FIXUP_6ST_AUTOMUTE] = {
1455 .type = HDA_FIXUP_PINS,
1456 .v.pins = (const struct hda_pintbl[]) {
1457 { 0x1b, 0x0121401f }, /* HP with jack detect */
1460 .chained_before = true,
1461 .chain_id = ALC880_FIXUP_6ST_BASE,
1465 static const struct snd_pci_quirk alc880_fixup_tbl[] = {
1466 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810),
1467 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A),
1468 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V),
1469 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1),
1470 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE),
1471 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2),
1472 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF),
1473 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG),
1474 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734),
1475 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL),
1476 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB),
1477 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810),
1478 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
1479 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE),
1480 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU),
1481 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU),
1482 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734),
1483 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU),
1484 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG),
1485 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
1486 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
1487 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25),
1488 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
1490 /* Below is the copied entries from alc880_quirks.c.
1491 * It's not quite sure whether BIOS sets the correct pin-config table
1492 * on these machines, thus they are kept to be compatible with
1493 * the old static quirks. Once when it's confirmed to work without
1494 * these overrides, it'd be better to remove.
1496 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
1497 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
1498 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
1499 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
1500 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
1501 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
1502 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
1503 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
1504 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
1505 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
1506 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
1507 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
1508 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
1509 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
1510 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
1511 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
1512 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
1513 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
1514 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
1515 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
1516 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
1517 SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
1518 SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
1519 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1520 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1521 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1522 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1523 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1524 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1525 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
1526 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1527 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1528 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
1530 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
1531 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
1532 SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
1536 static const struct hda_model_fixup alc880_fixup_models[] = {
1537 {.id = ALC880_FIXUP_3ST, .name = "3stack"},
1538 {.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
1539 {.id = ALC880_FIXUP_5ST, .name = "5stack"},
1540 {.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
1541 {.id = ALC880_FIXUP_6ST, .name = "6stack"},
1542 {.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
1543 {.id = ALC880_FIXUP_6ST_AUTOMUTE, .name = "6stack-automute"},
1549 * OK, here we have finally the patch for ALC880
1551 static int patch_alc880(struct hda_codec *codec)
1553 struct alc_spec *spec;
1556 err = alc_alloc_spec(codec, 0x0b);
1561 spec->gen.need_dac_fix = 1;
1562 spec->gen.beep_nid = 0x01;
1564 codec->patch_ops.unsol_event = alc880_unsol_event;
1566 snd_hda_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
1568 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1570 /* automatic parse from the BIOS config */
1571 err = alc880_parse_auto_config(codec);
1575 if (!spec->gen.no_analog) {
1576 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
1581 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1594 static int alc260_parse_auto_config(struct hda_codec *codec)
1596 static const hda_nid_t alc260_ignore[] = { 0x17, 0 };
1597 static const hda_nid_t alc260_ssids[] = { 0x10, 0x15, 0x0f, 0 };
1598 return alc_parse_auto_config(codec, alc260_ignore, alc260_ssids);
1605 ALC260_FIXUP_HP_DC5750,
1606 ALC260_FIXUP_HP_PIN_0F,
1609 ALC260_FIXUP_GPIO1_TOGGLE,
1610 ALC260_FIXUP_REPLACER,
1611 ALC260_FIXUP_HP_B1900,
1613 ALC260_FIXUP_FSC_S7020,
1614 ALC260_FIXUP_FSC_S7020_JWSE,
1615 ALC260_FIXUP_VAIO_PINS,
1618 static void alc260_gpio1_automute(struct hda_codec *codec)
1620 struct alc_spec *spec = codec->spec;
1622 alc_update_gpio_data(codec, 0x01, spec->gen.hp_jack_present);
1625 static void alc260_fixup_gpio1_toggle(struct hda_codec *codec,
1626 const struct hda_fixup *fix, int action)
1628 struct alc_spec *spec = codec->spec;
1629 if (action == HDA_FIXUP_ACT_PROBE) {
1630 /* although the machine has only one output pin, we need to
1631 * toggle GPIO1 according to the jack state
1633 spec->gen.automute_hook = alc260_gpio1_automute;
1634 spec->gen.detect_hp = 1;
1635 spec->gen.automute_speaker = 1;
1636 spec->gen.autocfg.hp_pins[0] = 0x0f; /* copy it for automute */
1637 snd_hda_jack_detect_enable_callback(codec, 0x0f,
1638 snd_hda_gen_hp_automute);
1639 alc_setup_gpio(codec, 0x01);
1643 static void alc260_fixup_kn1(struct hda_codec *codec,
1644 const struct hda_fixup *fix, int action)
1646 struct alc_spec *spec = codec->spec;
1647 static const struct hda_pintbl pincfgs[] = {
1648 { 0x0f, 0x02214000 }, /* HP/speaker */
1649 { 0x12, 0x90a60160 }, /* int mic */
1650 { 0x13, 0x02a19000 }, /* ext mic */
1651 { 0x18, 0x01446000 }, /* SPDIF out */
1652 /* disable bogus I/O pins */
1653 { 0x10, 0x411111f0 },
1654 { 0x11, 0x411111f0 },
1655 { 0x14, 0x411111f0 },
1656 { 0x15, 0x411111f0 },
1657 { 0x16, 0x411111f0 },
1658 { 0x17, 0x411111f0 },
1659 { 0x19, 0x411111f0 },
1664 case HDA_FIXUP_ACT_PRE_PROBE:
1665 snd_hda_apply_pincfgs(codec, pincfgs);
1666 spec->init_amp = ALC_INIT_NONE;
1671 static void alc260_fixup_fsc_s7020(struct hda_codec *codec,
1672 const struct hda_fixup *fix, int action)
1674 struct alc_spec *spec = codec->spec;
1675 if (action == HDA_FIXUP_ACT_PRE_PROBE)
1676 spec->init_amp = ALC_INIT_NONE;
1679 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec *codec,
1680 const struct hda_fixup *fix, int action)
1682 struct alc_spec *spec = codec->spec;
1683 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1684 spec->gen.add_jack_modes = 1;
1685 spec->gen.hp_mic = 1;
1689 static const struct hda_fixup alc260_fixups[] = {
1690 [ALC260_FIXUP_HP_DC5750] = {
1691 .type = HDA_FIXUP_PINS,
1692 .v.pins = (const struct hda_pintbl[]) {
1693 { 0x11, 0x90130110 }, /* speaker */
1697 [ALC260_FIXUP_HP_PIN_0F] = {
1698 .type = HDA_FIXUP_PINS,
1699 .v.pins = (const struct hda_pintbl[]) {
1700 { 0x0f, 0x01214000 }, /* HP */
1704 [ALC260_FIXUP_COEF] = {
1705 .type = HDA_FIXUP_VERBS,
1706 .v.verbs = (const struct hda_verb[]) {
1707 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1708 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3040 },
1712 [ALC260_FIXUP_GPIO1] = {
1713 .type = HDA_FIXUP_FUNC,
1714 .v.func = alc_fixup_gpio1,
1716 [ALC260_FIXUP_GPIO1_TOGGLE] = {
1717 .type = HDA_FIXUP_FUNC,
1718 .v.func = alc260_fixup_gpio1_toggle,
1720 .chain_id = ALC260_FIXUP_HP_PIN_0F,
1722 [ALC260_FIXUP_REPLACER] = {
1723 .type = HDA_FIXUP_VERBS,
1724 .v.verbs = (const struct hda_verb[]) {
1725 { 0x1a, AC_VERB_SET_COEF_INDEX, 0x07 },
1726 { 0x1a, AC_VERB_SET_PROC_COEF, 0x3050 },
1730 .chain_id = ALC260_FIXUP_GPIO1_TOGGLE,
1732 [ALC260_FIXUP_HP_B1900] = {
1733 .type = HDA_FIXUP_FUNC,
1734 .v.func = alc260_fixup_gpio1_toggle,
1736 .chain_id = ALC260_FIXUP_COEF,
1738 [ALC260_FIXUP_KN1] = {
1739 .type = HDA_FIXUP_FUNC,
1740 .v.func = alc260_fixup_kn1,
1742 [ALC260_FIXUP_FSC_S7020] = {
1743 .type = HDA_FIXUP_FUNC,
1744 .v.func = alc260_fixup_fsc_s7020,
1746 [ALC260_FIXUP_FSC_S7020_JWSE] = {
1747 .type = HDA_FIXUP_FUNC,
1748 .v.func = alc260_fixup_fsc_s7020_jwse,
1750 .chain_id = ALC260_FIXUP_FSC_S7020,
1752 [ALC260_FIXUP_VAIO_PINS] = {
1753 .type = HDA_FIXUP_PINS,
1754 .v.pins = (const struct hda_pintbl[]) {
1755 /* Pin configs are missing completely on some VAIOs */
1756 { 0x0f, 0x01211020 },
1757 { 0x10, 0x0001003f },
1758 { 0x11, 0x411111f0 },
1759 { 0x12, 0x01a15930 },
1760 { 0x13, 0x411111f0 },
1761 { 0x14, 0x411111f0 },
1762 { 0x15, 0x411111f0 },
1763 { 0x16, 0x411111f0 },
1764 { 0x17, 0x411111f0 },
1765 { 0x18, 0x411111f0 },
1766 { 0x19, 0x411111f0 },
1772 static const struct snd_pci_quirk alc260_fixup_tbl[] = {
1773 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1),
1774 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF),
1775 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1),
1776 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750),
1777 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900),
1778 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS),
1779 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F),
1780 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020),
1781 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1),
1782 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1),
1783 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER),
1784 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF),
1788 static const struct hda_model_fixup alc260_fixup_models[] = {
1789 {.id = ALC260_FIXUP_GPIO1, .name = "gpio1"},
1790 {.id = ALC260_FIXUP_COEF, .name = "coef"},
1791 {.id = ALC260_FIXUP_FSC_S7020, .name = "fujitsu"},
1792 {.id = ALC260_FIXUP_FSC_S7020_JWSE, .name = "fujitsu-jwse"},
1798 static int patch_alc260(struct hda_codec *codec)
1800 struct alc_spec *spec;
1803 err = alc_alloc_spec(codec, 0x07);
1808 /* as quite a few machines require HP amp for speaker outputs,
1809 * it's easier to enable it unconditionally; even if it's unneeded,
1810 * it's almost harmless.
1812 spec->gen.prefer_hp_amp = 1;
1813 spec->gen.beep_nid = 0x01;
1815 spec->shutup = alc_eapd_shutup;
1817 snd_hda_pick_fixup(codec, alc260_fixup_models, alc260_fixup_tbl,
1819 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
1821 /* automatic parse from the BIOS config */
1822 err = alc260_parse_auto_config(codec);
1826 if (!spec->gen.no_analog) {
1827 err = set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
1832 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
1843 * ALC882/883/885/888/889 support
1845 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1846 * configuration. Each pin widget can choose any input DACs and a mixer.
1847 * Each ADC is connected from a mixer of all inputs. This makes possible
1848 * 6-channel independent captures.
1850 * In addition, an independent DAC for the multi-playback (not used in this
1858 ALC882_FIXUP_ABIT_AW9D_MAX,
1859 ALC882_FIXUP_LENOVO_Y530,
1860 ALC882_FIXUP_PB_M5210,
1861 ALC882_FIXUP_ACER_ASPIRE_7736,
1862 ALC882_FIXUP_ASUS_W90V,
1864 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1865 ALC889_FIXUP_VAIO_TT,
1866 ALC888_FIXUP_EEE1601,
1869 ALC883_FIXUP_ACER_EAPD,
1874 ALC882_FIXUP_ASUS_W2JC,
1875 ALC882_FIXUP_ACER_ASPIRE_4930G,
1876 ALC882_FIXUP_ACER_ASPIRE_8930G,
1877 ALC882_FIXUP_ASPIRE_8930G_VERBS,
1878 ALC885_FIXUP_MACPRO_GPIO,
1879 ALC889_FIXUP_DAC_ROUTE,
1880 ALC889_FIXUP_MBP_VREF,
1881 ALC889_FIXUP_IMAC91_VREF,
1882 ALC889_FIXUP_MBA11_VREF,
1883 ALC889_FIXUP_MBA21_VREF,
1884 ALC889_FIXUP_MP11_VREF,
1885 ALC889_FIXUP_MP41_VREF,
1886 ALC882_FIXUP_INV_DMIC,
1887 ALC882_FIXUP_NO_PRIMARY_HP,
1888 ALC887_FIXUP_ASUS_BASS,
1889 ALC887_FIXUP_BASS_CHMAP,
1890 ALC1220_FIXUP_GB_DUAL_CODECS,
1891 ALC1220_FIXUP_CLEVO_P950,
1892 ALC1220_FIXUP_CLEVO_PB51ED,
1893 ALC1220_FIXUP_CLEVO_PB51ED_PINS,
1896 static void alc889_fixup_coef(struct hda_codec *codec,
1897 const struct hda_fixup *fix, int action)
1899 if (action != HDA_FIXUP_ACT_INIT)
1901 alc_update_coef_idx(codec, 7, 0, 0x2030);
1904 /* set up GPIO at initialization */
1905 static void alc885_fixup_macpro_gpio(struct hda_codec *codec,
1906 const struct hda_fixup *fix, int action)
1908 struct alc_spec *spec = codec->spec;
1910 spec->gpio_write_delay = true;
1911 alc_fixup_gpio3(codec, fix, action);
1914 /* Fix the connection of some pins for ALC889:
1915 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1916 * work correctly (bko#42740)
1918 static void alc889_fixup_dac_route(struct hda_codec *codec,
1919 const struct hda_fixup *fix, int action)
1921 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
1922 /* fake the connections during parsing the tree */
1923 hda_nid_t conn1[2] = { 0x0c, 0x0d };
1924 hda_nid_t conn2[2] = { 0x0e, 0x0f };
1925 snd_hda_override_conn_list(codec, 0x14, 2, conn1);
1926 snd_hda_override_conn_list(codec, 0x15, 2, conn1);
1927 snd_hda_override_conn_list(codec, 0x18, 2, conn2);
1928 snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
1929 } else if (action == HDA_FIXUP_ACT_PROBE) {
1930 /* restore the connections */
1931 hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1932 snd_hda_override_conn_list(codec, 0x14, 5, conn);
1933 snd_hda_override_conn_list(codec, 0x15, 5, conn);
1934 snd_hda_override_conn_list(codec, 0x18, 5, conn);
1935 snd_hda_override_conn_list(codec, 0x1a, 5, conn);
1939 /* Set VREF on HP pin */
1940 static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1941 const struct hda_fixup *fix, int action)
1943 struct alc_spec *spec = codec->spec;
1944 static hda_nid_t nids[3] = { 0x14, 0x15, 0x19 };
1947 if (action != HDA_FIXUP_ACT_INIT)
1949 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1950 unsigned int val = snd_hda_codec_get_pincfg(codec, nids[i]);
1951 if (get_defcfg_device(val) != AC_JACK_HP_OUT)
1953 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1954 val |= AC_PINCTL_VREF_80;
1955 snd_hda_set_pin_ctl(codec, nids[i], val);
1956 spec->gen.keep_vref_in_automute = 1;
1961 static void alc889_fixup_mac_pins(struct hda_codec *codec,
1962 const hda_nid_t *nids, int num_nids)
1964 struct alc_spec *spec = codec->spec;
1967 for (i = 0; i < num_nids; i++) {
1969 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1970 val |= AC_PINCTL_VREF_50;
1971 snd_hda_set_pin_ctl(codec, nids[i], val);
1973 spec->gen.keep_vref_in_automute = 1;
1976 /* Set VREF on speaker pins on imac91 */
1977 static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1978 const struct hda_fixup *fix, int action)
1980 static hda_nid_t nids[2] = { 0x18, 0x1a };
1982 if (action == HDA_FIXUP_ACT_INIT)
1983 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1986 /* Set VREF on speaker pins on mba11 */
1987 static void alc889_fixup_mba11_vref(struct hda_codec *codec,
1988 const struct hda_fixup *fix, int action)
1990 static hda_nid_t nids[1] = { 0x18 };
1992 if (action == HDA_FIXUP_ACT_INIT)
1993 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1996 /* Set VREF on speaker pins on mba21 */
1997 static void alc889_fixup_mba21_vref(struct hda_codec *codec,
1998 const struct hda_fixup *fix, int action)
2000 static hda_nid_t nids[2] = { 0x18, 0x19 };
2002 if (action == HDA_FIXUP_ACT_INIT)
2003 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
2006 /* Don't take HP output as primary
2007 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2008 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2010 static void alc882_fixup_no_primary_hp(struct hda_codec *codec,
2011 const struct hda_fixup *fix, int action)
2013 struct alc_spec *spec = codec->spec;
2014 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
2015 spec->gen.no_primary_hp = 1;
2016 spec->gen.no_multi_io = 1;
2020 static void alc_fixup_bass_chmap(struct hda_codec *codec,
2021 const struct hda_fixup *fix, int action);
2023 /* For dual-codec configuration, we need to disable some features to avoid
2024 * conflicts of kctls and PCM streams
2026 static void alc_fixup_dual_codecs(struct hda_codec *codec,
2027 const struct hda_fixup *fix, int action)
2029 struct alc_spec *spec = codec->spec;
2031 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2033 /* disable vmaster */
2034 spec->gen.suppress_vmaster = 1;
2035 /* auto-mute and auto-mic switch don't work with multiple codecs */
2036 spec->gen.suppress_auto_mute = 1;
2037 spec->gen.suppress_auto_mic = 1;
2038 /* disable aamix as well */
2039 spec->gen.mixer_nid = 0;
2040 /* add location prefix to avoid conflicts */
2041 codec->force_pin_prefix = 1;
2044 static void rename_ctl(struct hda_codec *codec, const char *oldname,
2045 const char *newname)
2047 struct snd_kcontrol *kctl;
2049 kctl = snd_hda_find_mixer_ctl(codec, oldname);
2051 strcpy(kctl->id.name, newname);
2054 static void alc1220_fixup_gb_dual_codecs(struct hda_codec *codec,
2055 const struct hda_fixup *fix,
2058 alc_fixup_dual_codecs(codec, fix, action);
2060 case HDA_FIXUP_ACT_PRE_PROBE:
2061 /* override card longname to provide a unique UCM profile */
2062 strcpy(codec->card->longname, "HDAudio-Gigabyte-ALC1220DualCodecs");
2064 case HDA_FIXUP_ACT_BUILD:
2065 /* rename Capture controls depending on the codec */
2066 rename_ctl(codec, "Capture Volume",
2068 "Rear-Panel Capture Volume" :
2069 "Front-Panel Capture Volume");
2070 rename_ctl(codec, "Capture Switch",
2072 "Rear-Panel Capture Switch" :
2073 "Front-Panel Capture Switch");
2078 static void alc1220_fixup_clevo_p950(struct hda_codec *codec,
2079 const struct hda_fixup *fix,
2082 hda_nid_t conn1[1] = { 0x0c };
2084 if (action != HDA_FIXUP_ACT_PRE_PROBE)
2087 alc_update_coef_idx(codec, 0x7, 0, 0x3c3);
2088 /* We therefore want to make sure 0x14 (front headphone) and
2089 * 0x1b (speakers) use the stereo DAC 0x02
2091 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
2092 snd_hda_override_conn_list(codec, 0x1b, 1, conn1);
2095 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
2096 const struct hda_fixup *fix, int action);
2098 static void alc1220_fixup_clevo_pb51ed(struct hda_codec *codec,
2099 const struct hda_fixup *fix,
2102 alc1220_fixup_clevo_p950(codec, fix, action);
2103 alc_fixup_headset_mode_no_hp_mic(codec, fix, action);
2106 static const struct hda_fixup alc882_fixups[] = {
2107 [ALC882_FIXUP_ABIT_AW9D_MAX] = {
2108 .type = HDA_FIXUP_PINS,
2109 .v.pins = (const struct hda_pintbl[]) {
2110 { 0x15, 0x01080104 }, /* side */
2111 { 0x16, 0x01011012 }, /* rear */
2112 { 0x17, 0x01016011 }, /* clfe */
2116 [ALC882_FIXUP_LENOVO_Y530] = {
2117 .type = HDA_FIXUP_PINS,
2118 .v.pins = (const struct hda_pintbl[]) {
2119 { 0x15, 0x99130112 }, /* rear int speakers */
2120 { 0x16, 0x99130111 }, /* subwoofer */
2124 [ALC882_FIXUP_PB_M5210] = {
2125 .type = HDA_FIXUP_PINCTLS,
2126 .v.pins = (const struct hda_pintbl[]) {
2127 { 0x19, PIN_VREF50 },
2131 [ALC882_FIXUP_ACER_ASPIRE_7736] = {
2132 .type = HDA_FIXUP_FUNC,
2133 .v.func = alc_fixup_sku_ignore,
2135 [ALC882_FIXUP_ASUS_W90V] = {
2136 .type = HDA_FIXUP_PINS,
2137 .v.pins = (const struct hda_pintbl[]) {
2138 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2142 [ALC889_FIXUP_CD] = {
2143 .type = HDA_FIXUP_PINS,
2144 .v.pins = (const struct hda_pintbl[]) {
2145 { 0x1c, 0x993301f0 }, /* CD */
2149 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2150 .type = HDA_FIXUP_PINS,
2151 .v.pins = (const struct hda_pintbl[]) {
2152 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2156 .chain_id = ALC889_FIXUP_CD,
2158 [ALC889_FIXUP_VAIO_TT] = {
2159 .type = HDA_FIXUP_PINS,
2160 .v.pins = (const struct hda_pintbl[]) {
2161 { 0x17, 0x90170111 }, /* hidden surround speaker */
2165 [ALC888_FIXUP_EEE1601] = {
2166 .type = HDA_FIXUP_VERBS,
2167 .v.verbs = (const struct hda_verb[]) {
2168 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2169 { 0x20, AC_VERB_SET_PROC_COEF, 0x0838 },
2173 [ALC882_FIXUP_EAPD] = {
2174 .type = HDA_FIXUP_VERBS,
2175 .v.verbs = (const struct hda_verb[]) {
2176 /* change to EAPD mode */
2177 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2178 { 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
2182 [ALC883_FIXUP_EAPD] = {
2183 .type = HDA_FIXUP_VERBS,
2184 .v.verbs = (const struct hda_verb[]) {
2185 /* change to EAPD mode */
2186 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2187 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2191 [ALC883_FIXUP_ACER_EAPD] = {
2192 .type = HDA_FIXUP_VERBS,
2193 .v.verbs = (const struct hda_verb[]) {
2194 /* eanable EAPD on Acer laptops */
2195 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2196 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2200 [ALC882_FIXUP_GPIO1] = {
2201 .type = HDA_FIXUP_FUNC,
2202 .v.func = alc_fixup_gpio1,
2204 [ALC882_FIXUP_GPIO2] = {
2205 .type = HDA_FIXUP_FUNC,
2206 .v.func = alc_fixup_gpio2,
2208 [ALC882_FIXUP_GPIO3] = {
2209 .type = HDA_FIXUP_FUNC,
2210 .v.func = alc_fixup_gpio3,
2212 [ALC882_FIXUP_ASUS_W2JC] = {
2213 .type = HDA_FIXUP_FUNC,
2214 .v.func = alc_fixup_gpio1,
2216 .chain_id = ALC882_FIXUP_EAPD,
2218 [ALC889_FIXUP_COEF] = {
2219 .type = HDA_FIXUP_FUNC,
2220 .v.func = alc889_fixup_coef,
2222 [ALC882_FIXUP_ACER_ASPIRE_4930G] = {
2223 .type = HDA_FIXUP_PINS,
2224 .v.pins = (const struct hda_pintbl[]) {
2225 { 0x16, 0x99130111 }, /* CLFE speaker */
2226 { 0x17, 0x99130112 }, /* surround speaker */
2230 .chain_id = ALC882_FIXUP_GPIO1,
2232 [ALC882_FIXUP_ACER_ASPIRE_8930G] = {
2233 .type = HDA_FIXUP_PINS,
2234 .v.pins = (const struct hda_pintbl[]) {
2235 { 0x16, 0x99130111 }, /* CLFE speaker */
2236 { 0x1b, 0x99130112 }, /* surround speaker */
2240 .chain_id = ALC882_FIXUP_ASPIRE_8930G_VERBS,
2242 [ALC882_FIXUP_ASPIRE_8930G_VERBS] = {
2243 /* additional init verbs for Acer Aspire 8930G */
2244 .type = HDA_FIXUP_VERBS,
2245 .v.verbs = (const struct hda_verb[]) {
2246 /* Enable all DACs */
2247 /* DAC DISABLE/MUTE 1? */
2248 /* setting bits 1-5 disables DAC nids 0x02-0x06
2249 * apparently. Init=0x38 */
2250 { 0x20, AC_VERB_SET_COEF_INDEX, 0x03 },
2251 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2252 /* DAC DISABLE/MUTE 2? */
2253 /* some bit here disables the other DACs.
2255 { 0x20, AC_VERB_SET_COEF_INDEX, 0x08 },
2256 { 0x20, AC_VERB_SET_PROC_COEF, 0x0000 },
2258 * This laptop has a stereo digital microphone.
2259 * The mics are only 1cm apart which makes the stereo
2260 * useless. However, either the mic or the ALC889
2261 * makes the signal become a difference/sum signal
2262 * instead of standard stereo, which is annoying.
2263 * So instead we flip this bit which makes the
2264 * codec replicate the sum signal to both channels,
2265 * turning it into a normal mono mic.
2267 /* DMIC_CONTROL? Init value = 0x0001 */
2268 { 0x20, AC_VERB_SET_COEF_INDEX, 0x0b },
2269 { 0x20, AC_VERB_SET_PROC_COEF, 0x0003 },
2270 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2271 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2275 .chain_id = ALC882_FIXUP_GPIO1,
2277 [ALC885_FIXUP_MACPRO_GPIO] = {
2278 .type = HDA_FIXUP_FUNC,
2279 .v.func = alc885_fixup_macpro_gpio,
2281 [ALC889_FIXUP_DAC_ROUTE] = {
2282 .type = HDA_FIXUP_FUNC,
2283 .v.func = alc889_fixup_dac_route,
2285 [ALC889_FIXUP_MBP_VREF] = {
2286 .type = HDA_FIXUP_FUNC,
2287 .v.func = alc889_fixup_mbp_vref,
2289 .chain_id = ALC882_FIXUP_GPIO1,
2291 [ALC889_FIXUP_IMAC91_VREF] = {
2292 .type = HDA_FIXUP_FUNC,
2293 .v.func = alc889_fixup_imac91_vref,
2295 .chain_id = ALC882_FIXUP_GPIO1,
2297 [ALC889_FIXUP_MBA11_VREF] = {
2298 .type = HDA_FIXUP_FUNC,
2299 .v.func = alc889_fixup_mba11_vref,
2301 .chain_id = ALC889_FIXUP_MBP_VREF,
2303 [ALC889_FIXUP_MBA21_VREF] = {
2304 .type = HDA_FIXUP_FUNC,
2305 .v.func = alc889_fixup_mba21_vref,
2307 .chain_id = ALC889_FIXUP_MBP_VREF,
2309 [ALC889_FIXUP_MP11_VREF] = {
2310 .type = HDA_FIXUP_FUNC,
2311 .v.func = alc889_fixup_mba11_vref,
2313 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2315 [ALC889_FIXUP_MP41_VREF] = {
2316 .type = HDA_FIXUP_FUNC,
2317 .v.func = alc889_fixup_mbp_vref,
2319 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2321 [ALC882_FIXUP_INV_DMIC] = {
2322 .type = HDA_FIXUP_FUNC,
2323 .v.func = alc_fixup_inv_dmic,
2325 [ALC882_FIXUP_NO_PRIMARY_HP] = {
2326 .type = HDA_FIXUP_FUNC,
2327 .v.func = alc882_fixup_no_primary_hp,
2329 [ALC887_FIXUP_ASUS_BASS] = {
2330 .type = HDA_FIXUP_PINS,
2331 .v.pins = (const struct hda_pintbl[]) {
2332 {0x16, 0x99130130}, /* bass speaker */
2336 .chain_id = ALC887_FIXUP_BASS_CHMAP,
2338 [ALC887_FIXUP_BASS_CHMAP] = {
2339 .type = HDA_FIXUP_FUNC,
2340 .v.func = alc_fixup_bass_chmap,
2342 [ALC1220_FIXUP_GB_DUAL_CODECS] = {
2343 .type = HDA_FIXUP_FUNC,
2344 .v.func = alc1220_fixup_gb_dual_codecs,
2346 [ALC1220_FIXUP_CLEVO_P950] = {
2347 .type = HDA_FIXUP_FUNC,
2348 .v.func = alc1220_fixup_clevo_p950,
2350 [ALC1220_FIXUP_CLEVO_PB51ED] = {
2351 .type = HDA_FIXUP_FUNC,
2352 .v.func = alc1220_fixup_clevo_pb51ed,
2354 [ALC1220_FIXUP_CLEVO_PB51ED_PINS] = {
2355 .type = HDA_FIXUP_PINS,
2356 .v.pins = (const struct hda_pintbl[]) {
2357 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2361 .chain_id = ALC1220_FIXUP_CLEVO_PB51ED,
2365 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2366 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD),
2367 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2368 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2369 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD),
2370 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD),
2371 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD),
2372 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD),
2373 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2374 ALC882_FIXUP_ACER_ASPIRE_4930G),
2375 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2376 ALC882_FIXUP_ACER_ASPIRE_4930G),
2377 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2378 ALC882_FIXUP_ACER_ASPIRE_8930G),
2379 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2380 ALC882_FIXUP_ACER_ASPIRE_8930G),
2381 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2382 ALC882_FIXUP_ACER_ASPIRE_4930G),
2383 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2384 ALC882_FIXUP_ACER_ASPIRE_4930G),
2385 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2386 ALC882_FIXUP_ACER_ASPIRE_4930G),
2387 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
2388 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2389 ALC882_FIXUP_ACER_ASPIRE_4930G),
2390 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
2391 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
2392 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
2393 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD),
2394 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V),
2395 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC),
2396 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601),
2397 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS),
2398 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3),
2399 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT),
2400 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP),
2401 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP),
2402 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP),
2403 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP),
2405 /* All Apple entries are in codec SSIDs */
2406 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2407 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2408 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2409 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2410 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2411 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2412 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2413 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2414 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2415 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2416 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2417 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2418 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2419 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
2420 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF),
2421 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF),
2422 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF),
2423 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF),
2424 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF),
2425 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF),
2426 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF),
2427 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF),
2429 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2430 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2431 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2432 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2433 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
2434 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2435 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2436 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
2437 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
2438 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
2439 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
2440 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
2441 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2442 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
2443 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2444 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
2445 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
2446 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF),
2450 static const struct hda_model_fixup alc882_fixup_models[] = {
2451 {.id = ALC882_FIXUP_ABIT_AW9D_MAX, .name = "abit-aw9d"},
2452 {.id = ALC882_FIXUP_LENOVO_Y530, .name = "lenovo-y530"},
2453 {.id = ALC882_FIXUP_ACER_ASPIRE_7736, .name = "acer-aspire-7736"},
2454 {.id = ALC882_FIXUP_ASUS_W90V, .name = "asus-w90v"},
2455 {.id = ALC889_FIXUP_CD, .name = "cd"},
2456 {.id = ALC889_FIXUP_FRONT_HP_NO_PRESENCE, .name = "no-front-hp"},
2457 {.id = ALC889_FIXUP_VAIO_TT, .name = "vaio-tt"},
2458 {.id = ALC888_FIXUP_EEE1601, .name = "eee1601"},
2459 {.id = ALC882_FIXUP_EAPD, .name = "alc882-eapd"},
2460 {.id = ALC883_FIXUP_EAPD, .name = "alc883-eapd"},
2461 {.id = ALC882_FIXUP_GPIO1, .name = "gpio1"},
2462 {.id = ALC882_FIXUP_GPIO2, .name = "gpio2"},
2463 {.id = ALC882_FIXUP_GPIO3, .name = "gpio3"},
2464 {.id = ALC889_FIXUP_COEF, .name = "alc889-coef"},
2465 {.id = ALC882_FIXUP_ASUS_W2JC, .name = "asus-w2jc"},
2466 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
2467 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
2468 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
2469 {.id = ALC885_FIXUP_MACPRO_GPIO, .name = "macpro-gpio"},
2470 {.id = ALC889_FIXUP_DAC_ROUTE, .name = "dac-route"},
2471 {.id = ALC889_FIXUP_MBP_VREF, .name = "mbp-vref"},
2472 {.id = ALC889_FIXUP_IMAC91_VREF, .name = "imac91-vref"},
2473 {.id = ALC889_FIXUP_MBA11_VREF, .name = "mba11-vref"},
2474 {.id = ALC889_FIXUP_MBA21_VREF, .name = "mba21-vref"},
2475 {.id = ALC889_FIXUP_MP11_VREF, .name = "mp11-vref"},
2476 {.id = ALC889_FIXUP_MP41_VREF, .name = "mp41-vref"},
2477 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
2478 {.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
2479 {.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
2480 {.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
2481 {.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
2486 * BIOS auto configuration
2488 /* almost identical with ALC880 parser... */
2489 static int alc882_parse_auto_config(struct hda_codec *codec)
2491 static const hda_nid_t alc882_ignore[] = { 0x1d, 0 };
2492 static const hda_nid_t alc882_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2493 return alc_parse_auto_config(codec, alc882_ignore, alc882_ssids);
2498 static int patch_alc882(struct hda_codec *codec)
2500 struct alc_spec *spec;
2503 err = alc_alloc_spec(codec, 0x0b);
2509 switch (codec->core.vendor_id) {
2516 /* ALC883 and variants */
2517 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2521 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl,
2523 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2525 alc_auto_parse_customize_define(codec);
2527 if (has_cdefine_beep(codec))
2528 spec->gen.beep_nid = 0x01;
2530 /* automatic parse from the BIOS config */
2531 err = alc882_parse_auto_config(codec);
2535 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2536 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2541 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2554 static int alc262_parse_auto_config(struct hda_codec *codec)
2556 static const hda_nid_t alc262_ignore[] = { 0x1d, 0 };
2557 static const hda_nid_t alc262_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2558 return alc_parse_auto_config(codec, alc262_ignore, alc262_ssids);
2565 ALC262_FIXUP_FSC_H270,
2566 ALC262_FIXUP_FSC_S7110,
2567 ALC262_FIXUP_HP_Z200,
2569 ALC262_FIXUP_LENOVO_3000,
2571 ALC262_FIXUP_BENQ_T31,
2572 ALC262_FIXUP_INV_DMIC,
2573 ALC262_FIXUP_INTEL_BAYLEYBAY,
2576 static const struct hda_fixup alc262_fixups[] = {
2577 [ALC262_FIXUP_FSC_H270] = {
2578 .type = HDA_FIXUP_PINS,
2579 .v.pins = (const struct hda_pintbl[]) {
2580 { 0x14, 0x99130110 }, /* speaker */
2581 { 0x15, 0x0221142f }, /* front HP */
2582 { 0x1b, 0x0121141f }, /* rear HP */
2586 [ALC262_FIXUP_FSC_S7110] = {
2587 .type = HDA_FIXUP_PINS,
2588 .v.pins = (const struct hda_pintbl[]) {
2589 { 0x15, 0x90170110 }, /* speaker */
2593 .chain_id = ALC262_FIXUP_BENQ,
2595 [ALC262_FIXUP_HP_Z200] = {
2596 .type = HDA_FIXUP_PINS,
2597 .v.pins = (const struct hda_pintbl[]) {
2598 { 0x16, 0x99130120 }, /* internal speaker */
2602 [ALC262_FIXUP_TYAN] = {
2603 .type = HDA_FIXUP_PINS,
2604 .v.pins = (const struct hda_pintbl[]) {
2605 { 0x14, 0x1993e1f0 }, /* int AUX */
2609 [ALC262_FIXUP_LENOVO_3000] = {
2610 .type = HDA_FIXUP_PINCTLS,
2611 .v.pins = (const struct hda_pintbl[]) {
2612 { 0x19, PIN_VREF50 },
2616 .chain_id = ALC262_FIXUP_BENQ,
2618 [ALC262_FIXUP_BENQ] = {
2619 .type = HDA_FIXUP_VERBS,
2620 .v.verbs = (const struct hda_verb[]) {
2621 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2622 { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 },
2626 [ALC262_FIXUP_BENQ_T31] = {
2627 .type = HDA_FIXUP_VERBS,
2628 .v.verbs = (const struct hda_verb[]) {
2629 { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
2630 { 0x20, AC_VERB_SET_PROC_COEF, 0x3050 },
2634 [ALC262_FIXUP_INV_DMIC] = {
2635 .type = HDA_FIXUP_FUNC,
2636 .v.func = alc_fixup_inv_dmic,
2638 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2639 .type = HDA_FIXUP_FUNC,
2640 .v.func = alc_fixup_no_depop_delay,
2644 static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2645 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200),
2646 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
2647 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
2648 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2649 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
2650 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
2651 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2652 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2653 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2654 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2658 static const struct hda_model_fixup alc262_fixup_models[] = {
2659 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
2660 {.id = ALC262_FIXUP_FSC_H270, .name = "fsc-h270"},
2661 {.id = ALC262_FIXUP_FSC_S7110, .name = "fsc-s7110"},
2662 {.id = ALC262_FIXUP_HP_Z200, .name = "hp-z200"},
2663 {.id = ALC262_FIXUP_TYAN, .name = "tyan"},
2664 {.id = ALC262_FIXUP_LENOVO_3000, .name = "lenovo-3000"},
2665 {.id = ALC262_FIXUP_BENQ, .name = "benq"},
2666 {.id = ALC262_FIXUP_BENQ_T31, .name = "benq-t31"},
2667 {.id = ALC262_FIXUP_INTEL_BAYLEYBAY, .name = "bayleybay"},
2673 static int patch_alc262(struct hda_codec *codec)
2675 struct alc_spec *spec;
2678 err = alc_alloc_spec(codec, 0x0b);
2683 spec->gen.shared_mic_vref_pin = 0x18;
2685 spec->shutup = alc_eapd_shutup;
2688 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2691 alc_update_coefex_idx(codec, 0x1a, 7, 0, 0x80);
2693 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
2695 snd_hda_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
2697 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2699 alc_auto_parse_customize_define(codec);
2701 if (has_cdefine_beep(codec))
2702 spec->gen.beep_nid = 0x01;
2704 /* automatic parse from the BIOS config */
2705 err = alc262_parse_auto_config(codec);
2709 if (!spec->gen.no_analog && spec->gen.beep_nid) {
2710 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
2715 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2727 /* bind Beep switches of both NID 0x0f and 0x10 */
2728 static int alc268_beep_switch_put(struct snd_kcontrol *kcontrol,
2729 struct snd_ctl_elem_value *ucontrol)
2731 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2735 mutex_lock(&codec->control_mutex);
2736 pval = kcontrol->private_value;
2737 kcontrol->private_value = (pval & ~0xff) | 0x0f;
2738 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2740 kcontrol->private_value = (pval & ~0xff) | 0x10;
2741 err = snd_hda_mixer_amp_switch_put(kcontrol, ucontrol);
2743 kcontrol->private_value = pval;
2744 mutex_unlock(&codec->control_mutex);
2748 static const struct snd_kcontrol_new alc268_beep_mixer[] = {
2749 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT),
2751 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2752 .name = "Beep Playback Switch",
2753 .subdevice = HDA_SUBDEV_AMP_FLAG,
2754 .info = snd_hda_mixer_amp_switch_info,
2755 .get = snd_hda_mixer_amp_switch_get,
2756 .put = alc268_beep_switch_put,
2757 .private_value = HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT)
2761 /* set PCBEEP vol = 0, mute connections */
2762 static const struct hda_verb alc268_beep_init_verbs[] = {
2763 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
2764 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2765 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
2770 ALC268_FIXUP_INV_DMIC,
2771 ALC268_FIXUP_HP_EAPD,
2775 static const struct hda_fixup alc268_fixups[] = {
2776 [ALC268_FIXUP_INV_DMIC] = {
2777 .type = HDA_FIXUP_FUNC,
2778 .v.func = alc_fixup_inv_dmic,
2780 [ALC268_FIXUP_HP_EAPD] = {
2781 .type = HDA_FIXUP_VERBS,
2782 .v.verbs = (const struct hda_verb[]) {
2783 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 0},
2787 [ALC268_FIXUP_SPDIF] = {
2788 .type = HDA_FIXUP_PINS,
2789 .v.pins = (const struct hda_pintbl[]) {
2790 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2796 static const struct hda_model_fixup alc268_fixup_models[] = {
2797 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
2798 {.id = ALC268_FIXUP_HP_EAPD, .name = "hp-eapd"},
2799 {.id = ALC268_FIXUP_SPDIF, .name = "spdif"},
2803 static const struct snd_pci_quirk alc268_fixup_tbl[] = {
2804 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF),
2805 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC),
2806 /* below is codec SSID since multiple Toshiba laptops have the
2807 * same PCI SSID 1179:ff00
2809 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD),
2814 * BIOS auto configuration
2816 static int alc268_parse_auto_config(struct hda_codec *codec)
2818 static const hda_nid_t alc268_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2819 return alc_parse_auto_config(codec, NULL, alc268_ssids);
2824 static int patch_alc268(struct hda_codec *codec)
2826 struct alc_spec *spec;
2829 /* ALC268 has no aa-loopback mixer */
2830 err = alc_alloc_spec(codec, 0);
2835 spec->gen.beep_nid = 0x01;
2837 spec->shutup = alc_eapd_shutup;
2839 snd_hda_pick_fixup(codec, alc268_fixup_models, alc268_fixup_tbl, alc268_fixups);
2840 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
2842 /* automatic parse from the BIOS config */
2843 err = alc268_parse_auto_config(codec);
2847 if (err > 0 && !spec->gen.no_analog &&
2848 spec->gen.autocfg.speaker_pins[0] != 0x1d) {
2849 for (i = 0; i < ARRAY_SIZE(alc268_beep_mixer); i++) {
2850 if (!snd_hda_gen_add_kctl(&spec->gen, NULL,
2851 &alc268_beep_mixer[i])) {
2856 snd_hda_add_verbs(codec, alc268_beep_init_verbs);
2857 if (!query_amp_caps(codec, 0x1d, HDA_INPUT))
2858 /* override the amp caps for beep generator */
2859 snd_hda_override_amp_caps(codec, 0x1d, HDA_INPUT,
2860 (0x0c << AC_AMPCAP_OFFSET_SHIFT) |
2861 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT) |
2862 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT) |
2863 (0 << AC_AMPCAP_MUTE_SHIFT));
2866 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
2879 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
2880 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2883 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
2884 .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
2887 /* different alc269-variants */
2889 ALC269_TYPE_ALC269VA,
2890 ALC269_TYPE_ALC269VB,
2891 ALC269_TYPE_ALC269VC,
2892 ALC269_TYPE_ALC269VD,
2911 * BIOS auto configuration
2913 static int alc269_parse_auto_config(struct hda_codec *codec)
2915 static const hda_nid_t alc269_ignore[] = { 0x1d, 0 };
2916 static const hda_nid_t alc269_ssids[] = { 0, 0x1b, 0x14, 0x21 };
2917 static const hda_nid_t alc269va_ssids[] = { 0x15, 0x1b, 0x14, 0 };
2918 struct alc_spec *spec = codec->spec;
2919 const hda_nid_t *ssids;
2921 switch (spec->codec_variant) {
2922 case ALC269_TYPE_ALC269VA:
2923 case ALC269_TYPE_ALC269VC:
2924 case ALC269_TYPE_ALC280:
2925 case ALC269_TYPE_ALC284:
2926 case ALC269_TYPE_ALC293:
2927 ssids = alc269va_ssids;
2929 case ALC269_TYPE_ALC269VB:
2930 case ALC269_TYPE_ALC269VD:
2931 case ALC269_TYPE_ALC282:
2932 case ALC269_TYPE_ALC283:
2933 case ALC269_TYPE_ALC286:
2934 case ALC269_TYPE_ALC298:
2935 case ALC269_TYPE_ALC255:
2936 case ALC269_TYPE_ALC256:
2937 case ALC269_TYPE_ALC257:
2938 case ALC269_TYPE_ALC215:
2939 case ALC269_TYPE_ALC225:
2940 case ALC269_TYPE_ALC294:
2941 case ALC269_TYPE_ALC300:
2942 case ALC269_TYPE_ALC700:
2943 ssids = alc269_ssids;
2946 ssids = alc269_ssids;
2950 return alc_parse_auto_config(codec, alc269_ignore, ssids);
2953 static void alc269vb_toggle_power_output(struct hda_codec *codec, int power_up)
2955 alc_update_coef_idx(codec, 0x04, 1 << 11, power_up ? (1 << 11) : 0);
2958 static void alc269_shutup(struct hda_codec *codec)
2960 struct alc_spec *spec = codec->spec;
2962 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
2963 alc269vb_toggle_power_output(codec, 0);
2964 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
2965 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
2968 alc_shutup_pins(codec);
2971 static struct coef_fw alc282_coefs[] = {
2972 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2973 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2974 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2975 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2976 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2977 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2978 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2979 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2980 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2981 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2982 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2983 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2984 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2985 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2986 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2987 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2988 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2989 WRITE_COEF(0x63, 0x2902), /* PLL */
2990 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2991 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2992 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2993 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2994 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2995 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2996 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2997 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2998 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2999 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3000 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3004 static void alc282_restore_default_value(struct hda_codec *codec)
3006 alc_process_coef_fw(codec, alc282_coefs);
3009 static void alc282_init(struct hda_codec *codec)
3011 struct alc_spec *spec = codec->spec;
3012 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3016 alc282_restore_default_value(codec);
3020 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3021 coef78 = alc_read_coef_idx(codec, 0x78);
3023 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3024 /* Headphone capless set to high power mode */
3025 alc_write_coef_idx(codec, 0x78, 0x9004);
3030 snd_hda_codec_write(codec, hp_pin, 0,
3031 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3036 snd_hda_codec_write(codec, hp_pin, 0,
3037 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3042 /* Headphone capless set to normal mode */
3043 alc_write_coef_idx(codec, 0x78, coef78);
3046 static void alc282_shutup(struct hda_codec *codec)
3048 struct alc_spec *spec = codec->spec;
3049 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3054 alc269_shutup(codec);
3058 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3059 coef78 = alc_read_coef_idx(codec, 0x78);
3060 alc_write_coef_idx(codec, 0x78, 0x9004);
3065 snd_hda_codec_write(codec, hp_pin, 0,
3066 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3071 if (!spec->no_shutup_pins)
3072 snd_hda_codec_write(codec, hp_pin, 0,
3073 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3078 alc_auto_setup_eapd(codec, false);
3079 alc_shutup_pins(codec);
3080 alc_write_coef_idx(codec, 0x78, coef78);
3083 static struct coef_fw alc283_coefs[] = {
3084 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3085 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3086 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3087 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3088 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3089 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3090 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3091 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3092 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3093 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3094 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3095 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3096 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3097 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3098 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3099 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3100 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3101 WRITE_COEF(0x2e, 0x2902), /* PLL */
3102 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3103 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3104 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3105 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3106 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3107 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3108 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3109 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3110 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3111 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3112 WRITE_COEF(0x49, 0x0), /* test mode */
3113 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3114 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3115 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3116 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3120 static void alc283_restore_default_value(struct hda_codec *codec)
3122 alc_process_coef_fw(codec, alc283_coefs);
3125 static void alc283_init(struct hda_codec *codec)
3127 struct alc_spec *spec = codec->spec;
3128 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3131 alc283_restore_default_value(codec);
3137 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3139 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3140 /* Headphone capless set to high power mode */
3141 alc_write_coef_idx(codec, 0x43, 0x9004);
3143 snd_hda_codec_write(codec, hp_pin, 0,
3144 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3149 snd_hda_codec_write(codec, hp_pin, 0,
3150 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3154 /* Index 0x46 Combo jack auto switch control 2 */
3155 /* 3k pull low control for Headset jack. */
3156 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3157 /* Headphone capless set to normal mode */
3158 alc_write_coef_idx(codec, 0x43, 0x9614);
3161 static void alc283_shutup(struct hda_codec *codec)
3163 struct alc_spec *spec = codec->spec;
3164 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3168 alc269_shutup(codec);
3172 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3174 alc_write_coef_idx(codec, 0x43, 0x9004);
3176 /*depop hp during suspend*/
3177 alc_write_coef_idx(codec, 0x06, 0x2100);
3179 snd_hda_codec_write(codec, hp_pin, 0,
3180 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3185 if (!spec->no_shutup_pins)
3186 snd_hda_codec_write(codec, hp_pin, 0,
3187 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3189 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3193 alc_auto_setup_eapd(codec, false);
3194 alc_shutup_pins(codec);
3195 alc_write_coef_idx(codec, 0x43, 0x9614);
3198 static void alc256_init(struct hda_codec *codec)
3200 struct alc_spec *spec = codec->spec;
3201 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3209 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3214 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3216 snd_hda_codec_write(codec, hp_pin, 0,
3217 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3222 snd_hda_codec_write(codec, hp_pin, 0,
3223 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3228 alc_update_coef_idx(codec, 0x46, 3 << 12, 0);
3229 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3230 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3231 alc_update_coefex_idx(codec, 0x53, 0x02, 0x8000, 0 << 15);
3232 alc_update_coef_idx(codec, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
3235 static void alc256_shutup(struct hda_codec *codec)
3237 struct alc_spec *spec = codec->spec;
3238 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3242 alc269_shutup(codec);
3246 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3251 snd_hda_codec_write(codec, hp_pin, 0,
3252 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3257 /* 3k pull low control for Headset jack. */
3258 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3259 alc_update_coef_idx(codec, 0x46, 0, 3 << 12);
3261 if (!spec->no_shutup_pins)
3262 snd_hda_codec_write(codec, hp_pin, 0,
3263 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3268 alc_auto_setup_eapd(codec, false);
3269 alc_shutup_pins(codec);
3272 static void alc225_init(struct hda_codec *codec)
3274 struct alc_spec *spec = codec->spec;
3275 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3276 bool hp1_pin_sense, hp2_pin_sense;
3283 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3284 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3286 if (hp1_pin_sense || hp2_pin_sense)
3289 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3292 snd_hda_codec_write(codec, hp_pin, 0,
3293 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3295 snd_hda_codec_write(codec, 0x16, 0,
3296 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3298 if (hp1_pin_sense || hp2_pin_sense)
3302 snd_hda_codec_write(codec, hp_pin, 0,
3303 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3305 snd_hda_codec_write(codec, 0x16, 0,
3306 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3308 if (hp1_pin_sense || hp2_pin_sense)
3311 alc_update_coef_idx(codec, 0x4a, 3 << 10, 0);
3312 alc_update_coefex_idx(codec, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3315 static void alc225_shutup(struct hda_codec *codec)
3317 struct alc_spec *spec = codec->spec;
3318 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3319 bool hp1_pin_sense, hp2_pin_sense;
3322 alc269_shutup(codec);
3326 /* 3k pull low control for Headset jack. */
3327 alc_update_coef_idx(codec, 0x4a, 0, 3 << 10);
3329 hp1_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3330 hp2_pin_sense = snd_hda_jack_detect(codec, 0x16);
3332 if (hp1_pin_sense || hp2_pin_sense)
3336 snd_hda_codec_write(codec, hp_pin, 0,
3337 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3339 snd_hda_codec_write(codec, 0x16, 0,
3340 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3342 if (hp1_pin_sense || hp2_pin_sense)
3346 snd_hda_codec_write(codec, hp_pin, 0,
3347 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3349 snd_hda_codec_write(codec, 0x16, 0,
3350 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3352 if (hp1_pin_sense || hp2_pin_sense)
3355 alc_auto_setup_eapd(codec, false);
3356 alc_shutup_pins(codec);
3359 static void alc_default_init(struct hda_codec *codec)
3361 struct alc_spec *spec = codec->spec;
3362 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3370 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3375 snd_hda_codec_write(codec, hp_pin, 0,
3376 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3381 snd_hda_codec_write(codec, hp_pin, 0,
3382 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
3388 static void alc_default_shutup(struct hda_codec *codec)
3390 struct alc_spec *spec = codec->spec;
3391 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3395 alc269_shutup(codec);
3399 hp_pin_sense = snd_hda_jack_detect(codec, hp_pin);
3404 snd_hda_codec_write(codec, hp_pin, 0,
3405 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3410 if (!spec->no_shutup_pins)
3411 snd_hda_codec_write(codec, hp_pin, 0,
3412 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3417 alc_auto_setup_eapd(codec, false);
3418 alc_shutup_pins(codec);
3421 static void alc294_hp_init(struct hda_codec *codec)
3423 struct alc_spec *spec = codec->spec;
3424 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3430 snd_hda_codec_write(codec, hp_pin, 0,
3431 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
3435 if (!spec->no_shutup_pins)
3436 snd_hda_codec_write(codec, hp_pin, 0,
3437 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
3439 alc_update_coef_idx(codec, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3440 alc_update_coefex_idx(codec, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3442 /* Wait for depop procedure finish */
3443 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3444 for (i = 0; i < 20 && val & 0x0080; i++) {
3446 val = alc_read_coefex_idx(codec, 0x58, 0x01);
3448 /* Set HP depop to auto mode */
3449 alc_update_coef_idx(codec, 0x6f, 0x000f, 0x000b);
3453 static void alc294_init(struct hda_codec *codec)
3455 struct alc_spec *spec = codec->spec;
3457 if (!spec->done_hp_init) {
3458 alc294_hp_init(codec);
3459 spec->done_hp_init = true;
3461 alc_default_init(codec);
3464 static void alc5505_coef_set(struct hda_codec *codec, unsigned int index_reg,
3467 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3468 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val & 0xffff); /* LSB */
3469 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_PROC_COEF, val >> 16); /* MSB */
3472 static int alc5505_coef_get(struct hda_codec *codec, unsigned int index_reg)
3476 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_COEF_INDEX, index_reg >> 1);
3477 val = snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3479 val |= snd_hda_codec_read(codec, 0x51, 0, AC_VERB_GET_PROC_COEF, 0)
3484 static void alc5505_dsp_halt(struct hda_codec *codec)
3488 alc5505_coef_set(codec, 0x3000, 0x000c); /* DSP CPU stop */
3489 alc5505_coef_set(codec, 0x880c, 0x0008); /* DDR enter self refresh */
3490 alc5505_coef_set(codec, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3491 alc5505_coef_set(codec, 0x6230, 0xfc0d4011); /* Disable Input OP */
3492 alc5505_coef_set(codec, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3493 alc5505_coef_set(codec, 0x61b0, 0x00005b17); /* Stop PLL1 */
3494 alc5505_coef_set(codec, 0x61b8, 0x04133303); /* Stop PLL3 */
3495 val = alc5505_coef_get(codec, 0x6220);
3496 alc5505_coef_set(codec, 0x6220, (val | 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3499 static void alc5505_dsp_back_from_halt(struct hda_codec *codec)
3501 alc5505_coef_set(codec, 0x61b8, 0x04133302);
3502 alc5505_coef_set(codec, 0x61b0, 0x00005b16);
3503 alc5505_coef_set(codec, 0x61b4, 0x040a2b02);
3504 alc5505_coef_set(codec, 0x6230, 0xf80d4011);
3505 alc5505_coef_set(codec, 0x6220, 0x2002010f);
3506 alc5505_coef_set(codec, 0x880c, 0x00000004);
3509 static void alc5505_dsp_init(struct hda_codec *codec)
3513 alc5505_dsp_halt(codec);
3514 alc5505_dsp_back_from_halt(codec);
3515 alc5505_coef_set(codec, 0x61b0, 0x5b14); /* PLL1 control */
3516 alc5505_coef_set(codec, 0x61b0, 0x5b16);
3517 alc5505_coef_set(codec, 0x61b4, 0x04132b00); /* PLL2 control */
3518 alc5505_coef_set(codec, 0x61b4, 0x04132b02);
3519 alc5505_coef_set(codec, 0x61b8, 0x041f3300); /* PLL3 control*/
3520 alc5505_coef_set(codec, 0x61b8, 0x041f3302);
3521 snd_hda_codec_write(codec, 0x51, 0, AC_VERB_SET_CODEC_RESET, 0); /* Function reset */
3522 alc5505_coef_set(codec, 0x61b8, 0x041b3302);
3523 alc5505_coef_set(codec, 0x61b8, 0x04173302);
3524 alc5505_coef_set(codec, 0x61b8, 0x04163302);
3525 alc5505_coef_set(codec, 0x8800, 0x348b328b); /* DRAM control */
3526 alc5505_coef_set(codec, 0x8808, 0x00020022); /* DRAM control */
3527 alc5505_coef_set(codec, 0x8818, 0x00000400); /* DRAM control */
3529 val = alc5505_coef_get(codec, 0x6200) >> 16; /* Read revision ID */
3531 alc5505_coef_set(codec, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3533 alc5505_coef_set(codec, 0x6220, 0x6002018f);
3535 alc5505_coef_set(codec, 0x61ac, 0x055525f0); /**/
3536 alc5505_coef_set(codec, 0x61c0, 0x12230080); /* Clock control */
3537 alc5505_coef_set(codec, 0x61b4, 0x040e2b02); /* PLL2 control */
3538 alc5505_coef_set(codec, 0x61bc, 0x010234f8); /* OSC Control */
3539 alc5505_coef_set(codec, 0x880c, 0x00000004); /* DRAM Function control */
3540 alc5505_coef_set(codec, 0x880c, 0x00000003);
3541 alc5505_coef_set(codec, 0x880c, 0x00000010);
3543 #ifdef HALT_REALTEK_ALC5505
3544 alc5505_dsp_halt(codec);
3548 #ifdef HALT_REALTEK_ALC5505
3549 #define alc5505_dsp_suspend(codec) /* NOP */
3550 #define alc5505_dsp_resume(codec) /* NOP */
3552 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3553 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3557 static int alc269_suspend(struct hda_codec *codec)
3559 struct alc_spec *spec = codec->spec;
3561 if (spec->has_alc5505_dsp)
3562 alc5505_dsp_suspend(codec);
3563 return alc_suspend(codec);
3566 static int alc269_resume(struct hda_codec *codec)
3568 struct alc_spec *spec = codec->spec;
3570 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3571 alc269vb_toggle_power_output(codec, 0);
3572 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3573 (alc_get_coef0(codec) & 0x00ff) == 0x018) {
3577 codec->patch_ops.init(codec);
3579 if (spec->codec_variant == ALC269_TYPE_ALC269VB)
3580 alc269vb_toggle_power_output(codec, 1);
3581 if (spec->codec_variant == ALC269_TYPE_ALC269VB &&
3582 (alc_get_coef0(codec) & 0x00ff) == 0x017) {
3586 regcache_sync(codec->core.regmap);
3587 hda_call_check_power_status(codec, 0x01);
3589 /* on some machine, the BIOS will clear the codec gpio data when enter
3590 * suspend, and won't restore the data after resume, so we restore it
3593 if (spec->gpio_data)
3594 alc_write_gpio_data(codec);
3596 if (spec->has_alc5505_dsp)
3597 alc5505_dsp_resume(codec);
3601 #endif /* CONFIG_PM */
3603 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
3604 const struct hda_fixup *fix, int action)
3606 struct alc_spec *spec = codec->spec;
3608 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3609 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3612 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec *codec,
3613 const struct hda_fixup *fix,
3616 unsigned int cfg_headphone = snd_hda_codec_get_pincfg(codec, 0x21);
3617 unsigned int cfg_headset_mic = snd_hda_codec_get_pincfg(codec, 0x19);
3619 if (cfg_headphone && cfg_headset_mic == 0x411111f0)
3620 snd_hda_codec_set_pincfg(codec, 0x19,
3621 (cfg_headphone & ~AC_DEFCFG_DEVICE) |
3622 (AC_JACK_MIC_IN << AC_DEFCFG_DEVICE_SHIFT));
3625 static void alc269_fixup_hweq(struct hda_codec *codec,
3626 const struct hda_fixup *fix, int action)
3628 if (action == HDA_FIXUP_ACT_INIT)
3629 alc_update_coef_idx(codec, 0x1e, 0, 0x80);
3632 static void alc269_fixup_headset_mic(struct hda_codec *codec,
3633 const struct hda_fixup *fix, int action)
3635 struct alc_spec *spec = codec->spec;
3637 if (action == HDA_FIXUP_ACT_PRE_PROBE)
3638 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3641 static void alc271_fixup_dmic(struct hda_codec *codec,
3642 const struct hda_fixup *fix, int action)
3644 static const struct hda_verb verbs[] = {
3645 {0x20, AC_VERB_SET_COEF_INDEX, 0x0d},
3646 {0x20, AC_VERB_SET_PROC_COEF, 0x4000},
3651 if (strcmp(codec->core.chip_name, "ALC271X") &&
3652 strcmp(codec->core.chip_name, "ALC269VB"))
3654 cfg = snd_hda_codec_get_pincfg(codec, 0x12);
3655 if (get_defcfg_connect(cfg) == AC_JACK_PORT_FIXED)
3656 snd_hda_sequence_write(codec, verbs);
3659 static void alc269_fixup_pcm_44k(struct hda_codec *codec,
3660 const struct hda_fixup *fix, int action)
3662 struct alc_spec *spec = codec->spec;
3664 if (action != HDA_FIXUP_ACT_PROBE)
3667 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3668 * fix the sample rate of analog I/O to 44.1kHz
3670 spec->gen.stream_analog_playback = &alc269_44k_pcm_analog_playback;
3671 spec->gen.stream_analog_capture = &alc269_44k_pcm_analog_capture;
3674 static void alc269_fixup_stereo_dmic(struct hda_codec *codec,
3675 const struct hda_fixup *fix, int action)
3677 /* The digital-mic unit sends PDM (differential signal) instead of
3678 * the standard PCM, thus you can't record a valid mono stream as is.
3679 * Below is a workaround specific to ALC269 to control the dmic
3680 * signal source as mono.
3682 if (action == HDA_FIXUP_ACT_INIT)
3683 alc_update_coef_idx(codec, 0x07, 0, 0x80);
3686 static void alc269_quanta_automute(struct hda_codec *codec)
3688 snd_hda_gen_update_outputs(codec);
3690 alc_write_coef_idx(codec, 0x0c, 0x680);
3691 alc_write_coef_idx(codec, 0x0c, 0x480);
3694 static void alc269_fixup_quanta_mute(struct hda_codec *codec,
3695 const struct hda_fixup *fix, int action)
3697 struct alc_spec *spec = codec->spec;
3698 if (action != HDA_FIXUP_ACT_PROBE)
3700 spec->gen.automute_hook = alc269_quanta_automute;
3703 static void alc269_x101_hp_automute_hook(struct hda_codec *codec,
3704 struct hda_jack_callback *jack)
3706 struct alc_spec *spec = codec->spec;
3709 snd_hda_gen_hp_automute(codec, jack);
3711 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3713 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3716 snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3720 static void alc269_fixup_x101_headset_mic(struct hda_codec *codec,
3721 const struct hda_fixup *fix, int action)
3723 struct alc_spec *spec = codec->spec;
3724 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3725 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
3726 spec->gen.hp_automute_hook = alc269_x101_hp_automute_hook;
3731 /* update mute-LED according to the speaker mute state via mic VREF pin */
3732 static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
3734 struct hda_codec *codec = private_data;
3735 struct alc_spec *spec = codec->spec;
3736 unsigned int pinval;
3738 if (spec->mute_led_polarity)
3740 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3741 pinval &= ~AC_PINCTL_VREFEN;
3742 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3743 if (spec->mute_led_nid) {
3744 /* temporarily power up/down for setting VREF */
3745 snd_hda_power_up_pm(codec);
3746 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3747 snd_hda_power_down_pm(codec);
3751 /* Make sure the led works even in runtime suspend */
3752 static unsigned int led_power_filter(struct hda_codec *codec,
3754 unsigned int power_state)
3756 struct alc_spec *spec = codec->spec;
3758 if (power_state != AC_PWRST_D3 || nid == 0 ||
3759 (nid != spec->mute_led_nid && nid != spec->cap_mute_led_nid))
3762 /* Set pin ctl again, it might have just been set to 0 */
3763 snd_hda_set_pin_ctl(codec, nid,
3764 snd_hda_codec_get_pin_target(codec, nid));
3766 return snd_hda_gen_path_power_filter(codec, nid, power_state);
3769 static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
3770 const struct hda_fixup *fix, int action)
3772 struct alc_spec *spec = codec->spec;
3773 const struct dmi_device *dev = NULL;
3775 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3778 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
3780 if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &pol, &pin) != 2)
3782 if (pin < 0x0a || pin >= 0x10)
3784 spec->mute_led_polarity = pol;
3785 spec->mute_led_nid = pin - 0x0a + 0x18;
3786 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3787 spec->gen.vmaster_mute_enum = 1;
3788 codec->power_filter = led_power_filter;
3790 "Detected mute LED for %x:%d\n", spec->mute_led_nid,
3791 spec->mute_led_polarity);
3796 static void alc269_fixup_hp_mute_led_micx(struct hda_codec *codec,
3797 const struct hda_fixup *fix,
3798 int action, hda_nid_t pin)
3800 struct alc_spec *spec = codec->spec;
3802 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3803 spec->mute_led_polarity = 0;
3804 spec->mute_led_nid = pin;
3805 spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
3806 spec->gen.vmaster_mute_enum = 1;
3807 codec->power_filter = led_power_filter;
3811 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
3812 const struct hda_fixup *fix, int action)
3814 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x18);
3817 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
3818 const struct hda_fixup *fix, int action)
3820 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x19);
3823 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec,
3824 const struct hda_fixup *fix, int action)
3826 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1b);
3829 /* update LED status via GPIO */
3830 static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask,
3833 struct alc_spec *spec = codec->spec;
3835 if (spec->mute_led_polarity)
3837 alc_update_gpio_data(codec, mask, !enabled); /* muted -> LED on */
3840 /* turn on/off mute LED via GPIO per vmaster hook */
3841 static void alc_fixup_gpio_mute_hook(void *private_data, int enabled)
3843 struct hda_codec *codec = private_data;
3844 struct alc_spec *spec = codec->spec;
3846 alc_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled);
3849 /* turn on/off mic-mute LED via GPIO per capture hook */
3850 static void alc_gpio_micmute_update(struct hda_codec *codec)
3852 struct alc_spec *spec = codec->spec;
3854 alc_update_gpio_led(codec, spec->gpio_mic_led_mask,
3855 spec->gen.micmute_led.led_value);
3858 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
3859 static void alc_fixup_hp_gpio_led(struct hda_codec *codec,
3861 unsigned int mute_mask,
3862 unsigned int micmute_mask)
3864 struct alc_spec *spec = codec->spec;
3866 alc_fixup_gpio(codec, action, mute_mask | micmute_mask);
3868 if (action != HDA_FIXUP_ACT_PRE_PROBE)
3871 spec->gpio_mute_led_mask = mute_mask;
3872 spec->gen.vmaster_mute.hook = alc_fixup_gpio_mute_hook;
3875 spec->gpio_mic_led_mask = micmute_mask;
3876 snd_hda_gen_add_micmute_led(codec, alc_gpio_micmute_update);
3880 static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
3881 const struct hda_fixup *fix, int action)
3883 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
3886 static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
3887 const struct hda_fixup *fix, int action)
3889 alc_fixup_hp_gpio_led(codec, action, 0x02, 0x20);
3892 /* turn on/off mic-mute LED per capture hook */
3893 static void alc_cap_micmute_update(struct hda_codec *codec)
3895 struct alc_spec *spec = codec->spec;
3896 unsigned int pinval;
3898 if (!spec->cap_mute_led_nid)
3900 pinval = snd_hda_codec_get_pin_target(codec, spec->cap_mute_led_nid);
3901 pinval &= ~AC_PINCTL_VREFEN;
3902 if (spec->gen.micmute_led.led_value)
3903 pinval |= AC_PINCTL_VREF_80;
3905 pinval |= AC_PINCTL_VREF_HIZ;
3906 snd_hda_set_pin_ctl_cache(codec, spec->cap_mute_led_nid, pinval);
3909 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec *codec,
3910 const struct hda_fixup *fix, int action)
3912 struct alc_spec *spec = codec->spec;
3914 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
3915 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3916 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
3917 * enable headphone amp
3919 spec->gpio_mask |= 0x10;
3920 spec->gpio_dir |= 0x10;
3921 spec->cap_mute_led_nid = 0x18;
3922 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
3923 codec->power_filter = led_power_filter;
3927 static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
3928 const struct hda_fixup *fix, int action)
3930 struct alc_spec *spec = codec->spec;
3932 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
3933 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3934 spec->cap_mute_led_nid = 0x18;
3935 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
3936 codec->power_filter = led_power_filter;
3940 #if IS_REACHABLE(CONFIG_INPUT)
3941 static void gpio2_mic_hotkey_event(struct hda_codec *codec,
3942 struct hda_jack_callback *event)
3944 struct alc_spec *spec = codec->spec;
3946 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3947 send both key on and key off event for every interrupt. */
3948 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 1);
3949 input_sync(spec->kb_dev);
3950 input_report_key(spec->kb_dev, spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX], 0);
3951 input_sync(spec->kb_dev);
3954 static int alc_register_micmute_input_device(struct hda_codec *codec)
3956 struct alc_spec *spec = codec->spec;
3959 spec->kb_dev = input_allocate_device();
3960 if (!spec->kb_dev) {
3961 codec_err(codec, "Out of memory (input_allocate_device)\n");
3965 spec->alc_mute_keycode_map[ALC_KEY_MICMUTE_INDEX] = KEY_MICMUTE;
3967 spec->kb_dev->name = "Microphone Mute Button";
3968 spec->kb_dev->evbit[0] = BIT_MASK(EV_KEY);
3969 spec->kb_dev->keycodesize = sizeof(spec->alc_mute_keycode_map[0]);
3970 spec->kb_dev->keycodemax = ARRAY_SIZE(spec->alc_mute_keycode_map);
3971 spec->kb_dev->keycode = spec->alc_mute_keycode_map;
3972 for (i = 0; i < ARRAY_SIZE(spec->alc_mute_keycode_map); i++)
3973 set_bit(spec->alc_mute_keycode_map[i], spec->kb_dev->keybit);
3975 if (input_register_device(spec->kb_dev)) {
3976 codec_err(codec, "input_register_device failed\n");
3977 input_free_device(spec->kb_dev);
3978 spec->kb_dev = NULL;
3985 /* GPIO1 = set according to SKU external amp
3986 * GPIO2 = mic mute hotkey
3988 * GPIO4 = mic mute LED
3990 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
3991 const struct hda_fixup *fix, int action)
3993 struct alc_spec *spec = codec->spec;
3995 alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
3996 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3997 spec->init_amp = ALC_INIT_DEFAULT;
3998 if (alc_register_micmute_input_device(codec) != 0)
4001 spec->gpio_mask |= 0x06;
4002 spec->gpio_dir |= 0x02;
4003 spec->gpio_data |= 0x02;
4004 snd_hda_codec_write_cache(codec, codec->core.afg, 0,
4005 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
4006 snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
4007 gpio2_mic_hotkey_event);
4015 case HDA_FIXUP_ACT_FREE:
4016 input_unregister_device(spec->kb_dev);
4017 spec->kb_dev = NULL;
4021 /* Line2 = mic mute hotkey
4022 * GPIO2 = mic mute LED
4024 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec *codec,
4025 const struct hda_fixup *fix, int action)
4027 struct alc_spec *spec = codec->spec;
4029 alc_fixup_hp_gpio_led(codec, action, 0, 0x04);
4030 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4031 spec->init_amp = ALC_INIT_DEFAULT;
4032 if (alc_register_micmute_input_device(codec) != 0)
4035 snd_hda_jack_detect_enable_callback(codec, 0x1b,
4036 gpio2_mic_hotkey_event);
4044 case HDA_FIXUP_ACT_FREE:
4045 input_unregister_device(spec->kb_dev);
4046 spec->kb_dev = NULL;
4050 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4051 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4054 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
4055 const struct hda_fixup *fix, int action)
4057 struct alc_spec *spec = codec->spec;
4059 alc269_fixup_hp_mute_led_micx(codec, fix, action, 0x1a);
4060 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4061 spec->cap_mute_led_nid = 0x18;
4062 snd_hda_gen_add_micmute_led(codec, alc_cap_micmute_update);
4066 static struct coef_fw alc225_pre_hsmode[] = {
4067 UPDATE_COEF(0x4a, 1<<8, 0),
4068 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4069 UPDATE_COEF(0x63, 3<<14, 3<<14),
4070 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4071 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4072 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4073 UPDATE_COEF(0x4a, 3<<10, 0),
4077 static void alc_headset_mode_unplugged(struct hda_codec *codec)
4079 static struct coef_fw coef0255[] = {
4080 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4081 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4082 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4083 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4084 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4087 static struct coef_fw coef0256[] = {
4088 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4089 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4090 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4091 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4092 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4095 static struct coef_fw coef0233[] = {
4096 WRITE_COEF(0x1b, 0x0c0b),
4097 WRITE_COEF(0x45, 0xc429),
4098 UPDATE_COEF(0x35, 0x4000, 0),
4099 WRITE_COEF(0x06, 0x2104),
4100 WRITE_COEF(0x1a, 0x0001),
4101 WRITE_COEF(0x26, 0x0004),
4102 WRITE_COEF(0x32, 0x42a3),
4105 static struct coef_fw coef0288[] = {
4106 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4107 UPDATE_COEF(0x50, 0x2000, 0x2000),
4108 UPDATE_COEF(0x56, 0x0006, 0x0006),
4109 UPDATE_COEF(0x66, 0x0008, 0),
4110 UPDATE_COEF(0x67, 0x2000, 0),
4113 static struct coef_fw coef0298[] = {
4114 UPDATE_COEF(0x19, 0x1300, 0x0300),
4117 static struct coef_fw coef0292[] = {
4118 WRITE_COEF(0x76, 0x000e),
4119 WRITE_COEF(0x6c, 0x2400),
4120 WRITE_COEF(0x18, 0x7308),
4121 WRITE_COEF(0x6b, 0xc429),
4124 static struct coef_fw coef0293[] = {
4125 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4126 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4127 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4128 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4129 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4130 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4133 static struct coef_fw coef0668[] = {
4134 WRITE_COEF(0x15, 0x0d40),
4135 WRITE_COEF(0xb7, 0x802b),
4138 static struct coef_fw coef0225[] = {
4139 UPDATE_COEF(0x63, 3<<14, 0),
4142 static struct coef_fw coef0274[] = {
4143 UPDATE_COEF(0x4a, 0x0100, 0),
4144 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4145 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4146 UPDATE_COEF(0x4a, 0x0010, 0),
4147 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4148 WRITE_COEF(0x45, 0x5289),
4149 UPDATE_COEF(0x4a, 0x0c00, 0),
4153 switch (codec->core.vendor_id) {
4155 alc_process_coef_fw(codec, coef0255);
4159 alc_process_coef_fw(codec, coef0256);
4164 alc_process_coef_fw(codec, coef0274);
4168 alc_process_coef_fw(codec, coef0233);
4172 alc_process_coef_fw(codec, coef0288);
4175 alc_process_coef_fw(codec, coef0298);
4176 alc_process_coef_fw(codec, coef0288);
4179 alc_process_coef_fw(codec, coef0292);
4182 alc_process_coef_fw(codec, coef0293);
4185 alc_process_coef_fw(codec, coef0668);
4193 alc_process_coef_fw(codec, alc225_pre_hsmode);
4194 alc_process_coef_fw(codec, coef0225);
4197 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4200 codec_dbg(codec, "Headset jack set to unplugged mode.\n");
4204 static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
4207 static struct coef_fw coef0255[] = {
4208 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4209 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4212 static struct coef_fw coef0256[] = {
4213 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4214 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4215 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4218 static struct coef_fw coef0233[] = {
4219 UPDATE_COEF(0x35, 0, 1<<14),
4220 WRITE_COEF(0x06, 0x2100),
4221 WRITE_COEF(0x1a, 0x0021),
4222 WRITE_COEF(0x26, 0x008c),
4225 static struct coef_fw coef0288[] = {
4226 UPDATE_COEF(0x4f, 0x00c0, 0),
4227 UPDATE_COEF(0x50, 0x2000, 0),
4228 UPDATE_COEF(0x56, 0x0006, 0),
4229 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4230 UPDATE_COEF(0x66, 0x0008, 0x0008),
4231 UPDATE_COEF(0x67, 0x2000, 0x2000),
4234 static struct coef_fw coef0292[] = {
4235 WRITE_COEF(0x19, 0xa208),
4236 WRITE_COEF(0x2e, 0xacf0),
4239 static struct coef_fw coef0293[] = {
4240 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4241 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4242 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4245 static struct coef_fw coef0688[] = {
4246 WRITE_COEF(0xb7, 0x802b),
4247 WRITE_COEF(0xb5, 0x1040),
4248 UPDATE_COEF(0xc3, 0, 1<<12),
4251 static struct coef_fw coef0225[] = {
4252 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4253 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4254 UPDATE_COEF(0x63, 3<<14, 0),
4257 static struct coef_fw coef0274[] = {
4258 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4259 UPDATE_COEF(0x4a, 0x0010, 0),
4260 UPDATE_COEF(0x6b, 0xf000, 0),
4264 switch (codec->core.vendor_id) {
4266 alc_write_coef_idx(codec, 0x45, 0xc489);
4267 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4268 alc_process_coef_fw(codec, coef0255);
4269 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4273 alc_write_coef_idx(codec, 0x45, 0xc489);
4274 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4275 alc_process_coef_fw(codec, coef0256);
4276 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4281 alc_write_coef_idx(codec, 0x45, 0x4689);
4282 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4283 alc_process_coef_fw(codec, coef0274);
4284 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4288 alc_write_coef_idx(codec, 0x45, 0xc429);
4289 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4290 alc_process_coef_fw(codec, coef0233);
4291 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4296 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4297 alc_process_coef_fw(codec, coef0288);
4298 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4301 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4302 alc_process_coef_fw(codec, coef0292);
4305 /* Set to TRS mode */
4306 alc_write_coef_idx(codec, 0x45, 0xc429);
4307 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4308 alc_process_coef_fw(codec, coef0293);
4309 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4312 alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14);
4316 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4317 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4320 alc_write_coef_idx(codec, 0x11, 0x0001);
4321 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4322 alc_process_coef_fw(codec, coef0688);
4323 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4331 alc_process_coef_fw(codec, alc225_pre_hsmode);
4332 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
4333 snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
4334 alc_process_coef_fw(codec, coef0225);
4335 snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
4338 codec_dbg(codec, "Headset jack set to mic-in mode.\n");
4341 static void alc_headset_mode_default(struct hda_codec *codec)
4343 static struct coef_fw coef0225[] = {
4344 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4345 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4346 UPDATE_COEF(0x49, 3<<8, 0<<8),
4347 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4348 UPDATE_COEF(0x63, 3<<14, 0),
4349 UPDATE_COEF(0x67, 0xf000, 0x3000),
4352 static struct coef_fw coef0255[] = {
4353 WRITE_COEF(0x45, 0xc089),
4354 WRITE_COEF(0x45, 0xc489),
4355 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4356 WRITE_COEF(0x49, 0x0049),
4359 static struct coef_fw coef0256[] = {
4360 WRITE_COEF(0x45, 0xc489),
4361 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4362 WRITE_COEF(0x49, 0x0049),
4363 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4364 WRITE_COEF(0x06, 0x6100),
4367 static struct coef_fw coef0233[] = {
4368 WRITE_COEF(0x06, 0x2100),
4369 WRITE_COEF(0x32, 0x4ea3),
4372 static struct coef_fw coef0288[] = {
4373 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4374 UPDATE_COEF(0x50, 0x2000, 0x2000),
4375 UPDATE_COEF(0x56, 0x0006, 0x0006),
4376 UPDATE_COEF(0x66, 0x0008, 0),
4377 UPDATE_COEF(0x67, 0x2000, 0),
4380 static struct coef_fw coef0292[] = {
4381 WRITE_COEF(0x76, 0x000e),
4382 WRITE_COEF(0x6c, 0x2400),
4383 WRITE_COEF(0x6b, 0xc429),
4384 WRITE_COEF(0x18, 0x7308),
4387 static struct coef_fw coef0293[] = {
4388 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4389 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4390 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4393 static struct coef_fw coef0688[] = {
4394 WRITE_COEF(0x11, 0x0041),
4395 WRITE_COEF(0x15, 0x0d40),
4396 WRITE_COEF(0xb7, 0x802b),
4399 static struct coef_fw coef0274[] = {
4400 WRITE_COEF(0x45, 0x4289),
4401 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4402 UPDATE_COEF(0x6b, 0x0f00, 0),
4403 UPDATE_COEF(0x49, 0x0300, 0x0300),
4407 switch (codec->core.vendor_id) {
4414 alc_process_coef_fw(codec, alc225_pre_hsmode);
4415 alc_process_coef_fw(codec, coef0225);
4418 alc_process_coef_fw(codec, coef0255);
4422 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4423 alc_write_coef_idx(codec, 0x45, 0xc089);
4425 alc_process_coef_fw(codec, coef0256);
4430 alc_process_coef_fw(codec, coef0274);
4434 alc_process_coef_fw(codec, coef0233);
4439 alc_process_coef_fw(codec, coef0288);
4442 alc_process_coef_fw(codec, coef0292);
4445 alc_process_coef_fw(codec, coef0293);
4448 alc_process_coef_fw(codec, coef0688);
4451 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4454 codec_dbg(codec, "Headset jack set to headphone (default) mode.\n");
4458 static void alc_headset_mode_ctia(struct hda_codec *codec)
4462 static struct coef_fw coef0255[] = {
4463 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4464 WRITE_COEF(0x1b, 0x0c2b),
4465 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4468 static struct coef_fw coef0256[] = {
4469 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4470 WRITE_COEF(0x1b, 0x0e6b),
4473 static struct coef_fw coef0233[] = {
4474 WRITE_COEF(0x45, 0xd429),
4475 WRITE_COEF(0x1b, 0x0c2b),
4476 WRITE_COEF(0x32, 0x4ea3),
4479 static struct coef_fw coef0288[] = {
4480 UPDATE_COEF(0x50, 0x2000, 0x2000),
4481 UPDATE_COEF(0x56, 0x0006, 0x0006),
4482 UPDATE_COEF(0x66, 0x0008, 0),
4483 UPDATE_COEF(0x67, 0x2000, 0),
4486 static struct coef_fw coef0292[] = {
4487 WRITE_COEF(0x6b, 0xd429),
4488 WRITE_COEF(0x76, 0x0008),
4489 WRITE_COEF(0x18, 0x7388),
4492 static struct coef_fw coef0293[] = {
4493 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4494 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4497 static struct coef_fw coef0688[] = {
4498 WRITE_COEF(0x11, 0x0001),
4499 WRITE_COEF(0x15, 0x0d60),
4500 WRITE_COEF(0xc3, 0x0000),
4503 static struct coef_fw coef0225_1[] = {
4504 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4505 UPDATE_COEF(0x63, 3<<14, 2<<14),
4508 static struct coef_fw coef0225_2[] = {
4509 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4510 UPDATE_COEF(0x63, 3<<14, 1<<14),
4514 switch (codec->core.vendor_id) {
4516 alc_process_coef_fw(codec, coef0255);
4520 alc_process_coef_fw(codec, coef0256);
4525 alc_write_coef_idx(codec, 0x45, 0xd689);
4529 alc_process_coef_fw(codec, coef0233);
4532 val = alc_read_coef_idx(codec, 0x50);
4533 if (val & (1 << 12)) {
4534 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4535 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4538 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4539 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4545 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
4547 alc_process_coef_fw(codec, coef0288);
4550 alc_process_coef_fw(codec, coef0292);
4553 alc_process_coef_fw(codec, coef0293);
4556 alc_process_coef_fw(codec, coef0688);
4564 val = alc_read_coef_idx(codec, 0x45);
4566 alc_process_coef_fw(codec, coef0225_2);
4568 alc_process_coef_fw(codec, coef0225_1);
4571 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4574 codec_dbg(codec, "Headset jack set to iPhone-style headset mode.\n");
4578 static void alc_headset_mode_omtp(struct hda_codec *codec)
4580 static struct coef_fw coef0255[] = {
4581 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4582 WRITE_COEF(0x1b, 0x0c2b),
4583 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4586 static struct coef_fw coef0256[] = {
4587 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4588 WRITE_COEF(0x1b, 0x0e6b),
4591 static struct coef_fw coef0233[] = {
4592 WRITE_COEF(0x45, 0xe429),
4593 WRITE_COEF(0x1b, 0x0c2b),
4594 WRITE_COEF(0x32, 0x4ea3),
4597 static struct coef_fw coef0288[] = {
4598 UPDATE_COEF(0x50, 0x2000, 0x2000),
4599 UPDATE_COEF(0x56, 0x0006, 0x0006),
4600 UPDATE_COEF(0x66, 0x0008, 0),
4601 UPDATE_COEF(0x67, 0x2000, 0),
4604 static struct coef_fw coef0292[] = {
4605 WRITE_COEF(0x6b, 0xe429),
4606 WRITE_COEF(0x76, 0x0008),
4607 WRITE_COEF(0x18, 0x7388),
4610 static struct coef_fw coef0293[] = {
4611 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4612 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4615 static struct coef_fw coef0688[] = {
4616 WRITE_COEF(0x11, 0x0001),
4617 WRITE_COEF(0x15, 0x0d50),
4618 WRITE_COEF(0xc3, 0x0000),
4621 static struct coef_fw coef0225[] = {
4622 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4623 UPDATE_COEF(0x63, 3<<14, 2<<14),
4627 switch (codec->core.vendor_id) {
4629 alc_process_coef_fw(codec, coef0255);
4633 alc_process_coef_fw(codec, coef0256);
4638 alc_write_coef_idx(codec, 0x45, 0xe689);
4642 alc_process_coef_fw(codec, coef0233);
4645 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4646 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4651 alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
4653 alc_process_coef_fw(codec, coef0288);
4656 alc_process_coef_fw(codec, coef0292);
4659 alc_process_coef_fw(codec, coef0293);
4662 alc_process_coef_fw(codec, coef0688);
4670 alc_process_coef_fw(codec, coef0225);
4673 codec_dbg(codec, "Headset jack set to Nokia-style headset mode.\n");
4676 static void alc_determine_headset_type(struct hda_codec *codec)
4679 bool is_ctia = false;
4680 struct alc_spec *spec = codec->spec;
4681 static struct coef_fw coef0255[] = {
4682 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4683 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4687 static struct coef_fw coef0288[] = {
4688 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4691 static struct coef_fw coef0298[] = {
4692 UPDATE_COEF(0x50, 0x2000, 0x2000),
4693 UPDATE_COEF(0x56, 0x0006, 0x0006),
4694 UPDATE_COEF(0x66, 0x0008, 0),
4695 UPDATE_COEF(0x67, 0x2000, 0),
4696 UPDATE_COEF(0x19, 0x1300, 0x1300),
4699 static struct coef_fw coef0293[] = {
4700 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4701 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4704 static struct coef_fw coef0688[] = {
4705 WRITE_COEF(0x11, 0x0001),
4706 WRITE_COEF(0xb7, 0x802b),
4707 WRITE_COEF(0x15, 0x0d60),
4708 WRITE_COEF(0xc3, 0x0c00),
4711 static struct coef_fw coef0274[] = {
4712 UPDATE_COEF(0x4a, 0x0010, 0),
4713 UPDATE_COEF(0x4a, 0x8000, 0),
4714 WRITE_COEF(0x45, 0xd289),
4715 UPDATE_COEF(0x49, 0x0300, 0x0300),
4719 switch (codec->core.vendor_id) {
4721 alc_process_coef_fw(codec, coef0255);
4723 val = alc_read_coef_idx(codec, 0x46);
4724 is_ctia = (val & 0x0070) == 0x0070;
4728 alc_write_coef_idx(codec, 0x1b, 0x0e4b);
4729 alc_write_coef_idx(codec, 0x06, 0x6104);
4730 alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
4732 snd_hda_codec_write(codec, 0x21, 0,
4733 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4735 snd_hda_codec_write(codec, 0x21, 0,
4736 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4738 alc_process_coef_fw(codec, coef0255);
4740 val = alc_read_coef_idx(codec, 0x46);
4741 is_ctia = (val & 0x0070) == 0x0070;
4743 alc_write_coefex_idx(codec, 0x57, 0x3, 0x0da3);
4744 alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
4746 snd_hda_codec_write(codec, 0x21, 0,
4747 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
4749 snd_hda_codec_write(codec, 0x21, 0,
4750 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4755 alc_process_coef_fw(codec, coef0274);
4757 val = alc_read_coef_idx(codec, 0x46);
4758 is_ctia = (val & 0x00f0) == 0x00f0;
4762 alc_write_coef_idx(codec, 0x45, 0xd029);
4764 val = alc_read_coef_idx(codec, 0x46);
4765 is_ctia = (val & 0x0070) == 0x0070;
4768 snd_hda_codec_write(codec, 0x21, 0,
4769 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4771 snd_hda_codec_write(codec, 0x21, 0,
4772 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4775 val = alc_read_coef_idx(codec, 0x50);
4776 if (val & (1 << 12)) {
4777 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
4778 alc_process_coef_fw(codec, coef0288);
4780 val = alc_read_coef_idx(codec, 0x50);
4781 is_ctia = (val & 0x0070) == 0x0070;
4783 alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
4784 alc_process_coef_fw(codec, coef0288);
4786 val = alc_read_coef_idx(codec, 0x50);
4787 is_ctia = (val & 0x0070) == 0x0070;
4789 alc_process_coef_fw(codec, coef0298);
4790 snd_hda_codec_write(codec, 0x21, 0,
4791 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
4793 snd_hda_codec_write(codec, 0x21, 0,
4794 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4798 alc_process_coef_fw(codec, coef0288);
4800 val = alc_read_coef_idx(codec, 0x50);
4801 is_ctia = (val & 0x0070) == 0x0070;
4804 alc_write_coef_idx(codec, 0x6b, 0xd429);
4806 val = alc_read_coef_idx(codec, 0x6c);
4807 is_ctia = (val & 0x001c) == 0x001c;
4810 alc_process_coef_fw(codec, coef0293);
4812 val = alc_read_coef_idx(codec, 0x46);
4813 is_ctia = (val & 0x0070) == 0x0070;
4816 alc_process_coef_fw(codec, coef0688);
4818 val = alc_read_coef_idx(codec, 0xbe);
4819 is_ctia = (val & 0x1c02) == 0x1c02;
4827 snd_hda_codec_write(codec, 0x21, 0,
4828 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
4830 snd_hda_codec_write(codec, 0x21, 0,
4831 AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
4833 alc_process_coef_fw(codec, alc225_pre_hsmode);
4834 alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
4835 val = alc_read_coef_idx(codec, 0x45);
4836 if (val & (1 << 9)) {
4837 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
4838 alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
4840 val = alc_read_coef_idx(codec, 0x46);
4841 is_ctia = (val & 0x00f0) == 0x00f0;
4843 alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
4844 alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
4846 val = alc_read_coef_idx(codec, 0x46);
4847 is_ctia = (val & 0x00f0) == 0x00f0;
4849 alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
4850 alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
4851 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
4853 snd_hda_codec_write(codec, 0x21, 0,
4854 AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
4856 snd_hda_codec_write(codec, 0x21, 0,
4857 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
4864 codec_dbg(codec, "Headset jack detected iPhone-style headset: %s\n",
4865 is_ctia ? "yes" : "no");
4866 spec->current_headset_type = is_ctia ? ALC_HEADSET_TYPE_CTIA : ALC_HEADSET_TYPE_OMTP;
4869 static void alc_update_headset_mode(struct hda_codec *codec)
4871 struct alc_spec *spec = codec->spec;
4873 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
4874 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4876 int new_headset_mode;
4878 if (!snd_hda_jack_detect(codec, hp_pin))
4879 new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
4880 else if (mux_pin == spec->headset_mic_pin)
4881 new_headset_mode = ALC_HEADSET_MODE_HEADSET;
4882 else if (mux_pin == spec->headphone_mic_pin)
4883 new_headset_mode = ALC_HEADSET_MODE_MIC;
4885 new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;
4887 if (new_headset_mode == spec->current_headset_mode) {
4888 snd_hda_gen_update_outputs(codec);
4892 switch (new_headset_mode) {
4893 case ALC_HEADSET_MODE_UNPLUGGED:
4894 alc_headset_mode_unplugged(codec);
4895 spec->gen.hp_jack_present = false;
4897 case ALC_HEADSET_MODE_HEADSET:
4898 if (spec->current_headset_type == ALC_HEADSET_TYPE_UNKNOWN)
4899 alc_determine_headset_type(codec);
4900 if (spec->current_headset_type == ALC_HEADSET_TYPE_CTIA)
4901 alc_headset_mode_ctia(codec);
4902 else if (spec->current_headset_type == ALC_HEADSET_TYPE_OMTP)
4903 alc_headset_mode_omtp(codec);
4904 spec->gen.hp_jack_present = true;
4906 case ALC_HEADSET_MODE_MIC:
4907 alc_headset_mode_mic_in(codec, hp_pin, spec->headphone_mic_pin);
4908 spec->gen.hp_jack_present = false;
4910 case ALC_HEADSET_MODE_HEADPHONE:
4911 alc_headset_mode_default(codec);
4912 spec->gen.hp_jack_present = true;
4915 if (new_headset_mode != ALC_HEADSET_MODE_MIC) {
4916 snd_hda_set_pin_ctl_cache(codec, hp_pin,
4917 AC_PINCTL_OUT_EN | AC_PINCTL_HP_EN);
4918 if (spec->headphone_mic_pin && spec->headphone_mic_pin != hp_pin)
4919 snd_hda_set_pin_ctl_cache(codec, spec->headphone_mic_pin,
4922 spec->current_headset_mode = new_headset_mode;
4924 snd_hda_gen_update_outputs(codec);
4927 static void alc_update_headset_mode_hook(struct hda_codec *codec,
4928 struct snd_kcontrol *kcontrol,
4929 struct snd_ctl_elem_value *ucontrol)
4931 alc_update_headset_mode(codec);
4934 static void alc_update_headset_jack_cb(struct hda_codec *codec,
4935 struct hda_jack_callback *jack)
4937 struct alc_spec *spec = codec->spec;
4938 spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN;
4939 snd_hda_gen_hp_automute(codec, jack);
4942 static void alc_probe_headset_mode(struct hda_codec *codec)
4945 struct alc_spec *spec = codec->spec;
4946 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
4949 for (i = 0; i < cfg->num_inputs; i++) {
4950 if (cfg->inputs[i].is_headset_mic && !spec->headset_mic_pin)
4951 spec->headset_mic_pin = cfg->inputs[i].pin;
4952 if (cfg->inputs[i].is_headphone_mic && !spec->headphone_mic_pin)
4953 spec->headphone_mic_pin = cfg->inputs[i].pin;
4956 WARN_ON(spec->gen.cap_sync_hook);
4957 spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
4958 spec->gen.automute_hook = alc_update_headset_mode;
4959 spec->gen.hp_automute_hook = alc_update_headset_jack_cb;
4962 static void alc_fixup_headset_mode(struct hda_codec *codec,
4963 const struct hda_fixup *fix, int action)
4965 struct alc_spec *spec = codec->spec;
4968 case HDA_FIXUP_ACT_PRE_PROBE:
4969 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC | HDA_PINCFG_HEADPHONE_MIC;
4971 case HDA_FIXUP_ACT_PROBE:
4972 alc_probe_headset_mode(codec);
4974 case HDA_FIXUP_ACT_INIT:
4975 spec->current_headset_mode = 0;
4976 alc_update_headset_mode(codec);
4981 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec,
4982 const struct hda_fixup *fix, int action)
4984 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4985 struct alc_spec *spec = codec->spec;
4986 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
4989 alc_fixup_headset_mode(codec, fix, action);
4992 static void alc255_set_default_jack_type(struct hda_codec *codec)
4994 /* Set to iphone type */
4995 static struct coef_fw alc255fw[] = {
4996 WRITE_COEF(0x1b, 0x880b),
4997 WRITE_COEF(0x45, 0xd089),
4998 WRITE_COEF(0x1b, 0x080b),
4999 WRITE_COEF(0x46, 0x0004),
5000 WRITE_COEF(0x1b, 0x0c0b),
5003 static struct coef_fw alc256fw[] = {
5004 WRITE_COEF(0x1b, 0x884b),
5005 WRITE_COEF(0x45, 0xd089),
5006 WRITE_COEF(0x1b, 0x084b),
5007 WRITE_COEF(0x46, 0x0004),
5008 WRITE_COEF(0x1b, 0x0c4b),
5011 switch (codec->core.vendor_id) {
5013 alc_process_coef_fw(codec, alc255fw);
5017 alc_process_coef_fw(codec, alc256fw);
5023 static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
5024 const struct hda_fixup *fix, int action)
5026 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5027 alc255_set_default_jack_type(codec);
5029 alc_fixup_headset_mode(codec, fix, action);
5032 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec *codec,
5033 const struct hda_fixup *fix, int action)
5035 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5036 struct alc_spec *spec = codec->spec;
5037 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5038 alc255_set_default_jack_type(codec);
5041 alc_fixup_headset_mode(codec, fix, action);
5044 static void alc288_update_headset_jack_cb(struct hda_codec *codec,
5045 struct hda_jack_callback *jack)
5047 struct alc_spec *spec = codec->spec;
5049 alc_update_headset_jack_cb(codec, jack);
5050 /* Headset Mic enable or disable, only for Dell Dino */
5051 alc_update_gpio_data(codec, 0x40, spec->gen.hp_jack_present);
5054 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec *codec,
5055 const struct hda_fixup *fix, int action)
5057 alc_fixup_headset_mode(codec, fix, action);
5058 if (action == HDA_FIXUP_ACT_PROBE) {
5059 struct alc_spec *spec = codec->spec;
5060 /* toggled via hp_automute_hook */
5061 spec->gpio_mask |= 0x40;
5062 spec->gpio_dir |= 0x40;
5063 spec->gen.hp_automute_hook = alc288_update_headset_jack_cb;
5067 static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
5068 const struct hda_fixup *fix, int action)
5070 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5071 struct alc_spec *spec = codec->spec;
5072 spec->gen.auto_mute_via_amp = 1;
5076 static void alc_fixup_no_shutup(struct hda_codec *codec,
5077 const struct hda_fixup *fix, int action)
5079 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5080 struct alc_spec *spec = codec->spec;
5081 spec->no_shutup_pins = 1;
5085 static void alc_fixup_disable_aamix(struct hda_codec *codec,
5086 const struct hda_fixup *fix, int action)
5088 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5089 struct alc_spec *spec = codec->spec;
5090 /* Disable AA-loopback as it causes white noise */
5091 spec->gen.mixer_nid = 0;
5095 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5096 static void alc_fixup_tpt440_dock(struct hda_codec *codec,
5097 const struct hda_fixup *fix, int action)
5099 static const struct hda_pintbl pincfgs[] = {
5100 { 0x16, 0x21211010 }, /* dock headphone */
5101 { 0x19, 0x21a11010 }, /* dock mic */
5104 struct alc_spec *spec = codec->spec;
5106 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5107 spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
5108 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5109 codec->power_save_node = 0; /* avoid click noises */
5110 snd_hda_apply_pincfgs(codec, pincfgs);
5114 static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5115 const struct hda_fixup *fix, int action)
5117 static const struct hda_pintbl pincfgs[] = {
5118 { 0x17, 0x21211010 }, /* dock headphone */
5119 { 0x19, 0x21a11010 }, /* dock mic */
5122 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5123 * the speaker output becomes too low by some reason on Thinkpads with
5126 static hda_nid_t preferred_pairs[] = {
5127 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5130 struct alc_spec *spec = codec->spec;
5132 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5133 spec->gen.preferred_dacs = preferred_pairs;
5134 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5135 snd_hda_apply_pincfgs(codec, pincfgs);
5136 } else if (action == HDA_FIXUP_ACT_INIT) {
5137 /* Enable DOCK device */
5138 snd_hda_codec_write(codec, 0x17, 0,
5139 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5140 /* Enable DOCK device */
5141 snd_hda_codec_write(codec, 0x19, 0,
5142 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0);
5146 static void alc_shutup_dell_xps13(struct hda_codec *codec)
5148 struct alc_spec *spec = codec->spec;
5149 int hp_pin = alc_get_hp_pin(spec);
5151 /* Prevent pop noises when headphones are plugged in */
5152 snd_hda_codec_write(codec, hp_pin, 0,
5153 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
5157 static void alc_fixup_dell_xps13(struct hda_codec *codec,
5158 const struct hda_fixup *fix, int action)
5160 struct alc_spec *spec = codec->spec;
5161 struct hda_input_mux *imux = &spec->gen.input_mux;
5165 case HDA_FIXUP_ACT_PRE_PROBE:
5166 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5167 * it causes a click noise at start up
5169 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5170 spec->shutup = alc_shutup_dell_xps13;
5172 case HDA_FIXUP_ACT_PROBE:
5173 /* Make the internal mic the default input source. */
5174 for (i = 0; i < imux->num_items; i++) {
5175 if (spec->gen.imux_pins[i] == 0x12) {
5176 spec->gen.cur_mux[0] = i;
5184 static void alc_fixup_headset_mode_alc662(struct hda_codec *codec,
5185 const struct hda_fixup *fix, int action)
5187 struct alc_spec *spec = codec->spec;
5189 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5190 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
5191 spec->gen.hp_mic = 1; /* Mic-in is same pin as headphone */
5193 /* Disable boost for mic-in permanently. (This code is only called
5194 from quirks that guarantee that the headphone is at NID 0x1b.) */
5195 snd_hda_codec_write(codec, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000);
5196 snd_hda_override_wcaps(codec, 0x1b, get_wcaps(codec, 0x1b) & ~AC_WCAP_IN_AMP);
5198 alc_fixup_headset_mode(codec, fix, action);
5201 static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
5202 const struct hda_fixup *fix, int action)
5204 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5205 alc_write_coef_idx(codec, 0xc4, 0x8000);
5206 alc_update_coef_idx(codec, 0xc2, ~0xfe, 0);
5207 snd_hda_set_pin_ctl_cache(codec, 0x18, 0);
5209 alc_fixup_headset_mode(codec, fix, action);
5212 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5213 static int find_ext_mic_pin(struct hda_codec *codec)
5215 struct alc_spec *spec = codec->spec;
5216 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5218 unsigned int defcfg;
5221 for (i = 0; i < cfg->num_inputs; i++) {
5222 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5224 nid = cfg->inputs[i].pin;
5225 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5226 if (snd_hda_get_input_pin_attr(defcfg) == INPUT_PIN_ATTR_INT)
5234 static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5235 const struct hda_fixup *fix,
5238 struct alc_spec *spec = codec->spec;
5240 if (action == HDA_FIXUP_ACT_PROBE) {
5241 int mic_pin = find_ext_mic_pin(codec);
5242 int hp_pin = alc_get_hp_pin(spec);
5244 if (snd_BUG_ON(!mic_pin || !hp_pin))
5246 snd_hda_jack_set_gating_jack(codec, mic_pin, hp_pin);
5250 static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
5251 const struct hda_fixup *fix,
5254 struct alc_spec *spec = codec->spec;
5255 struct auto_pin_cfg *cfg = &spec->gen.autocfg;
5258 /* The mic boosts on level 2 and 3 are too noisy
5259 on the internal mic input.
5260 Therefore limit the boost to 0 or 1. */
5262 if (action != HDA_FIXUP_ACT_PROBE)
5265 for (i = 0; i < cfg->num_inputs; i++) {
5266 hda_nid_t nid = cfg->inputs[i].pin;
5267 unsigned int defcfg;
5268 if (cfg->inputs[i].type != AUTO_PIN_MIC)
5270 defcfg = snd_hda_codec_get_pincfg(codec, nid);
5271 if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT)
5274 snd_hda_override_amp_caps(codec, nid, HDA_INPUT,
5275 (0x00 << AC_AMPCAP_OFFSET_SHIFT) |
5276 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) |
5277 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) |
5278 (0 << AC_AMPCAP_MUTE_SHIFT));
5282 static void alc283_hp_automute_hook(struct hda_codec *codec,
5283 struct hda_jack_callback *jack)
5285 struct alc_spec *spec = codec->spec;
5289 snd_hda_gen_hp_automute(codec, jack);
5291 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
5294 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
5298 static void alc283_fixup_chromebook(struct hda_codec *codec,
5299 const struct hda_fixup *fix, int action)
5301 struct alc_spec *spec = codec->spec;
5304 case HDA_FIXUP_ACT_PRE_PROBE:
5305 snd_hda_override_wcaps(codec, 0x03, 0);
5306 /* Disable AA-loopback as it causes white noise */
5307 spec->gen.mixer_nid = 0;
5309 case HDA_FIXUP_ACT_INIT:
5310 /* MIC2-VREF control */
5311 /* Set to manual mode */
5312 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5313 /* Enable Line1 input control by verb */
5314 alc_update_coef_idx(codec, 0x1a, 0, 1 << 4);
5319 static void alc283_fixup_sense_combo_jack(struct hda_codec *codec,
5320 const struct hda_fixup *fix, int action)
5322 struct alc_spec *spec = codec->spec;
5325 case HDA_FIXUP_ACT_PRE_PROBE:
5326 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
5328 case HDA_FIXUP_ACT_INIT:
5329 /* MIC2-VREF control */
5330 /* Set to manual mode */
5331 alc_update_coef_idx(codec, 0x06, 0x000c, 0);
5336 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5337 static void asus_tx300_automute(struct hda_codec *codec)
5339 struct alc_spec *spec = codec->spec;
5340 snd_hda_gen_update_outputs(codec);
5341 if (snd_hda_jack_detect(codec, 0x1b))
5342 spec->gen.mute_bits |= (1ULL << 0x14);
5345 static void alc282_fixup_asus_tx300(struct hda_codec *codec,
5346 const struct hda_fixup *fix, int action)
5348 struct alc_spec *spec = codec->spec;
5349 static const struct hda_pintbl dock_pins[] = {
5350 { 0x1b, 0x21114000 }, /* dock speaker pin */
5355 case HDA_FIXUP_ACT_PRE_PROBE:
5356 spec->init_amp = ALC_INIT_DEFAULT;
5357 /* TX300 needs to set up GPIO2 for the speaker amp */
5358 alc_setup_gpio(codec, 0x04);
5359 snd_hda_apply_pincfgs(codec, dock_pins);
5360 spec->gen.auto_mute_via_amp = 1;
5361 spec->gen.automute_hook = asus_tx300_automute;
5362 snd_hda_jack_detect_enable_callback(codec, 0x1b,
5363 snd_hda_gen_hp_automute);
5365 case HDA_FIXUP_ACT_PROBE:
5366 spec->init_amp = ALC_INIT_DEFAULT;
5368 case HDA_FIXUP_ACT_BUILD:
5369 /* this is a bit tricky; give more sane names for the main
5370 * (tablet) speaker and the dock speaker, respectively
5372 rename_ctl(codec, "Speaker Playback Switch",
5373 "Dock Speaker Playback Switch");
5374 rename_ctl(codec, "Bass Speaker Playback Switch",
5375 "Speaker Playback Switch");
5380 static void alc290_fixup_mono_speakers(struct hda_codec *codec,
5381 const struct hda_fixup *fix, int action)
5383 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5384 /* DAC node 0x03 is giving mono output. We therefore want to
5385 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5386 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5387 hda_nid_t conn1[2] = { 0x0c };
5388 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
5389 snd_hda_override_conn_list(codec, 0x15, 1, conn1);
5393 static void alc298_fixup_speaker_volume(struct hda_codec *codec,
5394 const struct hda_fixup *fix, int action)
5396 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5397 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5398 we can't adjust the speaker's volume since this node does not has
5399 Amp-out capability. we change the speaker's route to:
5400 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5401 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5402 speaker's volume now. */
5404 hda_nid_t conn1[1] = { 0x0c };
5405 snd_hda_override_conn_list(codec, 0x17, 1, conn1);
5409 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5410 static void alc295_fixup_disable_dac3(struct hda_codec *codec,
5411 const struct hda_fixup *fix, int action)
5413 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5414 hda_nid_t conn[2] = { 0x02, 0x03 };
5415 snd_hda_override_conn_list(codec, 0x17, 2, conn);
5419 /* Hook to update amp GPIO4 for automute */
5420 static void alc280_hp_gpio4_automute_hook(struct hda_codec *codec,
5421 struct hda_jack_callback *jack)
5423 struct alc_spec *spec = codec->spec;
5425 snd_hda_gen_hp_automute(codec, jack);
5426 /* mute_led_polarity is set to 0, so we pass inverted value here */
5427 alc_update_gpio_led(codec, 0x10, !spec->gen.hp_jack_present);
5430 /* Manage GPIOs for HP EliteBook Folio 9480m.
5432 * GPIO4 is the headphone amplifier power control
5433 * GPIO3 is the audio output mute indicator LED
5436 static void alc280_fixup_hp_9480m(struct hda_codec *codec,
5437 const struct hda_fixup *fix,
5440 struct alc_spec *spec = codec->spec;
5442 alc_fixup_hp_gpio_led(codec, action, 0x08, 0);
5443 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5444 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5445 spec->gpio_mask |= 0x10;
5446 spec->gpio_dir |= 0x10;
5447 spec->gen.hp_automute_hook = alc280_hp_gpio4_automute_hook;
5451 static void alc275_fixup_gpio4_off(struct hda_codec *codec,
5452 const struct hda_fixup *fix,
5455 struct alc_spec *spec = codec->spec;
5457 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5458 spec->gpio_mask |= 0x04;
5459 spec->gpio_dir |= 0x04;
5460 /* set data bit low */
5464 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec,
5465 const struct hda_fixup *fix,
5468 alc_fixup_dual_codecs(codec, fix, action);
5470 case HDA_FIXUP_ACT_PRE_PROBE:
5471 /* override card longname to provide a unique UCM profile */
5472 strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs");
5474 case HDA_FIXUP_ACT_BUILD:
5475 /* rename Capture controls depending on the codec */
5476 rename_ctl(codec, "Capture Volume",
5478 "Rear-Panel Capture Volume" :
5479 "Front-Panel Capture Volume");
5480 rename_ctl(codec, "Capture Switch",
5482 "Rear-Panel Capture Switch" :
5483 "Front-Panel Capture Switch");
5488 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5489 static void alc274_fixup_bind_dacs(struct hda_codec *codec,
5490 const struct hda_fixup *fix, int action)
5492 struct alc_spec *spec = codec->spec;
5493 static hda_nid_t preferred_pairs[] = {
5494 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5498 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5501 spec->gen.preferred_dacs = preferred_pairs;
5502 spec->gen.auto_mute_via_amp = 1;
5503 codec->power_save_node = 0;
5506 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5507 static void alc285_fixup_invalidate_dacs(struct hda_codec *codec,
5508 const struct hda_fixup *fix, int action)
5510 if (action != HDA_FIXUP_ACT_PRE_PROBE)
5513 snd_hda_override_wcaps(codec, 0x03, 0);
5516 static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
5517 const struct hda_fixup *fix, int action)
5519 if (action == HDA_FIXUP_ACT_PRE_PROBE)
5520 snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
5523 /* for hda_fixup_thinkpad_acpi() */
5524 #include "thinkpad_helper.c"
5526 static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5527 const struct hda_fixup *fix, int action)
5529 alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5530 hda_fixup_thinkpad_acpi(codec, fix, action);
5533 /* for dell wmi mic mute led */
5534 #include "dell_wmi_helper.c"
5536 /* for alc295_fixup_hp_top_speakers */
5537 #include "hp_x360_helper.c"
5540 ALC269_FIXUP_SONY_VAIO,
5541 ALC275_FIXUP_SONY_VAIO_GPIO2,
5542 ALC269_FIXUP_DELL_M101Z,
5543 ALC269_FIXUP_SKU_IGNORE,
5544 ALC269_FIXUP_ASUS_G73JW,
5545 ALC269_FIXUP_LENOVO_EAPD,
5546 ALC275_FIXUP_SONY_HWEQ,
5547 ALC275_FIXUP_SONY_DISABLE_AAMIX,
5549 ALC269_FIXUP_PCM_44K,
5550 ALC269_FIXUP_STEREO_DMIC,
5551 ALC269_FIXUP_HEADSET_MIC,
5552 ALC269_FIXUP_QUANTA_MUTE,
5553 ALC269_FIXUP_LIFEBOOK,
5554 ALC269_FIXUP_LIFEBOOK_EXTMIC,
5555 ALC269_FIXUP_LIFEBOOK_HP_PIN,
5556 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT,
5557 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC,
5560 ALC269VB_FIXUP_AMIC,
5561 ALC269VB_FIXUP_DMIC,
5562 ALC269_FIXUP_HP_MUTE_LED,
5563 ALC269_FIXUP_HP_MUTE_LED_MIC1,
5564 ALC269_FIXUP_HP_MUTE_LED_MIC2,
5565 ALC269_FIXUP_HP_MUTE_LED_MIC3,
5566 ALC269_FIXUP_HP_GPIO_LED,
5567 ALC269_FIXUP_HP_GPIO_MIC1_LED,
5568 ALC269_FIXUP_HP_LINE1_MIC1_LED,
5569 ALC269_FIXUP_INV_DMIC,
5570 ALC269_FIXUP_LENOVO_DOCK,
5571 ALC269_FIXUP_NO_SHUTUP,
5572 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
5573 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
5574 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5575 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
5576 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5577 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
5578 ALC269_FIXUP_HEADSET_MODE,
5579 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC,
5580 ALC269_FIXUP_ASPIRE_HEADSET_MIC,
5581 ALC269_FIXUP_ASUS_X101_FUNC,
5582 ALC269_FIXUP_ASUS_X101_VERB,
5583 ALC269_FIXUP_ASUS_X101,
5584 ALC271_FIXUP_AMIC_MIC2,
5585 ALC271_FIXUP_HP_GATE_MIC_JACK,
5586 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572,
5587 ALC269_FIXUP_ACER_AC700,
5588 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
5589 ALC269VB_FIXUP_ASUS_ZENBOOK,
5590 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
5591 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
5592 ALC269VB_FIXUP_ORDISSIMO_EVE2,
5593 ALC283_FIXUP_CHROME_BOOK,
5594 ALC283_FIXUP_SENSE_COMBO_JACK,
5595 ALC282_FIXUP_ASUS_TX300,
5596 ALC283_FIXUP_INT_MIC,
5597 ALC290_FIXUP_MONO_SPEAKERS,
5598 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
5599 ALC290_FIXUP_SUBWOOFER,
5600 ALC290_FIXUP_SUBWOOFER_HSJACK,
5601 ALC269_FIXUP_THINKPAD_ACPI,
5602 ALC269_FIXUP_DMIC_THINKPAD_ACPI,
5603 ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
5604 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
5605 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5606 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
5607 ALC255_FIXUP_HEADSET_MODE,
5608 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
5609 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5610 ALC292_FIXUP_TPT440_DOCK,
5611 ALC292_FIXUP_TPT440,
5612 ALC283_FIXUP_HEADSET_MIC,
5613 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
5614 ALC282_FIXUP_ASPIRE_V5_PINS,
5615 ALC280_FIXUP_HP_GPIO4,
5616 ALC286_FIXUP_HP_GPIO_LED,
5617 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY,
5618 ALC280_FIXUP_HP_DOCK_PINS,
5619 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED,
5620 ALC280_FIXUP_HP_9480M,
5621 ALC288_FIXUP_DELL_HEADSET_MODE,
5622 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
5623 ALC288_FIXUP_DELL_XPS_13,
5624 ALC288_FIXUP_DISABLE_AAMIX,
5625 ALC292_FIXUP_DELL_E7X,
5626 ALC292_FIXUP_DISABLE_AAMIX,
5627 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
5628 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
5629 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
5630 ALC275_FIXUP_DELL_XPS,
5631 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE,
5632 ALC293_FIXUP_LENOVO_SPK_NOISE,
5633 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
5634 ALC255_FIXUP_DELL_SPK_NOISE,
5635 ALC225_FIXUP_DISABLE_MIC_VREF,
5636 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
5637 ALC295_FIXUP_DISABLE_DAC3,
5638 ALC280_FIXUP_HP_HEADSET_MIC,
5639 ALC221_FIXUP_HP_FRONT_MIC,
5640 ALC292_FIXUP_TPT460,
5641 ALC298_FIXUP_SPK_VOLUME,
5642 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER,
5643 ALC269_FIXUP_ATIV_BOOK_8,
5644 ALC221_FIXUP_HP_MIC_NO_PRESENCE,
5645 ALC256_FIXUP_ASUS_HEADSET_MODE,
5646 ALC256_FIXUP_ASUS_MIC,
5647 ALC256_FIXUP_ASUS_AIO_GPIO2,
5648 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE,
5649 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE,
5650 ALC233_FIXUP_LENOVO_MULTI_CODECS,
5651 ALC233_FIXUP_ACER_HEADSET_MIC,
5652 ALC294_FIXUP_LENOVO_MIC_LOCATION,
5653 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE,
5654 ALC700_FIXUP_INTEL_REFERENCE,
5655 ALC274_FIXUP_DELL_BIND_DACS,
5656 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
5657 ALC298_FIXUP_TPT470_DOCK,
5658 ALC255_FIXUP_DUMMY_LINEOUT_VERB,
5659 ALC255_FIXUP_DELL_HEADSET_MIC,
5660 ALC256_FIXUP_HUAWEI_MBXP_PINS,
5661 ALC295_FIXUP_HP_X360,
5662 ALC221_FIXUP_HP_HEADSET_MIC,
5663 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE,
5664 ALC295_FIXUP_HP_AUTO_MUTE,
5665 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
5666 ALC294_FIXUP_ASUS_MIC,
5667 ALC294_FIXUP_ASUS_HEADSET_MIC,
5668 ALC294_FIXUP_ASUS_SPK,
5669 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
5670 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
5671 ALC255_FIXUP_ACER_HEADSET_MIC,
5672 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE,
5673 ALC225_FIXUP_WYSE_AUTO_MUTE,
5674 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF,
5675 ALC286_FIXUP_ACER_AIO_HEADSET_MIC,
5676 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
5677 ALC299_FIXUP_PREDATOR_SPK,
5680 static const struct hda_fixup alc269_fixups[] = {
5681 [ALC269_FIXUP_SONY_VAIO] = {
5682 .type = HDA_FIXUP_PINCTLS,
5683 .v.pins = (const struct hda_pintbl[]) {
5684 {0x19, PIN_VREFGRD},
5688 [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
5689 .type = HDA_FIXUP_FUNC,
5690 .v.func = alc275_fixup_gpio4_off,
5692 .chain_id = ALC269_FIXUP_SONY_VAIO
5694 [ALC269_FIXUP_DELL_M101Z] = {
5695 .type = HDA_FIXUP_VERBS,
5696 .v.verbs = (const struct hda_verb[]) {
5697 /* Enables internal speaker */
5698 {0x20, AC_VERB_SET_COEF_INDEX, 13},
5699 {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
5703 [ALC269_FIXUP_SKU_IGNORE] = {
5704 .type = HDA_FIXUP_FUNC,
5705 .v.func = alc_fixup_sku_ignore,
5707 [ALC269_FIXUP_ASUS_G73JW] = {
5708 .type = HDA_FIXUP_PINS,
5709 .v.pins = (const struct hda_pintbl[]) {
5710 { 0x17, 0x99130111 }, /* subwoofer */
5714 [ALC269_FIXUP_LENOVO_EAPD] = {
5715 .type = HDA_FIXUP_VERBS,
5716 .v.verbs = (const struct hda_verb[]) {
5717 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
5721 [ALC275_FIXUP_SONY_HWEQ] = {
5722 .type = HDA_FIXUP_FUNC,
5723 .v.func = alc269_fixup_hweq,
5725 .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
5727 [ALC275_FIXUP_SONY_DISABLE_AAMIX] = {
5728 .type = HDA_FIXUP_FUNC,
5729 .v.func = alc_fixup_disable_aamix,
5731 .chain_id = ALC269_FIXUP_SONY_VAIO
5733 [ALC271_FIXUP_DMIC] = {
5734 .type = HDA_FIXUP_FUNC,
5735 .v.func = alc271_fixup_dmic,
5737 [ALC269_FIXUP_PCM_44K] = {
5738 .type = HDA_FIXUP_FUNC,
5739 .v.func = alc269_fixup_pcm_44k,
5741 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5743 [ALC269_FIXUP_STEREO_DMIC] = {
5744 .type = HDA_FIXUP_FUNC,
5745 .v.func = alc269_fixup_stereo_dmic,
5747 [ALC269_FIXUP_HEADSET_MIC] = {
5748 .type = HDA_FIXUP_FUNC,
5749 .v.func = alc269_fixup_headset_mic,
5751 [ALC269_FIXUP_QUANTA_MUTE] = {
5752 .type = HDA_FIXUP_FUNC,
5753 .v.func = alc269_fixup_quanta_mute,
5755 [ALC269_FIXUP_LIFEBOOK] = {
5756 .type = HDA_FIXUP_PINS,
5757 .v.pins = (const struct hda_pintbl[]) {
5758 { 0x1a, 0x2101103f }, /* dock line-out */
5759 { 0x1b, 0x23a11040 }, /* dock mic-in */
5763 .chain_id = ALC269_FIXUP_QUANTA_MUTE
5765 [ALC269_FIXUP_LIFEBOOK_EXTMIC] = {
5766 .type = HDA_FIXUP_PINS,
5767 .v.pins = (const struct hda_pintbl[]) {
5768 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5772 [ALC269_FIXUP_LIFEBOOK_HP_PIN] = {
5773 .type = HDA_FIXUP_PINS,
5774 .v.pins = (const struct hda_pintbl[]) {
5775 { 0x21, 0x0221102f }, /* HP out */
5779 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT] = {
5780 .type = HDA_FIXUP_FUNC,
5781 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5783 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC] = {
5784 .type = HDA_FIXUP_FUNC,
5785 .v.func = alc269_fixup_pincfg_U7x7_headset_mic,
5787 [ALC269_FIXUP_AMIC] = {
5788 .type = HDA_FIXUP_PINS,
5789 .v.pins = (const struct hda_pintbl[]) {
5790 { 0x14, 0x99130110 }, /* speaker */
5791 { 0x15, 0x0121401f }, /* HP out */
5792 { 0x18, 0x01a19c20 }, /* mic */
5793 { 0x19, 0x99a3092f }, /* int-mic */
5797 [ALC269_FIXUP_DMIC] = {
5798 .type = HDA_FIXUP_PINS,
5799 .v.pins = (const struct hda_pintbl[]) {
5800 { 0x12, 0x99a3092f }, /* int-mic */
5801 { 0x14, 0x99130110 }, /* speaker */
5802 { 0x15, 0x0121401f }, /* HP out */
5803 { 0x18, 0x01a19c20 }, /* mic */
5807 [ALC269VB_FIXUP_AMIC] = {
5808 .type = HDA_FIXUP_PINS,
5809 .v.pins = (const struct hda_pintbl[]) {
5810 { 0x14, 0x99130110 }, /* speaker */
5811 { 0x18, 0x01a19c20 }, /* mic */
5812 { 0x19, 0x99a3092f }, /* int-mic */
5813 { 0x21, 0x0121401f }, /* HP out */
5817 [ALC269VB_FIXUP_DMIC] = {
5818 .type = HDA_FIXUP_PINS,
5819 .v.pins = (const struct hda_pintbl[]) {
5820 { 0x12, 0x99a3092f }, /* int-mic */
5821 { 0x14, 0x99130110 }, /* speaker */
5822 { 0x18, 0x01a19c20 }, /* mic */
5823 { 0x21, 0x0121401f }, /* HP out */
5827 [ALC269_FIXUP_HP_MUTE_LED] = {
5828 .type = HDA_FIXUP_FUNC,
5829 .v.func = alc269_fixup_hp_mute_led,
5831 [ALC269_FIXUP_HP_MUTE_LED_MIC1] = {
5832 .type = HDA_FIXUP_FUNC,
5833 .v.func = alc269_fixup_hp_mute_led_mic1,
5835 [ALC269_FIXUP_HP_MUTE_LED_MIC2] = {
5836 .type = HDA_FIXUP_FUNC,
5837 .v.func = alc269_fixup_hp_mute_led_mic2,
5839 [ALC269_FIXUP_HP_MUTE_LED_MIC3] = {
5840 .type = HDA_FIXUP_FUNC,
5841 .v.func = alc269_fixup_hp_mute_led_mic3,
5843 .chain_id = ALC295_FIXUP_HP_AUTO_MUTE
5845 [ALC269_FIXUP_HP_GPIO_LED] = {
5846 .type = HDA_FIXUP_FUNC,
5847 .v.func = alc269_fixup_hp_gpio_led,
5849 [ALC269_FIXUP_HP_GPIO_MIC1_LED] = {
5850 .type = HDA_FIXUP_FUNC,
5851 .v.func = alc269_fixup_hp_gpio_mic1_led,
5853 [ALC269_FIXUP_HP_LINE1_MIC1_LED] = {
5854 .type = HDA_FIXUP_FUNC,
5855 .v.func = alc269_fixup_hp_line1_mic1_led,
5857 [ALC269_FIXUP_INV_DMIC] = {
5858 .type = HDA_FIXUP_FUNC,
5859 .v.func = alc_fixup_inv_dmic,
5861 [ALC269_FIXUP_NO_SHUTUP] = {
5862 .type = HDA_FIXUP_FUNC,
5863 .v.func = alc_fixup_no_shutup,
5865 [ALC269_FIXUP_LENOVO_DOCK] = {
5866 .type = HDA_FIXUP_PINS,
5867 .v.pins = (const struct hda_pintbl[]) {
5868 { 0x19, 0x23a11040 }, /* dock mic */
5869 { 0x1b, 0x2121103f }, /* dock headphone */
5873 .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5875 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
5876 .type = HDA_FIXUP_FUNC,
5877 .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
5879 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
5881 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE] = {
5882 .type = HDA_FIXUP_PINS,
5883 .v.pins = (const struct hda_pintbl[]) {
5884 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5885 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5889 .chain_id = ALC269_FIXUP_HEADSET_MODE
5891 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE] = {
5892 .type = HDA_FIXUP_PINS,
5893 .v.pins = (const struct hda_pintbl[]) {
5894 { 0x16, 0x21014020 }, /* dock line out */
5895 { 0x19, 0x21a19030 }, /* dock mic */
5896 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5900 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5902 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE] = {
5903 .type = HDA_FIXUP_PINS,
5904 .v.pins = (const struct hda_pintbl[]) {
5905 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5909 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5911 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE] = {
5912 .type = HDA_FIXUP_PINS,
5913 .v.pins = (const struct hda_pintbl[]) {
5914 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5915 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5919 .chain_id = ALC269_FIXUP_HEADSET_MODE
5921 [ALC269_FIXUP_HEADSET_MODE] = {
5922 .type = HDA_FIXUP_FUNC,
5923 .v.func = alc_fixup_headset_mode,
5925 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5927 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
5928 .type = HDA_FIXUP_FUNC,
5929 .v.func = alc_fixup_headset_mode_no_hp_mic,
5931 [ALC269_FIXUP_ASPIRE_HEADSET_MIC] = {
5932 .type = HDA_FIXUP_PINS,
5933 .v.pins = (const struct hda_pintbl[]) {
5934 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5938 .chain_id = ALC269_FIXUP_HEADSET_MODE,
5940 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE] = {
5941 .type = HDA_FIXUP_PINS,
5942 .v.pins = (const struct hda_pintbl[]) {
5943 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5947 .chain_id = ALC269_FIXUP_HEADSET_MIC
5949 [ALC256_FIXUP_HUAWEI_MBXP_PINS] = {
5950 .type = HDA_FIXUP_PINS,
5951 .v.pins = (const struct hda_pintbl[]) {
5965 [ALC269_FIXUP_ASUS_X101_FUNC] = {
5966 .type = HDA_FIXUP_FUNC,
5967 .v.func = alc269_fixup_x101_headset_mic,
5969 [ALC269_FIXUP_ASUS_X101_VERB] = {
5970 .type = HDA_FIXUP_VERBS,
5971 .v.verbs = (const struct hda_verb[]) {
5972 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0},
5973 {0x20, AC_VERB_SET_COEF_INDEX, 0x08},
5974 {0x20, AC_VERB_SET_PROC_COEF, 0x0310},
5978 .chain_id = ALC269_FIXUP_ASUS_X101_FUNC
5980 [ALC269_FIXUP_ASUS_X101] = {
5981 .type = HDA_FIXUP_PINS,
5982 .v.pins = (const struct hda_pintbl[]) {
5983 { 0x18, 0x04a1182c }, /* Headset mic */
5987 .chain_id = ALC269_FIXUP_ASUS_X101_VERB
5989 [ALC271_FIXUP_AMIC_MIC2] = {
5990 .type = HDA_FIXUP_PINS,
5991 .v.pins = (const struct hda_pintbl[]) {
5992 { 0x14, 0x99130110 }, /* speaker */
5993 { 0x19, 0x01a19c20 }, /* mic */
5994 { 0x1b, 0x99a7012f }, /* int-mic */
5995 { 0x21, 0x0121401f }, /* HP out */
5999 [ALC271_FIXUP_HP_GATE_MIC_JACK] = {
6000 .type = HDA_FIXUP_FUNC,
6001 .v.func = alc271_hp_gate_mic_jack,
6003 .chain_id = ALC271_FIXUP_AMIC_MIC2,
6005 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572] = {
6006 .type = HDA_FIXUP_FUNC,
6007 .v.func = alc269_fixup_limit_int_mic_boost,
6009 .chain_id = ALC271_FIXUP_HP_GATE_MIC_JACK,
6011 [ALC269_FIXUP_ACER_AC700] = {
6012 .type = HDA_FIXUP_PINS,
6013 .v.pins = (const struct hda_pintbl[]) {
6014 { 0x12, 0x99a3092f }, /* int-mic */
6015 { 0x14, 0x99130110 }, /* speaker */
6016 { 0x18, 0x03a11c20 }, /* mic */
6017 { 0x1e, 0x0346101e }, /* SPDIF1 */
6018 { 0x21, 0x0321101f }, /* HP out */
6022 .chain_id = ALC271_FIXUP_DMIC,
6024 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = {
6025 .type = HDA_FIXUP_FUNC,
6026 .v.func = alc269_fixup_limit_int_mic_boost,
6028 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6030 [ALC269VB_FIXUP_ASUS_ZENBOOK] = {
6031 .type = HDA_FIXUP_FUNC,
6032 .v.func = alc269_fixup_limit_int_mic_boost,
6034 .chain_id = ALC269VB_FIXUP_DMIC,
6036 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
6037 .type = HDA_FIXUP_VERBS,
6038 .v.verbs = (const struct hda_verb[]) {
6039 /* class-D output amp +5dB */
6040 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
6041 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
6045 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
6047 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
6048 .type = HDA_FIXUP_FUNC,
6049 .v.func = alc269_fixup_limit_int_mic_boost,
6051 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC1,
6053 [ALC269VB_FIXUP_ORDISSIMO_EVE2] = {
6054 .type = HDA_FIXUP_PINS,
6055 .v.pins = (const struct hda_pintbl[]) {
6056 { 0x12, 0x99a3092f }, /* int-mic */
6057 { 0x18, 0x03a11d20 }, /* mic */
6058 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6062 [ALC283_FIXUP_CHROME_BOOK] = {
6063 .type = HDA_FIXUP_FUNC,
6064 .v.func = alc283_fixup_chromebook,
6066 [ALC283_FIXUP_SENSE_COMBO_JACK] = {
6067 .type = HDA_FIXUP_FUNC,
6068 .v.func = alc283_fixup_sense_combo_jack,
6070 .chain_id = ALC283_FIXUP_CHROME_BOOK,
6072 [ALC282_FIXUP_ASUS_TX300] = {
6073 .type = HDA_FIXUP_FUNC,
6074 .v.func = alc282_fixup_asus_tx300,
6076 [ALC283_FIXUP_INT_MIC] = {
6077 .type = HDA_FIXUP_VERBS,
6078 .v.verbs = (const struct hda_verb[]) {
6079 {0x20, AC_VERB_SET_COEF_INDEX, 0x1a},
6080 {0x20, AC_VERB_SET_PROC_COEF, 0x0011},
6084 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6086 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
6087 .type = HDA_FIXUP_PINS,
6088 .v.pins = (const struct hda_pintbl[]) {
6089 { 0x17, 0x90170112 }, /* subwoofer */
6093 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
6095 [ALC290_FIXUP_SUBWOOFER] = {
6096 .type = HDA_FIXUP_PINS,
6097 .v.pins = (const struct hda_pintbl[]) {
6098 { 0x17, 0x90170112 }, /* subwoofer */
6102 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
6104 [ALC290_FIXUP_MONO_SPEAKERS] = {
6105 .type = HDA_FIXUP_FUNC,
6106 .v.func = alc290_fixup_mono_speakers,
6108 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
6109 .type = HDA_FIXUP_FUNC,
6110 .v.func = alc290_fixup_mono_speakers,
6112 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
6114 [ALC269_FIXUP_THINKPAD_ACPI] = {
6115 .type = HDA_FIXUP_FUNC,
6116 .v.func = alc_fixup_thinkpad_acpi,
6118 .chain_id = ALC269_FIXUP_SKU_IGNORE,
6120 [ALC269_FIXUP_DMIC_THINKPAD_ACPI] = {
6121 .type = HDA_FIXUP_FUNC,
6122 .v.func = alc_fixup_inv_dmic,
6124 .chain_id = ALC269_FIXUP_THINKPAD_ACPI,
6126 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE] = {
6127 .type = HDA_FIXUP_PINS,
6128 .v.pins = (const struct hda_pintbl[]) {
6129 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6133 .chain_id = ALC255_FIXUP_HEADSET_MODE
6135 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6136 .type = HDA_FIXUP_PINS,
6137 .v.pins = (const struct hda_pintbl[]) {
6138 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6142 .chain_id = ALC255_FIXUP_HEADSET_MODE
6144 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6145 .type = HDA_FIXUP_PINS,
6146 .v.pins = (const struct hda_pintbl[]) {
6147 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6148 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6152 .chain_id = ALC255_FIXUP_HEADSET_MODE
6154 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE] = {
6155 .type = HDA_FIXUP_PINS,
6156 .v.pins = (const struct hda_pintbl[]) {
6157 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6161 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6163 [ALC255_FIXUP_HEADSET_MODE] = {
6164 .type = HDA_FIXUP_FUNC,
6165 .v.func = alc_fixup_headset_mode_alc255,
6167 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6169 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC] = {
6170 .type = HDA_FIXUP_FUNC,
6171 .v.func = alc_fixup_headset_mode_alc255_no_hp_mic,
6173 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6174 .type = HDA_FIXUP_PINS,
6175 .v.pins = (const struct hda_pintbl[]) {
6176 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6177 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6181 .chain_id = ALC269_FIXUP_HEADSET_MODE
6183 [ALC292_FIXUP_TPT440_DOCK] = {
6184 .type = HDA_FIXUP_FUNC,
6185 .v.func = alc_fixup_tpt440_dock,
6187 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6189 [ALC292_FIXUP_TPT440] = {
6190 .type = HDA_FIXUP_FUNC,
6191 .v.func = alc_fixup_disable_aamix,
6193 .chain_id = ALC292_FIXUP_TPT440_DOCK,
6195 [ALC283_FIXUP_HEADSET_MIC] = {
6196 .type = HDA_FIXUP_PINS,
6197 .v.pins = (const struct hda_pintbl[]) {
6198 { 0x19, 0x04a110f0 },
6202 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED] = {
6203 .type = HDA_FIXUP_FUNC,
6204 .v.func = alc_fixup_dell_wmi,
6206 [ALC282_FIXUP_ASPIRE_V5_PINS] = {
6207 .type = HDA_FIXUP_PINS,
6208 .v.pins = (const struct hda_pintbl[]) {
6209 { 0x12, 0x90a60130 },
6210 { 0x14, 0x90170110 },
6211 { 0x17, 0x40000008 },
6212 { 0x18, 0x411111f0 },
6213 { 0x19, 0x01a1913c },
6214 { 0x1a, 0x411111f0 },
6215 { 0x1b, 0x411111f0 },
6216 { 0x1d, 0x40f89b2d },
6217 { 0x1e, 0x411111f0 },
6218 { 0x21, 0x0321101f },
6222 [ALC280_FIXUP_HP_GPIO4] = {
6223 .type = HDA_FIXUP_FUNC,
6224 .v.func = alc280_fixup_hp_gpio4,
6226 [ALC286_FIXUP_HP_GPIO_LED] = {
6227 .type = HDA_FIXUP_FUNC,
6228 .v.func = alc286_fixup_hp_gpio_led,
6230 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY] = {
6231 .type = HDA_FIXUP_FUNC,
6232 .v.func = alc280_fixup_hp_gpio2_mic_hotkey,
6234 [ALC280_FIXUP_HP_DOCK_PINS] = {
6235 .type = HDA_FIXUP_PINS,
6236 .v.pins = (const struct hda_pintbl[]) {
6237 { 0x1b, 0x21011020 }, /* line-out */
6238 { 0x1a, 0x01a1903c }, /* headset mic */
6239 { 0x18, 0x2181103f }, /* line-in */
6243 .chain_id = ALC280_FIXUP_HP_GPIO4
6245 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED] = {
6246 .type = HDA_FIXUP_PINS,
6247 .v.pins = (const struct hda_pintbl[]) {
6248 { 0x1b, 0x21011020 }, /* line-out */
6249 { 0x18, 0x2181103f }, /* line-in */
6253 .chain_id = ALC269_FIXUP_HP_GPIO_MIC1_LED
6255 [ALC280_FIXUP_HP_9480M] = {
6256 .type = HDA_FIXUP_FUNC,
6257 .v.func = alc280_fixup_hp_9480m,
6259 [ALC288_FIXUP_DELL_HEADSET_MODE] = {
6260 .type = HDA_FIXUP_FUNC,
6261 .v.func = alc_fixup_headset_mode_dell_alc288,
6263 .chain_id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6265 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6266 .type = HDA_FIXUP_PINS,
6267 .v.pins = (const struct hda_pintbl[]) {
6268 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6269 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6273 .chain_id = ALC288_FIXUP_DELL_HEADSET_MODE
6275 [ALC288_FIXUP_DISABLE_AAMIX] = {
6276 .type = HDA_FIXUP_FUNC,
6277 .v.func = alc_fixup_disable_aamix,
6279 .chain_id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6281 [ALC288_FIXUP_DELL_XPS_13] = {
6282 .type = HDA_FIXUP_FUNC,
6283 .v.func = alc_fixup_dell_xps13,
6285 .chain_id = ALC288_FIXUP_DISABLE_AAMIX
6287 [ALC292_FIXUP_DISABLE_AAMIX] = {
6288 .type = HDA_FIXUP_FUNC,
6289 .v.func = alc_fixup_disable_aamix,
6291 .chain_id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6293 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK] = {
6294 .type = HDA_FIXUP_FUNC,
6295 .v.func = alc_fixup_disable_aamix,
6297 .chain_id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6299 [ALC292_FIXUP_DELL_E7X] = {
6300 .type = HDA_FIXUP_FUNC,
6301 .v.func = alc_fixup_dell_xps13,
6303 .chain_id = ALC292_FIXUP_DISABLE_AAMIX
6305 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6306 .type = HDA_FIXUP_PINS,
6307 .v.pins = (const struct hda_pintbl[]) {
6308 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6309 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6313 .chain_id = ALC269_FIXUP_HEADSET_MODE
6315 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE] = {
6316 .type = HDA_FIXUP_PINS,
6317 .v.pins = (const struct hda_pintbl[]) {
6318 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6322 .chain_id = ALC269_FIXUP_HEADSET_MODE
6324 [ALC275_FIXUP_DELL_XPS] = {
6325 .type = HDA_FIXUP_VERBS,
6326 .v.verbs = (const struct hda_verb[]) {
6327 /* Enables internal speaker */
6328 {0x20, AC_VERB_SET_COEF_INDEX, 0x1f},
6329 {0x20, AC_VERB_SET_PROC_COEF, 0x00c0},
6330 {0x20, AC_VERB_SET_COEF_INDEX, 0x30},
6331 {0x20, AC_VERB_SET_PROC_COEF, 0x00b1},
6335 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE] = {
6336 .type = HDA_FIXUP_VERBS,
6337 .v.verbs = (const struct hda_verb[]) {
6338 /* Disable pass-through path for FRONT 14h */
6339 {0x20, AC_VERB_SET_COEF_INDEX, 0x36},
6340 {0x20, AC_VERB_SET_PROC_COEF, 0x1737},
6344 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6346 [ALC293_FIXUP_LENOVO_SPK_NOISE] = {
6347 .type = HDA_FIXUP_FUNC,
6348 .v.func = alc_fixup_disable_aamix,
6350 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6352 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY] = {
6353 .type = HDA_FIXUP_FUNC,
6354 .v.func = alc233_fixup_lenovo_line2_mic_hotkey,
6356 [ALC255_FIXUP_DELL_SPK_NOISE] = {
6357 .type = HDA_FIXUP_FUNC,
6358 .v.func = alc_fixup_disable_aamix,
6360 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6362 [ALC225_FIXUP_DISABLE_MIC_VREF] = {
6363 .type = HDA_FIXUP_FUNC,
6364 .v.func = alc_fixup_disable_mic_vref,
6366 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6368 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE] = {
6369 .type = HDA_FIXUP_VERBS,
6370 .v.verbs = (const struct hda_verb[]) {
6371 /* Disable pass-through path for FRONT 14h */
6372 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6373 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6377 .chain_id = ALC225_FIXUP_DISABLE_MIC_VREF
6379 [ALC280_FIXUP_HP_HEADSET_MIC] = {
6380 .type = HDA_FIXUP_FUNC,
6381 .v.func = alc_fixup_disable_aamix,
6383 .chain_id = ALC269_FIXUP_HEADSET_MIC,
6385 [ALC221_FIXUP_HP_FRONT_MIC] = {
6386 .type = HDA_FIXUP_PINS,
6387 .v.pins = (const struct hda_pintbl[]) {
6388 { 0x19, 0x02a19020 }, /* Front Mic */
6392 [ALC292_FIXUP_TPT460] = {
6393 .type = HDA_FIXUP_FUNC,
6394 .v.func = alc_fixup_tpt440_dock,
6396 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE,
6398 [ALC298_FIXUP_SPK_VOLUME] = {
6399 .type = HDA_FIXUP_FUNC,
6400 .v.func = alc298_fixup_speaker_volume,
6402 .chain_id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE,
6404 [ALC295_FIXUP_DISABLE_DAC3] = {
6405 .type = HDA_FIXUP_FUNC,
6406 .v.func = alc295_fixup_disable_dac3,
6408 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER] = {
6409 .type = HDA_FIXUP_PINS,
6410 .v.pins = (const struct hda_pintbl[]) {
6411 { 0x1b, 0x90170151 },
6415 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6417 [ALC269_FIXUP_ATIV_BOOK_8] = {
6418 .type = HDA_FIXUP_FUNC,
6419 .v.func = alc_fixup_auto_mute_via_amp,
6421 .chain_id = ALC269_FIXUP_NO_SHUTUP
6423 [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = {
6424 .type = HDA_FIXUP_PINS,
6425 .v.pins = (const struct hda_pintbl[]) {
6426 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6427 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6431 .chain_id = ALC269_FIXUP_HEADSET_MODE
6433 [ALC256_FIXUP_ASUS_HEADSET_MODE] = {
6434 .type = HDA_FIXUP_FUNC,
6435 .v.func = alc_fixup_headset_mode,
6437 [ALC256_FIXUP_ASUS_MIC] = {
6438 .type = HDA_FIXUP_PINS,
6439 .v.pins = (const struct hda_pintbl[]) {
6440 { 0x13, 0x90a60160 }, /* use as internal mic */
6441 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6445 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6447 [ALC256_FIXUP_ASUS_AIO_GPIO2] = {
6448 .type = HDA_FIXUP_FUNC,
6449 /* Set up GPIO2 for the speaker amp */
6450 .v.func = alc_fixup_gpio4,
6452 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6453 .type = HDA_FIXUP_PINS,
6454 .v.pins = (const struct hda_pintbl[]) {
6455 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6459 .chain_id = ALC269_FIXUP_HEADSET_MIC
6461 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE] = {
6462 .type = HDA_FIXUP_VERBS,
6463 .v.verbs = (const struct hda_verb[]) {
6464 /* Enables internal speaker */
6465 {0x20, AC_VERB_SET_COEF_INDEX, 0x40},
6466 {0x20, AC_VERB_SET_PROC_COEF, 0x8800},
6470 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6472 [ALC233_FIXUP_LENOVO_MULTI_CODECS] = {
6473 .type = HDA_FIXUP_FUNC,
6474 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
6476 [ALC233_FIXUP_ACER_HEADSET_MIC] = {
6477 .type = HDA_FIXUP_VERBS,
6478 .v.verbs = (const struct hda_verb[]) {
6479 { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 },
6480 { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 },
6484 .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6486 [ALC294_FIXUP_LENOVO_MIC_LOCATION] = {
6487 .type = HDA_FIXUP_PINS,
6488 .v.pins = (const struct hda_pintbl[]) {
6489 /* Change the mic location from front to right, otherwise there are
6490 two front mics with the same name, pulseaudio can't handle them.
6491 This is just a temporary workaround, after applying this fixup,
6492 there will be one "Front Mic" and one "Mic" in this machine.
6494 { 0x1a, 0x04a19040 },
6498 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE] = {
6499 .type = HDA_FIXUP_PINS,
6500 .v.pins = (const struct hda_pintbl[]) {
6501 { 0x16, 0x0101102f }, /* Rear Headset HP */
6502 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6503 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6504 { 0x1b, 0x02011020 },
6508 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6510 [ALC700_FIXUP_INTEL_REFERENCE] = {
6511 .type = HDA_FIXUP_VERBS,
6512 .v.verbs = (const struct hda_verb[]) {
6513 /* Enables internal speaker */
6514 {0x20, AC_VERB_SET_COEF_INDEX, 0x45},
6515 {0x20, AC_VERB_SET_PROC_COEF, 0x5289},
6516 {0x20, AC_VERB_SET_COEF_INDEX, 0x4A},
6517 {0x20, AC_VERB_SET_PROC_COEF, 0x001b},
6518 {0x58, AC_VERB_SET_COEF_INDEX, 0x00},
6519 {0x58, AC_VERB_SET_PROC_COEF, 0x3888},
6520 {0x20, AC_VERB_SET_COEF_INDEX, 0x6f},
6521 {0x20, AC_VERB_SET_PROC_COEF, 0x2c0b},
6525 [ALC274_FIXUP_DELL_BIND_DACS] = {
6526 .type = HDA_FIXUP_FUNC,
6527 .v.func = alc274_fixup_bind_dacs,
6529 .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6531 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = {
6532 .type = HDA_FIXUP_PINS,
6533 .v.pins = (const struct hda_pintbl[]) {
6534 { 0x1b, 0x0401102f },
6538 .chain_id = ALC274_FIXUP_DELL_BIND_DACS
6540 [ALC298_FIXUP_TPT470_DOCK] = {
6541 .type = HDA_FIXUP_FUNC,
6542 .v.func = alc_fixup_tpt470_dock,
6544 .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
6546 [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
6547 .type = HDA_FIXUP_PINS,
6548 .v.pins = (const struct hda_pintbl[]) {
6549 { 0x14, 0x0201101f },
6553 .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6555 [ALC255_FIXUP_DELL_HEADSET_MIC] = {
6556 .type = HDA_FIXUP_PINS,
6557 .v.pins = (const struct hda_pintbl[]) {
6558 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6562 .chain_id = ALC269_FIXUP_HEADSET_MIC
6564 [ALC295_FIXUP_HP_X360] = {
6565 .type = HDA_FIXUP_FUNC,
6566 .v.func = alc295_fixup_hp_top_speakers,
6568 .chain_id = ALC269_FIXUP_HP_MUTE_LED_MIC3
6570 [ALC221_FIXUP_HP_HEADSET_MIC] = {
6571 .type = HDA_FIXUP_PINS,
6572 .v.pins = (const struct hda_pintbl[]) {
6573 { 0x19, 0x0181313f},
6577 .chain_id = ALC269_FIXUP_HEADSET_MIC
6579 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE] = {
6580 .type = HDA_FIXUP_FUNC,
6581 .v.func = alc285_fixup_invalidate_dacs,
6583 .chain_id = ALC269_FIXUP_THINKPAD_ACPI
6585 [ALC295_FIXUP_HP_AUTO_MUTE] = {
6586 .type = HDA_FIXUP_FUNC,
6587 .v.func = alc_fixup_auto_mute_via_amp,
6589 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE] = {
6590 .type = HDA_FIXUP_PINS,
6591 .v.pins = (const struct hda_pintbl[]) {
6592 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6596 .chain_id = ALC269_FIXUP_HEADSET_MIC
6598 [ALC294_FIXUP_ASUS_MIC] = {
6599 .type = HDA_FIXUP_PINS,
6600 .v.pins = (const struct hda_pintbl[]) {
6601 { 0x13, 0x90a60160 }, /* use as internal mic */
6602 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6606 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6608 [ALC294_FIXUP_ASUS_HEADSET_MIC] = {
6609 .type = HDA_FIXUP_PINS,
6610 .v.pins = (const struct hda_pintbl[]) {
6611 { 0x19, 0x01a1103c }, /* use as headset mic */
6615 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6617 [ALC294_FIXUP_ASUS_SPK] = {
6618 .type = HDA_FIXUP_VERBS,
6619 .v.verbs = (const struct hda_verb[]) {
6621 { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 },
6622 { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 },
6626 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
6628 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
6629 .type = HDA_FIXUP_PINS,
6630 .v.pins = (const struct hda_pintbl[]) {
6631 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6635 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6637 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE] = {
6638 .type = HDA_FIXUP_VERBS,
6639 .v.verbs = (const struct hda_verb[]) {
6640 /* Disable PCBEEP-IN passthrough */
6641 { 0x20, AC_VERB_SET_COEF_INDEX, 0x36 },
6642 { 0x20, AC_VERB_SET_PROC_COEF, 0x57d7 },
6646 .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6648 [ALC255_FIXUP_ACER_HEADSET_MIC] = {
6649 .type = HDA_FIXUP_PINS,
6650 .v.pins = (const struct hda_pintbl[]) {
6651 { 0x19, 0x03a11130 },
6652 { 0x1a, 0x90a60140 }, /* use as internal mic */
6656 .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6658 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = {
6659 .type = HDA_FIXUP_PINS,
6660 .v.pins = (const struct hda_pintbl[]) {
6661 { 0x16, 0x01011020 }, /* Rear Line out */
6662 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6666 .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE
6668 [ALC225_FIXUP_WYSE_AUTO_MUTE] = {
6669 .type = HDA_FIXUP_FUNC,
6670 .v.func = alc_fixup_auto_mute_via_amp,
6672 .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6674 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = {
6675 .type = HDA_FIXUP_FUNC,
6676 .v.func = alc_fixup_disable_mic_vref,
6678 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6680 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC] = {
6681 .type = HDA_FIXUP_VERBS,
6682 .v.verbs = (const struct hda_verb[]) {
6683 { 0x20, AC_VERB_SET_COEF_INDEX, 0x4f },
6684 { 0x20, AC_VERB_SET_PROC_COEF, 0x5029 },
6688 .chain_id = ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
6690 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE] = {
6691 .type = HDA_FIXUP_PINS,
6692 .v.pins = (const struct hda_pintbl[]) {
6693 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6697 .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
6699 [ALC299_FIXUP_PREDATOR_SPK] = {
6700 .type = HDA_FIXUP_PINS,
6701 .v.pins = (const struct hda_pintbl[]) {
6702 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
6708 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6709 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
6710 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
6711 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
6712 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
6713 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
6714 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
6715 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK),
6716 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK),
6717 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
6718 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
6719 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
6720 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
6721 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
6722 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
6723 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
6724 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
6725 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
6726 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
6727 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
6728 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
6729 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC),
6730 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
6731 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
6732 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS),
6733 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X),
6734 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
6735 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X),
6736 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X),
6737 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
6738 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
6739 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
6740 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
6741 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
6742 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
6743 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X),
6744 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X),
6745 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
6746 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6747 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6748 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13),
6749 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
6750 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK),
6751 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
6752 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6753 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6754 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6755 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6756 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6757 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6758 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK),
6759 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6760 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
6761 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE),
6762 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP),
6763 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6764 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME),
6765 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME),
6766 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3),
6767 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER),
6768 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE),
6769 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE),
6770 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6771 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6772 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
6773 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC),
6774 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB),
6775 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE),
6776 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE),
6777 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB),
6778 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6779 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE),
6780 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
6781 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
6782 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
6783 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY),
6785 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6786 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6787 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6788 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6789 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6790 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6791 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6792 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
6793 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6794 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6795 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6796 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6797 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED),
6798 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS),
6799 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS),
6800 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6801 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6802 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6803 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6804 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6805 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M),
6806 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6807 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6809 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6810 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6811 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6812 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6813 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6814 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6815 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6816 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6817 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6818 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED),
6819 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6820 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6821 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6822 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6823 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6824 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6825 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED),
6826 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6827 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6828 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6829 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6830 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6831 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6832 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6833 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6834 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6835 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6836 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6837 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
6838 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC),
6839 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
6840 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
6841 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
6842 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC),
6843 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360),
6844 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
6845 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE),
6846 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
6847 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
6848 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
6849 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
6850 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
6851 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6852 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
6853 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
6854 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
6855 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6856 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
6857 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
6858 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
6859 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
6860 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC),
6861 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC),
6862 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
6863 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
6864 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
6865 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
6866 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
6867 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
6868 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
6869 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6870 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
6871 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
6872 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
6873 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
6874 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
6875 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
6876 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
6877 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
6878 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
6879 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
6880 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
6881 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
6882 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX),
6883 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK),
6884 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT),
6885 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6886 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN),
6887 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
6888 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
6889 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
6890 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
6891 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
6892 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
6893 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
6894 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
6895 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6896 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
6897 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
6898 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
6899 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
6900 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
6901 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
6902 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
6903 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
6904 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
6905 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
6906 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
6907 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
6908 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
6909 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
6910 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
6911 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
6912 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
6913 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440),
6914 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
6915 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
6916 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK),
6917 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK),
6918 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK),
6919 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6920 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK),
6921 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK),
6922 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK),
6923 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6924 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6925 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460),
6926 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460),
6927 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK),
6928 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6929 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6930 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460),
6931 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6932 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6933 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6934 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6935 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6936 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
6937 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6938 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6939 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6940 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6941 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6942 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
6943 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
6944 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
6945 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6946 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
6947 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK),
6948 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6949 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK),
6950 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK),
6951 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK),
6952 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK),
6953 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE),
6954 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460),
6955 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460),
6956 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460),
6957 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6958 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6959 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6960 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
6961 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6962 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
6963 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
6964 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
6965 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS),
6966 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
6969 /* Below is a quirk table taken from the old code.
6970 * Basically the device should work as is without the fixup table.
6971 * If BIOS doesn't give a proper info, enable the corresponding
6974 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
6976 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC),
6977 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC),
6978 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC),
6979 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC),
6980 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC),
6981 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC),
6982 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC),
6983 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC),
6984 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC),
6985 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC),
6986 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC),
6987 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC),
6988 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC),
6989 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC),
6990 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC),
6991 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC),
6992 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC),
6993 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC),
6994 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC),
6995 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC),
6996 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC),
6997 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC),
6998 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC),
6999 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC),
7000 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC),
7001 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC),
7002 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC),
7003 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC),
7004 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC),
7005 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC),
7006 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC),
7007 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC),
7008 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC),
7009 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC),
7010 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC),
7011 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC),
7012 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC),
7013 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC),
7014 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC),
7019 static const struct snd_pci_quirk alc269_fixup_vendor_tbl[] = {
7020 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC),
7021 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
7022 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
7023 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI),
7027 static const struct hda_model_fixup alc269_fixup_models[] = {
7028 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
7029 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
7030 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
7031 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
7032 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
7033 {.id = ALC269_FIXUP_HEADSET_MIC, .name = "headset-mic"},
7034 {.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
7035 {.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
7036 {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
7037 {.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7038 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
7039 {.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
7040 {.id = ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "dell-headset-dock"},
7041 {.id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, .name = "dell-headset3"},
7042 {.id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, .name = "dell-headset4"},
7043 {.id = ALC283_FIXUP_CHROME_BOOK, .name = "alc283-dac-wcaps"},
7044 {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"},
7045 {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
7046 {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
7047 {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
7048 {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
7049 {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
7050 {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
7051 {.id = ALC269_FIXUP_SONY_VAIO, .name = "vaio"},
7052 {.id = ALC269_FIXUP_DELL_M101Z, .name = "dell-m101z"},
7053 {.id = ALC269_FIXUP_ASUS_G73JW, .name = "asus-g73jw"},
7054 {.id = ALC269_FIXUP_LENOVO_EAPD, .name = "lenovo-eapd"},
7055 {.id = ALC275_FIXUP_SONY_HWEQ, .name = "sony-hweq"},
7056 {.id = ALC269_FIXUP_PCM_44K, .name = "pcm44k"},
7057 {.id = ALC269_FIXUP_LIFEBOOK, .name = "lifebook"},
7058 {.id = ALC269_FIXUP_LIFEBOOK_EXTMIC, .name = "lifebook-extmic"},
7059 {.id = ALC269_FIXUP_LIFEBOOK_HP_PIN, .name = "lifebook-hp-pin"},
7060 {.id = ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC, .name = "lifebook-u7x7"},
7061 {.id = ALC269VB_FIXUP_AMIC, .name = "alc269vb-amic"},
7062 {.id = ALC269VB_FIXUP_DMIC, .name = "alc269vb-dmic"},
7063 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC1, .name = "hp-mute-led-mic1"},
7064 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC2, .name = "hp-mute-led-mic2"},
7065 {.id = ALC269_FIXUP_HP_MUTE_LED_MIC3, .name = "hp-mute-led-mic3"},
7066 {.id = ALC269_FIXUP_HP_GPIO_MIC1_LED, .name = "hp-gpio-mic1"},
7067 {.id = ALC269_FIXUP_HP_LINE1_MIC1_LED, .name = "hp-line1-mic1"},
7068 {.id = ALC269_FIXUP_NO_SHUTUP, .name = "noshutup"},
7069 {.id = ALC286_FIXUP_SONY_MIC_NO_PRESENCE, .name = "sony-nomic"},
7070 {.id = ALC269_FIXUP_ASPIRE_HEADSET_MIC, .name = "aspire-headset-mic"},
7071 {.id = ALC269_FIXUP_ASUS_X101, .name = "asus-x101"},
7072 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK, .name = "acer-ao7xx"},
7073 {.id = ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572, .name = "acer-aspire-e1"},
7074 {.id = ALC269_FIXUP_ACER_AC700, .name = "acer-ac700"},
7075 {.id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST, .name = "limit-mic-boost"},
7076 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK, .name = "asus-zenbook"},
7077 {.id = ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A, .name = "asus-zenbook-ux31a"},
7078 {.id = ALC269VB_FIXUP_ORDISSIMO_EVE2, .name = "ordissimo"},
7079 {.id = ALC282_FIXUP_ASUS_TX300, .name = "asus-tx300"},
7080 {.id = ALC283_FIXUP_INT_MIC, .name = "alc283-int-mic"},
7081 {.id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK, .name = "mono-speakers"},
7082 {.id = ALC290_FIXUP_SUBWOOFER_HSJACK, .name = "alc290-subwoofer"},
7083 {.id = ALC269_FIXUP_THINKPAD_ACPI, .name = "thinkpad"},
7084 {.id = ALC269_FIXUP_DMIC_THINKPAD_ACPI, .name = "dmic-thinkpad"},
7085 {.id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, .name = "alc255-acer"},
7086 {.id = ALC255_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc255-asus"},
7087 {.id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc255-dell1"},
7088 {.id = ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, .name = "alc255-dell2"},
7089 {.id = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc293-dell1"},
7090 {.id = ALC283_FIXUP_HEADSET_MIC, .name = "alc283-headset"},
7091 {.id = ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED, .name = "alc255-dell-mute"},
7092 {.id = ALC282_FIXUP_ASPIRE_V5_PINS, .name = "aspire-v5"},
7093 {.id = ALC280_FIXUP_HP_GPIO4, .name = "hp-gpio4"},
7094 {.id = ALC286_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
7095 {.id = ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, .name = "hp-gpio2-hotkey"},
7096 {.id = ALC280_FIXUP_HP_DOCK_PINS, .name = "hp-dock-pins"},
7097 {.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic"},
7098 {.id = ALC280_FIXUP_HP_9480M, .name = "hp-9480m"},
7099 {.id = ALC288_FIXUP_DELL_HEADSET_MODE, .name = "alc288-dell-headset"},
7100 {.id = ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc288-dell1"},
7101 {.id = ALC288_FIXUP_DELL_XPS_13, .name = "alc288-dell-xps13"},
7102 {.id = ALC292_FIXUP_DELL_E7X, .name = "dell-e7x"},
7103 {.id = ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK, .name = "alc293-dell"},
7104 {.id = ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc298-dell1"},
7105 {.id = ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE, .name = "alc298-dell-aio"},
7106 {.id = ALC275_FIXUP_DELL_XPS, .name = "alc275-dell-xps"},
7107 {.id = ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE, .name = "alc256-dell-xps13"},
7108 {.id = ALC293_FIXUP_LENOVO_SPK_NOISE, .name = "lenovo-spk-noise"},
7109 {.id = ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY, .name = "lenovo-hotkey"},
7110 {.id = ALC255_FIXUP_DELL_SPK_NOISE, .name = "dell-spk-noise"},
7111 {.id = ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "alc225-dell1"},
7112 {.id = ALC295_FIXUP_DISABLE_DAC3, .name = "alc295-disable-dac3"},
7113 {.id = ALC280_FIXUP_HP_HEADSET_MIC, .name = "alc280-hp-headset"},
7114 {.id = ALC221_FIXUP_HP_FRONT_MIC, .name = "alc221-hp-mic"},
7115 {.id = ALC298_FIXUP_SPK_VOLUME, .name = "alc298-spk-volume"},
7116 {.id = ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, .name = "dell-inspiron-7559"},
7117 {.id = ALC269_FIXUP_ATIV_BOOK_8, .name = "ativ-book"},
7118 {.id = ALC221_FIXUP_HP_MIC_NO_PRESENCE, .name = "alc221-hp-mic"},
7119 {.id = ALC256_FIXUP_ASUS_HEADSET_MODE, .name = "alc256-asus-headset"},
7120 {.id = ALC256_FIXUP_ASUS_MIC, .name = "alc256-asus-mic"},
7121 {.id = ALC256_FIXUP_ASUS_AIO_GPIO2, .name = "alc256-asus-aio"},
7122 {.id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, .name = "alc233-asus"},
7123 {.id = ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, .name = "alc233-eapd"},
7124 {.id = ALC294_FIXUP_LENOVO_MIC_LOCATION, .name = "alc294-lenovo-mic"},
7125 {.id = ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE, .name = "alc225-wyse"},
7126 {.id = ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, .name = "alc274-dell-aio"},
7127 {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"},
7128 {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"},
7129 {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"},
7130 {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
7133 #define ALC225_STANDARD_PINS \
7136 #define ALC256_STANDARD_PINS \
7137 {0x12, 0x90a60140}, \
7138 {0x14, 0x90170110}, \
7141 #define ALC282_STANDARD_PINS \
7144 #define ALC290_STANDARD_PINS \
7147 #define ALC292_STANDARD_PINS \
7148 {0x14, 0x90170110}, \
7151 #define ALC295_STANDARD_PINS \
7152 {0x12, 0xb7a60130}, \
7153 {0x14, 0x90170110}, \
7156 #define ALC298_STANDARD_PINS \
7157 {0x12, 0x90a60130}, \
7160 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
7161 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC,
7166 {0x21, 0x0221102f}),
7167 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE,
7170 {0x21, 0x02211030}),
7171 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7174 {0x21, 0x03211020}),
7175 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE,
7178 {0x21, 0x03211020}),
7179 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7180 ALC225_STANDARD_PINS,
7182 {0x14, 0x901701a0}),
7183 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7184 ALC225_STANDARD_PINS,
7186 {0x14, 0x901701b0}),
7187 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7188 ALC225_STANDARD_PINS,
7190 {0x14, 0x901701a0}),
7191 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7192 ALC225_STANDARD_PINS,
7194 {0x14, 0x901701b0}),
7195 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE,
7196 ALC225_STANDARD_PINS,
7198 {0x1b, 0x90170110}),
7199 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7202 {0x21, 0x02211020}),
7203 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY,
7207 {0x21, 0x02211020}),
7208 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7213 {0x21, 0x0221101f}),
7214 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7219 {0x21, 0x0221101f}),
7220 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
7224 {0x21, 0x0221101f}),
7225 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7228 {0x21, 0x02211020}),
7229 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7232 {0x21, 0x02211020}),
7233 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7234 {0x21, 0x02211020}),
7235 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7238 {0x21, 0x02211020}),
7239 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
7241 {0x21, 0x02211020}),
7242 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7244 {0x21, 0x02211040}),
7245 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7248 {0x21, 0x02211020}),
7249 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7252 {0x21, 0x02211030}),
7253 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7256 {0x21, 0x0221101f}),
7257 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7260 {0x21, 0x0221101f}),
7261 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7264 {0x21, 0x0221103f}),
7265 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7268 {0x21, 0x0221103f}),
7269 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7272 {0x21, 0x0221103f}),
7273 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7276 {0x21, 0x0221105f}),
7277 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7280 {0x21, 0x0221101f}),
7281 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7285 {0x21, 0x0321102f}),
7286 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7289 {0x21, 0x02211040}),
7290 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7293 {0x21, 0x02211050}),
7294 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7297 {0x21, 0x02211030}),
7298 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7301 {0x21, 0x02211040}),
7302 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7305 {0x21, 0x02211040}),
7306 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7309 {0x21, 0x02211050}),
7310 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7313 {0x21, 0x02211040}),
7314 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7317 {0x21, 0x02211030}),
7318 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7320 {0x21, 0x02211010}),
7321 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7325 {0x21, 0x0221101f}),
7326 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7329 {0x21, 0x02211030}),
7330 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7333 {0x21, 0x02211030}),
7334 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7337 {0x21, 0x02211030}),
7338 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7341 {0x21, 0x02211020}),
7342 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7346 {0x21, 0x0221101f}),
7347 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7348 ALC256_STANDARD_PINS),
7349 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7352 {0x21, 0x0221101f}),
7353 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7356 {0x21, 0x04211020}),
7357 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
7360 {0x21, 0x03211020}),
7361 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7364 {0x21, 0x03211020}),
7365 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7368 {0x21, 0x04211020}),
7369 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
7372 {0x21, 0x03211020}),
7373 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
7377 {0x21, 0x04211020}),
7378 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4,
7382 {0x1a, 0x04a11020}),
7383 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED,
7389 {0x1b, 0x02011020}),
7390 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7391 ALC282_STANDARD_PINS,
7394 {0x21, 0x0321101f}),
7395 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7396 ALC282_STANDARD_PINS,
7399 {0x21, 0x03211040}),
7400 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7401 ALC282_STANDARD_PINS,
7404 {0x21, 0x03211020}),
7405 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7406 ALC282_STANDARD_PINS,
7409 {0x21, 0x0421101f}),
7410 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED,
7411 ALC282_STANDARD_PINS,
7414 {0x21, 0x04211020}),
7415 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7416 ALC282_STANDARD_PINS,
7418 {0x21, 0x0321101f}),
7419 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7422 {0x21, 0x02211030}),
7423 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7424 ALC282_STANDARD_PINS,
7427 {0x21, 0x0321101f}),
7428 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
7432 {0x21, 0x04211020}),
7433 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
7436 {0x21, 0x02211020}),
7437 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE,
7440 {0x21, 0x0321101f}),
7441 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7444 {0x21, 0x04211020}),
7445 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7446 ALC290_STANDARD_PINS,
7449 {0x1a, 0x04a11020}),
7450 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7451 ALC290_STANDARD_PINS,
7454 {0x1a, 0x04a11020}),
7455 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7456 ALC290_STANDARD_PINS,
7458 {0x1a, 0x04a11020}),
7459 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7460 ALC290_STANDARD_PINS,
7462 {0x1a, 0x04a11040}),
7463 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7464 ALC290_STANDARD_PINS,
7467 {0x1a, 0x04a11040}),
7468 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7469 ALC290_STANDARD_PINS,
7472 {0x1a, 0x04a11020}),
7473 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1,
7474 ALC290_STANDARD_PINS,
7477 {0x1a, 0x04a11020}),
7478 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7479 ALC292_STANDARD_PINS,
7482 {0x19, 0x01a19030}),
7483 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE,
7484 ALC292_STANDARD_PINS,
7488 {0x19, 0x01a1903e}),
7489 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
7490 ALC292_STANDARD_PINS,
7491 {0x12, 0x90a60140}),
7492 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7493 ALC292_STANDARD_PINS,
7496 {0x19, 0x21a19030}),
7497 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
7498 ALC292_STANDARD_PINS,
7499 {0x13, 0x90a60140}),
7500 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC,
7503 {0x21, 0x04211020}),
7504 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7507 {0x21, 0x03211020}),
7508 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7511 {0x21, 0x04211020}),
7512 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK,
7515 {0x21, 0x03211020}),
7516 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7518 {0x21, 0x04211020}),
7519 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7521 {0x21, 0x04211030}),
7522 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7523 ALC295_STANDARD_PINS,
7525 {0x18, 0x21a19030}),
7526 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7527 ALC295_STANDARD_PINS,
7529 {0x18, 0x21a19050}),
7530 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
7531 ALC295_STANDARD_PINS),
7532 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7533 ALC298_STANDARD_PINS,
7534 {0x17, 0x90170110}),
7535 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7536 ALC298_STANDARD_PINS,
7537 {0x17, 0x90170140}),
7538 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE,
7539 ALC298_STANDARD_PINS,
7540 {0x17, 0x90170150}),
7541 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME,
7546 {0x21, 0x03211030}),
7547 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
7548 ALC225_STANDARD_PINS,
7550 {0x17, 0x90170110}),
7554 static void alc269_fill_coef(struct hda_codec *codec)
7556 struct alc_spec *spec = codec->spec;
7559 if (spec->codec_variant != ALC269_TYPE_ALC269VB)
7562 if ((alc_get_coef0(codec) & 0x00ff) < 0x015) {
7563 alc_write_coef_idx(codec, 0xf, 0x960b);
7564 alc_write_coef_idx(codec, 0xe, 0x8817);
7567 if ((alc_get_coef0(codec) & 0x00ff) == 0x016) {
7568 alc_write_coef_idx(codec, 0xf, 0x960b);
7569 alc_write_coef_idx(codec, 0xe, 0x8814);
7572 if ((alc_get_coef0(codec) & 0x00ff) == 0x017) {
7573 /* Power up output pin */
7574 alc_update_coef_idx(codec, 0x04, 0, 1<<11);
7577 if ((alc_get_coef0(codec) & 0x00ff) == 0x018) {
7578 val = alc_read_coef_idx(codec, 0xd);
7579 if (val != -1 && (val & 0x0c00) >> 10 != 0x1) {
7580 /* Capless ramp up clock control */
7581 alc_write_coef_idx(codec, 0xd, val | (1<<10));
7583 val = alc_read_coef_idx(codec, 0x17);
7584 if (val != -1 && (val & 0x01c0) >> 6 != 0x4) {
7585 /* Class D power on reset */
7586 alc_write_coef_idx(codec, 0x17, val | (1<<7));
7591 alc_update_coef_idx(codec, 0x4, 0, 1<<11);
7596 static int patch_alc269(struct hda_codec *codec)
7598 struct alc_spec *spec;
7601 err = alc_alloc_spec(codec, 0x0b);
7606 spec->gen.shared_mic_vref_pin = 0x18;
7607 codec->power_save_node = 0;
7610 codec->patch_ops.suspend = alc269_suspend;
7611 codec->patch_ops.resume = alc269_resume;
7613 spec->shutup = alc_default_shutup;
7614 spec->init_hook = alc_default_init;
7616 switch (codec->core.vendor_id) {
7618 spec->codec_variant = ALC269_TYPE_ALC269VA;
7619 switch (alc_get_coef0(codec) & 0x00f0) {
7621 if (codec->bus->pci &&
7622 codec->bus->pci->subsystem_vendor == 0x1025 &&
7623 spec->cdefine.platform_type == 1)
7624 err = alc_codec_rename(codec, "ALC271X");
7625 spec->codec_variant = ALC269_TYPE_ALC269VB;
7628 if (codec->bus->pci &&
7629 codec->bus->pci->subsystem_vendor == 0x17aa &&
7630 codec->bus->pci->subsystem_device == 0x21f3)
7631 err = alc_codec_rename(codec, "ALC3202");
7632 spec->codec_variant = ALC269_TYPE_ALC269VC;
7635 spec->codec_variant = ALC269_TYPE_ALC269VD;
7638 alc_fix_pll_init(codec, 0x20, 0x04, 15);
7642 spec->shutup = alc269_shutup;
7643 spec->init_hook = alc269_fill_coef;
7644 alc269_fill_coef(codec);
7649 spec->codec_variant = ALC269_TYPE_ALC280;
7652 spec->codec_variant = ALC269_TYPE_ALC282;
7653 spec->shutup = alc282_shutup;
7654 spec->init_hook = alc282_init;
7658 spec->codec_variant = ALC269_TYPE_ALC283;
7659 spec->shutup = alc283_shutup;
7660 spec->init_hook = alc283_init;
7664 spec->codec_variant = ALC269_TYPE_ALC284;
7667 spec->codec_variant = ALC269_TYPE_ALC293;
7671 spec->codec_variant = ALC269_TYPE_ALC286;
7674 spec->codec_variant = ALC269_TYPE_ALC298;
7678 spec->codec_variant = ALC269_TYPE_ALC255;
7679 spec->shutup = alc256_shutup;
7680 spec->init_hook = alc256_init;
7684 spec->codec_variant = ALC269_TYPE_ALC256;
7685 spec->shutup = alc256_shutup;
7686 spec->init_hook = alc256_init;
7687 spec->gen.mixer_nid = 0; /* ALC256 does not have any loopback mixer path */
7690 spec->codec_variant = ALC269_TYPE_ALC257;
7691 spec->shutup = alc256_shutup;
7692 spec->init_hook = alc256_init;
7693 spec->gen.mixer_nid = 0;
7698 spec->codec_variant = ALC269_TYPE_ALC215;
7699 spec->shutup = alc225_shutup;
7700 spec->init_hook = alc225_init;
7701 spec->gen.mixer_nid = 0;
7706 spec->codec_variant = ALC269_TYPE_ALC225;
7707 spec->shutup = alc225_shutup;
7708 spec->init_hook = alc225_init;
7709 spec->gen.mixer_nid = 0; /* no loopback on ALC225, ALC295 and ALC299 */
7714 spec->codec_variant = ALC269_TYPE_ALC294;
7715 spec->gen.mixer_nid = 0; /* ALC2x4 does not have any loopback mixer path */
7716 alc_update_coef_idx(codec, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7717 spec->init_hook = alc294_init;
7720 spec->codec_variant = ALC269_TYPE_ALC300;
7721 spec->gen.mixer_nid = 0; /* no loopback on ALC300 */
7726 spec->codec_variant = ALC269_TYPE_ALC700;
7727 spec->gen.mixer_nid = 0; /* ALC700 does not have any loopback mixer path */
7728 alc_update_coef_idx(codec, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7729 spec->init_hook = alc294_init;
7734 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
7735 spec->has_alc5505_dsp = 1;
7736 spec->init_hook = alc5505_dsp_init;
7739 snd_hda_pick_fixup(codec, alc269_fixup_models,
7740 alc269_fixup_tbl, alc269_fixups);
7741 snd_hda_pick_pin_fixup(codec, alc269_pin_fixup_tbl, alc269_fixups);
7742 snd_hda_pick_fixup(codec, NULL, alc269_fixup_vendor_tbl,
7744 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
7746 alc_auto_parse_customize_define(codec);
7748 if (has_cdefine_beep(codec))
7749 spec->gen.beep_nid = 0x01;
7751 /* automatic parse from the BIOS config */
7752 err = alc269_parse_auto_config(codec);
7756 if (!spec->gen.no_analog && spec->gen.beep_nid && spec->gen.mixer_nid) {
7757 err = set_beep_amp(spec, spec->gen.mixer_nid, 0x04, HDA_INPUT);
7762 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
7775 static int alc861_parse_auto_config(struct hda_codec *codec)
7777 static const hda_nid_t alc861_ignore[] = { 0x1d, 0 };
7778 static const hda_nid_t alc861_ssids[] = { 0x0e, 0x0f, 0x0b, 0 };
7779 return alc_parse_auto_config(codec, alc861_ignore, alc861_ssids);
7782 /* Pin config fixes */
7784 ALC861_FIXUP_FSC_AMILO_PI1505,
7785 ALC861_FIXUP_AMP_VREF_0F,
7786 ALC861_FIXUP_NO_JACK_DETECT,
7787 ALC861_FIXUP_ASUS_A6RP,
7788 ALC660_FIXUP_ASUS_W7J,
7791 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7792 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec *codec,
7793 const struct hda_fixup *fix, int action)
7795 struct alc_spec *spec = codec->spec;
7798 if (action != HDA_FIXUP_ACT_INIT)
7800 val = snd_hda_codec_get_pin_target(codec, 0x0f);
7801 if (!(val & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN)))
7802 val |= AC_PINCTL_IN_EN;
7803 val |= AC_PINCTL_VREF_50;
7804 snd_hda_set_pin_ctl(codec, 0x0f, val);
7805 spec->gen.keep_vref_in_automute = 1;
7808 /* suppress the jack-detection */
7809 static void alc_fixup_no_jack_detect(struct hda_codec *codec,
7810 const struct hda_fixup *fix, int action)
7812 if (action == HDA_FIXUP_ACT_PRE_PROBE)
7813 codec->no_jack_detect = 1;
7816 static const struct hda_fixup alc861_fixups[] = {
7817 [ALC861_FIXUP_FSC_AMILO_PI1505] = {
7818 .type = HDA_FIXUP_PINS,
7819 .v.pins = (const struct hda_pintbl[]) {
7820 { 0x0b, 0x0221101f }, /* HP */
7821 { 0x0f, 0x90170310 }, /* speaker */
7825 [ALC861_FIXUP_AMP_VREF_0F] = {
7826 .type = HDA_FIXUP_FUNC,
7827 .v.func = alc861_fixup_asus_amp_vref_0f,
7829 [ALC861_FIXUP_NO_JACK_DETECT] = {
7830 .type = HDA_FIXUP_FUNC,
7831 .v.func = alc_fixup_no_jack_detect,
7833 [ALC861_FIXUP_ASUS_A6RP] = {
7834 .type = HDA_FIXUP_FUNC,
7835 .v.func = alc861_fixup_asus_amp_vref_0f,
7837 .chain_id = ALC861_FIXUP_NO_JACK_DETECT,
7839 [ALC660_FIXUP_ASUS_W7J] = {
7840 .type = HDA_FIXUP_VERBS,
7841 .v.verbs = (const struct hda_verb[]) {
7842 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7843 * for enabling outputs
7845 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
7851 static const struct snd_pci_quirk alc861_fixup_tbl[] = {
7852 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J),
7853 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J),
7854 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP),
7855 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F),
7856 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT),
7857 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F),
7858 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F),
7859 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505),
7865 static int patch_alc861(struct hda_codec *codec)
7867 struct alc_spec *spec;
7870 err = alc_alloc_spec(codec, 0x15);
7875 spec->gen.beep_nid = 0x23;
7878 spec->power_hook = alc_power_eapd;
7881 snd_hda_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
7882 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
7884 /* automatic parse from the BIOS config */
7885 err = alc861_parse_auto_config(codec);
7889 if (!spec->gen.no_analog) {
7890 err = set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);
7895 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
7909 * In addition, an independent DAC
7911 static int alc861vd_parse_auto_config(struct hda_codec *codec)
7913 static const hda_nid_t alc861vd_ignore[] = { 0x1d, 0 };
7914 static const hda_nid_t alc861vd_ssids[] = { 0x15, 0x1b, 0x14, 0 };
7915 return alc_parse_auto_config(codec, alc861vd_ignore, alc861vd_ssids);
7919 ALC660VD_FIX_ASUS_GPIO1,
7920 ALC861VD_FIX_DALLAS,
7923 /* exclude VREF80 */
7924 static void alc861vd_fixup_dallas(struct hda_codec *codec,
7925 const struct hda_fixup *fix, int action)
7927 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
7928 snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
7929 snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
7934 static void alc660vd_fixup_asus_gpio1(struct hda_codec *codec,
7935 const struct hda_fixup *fix, int action)
7937 struct alc_spec *spec = codec->spec;
7939 if (action == HDA_FIXUP_ACT_PRE_PROBE)
7940 spec->gpio_mask |= 0x02;
7941 alc_fixup_gpio(codec, action, 0x01);
7944 static const struct hda_fixup alc861vd_fixups[] = {
7945 [ALC660VD_FIX_ASUS_GPIO1] = {
7946 .type = HDA_FIXUP_FUNC,
7947 .v.func = alc660vd_fixup_asus_gpio1,
7949 [ALC861VD_FIX_DALLAS] = {
7950 .type = HDA_FIXUP_FUNC,
7951 .v.func = alc861vd_fixup_dallas,
7955 static const struct snd_pci_quirk alc861vd_fixup_tbl[] = {
7956 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS),
7957 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1),
7958 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS),
7964 static int patch_alc861vd(struct hda_codec *codec)
7966 struct alc_spec *spec;
7969 err = alc_alloc_spec(codec, 0x0b);
7974 spec->gen.beep_nid = 0x23;
7976 spec->shutup = alc_eapd_shutup;
7978 snd_hda_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
7979 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
7981 /* automatic parse from the BIOS config */
7982 err = alc861vd_parse_auto_config(codec);
7986 if (!spec->gen.no_analog) {
7987 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
7992 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8004 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8005 * configuration. Each pin widget can choose any input DACs and a mixer.
8006 * Each ADC is connected from a mixer of all inputs. This makes possible
8007 * 6-channel independent captures.
8009 * In addition, an independent DAC for the multi-playback (not used in this
8014 * BIOS auto configuration
8017 static int alc662_parse_auto_config(struct hda_codec *codec)
8019 static const hda_nid_t alc662_ignore[] = { 0x1d, 0 };
8020 static const hda_nid_t alc663_ssids[] = { 0x15, 0x1b, 0x14, 0x21 };
8021 static const hda_nid_t alc662_ssids[] = { 0x15, 0x1b, 0x14, 0 };
8022 const hda_nid_t *ssids;
8024 if (codec->core.vendor_id == 0x10ec0272 || codec->core.vendor_id == 0x10ec0663 ||
8025 codec->core.vendor_id == 0x10ec0665 || codec->core.vendor_id == 0x10ec0670 ||
8026 codec->core.vendor_id == 0x10ec0671)
8027 ssids = alc663_ssids;
8029 ssids = alc662_ssids;
8030 return alc_parse_auto_config(codec, alc662_ignore, ssids);
8033 static void alc272_fixup_mario(struct hda_codec *codec,
8034 const struct hda_fixup *fix, int action)
8036 if (action != HDA_FIXUP_ACT_PRE_PROBE)
8038 if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
8039 (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
8040 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
8041 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT) |
8042 (0 << AC_AMPCAP_MUTE_SHIFT)))
8043 codec_warn(codec, "failed to override amp caps for NID 0x2\n");
8046 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps[] = {
8048 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
8050 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
8051 SNDRV_CHMAP_NA, SNDRV_CHMAP_LFE } }, /* LFE only on right */
8055 /* override the 2.1 chmap */
8056 static void alc_fixup_bass_chmap(struct hda_codec *codec,
8057 const struct hda_fixup *fix, int action)
8059 if (action == HDA_FIXUP_ACT_BUILD) {
8060 struct alc_spec *spec = codec->spec;
8061 spec->gen.pcm_rec[0]->stream[0].chmap = asus_pcm_2_1_chmaps;
8065 /* avoid D3 for keeping GPIO up */
8066 static unsigned int gpio_led_power_filter(struct hda_codec *codec,
8068 unsigned int power_state)
8070 struct alc_spec *spec = codec->spec;
8071 if (nid == codec->core.afg && power_state == AC_PWRST_D3 && spec->gpio_data)
8076 static void alc662_fixup_led_gpio1(struct hda_codec *codec,
8077 const struct hda_fixup *fix, int action)
8079 struct alc_spec *spec = codec->spec;
8081 alc_fixup_hp_gpio_led(codec, action, 0x01, 0);
8082 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8083 spec->mute_led_polarity = 1;
8084 codec->power_filter = gpio_led_power_filter;
8088 static void alc662_usi_automute_hook(struct hda_codec *codec,
8089 struct hda_jack_callback *jack)
8091 struct alc_spec *spec = codec->spec;
8094 snd_hda_gen_hp_automute(codec, jack);
8096 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
8098 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
8102 static void alc662_fixup_usi_headset_mic(struct hda_codec *codec,
8103 const struct hda_fixup *fix, int action)
8105 struct alc_spec *spec = codec->spec;
8106 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
8107 spec->parse_flags |= HDA_PINCFG_HEADSET_MIC;
8108 spec->gen.hp_automute_hook = alc662_usi_automute_hook;
8112 static struct coef_fw alc668_coefs[] = {
8113 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
8114 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
8115 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
8116 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
8117 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
8118 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
8119 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
8120 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
8121 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
8122 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
8123 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
8124 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8125 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8126 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8127 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8128 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8129 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8130 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8131 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8132 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8136 static void alc668_restore_default_value(struct hda_codec *codec)
8138 alc_process_coef_fw(codec, alc668_coefs);
8142 ALC662_FIXUP_ASPIRE,
8143 ALC662_FIXUP_LED_GPIO1,
8144 ALC662_FIXUP_IDEAPAD,
8146 ALC662_FIXUP_CZC_P10T,
8147 ALC662_FIXUP_SKU_IGNORE,
8148 ALC662_FIXUP_HP_RP5800,
8149 ALC662_FIXUP_ASUS_MODE1,
8150 ALC662_FIXUP_ASUS_MODE2,
8151 ALC662_FIXUP_ASUS_MODE3,
8152 ALC662_FIXUP_ASUS_MODE4,
8153 ALC662_FIXUP_ASUS_MODE5,
8154 ALC662_FIXUP_ASUS_MODE6,
8155 ALC662_FIXUP_ASUS_MODE7,
8156 ALC662_FIXUP_ASUS_MODE8,
8157 ALC662_FIXUP_NO_JACK_DETECT,
8158 ALC662_FIXUP_ZOTAC_Z68,
8159 ALC662_FIXUP_INV_DMIC,
8160 ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8161 ALC668_FIXUP_DELL_MIC_NO_PRESENCE,
8162 ALC662_FIXUP_HEADSET_MODE,
8163 ALC668_FIXUP_HEADSET_MODE,
8164 ALC662_FIXUP_BASS_MODE4_CHMAP,
8165 ALC662_FIXUP_BASS_16,
8166 ALC662_FIXUP_BASS_1A,
8167 ALC662_FIXUP_BASS_CHMAP,
8168 ALC668_FIXUP_AUTO_MUTE,
8169 ALC668_FIXUP_DELL_DISABLE_AAMIX,
8170 ALC668_FIXUP_DELL_XPS13,
8171 ALC662_FIXUP_ASUS_Nx50,
8172 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8173 ALC668_FIXUP_ASUS_Nx51,
8174 ALC668_FIXUP_MIC_COEF,
8175 ALC668_FIXUP_ASUS_G751,
8176 ALC891_FIXUP_HEADSET_MODE,
8177 ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8178 ALC662_FIXUP_ACER_VERITON,
8179 ALC892_FIXUP_ASROCK_MOBO,
8180 ALC662_FIXUP_USI_FUNC,
8181 ALC662_FIXUP_USI_HEADSET_MODE,
8182 ALC662_FIXUP_LENOVO_MULTI_CODECS,
8185 static const struct hda_fixup alc662_fixups[] = {
8186 [ALC662_FIXUP_ASPIRE] = {
8187 .type = HDA_FIXUP_PINS,
8188 .v.pins = (const struct hda_pintbl[]) {
8189 { 0x15, 0x99130112 }, /* subwoofer */
8193 [ALC662_FIXUP_LED_GPIO1] = {
8194 .type = HDA_FIXUP_FUNC,
8195 .v.func = alc662_fixup_led_gpio1,
8197 [ALC662_FIXUP_IDEAPAD] = {
8198 .type = HDA_FIXUP_PINS,
8199 .v.pins = (const struct hda_pintbl[]) {
8200 { 0x17, 0x99130112 }, /* subwoofer */
8204 .chain_id = ALC662_FIXUP_LED_GPIO1,
8206 [ALC272_FIXUP_MARIO] = {
8207 .type = HDA_FIXUP_FUNC,
8208 .v.func = alc272_fixup_mario,
8210 [ALC662_FIXUP_CZC_P10T] = {
8211 .type = HDA_FIXUP_VERBS,
8212 .v.verbs = (const struct hda_verb[]) {
8213 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
8217 [ALC662_FIXUP_SKU_IGNORE] = {
8218 .type = HDA_FIXUP_FUNC,
8219 .v.func = alc_fixup_sku_ignore,
8221 [ALC662_FIXUP_HP_RP5800] = {
8222 .type = HDA_FIXUP_PINS,
8223 .v.pins = (const struct hda_pintbl[]) {
8224 { 0x14, 0x0221201f }, /* HP out */
8228 .chain_id = ALC662_FIXUP_SKU_IGNORE
8230 [ALC662_FIXUP_ASUS_MODE1] = {
8231 .type = HDA_FIXUP_PINS,
8232 .v.pins = (const struct hda_pintbl[]) {
8233 { 0x14, 0x99130110 }, /* speaker */
8234 { 0x18, 0x01a19c20 }, /* mic */
8235 { 0x19, 0x99a3092f }, /* int-mic */
8236 { 0x21, 0x0121401f }, /* HP out */
8240 .chain_id = ALC662_FIXUP_SKU_IGNORE
8242 [ALC662_FIXUP_ASUS_MODE2] = {
8243 .type = HDA_FIXUP_PINS,
8244 .v.pins = (const struct hda_pintbl[]) {
8245 { 0x14, 0x99130110 }, /* speaker */
8246 { 0x18, 0x01a19820 }, /* mic */
8247 { 0x19, 0x99a3092f }, /* int-mic */
8248 { 0x1b, 0x0121401f }, /* HP out */
8252 .chain_id = ALC662_FIXUP_SKU_IGNORE
8254 [ALC662_FIXUP_ASUS_MODE3] = {
8255 .type = HDA_FIXUP_PINS,
8256 .v.pins = (const struct hda_pintbl[]) {
8257 { 0x14, 0x99130110 }, /* speaker */
8258 { 0x15, 0x0121441f }, /* HP */
8259 { 0x18, 0x01a19840 }, /* mic */
8260 { 0x19, 0x99a3094f }, /* int-mic */
8261 { 0x21, 0x01211420 }, /* HP2 */
8265 .chain_id = ALC662_FIXUP_SKU_IGNORE
8267 [ALC662_FIXUP_ASUS_MODE4] = {
8268 .type = HDA_FIXUP_PINS,
8269 .v.pins = (const struct hda_pintbl[]) {
8270 { 0x14, 0x99130110 }, /* speaker */
8271 { 0x16, 0x99130111 }, /* speaker */
8272 { 0x18, 0x01a19840 }, /* mic */
8273 { 0x19, 0x99a3094f }, /* int-mic */
8274 { 0x21, 0x0121441f }, /* HP */
8278 .chain_id = ALC662_FIXUP_SKU_IGNORE
8280 [ALC662_FIXUP_ASUS_MODE5] = {
8281 .type = HDA_FIXUP_PINS,
8282 .v.pins = (const struct hda_pintbl[]) {
8283 { 0x14, 0x99130110 }, /* speaker */
8284 { 0x15, 0x0121441f }, /* HP */
8285 { 0x16, 0x99130111 }, /* speaker */
8286 { 0x18, 0x01a19840 }, /* mic */
8287 { 0x19, 0x99a3094f }, /* int-mic */
8291 .chain_id = ALC662_FIXUP_SKU_IGNORE
8293 [ALC662_FIXUP_ASUS_MODE6] = {
8294 .type = HDA_FIXUP_PINS,
8295 .v.pins = (const struct hda_pintbl[]) {
8296 { 0x14, 0x99130110 }, /* speaker */
8297 { 0x15, 0x01211420 }, /* HP2 */
8298 { 0x18, 0x01a19840 }, /* mic */
8299 { 0x19, 0x99a3094f }, /* int-mic */
8300 { 0x1b, 0x0121441f }, /* HP */
8304 .chain_id = ALC662_FIXUP_SKU_IGNORE
8306 [ALC662_FIXUP_ASUS_MODE7] = {
8307 .type = HDA_FIXUP_PINS,
8308 .v.pins = (const struct hda_pintbl[]) {
8309 { 0x14, 0x99130110 }, /* speaker */
8310 { 0x17, 0x99130111 }, /* speaker */
8311 { 0x18, 0x01a19840 }, /* mic */
8312 { 0x19, 0x99a3094f }, /* int-mic */
8313 { 0x1b, 0x01214020 }, /* HP */
8314 { 0x21, 0x0121401f }, /* HP */
8318 .chain_id = ALC662_FIXUP_SKU_IGNORE
8320 [ALC662_FIXUP_ASUS_MODE8] = {
8321 .type = HDA_FIXUP_PINS,
8322 .v.pins = (const struct hda_pintbl[]) {
8323 { 0x14, 0x99130110 }, /* speaker */
8324 { 0x12, 0x99a30970 }, /* int-mic */
8325 { 0x15, 0x01214020 }, /* HP */
8326 { 0x17, 0x99130111 }, /* speaker */
8327 { 0x18, 0x01a19840 }, /* mic */
8328 { 0x21, 0x0121401f }, /* HP */
8332 .chain_id = ALC662_FIXUP_SKU_IGNORE
8334 [ALC662_FIXUP_NO_JACK_DETECT] = {
8335 .type = HDA_FIXUP_FUNC,
8336 .v.func = alc_fixup_no_jack_detect,
8338 [ALC662_FIXUP_ZOTAC_Z68] = {
8339 .type = HDA_FIXUP_PINS,
8340 .v.pins = (const struct hda_pintbl[]) {
8341 { 0x1b, 0x02214020 }, /* Front HP */
8345 [ALC662_FIXUP_INV_DMIC] = {
8346 .type = HDA_FIXUP_FUNC,
8347 .v.func = alc_fixup_inv_dmic,
8349 [ALC668_FIXUP_DELL_XPS13] = {
8350 .type = HDA_FIXUP_FUNC,
8351 .v.func = alc_fixup_dell_xps13,
8353 .chain_id = ALC668_FIXUP_DELL_DISABLE_AAMIX
8355 [ALC668_FIXUP_DELL_DISABLE_AAMIX] = {
8356 .type = HDA_FIXUP_FUNC,
8357 .v.func = alc_fixup_disable_aamix,
8359 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8361 [ALC668_FIXUP_AUTO_MUTE] = {
8362 .type = HDA_FIXUP_FUNC,
8363 .v.func = alc_fixup_auto_mute_via_amp,
8365 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8367 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE] = {
8368 .type = HDA_FIXUP_PINS,
8369 .v.pins = (const struct hda_pintbl[]) {
8370 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8371 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8375 .chain_id = ALC662_FIXUP_HEADSET_MODE
8377 [ALC662_FIXUP_HEADSET_MODE] = {
8378 .type = HDA_FIXUP_FUNC,
8379 .v.func = alc_fixup_headset_mode_alc662,
8381 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
8382 .type = HDA_FIXUP_PINS,
8383 .v.pins = (const struct hda_pintbl[]) {
8384 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8385 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8389 .chain_id = ALC668_FIXUP_HEADSET_MODE
8391 [ALC668_FIXUP_HEADSET_MODE] = {
8392 .type = HDA_FIXUP_FUNC,
8393 .v.func = alc_fixup_headset_mode_alc668,
8395 [ALC662_FIXUP_BASS_MODE4_CHMAP] = {
8396 .type = HDA_FIXUP_FUNC,
8397 .v.func = alc_fixup_bass_chmap,
8399 .chain_id = ALC662_FIXUP_ASUS_MODE4
8401 [ALC662_FIXUP_BASS_16] = {
8402 .type = HDA_FIXUP_PINS,
8403 .v.pins = (const struct hda_pintbl[]) {
8404 {0x16, 0x80106111}, /* bass speaker */
8408 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8410 [ALC662_FIXUP_BASS_1A] = {
8411 .type = HDA_FIXUP_PINS,
8412 .v.pins = (const struct hda_pintbl[]) {
8413 {0x1a, 0x80106111}, /* bass speaker */
8417 .chain_id = ALC662_FIXUP_BASS_CHMAP,
8419 [ALC662_FIXUP_BASS_CHMAP] = {
8420 .type = HDA_FIXUP_FUNC,
8421 .v.func = alc_fixup_bass_chmap,
8423 [ALC662_FIXUP_ASUS_Nx50] = {
8424 .type = HDA_FIXUP_FUNC,
8425 .v.func = alc_fixup_auto_mute_via_amp,
8427 .chain_id = ALC662_FIXUP_BASS_1A
8429 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE] = {
8430 .type = HDA_FIXUP_FUNC,
8431 .v.func = alc_fixup_headset_mode_alc668,
8432 .chain_id = ALC662_FIXUP_BASS_CHMAP
8434 [ALC668_FIXUP_ASUS_Nx51] = {
8435 .type = HDA_FIXUP_PINS,
8436 .v.pins = (const struct hda_pintbl[]) {
8437 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8438 { 0x1a, 0x90170151 }, /* bass speaker */
8439 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8443 .chain_id = ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE,
8445 [ALC668_FIXUP_MIC_COEF] = {
8446 .type = HDA_FIXUP_VERBS,
8447 .v.verbs = (const struct hda_verb[]) {
8448 { 0x20, AC_VERB_SET_COEF_INDEX, 0xc3 },
8449 { 0x20, AC_VERB_SET_PROC_COEF, 0x4000 },
8453 [ALC668_FIXUP_ASUS_G751] = {
8454 .type = HDA_FIXUP_PINS,
8455 .v.pins = (const struct hda_pintbl[]) {
8456 { 0x16, 0x0421101f }, /* HP */
8460 .chain_id = ALC668_FIXUP_MIC_COEF
8462 [ALC891_FIXUP_HEADSET_MODE] = {
8463 .type = HDA_FIXUP_FUNC,
8464 .v.func = alc_fixup_headset_mode,
8466 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE] = {
8467 .type = HDA_FIXUP_PINS,
8468 .v.pins = (const struct hda_pintbl[]) {
8469 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8470 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8474 .chain_id = ALC891_FIXUP_HEADSET_MODE
8476 [ALC662_FIXUP_ACER_VERITON] = {
8477 .type = HDA_FIXUP_PINS,
8478 .v.pins = (const struct hda_pintbl[]) {
8479 { 0x15, 0x50170120 }, /* no internal speaker */
8483 [ALC892_FIXUP_ASROCK_MOBO] = {
8484 .type = HDA_FIXUP_PINS,
8485 .v.pins = (const struct hda_pintbl[]) {
8486 { 0x15, 0x40f000f0 }, /* disabled */
8487 { 0x16, 0x40f000f0 }, /* disabled */
8491 [ALC662_FIXUP_USI_FUNC] = {
8492 .type = HDA_FIXUP_FUNC,
8493 .v.func = alc662_fixup_usi_headset_mic,
8495 [ALC662_FIXUP_USI_HEADSET_MODE] = {
8496 .type = HDA_FIXUP_PINS,
8497 .v.pins = (const struct hda_pintbl[]) {
8498 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8499 { 0x18, 0x01a1903d },
8503 .chain_id = ALC662_FIXUP_USI_FUNC
8505 [ALC662_FIXUP_LENOVO_MULTI_CODECS] = {
8506 .type = HDA_FIXUP_FUNC,
8507 .v.func = alc233_alc662_fixup_lenovo_dual_codecs,
8511 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
8512 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
8513 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC),
8514 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC),
8515 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
8516 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
8517 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC),
8518 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC),
8519 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
8520 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8521 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8522 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13),
8523 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13),
8524 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13),
8525 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8526 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8527 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8528 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8529 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
8530 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
8531 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
8532 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50),
8533 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A),
8534 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50),
8535 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751),
8536 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
8537 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16),
8538 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51),
8539 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51),
8540 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8),
8541 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16),
8542 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP),
8543 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT),
8544 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
8545 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
8546 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE),
8547 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS),
8548 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
8549 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
8550 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO),
8551 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68),
8552 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON),
8553 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
8556 /* Below is a quirk table taken from the old code.
8557 * Basically the device should work as is without the fixup table.
8558 * If BIOS doesn't give a proper info, enable the corresponding
8561 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
8562 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
8563 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
8564 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
8565 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8566 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8567 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8568 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
8569 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
8570 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8571 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
8572 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
8573 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
8574 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
8575 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
8576 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8577 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
8578 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
8579 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8580 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8581 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8582 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8583 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
8584 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
8585 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
8586 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8587 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
8588 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
8589 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8590 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
8591 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8592 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8593 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
8594 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
8595 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
8596 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
8597 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
8598 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
8599 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
8600 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
8601 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
8602 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
8603 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8604 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
8605 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
8606 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
8607 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
8608 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
8609 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
8610 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
8615 static const struct hda_model_fixup alc662_fixup_models[] = {
8616 {.id = ALC662_FIXUP_ASPIRE, .name = "aspire"},
8617 {.id = ALC662_FIXUP_IDEAPAD, .name = "ideapad"},
8618 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
8619 {.id = ALC662_FIXUP_HP_RP5800, .name = "hp-rp5800"},
8620 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
8621 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
8622 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
8623 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
8624 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
8625 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
8626 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
8627 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
8628 {.id = ALC662_FIXUP_ZOTAC_Z68, .name = "zotac-z68"},
8629 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
8630 {.id = ALC662_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc662-headset-multi"},
8631 {.id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
8632 {.id = ALC662_FIXUP_HEADSET_MODE, .name = "alc662-headset"},
8633 {.id = ALC668_FIXUP_HEADSET_MODE, .name = "alc668-headset"},
8634 {.id = ALC662_FIXUP_BASS_16, .name = "bass16"},
8635 {.id = ALC662_FIXUP_BASS_1A, .name = "bass1a"},
8636 {.id = ALC668_FIXUP_AUTO_MUTE, .name = "automute"},
8637 {.id = ALC668_FIXUP_DELL_XPS13, .name = "dell-xps13"},
8638 {.id = ALC662_FIXUP_ASUS_Nx50, .name = "asus-nx50"},
8639 {.id = ALC668_FIXUP_ASUS_Nx51, .name = "asus-nx51"},
8640 {.id = ALC891_FIXUP_HEADSET_MODE, .name = "alc891-headset"},
8641 {.id = ALC891_FIXUP_DELL_MIC_NO_PRESENCE, .name = "alc891-headset-multi"},
8642 {.id = ALC662_FIXUP_ACER_VERITON, .name = "acer-veriton"},
8643 {.id = ALC892_FIXUP_ASROCK_MOBO, .name = "asrock-mobo"},
8644 {.id = ALC662_FIXUP_USI_HEADSET_MODE, .name = "usi-headset"},
8645 {.id = ALC662_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
8649 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
8650 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8654 {0x21, 0x01014020}),
8655 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE,
8659 {0x21, 0x01014020}),
8660 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE,
8664 {0x1b, 0x0221401f}),
8665 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8669 {0x16, 0x03011020}),
8670 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8674 {0x16, 0x03011020}),
8675 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8679 {0x16, 0x03011020}),
8680 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
8683 {0x16, 0x03011020}),
8684 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
8687 {0x15, 0x0321101f}),
8693 static int patch_alc662(struct hda_codec *codec)
8695 struct alc_spec *spec;
8698 err = alc_alloc_spec(codec, 0x0b);
8704 spec->shutup = alc_eapd_shutup;
8706 /* handle multiple HPs as is */
8707 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
8709 alc_fix_pll_init(codec, 0x20, 0x04, 15);
8711 switch (codec->core.vendor_id) {
8713 spec->init_hook = alc668_restore_default_value;
8717 snd_hda_pick_fixup(codec, alc662_fixup_models,
8718 alc662_fixup_tbl, alc662_fixups);
8719 snd_hda_pick_pin_fixup(codec, alc662_pin_fixup_tbl, alc662_fixups);
8720 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
8722 alc_auto_parse_customize_define(codec);
8724 if (has_cdefine_beep(codec))
8725 spec->gen.beep_nid = 0x01;
8727 if ((alc_get_coef0(codec) & (1 << 14)) &&
8728 codec->bus->pci && codec->bus->pci->subsystem_vendor == 0x1025 &&
8729 spec->cdefine.platform_type == 1) {
8730 err = alc_codec_rename(codec, "ALC272X");
8735 /* automatic parse from the BIOS config */
8736 err = alc662_parse_auto_config(codec);
8740 if (!spec->gen.no_analog && spec->gen.beep_nid) {
8741 switch (codec->core.vendor_id) {
8743 err = set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
8749 err = set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
8752 err = set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
8759 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
8772 static int alc680_parse_auto_config(struct hda_codec *codec)
8774 return alc_parse_auto_config(codec, NULL, NULL);
8779 static int patch_alc680(struct hda_codec *codec)
8783 /* ALC680 has no aa-loopback mixer */
8784 err = alc_alloc_spec(codec, 0);
8788 /* automatic parse from the BIOS config */
8789 err = alc680_parse_auto_config(codec);
8801 static const struct hda_device_id snd_hda_id_realtek[] = {
8802 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269),
8803 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
8804 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269),
8805 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
8806 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
8807 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269),
8808 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
8809 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269),
8810 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
8811 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
8812 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269),
8813 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
8814 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
8815 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
8816 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
8817 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
8818 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
8819 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
8820 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269),
8821 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
8822 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
8823 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
8824 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
8825 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
8826 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
8827 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
8828 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
8829 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
8830 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
8831 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
8832 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
8833 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
8834 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269),
8835 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269),
8836 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
8837 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269),
8838 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269),
8839 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
8840 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
8841 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
8842 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
8843 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
8844 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
8845 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
8846 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
8847 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
8848 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
8849 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
8850 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
8851 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
8852 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
8853 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269),
8854 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269),
8855 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269),
8856 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662),
8857 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
8858 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
8859 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
8860 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
8861 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
8862 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
8863 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
8864 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
8865 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
8866 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
8867 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
8868 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
8869 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
8870 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
8871 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
8874 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
8876 MODULE_LICENSE("GPL");
8877 MODULE_DESCRIPTION("Realtek HD-audio codec");
8879 static struct hda_codec_driver realtek_driver = {
8880 .id = snd_hda_id_realtek,
8883 module_hda_codec_driver(realtek_driver);