1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Universal Interface for Intel High Definition Audio Codec
5 * HD audio interface patch for Realtek ALC codecs
7 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
8 * PeiSen Hou <pshou@realtek.com.tw>
9 * Takashi Iwai <tiwai@suse.de>
10 * Jonathan Woithe <jwoithe@just42.net>
13 #include <linux/init.h>
14 #include <linux/delay.h>
15 #include <linux/slab.h>
16 #include <linux/pci.h>
17 #include <linux/dmi.h>
18 #include <linux/module.h>
19 #include <linux/input.h>
20 #include <linux/leds.h>
21 #include <sound/core.h>
22 #include <sound/jack.h>
23 #include <sound/hda_codec.h>
24 #include "hda_local.h"
25 #include "hda_auto_parser.h"
27 #include "hda_generic.h"
29 /* keep halting ALC5505 DSP, for power saving */
30 #define HALT_REALTEK_ALC5505
32 /* extra amp-initialization sequence types */
40 ALC_HEADSET_MODE_UNKNOWN
,
41 ALC_HEADSET_MODE_UNPLUGGED
,
42 ALC_HEADSET_MODE_HEADSET
,
44 ALC_HEADSET_MODE_HEADPHONE
,
48 ALC_HEADSET_TYPE_UNKNOWN
,
49 ALC_HEADSET_TYPE_CTIA
,
50 ALC_HEADSET_TYPE_OMTP
,
54 ALC_KEY_MICMUTE_INDEX
,
57 struct alc_customize_define
{
59 unsigned char port_connectivity
;
60 unsigned char check_sum
;
61 unsigned char customization
;
62 unsigned char external_amp
;
63 unsigned int enable_pcbeep
:1;
64 unsigned int platform_type
:1;
66 unsigned int override
:1;
67 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
78 struct hda_gen_spec gen
; /* must be at head */
80 /* codec parameterization */
81 struct alc_customize_define cdefine
;
82 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
85 unsigned int gpio_mask
;
86 unsigned int gpio_dir
;
87 unsigned int gpio_data
;
88 bool gpio_write_delay
; /* add a delay before writing gpio_data */
90 /* mute LED for HP laptops, see vref_mute_led_set() */
91 int mute_led_polarity
;
92 int micmute_led_polarity
;
93 hda_nid_t mute_led_nid
;
94 hda_nid_t cap_mute_led_nid
;
96 unsigned int gpio_mute_led_mask
;
97 unsigned int gpio_mic_led_mask
;
98 struct alc_coef_led mute_led_coef
;
99 struct alc_coef_led mic_led_coef
;
101 hda_nid_t headset_mic_pin
;
102 hda_nid_t headphone_mic_pin
;
103 int current_headset_mode
;
104 int current_headset_type
;
107 void (*init_hook
)(struct hda_codec
*codec
);
109 void (*power_hook
)(struct hda_codec
*codec
);
111 void (*shutup
)(struct hda_codec
*codec
);
112 void (*reboot_notify
)(struct hda_codec
*codec
);
115 int codec_variant
; /* flag for other variants */
116 unsigned int has_alc5505_dsp
:1;
117 unsigned int no_depop_delay
:1;
118 unsigned int done_hp_init
:1;
119 unsigned int no_shutup_pins
:1;
120 unsigned int ultra_low_power
:1;
121 unsigned int has_hs_key
:1;
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);
291 static void alc_fixup_micmute_led(struct hda_codec
*codec
,
292 const struct hda_fixup
*fix
, int action
)
294 if (action
== HDA_FIXUP_ACT_PROBE
)
295 snd_hda_gen_add_micmute_led_cdev(codec
, NULL
);
299 * Fix hardware PLL issue
300 * On some codecs, the analog PLL gating control must be off while
301 * the default value is 1.
303 static void alc_fix_pll(struct hda_codec
*codec
)
305 struct alc_spec
*spec
= codec
->spec
;
308 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
309 1 << spec
->pll_coef_bit
, 0);
312 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
313 unsigned int coef_idx
, unsigned int coef_bit
)
315 struct alc_spec
*spec
= codec
->spec
;
317 spec
->pll_coef_idx
= coef_idx
;
318 spec
->pll_coef_bit
= coef_bit
;
322 /* update the master volume per volume-knob's unsol event */
323 static void alc_update_knob_master(struct hda_codec
*codec
,
324 struct hda_jack_callback
*jack
)
327 struct snd_kcontrol
*kctl
;
328 struct snd_ctl_elem_value
*uctl
;
330 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
333 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
336 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
337 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
338 val
&= HDA_AMP_VOLMASK
;
339 uctl
->value
.integer
.value
[0] = val
;
340 uctl
->value
.integer
.value
[1] = val
;
341 kctl
->put(kctl
, uctl
);
345 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
347 /* For some reason, the res given from ALC880 is broken.
348 Here we adjust it properly. */
349 snd_hda_jack_unsol_event(codec
, res
>> 2);
352 /* Change EAPD to verb control */
353 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
357 coef
= alc_get_coef0(codec
);
359 switch (codec
->core
.vendor_id
) {
361 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
365 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
368 if ((coef
& 0x00f0) == 0x0010)
369 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
370 if ((coef
& 0x00f0) == 0x0020)
371 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
372 if ((coef
& 0x00f0) == 0x0030)
373 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
379 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
384 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
403 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
406 alc_update_coef_idx(codec
, 0xe, 0, 1<<0);
409 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
418 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
421 if ((coef
& 0x00f0) == 0x0030)
422 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
431 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
435 alc_update_coef_idx(codec
, 0x19, 1<<13, 0);
438 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
441 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
444 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
445 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
448 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
455 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
460 /* additional initialization for ALC888 variants */
461 static void alc888_coef_init(struct hda_codec
*codec
)
463 switch (alc_get_coef0(codec
) & 0x00f0) {
468 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
473 /* turn on/off EAPD control (only if available) */
474 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
476 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
478 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
479 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
483 /* turn on/off EAPD controls of the codec */
484 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
486 /* We currently only handle front, HP */
487 static const hda_nid_t pins
[] = {
488 0x0f, 0x10, 0x14, 0x15, 0x17, 0
491 for (p
= pins
; *p
; p
++)
492 set_eapd(codec
, *p
, on
);
495 static int find_ext_mic_pin(struct hda_codec
*codec
);
497 static void alc_headset_mic_no_shutup(struct hda_codec
*codec
)
499 const struct hda_pincfg
*pin
;
500 int mic_pin
= find_ext_mic_pin(codec
);
503 /* don't shut up pins when unloading the driver; otherwise it breaks
504 * the default pin setup at the next load of the driver
506 if (codec
->bus
->shutdown
)
509 snd_array_for_each(&codec
->init_pins
, i
, pin
) {
510 /* use read here for syncing after issuing each verb */
511 if (pin
->nid
!= mic_pin
)
512 snd_hda_codec_read(codec
, pin
->nid
, 0,
513 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
516 codec
->pins_shutup
= 1;
519 static void alc_shutup_pins(struct hda_codec
*codec
)
521 struct alc_spec
*spec
= codec
->spec
;
523 switch (codec
->core
.vendor_id
) {
528 alc_headset_mic_no_shutup(codec
);
531 if (!spec
->no_shutup_pins
)
532 snd_hda_shutup_pins(codec
);
537 /* generic shutup callback;
538 * just turning off EAPD and a little pause for avoiding pop-noise
540 static void alc_eapd_shutup(struct hda_codec
*codec
)
542 struct alc_spec
*spec
= codec
->spec
;
544 alc_auto_setup_eapd(codec
, false);
545 if (!spec
->no_depop_delay
)
547 alc_shutup_pins(codec
);
550 /* generic EAPD initialization */
551 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
553 alc_auto_setup_eapd(codec
, true);
554 alc_write_gpio(codec
);
556 case ALC_INIT_DEFAULT
:
557 switch (codec
->core
.vendor_id
) {
559 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
565 alc_update_coef_idx(codec
, 7, 0, 0x2030);
568 alc888_coef_init(codec
);
575 /* get a primary headphone pin if available */
576 static hda_nid_t
alc_get_hp_pin(struct alc_spec
*spec
)
578 if (spec
->gen
.autocfg
.hp_pins
[0])
579 return spec
->gen
.autocfg
.hp_pins
[0];
580 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
581 return spec
->gen
.autocfg
.line_out_pins
[0];
586 * Realtek SSID verification
589 /* Could be any non-zero and even value. When used as fixup, tells
590 * the driver to ignore any present sku defines.
592 #define ALC_FIXUP_SKU_IGNORE (2)
594 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
595 const struct hda_fixup
*fix
, int action
)
597 struct alc_spec
*spec
= codec
->spec
;
598 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
599 spec
->cdefine
.fixup
= 1;
600 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
604 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
605 const struct hda_fixup
*fix
, int action
)
607 struct alc_spec
*spec
= codec
->spec
;
609 if (action
== HDA_FIXUP_ACT_PROBE
) {
610 spec
->no_depop_delay
= 1;
611 codec
->depop_delay
= 0;
615 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
617 unsigned int ass
, tmp
, i
;
619 struct alc_spec
*spec
= codec
->spec
;
621 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
623 if (spec
->cdefine
.fixup
) {
624 ass
= spec
->cdefine
.sku_cfg
;
625 if (ass
== ALC_FIXUP_SKU_IGNORE
)
630 if (!codec
->bus
->pci
)
632 ass
= codec
->core
.subsystem_id
& 0xffff;
633 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
637 if (codec
->core
.vendor_id
== 0x10ec0260)
639 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
642 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
643 codec
->core
.chip_name
, ass
);
649 for (i
= 1; i
< 16; i
++) {
653 if (((ass
>> 16) & 0xf) != tmp
)
656 spec
->cdefine
.port_connectivity
= ass
>> 30;
657 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
658 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
659 spec
->cdefine
.customization
= ass
>> 8;
661 spec
->cdefine
.sku_cfg
= ass
;
662 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
663 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
664 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
665 spec
->cdefine
.override
= ass
& 0x1;
667 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
668 nid
, spec
->cdefine
.sku_cfg
);
669 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
670 spec
->cdefine
.port_connectivity
);
671 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
672 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
673 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
674 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
675 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
676 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
677 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
682 /* return the position of NID in the list, or -1 if not found */
683 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
686 for (i
= 0; i
< nums
; i
++)
691 /* return true if the given NID is found in the list */
692 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
694 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
697 /* check subsystem ID and set up device-specific initialization;
698 * return 1 if initialized, 0 if invalid SSID
700 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
701 * 31 ~ 16 : Manufacture ID
703 * 7 ~ 0 : Assembly ID
704 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
706 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
708 unsigned int ass
, tmp
, i
;
710 struct alc_spec
*spec
= codec
->spec
;
712 if (spec
->cdefine
.fixup
) {
713 ass
= spec
->cdefine
.sku_cfg
;
714 if (ass
== ALC_FIXUP_SKU_IGNORE
)
719 ass
= codec
->core
.subsystem_id
& 0xffff;
720 if (codec
->bus
->pci
&&
721 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
724 /* invalid SSID, check the special NID pin defcfg instead */
726 * 31~30 : port connectivity
729 * 19~16 : Check sum (15:1)
734 if (codec
->core
.vendor_id
== 0x10ec0260)
736 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
738 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
742 if ((ass
>> 30) != 1) /* no physical connection */
747 for (i
= 1; i
< 16; i
++) {
751 if (((ass
>> 16) & 0xf) != tmp
)
754 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
755 ass
& 0xffff, codec
->core
.vendor_id
);
759 * 2 : 0 --> Desktop, 1 --> Laptop
760 * 3~5 : External Amplifier control
763 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
764 if (spec
->init_amp
== ALC_INIT_UNDEFINED
) {
767 alc_setup_gpio(codec
, 0x01);
770 alc_setup_gpio(codec
, 0x02);
773 alc_setup_gpio(codec
, 0x03);
777 spec
->init_amp
= ALC_INIT_DEFAULT
;
782 /* is laptop or Desktop and enable the function "Mute internal speaker
783 * when the external headphone out jack is plugged"
788 * 10~8 : Jack location
789 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
791 * 15 : 1 --> enable the function "Mute internal speaker
792 * when the external headphone out jack is plugged"
794 if (!alc_get_hp_pin(spec
)) {
796 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
798 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
799 spec
->gen
.autocfg
.line_outs
))
801 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
806 /* Check the validity of ALC subsystem-id
807 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
808 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
810 if (!alc_subsystem_id(codec
, ports
)) {
811 struct alc_spec
*spec
= codec
->spec
;
812 if (spec
->init_amp
== ALC_INIT_UNDEFINED
) {
814 "realtek: Enable default setup for auto mode as fallback\n");
815 spec
->init_amp
= ALC_INIT_DEFAULT
;
823 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
824 const struct hda_fixup
*fix
, int action
)
826 struct alc_spec
*spec
= codec
->spec
;
828 spec
->gen
.inv_dmic_split
= 1;
832 static int alc_build_controls(struct hda_codec
*codec
)
836 err
= snd_hda_gen_build_controls(codec
);
840 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
849 static void alc_pre_init(struct hda_codec
*codec
)
851 alc_fill_eapd_coef(codec
);
854 #define is_s3_resume(codec) \
855 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESUME)
856 #define is_s4_resume(codec) \
857 ((codec)->core.dev.power.power_state.event == PM_EVENT_RESTORE)
859 static int alc_init(struct hda_codec
*codec
)
861 struct alc_spec
*spec
= codec
->spec
;
863 /* hibernation resume needs the full chip initialization */
864 if (is_s4_resume(codec
))
868 spec
->init_hook(codec
);
870 spec
->gen
.skip_verbs
= 1; /* applied in below */
871 snd_hda_gen_init(codec
);
873 alc_auto_init_amp(codec
, spec
->init_amp
);
874 snd_hda_apply_verbs(codec
); /* apply verbs here after own init */
876 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
881 static inline void alc_shutup(struct hda_codec
*codec
)
883 struct alc_spec
*spec
= codec
->spec
;
885 if (!snd_hda_get_bool_hint(codec
, "shutup"))
886 return; /* disabled explicitly by hints */
888 if (spec
&& spec
->shutup
)
891 alc_shutup_pins(codec
);
894 static void alc_reboot_notify(struct hda_codec
*codec
)
896 struct alc_spec
*spec
= codec
->spec
;
898 if (spec
&& spec
->reboot_notify
)
899 spec
->reboot_notify(codec
);
904 #define alc_free snd_hda_gen_free
907 static void alc_power_eapd(struct hda_codec
*codec
)
909 alc_auto_setup_eapd(codec
, false);
912 static int alc_suspend(struct hda_codec
*codec
)
914 struct alc_spec
*spec
= codec
->spec
;
916 if (spec
&& spec
->power_hook
)
917 spec
->power_hook(codec
);
923 static int alc_resume(struct hda_codec
*codec
)
925 struct alc_spec
*spec
= codec
->spec
;
927 if (!spec
->no_depop_delay
)
928 msleep(150); /* to avoid pop noise */
929 codec
->patch_ops
.init(codec
);
930 snd_hda_regmap_sync(codec
);
931 hda_call_check_power_status(codec
, 0x01);
938 static const struct hda_codec_ops alc_patch_ops
= {
939 .build_controls
= alc_build_controls
,
940 .build_pcms
= snd_hda_gen_build_pcms
,
943 .unsol_event
= snd_hda_jack_unsol_event
,
945 .resume
= alc_resume
,
946 .suspend
= alc_suspend
,
947 .check_power_status
= snd_hda_gen_check_power_status
,
949 .reboot_notify
= alc_reboot_notify
,
953 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
956 * Rename codecs appropriately from COEF value or subvendor id
958 struct alc_codec_rename_table
{
959 unsigned int vendor_id
;
960 unsigned short coef_mask
;
961 unsigned short coef_bits
;
965 struct alc_codec_rename_pci_table
{
966 unsigned int codec_vendor_id
;
967 unsigned short pci_subvendor
;
968 unsigned short pci_subdevice
;
972 static const struct alc_codec_rename_table rename_tbl
[] = {
973 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
974 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
975 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
976 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
977 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
978 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
979 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
980 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
981 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
982 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
983 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
984 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
985 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
986 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
987 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
988 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
989 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
993 static const struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
994 { 0x10ec0280, 0x1028, 0, "ALC3220" },
995 { 0x10ec0282, 0x1028, 0, "ALC3221" },
996 { 0x10ec0283, 0x1028, 0, "ALC3223" },
997 { 0x10ec0288, 0x1028, 0, "ALC3263" },
998 { 0x10ec0292, 0x1028, 0, "ALC3226" },
999 { 0x10ec0293, 0x1028, 0, "ALC3235" },
1000 { 0x10ec0255, 0x1028, 0, "ALC3234" },
1001 { 0x10ec0668, 0x1028, 0, "ALC3661" },
1002 { 0x10ec0275, 0x1028, 0, "ALC3260" },
1003 { 0x10ec0899, 0x1028, 0, "ALC3861" },
1004 { 0x10ec0298, 0x1028, 0, "ALC3266" },
1005 { 0x10ec0236, 0x1028, 0, "ALC3204" },
1006 { 0x10ec0256, 0x1028, 0, "ALC3246" },
1007 { 0x10ec0225, 0x1028, 0, "ALC3253" },
1008 { 0x10ec0295, 0x1028, 0, "ALC3254" },
1009 { 0x10ec0299, 0x1028, 0, "ALC3271" },
1010 { 0x10ec0670, 0x1025, 0, "ALC669X" },
1011 { 0x10ec0676, 0x1025, 0, "ALC679X" },
1012 { 0x10ec0282, 0x1043, 0, "ALC3229" },
1013 { 0x10ec0233, 0x1043, 0, "ALC3236" },
1014 { 0x10ec0280, 0x103c, 0, "ALC3228" },
1015 { 0x10ec0282, 0x103c, 0, "ALC3227" },
1016 { 0x10ec0286, 0x103c, 0, "ALC3242" },
1017 { 0x10ec0290, 0x103c, 0, "ALC3241" },
1018 { 0x10ec0668, 0x103c, 0, "ALC3662" },
1019 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
1020 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
1021 { } /* terminator */
1024 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
1026 const struct alc_codec_rename_table
*p
;
1027 const struct alc_codec_rename_pci_table
*q
;
1029 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
1030 if (p
->vendor_id
!= codec
->core
.vendor_id
)
1032 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
1033 return alc_codec_rename(codec
, p
->name
);
1036 if (!codec
->bus
->pci
)
1038 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
1039 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
1041 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
1043 if (!q
->pci_subdevice
||
1044 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
1045 return alc_codec_rename(codec
, q
->name
);
1053 * Digital-beep handlers
1055 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1057 /* additional beep mixers; private_value will be overwritten */
1058 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
1059 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
1060 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
1063 /* set up and create beep controls */
1064 static int set_beep_amp(struct alc_spec
*spec
, hda_nid_t nid
,
1067 struct snd_kcontrol_new
*knew
;
1068 unsigned int beep_amp
= HDA_COMPOSE_AMP_VAL(nid
, 3, idx
, dir
);
1071 for (i
= 0; i
< ARRAY_SIZE(alc_beep_mixer
); i
++) {
1072 knew
= snd_hda_gen_add_kctl(&spec
->gen
, NULL
,
1073 &alc_beep_mixer
[i
]);
1076 knew
->private_value
= beep_amp
;
1081 static const struct snd_pci_quirk beep_allow_list
[] = {
1082 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1083 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1084 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1085 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1086 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1087 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1088 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1089 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1090 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1091 /* denylist -- no beep available */
1092 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1093 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1097 static inline int has_cdefine_beep(struct hda_codec
*codec
)
1099 struct alc_spec
*spec
= codec
->spec
;
1100 const struct snd_pci_quirk
*q
;
1101 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_allow_list
);
1104 return spec
->cdefine
.enable_pcbeep
;
1107 #define set_beep_amp(spec, nid, idx, dir) 0
1108 #define has_cdefine_beep(codec) 0
1111 /* parse the BIOS configuration and set up the alc_spec */
1112 /* return 1 if successful, 0 if the proper config is not found,
1113 * or a negative error code
1115 static int alc_parse_auto_config(struct hda_codec
*codec
,
1116 const hda_nid_t
*ignore_nids
,
1117 const hda_nid_t
*ssid_nids
)
1119 struct alc_spec
*spec
= codec
->spec
;
1120 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1123 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1129 alc_ssid_check(codec
, ssid_nids
);
1131 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1138 /* common preparation job for alc_spec */
1139 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1141 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1147 snd_hda_gen_spec_init(&spec
->gen
);
1148 spec
->gen
.mixer_nid
= mixer_nid
;
1149 spec
->gen
.own_eapd_ctl
= 1;
1150 codec
->single_adc_amp
= 1;
1151 /* FIXME: do we need this for all Realtek codec models? */
1152 codec
->spdif_status_reset
= 1;
1153 codec
->forced_resume
= 1;
1154 codec
->patch_ops
= alc_patch_ops
;
1156 err
= alc_codec_rename_from_preset(codec
);
1164 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1166 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1167 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1168 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1177 ALC880_FIXUP_MEDION_RIM
,
1179 ALC880_FIXUP_LG_LW25
,
1181 ALC880_FIXUP_EAPD_COEF
,
1182 ALC880_FIXUP_TCL_S700
,
1183 ALC880_FIXUP_VOL_KNOB
,
1184 ALC880_FIXUP_FUJITSU
,
1186 ALC880_FIXUP_UNIWILL
,
1187 ALC880_FIXUP_UNIWILL_DIG
,
1189 ALC880_FIXUP_ASUS_W5A
,
1190 ALC880_FIXUP_3ST_BASE
,
1192 ALC880_FIXUP_3ST_DIG
,
1193 ALC880_FIXUP_5ST_BASE
,
1195 ALC880_FIXUP_5ST_DIG
,
1196 ALC880_FIXUP_6ST_BASE
,
1198 ALC880_FIXUP_6ST_DIG
,
1199 ALC880_FIXUP_6ST_AUTOMUTE
,
1202 /* enable the volume-knob widget support on NID 0x21 */
1203 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1204 const struct hda_fixup
*fix
, int action
)
1206 if (action
== HDA_FIXUP_ACT_PROBE
)
1207 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1208 alc_update_knob_master
);
1211 static const struct hda_fixup alc880_fixups
[] = {
1212 [ALC880_FIXUP_GPIO1
] = {
1213 .type
= HDA_FIXUP_FUNC
,
1214 .v
.func
= alc_fixup_gpio1
,
1216 [ALC880_FIXUP_GPIO2
] = {
1217 .type
= HDA_FIXUP_FUNC
,
1218 .v
.func
= alc_fixup_gpio2
,
1220 [ALC880_FIXUP_MEDION_RIM
] = {
1221 .type
= HDA_FIXUP_VERBS
,
1222 .v
.verbs
= (const struct hda_verb
[]) {
1223 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1224 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1228 .chain_id
= ALC880_FIXUP_GPIO2
,
1230 [ALC880_FIXUP_LG
] = {
1231 .type
= HDA_FIXUP_PINS
,
1232 .v
.pins
= (const struct hda_pintbl
[]) {
1233 /* disable bogus unused pins */
1234 { 0x16, 0x411111f0 },
1235 { 0x18, 0x411111f0 },
1236 { 0x1a, 0x411111f0 },
1240 [ALC880_FIXUP_LG_LW25
] = {
1241 .type
= HDA_FIXUP_PINS
,
1242 .v
.pins
= (const struct hda_pintbl
[]) {
1243 { 0x1a, 0x0181344f }, /* line-in */
1244 { 0x1b, 0x0321403f }, /* headphone */
1248 [ALC880_FIXUP_W810
] = {
1249 .type
= HDA_FIXUP_PINS
,
1250 .v
.pins
= (const struct hda_pintbl
[]) {
1251 /* disable bogus unused pins */
1252 { 0x17, 0x411111f0 },
1256 .chain_id
= ALC880_FIXUP_GPIO2
,
1258 [ALC880_FIXUP_EAPD_COEF
] = {
1259 .type
= HDA_FIXUP_VERBS
,
1260 .v
.verbs
= (const struct hda_verb
[]) {
1261 /* change to EAPD mode */
1262 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1263 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1267 [ALC880_FIXUP_TCL_S700
] = {
1268 .type
= HDA_FIXUP_VERBS
,
1269 .v
.verbs
= (const struct hda_verb
[]) {
1270 /* change to EAPD mode */
1271 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1272 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1276 .chain_id
= ALC880_FIXUP_GPIO2
,
1278 [ALC880_FIXUP_VOL_KNOB
] = {
1279 .type
= HDA_FIXUP_FUNC
,
1280 .v
.func
= alc880_fixup_vol_knob
,
1282 [ALC880_FIXUP_FUJITSU
] = {
1283 /* override all pins as BIOS on old Amilo is broken */
1284 .type
= HDA_FIXUP_PINS
,
1285 .v
.pins
= (const struct hda_pintbl
[]) {
1286 { 0x14, 0x0121401f }, /* HP */
1287 { 0x15, 0x99030120 }, /* speaker */
1288 { 0x16, 0x99030130 }, /* bass speaker */
1289 { 0x17, 0x411111f0 }, /* N/A */
1290 { 0x18, 0x411111f0 }, /* N/A */
1291 { 0x19, 0x01a19950 }, /* mic-in */
1292 { 0x1a, 0x411111f0 }, /* N/A */
1293 { 0x1b, 0x411111f0 }, /* N/A */
1294 { 0x1c, 0x411111f0 }, /* N/A */
1295 { 0x1d, 0x411111f0 }, /* N/A */
1296 { 0x1e, 0x01454140 }, /* SPDIF out */
1300 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1302 [ALC880_FIXUP_F1734
] = {
1303 /* almost compatible with FUJITSU, but no bass and SPDIF */
1304 .type
= HDA_FIXUP_PINS
,
1305 .v
.pins
= (const struct hda_pintbl
[]) {
1306 { 0x14, 0x0121401f }, /* HP */
1307 { 0x15, 0x99030120 }, /* speaker */
1308 { 0x16, 0x411111f0 }, /* N/A */
1309 { 0x17, 0x411111f0 }, /* N/A */
1310 { 0x18, 0x411111f0 }, /* N/A */
1311 { 0x19, 0x01a19950 }, /* mic-in */
1312 { 0x1a, 0x411111f0 }, /* N/A */
1313 { 0x1b, 0x411111f0 }, /* N/A */
1314 { 0x1c, 0x411111f0 }, /* N/A */
1315 { 0x1d, 0x411111f0 }, /* N/A */
1316 { 0x1e, 0x411111f0 }, /* N/A */
1320 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1322 [ALC880_FIXUP_UNIWILL
] = {
1323 /* need to fix HP and speaker pins to be parsed correctly */
1324 .type
= HDA_FIXUP_PINS
,
1325 .v
.pins
= (const struct hda_pintbl
[]) {
1326 { 0x14, 0x0121411f }, /* HP */
1327 { 0x15, 0x99030120 }, /* speaker */
1328 { 0x16, 0x99030130 }, /* bass speaker */
1332 [ALC880_FIXUP_UNIWILL_DIG
] = {
1333 .type
= HDA_FIXUP_PINS
,
1334 .v
.pins
= (const struct hda_pintbl
[]) {
1335 /* disable bogus unused pins */
1336 { 0x17, 0x411111f0 },
1337 { 0x19, 0x411111f0 },
1338 { 0x1b, 0x411111f0 },
1339 { 0x1f, 0x411111f0 },
1343 [ALC880_FIXUP_Z71V
] = {
1344 .type
= HDA_FIXUP_PINS
,
1345 .v
.pins
= (const struct hda_pintbl
[]) {
1346 /* set up the whole pins as BIOS is utterly broken */
1347 { 0x14, 0x99030120 }, /* speaker */
1348 { 0x15, 0x0121411f }, /* HP */
1349 { 0x16, 0x411111f0 }, /* N/A */
1350 { 0x17, 0x411111f0 }, /* N/A */
1351 { 0x18, 0x01a19950 }, /* mic-in */
1352 { 0x19, 0x411111f0 }, /* N/A */
1353 { 0x1a, 0x01813031 }, /* line-in */
1354 { 0x1b, 0x411111f0 }, /* N/A */
1355 { 0x1c, 0x411111f0 }, /* N/A */
1356 { 0x1d, 0x411111f0 }, /* N/A */
1357 { 0x1e, 0x0144111e }, /* SPDIF */
1361 [ALC880_FIXUP_ASUS_W5A
] = {
1362 .type
= HDA_FIXUP_PINS
,
1363 .v
.pins
= (const struct hda_pintbl
[]) {
1364 /* set up the whole pins as BIOS is utterly broken */
1365 { 0x14, 0x0121411f }, /* HP */
1366 { 0x15, 0x411111f0 }, /* N/A */
1367 { 0x16, 0x411111f0 }, /* N/A */
1368 { 0x17, 0x411111f0 }, /* N/A */
1369 { 0x18, 0x90a60160 }, /* mic */
1370 { 0x19, 0x411111f0 }, /* N/A */
1371 { 0x1a, 0x411111f0 }, /* N/A */
1372 { 0x1b, 0x411111f0 }, /* N/A */
1373 { 0x1c, 0x411111f0 }, /* N/A */
1374 { 0x1d, 0x411111f0 }, /* N/A */
1375 { 0x1e, 0xb743111e }, /* SPDIF out */
1379 .chain_id
= ALC880_FIXUP_GPIO1
,
1381 [ALC880_FIXUP_3ST_BASE
] = {
1382 .type
= HDA_FIXUP_PINS
,
1383 .v
.pins
= (const struct hda_pintbl
[]) {
1384 { 0x14, 0x01014010 }, /* line-out */
1385 { 0x15, 0x411111f0 }, /* N/A */
1386 { 0x16, 0x411111f0 }, /* N/A */
1387 { 0x17, 0x411111f0 }, /* N/A */
1388 { 0x18, 0x01a19c30 }, /* mic-in */
1389 { 0x19, 0x0121411f }, /* HP */
1390 { 0x1a, 0x01813031 }, /* line-in */
1391 { 0x1b, 0x02a19c40 }, /* front-mic */
1392 { 0x1c, 0x411111f0 }, /* N/A */
1393 { 0x1d, 0x411111f0 }, /* N/A */
1394 /* 0x1e is filled in below */
1395 { 0x1f, 0x411111f0 }, /* N/A */
1399 [ALC880_FIXUP_3ST
] = {
1400 .type
= HDA_FIXUP_PINS
,
1401 .v
.pins
= (const struct hda_pintbl
[]) {
1402 { 0x1e, 0x411111f0 }, /* N/A */
1406 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1408 [ALC880_FIXUP_3ST_DIG
] = {
1409 .type
= HDA_FIXUP_PINS
,
1410 .v
.pins
= (const struct hda_pintbl
[]) {
1411 { 0x1e, 0x0144111e }, /* SPDIF */
1415 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1417 [ALC880_FIXUP_5ST_BASE
] = {
1418 .type
= HDA_FIXUP_PINS
,
1419 .v
.pins
= (const struct hda_pintbl
[]) {
1420 { 0x14, 0x01014010 }, /* front */
1421 { 0x15, 0x411111f0 }, /* N/A */
1422 { 0x16, 0x01011411 }, /* CLFE */
1423 { 0x17, 0x01016412 }, /* surr */
1424 { 0x18, 0x01a19c30 }, /* mic-in */
1425 { 0x19, 0x0121411f }, /* HP */
1426 { 0x1a, 0x01813031 }, /* line-in */
1427 { 0x1b, 0x02a19c40 }, /* front-mic */
1428 { 0x1c, 0x411111f0 }, /* N/A */
1429 { 0x1d, 0x411111f0 }, /* N/A */
1430 /* 0x1e is filled in below */
1431 { 0x1f, 0x411111f0 }, /* N/A */
1435 [ALC880_FIXUP_5ST
] = {
1436 .type
= HDA_FIXUP_PINS
,
1437 .v
.pins
= (const struct hda_pintbl
[]) {
1438 { 0x1e, 0x411111f0 }, /* N/A */
1442 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1444 [ALC880_FIXUP_5ST_DIG
] = {
1445 .type
= HDA_FIXUP_PINS
,
1446 .v
.pins
= (const struct hda_pintbl
[]) {
1447 { 0x1e, 0x0144111e }, /* SPDIF */
1451 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1453 [ALC880_FIXUP_6ST_BASE
] = {
1454 .type
= HDA_FIXUP_PINS
,
1455 .v
.pins
= (const struct hda_pintbl
[]) {
1456 { 0x14, 0x01014010 }, /* front */
1457 { 0x15, 0x01016412 }, /* surr */
1458 { 0x16, 0x01011411 }, /* CLFE */
1459 { 0x17, 0x01012414 }, /* side */
1460 { 0x18, 0x01a19c30 }, /* mic-in */
1461 { 0x19, 0x02a19c40 }, /* front-mic */
1462 { 0x1a, 0x01813031 }, /* line-in */
1463 { 0x1b, 0x0121411f }, /* HP */
1464 { 0x1c, 0x411111f0 }, /* N/A */
1465 { 0x1d, 0x411111f0 }, /* N/A */
1466 /* 0x1e is filled in below */
1467 { 0x1f, 0x411111f0 }, /* N/A */
1471 [ALC880_FIXUP_6ST
] = {
1472 .type
= HDA_FIXUP_PINS
,
1473 .v
.pins
= (const struct hda_pintbl
[]) {
1474 { 0x1e, 0x411111f0 }, /* N/A */
1478 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1480 [ALC880_FIXUP_6ST_DIG
] = {
1481 .type
= HDA_FIXUP_PINS
,
1482 .v
.pins
= (const struct hda_pintbl
[]) {
1483 { 0x1e, 0x0144111e }, /* SPDIF */
1487 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1489 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1490 .type
= HDA_FIXUP_PINS
,
1491 .v
.pins
= (const struct hda_pintbl
[]) {
1492 { 0x1b, 0x0121401f }, /* HP with jack detect */
1495 .chained_before
= true,
1496 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1500 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1501 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1502 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1503 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1504 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1505 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1506 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1507 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1508 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1509 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1510 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1511 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1512 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1513 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1514 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1515 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1516 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1517 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1518 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1519 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1520 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1521 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1522 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1523 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1525 /* Below is the copied entries from alc880_quirks.c.
1526 * It's not quite sure whether BIOS sets the correct pin-config table
1527 * on these machines, thus they are kept to be compatible with
1528 * the old static quirks. Once when it's confirmed to work without
1529 * these overrides, it'd be better to remove.
1531 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1532 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1533 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1534 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1535 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1536 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1537 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1538 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1539 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1540 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1541 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1542 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1543 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1544 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1545 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1546 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1547 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1548 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1549 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1550 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1551 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1552 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1553 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1554 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1555 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1556 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1557 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1558 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1559 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1560 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1561 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1562 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1563 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1565 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1566 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1567 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1571 static const struct hda_model_fixup alc880_fixup_models
[] = {
1572 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1573 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1574 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1575 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1576 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1577 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1578 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1584 * OK, here we have finally the patch for ALC880
1586 static int patch_alc880(struct hda_codec
*codec
)
1588 struct alc_spec
*spec
;
1591 err
= alc_alloc_spec(codec
, 0x0b);
1596 spec
->gen
.need_dac_fix
= 1;
1597 spec
->gen
.beep_nid
= 0x01;
1599 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1601 alc_pre_init(codec
);
1603 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1605 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1607 /* automatic parse from the BIOS config */
1608 err
= alc880_parse_auto_config(codec
);
1612 if (!spec
->gen
.no_analog
) {
1613 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1618 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1631 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1633 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1634 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1635 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1642 ALC260_FIXUP_HP_DC5750
,
1643 ALC260_FIXUP_HP_PIN_0F
,
1646 ALC260_FIXUP_GPIO1_TOGGLE
,
1647 ALC260_FIXUP_REPLACER
,
1648 ALC260_FIXUP_HP_B1900
,
1650 ALC260_FIXUP_FSC_S7020
,
1651 ALC260_FIXUP_FSC_S7020_JWSE
,
1652 ALC260_FIXUP_VAIO_PINS
,
1655 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1657 struct alc_spec
*spec
= codec
->spec
;
1659 alc_update_gpio_data(codec
, 0x01, spec
->gen
.hp_jack_present
);
1662 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1663 const struct hda_fixup
*fix
, int action
)
1665 struct alc_spec
*spec
= codec
->spec
;
1666 if (action
== HDA_FIXUP_ACT_PROBE
) {
1667 /* although the machine has only one output pin, we need to
1668 * toggle GPIO1 according to the jack state
1670 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1671 spec
->gen
.detect_hp
= 1;
1672 spec
->gen
.automute_speaker
= 1;
1673 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1674 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1675 snd_hda_gen_hp_automute
);
1676 alc_setup_gpio(codec
, 0x01);
1680 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1681 const struct hda_fixup
*fix
, int action
)
1683 struct alc_spec
*spec
= codec
->spec
;
1684 static const struct hda_pintbl pincfgs
[] = {
1685 { 0x0f, 0x02214000 }, /* HP/speaker */
1686 { 0x12, 0x90a60160 }, /* int mic */
1687 { 0x13, 0x02a19000 }, /* ext mic */
1688 { 0x18, 0x01446000 }, /* SPDIF out */
1689 /* disable bogus I/O pins */
1690 { 0x10, 0x411111f0 },
1691 { 0x11, 0x411111f0 },
1692 { 0x14, 0x411111f0 },
1693 { 0x15, 0x411111f0 },
1694 { 0x16, 0x411111f0 },
1695 { 0x17, 0x411111f0 },
1696 { 0x19, 0x411111f0 },
1701 case HDA_FIXUP_ACT_PRE_PROBE
:
1702 snd_hda_apply_pincfgs(codec
, pincfgs
);
1703 spec
->init_amp
= ALC_INIT_NONE
;
1708 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1709 const struct hda_fixup
*fix
, int action
)
1711 struct alc_spec
*spec
= codec
->spec
;
1712 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
1713 spec
->init_amp
= ALC_INIT_NONE
;
1716 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1717 const struct hda_fixup
*fix
, int action
)
1719 struct alc_spec
*spec
= codec
->spec
;
1720 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1721 spec
->gen
.add_jack_modes
= 1;
1722 spec
->gen
.hp_mic
= 1;
1726 static const struct hda_fixup alc260_fixups
[] = {
1727 [ALC260_FIXUP_HP_DC5750
] = {
1728 .type
= HDA_FIXUP_PINS
,
1729 .v
.pins
= (const struct hda_pintbl
[]) {
1730 { 0x11, 0x90130110 }, /* speaker */
1734 [ALC260_FIXUP_HP_PIN_0F
] = {
1735 .type
= HDA_FIXUP_PINS
,
1736 .v
.pins
= (const struct hda_pintbl
[]) {
1737 { 0x0f, 0x01214000 }, /* HP */
1741 [ALC260_FIXUP_COEF
] = {
1742 .type
= HDA_FIXUP_VERBS
,
1743 .v
.verbs
= (const struct hda_verb
[]) {
1744 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1745 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1749 [ALC260_FIXUP_GPIO1
] = {
1750 .type
= HDA_FIXUP_FUNC
,
1751 .v
.func
= alc_fixup_gpio1
,
1753 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1754 .type
= HDA_FIXUP_FUNC
,
1755 .v
.func
= alc260_fixup_gpio1_toggle
,
1757 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1759 [ALC260_FIXUP_REPLACER
] = {
1760 .type
= HDA_FIXUP_VERBS
,
1761 .v
.verbs
= (const struct hda_verb
[]) {
1762 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1763 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1767 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1769 [ALC260_FIXUP_HP_B1900
] = {
1770 .type
= HDA_FIXUP_FUNC
,
1771 .v
.func
= alc260_fixup_gpio1_toggle
,
1773 .chain_id
= ALC260_FIXUP_COEF
,
1775 [ALC260_FIXUP_KN1
] = {
1776 .type
= HDA_FIXUP_FUNC
,
1777 .v
.func
= alc260_fixup_kn1
,
1779 [ALC260_FIXUP_FSC_S7020
] = {
1780 .type
= HDA_FIXUP_FUNC
,
1781 .v
.func
= alc260_fixup_fsc_s7020
,
1783 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1784 .type
= HDA_FIXUP_FUNC
,
1785 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1787 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1789 [ALC260_FIXUP_VAIO_PINS
] = {
1790 .type
= HDA_FIXUP_PINS
,
1791 .v
.pins
= (const struct hda_pintbl
[]) {
1792 /* Pin configs are missing completely on some VAIOs */
1793 { 0x0f, 0x01211020 },
1794 { 0x10, 0x0001003f },
1795 { 0x11, 0x411111f0 },
1796 { 0x12, 0x01a15930 },
1797 { 0x13, 0x411111f0 },
1798 { 0x14, 0x411111f0 },
1799 { 0x15, 0x411111f0 },
1800 { 0x16, 0x411111f0 },
1801 { 0x17, 0x411111f0 },
1802 { 0x18, 0x411111f0 },
1803 { 0x19, 0x411111f0 },
1809 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1810 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1811 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1812 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1813 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1814 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1815 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1816 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1817 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1818 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1819 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1820 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1821 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1825 static const struct hda_model_fixup alc260_fixup_models
[] = {
1826 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1827 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1828 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1829 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1835 static int patch_alc260(struct hda_codec
*codec
)
1837 struct alc_spec
*spec
;
1840 err
= alc_alloc_spec(codec
, 0x07);
1845 /* as quite a few machines require HP amp for speaker outputs,
1846 * it's easier to enable it unconditionally; even if it's unneeded,
1847 * it's almost harmless.
1849 spec
->gen
.prefer_hp_amp
= 1;
1850 spec
->gen
.beep_nid
= 0x01;
1852 spec
->shutup
= alc_eapd_shutup
;
1854 alc_pre_init(codec
);
1856 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1858 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1860 /* automatic parse from the BIOS config */
1861 err
= alc260_parse_auto_config(codec
);
1865 if (!spec
->gen
.no_analog
) {
1866 err
= set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1871 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1882 * ALC882/883/885/888/889 support
1884 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1885 * configuration. Each pin widget can choose any input DACs and a mixer.
1886 * Each ADC is connected from a mixer of all inputs. This makes possible
1887 * 6-channel independent captures.
1889 * In addition, an independent DAC for the multi-playback (not used in this
1897 ALC882_FIXUP_ABIT_AW9D_MAX
,
1898 ALC882_FIXUP_LENOVO_Y530
,
1899 ALC882_FIXUP_PB_M5210
,
1900 ALC882_FIXUP_ACER_ASPIRE_7736
,
1901 ALC882_FIXUP_ASUS_W90V
,
1903 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1904 ALC889_FIXUP_VAIO_TT
,
1905 ALC888_FIXUP_EEE1601
,
1908 ALC883_FIXUP_ACER_EAPD
,
1913 ALC882_FIXUP_ASUS_W2JC
,
1914 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1915 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1916 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1917 ALC885_FIXUP_MACPRO_GPIO
,
1918 ALC889_FIXUP_DAC_ROUTE
,
1919 ALC889_FIXUP_MBP_VREF
,
1920 ALC889_FIXUP_IMAC91_VREF
,
1921 ALC889_FIXUP_MBA11_VREF
,
1922 ALC889_FIXUP_MBA21_VREF
,
1923 ALC889_FIXUP_MP11_VREF
,
1924 ALC889_FIXUP_MP41_VREF
,
1925 ALC882_FIXUP_INV_DMIC
,
1926 ALC882_FIXUP_NO_PRIMARY_HP
,
1927 ALC887_FIXUP_ASUS_BASS
,
1928 ALC887_FIXUP_BASS_CHMAP
,
1929 ALC1220_FIXUP_GB_DUAL_CODECS
,
1930 ALC1220_FIXUP_CLEVO_P950
,
1931 ALC1220_FIXUP_CLEVO_PB51ED
,
1932 ALC1220_FIXUP_CLEVO_PB51ED_PINS
,
1933 ALC887_FIXUP_ASUS_AUDIO
,
1934 ALC887_FIXUP_ASUS_HMIC
,
1937 static void alc889_fixup_coef(struct hda_codec
*codec
,
1938 const struct hda_fixup
*fix
, int action
)
1940 if (action
!= HDA_FIXUP_ACT_INIT
)
1942 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1945 /* set up GPIO at initialization */
1946 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1947 const struct hda_fixup
*fix
, int action
)
1949 struct alc_spec
*spec
= codec
->spec
;
1951 spec
->gpio_write_delay
= true;
1952 alc_fixup_gpio3(codec
, fix
, action
);
1955 /* Fix the connection of some pins for ALC889:
1956 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1957 * work correctly (bko#42740)
1959 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1960 const struct hda_fixup
*fix
, int action
)
1962 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1963 /* fake the connections during parsing the tree */
1964 static const hda_nid_t conn1
[] = { 0x0c, 0x0d };
1965 static const hda_nid_t conn2
[] = { 0x0e, 0x0f };
1966 snd_hda_override_conn_list(codec
, 0x14, ARRAY_SIZE(conn1
), conn1
);
1967 snd_hda_override_conn_list(codec
, 0x15, ARRAY_SIZE(conn1
), conn1
);
1968 snd_hda_override_conn_list(codec
, 0x18, ARRAY_SIZE(conn2
), conn2
);
1969 snd_hda_override_conn_list(codec
, 0x1a, ARRAY_SIZE(conn2
), conn2
);
1970 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1971 /* restore the connections */
1972 static const hda_nid_t conn
[] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1973 snd_hda_override_conn_list(codec
, 0x14, ARRAY_SIZE(conn
), conn
);
1974 snd_hda_override_conn_list(codec
, 0x15, ARRAY_SIZE(conn
), conn
);
1975 snd_hda_override_conn_list(codec
, 0x18, ARRAY_SIZE(conn
), conn
);
1976 snd_hda_override_conn_list(codec
, 0x1a, ARRAY_SIZE(conn
), conn
);
1980 /* Set VREF on HP pin */
1981 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1982 const struct hda_fixup
*fix
, int action
)
1984 static const hda_nid_t nids
[] = { 0x14, 0x15, 0x19 };
1985 struct alc_spec
*spec
= codec
->spec
;
1988 if (action
!= HDA_FIXUP_ACT_INIT
)
1990 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1991 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1992 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1994 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1995 val
|= AC_PINCTL_VREF_80
;
1996 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1997 spec
->gen
.keep_vref_in_automute
= 1;
2002 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
2003 const hda_nid_t
*nids
, int num_nids
)
2005 struct alc_spec
*spec
= codec
->spec
;
2008 for (i
= 0; i
< num_nids
; i
++) {
2010 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
2011 val
|= AC_PINCTL_VREF_50
;
2012 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
2014 spec
->gen
.keep_vref_in_automute
= 1;
2017 /* Set VREF on speaker pins on imac91 */
2018 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
2019 const struct hda_fixup
*fix
, int action
)
2021 static const hda_nid_t nids
[] = { 0x18, 0x1a };
2023 if (action
== HDA_FIXUP_ACT_INIT
)
2024 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2027 /* Set VREF on speaker pins on mba11 */
2028 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
2029 const struct hda_fixup
*fix
, int action
)
2031 static const hda_nid_t nids
[] = { 0x18 };
2033 if (action
== HDA_FIXUP_ACT_INIT
)
2034 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2037 /* Set VREF on speaker pins on mba21 */
2038 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
2039 const struct hda_fixup
*fix
, int action
)
2041 static const hda_nid_t nids
[] = { 0x18, 0x19 };
2043 if (action
== HDA_FIXUP_ACT_INIT
)
2044 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2047 /* Don't take HP output as primary
2048 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2049 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2051 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
2052 const struct hda_fixup
*fix
, int action
)
2054 struct alc_spec
*spec
= codec
->spec
;
2055 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
2056 spec
->gen
.no_primary_hp
= 1;
2057 spec
->gen
.no_multi_io
= 1;
2061 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
2062 const struct hda_fixup
*fix
, int action
);
2064 /* For dual-codec configuration, we need to disable some features to avoid
2065 * conflicts of kctls and PCM streams
2067 static void alc_fixup_dual_codecs(struct hda_codec
*codec
,
2068 const struct hda_fixup
*fix
, int action
)
2070 struct alc_spec
*spec
= codec
->spec
;
2072 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2074 /* disable vmaster */
2075 spec
->gen
.suppress_vmaster
= 1;
2076 /* auto-mute and auto-mic switch don't work with multiple codecs */
2077 spec
->gen
.suppress_auto_mute
= 1;
2078 spec
->gen
.suppress_auto_mic
= 1;
2079 /* disable aamix as well */
2080 spec
->gen
.mixer_nid
= 0;
2081 /* add location prefix to avoid conflicts */
2082 codec
->force_pin_prefix
= 1;
2085 static void rename_ctl(struct hda_codec
*codec
, const char *oldname
,
2086 const char *newname
)
2088 struct snd_kcontrol
*kctl
;
2090 kctl
= snd_hda_find_mixer_ctl(codec
, oldname
);
2092 strcpy(kctl
->id
.name
, newname
);
2095 static void alc1220_fixup_gb_dual_codecs(struct hda_codec
*codec
,
2096 const struct hda_fixup
*fix
,
2099 alc_fixup_dual_codecs(codec
, fix
, action
);
2101 case HDA_FIXUP_ACT_PRE_PROBE
:
2102 /* override card longname to provide a unique UCM profile */
2103 strcpy(codec
->card
->longname
, "HDAudio-Gigabyte-ALC1220DualCodecs");
2105 case HDA_FIXUP_ACT_BUILD
:
2106 /* rename Capture controls depending on the codec */
2107 rename_ctl(codec
, "Capture Volume",
2109 "Rear-Panel Capture Volume" :
2110 "Front-Panel Capture Volume");
2111 rename_ctl(codec
, "Capture Switch",
2113 "Rear-Panel Capture Switch" :
2114 "Front-Panel Capture Switch");
2119 static void alc1220_fixup_clevo_p950(struct hda_codec
*codec
,
2120 const struct hda_fixup
*fix
,
2123 static const hda_nid_t conn1
[] = { 0x0c };
2125 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2128 alc_update_coef_idx(codec
, 0x7, 0, 0x3c3);
2129 /* We therefore want to make sure 0x14 (front headphone) and
2130 * 0x1b (speakers) use the stereo DAC 0x02
2132 snd_hda_override_conn_list(codec
, 0x14, ARRAY_SIZE(conn1
), conn1
);
2133 snd_hda_override_conn_list(codec
, 0x1b, ARRAY_SIZE(conn1
), conn1
);
2136 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
2137 const struct hda_fixup
*fix
, int action
);
2139 static void alc1220_fixup_clevo_pb51ed(struct hda_codec
*codec
,
2140 const struct hda_fixup
*fix
,
2143 alc1220_fixup_clevo_p950(codec
, fix
, action
);
2144 alc_fixup_headset_mode_no_hp_mic(codec
, fix
, action
);
2147 static void alc887_asus_hp_automute_hook(struct hda_codec
*codec
,
2148 struct hda_jack_callback
*jack
)
2150 struct alc_spec
*spec
= codec
->spec
;
2153 snd_hda_gen_hp_automute(codec
, jack
);
2155 if (spec
->gen
.hp_jack_present
)
2156 vref
= AC_PINCTL_VREF_80
;
2158 vref
= AC_PINCTL_VREF_HIZ
;
2159 snd_hda_set_pin_ctl(codec
, 0x19, PIN_HP
| vref
);
2162 static void alc887_fixup_asus_jack(struct hda_codec
*codec
,
2163 const struct hda_fixup
*fix
, int action
)
2165 struct alc_spec
*spec
= codec
->spec
;
2166 if (action
!= HDA_FIXUP_ACT_PROBE
)
2168 snd_hda_set_pin_ctl_cache(codec
, 0x1b, PIN_HP
);
2169 spec
->gen
.hp_automute_hook
= alc887_asus_hp_automute_hook
;
2172 static const struct hda_fixup alc882_fixups
[] = {
2173 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2174 .type
= HDA_FIXUP_PINS
,
2175 .v
.pins
= (const struct hda_pintbl
[]) {
2176 { 0x15, 0x01080104 }, /* side */
2177 { 0x16, 0x01011012 }, /* rear */
2178 { 0x17, 0x01016011 }, /* clfe */
2182 [ALC882_FIXUP_LENOVO_Y530
] = {
2183 .type
= HDA_FIXUP_PINS
,
2184 .v
.pins
= (const struct hda_pintbl
[]) {
2185 { 0x15, 0x99130112 }, /* rear int speakers */
2186 { 0x16, 0x99130111 }, /* subwoofer */
2190 [ALC882_FIXUP_PB_M5210
] = {
2191 .type
= HDA_FIXUP_PINCTLS
,
2192 .v
.pins
= (const struct hda_pintbl
[]) {
2193 { 0x19, PIN_VREF50
},
2197 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2198 .type
= HDA_FIXUP_FUNC
,
2199 .v
.func
= alc_fixup_sku_ignore
,
2201 [ALC882_FIXUP_ASUS_W90V
] = {
2202 .type
= HDA_FIXUP_PINS
,
2203 .v
.pins
= (const struct hda_pintbl
[]) {
2204 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2208 [ALC889_FIXUP_CD
] = {
2209 .type
= HDA_FIXUP_PINS
,
2210 .v
.pins
= (const struct hda_pintbl
[]) {
2211 { 0x1c, 0x993301f0 }, /* CD */
2215 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2216 .type
= HDA_FIXUP_PINS
,
2217 .v
.pins
= (const struct hda_pintbl
[]) {
2218 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2222 .chain_id
= ALC889_FIXUP_CD
,
2224 [ALC889_FIXUP_VAIO_TT
] = {
2225 .type
= HDA_FIXUP_PINS
,
2226 .v
.pins
= (const struct hda_pintbl
[]) {
2227 { 0x17, 0x90170111 }, /* hidden surround speaker */
2231 [ALC888_FIXUP_EEE1601
] = {
2232 .type
= HDA_FIXUP_VERBS
,
2233 .v
.verbs
= (const struct hda_verb
[]) {
2234 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2235 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2239 [ALC882_FIXUP_EAPD
] = {
2240 .type
= HDA_FIXUP_VERBS
,
2241 .v
.verbs
= (const struct hda_verb
[]) {
2242 /* change to EAPD mode */
2243 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2244 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2248 [ALC883_FIXUP_EAPD
] = {
2249 .type
= HDA_FIXUP_VERBS
,
2250 .v
.verbs
= (const struct hda_verb
[]) {
2251 /* change to EAPD mode */
2252 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2253 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2257 [ALC883_FIXUP_ACER_EAPD
] = {
2258 .type
= HDA_FIXUP_VERBS
,
2259 .v
.verbs
= (const struct hda_verb
[]) {
2260 /* eanable EAPD on Acer laptops */
2261 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2262 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2266 [ALC882_FIXUP_GPIO1
] = {
2267 .type
= HDA_FIXUP_FUNC
,
2268 .v
.func
= alc_fixup_gpio1
,
2270 [ALC882_FIXUP_GPIO2
] = {
2271 .type
= HDA_FIXUP_FUNC
,
2272 .v
.func
= alc_fixup_gpio2
,
2274 [ALC882_FIXUP_GPIO3
] = {
2275 .type
= HDA_FIXUP_FUNC
,
2276 .v
.func
= alc_fixup_gpio3
,
2278 [ALC882_FIXUP_ASUS_W2JC
] = {
2279 .type
= HDA_FIXUP_FUNC
,
2280 .v
.func
= alc_fixup_gpio1
,
2282 .chain_id
= ALC882_FIXUP_EAPD
,
2284 [ALC889_FIXUP_COEF
] = {
2285 .type
= HDA_FIXUP_FUNC
,
2286 .v
.func
= alc889_fixup_coef
,
2288 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2289 .type
= HDA_FIXUP_PINS
,
2290 .v
.pins
= (const struct hda_pintbl
[]) {
2291 { 0x16, 0x99130111 }, /* CLFE speaker */
2292 { 0x17, 0x99130112 }, /* surround speaker */
2296 .chain_id
= ALC882_FIXUP_GPIO1
,
2298 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2299 .type
= HDA_FIXUP_PINS
,
2300 .v
.pins
= (const struct hda_pintbl
[]) {
2301 { 0x16, 0x99130111 }, /* CLFE speaker */
2302 { 0x1b, 0x99130112 }, /* surround speaker */
2306 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2308 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2309 /* additional init verbs for Acer Aspire 8930G */
2310 .type
= HDA_FIXUP_VERBS
,
2311 .v
.verbs
= (const struct hda_verb
[]) {
2312 /* Enable all DACs */
2313 /* DAC DISABLE/MUTE 1? */
2314 /* setting bits 1-5 disables DAC nids 0x02-0x06
2315 * apparently. Init=0x38 */
2316 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2317 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2318 /* DAC DISABLE/MUTE 2? */
2319 /* some bit here disables the other DACs.
2321 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2322 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2324 * This laptop has a stereo digital microphone.
2325 * The mics are only 1cm apart which makes the stereo
2326 * useless. However, either the mic or the ALC889
2327 * makes the signal become a difference/sum signal
2328 * instead of standard stereo, which is annoying.
2329 * So instead we flip this bit which makes the
2330 * codec replicate the sum signal to both channels,
2331 * turning it into a normal mono mic.
2333 /* DMIC_CONTROL? Init value = 0x0001 */
2334 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2335 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2336 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2337 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2341 .chain_id
= ALC882_FIXUP_GPIO1
,
2343 [ALC885_FIXUP_MACPRO_GPIO
] = {
2344 .type
= HDA_FIXUP_FUNC
,
2345 .v
.func
= alc885_fixup_macpro_gpio
,
2347 [ALC889_FIXUP_DAC_ROUTE
] = {
2348 .type
= HDA_FIXUP_FUNC
,
2349 .v
.func
= alc889_fixup_dac_route
,
2351 [ALC889_FIXUP_MBP_VREF
] = {
2352 .type
= HDA_FIXUP_FUNC
,
2353 .v
.func
= alc889_fixup_mbp_vref
,
2355 .chain_id
= ALC882_FIXUP_GPIO1
,
2357 [ALC889_FIXUP_IMAC91_VREF
] = {
2358 .type
= HDA_FIXUP_FUNC
,
2359 .v
.func
= alc889_fixup_imac91_vref
,
2361 .chain_id
= ALC882_FIXUP_GPIO1
,
2363 [ALC889_FIXUP_MBA11_VREF
] = {
2364 .type
= HDA_FIXUP_FUNC
,
2365 .v
.func
= alc889_fixup_mba11_vref
,
2367 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2369 [ALC889_FIXUP_MBA21_VREF
] = {
2370 .type
= HDA_FIXUP_FUNC
,
2371 .v
.func
= alc889_fixup_mba21_vref
,
2373 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2375 [ALC889_FIXUP_MP11_VREF
] = {
2376 .type
= HDA_FIXUP_FUNC
,
2377 .v
.func
= alc889_fixup_mba11_vref
,
2379 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2381 [ALC889_FIXUP_MP41_VREF
] = {
2382 .type
= HDA_FIXUP_FUNC
,
2383 .v
.func
= alc889_fixup_mbp_vref
,
2385 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2387 [ALC882_FIXUP_INV_DMIC
] = {
2388 .type
= HDA_FIXUP_FUNC
,
2389 .v
.func
= alc_fixup_inv_dmic
,
2391 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2392 .type
= HDA_FIXUP_FUNC
,
2393 .v
.func
= alc882_fixup_no_primary_hp
,
2395 [ALC887_FIXUP_ASUS_BASS
] = {
2396 .type
= HDA_FIXUP_PINS
,
2397 .v
.pins
= (const struct hda_pintbl
[]) {
2398 {0x16, 0x99130130}, /* bass speaker */
2402 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2404 [ALC887_FIXUP_BASS_CHMAP
] = {
2405 .type
= HDA_FIXUP_FUNC
,
2406 .v
.func
= alc_fixup_bass_chmap
,
2408 [ALC1220_FIXUP_GB_DUAL_CODECS
] = {
2409 .type
= HDA_FIXUP_FUNC
,
2410 .v
.func
= alc1220_fixup_gb_dual_codecs
,
2412 [ALC1220_FIXUP_CLEVO_P950
] = {
2413 .type
= HDA_FIXUP_FUNC
,
2414 .v
.func
= alc1220_fixup_clevo_p950
,
2416 [ALC1220_FIXUP_CLEVO_PB51ED
] = {
2417 .type
= HDA_FIXUP_FUNC
,
2418 .v
.func
= alc1220_fixup_clevo_pb51ed
,
2420 [ALC1220_FIXUP_CLEVO_PB51ED_PINS
] = {
2421 .type
= HDA_FIXUP_PINS
,
2422 .v
.pins
= (const struct hda_pintbl
[]) {
2423 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2427 .chain_id
= ALC1220_FIXUP_CLEVO_PB51ED
,
2429 [ALC887_FIXUP_ASUS_AUDIO
] = {
2430 .type
= HDA_FIXUP_PINS
,
2431 .v
.pins
= (const struct hda_pintbl
[]) {
2432 { 0x15, 0x02a14150 }, /* use as headset mic, without its own jack detect */
2433 { 0x19, 0x22219420 },
2437 [ALC887_FIXUP_ASUS_HMIC
] = {
2438 .type
= HDA_FIXUP_FUNC
,
2439 .v
.func
= alc887_fixup_asus_jack
,
2441 .chain_id
= ALC887_FIXUP_ASUS_AUDIO
,
2445 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2446 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2447 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2448 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2449 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2450 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2451 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2452 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2453 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2454 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2455 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2456 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2457 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2458 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2459 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2460 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2461 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2462 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2463 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2464 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2465 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2466 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2467 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2468 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2469 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2470 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2471 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2472 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2473 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2474 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2475 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2476 SND_PCI_QUIRK(0x1043, 0x2390, "Asus D700SA", ALC887_FIXUP_ASUS_HMIC
),
2477 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2478 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2479 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2480 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2481 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2482 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP
),
2483 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2484 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2486 /* All Apple entries are in codec SSIDs */
2487 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2488 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2489 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2490 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2491 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2492 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2493 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2494 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2495 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2496 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2497 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2498 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2499 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2500 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2501 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2502 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2503 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2504 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2505 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2506 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2507 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2508 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2510 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2511 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2512 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2513 SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950
),
2514 SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950
),
2515 SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950
),
2516 SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950
),
2517 SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950
),
2518 SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950
),
2519 SND_PCI_QUIRK(0x1462, 0x1293, "MSI-GP65", ALC1220_FIXUP_CLEVO_P950
),
2520 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2521 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2522 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2523 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2524 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950
),
2525 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950
),
2526 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950
),
2527 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950
),
2528 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950
),
2529 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2530 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2531 SND_PCI_QUIRK(0x1558, 0x50d3, "Clevo PC50[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2532 SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2533 SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2534 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2535 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2536 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2537 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2541 static const struct hda_model_fixup alc882_fixup_models
[] = {
2542 {.id
= ALC882_FIXUP_ABIT_AW9D_MAX
, .name
= "abit-aw9d"},
2543 {.id
= ALC882_FIXUP_LENOVO_Y530
, .name
= "lenovo-y530"},
2544 {.id
= ALC882_FIXUP_ACER_ASPIRE_7736
, .name
= "acer-aspire-7736"},
2545 {.id
= ALC882_FIXUP_ASUS_W90V
, .name
= "asus-w90v"},
2546 {.id
= ALC889_FIXUP_CD
, .name
= "cd"},
2547 {.id
= ALC889_FIXUP_FRONT_HP_NO_PRESENCE
, .name
= "no-front-hp"},
2548 {.id
= ALC889_FIXUP_VAIO_TT
, .name
= "vaio-tt"},
2549 {.id
= ALC888_FIXUP_EEE1601
, .name
= "eee1601"},
2550 {.id
= ALC882_FIXUP_EAPD
, .name
= "alc882-eapd"},
2551 {.id
= ALC883_FIXUP_EAPD
, .name
= "alc883-eapd"},
2552 {.id
= ALC882_FIXUP_GPIO1
, .name
= "gpio1"},
2553 {.id
= ALC882_FIXUP_GPIO2
, .name
= "gpio2"},
2554 {.id
= ALC882_FIXUP_GPIO3
, .name
= "gpio3"},
2555 {.id
= ALC889_FIXUP_COEF
, .name
= "alc889-coef"},
2556 {.id
= ALC882_FIXUP_ASUS_W2JC
, .name
= "asus-w2jc"},
2557 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2558 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2559 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2560 {.id
= ALC885_FIXUP_MACPRO_GPIO
, .name
= "macpro-gpio"},
2561 {.id
= ALC889_FIXUP_DAC_ROUTE
, .name
= "dac-route"},
2562 {.id
= ALC889_FIXUP_MBP_VREF
, .name
= "mbp-vref"},
2563 {.id
= ALC889_FIXUP_IMAC91_VREF
, .name
= "imac91-vref"},
2564 {.id
= ALC889_FIXUP_MBA11_VREF
, .name
= "mba11-vref"},
2565 {.id
= ALC889_FIXUP_MBA21_VREF
, .name
= "mba21-vref"},
2566 {.id
= ALC889_FIXUP_MP11_VREF
, .name
= "mp11-vref"},
2567 {.id
= ALC889_FIXUP_MP41_VREF
, .name
= "mp41-vref"},
2568 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2569 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2570 {.id
= ALC887_FIXUP_ASUS_BASS
, .name
= "asus-bass"},
2571 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2572 {.id
= ALC1220_FIXUP_CLEVO_P950
, .name
= "clevo-p950"},
2577 * BIOS auto configuration
2579 /* almost identical with ALC880 parser... */
2580 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2582 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2583 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2584 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2589 static int patch_alc882(struct hda_codec
*codec
)
2591 struct alc_spec
*spec
;
2594 err
= alc_alloc_spec(codec
, 0x0b);
2600 switch (codec
->core
.vendor_id
) {
2608 /* ALC883 and variants */
2609 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2613 alc_pre_init(codec
);
2615 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2617 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2619 alc_auto_parse_customize_define(codec
);
2621 if (has_cdefine_beep(codec
))
2622 spec
->gen
.beep_nid
= 0x01;
2624 /* automatic parse from the BIOS config */
2625 err
= alc882_parse_auto_config(codec
);
2629 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
2630 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2635 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2648 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2650 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2651 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2652 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2659 ALC262_FIXUP_FSC_H270
,
2660 ALC262_FIXUP_FSC_S7110
,
2661 ALC262_FIXUP_HP_Z200
,
2663 ALC262_FIXUP_LENOVO_3000
,
2665 ALC262_FIXUP_BENQ_T31
,
2666 ALC262_FIXUP_INV_DMIC
,
2667 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2670 static const struct hda_fixup alc262_fixups
[] = {
2671 [ALC262_FIXUP_FSC_H270
] = {
2672 .type
= HDA_FIXUP_PINS
,
2673 .v
.pins
= (const struct hda_pintbl
[]) {
2674 { 0x14, 0x99130110 }, /* speaker */
2675 { 0x15, 0x0221142f }, /* front HP */
2676 { 0x1b, 0x0121141f }, /* rear HP */
2680 [ALC262_FIXUP_FSC_S7110
] = {
2681 .type
= HDA_FIXUP_PINS
,
2682 .v
.pins
= (const struct hda_pintbl
[]) {
2683 { 0x15, 0x90170110 }, /* speaker */
2687 .chain_id
= ALC262_FIXUP_BENQ
,
2689 [ALC262_FIXUP_HP_Z200
] = {
2690 .type
= HDA_FIXUP_PINS
,
2691 .v
.pins
= (const struct hda_pintbl
[]) {
2692 { 0x16, 0x99130120 }, /* internal speaker */
2696 [ALC262_FIXUP_TYAN
] = {
2697 .type
= HDA_FIXUP_PINS
,
2698 .v
.pins
= (const struct hda_pintbl
[]) {
2699 { 0x14, 0x1993e1f0 }, /* int AUX */
2703 [ALC262_FIXUP_LENOVO_3000
] = {
2704 .type
= HDA_FIXUP_PINCTLS
,
2705 .v
.pins
= (const struct hda_pintbl
[]) {
2706 { 0x19, PIN_VREF50
},
2710 .chain_id
= ALC262_FIXUP_BENQ
,
2712 [ALC262_FIXUP_BENQ
] = {
2713 .type
= HDA_FIXUP_VERBS
,
2714 .v
.verbs
= (const struct hda_verb
[]) {
2715 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2716 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2720 [ALC262_FIXUP_BENQ_T31
] = {
2721 .type
= HDA_FIXUP_VERBS
,
2722 .v
.verbs
= (const struct hda_verb
[]) {
2723 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2724 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2728 [ALC262_FIXUP_INV_DMIC
] = {
2729 .type
= HDA_FIXUP_FUNC
,
2730 .v
.func
= alc_fixup_inv_dmic
,
2732 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2733 .type
= HDA_FIXUP_FUNC
,
2734 .v
.func
= alc_fixup_no_depop_delay
,
2738 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2739 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2740 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2741 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2742 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2743 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2744 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2745 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2746 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2747 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2748 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2752 static const struct hda_model_fixup alc262_fixup_models
[] = {
2753 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2754 {.id
= ALC262_FIXUP_FSC_H270
, .name
= "fsc-h270"},
2755 {.id
= ALC262_FIXUP_FSC_S7110
, .name
= "fsc-s7110"},
2756 {.id
= ALC262_FIXUP_HP_Z200
, .name
= "hp-z200"},
2757 {.id
= ALC262_FIXUP_TYAN
, .name
= "tyan"},
2758 {.id
= ALC262_FIXUP_LENOVO_3000
, .name
= "lenovo-3000"},
2759 {.id
= ALC262_FIXUP_BENQ
, .name
= "benq"},
2760 {.id
= ALC262_FIXUP_BENQ_T31
, .name
= "benq-t31"},
2761 {.id
= ALC262_FIXUP_INTEL_BAYLEYBAY
, .name
= "bayleybay"},
2767 static int patch_alc262(struct hda_codec
*codec
)
2769 struct alc_spec
*spec
;
2772 err
= alc_alloc_spec(codec
, 0x0b);
2777 spec
->gen
.shared_mic_vref_pin
= 0x18;
2779 spec
->shutup
= alc_eapd_shutup
;
2782 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2785 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2787 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2789 alc_pre_init(codec
);
2791 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2793 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2795 alc_auto_parse_customize_define(codec
);
2797 if (has_cdefine_beep(codec
))
2798 spec
->gen
.beep_nid
= 0x01;
2800 /* automatic parse from the BIOS config */
2801 err
= alc262_parse_auto_config(codec
);
2805 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
2806 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2811 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2823 /* bind Beep switches of both NID 0x0f and 0x10 */
2824 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2825 struct snd_ctl_elem_value
*ucontrol
)
2827 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2831 mutex_lock(&codec
->control_mutex
);
2832 pval
= kcontrol
->private_value
;
2833 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2834 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2836 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2837 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2839 kcontrol
->private_value
= pval
;
2840 mutex_unlock(&codec
->control_mutex
);
2844 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2845 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2847 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2848 .name
= "Beep Playback Switch",
2849 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2850 .info
= snd_hda_mixer_amp_switch_info
,
2851 .get
= snd_hda_mixer_amp_switch_get
,
2852 .put
= alc268_beep_switch_put
,
2853 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2857 /* set PCBEEP vol = 0, mute connections */
2858 static const struct hda_verb alc268_beep_init_verbs
[] = {
2859 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2860 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2861 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2866 ALC268_FIXUP_INV_DMIC
,
2867 ALC268_FIXUP_HP_EAPD
,
2871 static const struct hda_fixup alc268_fixups
[] = {
2872 [ALC268_FIXUP_INV_DMIC
] = {
2873 .type
= HDA_FIXUP_FUNC
,
2874 .v
.func
= alc_fixup_inv_dmic
,
2876 [ALC268_FIXUP_HP_EAPD
] = {
2877 .type
= HDA_FIXUP_VERBS
,
2878 .v
.verbs
= (const struct hda_verb
[]) {
2879 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2883 [ALC268_FIXUP_SPDIF
] = {
2884 .type
= HDA_FIXUP_PINS
,
2885 .v
.pins
= (const struct hda_pintbl
[]) {
2886 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2892 static const struct hda_model_fixup alc268_fixup_models
[] = {
2893 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2894 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2895 {.id
= ALC268_FIXUP_SPDIF
, .name
= "spdif"},
2899 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2900 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2901 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2902 /* below is codec SSID since multiple Toshiba laptops have the
2903 * same PCI SSID 1179:ff00
2905 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2910 * BIOS auto configuration
2912 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2914 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2915 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2920 static int patch_alc268(struct hda_codec
*codec
)
2922 struct alc_spec
*spec
;
2925 /* ALC268 has no aa-loopback mixer */
2926 err
= alc_alloc_spec(codec
, 0);
2931 if (has_cdefine_beep(codec
))
2932 spec
->gen
.beep_nid
= 0x01;
2934 spec
->shutup
= alc_eapd_shutup
;
2936 alc_pre_init(codec
);
2938 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2939 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2941 /* automatic parse from the BIOS config */
2942 err
= alc268_parse_auto_config(codec
);
2946 if (err
> 0 && !spec
->gen
.no_analog
&&
2947 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2948 for (i
= 0; i
< ARRAY_SIZE(alc268_beep_mixer
); i
++) {
2949 if (!snd_hda_gen_add_kctl(&spec
->gen
, NULL
,
2950 &alc268_beep_mixer
[i
])) {
2955 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2956 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2957 /* override the amp caps for beep generator */
2958 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2959 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2960 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2961 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2962 (0 << AC_AMPCAP_MUTE_SHIFT
));
2965 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2978 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2979 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2982 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2983 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2986 /* different alc269-variants */
2988 ALC269_TYPE_ALC269VA
,
2989 ALC269_TYPE_ALC269VB
,
2990 ALC269_TYPE_ALC269VC
,
2991 ALC269_TYPE_ALC269VD
,
3011 * BIOS auto configuration
3013 static int alc269_parse_auto_config(struct hda_codec
*codec
)
3015 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
3016 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
3017 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
3018 struct alc_spec
*spec
= codec
->spec
;
3019 const hda_nid_t
*ssids
;
3021 switch (spec
->codec_variant
) {
3022 case ALC269_TYPE_ALC269VA
:
3023 case ALC269_TYPE_ALC269VC
:
3024 case ALC269_TYPE_ALC280
:
3025 case ALC269_TYPE_ALC284
:
3026 case ALC269_TYPE_ALC293
:
3027 ssids
= alc269va_ssids
;
3029 case ALC269_TYPE_ALC269VB
:
3030 case ALC269_TYPE_ALC269VD
:
3031 case ALC269_TYPE_ALC282
:
3032 case ALC269_TYPE_ALC283
:
3033 case ALC269_TYPE_ALC286
:
3034 case ALC269_TYPE_ALC298
:
3035 case ALC269_TYPE_ALC255
:
3036 case ALC269_TYPE_ALC256
:
3037 case ALC269_TYPE_ALC257
:
3038 case ALC269_TYPE_ALC215
:
3039 case ALC269_TYPE_ALC225
:
3040 case ALC269_TYPE_ALC294
:
3041 case ALC269_TYPE_ALC300
:
3042 case ALC269_TYPE_ALC623
:
3043 case ALC269_TYPE_ALC700
:
3044 ssids
= alc269_ssids
;
3047 ssids
= alc269_ssids
;
3051 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
3054 static const struct hda_jack_keymap alc_headset_btn_keymap
[] = {
3055 { SND_JACK_BTN_0
, KEY_PLAYPAUSE
},
3056 { SND_JACK_BTN_1
, KEY_VOICECOMMAND
},
3057 { SND_JACK_BTN_2
, KEY_VOLUMEUP
},
3058 { SND_JACK_BTN_3
, KEY_VOLUMEDOWN
},
3062 static void alc_headset_btn_callback(struct hda_codec
*codec
,
3063 struct hda_jack_callback
*jack
)
3067 if (jack
->unsol_res
& (7 << 13))
3068 report
|= SND_JACK_BTN_0
;
3070 if (jack
->unsol_res
& (1 << 16 | 3 << 8))
3071 report
|= SND_JACK_BTN_1
;
3074 if (jack
->unsol_res
& (7 << 23))
3075 report
|= SND_JACK_BTN_2
;
3077 /* Volume down key */
3078 if (jack
->unsol_res
& (7 << 10))
3079 report
|= SND_JACK_BTN_3
;
3081 jack
->jack
->button_state
= report
;
3084 static void alc_disable_headset_jack_key(struct hda_codec
*codec
)
3086 struct alc_spec
*spec
= codec
->spec
;
3088 if (!spec
->has_hs_key
)
3091 switch (codec
->core
.vendor_id
) {
3098 alc_write_coef_idx(codec
, 0x48, 0x0);
3099 alc_update_coef_idx(codec
, 0x49, 0x0045, 0x0);
3100 alc_update_coef_idx(codec
, 0x44, 0x0045 << 8, 0x0);
3104 alc_write_coef_idx(codec
, 0x48, 0x0);
3105 alc_update_coef_idx(codec
, 0x49, 0x0045, 0x0);
3110 static void alc_enable_headset_jack_key(struct hda_codec
*codec
)
3112 struct alc_spec
*spec
= codec
->spec
;
3114 if (!spec
->has_hs_key
)
3117 switch (codec
->core
.vendor_id
) {
3124 alc_write_coef_idx(codec
, 0x48, 0xd011);
3125 alc_update_coef_idx(codec
, 0x49, 0x007f, 0x0045);
3126 alc_update_coef_idx(codec
, 0x44, 0x007f << 8, 0x0045 << 8);
3130 alc_write_coef_idx(codec
, 0x48, 0xd011);
3131 alc_update_coef_idx(codec
, 0x49, 0x007f, 0x0045);
3136 static void alc_fixup_headset_jack(struct hda_codec
*codec
,
3137 const struct hda_fixup
*fix
, int action
)
3139 struct alc_spec
*spec
= codec
->spec
;
3142 case HDA_FIXUP_ACT_PRE_PROBE
:
3143 spec
->has_hs_key
= 1;
3144 snd_hda_jack_detect_enable_callback(codec
, 0x55,
3145 alc_headset_btn_callback
);
3146 snd_hda_jack_add_kctl(codec
, 0x55, "Headset Jack", false,
3147 SND_JACK_HEADSET
, alc_headset_btn_keymap
);
3149 case HDA_FIXUP_ACT_INIT
:
3150 alc_enable_headset_jack_key(codec
);
3155 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
3157 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
3160 static void alc269_shutup(struct hda_codec
*codec
)
3162 struct alc_spec
*spec
= codec
->spec
;
3164 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3165 alc269vb_toggle_power_output(codec
, 0);
3166 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3167 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3170 alc_shutup_pins(codec
);
3173 static const struct coef_fw alc282_coefs
[] = {
3174 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3175 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3176 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3177 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3178 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3179 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3180 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3181 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
3182 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3183 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3184 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
3185 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
3186 WRITE_COEF(0x34, 0xa0c0), /* ANC */
3187 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
3188 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3189 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3190 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3191 WRITE_COEF(0x63, 0x2902), /* PLL */
3192 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
3193 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
3194 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
3195 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
3196 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
3197 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
3198 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
3199 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
3200 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
3201 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
3202 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
3206 static void alc282_restore_default_value(struct hda_codec
*codec
)
3208 alc_process_coef_fw(codec
, alc282_coefs
);
3211 static void alc282_init(struct hda_codec
*codec
)
3213 struct alc_spec
*spec
= codec
->spec
;
3214 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3218 alc282_restore_default_value(codec
);
3222 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3223 coef78
= alc_read_coef_idx(codec
, 0x78);
3225 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3226 /* Headphone capless set to high power mode */
3227 alc_write_coef_idx(codec
, 0x78, 0x9004);
3232 snd_hda_codec_write(codec
, hp_pin
, 0,
3233 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3238 snd_hda_codec_write(codec
, hp_pin
, 0,
3239 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3244 /* Headphone capless set to normal mode */
3245 alc_write_coef_idx(codec
, 0x78, coef78
);
3248 static void alc282_shutup(struct hda_codec
*codec
)
3250 struct alc_spec
*spec
= codec
->spec
;
3251 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3256 alc269_shutup(codec
);
3260 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3261 coef78
= alc_read_coef_idx(codec
, 0x78);
3262 alc_write_coef_idx(codec
, 0x78, 0x9004);
3267 snd_hda_codec_write(codec
, hp_pin
, 0,
3268 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3273 if (!spec
->no_shutup_pins
)
3274 snd_hda_codec_write(codec
, hp_pin
, 0,
3275 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3280 alc_auto_setup_eapd(codec
, false);
3281 alc_shutup_pins(codec
);
3282 alc_write_coef_idx(codec
, 0x78, coef78
);
3285 static const struct coef_fw alc283_coefs
[] = {
3286 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3287 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3288 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3289 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3290 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3291 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3292 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3293 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3294 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3295 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3296 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3297 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3298 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3299 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3300 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3301 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3302 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3303 WRITE_COEF(0x2e, 0x2902), /* PLL */
3304 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3305 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3306 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3307 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3308 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3309 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3310 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3311 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3312 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3313 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3314 WRITE_COEF(0x49, 0x0), /* test mode */
3315 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3316 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3317 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3318 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3322 static void alc283_restore_default_value(struct hda_codec
*codec
)
3324 alc_process_coef_fw(codec
, alc283_coefs
);
3327 static void alc283_init(struct hda_codec
*codec
)
3329 struct alc_spec
*spec
= codec
->spec
;
3330 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3333 alc283_restore_default_value(codec
);
3339 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3341 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3342 /* Headphone capless set to high power mode */
3343 alc_write_coef_idx(codec
, 0x43, 0x9004);
3345 snd_hda_codec_write(codec
, hp_pin
, 0,
3346 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3351 snd_hda_codec_write(codec
, hp_pin
, 0,
3352 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3356 /* Index 0x46 Combo jack auto switch control 2 */
3357 /* 3k pull low control for Headset jack. */
3358 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3359 /* Headphone capless set to normal mode */
3360 alc_write_coef_idx(codec
, 0x43, 0x9614);
3363 static void alc283_shutup(struct hda_codec
*codec
)
3365 struct alc_spec
*spec
= codec
->spec
;
3366 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3370 alc269_shutup(codec
);
3374 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3376 alc_write_coef_idx(codec
, 0x43, 0x9004);
3378 /*depop hp during suspend*/
3379 alc_write_coef_idx(codec
, 0x06, 0x2100);
3381 snd_hda_codec_write(codec
, hp_pin
, 0,
3382 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3387 if (!spec
->no_shutup_pins
)
3388 snd_hda_codec_write(codec
, hp_pin
, 0,
3389 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3391 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3395 alc_auto_setup_eapd(codec
, false);
3396 alc_shutup_pins(codec
);
3397 alc_write_coef_idx(codec
, 0x43, 0x9614);
3400 static void alc256_init(struct hda_codec
*codec
)
3402 struct alc_spec
*spec
= codec
->spec
;
3403 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3411 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3416 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3417 if (spec
->ultra_low_power
) {
3418 alc_update_coef_idx(codec
, 0x03, 1<<1, 1<<1);
3419 alc_update_coef_idx(codec
, 0x08, 3<<2, 3<<2);
3420 alc_update_coef_idx(codec
, 0x08, 7<<4, 0);
3421 alc_update_coef_idx(codec
, 0x3b, 1<<15, 0);
3422 alc_update_coef_idx(codec
, 0x0e, 7<<6, 7<<6);
3426 snd_hda_codec_write(codec
, hp_pin
, 0,
3427 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3429 if (hp_pin_sense
|| spec
->ultra_low_power
)
3432 snd_hda_codec_write(codec
, hp_pin
, 0,
3433 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3435 if (hp_pin_sense
|| spec
->ultra_low_power
)
3438 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3439 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3440 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3441 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 0 << 15);
3443 * Expose headphone mic (or possibly Line In on some machines) instead
3444 * of PC Beep on 1Ah, and disable 1Ah loopback for all outputs. See
3445 * Documentation/sound/hd-audio/realtek-pc-beep.rst for details of
3448 alc_write_coef_idx(codec
, 0x36, 0x5757);
3451 static void alc256_shutup(struct hda_codec
*codec
)
3453 struct alc_spec
*spec
= codec
->spec
;
3454 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3460 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3465 snd_hda_codec_write(codec
, hp_pin
, 0,
3466 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3468 if (hp_pin_sense
|| spec
->ultra_low_power
)
3471 /* 3k pull low control for Headset jack. */
3472 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3473 /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly
3474 * when booting with headset plugged. So skip setting it for the codec alc257
3476 if (codec
->core
.vendor_id
!= 0x10ec0257)
3477 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3479 if (!spec
->no_shutup_pins
)
3480 snd_hda_codec_write(codec
, hp_pin
, 0,
3481 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3483 if (hp_pin_sense
|| spec
->ultra_low_power
)
3486 alc_auto_setup_eapd(codec
, false);
3487 alc_shutup_pins(codec
);
3488 if (spec
->ultra_low_power
) {
3490 alc_update_coef_idx(codec
, 0x03, 1<<1, 0);
3491 alc_update_coef_idx(codec
, 0x08, 7<<4, 7<<4);
3492 alc_update_coef_idx(codec
, 0x08, 3<<2, 0);
3493 alc_update_coef_idx(codec
, 0x3b, 1<<15, 1<<15);
3494 alc_update_coef_idx(codec
, 0x0e, 7<<6, 0);
3499 static void alc225_init(struct hda_codec
*codec
)
3501 struct alc_spec
*spec
= codec
->spec
;
3502 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3503 bool hp1_pin_sense
, hp2_pin_sense
;
3509 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3510 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3512 if (hp1_pin_sense
|| hp2_pin_sense
)
3515 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3516 if (spec
->ultra_low_power
) {
3517 alc_update_coef_idx(codec
, 0x08, 0x0f << 2, 3<<2);
3518 alc_update_coef_idx(codec
, 0x0e, 7<<6, 7<<6);
3519 alc_update_coef_idx(codec
, 0x33, 1<<11, 0);
3523 if (hp1_pin_sense
|| spec
->ultra_low_power
)
3524 snd_hda_codec_write(codec
, hp_pin
, 0,
3525 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3527 snd_hda_codec_write(codec
, 0x16, 0,
3528 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3530 if (hp1_pin_sense
|| hp2_pin_sense
|| spec
->ultra_low_power
)
3533 if (hp1_pin_sense
|| spec
->ultra_low_power
)
3534 snd_hda_codec_write(codec
, hp_pin
, 0,
3535 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3537 snd_hda_codec_write(codec
, 0x16, 0,
3538 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3540 if (hp1_pin_sense
|| hp2_pin_sense
|| spec
->ultra_low_power
)
3543 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3544 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3547 static void alc225_shutup(struct hda_codec
*codec
)
3549 struct alc_spec
*spec
= codec
->spec
;
3550 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3551 bool hp1_pin_sense
, hp2_pin_sense
;
3556 alc_disable_headset_jack_key(codec
);
3557 /* 3k pull low control for Headset jack. */
3558 alc_update_coef_idx(codec
, 0x4a, 0, 3 << 10);
3560 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3561 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3563 if (hp1_pin_sense
|| hp2_pin_sense
)
3566 if (hp1_pin_sense
|| spec
->ultra_low_power
)
3567 snd_hda_codec_write(codec
, hp_pin
, 0,
3568 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3570 snd_hda_codec_write(codec
, 0x16, 0,
3571 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3573 if (hp1_pin_sense
|| hp2_pin_sense
|| spec
->ultra_low_power
)
3576 if (hp1_pin_sense
|| spec
->ultra_low_power
)
3577 snd_hda_codec_write(codec
, hp_pin
, 0,
3578 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3580 snd_hda_codec_write(codec
, 0x16, 0,
3581 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3583 if (hp1_pin_sense
|| hp2_pin_sense
|| spec
->ultra_low_power
)
3586 alc_auto_setup_eapd(codec
, false);
3587 alc_shutup_pins(codec
);
3588 if (spec
->ultra_low_power
) {
3590 alc_update_coef_idx(codec
, 0x08, 0x0f << 2, 0x0c << 2);
3591 alc_update_coef_idx(codec
, 0x0e, 7<<6, 0);
3592 alc_update_coef_idx(codec
, 0x33, 1<<11, 1<<11);
3593 alc_update_coef_idx(codec
, 0x4a, 3<<4, 2<<4);
3597 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3598 alc_enable_headset_jack_key(codec
);
3601 static void alc_default_init(struct hda_codec
*codec
)
3603 struct alc_spec
*spec
= codec
->spec
;
3604 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3612 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3617 snd_hda_codec_write(codec
, hp_pin
, 0,
3618 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3623 snd_hda_codec_write(codec
, hp_pin
, 0,
3624 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3630 static void alc_default_shutup(struct hda_codec
*codec
)
3632 struct alc_spec
*spec
= codec
->spec
;
3633 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3637 alc269_shutup(codec
);
3641 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3646 snd_hda_codec_write(codec
, hp_pin
, 0,
3647 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3652 if (!spec
->no_shutup_pins
)
3653 snd_hda_codec_write(codec
, hp_pin
, 0,
3654 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3659 alc_auto_setup_eapd(codec
, false);
3660 alc_shutup_pins(codec
);
3663 static void alc294_hp_init(struct hda_codec
*codec
)
3665 struct alc_spec
*spec
= codec
->spec
;
3666 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3672 snd_hda_codec_write(codec
, hp_pin
, 0,
3673 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3677 if (!spec
->no_shutup_pins
)
3678 snd_hda_codec_write(codec
, hp_pin
, 0,
3679 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3681 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3682 alc_update_coefex_idx(codec
, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3684 /* Wait for depop procedure finish */
3685 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3686 for (i
= 0; i
< 20 && val
& 0x0080; i
++) {
3688 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3690 /* Set HP depop to auto mode */
3691 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0x000b);
3695 static void alc294_init(struct hda_codec
*codec
)
3697 struct alc_spec
*spec
= codec
->spec
;
3699 /* required only at boot or S4 resume time */
3700 if (!spec
->done_hp_init
||
3701 codec
->core
.dev
.power
.power_state
.event
== PM_EVENT_RESTORE
) {
3702 alc294_hp_init(codec
);
3703 spec
->done_hp_init
= true;
3705 alc_default_init(codec
);
3708 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3711 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3712 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3713 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3716 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3720 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3721 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3723 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3728 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3732 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3733 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3734 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3735 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3736 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3737 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3738 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3739 val
= alc5505_coef_get(codec
, 0x6220);
3740 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3743 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3745 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3746 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3747 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3748 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3749 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3750 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3753 static void alc5505_dsp_init(struct hda_codec
*codec
)
3757 alc5505_dsp_halt(codec
);
3758 alc5505_dsp_back_from_halt(codec
);
3759 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3760 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3761 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3762 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3763 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3764 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3765 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3766 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3767 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3768 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3769 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3770 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3771 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3773 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3775 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3777 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3779 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3780 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3781 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3782 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3783 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3784 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3785 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3787 #ifdef HALT_REALTEK_ALC5505
3788 alc5505_dsp_halt(codec
);
3792 #ifdef HALT_REALTEK_ALC5505
3793 #define alc5505_dsp_suspend(codec) do { } while (0) /* NOP */
3794 #define alc5505_dsp_resume(codec) do { } while (0) /* NOP */
3796 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3797 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3801 static int alc269_suspend(struct hda_codec
*codec
)
3803 struct alc_spec
*spec
= codec
->spec
;
3805 if (spec
->has_alc5505_dsp
)
3806 alc5505_dsp_suspend(codec
);
3807 return alc_suspend(codec
);
3810 static int alc269_resume(struct hda_codec
*codec
)
3812 struct alc_spec
*spec
= codec
->spec
;
3814 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3815 alc269vb_toggle_power_output(codec
, 0);
3816 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3817 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3821 codec
->patch_ops
.init(codec
);
3823 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3824 alc269vb_toggle_power_output(codec
, 1);
3825 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3826 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3830 snd_hda_regmap_sync(codec
);
3831 hda_call_check_power_status(codec
, 0x01);
3833 /* on some machine, the BIOS will clear the codec gpio data when enter
3834 * suspend, and won't restore the data after resume, so we restore it
3837 if (spec
->gpio_data
)
3838 alc_write_gpio_data(codec
);
3840 if (spec
->has_alc5505_dsp
)
3841 alc5505_dsp_resume(codec
);
3845 #endif /* CONFIG_PM */
3847 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3848 const struct hda_fixup
*fix
, int action
)
3850 struct alc_spec
*spec
= codec
->spec
;
3852 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3853 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3856 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3857 const struct hda_fixup
*fix
,
3860 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3861 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3863 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3864 snd_hda_codec_set_pincfg(codec
, 0x19,
3865 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3866 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3869 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3870 const struct hda_fixup
*fix
, int action
)
3872 if (action
== HDA_FIXUP_ACT_INIT
)
3873 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3876 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3877 const struct hda_fixup
*fix
, int action
)
3879 struct alc_spec
*spec
= codec
->spec
;
3881 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3882 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3885 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3886 const struct hda_fixup
*fix
, int action
)
3888 static const struct hda_verb verbs
[] = {
3889 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3890 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3895 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3896 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3898 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3899 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3900 snd_hda_sequence_write(codec
, verbs
);
3903 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3904 const struct hda_fixup
*fix
, int action
)
3906 struct alc_spec
*spec
= codec
->spec
;
3908 if (action
!= HDA_FIXUP_ACT_PROBE
)
3911 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3912 * fix the sample rate of analog I/O to 44.1kHz
3914 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3915 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3918 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3919 const struct hda_fixup
*fix
, int action
)
3921 /* The digital-mic unit sends PDM (differential signal) instead of
3922 * the standard PCM, thus you can't record a valid mono stream as is.
3923 * Below is a workaround specific to ALC269 to control the dmic
3924 * signal source as mono.
3926 if (action
== HDA_FIXUP_ACT_INIT
)
3927 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3930 static void alc269_quanta_automute(struct hda_codec
*codec
)
3932 snd_hda_gen_update_outputs(codec
);
3934 alc_write_coef_idx(codec
, 0x0c, 0x680);
3935 alc_write_coef_idx(codec
, 0x0c, 0x480);
3938 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3939 const struct hda_fixup
*fix
, int action
)
3941 struct alc_spec
*spec
= codec
->spec
;
3942 if (action
!= HDA_FIXUP_ACT_PROBE
)
3944 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3947 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3948 struct hda_jack_callback
*jack
)
3950 struct alc_spec
*spec
= codec
->spec
;
3953 snd_hda_gen_hp_automute(codec
, jack
);
3955 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3957 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3960 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3965 * Magic sequence to make Huawei Matebook X right speaker working (bko#197801)
3967 struct hda_alc298_mbxinit
{
3968 unsigned char value_0x23
;
3969 unsigned char value_0x25
;
3972 static void alc298_huawei_mbx_stereo_seq(struct hda_codec
*codec
,
3973 const struct hda_alc298_mbxinit
*initval
,
3976 snd_hda_codec_write(codec
, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3
, 0x0);
3977 alc_write_coef_idx(codec
, 0x26, 0xb000);
3980 snd_hda_codec_write(codec
, 0x21, 0, AC_VERB_GET_PIN_SENSE
, 0x0);
3982 snd_hda_codec_write(codec
, 0x6, 0, AC_VERB_SET_DIGI_CONVERT_3
, 0x80);
3983 alc_write_coef_idx(codec
, 0x26, 0xf000);
3984 alc_write_coef_idx(codec
, 0x23, initval
->value_0x23
);
3986 if (initval
->value_0x23
!= 0x1e)
3987 alc_write_coef_idx(codec
, 0x25, initval
->value_0x25
);
3989 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 0x26);
3990 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
, 0xb010);
3993 static void alc298_fixup_huawei_mbx_stereo(struct hda_codec
*codec
,
3994 const struct hda_fixup
*fix
,
3997 /* Initialization magic */
3998 static const struct hda_alc298_mbxinit dac_init
[] = {
3999 {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
4000 {0x10, 0x00}, {0x1a, 0x40}, {0x1b, 0x82}, {0x1c, 0x00},
4001 {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
4002 {0x20, 0xc2}, {0x21, 0xc8}, {0x22, 0x26}, {0x23, 0x24},
4003 {0x27, 0xff}, {0x28, 0xff}, {0x29, 0xff}, {0x2a, 0x8f},
4004 {0x2b, 0x02}, {0x2c, 0x48}, {0x2d, 0x34}, {0x2e, 0x00},
4006 {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
4007 {0x34, 0x00}, {0x35, 0x01}, {0x36, 0x93}, {0x37, 0x0c},
4008 {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0xf8}, {0x38, 0x80},
4011 const struct hda_alc298_mbxinit
*seq
;
4013 if (action
!= HDA_FIXUP_ACT_INIT
)
4017 snd_hda_codec_write(codec
, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3
, 0x00);
4018 snd_hda_codec_write(codec
, 0x06, 0, AC_VERB_SET_DIGI_CONVERT_3
, 0x80);
4019 alc_write_coef_idx(codec
, 0x26, 0xf000);
4020 alc_write_coef_idx(codec
, 0x22, 0x31);
4021 alc_write_coef_idx(codec
, 0x23, 0x0b);
4022 alc_write_coef_idx(codec
, 0x25, 0x00);
4023 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_COEF_INDEX
, 0x26);
4024 snd_hda_codec_write(codec
, 0x20, 0, AC_VERB_SET_PROC_COEF
, 0xb010);
4026 for (seq
= dac_init
; seq
->value_0x23
; seq
++)
4027 alc298_huawei_mbx_stereo_seq(codec
, seq
, seq
== dac_init
);
4030 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
4031 const struct hda_fixup
*fix
, int action
)
4033 struct alc_spec
*spec
= codec
->spec
;
4034 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4035 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4036 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
4040 static void alc_update_vref_led(struct hda_codec
*codec
, hda_nid_t pin
,
4041 bool polarity
, bool on
)
4043 unsigned int pinval
;
4049 pinval
= snd_hda_codec_get_pin_target(codec
, pin
);
4050 pinval
&= ~AC_PINCTL_VREFEN
;
4051 pinval
|= on
? AC_PINCTL_VREF_80
: AC_PINCTL_VREF_HIZ
;
4052 /* temporarily power up/down for setting VREF */
4053 snd_hda_power_up_pm(codec
);
4054 snd_hda_set_pin_ctl_cache(codec
, pin
, pinval
);
4055 snd_hda_power_down_pm(codec
);
4058 /* update mute-LED according to the speaker mute state via mic VREF pin */
4059 static int vref_mute_led_set(struct led_classdev
*led_cdev
,
4060 enum led_brightness brightness
)
4062 struct hda_codec
*codec
= dev_to_hda_codec(led_cdev
->dev
->parent
);
4063 struct alc_spec
*spec
= codec
->spec
;
4065 alc_update_vref_led(codec
, spec
->mute_led_nid
,
4066 spec
->mute_led_polarity
, brightness
);
4070 /* Make sure the led works even in runtime suspend */
4071 static unsigned int led_power_filter(struct hda_codec
*codec
,
4073 unsigned int power_state
)
4075 struct alc_spec
*spec
= codec
->spec
;
4077 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
4078 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
4081 /* Set pin ctl again, it might have just been set to 0 */
4082 snd_hda_set_pin_ctl(codec
, nid
,
4083 snd_hda_codec_get_pin_target(codec
, nid
));
4085 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
4088 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
4089 const struct hda_fixup
*fix
, int action
)
4091 struct alc_spec
*spec
= codec
->spec
;
4092 const struct dmi_device
*dev
= NULL
;
4094 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
4097 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
4099 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
4101 if (pin
< 0x0a || pin
>= 0x10)
4103 spec
->mute_led_polarity
= pol
;
4104 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
4105 snd_hda_gen_add_mute_led_cdev(codec
, vref_mute_led_set
);
4106 codec
->power_filter
= led_power_filter
;
4108 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
4109 spec
->mute_led_polarity
);
4114 static void alc269_fixup_hp_mute_led_micx(struct hda_codec
*codec
,
4115 const struct hda_fixup
*fix
,
4116 int action
, hda_nid_t pin
)
4118 struct alc_spec
*spec
= codec
->spec
;
4120 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4121 spec
->mute_led_polarity
= 0;
4122 spec
->mute_led_nid
= pin
;
4123 snd_hda_gen_add_mute_led_cdev(codec
, vref_mute_led_set
);
4124 codec
->power_filter
= led_power_filter
;
4128 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
4129 const struct hda_fixup
*fix
, int action
)
4131 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x18);
4134 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
4135 const struct hda_fixup
*fix
, int action
)
4137 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x19);
4140 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec
*codec
,
4141 const struct hda_fixup
*fix
, int action
)
4143 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x1b);
4146 /* update LED status via GPIO */
4147 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
4148 int polarity
, bool enabled
)
4152 alc_update_gpio_data(codec
, mask
, !enabled
); /* muted -> LED on */
4155 /* turn on/off mute LED via GPIO per vmaster hook */
4156 static int gpio_mute_led_set(struct led_classdev
*led_cdev
,
4157 enum led_brightness brightness
)
4159 struct hda_codec
*codec
= dev_to_hda_codec(led_cdev
->dev
->parent
);
4160 struct alc_spec
*spec
= codec
->spec
;
4162 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
,
4163 spec
->mute_led_polarity
, !brightness
);
4167 /* turn on/off mic-mute LED via GPIO per capture hook */
4168 static int micmute_led_set(struct led_classdev
*led_cdev
,
4169 enum led_brightness brightness
)
4171 struct hda_codec
*codec
= dev_to_hda_codec(led_cdev
->dev
->parent
);
4172 struct alc_spec
*spec
= codec
->spec
;
4174 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
4175 spec
->micmute_led_polarity
, !brightness
);
4179 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
4180 static void alc_fixup_hp_gpio_led(struct hda_codec
*codec
,
4182 unsigned int mute_mask
,
4183 unsigned int micmute_mask
)
4185 struct alc_spec
*spec
= codec
->spec
;
4187 alc_fixup_gpio(codec
, action
, mute_mask
| micmute_mask
);
4189 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
4192 spec
->gpio_mute_led_mask
= mute_mask
;
4193 snd_hda_gen_add_mute_led_cdev(codec
, gpio_mute_led_set
);
4196 spec
->gpio_mic_led_mask
= micmute_mask
;
4197 snd_hda_gen_add_micmute_led_cdev(codec
, micmute_led_set
);
4201 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
4202 const struct hda_fixup
*fix
, int action
)
4204 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0x10);
4207 static void alc285_fixup_hp_gpio_led(struct hda_codec
*codec
,
4208 const struct hda_fixup
*fix
, int action
)
4210 alc_fixup_hp_gpio_led(codec
, action
, 0x04, 0x01);
4213 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
4214 const struct hda_fixup
*fix
, int action
)
4216 alc_fixup_hp_gpio_led(codec
, action
, 0x02, 0x20);
4219 /* turn on/off mic-mute LED per capture hook via VREF change */
4220 static int vref_micmute_led_set(struct led_classdev
*led_cdev
,
4221 enum led_brightness brightness
)
4223 struct hda_codec
*codec
= dev_to_hda_codec(led_cdev
->dev
->parent
);
4224 struct alc_spec
*spec
= codec
->spec
;
4226 alc_update_vref_led(codec
, spec
->cap_mute_led_nid
,
4227 spec
->micmute_led_polarity
, brightness
);
4231 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
4232 const struct hda_fixup
*fix
, int action
)
4234 struct alc_spec
*spec
= codec
->spec
;
4236 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0);
4237 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4238 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
4239 * enable headphone amp
4241 spec
->gpio_mask
|= 0x10;
4242 spec
->gpio_dir
|= 0x10;
4243 spec
->cap_mute_led_nid
= 0x18;
4244 snd_hda_gen_add_micmute_led_cdev(codec
, vref_micmute_led_set
);
4245 codec
->power_filter
= led_power_filter
;
4249 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
4250 const struct hda_fixup
*fix
, int action
)
4252 struct alc_spec
*spec
= codec
->spec
;
4254 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0);
4255 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4256 spec
->cap_mute_led_nid
= 0x18;
4257 snd_hda_gen_add_micmute_led_cdev(codec
, vref_micmute_led_set
);
4258 codec
->power_filter
= led_power_filter
;
4262 static void alc_update_coef_led(struct hda_codec
*codec
,
4263 struct alc_coef_led
*led
,
4264 bool polarity
, bool on
)
4268 /* temporarily power up/down for setting COEF bit */
4269 alc_update_coef_idx(codec
, led
->idx
, led
->mask
,
4270 on
? led
->on
: led
->off
);
4273 /* update mute-LED according to the speaker mute state via COEF bit */
4274 static int coef_mute_led_set(struct led_classdev
*led_cdev
,
4275 enum led_brightness brightness
)
4277 struct hda_codec
*codec
= dev_to_hda_codec(led_cdev
->dev
->parent
);
4278 struct alc_spec
*spec
= codec
->spec
;
4280 alc_update_coef_led(codec
, &spec
->mute_led_coef
,
4281 spec
->mute_led_polarity
, brightness
);
4285 static void alc285_fixup_hp_mute_led_coefbit(struct hda_codec
*codec
,
4286 const struct hda_fixup
*fix
,
4289 struct alc_spec
*spec
= codec
->spec
;
4291 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4292 spec
->mute_led_polarity
= 0;
4293 spec
->mute_led_coef
.idx
= 0x0b;
4294 spec
->mute_led_coef
.mask
= 1 << 3;
4295 spec
->mute_led_coef
.on
= 1 << 3;
4296 spec
->mute_led_coef
.off
= 0;
4297 snd_hda_gen_add_mute_led_cdev(codec
, coef_mute_led_set
);
4301 static void alc236_fixup_hp_mute_led_coefbit(struct hda_codec
*codec
,
4302 const struct hda_fixup
*fix
,
4305 struct alc_spec
*spec
= codec
->spec
;
4307 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4308 spec
->mute_led_polarity
= 0;
4309 spec
->mute_led_coef
.idx
= 0x34;
4310 spec
->mute_led_coef
.mask
= 1 << 5;
4311 spec
->mute_led_coef
.on
= 0;
4312 spec
->mute_led_coef
.off
= 1 << 5;
4313 snd_hda_gen_add_mute_led_cdev(codec
, coef_mute_led_set
);
4317 /* turn on/off mic-mute LED per capture hook by coef bit */
4318 static int coef_micmute_led_set(struct led_classdev
*led_cdev
,
4319 enum led_brightness brightness
)
4321 struct hda_codec
*codec
= dev_to_hda_codec(led_cdev
->dev
->parent
);
4322 struct alc_spec
*spec
= codec
->spec
;
4324 alc_update_coef_led(codec
, &spec
->mic_led_coef
,
4325 spec
->micmute_led_polarity
, brightness
);
4329 static void alc285_fixup_hp_coef_micmute_led(struct hda_codec
*codec
,
4330 const struct hda_fixup
*fix
, int action
)
4332 struct alc_spec
*spec
= codec
->spec
;
4334 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4335 spec
->mic_led_coef
.idx
= 0x19;
4336 spec
->mic_led_coef
.mask
= 1 << 13;
4337 spec
->mic_led_coef
.on
= 1 << 13;
4338 spec
->mic_led_coef
.off
= 0;
4339 snd_hda_gen_add_micmute_led_cdev(codec
, coef_micmute_led_set
);
4343 static void alc236_fixup_hp_coef_micmute_led(struct hda_codec
*codec
,
4344 const struct hda_fixup
*fix
, int action
)
4346 struct alc_spec
*spec
= codec
->spec
;
4348 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4349 spec
->mic_led_coef
.idx
= 0x35;
4350 spec
->mic_led_coef
.mask
= 3 << 2;
4351 spec
->mic_led_coef
.on
= 2 << 2;
4352 spec
->mic_led_coef
.off
= 1 << 2;
4353 snd_hda_gen_add_micmute_led_cdev(codec
, coef_micmute_led_set
);
4357 static void alc285_fixup_hp_mute_led(struct hda_codec
*codec
,
4358 const struct hda_fixup
*fix
, int action
)
4360 alc285_fixup_hp_mute_led_coefbit(codec
, fix
, action
);
4361 alc285_fixup_hp_coef_micmute_led(codec
, fix
, action
);
4364 static void alc236_fixup_hp_mute_led(struct hda_codec
*codec
,
4365 const struct hda_fixup
*fix
, int action
)
4367 alc236_fixup_hp_mute_led_coefbit(codec
, fix
, action
);
4368 alc236_fixup_hp_coef_micmute_led(codec
, fix
, action
);
4371 #if IS_REACHABLE(CONFIG_INPUT)
4372 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
4373 struct hda_jack_callback
*event
)
4375 struct alc_spec
*spec
= codec
->spec
;
4377 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4378 send both key on and key off event for every interrupt. */
4379 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
4380 input_sync(spec
->kb_dev
);
4381 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
4382 input_sync(spec
->kb_dev
);
4385 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
4387 struct alc_spec
*spec
= codec
->spec
;
4390 spec
->kb_dev
= input_allocate_device();
4391 if (!spec
->kb_dev
) {
4392 codec_err(codec
, "Out of memory (input_allocate_device)\n");
4396 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
4398 spec
->kb_dev
->name
= "Microphone Mute Button";
4399 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
4400 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
4401 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
4402 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
4403 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
4404 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
4406 if (input_register_device(spec
->kb_dev
)) {
4407 codec_err(codec
, "input_register_device failed\n");
4408 input_free_device(spec
->kb_dev
);
4409 spec
->kb_dev
= NULL
;
4416 /* GPIO1 = set according to SKU external amp
4417 * GPIO2 = mic mute hotkey
4419 * GPIO4 = mic mute LED
4421 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
4422 const struct hda_fixup
*fix
, int action
)
4424 struct alc_spec
*spec
= codec
->spec
;
4426 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0x10);
4427 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4428 spec
->init_amp
= ALC_INIT_DEFAULT
;
4429 if (alc_register_micmute_input_device(codec
) != 0)
4432 spec
->gpio_mask
|= 0x06;
4433 spec
->gpio_dir
|= 0x02;
4434 spec
->gpio_data
|= 0x02;
4435 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
4436 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
4437 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
4438 gpio2_mic_hotkey_event
);
4446 case HDA_FIXUP_ACT_FREE
:
4447 input_unregister_device(spec
->kb_dev
);
4448 spec
->kb_dev
= NULL
;
4452 /* Line2 = mic mute hotkey
4453 * GPIO2 = mic mute LED
4455 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
4456 const struct hda_fixup
*fix
, int action
)
4458 struct alc_spec
*spec
= codec
->spec
;
4460 alc_fixup_hp_gpio_led(codec
, action
, 0, 0x04);
4461 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4462 spec
->init_amp
= ALC_INIT_DEFAULT
;
4463 if (alc_register_micmute_input_device(codec
) != 0)
4466 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4467 gpio2_mic_hotkey_event
);
4475 case HDA_FIXUP_ACT_FREE
:
4476 input_unregister_device(spec
->kb_dev
);
4477 spec
->kb_dev
= NULL
;
4481 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4482 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4485 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
4486 const struct hda_fixup
*fix
, int action
)
4488 struct alc_spec
*spec
= codec
->spec
;
4490 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x1a);
4491 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4492 spec
->cap_mute_led_nid
= 0x18;
4493 snd_hda_gen_add_micmute_led_cdev(codec
, vref_micmute_led_set
);
4497 static const struct coef_fw alc225_pre_hsmode
[] = {
4498 UPDATE_COEF(0x4a, 1<<8, 0),
4499 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4500 UPDATE_COEF(0x63, 3<<14, 3<<14),
4501 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4502 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4503 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4504 UPDATE_COEF(0x4a, 3<<10, 0),
4508 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
4510 static const struct coef_fw coef0255
[] = {
4511 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4512 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4513 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4514 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4515 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4518 static const struct coef_fw coef0256
[] = {
4519 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4520 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4521 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4522 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4523 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4526 static const struct coef_fw coef0233
[] = {
4527 WRITE_COEF(0x1b, 0x0c0b),
4528 WRITE_COEF(0x45, 0xc429),
4529 UPDATE_COEF(0x35, 0x4000, 0),
4530 WRITE_COEF(0x06, 0x2104),
4531 WRITE_COEF(0x1a, 0x0001),
4532 WRITE_COEF(0x26, 0x0004),
4533 WRITE_COEF(0x32, 0x42a3),
4536 static const struct coef_fw coef0288
[] = {
4537 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4538 UPDATE_COEF(0x50, 0x2000, 0x2000),
4539 UPDATE_COEF(0x56, 0x0006, 0x0006),
4540 UPDATE_COEF(0x66, 0x0008, 0),
4541 UPDATE_COEF(0x67, 0x2000, 0),
4544 static const struct coef_fw coef0298
[] = {
4545 UPDATE_COEF(0x19, 0x1300, 0x0300),
4548 static const struct coef_fw coef0292
[] = {
4549 WRITE_COEF(0x76, 0x000e),
4550 WRITE_COEF(0x6c, 0x2400),
4551 WRITE_COEF(0x18, 0x7308),
4552 WRITE_COEF(0x6b, 0xc429),
4555 static const struct coef_fw coef0293
[] = {
4556 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4557 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4558 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4559 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4560 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4561 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4564 static const struct coef_fw coef0668
[] = {
4565 WRITE_COEF(0x15, 0x0d40),
4566 WRITE_COEF(0xb7, 0x802b),
4569 static const struct coef_fw coef0225
[] = {
4570 UPDATE_COEF(0x63, 3<<14, 0),
4573 static const struct coef_fw coef0274
[] = {
4574 UPDATE_COEF(0x4a, 0x0100, 0),
4575 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4576 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4577 UPDATE_COEF(0x4a, 0x0010, 0),
4578 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4579 WRITE_COEF(0x45, 0x5289),
4580 UPDATE_COEF(0x4a, 0x0c00, 0),
4584 switch (codec
->core
.vendor_id
) {
4586 alc_process_coef_fw(codec
, coef0255
);
4590 alc_process_coef_fw(codec
, coef0256
);
4595 alc_process_coef_fw(codec
, coef0274
);
4599 alc_process_coef_fw(codec
, coef0233
);
4603 alc_process_coef_fw(codec
, coef0288
);
4606 alc_process_coef_fw(codec
, coef0298
);
4607 alc_process_coef_fw(codec
, coef0288
);
4610 alc_process_coef_fw(codec
, coef0292
);
4613 alc_process_coef_fw(codec
, coef0293
);
4616 alc_process_coef_fw(codec
, coef0668
);
4624 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4625 alc_process_coef_fw(codec
, coef0225
);
4628 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4631 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
4635 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
4638 static const struct coef_fw coef0255
[] = {
4639 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4640 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4643 static const struct coef_fw coef0256
[] = {
4644 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4645 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4646 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4649 static const struct coef_fw coef0233
[] = {
4650 UPDATE_COEF(0x35, 0, 1<<14),
4651 WRITE_COEF(0x06, 0x2100),
4652 WRITE_COEF(0x1a, 0x0021),
4653 WRITE_COEF(0x26, 0x008c),
4656 static const struct coef_fw coef0288
[] = {
4657 UPDATE_COEF(0x4f, 0x00c0, 0),
4658 UPDATE_COEF(0x50, 0x2000, 0),
4659 UPDATE_COEF(0x56, 0x0006, 0),
4660 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4661 UPDATE_COEF(0x66, 0x0008, 0x0008),
4662 UPDATE_COEF(0x67, 0x2000, 0x2000),
4665 static const struct coef_fw coef0292
[] = {
4666 WRITE_COEF(0x19, 0xa208),
4667 WRITE_COEF(0x2e, 0xacf0),
4670 static const struct coef_fw coef0293
[] = {
4671 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4672 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4673 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4676 static const struct coef_fw coef0688
[] = {
4677 WRITE_COEF(0xb7, 0x802b),
4678 WRITE_COEF(0xb5, 0x1040),
4679 UPDATE_COEF(0xc3, 0, 1<<12),
4682 static const struct coef_fw coef0225
[] = {
4683 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4684 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4685 UPDATE_COEF(0x63, 3<<14, 0),
4688 static const struct coef_fw coef0274
[] = {
4689 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4690 UPDATE_COEF(0x4a, 0x0010, 0),
4691 UPDATE_COEF(0x6b, 0xf000, 0),
4695 switch (codec
->core
.vendor_id
) {
4697 alc_write_coef_idx(codec
, 0x45, 0xc489);
4698 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4699 alc_process_coef_fw(codec
, coef0255
);
4700 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4704 alc_write_coef_idx(codec
, 0x45, 0xc489);
4705 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4706 alc_process_coef_fw(codec
, coef0256
);
4707 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4712 alc_write_coef_idx(codec
, 0x45, 0x4689);
4713 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4714 alc_process_coef_fw(codec
, coef0274
);
4715 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4719 alc_write_coef_idx(codec
, 0x45, 0xc429);
4720 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4721 alc_process_coef_fw(codec
, coef0233
);
4722 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4727 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4728 alc_process_coef_fw(codec
, coef0288
);
4729 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4732 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4733 alc_process_coef_fw(codec
, coef0292
);
4736 /* Set to TRS mode */
4737 alc_write_coef_idx(codec
, 0x45, 0xc429);
4738 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4739 alc_process_coef_fw(codec
, coef0293
);
4740 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4743 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4747 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4748 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4751 alc_write_coef_idx(codec
, 0x11, 0x0001);
4752 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4753 alc_process_coef_fw(codec
, coef0688
);
4754 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4762 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4763 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4764 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4765 alc_process_coef_fw(codec
, coef0225
);
4766 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4769 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4772 static void alc_headset_mode_default(struct hda_codec
*codec
)
4774 static const struct coef_fw coef0225
[] = {
4775 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4776 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4777 UPDATE_COEF(0x49, 3<<8, 0<<8),
4778 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4779 UPDATE_COEF(0x63, 3<<14, 0),
4780 UPDATE_COEF(0x67, 0xf000, 0x3000),
4783 static const struct coef_fw coef0255
[] = {
4784 WRITE_COEF(0x45, 0xc089),
4785 WRITE_COEF(0x45, 0xc489),
4786 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4787 WRITE_COEF(0x49, 0x0049),
4790 static const struct coef_fw coef0256
[] = {
4791 WRITE_COEF(0x45, 0xc489),
4792 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4793 WRITE_COEF(0x49, 0x0049),
4794 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4795 WRITE_COEF(0x06, 0x6100),
4798 static const struct coef_fw coef0233
[] = {
4799 WRITE_COEF(0x06, 0x2100),
4800 WRITE_COEF(0x32, 0x4ea3),
4803 static const struct coef_fw coef0288
[] = {
4804 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4805 UPDATE_COEF(0x50, 0x2000, 0x2000),
4806 UPDATE_COEF(0x56, 0x0006, 0x0006),
4807 UPDATE_COEF(0x66, 0x0008, 0),
4808 UPDATE_COEF(0x67, 0x2000, 0),
4811 static const struct coef_fw coef0292
[] = {
4812 WRITE_COEF(0x76, 0x000e),
4813 WRITE_COEF(0x6c, 0x2400),
4814 WRITE_COEF(0x6b, 0xc429),
4815 WRITE_COEF(0x18, 0x7308),
4818 static const struct coef_fw coef0293
[] = {
4819 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4820 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4821 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4824 static const struct coef_fw coef0688
[] = {
4825 WRITE_COEF(0x11, 0x0041),
4826 WRITE_COEF(0x15, 0x0d40),
4827 WRITE_COEF(0xb7, 0x802b),
4830 static const struct coef_fw coef0274
[] = {
4831 WRITE_COEF(0x45, 0x4289),
4832 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4833 UPDATE_COEF(0x6b, 0x0f00, 0),
4834 UPDATE_COEF(0x49, 0x0300, 0x0300),
4838 switch (codec
->core
.vendor_id
) {
4845 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4846 alc_process_coef_fw(codec
, coef0225
);
4849 alc_process_coef_fw(codec
, coef0255
);
4853 alc_write_coef_idx(codec
, 0x1b, 0x0e4b);
4854 alc_write_coef_idx(codec
, 0x45, 0xc089);
4856 alc_process_coef_fw(codec
, coef0256
);
4861 alc_process_coef_fw(codec
, coef0274
);
4865 alc_process_coef_fw(codec
, coef0233
);
4870 alc_process_coef_fw(codec
, coef0288
);
4873 alc_process_coef_fw(codec
, coef0292
);
4876 alc_process_coef_fw(codec
, coef0293
);
4879 alc_process_coef_fw(codec
, coef0688
);
4882 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4885 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4889 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4893 static const struct coef_fw coef0255
[] = {
4894 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4895 WRITE_COEF(0x1b, 0x0c2b),
4896 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4899 static const struct coef_fw coef0256
[] = {
4900 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4901 WRITE_COEF(0x1b, 0x0e6b),
4904 static const struct coef_fw coef0233
[] = {
4905 WRITE_COEF(0x45, 0xd429),
4906 WRITE_COEF(0x1b, 0x0c2b),
4907 WRITE_COEF(0x32, 0x4ea3),
4910 static const struct coef_fw coef0288
[] = {
4911 UPDATE_COEF(0x50, 0x2000, 0x2000),
4912 UPDATE_COEF(0x56, 0x0006, 0x0006),
4913 UPDATE_COEF(0x66, 0x0008, 0),
4914 UPDATE_COEF(0x67, 0x2000, 0),
4917 static const struct coef_fw coef0292
[] = {
4918 WRITE_COEF(0x6b, 0xd429),
4919 WRITE_COEF(0x76, 0x0008),
4920 WRITE_COEF(0x18, 0x7388),
4923 static const struct coef_fw coef0293
[] = {
4924 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4925 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4928 static const struct coef_fw coef0688
[] = {
4929 WRITE_COEF(0x11, 0x0001),
4930 WRITE_COEF(0x15, 0x0d60),
4931 WRITE_COEF(0xc3, 0x0000),
4934 static const struct coef_fw coef0225_1
[] = {
4935 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4936 UPDATE_COEF(0x63, 3<<14, 2<<14),
4939 static const struct coef_fw coef0225_2
[] = {
4940 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4941 UPDATE_COEF(0x63, 3<<14, 1<<14),
4945 switch (codec
->core
.vendor_id
) {
4947 alc_process_coef_fw(codec
, coef0255
);
4951 alc_process_coef_fw(codec
, coef0256
);
4956 alc_write_coef_idx(codec
, 0x45, 0xd689);
4960 alc_process_coef_fw(codec
, coef0233
);
4963 val
= alc_read_coef_idx(codec
, 0x50);
4964 if (val
& (1 << 12)) {
4965 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4966 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4969 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4970 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4976 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4978 alc_process_coef_fw(codec
, coef0288
);
4981 alc_process_coef_fw(codec
, coef0292
);
4984 alc_process_coef_fw(codec
, coef0293
);
4987 alc_process_coef_fw(codec
, coef0688
);
4995 val
= alc_read_coef_idx(codec
, 0x45);
4997 alc_process_coef_fw(codec
, coef0225_2
);
4999 alc_process_coef_fw(codec
, coef0225_1
);
5002 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
5005 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
5009 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
5011 static const struct coef_fw coef0255
[] = {
5012 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5013 WRITE_COEF(0x1b, 0x0c2b),
5014 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
5017 static const struct coef_fw coef0256
[] = {
5018 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
5019 WRITE_COEF(0x1b, 0x0e6b),
5022 static const struct coef_fw coef0233
[] = {
5023 WRITE_COEF(0x45, 0xe429),
5024 WRITE_COEF(0x1b, 0x0c2b),
5025 WRITE_COEF(0x32, 0x4ea3),
5028 static const struct coef_fw coef0288
[] = {
5029 UPDATE_COEF(0x50, 0x2000, 0x2000),
5030 UPDATE_COEF(0x56, 0x0006, 0x0006),
5031 UPDATE_COEF(0x66, 0x0008, 0),
5032 UPDATE_COEF(0x67, 0x2000, 0),
5035 static const struct coef_fw coef0292
[] = {
5036 WRITE_COEF(0x6b, 0xe429),
5037 WRITE_COEF(0x76, 0x0008),
5038 WRITE_COEF(0x18, 0x7388),
5041 static const struct coef_fw coef0293
[] = {
5042 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
5043 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
5046 static const struct coef_fw coef0688
[] = {
5047 WRITE_COEF(0x11, 0x0001),
5048 WRITE_COEF(0x15, 0x0d50),
5049 WRITE_COEF(0xc3, 0x0000),
5052 static const struct coef_fw coef0225
[] = {
5053 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
5054 UPDATE_COEF(0x63, 3<<14, 2<<14),
5058 switch (codec
->core
.vendor_id
) {
5060 alc_process_coef_fw(codec
, coef0255
);
5064 alc_process_coef_fw(codec
, coef0256
);
5069 alc_write_coef_idx(codec
, 0x45, 0xe689);
5073 alc_process_coef_fw(codec
, coef0233
);
5076 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
5077 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
5082 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
5084 alc_process_coef_fw(codec
, coef0288
);
5087 alc_process_coef_fw(codec
, coef0292
);
5090 alc_process_coef_fw(codec
, coef0293
);
5093 alc_process_coef_fw(codec
, coef0688
);
5101 alc_process_coef_fw(codec
, coef0225
);
5104 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
5107 static void alc_determine_headset_type(struct hda_codec
*codec
)
5110 bool is_ctia
= false;
5111 struct alc_spec
*spec
= codec
->spec
;
5112 static const struct coef_fw coef0255
[] = {
5113 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
5114 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
5118 static const struct coef_fw coef0288
[] = {
5119 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
5122 static const struct coef_fw coef0298
[] = {
5123 UPDATE_COEF(0x50, 0x2000, 0x2000),
5124 UPDATE_COEF(0x56, 0x0006, 0x0006),
5125 UPDATE_COEF(0x66, 0x0008, 0),
5126 UPDATE_COEF(0x67, 0x2000, 0),
5127 UPDATE_COEF(0x19, 0x1300, 0x1300),
5130 static const struct coef_fw coef0293
[] = {
5131 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
5132 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
5135 static const struct coef_fw coef0688
[] = {
5136 WRITE_COEF(0x11, 0x0001),
5137 WRITE_COEF(0xb7, 0x802b),
5138 WRITE_COEF(0x15, 0x0d60),
5139 WRITE_COEF(0xc3, 0x0c00),
5142 static const struct coef_fw coef0274
[] = {
5143 UPDATE_COEF(0x4a, 0x0010, 0),
5144 UPDATE_COEF(0x4a, 0x8000, 0),
5145 WRITE_COEF(0x45, 0xd289),
5146 UPDATE_COEF(0x49, 0x0300, 0x0300),
5150 switch (codec
->core
.vendor_id
) {
5152 alc_process_coef_fw(codec
, coef0255
);
5154 val
= alc_read_coef_idx(codec
, 0x46);
5155 is_ctia
= (val
& 0x0070) == 0x0070;
5159 alc_write_coef_idx(codec
, 0x1b, 0x0e4b);
5160 alc_write_coef_idx(codec
, 0x06, 0x6104);
5161 alc_write_coefex_idx(codec
, 0x57, 0x3, 0x09a3);
5163 snd_hda_codec_write(codec
, 0x21, 0,
5164 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5166 snd_hda_codec_write(codec
, 0x21, 0,
5167 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
5169 alc_process_coef_fw(codec
, coef0255
);
5171 val
= alc_read_coef_idx(codec
, 0x46);
5172 is_ctia
= (val
& 0x0070) == 0x0070;
5174 alc_write_coefex_idx(codec
, 0x57, 0x3, 0x0da3);
5175 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
5177 snd_hda_codec_write(codec
, 0x21, 0,
5178 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
5180 snd_hda_codec_write(codec
, 0x21, 0,
5181 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
5186 alc_process_coef_fw(codec
, coef0274
);
5188 val
= alc_read_coef_idx(codec
, 0x46);
5189 is_ctia
= (val
& 0x00f0) == 0x00f0;
5193 alc_write_coef_idx(codec
, 0x45, 0xd029);
5195 val
= alc_read_coef_idx(codec
, 0x46);
5196 is_ctia
= (val
& 0x0070) == 0x0070;
5199 snd_hda_codec_write(codec
, 0x21, 0,
5200 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5202 snd_hda_codec_write(codec
, 0x21, 0,
5203 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
5206 val
= alc_read_coef_idx(codec
, 0x50);
5207 if (val
& (1 << 12)) {
5208 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
5209 alc_process_coef_fw(codec
, coef0288
);
5211 val
= alc_read_coef_idx(codec
, 0x50);
5212 is_ctia
= (val
& 0x0070) == 0x0070;
5214 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
5215 alc_process_coef_fw(codec
, coef0288
);
5217 val
= alc_read_coef_idx(codec
, 0x50);
5218 is_ctia
= (val
& 0x0070) == 0x0070;
5220 alc_process_coef_fw(codec
, coef0298
);
5221 snd_hda_codec_write(codec
, 0x21, 0,
5222 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
);
5224 snd_hda_codec_write(codec
, 0x21, 0,
5225 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
5229 alc_process_coef_fw(codec
, coef0288
);
5231 val
= alc_read_coef_idx(codec
, 0x50);
5232 is_ctia
= (val
& 0x0070) == 0x0070;
5235 alc_write_coef_idx(codec
, 0x6b, 0xd429);
5237 val
= alc_read_coef_idx(codec
, 0x6c);
5238 is_ctia
= (val
& 0x001c) == 0x001c;
5241 alc_process_coef_fw(codec
, coef0293
);
5243 val
= alc_read_coef_idx(codec
, 0x46);
5244 is_ctia
= (val
& 0x0070) == 0x0070;
5247 alc_process_coef_fw(codec
, coef0688
);
5249 val
= alc_read_coef_idx(codec
, 0xbe);
5250 is_ctia
= (val
& 0x1c02) == 0x1c02;
5258 snd_hda_codec_write(codec
, 0x21, 0,
5259 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5261 snd_hda_codec_write(codec
, 0x21, 0,
5262 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
5264 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
5265 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x1000);
5266 val
= alc_read_coef_idx(codec
, 0x45);
5267 if (val
& (1 << 9)) {
5268 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
5269 alc_update_coef_idx(codec
, 0x49, 3<<8, 2<<8);
5271 val
= alc_read_coef_idx(codec
, 0x46);
5272 is_ctia
= (val
& 0x00f0) == 0x00f0;
5274 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
5275 alc_update_coef_idx(codec
, 0x49, 3<<8, 1<<8);
5277 val
= alc_read_coef_idx(codec
, 0x46);
5278 is_ctia
= (val
& 0x00f0) == 0x00f0;
5280 alc_update_coef_idx(codec
, 0x4a, 7<<6, 7<<6);
5281 alc_update_coef_idx(codec
, 0x4a, 3<<4, 3<<4);
5282 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
5284 snd_hda_codec_write(codec
, 0x21, 0,
5285 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
5287 snd_hda_codec_write(codec
, 0x21, 0,
5288 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
5295 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
5296 is_ctia
? "yes" : "no");
5297 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
5300 static void alc_update_headset_mode(struct hda_codec
*codec
)
5302 struct alc_spec
*spec
= codec
->spec
;
5304 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
5305 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
5307 int new_headset_mode
;
5309 if (!snd_hda_jack_detect(codec
, hp_pin
))
5310 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
5311 else if (mux_pin
== spec
->headset_mic_pin
)
5312 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
5313 else if (mux_pin
== spec
->headphone_mic_pin
)
5314 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
5316 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
5318 if (new_headset_mode
== spec
->current_headset_mode
) {
5319 snd_hda_gen_update_outputs(codec
);
5323 switch (new_headset_mode
) {
5324 case ALC_HEADSET_MODE_UNPLUGGED
:
5325 alc_headset_mode_unplugged(codec
);
5326 spec
->current_headset_mode
= ALC_HEADSET_MODE_UNKNOWN
;
5327 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
5328 spec
->gen
.hp_jack_present
= false;
5330 case ALC_HEADSET_MODE_HEADSET
:
5331 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
5332 alc_determine_headset_type(codec
);
5333 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
5334 alc_headset_mode_ctia(codec
);
5335 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
5336 alc_headset_mode_omtp(codec
);
5337 spec
->gen
.hp_jack_present
= true;
5339 case ALC_HEADSET_MODE_MIC
:
5340 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
5341 spec
->gen
.hp_jack_present
= false;
5343 case ALC_HEADSET_MODE_HEADPHONE
:
5344 alc_headset_mode_default(codec
);
5345 spec
->gen
.hp_jack_present
= true;
5348 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
5349 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
5350 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
5351 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
5352 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
5355 spec
->current_headset_mode
= new_headset_mode
;
5357 snd_hda_gen_update_outputs(codec
);
5360 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
5361 struct snd_kcontrol
*kcontrol
,
5362 struct snd_ctl_elem_value
*ucontrol
)
5364 alc_update_headset_mode(codec
);
5367 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
5368 struct hda_jack_callback
*jack
)
5370 snd_hda_gen_hp_automute(codec
, jack
);
5373 static void alc_probe_headset_mode(struct hda_codec
*codec
)
5376 struct alc_spec
*spec
= codec
->spec
;
5377 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5380 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5381 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
5382 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
5383 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
5384 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
5387 WARN_ON(spec
->gen
.cap_sync_hook
);
5388 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
5389 spec
->gen
.automute_hook
= alc_update_headset_mode
;
5390 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
5393 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
5394 const struct hda_fixup
*fix
, int action
)
5396 struct alc_spec
*spec
= codec
->spec
;
5399 case HDA_FIXUP_ACT_PRE_PROBE
:
5400 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
5402 case HDA_FIXUP_ACT_PROBE
:
5403 alc_probe_headset_mode(codec
);
5405 case HDA_FIXUP_ACT_INIT
:
5406 if (is_s3_resume(codec
) || is_s4_resume(codec
)) {
5407 spec
->current_headset_mode
= ALC_HEADSET_MODE_UNKNOWN
;
5408 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
5410 alc_update_headset_mode(codec
);
5415 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
5416 const struct hda_fixup
*fix
, int action
)
5418 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5419 struct alc_spec
*spec
= codec
->spec
;
5420 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5423 alc_fixup_headset_mode(codec
, fix
, action
);
5426 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
5428 /* Set to iphone type */
5429 static const struct coef_fw alc255fw
[] = {
5430 WRITE_COEF(0x1b, 0x880b),
5431 WRITE_COEF(0x45, 0xd089),
5432 WRITE_COEF(0x1b, 0x080b),
5433 WRITE_COEF(0x46, 0x0004),
5434 WRITE_COEF(0x1b, 0x0c0b),
5437 static const struct coef_fw alc256fw
[] = {
5438 WRITE_COEF(0x1b, 0x884b),
5439 WRITE_COEF(0x45, 0xd089),
5440 WRITE_COEF(0x1b, 0x084b),
5441 WRITE_COEF(0x46, 0x0004),
5442 WRITE_COEF(0x1b, 0x0c4b),
5445 switch (codec
->core
.vendor_id
) {
5447 alc_process_coef_fw(codec
, alc255fw
);
5451 alc_process_coef_fw(codec
, alc256fw
);
5457 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
5458 const struct hda_fixup
*fix
, int action
)
5460 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5461 alc255_set_default_jack_type(codec
);
5463 alc_fixup_headset_mode(codec
, fix
, action
);
5466 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
5467 const struct hda_fixup
*fix
, int action
)
5469 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5470 struct alc_spec
*spec
= codec
->spec
;
5471 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5472 alc255_set_default_jack_type(codec
);
5475 alc_fixup_headset_mode(codec
, fix
, action
);
5478 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
5479 struct hda_jack_callback
*jack
)
5481 struct alc_spec
*spec
= codec
->spec
;
5483 alc_update_headset_jack_cb(codec
, jack
);
5484 /* Headset Mic enable or disable, only for Dell Dino */
5485 alc_update_gpio_data(codec
, 0x40, spec
->gen
.hp_jack_present
);
5488 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
5489 const struct hda_fixup
*fix
, int action
)
5491 alc_fixup_headset_mode(codec
, fix
, action
);
5492 if (action
== HDA_FIXUP_ACT_PROBE
) {
5493 struct alc_spec
*spec
= codec
->spec
;
5494 /* toggled via hp_automute_hook */
5495 spec
->gpio_mask
|= 0x40;
5496 spec
->gpio_dir
|= 0x40;
5497 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
5501 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
5502 const struct hda_fixup
*fix
, int action
)
5504 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5505 struct alc_spec
*spec
= codec
->spec
;
5506 spec
->gen
.auto_mute_via_amp
= 1;
5510 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
5511 const struct hda_fixup
*fix
, int action
)
5513 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5514 struct alc_spec
*spec
= codec
->spec
;
5515 spec
->no_shutup_pins
= 1;
5519 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
5520 const struct hda_fixup
*fix
, int action
)
5522 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5523 struct alc_spec
*spec
= codec
->spec
;
5524 /* Disable AA-loopback as it causes white noise */
5525 spec
->gen
.mixer_nid
= 0;
5529 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5530 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
5531 const struct hda_fixup
*fix
, int action
)
5533 static const struct hda_pintbl pincfgs
[] = {
5534 { 0x16, 0x21211010 }, /* dock headphone */
5535 { 0x19, 0x21a11010 }, /* dock mic */
5538 struct alc_spec
*spec
= codec
->spec
;
5540 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5541 spec
->reboot_notify
= snd_hda_gen_reboot_notify
; /* reduce noise */
5542 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5543 codec
->power_save_node
= 0; /* avoid click noises */
5544 snd_hda_apply_pincfgs(codec
, pincfgs
);
5548 static void alc_fixup_tpt470_dock(struct hda_codec
*codec
,
5549 const struct hda_fixup
*fix
, int action
)
5551 static const struct hda_pintbl pincfgs
[] = {
5552 { 0x17, 0x21211010 }, /* dock headphone */
5553 { 0x19, 0x21a11010 }, /* dock mic */
5556 struct alc_spec
*spec
= codec
->spec
;
5558 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5559 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5560 snd_hda_apply_pincfgs(codec
, pincfgs
);
5561 } else if (action
== HDA_FIXUP_ACT_INIT
) {
5562 /* Enable DOCK device */
5563 snd_hda_codec_write(codec
, 0x17, 0,
5564 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5565 /* Enable DOCK device */
5566 snd_hda_codec_write(codec
, 0x19, 0,
5567 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5571 static void alc_fixup_tpt470_dacs(struct hda_codec
*codec
,
5572 const struct hda_fixup
*fix
, int action
)
5574 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5575 * the speaker output becomes too low by some reason on Thinkpads with
5578 static const hda_nid_t preferred_pairs
[] = {
5579 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5582 struct alc_spec
*spec
= codec
->spec
;
5584 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5585 spec
->gen
.preferred_dacs
= preferred_pairs
;
5588 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
5590 struct alc_spec
*spec
= codec
->spec
;
5591 int hp_pin
= alc_get_hp_pin(spec
);
5593 /* Prevent pop noises when headphones are plugged in */
5594 snd_hda_codec_write(codec
, hp_pin
, 0,
5595 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5599 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
5600 const struct hda_fixup
*fix
, int action
)
5602 struct alc_spec
*spec
= codec
->spec
;
5603 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
5607 case HDA_FIXUP_ACT_PRE_PROBE
:
5608 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5609 * it causes a click noise at start up
5611 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5612 spec
->shutup
= alc_shutup_dell_xps13
;
5614 case HDA_FIXUP_ACT_PROBE
:
5615 /* Make the internal mic the default input source. */
5616 for (i
= 0; i
< imux
->num_items
; i
++) {
5617 if (spec
->gen
.imux_pins
[i
] == 0x12) {
5618 spec
->gen
.cur_mux
[0] = i
;
5626 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
5627 const struct hda_fixup
*fix
, int action
)
5629 struct alc_spec
*spec
= codec
->spec
;
5631 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5632 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5633 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
5635 /* Disable boost for mic-in permanently. (This code is only called
5636 from quirks that guarantee that the headphone is at NID 0x1b.) */
5637 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
5638 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
5640 alc_fixup_headset_mode(codec
, fix
, action
);
5643 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
5644 const struct hda_fixup
*fix
, int action
)
5646 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5647 alc_write_coef_idx(codec
, 0xc4, 0x8000);
5648 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
5649 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
5651 alc_fixup_headset_mode(codec
, fix
, action
);
5654 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5655 static int find_ext_mic_pin(struct hda_codec
*codec
)
5657 struct alc_spec
*spec
= codec
->spec
;
5658 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5660 unsigned int defcfg
;
5663 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5664 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5666 nid
= cfg
->inputs
[i
].pin
;
5667 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5668 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
5676 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
5677 const struct hda_fixup
*fix
,
5680 struct alc_spec
*spec
= codec
->spec
;
5682 if (action
== HDA_FIXUP_ACT_PROBE
) {
5683 int mic_pin
= find_ext_mic_pin(codec
);
5684 int hp_pin
= alc_get_hp_pin(spec
);
5686 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
5688 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
5692 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
5693 const struct hda_fixup
*fix
,
5696 struct alc_spec
*spec
= codec
->spec
;
5697 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5700 /* The mic boosts on level 2 and 3 are too noisy
5701 on the internal mic input.
5702 Therefore limit the boost to 0 or 1. */
5704 if (action
!= HDA_FIXUP_ACT_PROBE
)
5707 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5708 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5709 unsigned int defcfg
;
5710 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5712 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5713 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
5716 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
5717 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
5718 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5719 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5720 (0 << AC_AMPCAP_MUTE_SHIFT
));
5724 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
5725 struct hda_jack_callback
*jack
)
5727 struct alc_spec
*spec
= codec
->spec
;
5731 snd_hda_gen_hp_automute(codec
, jack
);
5733 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
5736 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5740 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
5741 const struct hda_fixup
*fix
, int action
)
5743 struct alc_spec
*spec
= codec
->spec
;
5746 case HDA_FIXUP_ACT_PRE_PROBE
:
5747 snd_hda_override_wcaps(codec
, 0x03, 0);
5748 /* Disable AA-loopback as it causes white noise */
5749 spec
->gen
.mixer_nid
= 0;
5751 case HDA_FIXUP_ACT_INIT
:
5752 /* MIC2-VREF control */
5753 /* Set to manual mode */
5754 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5755 /* Enable Line1 input control by verb */
5756 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
5761 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
5762 const struct hda_fixup
*fix
, int action
)
5764 struct alc_spec
*spec
= codec
->spec
;
5767 case HDA_FIXUP_ACT_PRE_PROBE
:
5768 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
5770 case HDA_FIXUP_ACT_INIT
:
5771 /* MIC2-VREF control */
5772 /* Set to manual mode */
5773 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5778 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5779 static void asus_tx300_automute(struct hda_codec
*codec
)
5781 struct alc_spec
*spec
= codec
->spec
;
5782 snd_hda_gen_update_outputs(codec
);
5783 if (snd_hda_jack_detect(codec
, 0x1b))
5784 spec
->gen
.mute_bits
|= (1ULL << 0x14);
5787 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
5788 const struct hda_fixup
*fix
, int action
)
5790 struct alc_spec
*spec
= codec
->spec
;
5791 static const struct hda_pintbl dock_pins
[] = {
5792 { 0x1b, 0x21114000 }, /* dock speaker pin */
5797 case HDA_FIXUP_ACT_PRE_PROBE
:
5798 spec
->init_amp
= ALC_INIT_DEFAULT
;
5799 /* TX300 needs to set up GPIO2 for the speaker amp */
5800 alc_setup_gpio(codec
, 0x04);
5801 snd_hda_apply_pincfgs(codec
, dock_pins
);
5802 spec
->gen
.auto_mute_via_amp
= 1;
5803 spec
->gen
.automute_hook
= asus_tx300_automute
;
5804 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
5805 snd_hda_gen_hp_automute
);
5807 case HDA_FIXUP_ACT_PROBE
:
5808 spec
->init_amp
= ALC_INIT_DEFAULT
;
5810 case HDA_FIXUP_ACT_BUILD
:
5811 /* this is a bit tricky; give more sane names for the main
5812 * (tablet) speaker and the dock speaker, respectively
5814 rename_ctl(codec
, "Speaker Playback Switch",
5815 "Dock Speaker Playback Switch");
5816 rename_ctl(codec
, "Bass Speaker Playback Switch",
5817 "Speaker Playback Switch");
5822 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
5823 const struct hda_fixup
*fix
, int action
)
5825 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5826 /* DAC node 0x03 is giving mono output. We therefore want to
5827 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5828 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5829 static const hda_nid_t conn1
[] = { 0x0c };
5830 snd_hda_override_conn_list(codec
, 0x14, ARRAY_SIZE(conn1
), conn1
);
5831 snd_hda_override_conn_list(codec
, 0x15, ARRAY_SIZE(conn1
), conn1
);
5835 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
5836 const struct hda_fixup
*fix
, int action
)
5838 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5839 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5840 we can't adjust the speaker's volume since this node does not has
5841 Amp-out capability. we change the speaker's route to:
5842 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5843 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5844 speaker's volume now. */
5846 static const hda_nid_t conn1
[] = { 0x0c };
5847 snd_hda_override_conn_list(codec
, 0x17, ARRAY_SIZE(conn1
), conn1
);
5851 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5852 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
5853 const struct hda_fixup
*fix
, int action
)
5855 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5856 static const hda_nid_t conn
[] = { 0x02, 0x03 };
5857 snd_hda_override_conn_list(codec
, 0x17, ARRAY_SIZE(conn
), conn
);
5861 /* force NID 0x17 (Bass Speaker) to DAC1 to share it with the main speaker */
5862 static void alc285_fixup_speaker2_to_dac1(struct hda_codec
*codec
,
5863 const struct hda_fixup
*fix
, int action
)
5865 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5866 static const hda_nid_t conn
[] = { 0x02 };
5867 snd_hda_override_conn_list(codec
, 0x17, ARRAY_SIZE(conn
), conn
);
5871 /* Hook to update amp GPIO4 for automute */
5872 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
5873 struct hda_jack_callback
*jack
)
5875 struct alc_spec
*spec
= codec
->spec
;
5877 snd_hda_gen_hp_automute(codec
, jack
);
5878 /* mute_led_polarity is set to 0, so we pass inverted value here */
5879 alc_update_gpio_led(codec
, 0x10, spec
->mute_led_polarity
,
5880 !spec
->gen
.hp_jack_present
);
5883 /* Manage GPIOs for HP EliteBook Folio 9480m.
5885 * GPIO4 is the headphone amplifier power control
5886 * GPIO3 is the audio output mute indicator LED
5889 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5890 const struct hda_fixup
*fix
,
5893 struct alc_spec
*spec
= codec
->spec
;
5895 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0);
5896 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5897 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5898 spec
->gpio_mask
|= 0x10;
5899 spec
->gpio_dir
|= 0x10;
5900 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5904 static void alc275_fixup_gpio4_off(struct hda_codec
*codec
,
5905 const struct hda_fixup
*fix
,
5908 struct alc_spec
*spec
= codec
->spec
;
5910 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5911 spec
->gpio_mask
|= 0x04;
5912 spec
->gpio_dir
|= 0x04;
5913 /* set data bit low */
5917 /* Quirk for Thinkpad X1 7th and 8th Gen
5918 * The following fixed routing needed
5919 * DAC1 (NID 0x02) -> Speaker (NID 0x14); some eq applied secretly
5920 * DAC2 (NID 0x03) -> Bass (NID 0x17) & Headphone (NID 0x21); sharing a DAC
5921 * DAC3 (NID 0x06) -> Unused, due to the lack of volume amp
5923 static void alc285_fixup_thinkpad_x1_gen7(struct hda_codec
*codec
,
5924 const struct hda_fixup
*fix
, int action
)
5926 static const hda_nid_t conn
[] = { 0x02, 0x03 }; /* exclude 0x06 */
5927 static const hda_nid_t preferred_pairs
[] = {
5928 0x14, 0x02, 0x17, 0x03, 0x21, 0x03, 0
5930 struct alc_spec
*spec
= codec
->spec
;
5933 case HDA_FIXUP_ACT_PRE_PROBE
:
5934 snd_hda_override_conn_list(codec
, 0x17, ARRAY_SIZE(conn
), conn
);
5935 spec
->gen
.preferred_dacs
= preferred_pairs
;
5937 case HDA_FIXUP_ACT_BUILD
:
5938 /* The generic parser creates somewhat unintuitive volume ctls
5939 * with the fixed routing above, and the shared DAC2 may be
5941 * Rename those to unique names so that PA doesn't touch them
5942 * and use only Master volume.
5944 rename_ctl(codec
, "Front Playback Volume", "DAC1 Playback Volume");
5945 rename_ctl(codec
, "Bass Speaker Playback Volume", "DAC2 Playback Volume");
5950 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5951 const struct hda_fixup
*fix
,
5954 alc_fixup_dual_codecs(codec
, fix
, action
);
5956 case HDA_FIXUP_ACT_PRE_PROBE
:
5957 /* override card longname to provide a unique UCM profile */
5958 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5960 case HDA_FIXUP_ACT_BUILD
:
5961 /* rename Capture controls depending on the codec */
5962 rename_ctl(codec
, "Capture Volume",
5964 "Rear-Panel Capture Volume" :
5965 "Front-Panel Capture Volume");
5966 rename_ctl(codec
, "Capture Switch",
5968 "Rear-Panel Capture Switch" :
5969 "Front-Panel Capture Switch");
5974 static void alc225_fixup_s3_pop_noise(struct hda_codec
*codec
,
5975 const struct hda_fixup
*fix
, int action
)
5977 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5980 codec
->power_save_node
= 1;
5983 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5984 static void alc274_fixup_bind_dacs(struct hda_codec
*codec
,
5985 const struct hda_fixup
*fix
, int action
)
5987 struct alc_spec
*spec
= codec
->spec
;
5988 static const hda_nid_t preferred_pairs
[] = {
5989 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5993 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5996 spec
->gen
.preferred_dacs
= preferred_pairs
;
5997 spec
->gen
.auto_mute_via_amp
= 1;
5998 codec
->power_save_node
= 0;
6001 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
6002 static void alc285_fixup_invalidate_dacs(struct hda_codec
*codec
,
6003 const struct hda_fixup
*fix
, int action
)
6005 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
6008 snd_hda_override_wcaps(codec
, 0x03, 0);
6011 static void alc295_fixup_chromebook(struct hda_codec
*codec
,
6012 const struct hda_fixup
*fix
, int action
)
6014 struct alc_spec
*spec
= codec
->spec
;
6017 case HDA_FIXUP_ACT_PRE_PROBE
:
6018 spec
->ultra_low_power
= true;
6020 case HDA_FIXUP_ACT_INIT
:
6021 switch (codec
->core
.vendor_id
) {
6023 alc_update_coef_idx(codec
, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
6024 alc_update_coef_idx(codec
, 0x4a, 0x8000, 0 << 15);
6027 alc_update_coef_idx(codec
, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
6028 alc_update_coef_idx(codec
, 0x1b, 0x8000, 0 << 15);
6035 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
6036 const struct hda_fixup
*fix
, int action
)
6038 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
6039 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
6043 static void alc294_gx502_toggle_output(struct hda_codec
*codec
,
6044 struct hda_jack_callback
*cb
)
6046 /* The Windows driver sets the codec up in a very different way where
6047 * it appears to leave 0x10 = 0x8a20 set. For Linux we need to toggle it
6049 if (snd_hda_jack_detect_state(codec
, 0x21) == HDA_JACK_PRESENT
)
6050 alc_write_coef_idx(codec
, 0x10, 0x8a20);
6052 alc_write_coef_idx(codec
, 0x10, 0x0a20);
6055 static void alc294_fixup_gx502_hp(struct hda_codec
*codec
,
6056 const struct hda_fixup
*fix
, int action
)
6058 /* Pin 0x21: headphones/headset mic */
6059 if (!is_jack_detectable(codec
, 0x21))
6063 case HDA_FIXUP_ACT_PRE_PROBE
:
6064 snd_hda_jack_detect_enable_callback(codec
, 0x21,
6065 alc294_gx502_toggle_output
);
6067 case HDA_FIXUP_ACT_INIT
:
6068 /* Make sure to start in a correct state, i.e. if
6069 * headphones have been plugged in before powering up the system
6071 alc294_gx502_toggle_output(codec
, NULL
);
6076 static void alc285_fixup_hp_gpio_amp_init(struct hda_codec
*codec
,
6077 const struct hda_fixup
*fix
, int action
)
6079 if (action
!= HDA_FIXUP_ACT_INIT
)
6083 alc_write_coef_idx(codec
, 0x65, 0x0);
6086 /* for hda_fixup_thinkpad_acpi() */
6087 #include "thinkpad_helper.c"
6089 static void alc_fixup_thinkpad_acpi(struct hda_codec
*codec
,
6090 const struct hda_fixup
*fix
, int action
)
6092 alc_fixup_no_shutup(codec
, fix
, action
); /* reduce click noise */
6093 hda_fixup_thinkpad_acpi(codec
, fix
, action
);
6096 /* for alc295_fixup_hp_top_speakers */
6097 #include "hp_x360_helper.c"
6101 ALC269_FIXUP_SONY_VAIO
,
6102 ALC275_FIXUP_SONY_VAIO_GPIO2
,
6103 ALC269_FIXUP_DELL_M101Z
,
6104 ALC269_FIXUP_SKU_IGNORE
,
6105 ALC269_FIXUP_ASUS_G73JW
,
6106 ALC269_FIXUP_LENOVO_EAPD
,
6107 ALC275_FIXUP_SONY_HWEQ
,
6108 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
6110 ALC269_FIXUP_PCM_44K
,
6111 ALC269_FIXUP_STEREO_DMIC
,
6112 ALC269_FIXUP_HEADSET_MIC
,
6113 ALC269_FIXUP_QUANTA_MUTE
,
6114 ALC269_FIXUP_LIFEBOOK
,
6115 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
6116 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
6117 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
6118 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
6121 ALC269VB_FIXUP_AMIC
,
6122 ALC269VB_FIXUP_DMIC
,
6123 ALC269_FIXUP_HP_MUTE_LED
,
6124 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6125 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
6126 ALC269_FIXUP_HP_MUTE_LED_MIC3
,
6127 ALC269_FIXUP_HP_GPIO_LED
,
6128 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
6129 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
6130 ALC269_FIXUP_INV_DMIC
,
6131 ALC269_FIXUP_LENOVO_DOCK
,
6132 ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
,
6133 ALC269_FIXUP_NO_SHUTUP
,
6134 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
6135 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
6136 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6137 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
6138 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6139 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
6140 ALC269_FIXUP_HEADSET_MODE
,
6141 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
6142 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
6143 ALC269_FIXUP_ASUS_X101_FUNC
,
6144 ALC269_FIXUP_ASUS_X101_VERB
,
6145 ALC269_FIXUP_ASUS_X101
,
6146 ALC271_FIXUP_AMIC_MIC2
,
6147 ALC271_FIXUP_HP_GATE_MIC_JACK
,
6148 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
6149 ALC269_FIXUP_ACER_AC700
,
6150 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
6151 ALC269VB_FIXUP_ASUS_ZENBOOK
,
6152 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
6153 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
6154 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
6155 ALC283_FIXUP_CHROME_BOOK
,
6156 ALC283_FIXUP_SENSE_COMBO_JACK
,
6157 ALC282_FIXUP_ASUS_TX300
,
6158 ALC283_FIXUP_INT_MIC
,
6159 ALC290_FIXUP_MONO_SPEAKERS
,
6160 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6161 ALC290_FIXUP_SUBWOOFER
,
6162 ALC290_FIXUP_SUBWOOFER_HSJACK
,
6163 ALC269_FIXUP_THINKPAD_ACPI
,
6164 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
6165 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
6166 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6167 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6168 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
6169 ALC255_FIXUP_HEADSET_MODE
,
6170 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
6171 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
6172 ALC292_FIXUP_TPT440_DOCK
,
6173 ALC292_FIXUP_TPT440
,
6174 ALC283_FIXUP_HEADSET_MIC
,
6175 ALC255_FIXUP_MIC_MUTE_LED
,
6176 ALC282_FIXUP_ASPIRE_V5_PINS
,
6177 ALC280_FIXUP_HP_GPIO4
,
6178 ALC286_FIXUP_HP_GPIO_LED
,
6179 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
6180 ALC280_FIXUP_HP_DOCK_PINS
,
6181 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
6182 ALC280_FIXUP_HP_9480M
,
6183 ALC288_FIXUP_DELL_HEADSET_MODE
,
6184 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
6185 ALC288_FIXUP_DELL_XPS_13
,
6186 ALC288_FIXUP_DISABLE_AAMIX
,
6187 ALC292_FIXUP_DELL_E7X_AAMIX
,
6188 ALC292_FIXUP_DELL_E7X
,
6189 ALC292_FIXUP_DISABLE_AAMIX
,
6190 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
6191 ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE
,
6192 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6193 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
6194 ALC275_FIXUP_DELL_XPS
,
6195 ALC293_FIXUP_LENOVO_SPK_NOISE
,
6196 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
6197 ALC255_FIXUP_DELL_SPK_NOISE
,
6198 ALC225_FIXUP_DISABLE_MIC_VREF
,
6199 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6200 ALC295_FIXUP_DISABLE_DAC3
,
6201 ALC285_FIXUP_SPEAKER2_TO_DAC1
,
6202 ALC280_FIXUP_HP_HEADSET_MIC
,
6203 ALC221_FIXUP_HP_FRONT_MIC
,
6204 ALC292_FIXUP_TPT460
,
6205 ALC298_FIXUP_SPK_VOLUME
,
6206 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
6207 ALC269_FIXUP_ATIV_BOOK_8
,
6208 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
6209 ALC256_FIXUP_ASUS_HEADSET_MODE
,
6210 ALC256_FIXUP_ASUS_MIC
,
6211 ALC256_FIXUP_ASUS_AIO_GPIO2
,
6212 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
6213 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
6214 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
6215 ALC233_FIXUP_ACER_HEADSET_MIC
,
6216 ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6217 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
,
6218 ALC225_FIXUP_S3_POP_NOISE
,
6219 ALC700_FIXUP_INTEL_REFERENCE
,
6220 ALC274_FIXUP_DELL_BIND_DACS
,
6221 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
6222 ALC298_FIXUP_TPT470_DOCK_FIX
,
6223 ALC298_FIXUP_TPT470_DOCK
,
6224 ALC255_FIXUP_DUMMY_LINEOUT_VERB
,
6225 ALC255_FIXUP_DELL_HEADSET_MIC
,
6226 ALC256_FIXUP_HUAWEI_MACH_WX9_PINS
,
6227 ALC298_FIXUP_HUAWEI_MBX_STEREO
,
6228 ALC295_FIXUP_HP_X360
,
6229 ALC221_FIXUP_HP_HEADSET_MIC
,
6230 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
,
6231 ALC295_FIXUP_HP_AUTO_MUTE
,
6232 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
6233 ALC294_FIXUP_ASUS_MIC
,
6234 ALC294_FIXUP_ASUS_HEADSET_MIC
,
6235 ALC294_FIXUP_ASUS_SPK
,
6236 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
,
6237 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
6238 ALC255_FIXUP_ACER_HEADSET_MIC
,
6239 ALC295_FIXUP_CHROME_BOOK
,
6240 ALC225_FIXUP_HEADSET_JACK
,
6241 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
,
6242 ALC225_FIXUP_WYSE_AUTO_MUTE
,
6243 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
,
6244 ALC286_FIXUP_ACER_AIO_HEADSET_MIC
,
6245 ALC256_FIXUP_ASUS_HEADSET_MIC
,
6246 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
6247 ALC299_FIXUP_PREDATOR_SPK
,
6248 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
,
6249 ALC289_FIXUP_DELL_SPK2
,
6250 ALC289_FIXUP_DUAL_SPK
,
6251 ALC294_FIXUP_SPK2_TO_DAC1
,
6252 ALC294_FIXUP_ASUS_DUAL_SPK
,
6253 ALC285_FIXUP_THINKPAD_X1_GEN7
,
6254 ALC285_FIXUP_THINKPAD_HEADSET_JACK
,
6255 ALC294_FIXUP_ASUS_HPE
,
6256 ALC294_FIXUP_ASUS_COEF_1B
,
6257 ALC294_FIXUP_ASUS_GX502_HP
,
6258 ALC294_FIXUP_ASUS_GX502_PINS
,
6259 ALC294_FIXUP_ASUS_GX502_VERBS
,
6260 ALC285_FIXUP_HP_GPIO_LED
,
6261 ALC285_FIXUP_HP_MUTE_LED
,
6262 ALC236_FIXUP_HP_MUTE_LED
,
6263 ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
,
6264 ALC295_FIXUP_ASUS_MIC_NO_PRESENCE
,
6265 ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS
,
6266 ALC269VC_FIXUP_ACER_HEADSET_MIC
,
6267 ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE
,
6268 ALC289_FIXUP_ASUS_GA401
,
6269 ALC289_FIXUP_ASUS_GA502
,
6270 ALC256_FIXUP_ACER_MIC_NO_PRESENCE
,
6271 ALC285_FIXUP_HP_GPIO_AMP_INIT
,
6272 ALC269_FIXUP_CZC_B20
,
6273 ALC269_FIXUP_CZC_TMI
,
6274 ALC269_FIXUP_CZC_L101
,
6275 ALC269_FIXUP_LEMOTE_A1802
,
6276 ALC269_FIXUP_LEMOTE_A190X
,
6277 ALC256_FIXUP_INTEL_NUC8_RUGGED
,
6278 ALC255_FIXUP_XIAOMI_HEADSET_MIC
,
6279 ALC274_FIXUP_HP_MIC
,
6282 static const struct hda_fixup alc269_fixups
[] = {
6283 [ALC269_FIXUP_GPIO2
] = {
6284 .type
= HDA_FIXUP_FUNC
,
6285 .v
.func
= alc_fixup_gpio2
,
6287 [ALC269_FIXUP_SONY_VAIO
] = {
6288 .type
= HDA_FIXUP_PINCTLS
,
6289 .v
.pins
= (const struct hda_pintbl
[]) {
6290 {0x19, PIN_VREFGRD
},
6294 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
6295 .type
= HDA_FIXUP_FUNC
,
6296 .v
.func
= alc275_fixup_gpio4_off
,
6298 .chain_id
= ALC269_FIXUP_SONY_VAIO
6300 [ALC269_FIXUP_DELL_M101Z
] = {
6301 .type
= HDA_FIXUP_VERBS
,
6302 .v
.verbs
= (const struct hda_verb
[]) {
6303 /* Enables internal speaker */
6304 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
6305 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
6309 [ALC269_FIXUP_SKU_IGNORE
] = {
6310 .type
= HDA_FIXUP_FUNC
,
6311 .v
.func
= alc_fixup_sku_ignore
,
6313 [ALC269_FIXUP_ASUS_G73JW
] = {
6314 .type
= HDA_FIXUP_PINS
,
6315 .v
.pins
= (const struct hda_pintbl
[]) {
6316 { 0x17, 0x99130111 }, /* subwoofer */
6320 [ALC269_FIXUP_LENOVO_EAPD
] = {
6321 .type
= HDA_FIXUP_VERBS
,
6322 .v
.verbs
= (const struct hda_verb
[]) {
6323 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
6327 [ALC275_FIXUP_SONY_HWEQ
] = {
6328 .type
= HDA_FIXUP_FUNC
,
6329 .v
.func
= alc269_fixup_hweq
,
6331 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
6333 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
6334 .type
= HDA_FIXUP_FUNC
,
6335 .v
.func
= alc_fixup_disable_aamix
,
6337 .chain_id
= ALC269_FIXUP_SONY_VAIO
6339 [ALC271_FIXUP_DMIC
] = {
6340 .type
= HDA_FIXUP_FUNC
,
6341 .v
.func
= alc271_fixup_dmic
,
6343 [ALC269_FIXUP_PCM_44K
] = {
6344 .type
= HDA_FIXUP_FUNC
,
6345 .v
.func
= alc269_fixup_pcm_44k
,
6347 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
6349 [ALC269_FIXUP_STEREO_DMIC
] = {
6350 .type
= HDA_FIXUP_FUNC
,
6351 .v
.func
= alc269_fixup_stereo_dmic
,
6353 [ALC269_FIXUP_HEADSET_MIC
] = {
6354 .type
= HDA_FIXUP_FUNC
,
6355 .v
.func
= alc269_fixup_headset_mic
,
6357 [ALC269_FIXUP_QUANTA_MUTE
] = {
6358 .type
= HDA_FIXUP_FUNC
,
6359 .v
.func
= alc269_fixup_quanta_mute
,
6361 [ALC269_FIXUP_LIFEBOOK
] = {
6362 .type
= HDA_FIXUP_PINS
,
6363 .v
.pins
= (const struct hda_pintbl
[]) {
6364 { 0x1a, 0x2101103f }, /* dock line-out */
6365 { 0x1b, 0x23a11040 }, /* dock mic-in */
6369 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
6371 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
6372 .type
= HDA_FIXUP_PINS
,
6373 .v
.pins
= (const struct hda_pintbl
[]) {
6374 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
6378 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
6379 .type
= HDA_FIXUP_PINS
,
6380 .v
.pins
= (const struct hda_pintbl
[]) {
6381 { 0x21, 0x0221102f }, /* HP out */
6385 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
6386 .type
= HDA_FIXUP_FUNC
,
6387 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
6389 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
6390 .type
= HDA_FIXUP_FUNC
,
6391 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
6393 [ALC269_FIXUP_AMIC
] = {
6394 .type
= HDA_FIXUP_PINS
,
6395 .v
.pins
= (const struct hda_pintbl
[]) {
6396 { 0x14, 0x99130110 }, /* speaker */
6397 { 0x15, 0x0121401f }, /* HP out */
6398 { 0x18, 0x01a19c20 }, /* mic */
6399 { 0x19, 0x99a3092f }, /* int-mic */
6403 [ALC269_FIXUP_DMIC
] = {
6404 .type
= HDA_FIXUP_PINS
,
6405 .v
.pins
= (const struct hda_pintbl
[]) {
6406 { 0x12, 0x99a3092f }, /* int-mic */
6407 { 0x14, 0x99130110 }, /* speaker */
6408 { 0x15, 0x0121401f }, /* HP out */
6409 { 0x18, 0x01a19c20 }, /* mic */
6413 [ALC269VB_FIXUP_AMIC
] = {
6414 .type
= HDA_FIXUP_PINS
,
6415 .v
.pins
= (const struct hda_pintbl
[]) {
6416 { 0x14, 0x99130110 }, /* speaker */
6417 { 0x18, 0x01a19c20 }, /* mic */
6418 { 0x19, 0x99a3092f }, /* int-mic */
6419 { 0x21, 0x0121401f }, /* HP out */
6423 [ALC269VB_FIXUP_DMIC
] = {
6424 .type
= HDA_FIXUP_PINS
,
6425 .v
.pins
= (const struct hda_pintbl
[]) {
6426 { 0x12, 0x99a3092f }, /* int-mic */
6427 { 0x14, 0x99130110 }, /* speaker */
6428 { 0x18, 0x01a19c20 }, /* mic */
6429 { 0x21, 0x0121401f }, /* HP out */
6433 [ALC269_FIXUP_HP_MUTE_LED
] = {
6434 .type
= HDA_FIXUP_FUNC
,
6435 .v
.func
= alc269_fixup_hp_mute_led
,
6437 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
6438 .type
= HDA_FIXUP_FUNC
,
6439 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
6441 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
6442 .type
= HDA_FIXUP_FUNC
,
6443 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
6445 [ALC269_FIXUP_HP_MUTE_LED_MIC3
] = {
6446 .type
= HDA_FIXUP_FUNC
,
6447 .v
.func
= alc269_fixup_hp_mute_led_mic3
,
6449 .chain_id
= ALC295_FIXUP_HP_AUTO_MUTE
6451 [ALC269_FIXUP_HP_GPIO_LED
] = {
6452 .type
= HDA_FIXUP_FUNC
,
6453 .v
.func
= alc269_fixup_hp_gpio_led
,
6455 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
6456 .type
= HDA_FIXUP_FUNC
,
6457 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
6459 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
6460 .type
= HDA_FIXUP_FUNC
,
6461 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
6463 [ALC269_FIXUP_INV_DMIC
] = {
6464 .type
= HDA_FIXUP_FUNC
,
6465 .v
.func
= alc_fixup_inv_dmic
,
6467 [ALC269_FIXUP_NO_SHUTUP
] = {
6468 .type
= HDA_FIXUP_FUNC
,
6469 .v
.func
= alc_fixup_no_shutup
,
6471 [ALC269_FIXUP_LENOVO_DOCK
] = {
6472 .type
= HDA_FIXUP_PINS
,
6473 .v
.pins
= (const struct hda_pintbl
[]) {
6474 { 0x19, 0x23a11040 }, /* dock mic */
6475 { 0x1b, 0x2121103f }, /* dock headphone */
6479 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
6481 [ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
] = {
6482 .type
= HDA_FIXUP_FUNC
,
6483 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6485 .chain_id
= ALC269_FIXUP_LENOVO_DOCK
,
6487 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
6488 .type
= HDA_FIXUP_FUNC
,
6489 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
6491 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6493 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6494 .type
= HDA_FIXUP_PINS
,
6495 .v
.pins
= (const struct hda_pintbl
[]) {
6496 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6497 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6501 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6503 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6504 .type
= HDA_FIXUP_PINS
,
6505 .v
.pins
= (const struct hda_pintbl
[]) {
6506 { 0x16, 0x21014020 }, /* dock line out */
6507 { 0x19, 0x21a19030 }, /* dock mic */
6508 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6512 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6514 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
6515 .type
= HDA_FIXUP_PINS
,
6516 .v
.pins
= (const struct hda_pintbl
[]) {
6517 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6521 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6523 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
6524 .type
= HDA_FIXUP_PINS
,
6525 .v
.pins
= (const struct hda_pintbl
[]) {
6526 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6527 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6531 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6533 [ALC269_FIXUP_HEADSET_MODE
] = {
6534 .type
= HDA_FIXUP_FUNC
,
6535 .v
.func
= alc_fixup_headset_mode
,
6537 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6539 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6540 .type
= HDA_FIXUP_FUNC
,
6541 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
6543 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
6544 .type
= HDA_FIXUP_PINS
,
6545 .v
.pins
= (const struct hda_pintbl
[]) {
6546 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6550 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
6552 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
6553 .type
= HDA_FIXUP_PINS
,
6554 .v
.pins
= (const struct hda_pintbl
[]) {
6555 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6559 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6561 [ALC256_FIXUP_HUAWEI_MACH_WX9_PINS
] = {
6562 .type
= HDA_FIXUP_PINS
,
6563 .v
.pins
= (const struct hda_pintbl
[]) {
6577 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6579 [ALC298_FIXUP_HUAWEI_MBX_STEREO
] = {
6580 .type
= HDA_FIXUP_FUNC
,
6581 .v
.func
= alc298_fixup_huawei_mbx_stereo
,
6583 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6585 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
6586 .type
= HDA_FIXUP_FUNC
,
6587 .v
.func
= alc269_fixup_x101_headset_mic
,
6589 [ALC269_FIXUP_ASUS_X101_VERB
] = {
6590 .type
= HDA_FIXUP_VERBS
,
6591 .v
.verbs
= (const struct hda_verb
[]) {
6592 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6593 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
6594 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
6598 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
6600 [ALC269_FIXUP_ASUS_X101
] = {
6601 .type
= HDA_FIXUP_PINS
,
6602 .v
.pins
= (const struct hda_pintbl
[]) {
6603 { 0x18, 0x04a1182c }, /* Headset mic */
6607 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
6609 [ALC271_FIXUP_AMIC_MIC2
] = {
6610 .type
= HDA_FIXUP_PINS
,
6611 .v
.pins
= (const struct hda_pintbl
[]) {
6612 { 0x14, 0x99130110 }, /* speaker */
6613 { 0x19, 0x01a19c20 }, /* mic */
6614 { 0x1b, 0x99a7012f }, /* int-mic */
6615 { 0x21, 0x0121401f }, /* HP out */
6619 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
6620 .type
= HDA_FIXUP_FUNC
,
6621 .v
.func
= alc271_hp_gate_mic_jack
,
6623 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
6625 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
6626 .type
= HDA_FIXUP_FUNC
,
6627 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6629 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
6631 [ALC269_FIXUP_ACER_AC700
] = {
6632 .type
= HDA_FIXUP_PINS
,
6633 .v
.pins
= (const struct hda_pintbl
[]) {
6634 { 0x12, 0x99a3092f }, /* int-mic */
6635 { 0x14, 0x99130110 }, /* speaker */
6636 { 0x18, 0x03a11c20 }, /* mic */
6637 { 0x1e, 0x0346101e }, /* SPDIF1 */
6638 { 0x21, 0x0321101f }, /* HP out */
6642 .chain_id
= ALC271_FIXUP_DMIC
,
6644 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
6645 .type
= HDA_FIXUP_FUNC
,
6646 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6648 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6650 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
6651 .type
= HDA_FIXUP_FUNC
,
6652 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6654 .chain_id
= ALC269VB_FIXUP_DMIC
,
6656 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
6657 .type
= HDA_FIXUP_VERBS
,
6658 .v
.verbs
= (const struct hda_verb
[]) {
6659 /* class-D output amp +5dB */
6660 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
6661 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
6665 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
6667 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
6668 .type
= HDA_FIXUP_FUNC
,
6669 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6671 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6673 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
6674 .type
= HDA_FIXUP_PINS
,
6675 .v
.pins
= (const struct hda_pintbl
[]) {
6676 { 0x12, 0x99a3092f }, /* int-mic */
6677 { 0x18, 0x03a11d20 }, /* mic */
6678 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6682 [ALC283_FIXUP_CHROME_BOOK
] = {
6683 .type
= HDA_FIXUP_FUNC
,
6684 .v
.func
= alc283_fixup_chromebook
,
6686 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
6687 .type
= HDA_FIXUP_FUNC
,
6688 .v
.func
= alc283_fixup_sense_combo_jack
,
6690 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
6692 [ALC282_FIXUP_ASUS_TX300
] = {
6693 .type
= HDA_FIXUP_FUNC
,
6694 .v
.func
= alc282_fixup_asus_tx300
,
6696 [ALC283_FIXUP_INT_MIC
] = {
6697 .type
= HDA_FIXUP_VERBS
,
6698 .v
.verbs
= (const struct hda_verb
[]) {
6699 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
6700 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
6704 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6706 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
6707 .type
= HDA_FIXUP_PINS
,
6708 .v
.pins
= (const struct hda_pintbl
[]) {
6709 { 0x17, 0x90170112 }, /* subwoofer */
6713 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6715 [ALC290_FIXUP_SUBWOOFER
] = {
6716 .type
= HDA_FIXUP_PINS
,
6717 .v
.pins
= (const struct hda_pintbl
[]) {
6718 { 0x17, 0x90170112 }, /* subwoofer */
6722 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
6724 [ALC290_FIXUP_MONO_SPEAKERS
] = {
6725 .type
= HDA_FIXUP_FUNC
,
6726 .v
.func
= alc290_fixup_mono_speakers
,
6728 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
6729 .type
= HDA_FIXUP_FUNC
,
6730 .v
.func
= alc290_fixup_mono_speakers
,
6732 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6734 [ALC269_FIXUP_THINKPAD_ACPI
] = {
6735 .type
= HDA_FIXUP_FUNC
,
6736 .v
.func
= alc_fixup_thinkpad_acpi
,
6738 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
6740 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
6741 .type
= HDA_FIXUP_FUNC
,
6742 .v
.func
= alc_fixup_inv_dmic
,
6744 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6746 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
6747 .type
= HDA_FIXUP_PINS
,
6748 .v
.pins
= (const struct hda_pintbl
[]) {
6749 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6753 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6755 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6756 .type
= HDA_FIXUP_PINS
,
6757 .v
.pins
= (const struct hda_pintbl
[]) {
6758 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6762 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6764 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6765 .type
= HDA_FIXUP_PINS
,
6766 .v
.pins
= (const struct hda_pintbl
[]) {
6767 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6768 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6772 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6774 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6775 .type
= HDA_FIXUP_PINS
,
6776 .v
.pins
= (const struct hda_pintbl
[]) {
6777 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6781 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6783 [ALC255_FIXUP_HEADSET_MODE
] = {
6784 .type
= HDA_FIXUP_FUNC
,
6785 .v
.func
= alc_fixup_headset_mode_alc255
,
6787 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6789 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6790 .type
= HDA_FIXUP_FUNC
,
6791 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
6793 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6794 .type
= HDA_FIXUP_PINS
,
6795 .v
.pins
= (const struct hda_pintbl
[]) {
6796 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6797 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6801 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6803 [ALC292_FIXUP_TPT440_DOCK
] = {
6804 .type
= HDA_FIXUP_FUNC
,
6805 .v
.func
= alc_fixup_tpt440_dock
,
6807 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6809 [ALC292_FIXUP_TPT440
] = {
6810 .type
= HDA_FIXUP_FUNC
,
6811 .v
.func
= alc_fixup_disable_aamix
,
6813 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
6815 [ALC283_FIXUP_HEADSET_MIC
] = {
6816 .type
= HDA_FIXUP_PINS
,
6817 .v
.pins
= (const struct hda_pintbl
[]) {
6818 { 0x19, 0x04a110f0 },
6822 [ALC255_FIXUP_MIC_MUTE_LED
] = {
6823 .type
= HDA_FIXUP_FUNC
,
6824 .v
.func
= alc_fixup_micmute_led
,
6826 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
6827 .type
= HDA_FIXUP_PINS
,
6828 .v
.pins
= (const struct hda_pintbl
[]) {
6829 { 0x12, 0x90a60130 },
6830 { 0x14, 0x90170110 },
6831 { 0x17, 0x40000008 },
6832 { 0x18, 0x411111f0 },
6833 { 0x19, 0x01a1913c },
6834 { 0x1a, 0x411111f0 },
6835 { 0x1b, 0x411111f0 },
6836 { 0x1d, 0x40f89b2d },
6837 { 0x1e, 0x411111f0 },
6838 { 0x21, 0x0321101f },
6842 [ALC280_FIXUP_HP_GPIO4
] = {
6843 .type
= HDA_FIXUP_FUNC
,
6844 .v
.func
= alc280_fixup_hp_gpio4
,
6846 [ALC286_FIXUP_HP_GPIO_LED
] = {
6847 .type
= HDA_FIXUP_FUNC
,
6848 .v
.func
= alc286_fixup_hp_gpio_led
,
6850 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
6851 .type
= HDA_FIXUP_FUNC
,
6852 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
6854 [ALC280_FIXUP_HP_DOCK_PINS
] = {
6855 .type
= HDA_FIXUP_PINS
,
6856 .v
.pins
= (const struct hda_pintbl
[]) {
6857 { 0x1b, 0x21011020 }, /* line-out */
6858 { 0x1a, 0x01a1903c }, /* headset mic */
6859 { 0x18, 0x2181103f }, /* line-in */
6863 .chain_id
= ALC280_FIXUP_HP_GPIO4
6865 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
6866 .type
= HDA_FIXUP_PINS
,
6867 .v
.pins
= (const struct hda_pintbl
[]) {
6868 { 0x1b, 0x21011020 }, /* line-out */
6869 { 0x18, 0x2181103f }, /* line-in */
6873 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
6875 [ALC280_FIXUP_HP_9480M
] = {
6876 .type
= HDA_FIXUP_FUNC
,
6877 .v
.func
= alc280_fixup_hp_9480m
,
6879 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
6880 .type
= HDA_FIXUP_FUNC
,
6881 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
6883 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6885 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6886 .type
= HDA_FIXUP_PINS
,
6887 .v
.pins
= (const struct hda_pintbl
[]) {
6888 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6889 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6893 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
6895 [ALC288_FIXUP_DISABLE_AAMIX
] = {
6896 .type
= HDA_FIXUP_FUNC
,
6897 .v
.func
= alc_fixup_disable_aamix
,
6899 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6901 [ALC288_FIXUP_DELL_XPS_13
] = {
6902 .type
= HDA_FIXUP_FUNC
,
6903 .v
.func
= alc_fixup_dell_xps13
,
6905 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
6907 [ALC292_FIXUP_DISABLE_AAMIX
] = {
6908 .type
= HDA_FIXUP_FUNC
,
6909 .v
.func
= alc_fixup_disable_aamix
,
6911 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6913 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
6914 .type
= HDA_FIXUP_FUNC
,
6915 .v
.func
= alc_fixup_disable_aamix
,
6917 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6919 [ALC292_FIXUP_DELL_E7X_AAMIX
] = {
6920 .type
= HDA_FIXUP_FUNC
,
6921 .v
.func
= alc_fixup_dell_xps13
,
6923 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
6925 [ALC292_FIXUP_DELL_E7X
] = {
6926 .type
= HDA_FIXUP_FUNC
,
6927 .v
.func
= alc_fixup_micmute_led
,
6928 /* micmute fixup must be applied at last */
6929 .chained_before
= true,
6930 .chain_id
= ALC292_FIXUP_DELL_E7X_AAMIX
,
6932 [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE
] = {
6933 .type
= HDA_FIXUP_PINS
,
6934 .v
.pins
= (const struct hda_pintbl
[]) {
6935 { 0x18, 0x01a1913c }, /* headset mic w/o jack detect */
6938 .chained_before
= true,
6939 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
6941 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6942 .type
= HDA_FIXUP_PINS
,
6943 .v
.pins
= (const struct hda_pintbl
[]) {
6944 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6945 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6949 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6951 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
6952 .type
= HDA_FIXUP_PINS
,
6953 .v
.pins
= (const struct hda_pintbl
[]) {
6954 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6958 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6960 [ALC275_FIXUP_DELL_XPS
] = {
6961 .type
= HDA_FIXUP_VERBS
,
6962 .v
.verbs
= (const struct hda_verb
[]) {
6963 /* Enables internal speaker */
6964 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
6965 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
6966 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
6967 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
6971 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
6972 .type
= HDA_FIXUP_FUNC
,
6973 .v
.func
= alc_fixup_disable_aamix
,
6975 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6977 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
6978 .type
= HDA_FIXUP_FUNC
,
6979 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
6981 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
6982 .type
= HDA_FIXUP_FUNC
,
6983 .v
.func
= alc_fixup_disable_aamix
,
6985 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6987 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
6988 .type
= HDA_FIXUP_FUNC
,
6989 .v
.func
= alc_fixup_disable_mic_vref
,
6991 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6993 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6994 .type
= HDA_FIXUP_VERBS
,
6995 .v
.verbs
= (const struct hda_verb
[]) {
6996 /* Disable pass-through path for FRONT 14h */
6997 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6998 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
7002 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
7004 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
7005 .type
= HDA_FIXUP_FUNC
,
7006 .v
.func
= alc_fixup_disable_aamix
,
7008 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
7010 [ALC221_FIXUP_HP_FRONT_MIC
] = {
7011 .type
= HDA_FIXUP_PINS
,
7012 .v
.pins
= (const struct hda_pintbl
[]) {
7013 { 0x19, 0x02a19020 }, /* Front Mic */
7017 [ALC292_FIXUP_TPT460
] = {
7018 .type
= HDA_FIXUP_FUNC
,
7019 .v
.func
= alc_fixup_tpt440_dock
,
7021 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
7023 [ALC298_FIXUP_SPK_VOLUME
] = {
7024 .type
= HDA_FIXUP_FUNC
,
7025 .v
.func
= alc298_fixup_speaker_volume
,
7027 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
7029 [ALC295_FIXUP_DISABLE_DAC3
] = {
7030 .type
= HDA_FIXUP_FUNC
,
7031 .v
.func
= alc295_fixup_disable_dac3
,
7033 [ALC285_FIXUP_SPEAKER2_TO_DAC1
] = {
7034 .type
= HDA_FIXUP_FUNC
,
7035 .v
.func
= alc285_fixup_speaker2_to_dac1
,
7037 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
7039 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
7040 .type
= HDA_FIXUP_PINS
,
7041 .v
.pins
= (const struct hda_pintbl
[]) {
7042 { 0x1b, 0x90170151 },
7046 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7048 [ALC269_FIXUP_ATIV_BOOK_8
] = {
7049 .type
= HDA_FIXUP_FUNC
,
7050 .v
.func
= alc_fixup_auto_mute_via_amp
,
7052 .chain_id
= ALC269_FIXUP_NO_SHUTUP
7054 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
7055 .type
= HDA_FIXUP_PINS
,
7056 .v
.pins
= (const struct hda_pintbl
[]) {
7057 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7058 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
7062 .chain_id
= ALC269_FIXUP_HEADSET_MODE
7064 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
7065 .type
= HDA_FIXUP_FUNC
,
7066 .v
.func
= alc_fixup_headset_mode
,
7068 [ALC256_FIXUP_ASUS_MIC
] = {
7069 .type
= HDA_FIXUP_PINS
,
7070 .v
.pins
= (const struct hda_pintbl
[]) {
7071 { 0x13, 0x90a60160 }, /* use as internal mic */
7072 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7076 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
7078 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
7079 .type
= HDA_FIXUP_FUNC
,
7080 /* Set up GPIO2 for the speaker amp */
7081 .v
.func
= alc_fixup_gpio4
,
7083 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
7084 .type
= HDA_FIXUP_PINS
,
7085 .v
.pins
= (const struct hda_pintbl
[]) {
7086 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7090 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7092 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
7093 .type
= HDA_FIXUP_VERBS
,
7094 .v
.verbs
= (const struct hda_verb
[]) {
7095 /* Enables internal speaker */
7096 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
7097 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
7101 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7103 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
7104 .type
= HDA_FIXUP_FUNC
,
7105 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
7107 .chain_id
= ALC269_FIXUP_GPIO2
7109 [ALC233_FIXUP_ACER_HEADSET_MIC
] = {
7110 .type
= HDA_FIXUP_VERBS
,
7111 .v
.verbs
= (const struct hda_verb
[]) {
7112 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x45 },
7113 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5089 },
7117 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
7119 [ALC294_FIXUP_LENOVO_MIC_LOCATION
] = {
7120 .type
= HDA_FIXUP_PINS
,
7121 .v
.pins
= (const struct hda_pintbl
[]) {
7122 /* Change the mic location from front to right, otherwise there are
7123 two front mics with the same name, pulseaudio can't handle them.
7124 This is just a temporary workaround, after applying this fixup,
7125 there will be one "Front Mic" and one "Mic" in this machine.
7127 { 0x1a, 0x04a19040 },
7131 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
] = {
7132 .type
= HDA_FIXUP_PINS
,
7133 .v
.pins
= (const struct hda_pintbl
[]) {
7134 { 0x16, 0x0101102f }, /* Rear Headset HP */
7135 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
7136 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
7137 { 0x1b, 0x02011020 },
7141 .chain_id
= ALC225_FIXUP_S3_POP_NOISE
7143 [ALC225_FIXUP_S3_POP_NOISE
] = {
7144 .type
= HDA_FIXUP_FUNC
,
7145 .v
.func
= alc225_fixup_s3_pop_noise
,
7147 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7149 [ALC700_FIXUP_INTEL_REFERENCE
] = {
7150 .type
= HDA_FIXUP_VERBS
,
7151 .v
.verbs
= (const struct hda_verb
[]) {
7152 /* Enables internal speaker */
7153 {0x20, AC_VERB_SET_COEF_INDEX
, 0x45},
7154 {0x20, AC_VERB_SET_PROC_COEF
, 0x5289},
7155 {0x20, AC_VERB_SET_COEF_INDEX
, 0x4A},
7156 {0x20, AC_VERB_SET_PROC_COEF
, 0x001b},
7157 {0x58, AC_VERB_SET_COEF_INDEX
, 0x00},
7158 {0x58, AC_VERB_SET_PROC_COEF
, 0x3888},
7159 {0x20, AC_VERB_SET_COEF_INDEX
, 0x6f},
7160 {0x20, AC_VERB_SET_PROC_COEF
, 0x2c0b},
7164 [ALC274_FIXUP_DELL_BIND_DACS
] = {
7165 .type
= HDA_FIXUP_FUNC
,
7166 .v
.func
= alc274_fixup_bind_dacs
,
7168 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
7170 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
] = {
7171 .type
= HDA_FIXUP_PINS
,
7172 .v
.pins
= (const struct hda_pintbl
[]) {
7173 { 0x1b, 0x0401102f },
7177 .chain_id
= ALC274_FIXUP_DELL_BIND_DACS
7179 [ALC298_FIXUP_TPT470_DOCK_FIX
] = {
7180 .type
= HDA_FIXUP_FUNC
,
7181 .v
.func
= alc_fixup_tpt470_dock
,
7183 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
7185 [ALC298_FIXUP_TPT470_DOCK
] = {
7186 .type
= HDA_FIXUP_FUNC
,
7187 .v
.func
= alc_fixup_tpt470_dacs
,
7189 .chain_id
= ALC298_FIXUP_TPT470_DOCK_FIX
7191 [ALC255_FIXUP_DUMMY_LINEOUT_VERB
] = {
7192 .type
= HDA_FIXUP_PINS
,
7193 .v
.pins
= (const struct hda_pintbl
[]) {
7194 { 0x14, 0x0201101f },
7198 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
7200 [ALC255_FIXUP_DELL_HEADSET_MIC
] = {
7201 .type
= HDA_FIXUP_PINS
,
7202 .v
.pins
= (const struct hda_pintbl
[]) {
7203 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7207 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7209 [ALC295_FIXUP_HP_X360
] = {
7210 .type
= HDA_FIXUP_FUNC
,
7211 .v
.func
= alc295_fixup_hp_top_speakers
,
7213 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC3
7215 [ALC221_FIXUP_HP_HEADSET_MIC
] = {
7216 .type
= HDA_FIXUP_PINS
,
7217 .v
.pins
= (const struct hda_pintbl
[]) {
7218 { 0x19, 0x0181313f},
7222 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7224 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
] = {
7225 .type
= HDA_FIXUP_FUNC
,
7226 .v
.func
= alc285_fixup_invalidate_dacs
,
7228 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
7230 [ALC295_FIXUP_HP_AUTO_MUTE
] = {
7231 .type
= HDA_FIXUP_FUNC
,
7232 .v
.func
= alc_fixup_auto_mute_via_amp
,
7234 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
] = {
7235 .type
= HDA_FIXUP_PINS
,
7236 .v
.pins
= (const struct hda_pintbl
[]) {
7237 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7241 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7243 [ALC294_FIXUP_ASUS_MIC
] = {
7244 .type
= HDA_FIXUP_PINS
,
7245 .v
.pins
= (const struct hda_pintbl
[]) {
7246 { 0x13, 0x90a60160 }, /* use as internal mic */
7247 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7251 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7253 [ALC294_FIXUP_ASUS_HEADSET_MIC
] = {
7254 .type
= HDA_FIXUP_PINS
,
7255 .v
.pins
= (const struct hda_pintbl
[]) {
7256 { 0x19, 0x01a1103c }, /* use as headset mic */
7260 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7262 [ALC294_FIXUP_ASUS_SPK
] = {
7263 .type
= HDA_FIXUP_VERBS
,
7264 .v
.verbs
= (const struct hda_verb
[]) {
7266 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x40 },
7267 { 0x20, AC_VERB_SET_PROC_COEF
, 0x8800 },
7268 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0f },
7269 { 0x20, AC_VERB_SET_PROC_COEF
, 0x7774 },
7273 .chain_id
= ALC294_FIXUP_ASUS_HEADSET_MIC
7275 [ALC295_FIXUP_CHROME_BOOK
] = {
7276 .type
= HDA_FIXUP_FUNC
,
7277 .v
.func
= alc295_fixup_chromebook
,
7279 .chain_id
= ALC225_FIXUP_HEADSET_JACK
7281 [ALC225_FIXUP_HEADSET_JACK
] = {
7282 .type
= HDA_FIXUP_FUNC
,
7283 .v
.func
= alc_fixup_headset_jack
,
7285 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
] = {
7286 .type
= HDA_FIXUP_PINS
,
7287 .v
.pins
= (const struct hda_pintbl
[]) {
7288 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7292 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7294 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
] = {
7295 .type
= HDA_FIXUP_VERBS
,
7296 .v
.verbs
= (const struct hda_verb
[]) {
7297 /* Disable PCBEEP-IN passthrough */
7298 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
7299 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
7303 .chain_id
= ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
7305 [ALC255_FIXUP_ACER_HEADSET_MIC
] = {
7306 .type
= HDA_FIXUP_PINS
,
7307 .v
.pins
= (const struct hda_pintbl
[]) {
7308 { 0x19, 0x03a11130 },
7309 { 0x1a, 0x90a60140 }, /* use as internal mic */
7313 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
7315 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
] = {
7316 .type
= HDA_FIXUP_PINS
,
7317 .v
.pins
= (const struct hda_pintbl
[]) {
7318 { 0x16, 0x01011020 }, /* Rear Line out */
7319 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
7323 .chain_id
= ALC225_FIXUP_WYSE_AUTO_MUTE
7325 [ALC225_FIXUP_WYSE_AUTO_MUTE
] = {
7326 .type
= HDA_FIXUP_FUNC
,
7327 .v
.func
= alc_fixup_auto_mute_via_amp
,
7329 .chain_id
= ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
7331 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
] = {
7332 .type
= HDA_FIXUP_FUNC
,
7333 .v
.func
= alc_fixup_disable_mic_vref
,
7335 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
7337 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC
] = {
7338 .type
= HDA_FIXUP_VERBS
,
7339 .v
.verbs
= (const struct hda_verb
[]) {
7340 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x4f },
7341 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5029 },
7345 .chain_id
= ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
7347 [ALC256_FIXUP_ASUS_HEADSET_MIC
] = {
7348 .type
= HDA_FIXUP_PINS
,
7349 .v
.pins
= (const struct hda_pintbl
[]) {
7350 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7354 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
7356 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
7357 .type
= HDA_FIXUP_PINS
,
7358 .v
.pins
= (const struct hda_pintbl
[]) {
7359 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
7363 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
7365 [ALC299_FIXUP_PREDATOR_SPK
] = {
7366 .type
= HDA_FIXUP_PINS
,
7367 .v
.pins
= (const struct hda_pintbl
[]) {
7368 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
7372 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
] = {
7373 .type
= HDA_FIXUP_PINS
,
7374 .v
.pins
= (const struct hda_pintbl
[]) {
7375 { 0x19, 0x04a11040 },
7376 { 0x21, 0x04211020 },
7380 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
7382 [ALC289_FIXUP_DELL_SPK2
] = {
7383 .type
= HDA_FIXUP_PINS
,
7384 .v
.pins
= (const struct hda_pintbl
[]) {
7385 { 0x17, 0x90170130 }, /* bass spk */
7389 .chain_id
= ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
7391 [ALC289_FIXUP_DUAL_SPK
] = {
7392 .type
= HDA_FIXUP_FUNC
,
7393 .v
.func
= alc285_fixup_speaker2_to_dac1
,
7395 .chain_id
= ALC289_FIXUP_DELL_SPK2
7397 [ALC294_FIXUP_SPK2_TO_DAC1
] = {
7398 .type
= HDA_FIXUP_FUNC
,
7399 .v
.func
= alc285_fixup_speaker2_to_dac1
,
7401 .chain_id
= ALC294_FIXUP_ASUS_HEADSET_MIC
7403 [ALC294_FIXUP_ASUS_DUAL_SPK
] = {
7404 .type
= HDA_FIXUP_FUNC
,
7405 /* The GPIO must be pulled to initialize the AMP */
7406 .v
.func
= alc_fixup_gpio4
,
7408 .chain_id
= ALC294_FIXUP_SPK2_TO_DAC1
7410 [ALC285_FIXUP_THINKPAD_X1_GEN7
] = {
7411 .type
= HDA_FIXUP_FUNC
,
7412 .v
.func
= alc285_fixup_thinkpad_x1_gen7
,
7414 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
7416 [ALC285_FIXUP_THINKPAD_HEADSET_JACK
] = {
7417 .type
= HDA_FIXUP_FUNC
,
7418 .v
.func
= alc_fixup_headset_jack
,
7420 .chain_id
= ALC285_FIXUP_THINKPAD_X1_GEN7
7422 [ALC294_FIXUP_ASUS_HPE
] = {
7423 .type
= HDA_FIXUP_VERBS
,
7424 .v
.verbs
= (const struct hda_verb
[]) {
7426 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0f },
7427 { 0x20, AC_VERB_SET_PROC_COEF
, 0x7774 },
7431 .chain_id
= ALC294_FIXUP_ASUS_HEADSET_MIC
7433 [ALC294_FIXUP_ASUS_GX502_PINS
] = {
7434 .type
= HDA_FIXUP_PINS
,
7435 .v
.pins
= (const struct hda_pintbl
[]) {
7436 { 0x19, 0x03a11050 }, /* front HP mic */
7437 { 0x1a, 0x01a11830 }, /* rear external mic */
7438 { 0x21, 0x03211020 }, /* front HP out */
7442 .chain_id
= ALC294_FIXUP_ASUS_GX502_VERBS
7444 [ALC294_FIXUP_ASUS_GX502_VERBS
] = {
7445 .type
= HDA_FIXUP_VERBS
,
7446 .v
.verbs
= (const struct hda_verb
[]) {
7447 /* set 0x15 to HP-OUT ctrl */
7448 { 0x15, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc0 },
7449 /* unmute the 0x15 amp */
7450 { 0x15, AC_VERB_SET_AMP_GAIN_MUTE
, 0xb000 },
7454 .chain_id
= ALC294_FIXUP_ASUS_GX502_HP
7456 [ALC294_FIXUP_ASUS_GX502_HP
] = {
7457 .type
= HDA_FIXUP_FUNC
,
7458 .v
.func
= alc294_fixup_gx502_hp
,
7460 [ALC294_FIXUP_ASUS_COEF_1B
] = {
7461 .type
= HDA_FIXUP_VERBS
,
7462 .v
.verbs
= (const struct hda_verb
[]) {
7463 /* Set bit 10 to correct noisy output after reboot from
7464 * Windows 10 (due to pop noise reduction?)
7466 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x1b },
7467 { 0x20, AC_VERB_SET_PROC_COEF
, 0x4e4b },
7471 [ALC285_FIXUP_HP_GPIO_LED
] = {
7472 .type
= HDA_FIXUP_FUNC
,
7473 .v
.func
= alc285_fixup_hp_gpio_led
,
7475 [ALC285_FIXUP_HP_MUTE_LED
] = {
7476 .type
= HDA_FIXUP_FUNC
,
7477 .v
.func
= alc285_fixup_hp_mute_led
,
7479 [ALC236_FIXUP_HP_MUTE_LED
] = {
7480 .type
= HDA_FIXUP_FUNC
,
7481 .v
.func
= alc236_fixup_hp_mute_led
,
7483 [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
] = {
7484 .type
= HDA_FIXUP_VERBS
,
7485 .v
.verbs
= (const struct hda_verb
[]) {
7486 { 0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0xc5 },
7490 [ALC295_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
7491 .type
= HDA_FIXUP_PINS
,
7492 .v
.pins
= (const struct hda_pintbl
[]) {
7493 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7497 .chain_id
= ALC269_FIXUP_HEADSET_MODE
7499 [ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS
] = {
7500 .type
= HDA_FIXUP_PINS
,
7501 .v
.pins
= (const struct hda_pintbl
[]) {
7502 { 0x14, 0x90100120 }, /* use as internal speaker */
7503 { 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7504 { 0x1a, 0x01011020 }, /* use as line out */
7508 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7510 [ALC269VC_FIXUP_ACER_HEADSET_MIC
] = {
7511 .type
= HDA_FIXUP_PINS
,
7512 .v
.pins
= (const struct hda_pintbl
[]) {
7513 { 0x18, 0x02a11030 }, /* use as headset mic */
7517 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7519 [ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE
] = {
7520 .type
= HDA_FIXUP_PINS
,
7521 .v
.pins
= (const struct hda_pintbl
[]) {
7522 { 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7526 .chain_id
= ALC269_FIXUP_HEADSET_MIC
7528 [ALC289_FIXUP_ASUS_GA401
] = {
7529 .type
= HDA_FIXUP_PINS
,
7530 .v
.pins
= (const struct hda_pintbl
[]) {
7531 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7535 [ALC289_FIXUP_ASUS_GA502
] = {
7536 .type
= HDA_FIXUP_PINS
,
7537 .v
.pins
= (const struct hda_pintbl
[]) {
7538 { 0x19, 0x03a11020 }, /* headset mic with jack detect */
7542 [ALC256_FIXUP_ACER_MIC_NO_PRESENCE
] = {
7543 .type
= HDA_FIXUP_PINS
,
7544 .v
.pins
= (const struct hda_pintbl
[]) {
7545 { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */
7549 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
7551 [ALC285_FIXUP_HP_GPIO_AMP_INIT
] = {
7552 .type
= HDA_FIXUP_FUNC
,
7553 .v
.func
= alc285_fixup_hp_gpio_amp_init
,
7555 .chain_id
= ALC285_FIXUP_HP_GPIO_LED
7557 [ALC269_FIXUP_CZC_B20
] = {
7558 .type
= HDA_FIXUP_PINS
,
7559 .v
.pins
= (const struct hda_pintbl
[]) {
7560 { 0x12, 0x411111f0 },
7561 { 0x14, 0x90170110 }, /* speaker */
7562 { 0x15, 0x032f1020 }, /* HP out */
7563 { 0x17, 0x411111f0 },
7564 { 0x18, 0x03ab1040 }, /* mic */
7565 { 0x19, 0xb7a7013f },
7566 { 0x1a, 0x0181305f },
7567 { 0x1b, 0x411111f0 },
7568 { 0x1d, 0x411111f0 },
7569 { 0x1e, 0x411111f0 },
7572 .chain_id
= ALC269_FIXUP_DMIC
,
7574 [ALC269_FIXUP_CZC_TMI
] = {
7575 .type
= HDA_FIXUP_PINS
,
7576 .v
.pins
= (const struct hda_pintbl
[]) {
7577 { 0x12, 0x4000c000 },
7578 { 0x14, 0x90170110 }, /* speaker */
7579 { 0x15, 0x0421401f }, /* HP out */
7580 { 0x17, 0x411111f0 },
7581 { 0x18, 0x04a19020 }, /* mic */
7582 { 0x19, 0x411111f0 },
7583 { 0x1a, 0x411111f0 },
7584 { 0x1b, 0x411111f0 },
7585 { 0x1d, 0x40448505 },
7586 { 0x1e, 0x411111f0 },
7587 { 0x20, 0x8000ffff },
7590 .chain_id
= ALC269_FIXUP_DMIC
,
7592 [ALC269_FIXUP_CZC_L101
] = {
7593 .type
= HDA_FIXUP_PINS
,
7594 .v
.pins
= (const struct hda_pintbl
[]) {
7595 { 0x12, 0x40000000 },
7596 { 0x14, 0x01014010 }, /* speaker */
7597 { 0x15, 0x411111f0 }, /* HP out */
7598 { 0x16, 0x411111f0 },
7599 { 0x18, 0x01a19020 }, /* mic */
7600 { 0x19, 0x02a19021 },
7601 { 0x1a, 0x0181302f },
7602 { 0x1b, 0x0221401f },
7603 { 0x1c, 0x411111f0 },
7604 { 0x1d, 0x4044c601 },
7605 { 0x1e, 0x411111f0 },
7608 .chain_id
= ALC269_FIXUP_DMIC
,
7610 [ALC269_FIXUP_LEMOTE_A1802
] = {
7611 .type
= HDA_FIXUP_PINS
,
7612 .v
.pins
= (const struct hda_pintbl
[]) {
7613 { 0x12, 0x40000000 },
7614 { 0x14, 0x90170110 }, /* speaker */
7615 { 0x17, 0x411111f0 },
7616 { 0x18, 0x03a19040 }, /* mic1 */
7617 { 0x19, 0x90a70130 }, /* mic2 */
7618 { 0x1a, 0x411111f0 },
7619 { 0x1b, 0x411111f0 },
7620 { 0x1d, 0x40489d2d },
7621 { 0x1e, 0x411111f0 },
7622 { 0x20, 0x0003ffff },
7623 { 0x21, 0x03214020 },
7626 .chain_id
= ALC269_FIXUP_DMIC
,
7628 [ALC269_FIXUP_LEMOTE_A190X
] = {
7629 .type
= HDA_FIXUP_PINS
,
7630 .v
.pins
= (const struct hda_pintbl
[]) {
7631 { 0x14, 0x99130110 }, /* speaker */
7632 { 0x15, 0x0121401f }, /* HP out */
7633 { 0x18, 0x01a19c20 }, /* rear mic */
7634 { 0x19, 0x99a3092f }, /* front mic */
7635 { 0x1b, 0x0201401f }, /* front lineout */
7638 .chain_id
= ALC269_FIXUP_DMIC
,
7640 [ALC256_FIXUP_INTEL_NUC8_RUGGED
] = {
7641 .type
= HDA_FIXUP_PINS
,
7642 .v
.pins
= (const struct hda_pintbl
[]) {
7643 { 0x1b, 0x01a1913c }, /* use as headset mic, without its own jack detect */
7647 .chain_id
= ALC269_FIXUP_HEADSET_MODE
7649 [ALC255_FIXUP_XIAOMI_HEADSET_MIC
] = {
7650 .type
= HDA_FIXUP_VERBS
,
7651 .v
.verbs
= (const struct hda_verb
[]) {
7652 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x45 },
7653 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5089 },
7657 .chain_id
= ALC289_FIXUP_ASUS_GA401
7659 [ALC274_FIXUP_HP_MIC
] = {
7660 .type
= HDA_FIXUP_VERBS
,
7661 .v
.verbs
= (const struct hda_verb
[]) {
7662 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x45 },
7663 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5089 },
7669 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
7670 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
7671 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
7672 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
7673 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
7674 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
7675 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
7676 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
7677 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
7678 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
7679 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
7680 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
7681 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
),
7682 SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC
),
7683 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
7684 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
7685 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
7686 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK
),
7687 SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS
),
7688 SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE
),
7689 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
7690 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
7691 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
7692 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
7693 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC
),
7694 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC
),
7695 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE
),
7696 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
7697 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
7698 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
7699 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
7700 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
7701 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
7702 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
7703 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
7704 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
7705 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
7706 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
7707 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
7708 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
7709 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
7710 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
7711 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
7712 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
7713 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
7714 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
7715 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
7716 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
7717 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
7718 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
7719 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
7720 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
7721 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
7722 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
7723 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
7724 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
7725 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
7726 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP
),
7727 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME
),
7728 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
7729 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
7730 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
7731 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
),
7732 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
7733 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
7734 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
7735 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
7736 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB
),
7737 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
),
7738 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
),
7739 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
7740 SND_PCI_QUIRK(0x1028, 0x097e, "Dell Precision", ALC289_FIXUP_DUAL_SPK
),
7741 SND_PCI_QUIRK(0x1028, 0x097d, "Dell Precision", ALC289_FIXUP_DUAL_SPK
),
7742 SND_PCI_QUIRK(0x1028, 0x098d, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
),
7743 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
),
7744 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
7745 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
7746 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
7747 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
7748 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
7749 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
7751 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7752 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7753 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7754 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
7755 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
7756 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
7757 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
7758 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
7759 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7760 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7761 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7762 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7763 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
7764 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
7765 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
7766 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7767 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7768 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7769 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7770 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7771 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
7772 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7773 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7775 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7776 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7777 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7778 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7779 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7780 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7781 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7782 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7783 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7784 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
7785 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7786 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7787 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7788 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7789 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7790 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7791 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
7792 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7793 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7794 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7795 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7796 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7797 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7798 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7799 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7800 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7801 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7802 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7803 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
7804 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
7805 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
7806 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
7807 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
7808 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
7809 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360
),
7810 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
7811 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
7812 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
7813 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
7814 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
7815 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED
),
7816 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED
),
7817 SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT
),
7818 SND_PCI_QUIRK(0x103c, 0x874e, "HP", ALC274_FIXUP_HP_MIC
),
7819 SND_PCI_QUIRK(0x103c, 0x8760, "HP", ALC285_FIXUP_HP_MUTE_LED
),
7820 SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED
),
7821 SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED
),
7822 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
7823 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
7824 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7825 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK
),
7826 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
7827 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
7828 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7829 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
7830 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
7831 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
7832 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
7833 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
7834 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
7835 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
7836 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
7837 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
7838 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK
),
7839 SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC
),
7840 SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC
),
7841 SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE
),
7842 SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE
),
7843 SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE
),
7844 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
7845 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
7846 SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B
),
7847 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
7848 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
7849 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7850 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
7851 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502
),
7852 SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401
),
7853 SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS
),
7854 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
7855 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
7856 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
7857 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
7858 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
7859 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
7860 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
7861 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
7862 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
7863 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
7864 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
7865 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
7866 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
7867 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
7868 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
7869 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
7870 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
7871 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
7872 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE
),
7873 SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK
),
7874 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE
),
7875 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
7876 SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
),
7877 SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
),
7878 SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
),
7879 SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
),
7880 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
),
7881 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
7882 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
),
7883 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
7884 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
7885 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC
),
7886 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
7887 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
7888 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
7889 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
7890 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
7891 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
7892 SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7893 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
7894 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
7895 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
7896 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
7897 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
7898 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
),
7899 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
7900 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
7901 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
7902 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
7903 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
7904 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
7905 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
7906 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
7907 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
7908 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
7909 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
7910 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7911 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
7912 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
7913 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
7914 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7915 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7916 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
7917 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
7918 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK
),
7919 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7920 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7921 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460
),
7922 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7923 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7924 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7925 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7926 SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK
),
7927 SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK
),
7928 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
7929 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
7930 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7931 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7932 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7933 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7934 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7935 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7936 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7937 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7938 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
7939 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
7940 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
7941 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7942 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
7943 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
7944 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7945 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
7946 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
7947 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
7948 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
7949 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
7950 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
7951 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
7952 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
7953 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7954 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7955 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7956 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7957 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7958 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7959 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
7960 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
7961 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS
),
7962 SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20
),
7963 SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI
),
7964 SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101
),
7965 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
7966 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC
),
7967 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC
),
7968 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
),
7969 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802
),
7970 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X
),
7971 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED
),
7974 /* Below is a quirk table taken from the old code.
7975 * Basically the device should work as is without the fixup table.
7976 * If BIOS doesn't give a proper info, enable the corresponding
7979 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7981 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
7982 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
7983 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
7984 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
7985 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
7986 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
7987 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
7988 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
7989 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
7990 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
7991 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
7992 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
7993 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
7994 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
7995 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
7996 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
7997 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
7998 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
7999 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
8000 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
8001 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
8002 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
8003 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
8004 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
8005 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
8006 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
8007 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
8008 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
8009 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
8010 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
8011 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
8012 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
8013 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
8014 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
8015 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
8016 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
8017 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
8018 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
8019 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
8024 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
8025 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
8026 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
8027 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
8028 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
8029 SND_PCI_QUIRK_VENDOR(0x19e5, "Huawei Matebook", ALC255_FIXUP_MIC_MUTE_LED
),
8033 static const struct hda_model_fixup alc269_fixup_models
[] = {
8034 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
8035 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
8036 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
8037 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
8038 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
8039 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
8040 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
8041 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
8042 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
8043 {.id
= ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST
, .name
= "lenovo-dock-limit-boost"},
8044 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
8045 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
8046 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
8047 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
8048 {.id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
, .name
= "dell-headset3"},
8049 {.id
= ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
, .name
= "dell-headset4"},
8050 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
8051 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
8052 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
8053 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
8054 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
8055 {.id
= ALC298_FIXUP_TPT470_DOCK_FIX
, .name
= "tpt470-dock-fix"},
8056 {.id
= ALC298_FIXUP_TPT470_DOCK
, .name
= "tpt470-dock"},
8057 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
8058 {.id
= ALC700_FIXUP_INTEL_REFERENCE
, .name
= "alc700-ref"},
8059 {.id
= ALC269_FIXUP_SONY_VAIO
, .name
= "vaio"},
8060 {.id
= ALC269_FIXUP_DELL_M101Z
, .name
= "dell-m101z"},
8061 {.id
= ALC269_FIXUP_ASUS_G73JW
, .name
= "asus-g73jw"},
8062 {.id
= ALC269_FIXUP_LENOVO_EAPD
, .name
= "lenovo-eapd"},
8063 {.id
= ALC275_FIXUP_SONY_HWEQ
, .name
= "sony-hweq"},
8064 {.id
= ALC269_FIXUP_PCM_44K
, .name
= "pcm44k"},
8065 {.id
= ALC269_FIXUP_LIFEBOOK
, .name
= "lifebook"},
8066 {.id
= ALC269_FIXUP_LIFEBOOK_EXTMIC
, .name
= "lifebook-extmic"},
8067 {.id
= ALC269_FIXUP_LIFEBOOK_HP_PIN
, .name
= "lifebook-hp-pin"},
8068 {.id
= ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
, .name
= "lifebook-u7x7"},
8069 {.id
= ALC269VB_FIXUP_AMIC
, .name
= "alc269vb-amic"},
8070 {.id
= ALC269VB_FIXUP_DMIC
, .name
= "alc269vb-dmic"},
8071 {.id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
, .name
= "hp-mute-led-mic1"},
8072 {.id
= ALC269_FIXUP_HP_MUTE_LED_MIC2
, .name
= "hp-mute-led-mic2"},
8073 {.id
= ALC269_FIXUP_HP_MUTE_LED_MIC3
, .name
= "hp-mute-led-mic3"},
8074 {.id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
, .name
= "hp-gpio-mic1"},
8075 {.id
= ALC269_FIXUP_HP_LINE1_MIC1_LED
, .name
= "hp-line1-mic1"},
8076 {.id
= ALC269_FIXUP_NO_SHUTUP
, .name
= "noshutup"},
8077 {.id
= ALC286_FIXUP_SONY_MIC_NO_PRESENCE
, .name
= "sony-nomic"},
8078 {.id
= ALC269_FIXUP_ASPIRE_HEADSET_MIC
, .name
= "aspire-headset-mic"},
8079 {.id
= ALC269_FIXUP_ASUS_X101
, .name
= "asus-x101"},
8080 {.id
= ALC271_FIXUP_HP_GATE_MIC_JACK
, .name
= "acer-ao7xx"},
8081 {.id
= ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
, .name
= "acer-aspire-e1"},
8082 {.id
= ALC269_FIXUP_ACER_AC700
, .name
= "acer-ac700"},
8083 {.id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
, .name
= "limit-mic-boost"},
8084 {.id
= ALC269VB_FIXUP_ASUS_ZENBOOK
, .name
= "asus-zenbook"},
8085 {.id
= ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
, .name
= "asus-zenbook-ux31a"},
8086 {.id
= ALC269VB_FIXUP_ORDISSIMO_EVE2
, .name
= "ordissimo"},
8087 {.id
= ALC282_FIXUP_ASUS_TX300
, .name
= "asus-tx300"},
8088 {.id
= ALC283_FIXUP_INT_MIC
, .name
= "alc283-int-mic"},
8089 {.id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
, .name
= "mono-speakers"},
8090 {.id
= ALC290_FIXUP_SUBWOOFER_HSJACK
, .name
= "alc290-subwoofer"},
8091 {.id
= ALC269_FIXUP_THINKPAD_ACPI
, .name
= "thinkpad"},
8092 {.id
= ALC269_FIXUP_DMIC_THINKPAD_ACPI
, .name
= "dmic-thinkpad"},
8093 {.id
= ALC255_FIXUP_ACER_MIC_NO_PRESENCE
, .name
= "alc255-acer"},
8094 {.id
= ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
, .name
= "alc255-asus"},
8095 {.id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc255-dell1"},
8096 {.id
= ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "alc255-dell2"},
8097 {.id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc293-dell1"},
8098 {.id
= ALC283_FIXUP_HEADSET_MIC
, .name
= "alc283-headset"},
8099 {.id
= ALC255_FIXUP_MIC_MUTE_LED
, .name
= "alc255-dell-mute"},
8100 {.id
= ALC282_FIXUP_ASPIRE_V5_PINS
, .name
= "aspire-v5"},
8101 {.id
= ALC280_FIXUP_HP_GPIO4
, .name
= "hp-gpio4"},
8102 {.id
= ALC286_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
8103 {.id
= ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
, .name
= "hp-gpio2-hotkey"},
8104 {.id
= ALC280_FIXUP_HP_DOCK_PINS
, .name
= "hp-dock-pins"},
8105 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic"},
8106 {.id
= ALC280_FIXUP_HP_9480M
, .name
= "hp-9480m"},
8107 {.id
= ALC288_FIXUP_DELL_HEADSET_MODE
, .name
= "alc288-dell-headset"},
8108 {.id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc288-dell1"},
8109 {.id
= ALC288_FIXUP_DELL_XPS_13
, .name
= "alc288-dell-xps13"},
8110 {.id
= ALC292_FIXUP_DELL_E7X
, .name
= "dell-e7x"},
8111 {.id
= ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
, .name
= "alc293-dell"},
8112 {.id
= ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc298-dell1"},
8113 {.id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
, .name
= "alc298-dell-aio"},
8114 {.id
= ALC275_FIXUP_DELL_XPS
, .name
= "alc275-dell-xps"},
8115 {.id
= ALC293_FIXUP_LENOVO_SPK_NOISE
, .name
= "lenovo-spk-noise"},
8116 {.id
= ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
, .name
= "lenovo-hotkey"},
8117 {.id
= ALC255_FIXUP_DELL_SPK_NOISE
, .name
= "dell-spk-noise"},
8118 {.id
= ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc225-dell1"},
8119 {.id
= ALC295_FIXUP_DISABLE_DAC3
, .name
= "alc295-disable-dac3"},
8120 {.id
= ALC285_FIXUP_SPEAKER2_TO_DAC1
, .name
= "alc285-speaker2-to-dac1"},
8121 {.id
= ALC280_FIXUP_HP_HEADSET_MIC
, .name
= "alc280-hp-headset"},
8122 {.id
= ALC221_FIXUP_HP_FRONT_MIC
, .name
= "alc221-hp-mic"},
8123 {.id
= ALC298_FIXUP_SPK_VOLUME
, .name
= "alc298-spk-volume"},
8124 {.id
= ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
, .name
= "dell-inspiron-7559"},
8125 {.id
= ALC269_FIXUP_ATIV_BOOK_8
, .name
= "ativ-book"},
8126 {.id
= ALC221_FIXUP_HP_MIC_NO_PRESENCE
, .name
= "alc221-hp-mic"},
8127 {.id
= ALC256_FIXUP_ASUS_HEADSET_MODE
, .name
= "alc256-asus-headset"},
8128 {.id
= ALC256_FIXUP_ASUS_MIC
, .name
= "alc256-asus-mic"},
8129 {.id
= ALC256_FIXUP_ASUS_AIO_GPIO2
, .name
= "alc256-asus-aio"},
8130 {.id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
, .name
= "alc233-asus"},
8131 {.id
= ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
, .name
= "alc233-eapd"},
8132 {.id
= ALC294_FIXUP_LENOVO_MIC_LOCATION
, .name
= "alc294-lenovo-mic"},
8133 {.id
= ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
, .name
= "alc225-wyse"},
8134 {.id
= ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
, .name
= "alc274-dell-aio"},
8135 {.id
= ALC255_FIXUP_DUMMY_LINEOUT_VERB
, .name
= "alc255-dummy-lineout"},
8136 {.id
= ALC255_FIXUP_DELL_HEADSET_MIC
, .name
= "alc255-dell-headset"},
8137 {.id
= ALC295_FIXUP_HP_X360
, .name
= "alc295-hp-x360"},
8138 {.id
= ALC225_FIXUP_HEADSET_JACK
, .name
= "alc-headset-jack"},
8139 {.id
= ALC295_FIXUP_CHROME_BOOK
, .name
= "alc-chrome-book"},
8140 {.id
= ALC299_FIXUP_PREDATOR_SPK
, .name
= "predator-spk"},
8141 {.id
= ALC298_FIXUP_HUAWEI_MBX_STEREO
, .name
= "huawei-mbx-stereo"},
8142 {.id
= ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
, .name
= "alc256-medion-headset"},
8143 {.id
= ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
, .name
= "alc298-samsung-headphone"},
8144 {.id
= ALC255_FIXUP_XIAOMI_HEADSET_MIC
, .name
= "alc255-xiaomi-headset"},
8145 {.id
= ALC274_FIXUP_HP_MIC
, .name
= "alc274-hp-mic-detect"},
8148 #define ALC225_STANDARD_PINS \
8151 #define ALC256_STANDARD_PINS \
8152 {0x12, 0x90a60140}, \
8153 {0x14, 0x90170110}, \
8156 #define ALC282_STANDARD_PINS \
8159 #define ALC290_STANDARD_PINS \
8162 #define ALC292_STANDARD_PINS \
8163 {0x14, 0x90170110}, \
8166 #define ALC295_STANDARD_PINS \
8167 {0x12, 0xb7a60130}, \
8168 {0x14, 0x90170110}, \
8171 #define ALC298_STANDARD_PINS \
8172 {0x12, 0x90a60130}, \
8175 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
8176 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC
,
8181 {0x21, 0x0221102f}),
8182 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
8185 {0x21, 0x02211030}),
8186 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
8189 {0x21, 0x03211020}),
8190 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
8193 {0x21, 0x03211020}),
8194 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
8195 ALC225_STANDARD_PINS
,
8197 {0x14, 0x901701a0}),
8198 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
8199 ALC225_STANDARD_PINS
,
8201 {0x14, 0x901701b0}),
8202 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
8203 ALC225_STANDARD_PINS
,
8205 {0x14, 0x901701a0}),
8206 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
8207 ALC225_STANDARD_PINS
,
8209 {0x14, 0x901701b0}),
8210 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
8211 ALC225_STANDARD_PINS
,
8213 {0x1b, 0x90170110}),
8214 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8217 {0x21, 0x02211020}),
8218 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
8222 {0x21, 0x02211020}),
8223 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
8228 {0x21, 0x0221101f}),
8229 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
8234 {0x21, 0x0221101f}),
8235 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
8239 {0x21, 0x0221101f}),
8240 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
8242 {0x21, 0x02211020}),
8243 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8245 {0x21, 0x02211040}),
8246 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8249 {0x21, 0x02211020}),
8250 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8253 {0x21, 0x02211030}),
8254 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8257 {0x21, 0x0221101f}),
8258 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8261 {0x21, 0x0221101f}),
8262 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8265 {0x21, 0x0221103f}),
8266 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8269 {0x21, 0x0221103f}),
8270 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8273 {0x21, 0x0221103f}),
8274 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8277 {0x21, 0x0221105f}),
8278 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8281 {0x21, 0x0221101f}),
8282 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8286 {0x21, 0x0321102f}),
8287 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8290 {0x21, 0x02211040}),
8291 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8294 {0x21, 0x02211050}),
8295 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8298 {0x21, 0x02211030}),
8299 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8302 {0x21, 0x02211040}),
8303 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8306 {0x21, 0x02211040}),
8307 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8310 {0x21, 0x02211050}),
8311 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8314 {0x21, 0x02211040}),
8315 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8318 {0x21, 0x02211030}),
8319 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8321 {0x21, 0x02211010}),
8322 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
8325 {0x21, 0x04211020}),
8326 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
8329 {0x21, 0x03211020}),
8330 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
8333 {0x21, 0x03211020}),
8334 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
8337 {0x21, 0x04211020}),
8338 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
8341 {0x21, 0x03211020}),
8342 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
8346 {0x1a, 0x04a11020}),
8347 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
8353 {0x1b, 0x02011020}),
8354 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8355 ALC282_STANDARD_PINS
,
8358 {0x21, 0x0321101f}),
8359 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8360 ALC282_STANDARD_PINS
,
8363 {0x21, 0x03211040}),
8364 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8365 ALC282_STANDARD_PINS
,
8368 {0x21, 0x03211020}),
8369 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8370 ALC282_STANDARD_PINS
,
8373 {0x21, 0x0421101f}),
8374 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
8375 ALC282_STANDARD_PINS
,
8378 {0x21, 0x04211020}),
8379 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8380 ALC282_STANDARD_PINS
,
8382 {0x21, 0x0321101f}),
8383 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8386 {0x21, 0x02211030}),
8387 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8388 ALC282_STANDARD_PINS
,
8391 {0x21, 0x0321101f}),
8392 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
8396 {0x21, 0x04211020}),
8397 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
8400 {0x21, 0x02211020}),
8401 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
8404 {0x21, 0x0321101f}),
8405 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8406 ALC290_STANDARD_PINS
,
8409 {0x1a, 0x04a11020}),
8410 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8411 ALC290_STANDARD_PINS
,
8414 {0x1a, 0x04a11020}),
8415 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8416 ALC290_STANDARD_PINS
,
8418 {0x1a, 0x04a11020}),
8419 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8420 ALC290_STANDARD_PINS
,
8422 {0x1a, 0x04a11040}),
8423 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8424 ALC290_STANDARD_PINS
,
8427 {0x1a, 0x04a11040}),
8428 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8429 ALC290_STANDARD_PINS
,
8432 {0x1a, 0x04a11020}),
8433 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
8434 ALC290_STANDARD_PINS
,
8437 {0x1a, 0x04a11020}),
8438 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
8439 ALC292_STANDARD_PINS
,
8442 {0x19, 0x01a19030}),
8443 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
8444 ALC292_STANDARD_PINS
,
8448 {0x19, 0x01a1903e}),
8449 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
8450 ALC292_STANDARD_PINS
,
8451 {0x12, 0x90a60140}),
8452 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
8453 ALC292_STANDARD_PINS
,
8456 {0x19, 0x21a19030}),
8457 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
8458 ALC292_STANDARD_PINS
,
8459 {0x13, 0x90a60140}),
8460 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC
,
8463 {0x21, 0x04211020}),
8464 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
8467 {0x21, 0x03211020}),
8468 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
8471 {0x21, 0x04211020}),
8472 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
8475 {0x21, 0x03211020}),
8476 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE
,
8479 {0x21, 0x04211030}),
8480 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE
,
8483 {0x21, 0x03211020}),
8484 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE
,
8487 {0x21, 0x03211020}),
8488 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
8490 {0x21, 0x04211020}),
8491 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
8493 {0x21, 0x04211030}),
8494 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8495 ALC295_STANDARD_PINS
,
8497 {0x18, 0x21a19030}),
8498 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8499 ALC295_STANDARD_PINS
,
8501 {0x18, 0x21a19050}),
8502 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
8503 ALC295_STANDARD_PINS
),
8504 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
8505 ALC298_STANDARD_PINS
,
8506 {0x17, 0x90170110}),
8507 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
8508 ALC298_STANDARD_PINS
,
8509 {0x17, 0x90170140}),
8510 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
8511 ALC298_STANDARD_PINS
,
8512 {0x17, 0x90170150}),
8513 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
8518 {0x21, 0x03211030}),
8519 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE
,
8523 {0x21, 0x03211020}),
8524 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
8525 ALC225_STANDARD_PINS
,
8527 {0x17, 0x90170110}),
8528 SND_HDA_PIN_QUIRK(0x10ec0623, 0x17aa, "Lenovo", ALC283_FIXUP_HEADSET_MIC
,
8533 {0x21, 0x0221101f}),
8537 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
8538 * more machines, don't need to match all valid pins, just need to match
8539 * all the pins defined in the tbl. Just because of this reason, it is possible
8540 * that a single machine matches multiple tbls, so there is one limitation:
8541 * at most one tbl is allowed to define for the same vendor and same codec
8543 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl
[] = {
8544 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
8546 {0x1b, 0x40000000}),
8547 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8549 {0x1a, 0x40000000}),
8550 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
8552 {0x1a, 0x40000000}),
8553 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
8555 {0x1a, 0x40000000}),
8559 static void alc269_fill_coef(struct hda_codec
*codec
)
8561 struct alc_spec
*spec
= codec
->spec
;
8564 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
8567 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
8568 alc_write_coef_idx(codec
, 0xf, 0x960b);
8569 alc_write_coef_idx(codec
, 0xe, 0x8817);
8572 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
8573 alc_write_coef_idx(codec
, 0xf, 0x960b);
8574 alc_write_coef_idx(codec
, 0xe, 0x8814);
8577 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
8578 /* Power up output pin */
8579 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
8582 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
8583 val
= alc_read_coef_idx(codec
, 0xd);
8584 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
8585 /* Capless ramp up clock control */
8586 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
8588 val
= alc_read_coef_idx(codec
, 0x17);
8589 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
8590 /* Class D power on reset */
8591 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
8596 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
8601 static int patch_alc269(struct hda_codec
*codec
)
8603 struct alc_spec
*spec
;
8606 err
= alc_alloc_spec(codec
, 0x0b);
8611 spec
->gen
.shared_mic_vref_pin
= 0x18;
8612 codec
->power_save_node
= 0;
8615 codec
->patch_ops
.suspend
= alc269_suspend
;
8616 codec
->patch_ops
.resume
= alc269_resume
;
8618 spec
->shutup
= alc_default_shutup
;
8619 spec
->init_hook
= alc_default_init
;
8621 switch (codec
->core
.vendor_id
) {
8623 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
8624 switch (alc_get_coef0(codec
) & 0x00f0) {
8626 if (codec
->bus
->pci
&&
8627 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
8628 spec
->cdefine
.platform_type
== 1)
8629 err
= alc_codec_rename(codec
, "ALC271X");
8630 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
8633 if (codec
->bus
->pci
&&
8634 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
8635 codec
->bus
->pci
->subsystem_device
== 0x21f3)
8636 err
= alc_codec_rename(codec
, "ALC3202");
8637 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
8640 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
8643 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
8647 spec
->shutup
= alc269_shutup
;
8648 spec
->init_hook
= alc269_fill_coef
;
8649 alc269_fill_coef(codec
);
8654 spec
->codec_variant
= ALC269_TYPE_ALC280
;
8657 spec
->codec_variant
= ALC269_TYPE_ALC282
;
8658 spec
->shutup
= alc282_shutup
;
8659 spec
->init_hook
= alc282_init
;
8663 spec
->codec_variant
= ALC269_TYPE_ALC283
;
8664 spec
->shutup
= alc283_shutup
;
8665 spec
->init_hook
= alc283_init
;
8669 spec
->codec_variant
= ALC269_TYPE_ALC284
;
8672 spec
->codec_variant
= ALC269_TYPE_ALC293
;
8676 spec
->codec_variant
= ALC269_TYPE_ALC286
;
8679 spec
->codec_variant
= ALC269_TYPE_ALC298
;
8683 spec
->codec_variant
= ALC269_TYPE_ALC255
;
8684 spec
->shutup
= alc256_shutup
;
8685 spec
->init_hook
= alc256_init
;
8689 spec
->codec_variant
= ALC269_TYPE_ALC256
;
8690 spec
->shutup
= alc256_shutup
;
8691 spec
->init_hook
= alc256_init
;
8692 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
8695 spec
->codec_variant
= ALC269_TYPE_ALC257
;
8696 spec
->shutup
= alc256_shutup
;
8697 spec
->init_hook
= alc256_init
;
8698 spec
->gen
.mixer_nid
= 0;
8705 spec
->codec_variant
= ALC269_TYPE_ALC215
;
8706 spec
->shutup
= alc225_shutup
;
8707 spec
->init_hook
= alc225_init
;
8708 spec
->gen
.mixer_nid
= 0;
8713 spec
->codec_variant
= ALC269_TYPE_ALC225
;
8714 spec
->shutup
= alc225_shutup
;
8715 spec
->init_hook
= alc225_init
;
8716 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225, ALC295 and ALC299 */
8721 spec
->codec_variant
= ALC269_TYPE_ALC294
;
8722 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
8723 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
8724 spec
->init_hook
= alc294_init
;
8727 spec
->codec_variant
= ALC269_TYPE_ALC300
;
8728 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC300 */
8731 spec
->codec_variant
= ALC269_TYPE_ALC623
;
8737 spec
->codec_variant
= ALC269_TYPE_ALC700
;
8738 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
8739 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
8740 spec
->init_hook
= alc294_init
;
8745 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
8746 spec
->has_alc5505_dsp
= 1;
8747 spec
->init_hook
= alc5505_dsp_init
;
8750 alc_pre_init(codec
);
8752 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
8753 alc269_fixup_tbl
, alc269_fixups
);
8754 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
, true);
8755 snd_hda_pick_pin_fixup(codec
, alc269_fallback_pin_fixup_tbl
, alc269_fixups
, false);
8756 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
8758 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8760 alc_auto_parse_customize_define(codec
);
8762 if (has_cdefine_beep(codec
))
8763 spec
->gen
.beep_nid
= 0x01;
8765 /* automatic parse from the BIOS config */
8766 err
= alc269_parse_auto_config(codec
);
8770 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
) {
8771 err
= set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
8776 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8789 static int alc861_parse_auto_config(struct hda_codec
*codec
)
8791 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
8792 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
8793 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
8796 /* Pin config fixes */
8798 ALC861_FIXUP_FSC_AMILO_PI1505
,
8799 ALC861_FIXUP_AMP_VREF_0F
,
8800 ALC861_FIXUP_NO_JACK_DETECT
,
8801 ALC861_FIXUP_ASUS_A6RP
,
8802 ALC660_FIXUP_ASUS_W7J
,
8805 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
8806 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
8807 const struct hda_fixup
*fix
, int action
)
8809 struct alc_spec
*spec
= codec
->spec
;
8812 if (action
!= HDA_FIXUP_ACT_INIT
)
8814 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
8815 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
8816 val
|= AC_PINCTL_IN_EN
;
8817 val
|= AC_PINCTL_VREF_50
;
8818 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
8819 spec
->gen
.keep_vref_in_automute
= 1;
8822 /* suppress the jack-detection */
8823 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
8824 const struct hda_fixup
*fix
, int action
)
8826 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
8827 codec
->no_jack_detect
= 1;
8830 static const struct hda_fixup alc861_fixups
[] = {
8831 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
8832 .type
= HDA_FIXUP_PINS
,
8833 .v
.pins
= (const struct hda_pintbl
[]) {
8834 { 0x0b, 0x0221101f }, /* HP */
8835 { 0x0f, 0x90170310 }, /* speaker */
8839 [ALC861_FIXUP_AMP_VREF_0F
] = {
8840 .type
= HDA_FIXUP_FUNC
,
8841 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
8843 [ALC861_FIXUP_NO_JACK_DETECT
] = {
8844 .type
= HDA_FIXUP_FUNC
,
8845 .v
.func
= alc_fixup_no_jack_detect
,
8847 [ALC861_FIXUP_ASUS_A6RP
] = {
8848 .type
= HDA_FIXUP_FUNC
,
8849 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
8851 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
8853 [ALC660_FIXUP_ASUS_W7J
] = {
8854 .type
= HDA_FIXUP_VERBS
,
8855 .v
.verbs
= (const struct hda_verb
[]) {
8856 /* ASUS W7J needs a magic pin setup on unused NID 0x10
8857 * for enabling outputs
8859 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
8865 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
8866 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
8867 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
8868 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
8869 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
8870 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
8871 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
8872 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
8873 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
8879 static int patch_alc861(struct hda_codec
*codec
)
8881 struct alc_spec
*spec
;
8884 err
= alc_alloc_spec(codec
, 0x15);
8889 if (has_cdefine_beep(codec
))
8890 spec
->gen
.beep_nid
= 0x23;
8893 spec
->power_hook
= alc_power_eapd
;
8896 alc_pre_init(codec
);
8898 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
8899 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8901 /* automatic parse from the BIOS config */
8902 err
= alc861_parse_auto_config(codec
);
8906 if (!spec
->gen
.no_analog
) {
8907 err
= set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
8912 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8926 * In addition, an independent DAC
8928 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
8930 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
8931 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
8932 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
8936 ALC660VD_FIX_ASUS_GPIO1
,
8937 ALC861VD_FIX_DALLAS
,
8940 /* exclude VREF80 */
8941 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
8942 const struct hda_fixup
*fix
, int action
)
8944 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
8945 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
8946 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
8951 static void alc660vd_fixup_asus_gpio1(struct hda_codec
*codec
,
8952 const struct hda_fixup
*fix
, int action
)
8954 struct alc_spec
*spec
= codec
->spec
;
8956 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
8957 spec
->gpio_mask
|= 0x02;
8958 alc_fixup_gpio(codec
, action
, 0x01);
8961 static const struct hda_fixup alc861vd_fixups
[] = {
8962 [ALC660VD_FIX_ASUS_GPIO1
] = {
8963 .type
= HDA_FIXUP_FUNC
,
8964 .v
.func
= alc660vd_fixup_asus_gpio1
,
8966 [ALC861VD_FIX_DALLAS
] = {
8967 .type
= HDA_FIXUP_FUNC
,
8968 .v
.func
= alc861vd_fixup_dallas
,
8972 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
8973 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
8974 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
8975 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
8981 static int patch_alc861vd(struct hda_codec
*codec
)
8983 struct alc_spec
*spec
;
8986 err
= alc_alloc_spec(codec
, 0x0b);
8991 if (has_cdefine_beep(codec
))
8992 spec
->gen
.beep_nid
= 0x23;
8994 spec
->shutup
= alc_eapd_shutup
;
8996 alc_pre_init(codec
);
8998 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
8999 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
9001 /* automatic parse from the BIOS config */
9002 err
= alc861vd_parse_auto_config(codec
);
9006 if (!spec
->gen
.no_analog
) {
9007 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
9012 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
9024 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
9025 * configuration. Each pin widget can choose any input DACs and a mixer.
9026 * Each ADC is connected from a mixer of all inputs. This makes possible
9027 * 6-channel independent captures.
9029 * In addition, an independent DAC for the multi-playback (not used in this
9034 * BIOS auto configuration
9037 static int alc662_parse_auto_config(struct hda_codec
*codec
)
9039 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
9040 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
9041 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
9042 const hda_nid_t
*ssids
;
9044 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
9045 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
9046 codec
->core
.vendor_id
== 0x10ec0671)
9047 ssids
= alc663_ssids
;
9049 ssids
= alc662_ssids
;
9050 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
9053 static void alc272_fixup_mario(struct hda_codec
*codec
,
9054 const struct hda_fixup
*fix
, int action
)
9056 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
9058 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
9059 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
9060 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
9061 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
9062 (0 << AC_AMPCAP_MUTE_SHIFT
)))
9063 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
9066 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
9068 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
9070 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
9071 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
9075 /* override the 2.1 chmap */
9076 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
9077 const struct hda_fixup
*fix
, int action
)
9079 if (action
== HDA_FIXUP_ACT_BUILD
) {
9080 struct alc_spec
*spec
= codec
->spec
;
9081 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
9085 /* avoid D3 for keeping GPIO up */
9086 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
9088 unsigned int power_state
)
9090 struct alc_spec
*spec
= codec
->spec
;
9091 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_data
)
9096 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
9097 const struct hda_fixup
*fix
, int action
)
9099 struct alc_spec
*spec
= codec
->spec
;
9101 alc_fixup_hp_gpio_led(codec
, action
, 0x01, 0);
9102 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
9103 spec
->mute_led_polarity
= 1;
9104 codec
->power_filter
= gpio_led_power_filter
;
9108 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
9109 struct hda_jack_callback
*jack
)
9111 struct alc_spec
*spec
= codec
->spec
;
9114 snd_hda_gen_hp_automute(codec
, jack
);
9116 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
9118 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
9122 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
9123 const struct hda_fixup
*fix
, int action
)
9125 struct alc_spec
*spec
= codec
->spec
;
9126 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
9127 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
9128 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
9132 static void alc662_aspire_ethos_mute_speakers(struct hda_codec
*codec
,
9133 struct hda_jack_callback
*cb
)
9135 /* surround speakers at 0x1b already get muted automatically when
9136 * headphones are plugged in, but we have to mute/unmute the remaining
9137 * channels manually:
9138 * 0x15 - front left/front right
9139 * 0x18 - front center/ LFE
9141 if (snd_hda_jack_detect_state(codec
, 0x1b) == HDA_JACK_PRESENT
) {
9142 snd_hda_set_pin_ctl_cache(codec
, 0x15, 0);
9143 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
9145 snd_hda_set_pin_ctl_cache(codec
, 0x15, PIN_OUT
);
9146 snd_hda_set_pin_ctl_cache(codec
, 0x18, PIN_OUT
);
9150 static void alc662_fixup_aspire_ethos_hp(struct hda_codec
*codec
,
9151 const struct hda_fixup
*fix
, int action
)
9153 /* Pin 0x1b: shared headphones jack and surround speakers */
9154 if (!is_jack_detectable(codec
, 0x1b))
9158 case HDA_FIXUP_ACT_PRE_PROBE
:
9159 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
9160 alc662_aspire_ethos_mute_speakers
);
9161 /* subwoofer needs an extra GPIO setting to become audible */
9162 alc_setup_gpio(codec
, 0x02);
9164 case HDA_FIXUP_ACT_INIT
:
9165 /* Make sure to start in a correct state, i.e. if
9166 * headphones have been plugged in before powering up the system
9168 alc662_aspire_ethos_mute_speakers(codec
, NULL
);
9173 static void alc671_fixup_hp_headset_mic2(struct hda_codec
*codec
,
9174 const struct hda_fixup
*fix
, int action
)
9176 struct alc_spec
*spec
= codec
->spec
;
9178 static const struct hda_pintbl pincfgs
[] = {
9179 { 0x19, 0x02a11040 }, /* use as headset mic, with its own jack detect */
9180 { 0x1b, 0x0181304f },
9185 case HDA_FIXUP_ACT_PRE_PROBE
:
9186 spec
->gen
.mixer_nid
= 0;
9187 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
9188 snd_hda_apply_pincfgs(codec
, pincfgs
);
9190 case HDA_FIXUP_ACT_INIT
:
9191 alc_write_coef_idx(codec
, 0x19, 0xa054);
9196 static const struct coef_fw alc668_coefs
[] = {
9197 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
9198 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
9199 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
9200 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
9201 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
9202 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
9203 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
9204 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
9205 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
9206 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
9207 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
9208 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
9209 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
9210 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
9211 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
9212 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
9213 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
9214 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
9215 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
9216 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
9220 static void alc668_restore_default_value(struct hda_codec
*codec
)
9222 alc_process_coef_fw(codec
, alc668_coefs
);
9226 ALC662_FIXUP_ASPIRE
,
9227 ALC662_FIXUP_LED_GPIO1
,
9228 ALC662_FIXUP_IDEAPAD
,
9230 ALC662_FIXUP_CZC_ET26
,
9231 ALC662_FIXUP_CZC_P10T
,
9232 ALC662_FIXUP_SKU_IGNORE
,
9233 ALC662_FIXUP_HP_RP5800
,
9234 ALC662_FIXUP_ASUS_MODE1
,
9235 ALC662_FIXUP_ASUS_MODE2
,
9236 ALC662_FIXUP_ASUS_MODE3
,
9237 ALC662_FIXUP_ASUS_MODE4
,
9238 ALC662_FIXUP_ASUS_MODE5
,
9239 ALC662_FIXUP_ASUS_MODE6
,
9240 ALC662_FIXUP_ASUS_MODE7
,
9241 ALC662_FIXUP_ASUS_MODE8
,
9242 ALC662_FIXUP_NO_JACK_DETECT
,
9243 ALC662_FIXUP_ZOTAC_Z68
,
9244 ALC662_FIXUP_INV_DMIC
,
9245 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
9246 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
9247 ALC662_FIXUP_HEADSET_MODE
,
9248 ALC668_FIXUP_HEADSET_MODE
,
9249 ALC662_FIXUP_BASS_MODE4_CHMAP
,
9250 ALC662_FIXUP_BASS_16
,
9251 ALC662_FIXUP_BASS_1A
,
9252 ALC662_FIXUP_BASS_CHMAP
,
9253 ALC668_FIXUP_AUTO_MUTE
,
9254 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
9255 ALC668_FIXUP_DELL_XPS13
,
9256 ALC662_FIXUP_ASUS_Nx50
,
9257 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
9258 ALC668_FIXUP_ASUS_Nx51
,
9259 ALC668_FIXUP_MIC_COEF
,
9260 ALC668_FIXUP_ASUS_G751
,
9261 ALC891_FIXUP_HEADSET_MODE
,
9262 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
9263 ALC662_FIXUP_ACER_VERITON
,
9264 ALC892_FIXUP_ASROCK_MOBO
,
9265 ALC662_FIXUP_USI_FUNC
,
9266 ALC662_FIXUP_USI_HEADSET_MODE
,
9267 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
9268 ALC669_FIXUP_ACER_ASPIRE_ETHOS
,
9269 ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
,
9270 ALC671_FIXUP_HP_HEADSET_MIC2
,
9271 ALC662_FIXUP_ACER_X2660G_HEADSET_MODE
,
9272 ALC662_FIXUP_ACER_NITRO_HEADSET_MODE
,
9275 static const struct hda_fixup alc662_fixups
[] = {
9276 [ALC662_FIXUP_ASPIRE
] = {
9277 .type
= HDA_FIXUP_PINS
,
9278 .v
.pins
= (const struct hda_pintbl
[]) {
9279 { 0x15, 0x99130112 }, /* subwoofer */
9283 [ALC662_FIXUP_LED_GPIO1
] = {
9284 .type
= HDA_FIXUP_FUNC
,
9285 .v
.func
= alc662_fixup_led_gpio1
,
9287 [ALC662_FIXUP_IDEAPAD
] = {
9288 .type
= HDA_FIXUP_PINS
,
9289 .v
.pins
= (const struct hda_pintbl
[]) {
9290 { 0x17, 0x99130112 }, /* subwoofer */
9294 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
9296 [ALC272_FIXUP_MARIO
] = {
9297 .type
= HDA_FIXUP_FUNC
,
9298 .v
.func
= alc272_fixup_mario
,
9300 [ALC662_FIXUP_CZC_ET26
] = {
9301 .type
= HDA_FIXUP_PINS
,
9302 .v
.pins
= (const struct hda_pintbl
[]) {
9304 {0x14, 0x90170110}, /* speaker */
9307 {0x18, 0x01a19030}, /* mic */
9308 {0x19, 0x90a7013f}, /* int-mic */
9317 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9319 [ALC662_FIXUP_CZC_P10T
] = {
9320 .type
= HDA_FIXUP_VERBS
,
9321 .v
.verbs
= (const struct hda_verb
[]) {
9322 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
9326 [ALC662_FIXUP_SKU_IGNORE
] = {
9327 .type
= HDA_FIXUP_FUNC
,
9328 .v
.func
= alc_fixup_sku_ignore
,
9330 [ALC662_FIXUP_HP_RP5800
] = {
9331 .type
= HDA_FIXUP_PINS
,
9332 .v
.pins
= (const struct hda_pintbl
[]) {
9333 { 0x14, 0x0221201f }, /* HP out */
9337 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9339 [ALC662_FIXUP_ASUS_MODE1
] = {
9340 .type
= HDA_FIXUP_PINS
,
9341 .v
.pins
= (const struct hda_pintbl
[]) {
9342 { 0x14, 0x99130110 }, /* speaker */
9343 { 0x18, 0x01a19c20 }, /* mic */
9344 { 0x19, 0x99a3092f }, /* int-mic */
9345 { 0x21, 0x0121401f }, /* HP out */
9349 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9351 [ALC662_FIXUP_ASUS_MODE2
] = {
9352 .type
= HDA_FIXUP_PINS
,
9353 .v
.pins
= (const struct hda_pintbl
[]) {
9354 { 0x14, 0x99130110 }, /* speaker */
9355 { 0x18, 0x01a19820 }, /* mic */
9356 { 0x19, 0x99a3092f }, /* int-mic */
9357 { 0x1b, 0x0121401f }, /* HP out */
9361 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9363 [ALC662_FIXUP_ASUS_MODE3
] = {
9364 .type
= HDA_FIXUP_PINS
,
9365 .v
.pins
= (const struct hda_pintbl
[]) {
9366 { 0x14, 0x99130110 }, /* speaker */
9367 { 0x15, 0x0121441f }, /* HP */
9368 { 0x18, 0x01a19840 }, /* mic */
9369 { 0x19, 0x99a3094f }, /* int-mic */
9370 { 0x21, 0x01211420 }, /* HP2 */
9374 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9376 [ALC662_FIXUP_ASUS_MODE4
] = {
9377 .type
= HDA_FIXUP_PINS
,
9378 .v
.pins
= (const struct hda_pintbl
[]) {
9379 { 0x14, 0x99130110 }, /* speaker */
9380 { 0x16, 0x99130111 }, /* speaker */
9381 { 0x18, 0x01a19840 }, /* mic */
9382 { 0x19, 0x99a3094f }, /* int-mic */
9383 { 0x21, 0x0121441f }, /* HP */
9387 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9389 [ALC662_FIXUP_ASUS_MODE5
] = {
9390 .type
= HDA_FIXUP_PINS
,
9391 .v
.pins
= (const struct hda_pintbl
[]) {
9392 { 0x14, 0x99130110 }, /* speaker */
9393 { 0x15, 0x0121441f }, /* HP */
9394 { 0x16, 0x99130111 }, /* speaker */
9395 { 0x18, 0x01a19840 }, /* mic */
9396 { 0x19, 0x99a3094f }, /* int-mic */
9400 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9402 [ALC662_FIXUP_ASUS_MODE6
] = {
9403 .type
= HDA_FIXUP_PINS
,
9404 .v
.pins
= (const struct hda_pintbl
[]) {
9405 { 0x14, 0x99130110 }, /* speaker */
9406 { 0x15, 0x01211420 }, /* HP2 */
9407 { 0x18, 0x01a19840 }, /* mic */
9408 { 0x19, 0x99a3094f }, /* int-mic */
9409 { 0x1b, 0x0121441f }, /* HP */
9413 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9415 [ALC662_FIXUP_ASUS_MODE7
] = {
9416 .type
= HDA_FIXUP_PINS
,
9417 .v
.pins
= (const struct hda_pintbl
[]) {
9418 { 0x14, 0x99130110 }, /* speaker */
9419 { 0x17, 0x99130111 }, /* speaker */
9420 { 0x18, 0x01a19840 }, /* mic */
9421 { 0x19, 0x99a3094f }, /* int-mic */
9422 { 0x1b, 0x01214020 }, /* HP */
9423 { 0x21, 0x0121401f }, /* HP */
9427 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9429 [ALC662_FIXUP_ASUS_MODE8
] = {
9430 .type
= HDA_FIXUP_PINS
,
9431 .v
.pins
= (const struct hda_pintbl
[]) {
9432 { 0x14, 0x99130110 }, /* speaker */
9433 { 0x12, 0x99a30970 }, /* int-mic */
9434 { 0x15, 0x01214020 }, /* HP */
9435 { 0x17, 0x99130111 }, /* speaker */
9436 { 0x18, 0x01a19840 }, /* mic */
9437 { 0x21, 0x0121401f }, /* HP */
9441 .chain_id
= ALC662_FIXUP_SKU_IGNORE
9443 [ALC662_FIXUP_NO_JACK_DETECT
] = {
9444 .type
= HDA_FIXUP_FUNC
,
9445 .v
.func
= alc_fixup_no_jack_detect
,
9447 [ALC662_FIXUP_ZOTAC_Z68
] = {
9448 .type
= HDA_FIXUP_PINS
,
9449 .v
.pins
= (const struct hda_pintbl
[]) {
9450 { 0x1b, 0x02214020 }, /* Front HP */
9454 [ALC662_FIXUP_INV_DMIC
] = {
9455 .type
= HDA_FIXUP_FUNC
,
9456 .v
.func
= alc_fixup_inv_dmic
,
9458 [ALC668_FIXUP_DELL_XPS13
] = {
9459 .type
= HDA_FIXUP_FUNC
,
9460 .v
.func
= alc_fixup_dell_xps13
,
9462 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
9464 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
9465 .type
= HDA_FIXUP_FUNC
,
9466 .v
.func
= alc_fixup_disable_aamix
,
9468 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
9470 [ALC668_FIXUP_AUTO_MUTE
] = {
9471 .type
= HDA_FIXUP_FUNC
,
9472 .v
.func
= alc_fixup_auto_mute_via_amp
,
9474 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
9476 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
9477 .type
= HDA_FIXUP_PINS
,
9478 .v
.pins
= (const struct hda_pintbl
[]) {
9479 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9480 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
9484 .chain_id
= ALC662_FIXUP_HEADSET_MODE
9486 [ALC662_FIXUP_HEADSET_MODE
] = {
9487 .type
= HDA_FIXUP_FUNC
,
9488 .v
.func
= alc_fixup_headset_mode_alc662
,
9490 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
9491 .type
= HDA_FIXUP_PINS
,
9492 .v
.pins
= (const struct hda_pintbl
[]) {
9493 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9494 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9498 .chain_id
= ALC668_FIXUP_HEADSET_MODE
9500 [ALC668_FIXUP_HEADSET_MODE
] = {
9501 .type
= HDA_FIXUP_FUNC
,
9502 .v
.func
= alc_fixup_headset_mode_alc668
,
9504 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
9505 .type
= HDA_FIXUP_FUNC
,
9506 .v
.func
= alc_fixup_bass_chmap
,
9508 .chain_id
= ALC662_FIXUP_ASUS_MODE4
9510 [ALC662_FIXUP_BASS_16
] = {
9511 .type
= HDA_FIXUP_PINS
,
9512 .v
.pins
= (const struct hda_pintbl
[]) {
9513 {0x16, 0x80106111}, /* bass speaker */
9517 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
9519 [ALC662_FIXUP_BASS_1A
] = {
9520 .type
= HDA_FIXUP_PINS
,
9521 .v
.pins
= (const struct hda_pintbl
[]) {
9522 {0x1a, 0x80106111}, /* bass speaker */
9526 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
9528 [ALC662_FIXUP_BASS_CHMAP
] = {
9529 .type
= HDA_FIXUP_FUNC
,
9530 .v
.func
= alc_fixup_bass_chmap
,
9532 [ALC662_FIXUP_ASUS_Nx50
] = {
9533 .type
= HDA_FIXUP_FUNC
,
9534 .v
.func
= alc_fixup_auto_mute_via_amp
,
9536 .chain_id
= ALC662_FIXUP_BASS_1A
9538 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
9539 .type
= HDA_FIXUP_FUNC
,
9540 .v
.func
= alc_fixup_headset_mode_alc668
,
9541 .chain_id
= ALC662_FIXUP_BASS_CHMAP
9543 [ALC668_FIXUP_ASUS_Nx51
] = {
9544 .type
= HDA_FIXUP_PINS
,
9545 .v
.pins
= (const struct hda_pintbl
[]) {
9546 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9547 { 0x1a, 0x90170151 }, /* bass speaker */
9548 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9552 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
9554 [ALC668_FIXUP_MIC_COEF
] = {
9555 .type
= HDA_FIXUP_VERBS
,
9556 .v
.verbs
= (const struct hda_verb
[]) {
9557 { 0x20, AC_VERB_SET_COEF_INDEX
, 0xc3 },
9558 { 0x20, AC_VERB_SET_PROC_COEF
, 0x4000 },
9562 [ALC668_FIXUP_ASUS_G751
] = {
9563 .type
= HDA_FIXUP_PINS
,
9564 .v
.pins
= (const struct hda_pintbl
[]) {
9565 { 0x16, 0x0421101f }, /* HP */
9569 .chain_id
= ALC668_FIXUP_MIC_COEF
9571 [ALC891_FIXUP_HEADSET_MODE
] = {
9572 .type
= HDA_FIXUP_FUNC
,
9573 .v
.func
= alc_fixup_headset_mode
,
9575 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
9576 .type
= HDA_FIXUP_PINS
,
9577 .v
.pins
= (const struct hda_pintbl
[]) {
9578 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
9579 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
9583 .chain_id
= ALC891_FIXUP_HEADSET_MODE
9585 [ALC662_FIXUP_ACER_VERITON
] = {
9586 .type
= HDA_FIXUP_PINS
,
9587 .v
.pins
= (const struct hda_pintbl
[]) {
9588 { 0x15, 0x50170120 }, /* no internal speaker */
9592 [ALC892_FIXUP_ASROCK_MOBO
] = {
9593 .type
= HDA_FIXUP_PINS
,
9594 .v
.pins
= (const struct hda_pintbl
[]) {
9595 { 0x15, 0x40f000f0 }, /* disabled */
9596 { 0x16, 0x40f000f0 }, /* disabled */
9600 [ALC662_FIXUP_USI_FUNC
] = {
9601 .type
= HDA_FIXUP_FUNC
,
9602 .v
.func
= alc662_fixup_usi_headset_mic
,
9604 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
9605 .type
= HDA_FIXUP_PINS
,
9606 .v
.pins
= (const struct hda_pintbl
[]) {
9607 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
9608 { 0x18, 0x01a1903d },
9612 .chain_id
= ALC662_FIXUP_USI_FUNC
9614 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
9615 .type
= HDA_FIXUP_FUNC
,
9616 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
9618 [ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
] = {
9619 .type
= HDA_FIXUP_FUNC
,
9620 .v
.func
= alc662_fixup_aspire_ethos_hp
,
9622 [ALC669_FIXUP_ACER_ASPIRE_ETHOS
] = {
9623 .type
= HDA_FIXUP_PINS
,
9624 .v
.pins
= (const struct hda_pintbl
[]) {
9625 { 0x15, 0x92130110 }, /* front speakers */
9626 { 0x18, 0x99130111 }, /* center/subwoofer */
9627 { 0x1b, 0x11130012 }, /* surround plus jack for HP */
9631 .chain_id
= ALC669_FIXUP_ACER_ASPIRE_ETHOS_HEADSET
9633 [ALC671_FIXUP_HP_HEADSET_MIC2
] = {
9634 .type
= HDA_FIXUP_FUNC
,
9635 .v
.func
= alc671_fixup_hp_headset_mic2
,
9637 [ALC662_FIXUP_ACER_X2660G_HEADSET_MODE
] = {
9638 .type
= HDA_FIXUP_PINS
,
9639 .v
.pins
= (const struct hda_pintbl
[]) {
9640 { 0x1a, 0x02a1113c }, /* use as headset mic, without its own jack detect */
9644 .chain_id
= ALC662_FIXUP_USI_FUNC
9646 [ALC662_FIXUP_ACER_NITRO_HEADSET_MODE
] = {
9647 .type
= HDA_FIXUP_PINS
,
9648 .v
.pins
= (const struct hda_pintbl
[]) {
9649 { 0x1a, 0x01a11140 }, /* use as headset mic, without its own jack detect */
9650 { 0x1b, 0x0221144f },
9654 .chain_id
= ALC662_FIXUP_USI_FUNC
9658 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
9659 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
9660 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
9661 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
9662 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
9663 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
9664 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
9665 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
9666 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
9667 SND_PCI_QUIRK(0x1025, 0x123c, "Acer Nitro N50-600", ALC662_FIXUP_ACER_NITRO_HEADSET_MODE
),
9668 SND_PCI_QUIRK(0x1025, 0x124e, "Acer 2660G", ALC662_FIXUP_ACER_X2660G_HEADSET_MODE
),
9669 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9670 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9671 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
9672 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
9673 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
9674 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9675 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9676 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9677 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9678 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
9679 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
9680 SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2
),
9681 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
9682 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
9683 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
9684 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
9685 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751
),
9686 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
9687 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
9688 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
9689 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
9690 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
9691 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
9692 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
9693 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
9694 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
9695 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
9696 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
9697 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
9698 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
9699 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
9700 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
9701 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
9702 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
9703 SND_PCI_QUIRK(0x1b35, 0x1234, "CZC ET26", ALC662_FIXUP_CZC_ET26
),
9704 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
9705 SND_PCI_QUIRK(0x1025, 0x0566, "Acer Aspire Ethos 8951G", ALC669_FIXUP_ACER_ASPIRE_ETHOS
),
9708 /* Below is a quirk table taken from the old code.
9709 * Basically the device should work as is without the fixup table.
9710 * If BIOS doesn't give a proper info, enable the corresponding
9713 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
9714 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
9715 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
9716 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
9717 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
9718 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9719 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
9720 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
9721 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
9722 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9723 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
9724 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
9725 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
9726 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
9727 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
9728 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9729 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
9730 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
9731 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9732 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
9733 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
9734 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9735 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
9736 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
9737 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
9738 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9739 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
9740 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
9741 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9742 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
9743 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9744 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9745 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
9746 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
9747 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
9748 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
9749 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
9750 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
9751 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
9752 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
9753 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
9754 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
9755 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
9756 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
9757 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
9758 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
9759 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
9760 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
9761 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
9762 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
9767 static const struct hda_model_fixup alc662_fixup_models
[] = {
9768 {.id
= ALC662_FIXUP_ASPIRE
, .name
= "aspire"},
9769 {.id
= ALC662_FIXUP_IDEAPAD
, .name
= "ideapad"},
9770 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
9771 {.id
= ALC662_FIXUP_HP_RP5800
, .name
= "hp-rp5800"},
9772 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
9773 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
9774 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
9775 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
9776 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
9777 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
9778 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
9779 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
9780 {.id
= ALC662_FIXUP_ZOTAC_Z68
, .name
= "zotac-z68"},
9781 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
9782 {.id
= ALC662_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "alc662-headset-multi"},
9783 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
9784 {.id
= ALC662_FIXUP_HEADSET_MODE
, .name
= "alc662-headset"},
9785 {.id
= ALC668_FIXUP_HEADSET_MODE
, .name
= "alc668-headset"},
9786 {.id
= ALC662_FIXUP_BASS_16
, .name
= "bass16"},
9787 {.id
= ALC662_FIXUP_BASS_1A
, .name
= "bass1a"},
9788 {.id
= ALC668_FIXUP_AUTO_MUTE
, .name
= "automute"},
9789 {.id
= ALC668_FIXUP_DELL_XPS13
, .name
= "dell-xps13"},
9790 {.id
= ALC662_FIXUP_ASUS_Nx50
, .name
= "asus-nx50"},
9791 {.id
= ALC668_FIXUP_ASUS_Nx51
, .name
= "asus-nx51"},
9792 {.id
= ALC668_FIXUP_ASUS_G751
, .name
= "asus-g751"},
9793 {.id
= ALC891_FIXUP_HEADSET_MODE
, .name
= "alc891-headset"},
9794 {.id
= ALC891_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "alc891-headset-multi"},
9795 {.id
= ALC662_FIXUP_ACER_VERITON
, .name
= "acer-veriton"},
9796 {.id
= ALC892_FIXUP_ASROCK_MOBO
, .name
= "asrock-mobo"},
9797 {.id
= ALC662_FIXUP_USI_HEADSET_MODE
, .name
= "usi-headset"},
9798 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
9799 {.id
= ALC669_FIXUP_ACER_ASPIRE_ETHOS
, .name
= "aspire-ethos"},
9803 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
9804 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
9808 {0x21, 0x01014020}),
9809 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
9813 {0x21, 0x01014020}),
9814 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
9818 {0x1b, 0x0221401f}),
9819 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
9823 {0x16, 0x03011020}),
9824 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
9828 {0x16, 0x03011020}),
9829 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
9833 {0x16, 0x03011020}),
9834 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
9837 {0x16, 0x03011020}),
9838 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
9841 {0x15, 0x0321101f}),
9842 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2
,
9847 {0x21, 0x02211020}),
9848 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2
,
9852 {0x21, 0x02211020}),
9853 SND_HDA_PIN_QUIRK(0x10ec0671, 0x103c, "HP cPC", ALC671_FIXUP_HP_HEADSET_MIC2
,
9858 {0x21, 0x02211030}),
9864 static int patch_alc662(struct hda_codec
*codec
)
9866 struct alc_spec
*spec
;
9869 err
= alc_alloc_spec(codec
, 0x0b);
9875 spec
->shutup
= alc_eapd_shutup
;
9877 /* handle multiple HPs as is */
9878 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
9880 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
9882 switch (codec
->core
.vendor_id
) {
9884 spec
->init_hook
= alc668_restore_default_value
;
9888 alc_pre_init(codec
);
9890 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
9891 alc662_fixup_tbl
, alc662_fixups
);
9892 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
, true);
9893 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
9895 alc_auto_parse_customize_define(codec
);
9897 if (has_cdefine_beep(codec
))
9898 spec
->gen
.beep_nid
= 0x01;
9900 if ((alc_get_coef0(codec
) & (1 << 14)) &&
9901 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
9902 spec
->cdefine
.platform_type
== 1) {
9903 err
= alc_codec_rename(codec
, "ALC272X");
9908 /* automatic parse from the BIOS config */
9909 err
= alc662_parse_auto_config(codec
);
9913 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
9914 switch (codec
->core
.vendor_id
) {
9916 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
9922 err
= set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
9925 err
= set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
9932 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
9945 static int alc680_parse_auto_config(struct hda_codec
*codec
)
9947 return alc_parse_auto_config(codec
, NULL
, NULL
);
9952 static int patch_alc680(struct hda_codec
*codec
)
9956 /* ALC680 has no aa-loopback mixer */
9957 err
= alc_alloc_spec(codec
, 0);
9961 /* automatic parse from the BIOS config */
9962 err
= alc680_parse_auto_config(codec
);
9974 static const struct hda_device_id snd_hda_id_realtek
[] = {
9975 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
9976 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
9977 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269
),
9978 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
9979 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
9980 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
9981 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
9982 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
9983 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
9984 HDA_CODEC_ENTRY(0x10ec0245, "ALC245", patch_alc269
),
9985 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
9986 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
9987 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269
),
9988 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
9989 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
9990 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
9991 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
9992 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
9993 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
9994 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
9995 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
9996 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
9997 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
9998 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
9999 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
10000 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
10001 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
10002 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
10003 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
10004 HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269
),
10005 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
10006 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
10007 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
10008 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
10009 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
10010 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
10011 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
10012 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
10013 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
10014 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269
),
10015 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269
),
10016 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
10017 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
10018 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
10019 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
10020 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
10021 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
10022 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
10023 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
10024 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
10025 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
10026 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
10027 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
10028 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
10029 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
10030 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
10031 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
10032 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
10033 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269
),
10034 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
10035 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
10036 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
10037 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
10038 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
10039 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
10040 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
10041 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
10042 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
10043 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
10044 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
10045 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
10046 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
10047 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
10048 HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882
),
10049 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882
),
10050 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
10051 {} /* terminator */
10053 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
10055 MODULE_LICENSE("GPL");
10056 MODULE_DESCRIPTION("Realtek HD-audio codec");
10058 static struct hda_codec_driver realtek_driver
= {
10059 .id
= snd_hda_id_realtek
,
10062 module_hda_codec_driver(realtek_driver
);