2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for Realtek ALC codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@just42.net>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <linux/dmi.h>
31 #include <linux/module.h>
32 #include <linux/input.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include "hda_codec.h"
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
39 #include "hda_generic.h"
41 /* keep halting ALC5505 DSP, for power saving */
42 #define HALT_REALTEK_ALC5505
44 /* extra amp-initialization sequence types */
54 ALC_HEADSET_MODE_UNKNOWN
,
55 ALC_HEADSET_MODE_UNPLUGGED
,
56 ALC_HEADSET_MODE_HEADSET
,
58 ALC_HEADSET_MODE_HEADPHONE
,
62 ALC_HEADSET_TYPE_UNKNOWN
,
63 ALC_HEADSET_TYPE_CTIA
,
64 ALC_HEADSET_TYPE_OMTP
,
68 ALC_KEY_MICMUTE_INDEX
,
71 struct alc_customize_define
{
73 unsigned char port_connectivity
;
74 unsigned char check_sum
;
75 unsigned char customization
;
76 unsigned char external_amp
;
77 unsigned int enable_pcbeep
:1;
78 unsigned int platform_type
:1;
80 unsigned int override
:1;
81 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
85 struct hda_gen_spec gen
; /* must be at head */
87 /* codec parameterization */
88 const struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
89 unsigned int num_mixers
;
90 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
92 struct alc_customize_define cdefine
;
93 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
95 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
96 int mute_led_polarity
;
97 hda_nid_t mute_led_nid
;
98 hda_nid_t cap_mute_led_nid
;
100 unsigned int gpio_led
; /* used for alc269_fixup_hp_gpio_led() */
101 unsigned int gpio_mute_led_mask
;
102 unsigned int gpio_mic_led_mask
;
104 hda_nid_t headset_mic_pin
;
105 hda_nid_t headphone_mic_pin
;
106 int current_headset_mode
;
107 int current_headset_type
;
110 void (*init_hook
)(struct hda_codec
*codec
);
112 void (*power_hook
)(struct hda_codec
*codec
);
114 void (*shutup
)(struct hda_codec
*codec
);
115 void (*reboot_notify
)(struct hda_codec
*codec
);
118 int codec_variant
; /* flag for other variants */
119 unsigned int has_alc5505_dsp
:1;
120 unsigned int no_depop_delay
:1;
121 unsigned int done_hp_init
:1;
122 unsigned int no_shutup_pins
:1;
126 unsigned int pll_coef_idx
, pll_coef_bit
;
128 struct input_dev
*kb_dev
;
129 u8 alc_mute_keycode_map
[1];
133 * COEF access helper functions
136 static int alc_read_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
137 unsigned int coef_idx
)
141 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
142 val
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
146 #define alc_read_coef_idx(codec, coef_idx) \
147 alc_read_coefex_idx(codec, 0x20, coef_idx)
149 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
150 unsigned int coef_idx
, unsigned int coef_val
)
152 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
153 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
, coef_val
);
156 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
157 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
159 static void alc_update_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
160 unsigned int coef_idx
, unsigned int mask
,
161 unsigned int bits_set
)
163 unsigned int val
= alc_read_coefex_idx(codec
, nid
, coef_idx
);
166 alc_write_coefex_idx(codec
, nid
, coef_idx
,
167 (val
& ~mask
) | bits_set
);
170 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
171 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
173 /* a special bypass for COEF 0; read the cached value at the second time */
174 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
176 struct alc_spec
*spec
= codec
->spec
;
179 spec
->coef0
= alc_read_coef_idx(codec
, 0);
183 /* coef writes/updates batch */
191 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
192 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
193 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
194 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
195 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
197 static void alc_process_coef_fw(struct hda_codec
*codec
,
198 const struct coef_fw
*fw
)
200 for (; fw
->nid
; fw
++) {
201 if (fw
->mask
== (unsigned short)-1)
202 alc_write_coefex_idx(codec
, fw
->nid
, fw
->idx
, fw
->val
);
204 alc_update_coefex_idx(codec
, fw
->nid
, fw
->idx
,
210 * Append the given mixer and verb elements for the later use
211 * The mixer array is referred in build_controls(), and init_verbs are
214 static void add_mixer(struct alc_spec
*spec
, const struct snd_kcontrol_new
*mix
)
216 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
218 spec
->mixers
[spec
->num_mixers
++] = mix
;
222 * GPIO setup tables, used in initialization
224 /* Enable GPIO mask and set output */
225 static const struct hda_verb alc_gpio1_init_verbs
[] = {
226 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
227 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
228 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
232 static const struct hda_verb alc_gpio2_init_verbs
[] = {
233 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
234 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
235 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
239 static const struct hda_verb alc_gpio3_init_verbs
[] = {
240 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
241 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
242 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
247 * Fix hardware PLL issue
248 * On some codecs, the analog PLL gating control must be off while
249 * the default value is 1.
251 static void alc_fix_pll(struct hda_codec
*codec
)
253 struct alc_spec
*spec
= codec
->spec
;
256 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
257 1 << spec
->pll_coef_bit
, 0);
260 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
261 unsigned int coef_idx
, unsigned int coef_bit
)
263 struct alc_spec
*spec
= codec
->spec
;
265 spec
->pll_coef_idx
= coef_idx
;
266 spec
->pll_coef_bit
= coef_bit
;
270 /* update the master volume per volume-knob's unsol event */
271 static void alc_update_knob_master(struct hda_codec
*codec
,
272 struct hda_jack_callback
*jack
)
275 struct snd_kcontrol
*kctl
;
276 struct snd_ctl_elem_value
*uctl
;
278 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
281 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
284 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
285 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
286 val
&= HDA_AMP_VOLMASK
;
287 uctl
->value
.integer
.value
[0] = val
;
288 uctl
->value
.integer
.value
[1] = val
;
289 kctl
->put(kctl
, uctl
);
293 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
295 /* For some reason, the res given from ALC880 is broken.
296 Here we adjust it properly. */
297 snd_hda_jack_unsol_event(codec
, res
>> 2);
300 /* Change EAPD to verb control */
301 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
305 coef
= alc_get_coef0(codec
);
307 switch (codec
->core
.vendor_id
) {
309 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
313 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
316 if ((coef
& 0x00f0) == 0x0010)
317 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
318 if ((coef
& 0x00f0) == 0x0020)
319 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
320 if ((coef
& 0x00f0) == 0x0030)
321 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
327 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
332 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
349 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
352 alc_update_coef_idx(codec
, 0xe, 0, 1<<0);
355 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
364 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
367 if ((coef
& 0x00f0) == 0x0030)
368 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
377 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
380 alc_update_coef_idx(codec
, 0x19, 1<<13, 0);
383 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
386 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
389 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
390 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
393 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
399 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
404 /* additional initialization for ALC888 variants */
405 static void alc888_coef_init(struct hda_codec
*codec
)
407 switch (alc_get_coef0(codec
) & 0x00f0) {
412 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
417 /* turn on/off EAPD control (only if available) */
418 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
420 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
422 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
423 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
427 /* turn on/off EAPD controls of the codec */
428 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
430 /* We currently only handle front, HP */
431 static hda_nid_t pins
[] = {
432 0x0f, 0x10, 0x14, 0x15, 0x17, 0
435 for (p
= pins
; *p
; p
++)
436 set_eapd(codec
, *p
, on
);
439 static int find_ext_mic_pin(struct hda_codec
*codec
);
441 static void alc_headset_mic_no_shutup(struct hda_codec
*codec
)
443 const struct hda_pincfg
*pin
;
444 int mic_pin
= find_ext_mic_pin(codec
);
447 /* don't shut up pins when unloading the driver; otherwise it breaks
448 * the default pin setup at the next load of the driver
450 if (codec
->bus
->shutdown
)
453 for (i
= 0; i
< codec
->init_pins
.used
; i
++) {
454 pin
= snd_array_elem(&codec
->init_pins
, i
);
455 /* use read here for syncing after issuing each verb */
456 if (pin
->nid
!= mic_pin
)
457 snd_hda_codec_read(codec
, pin
->nid
, 0,
458 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
461 codec
->pins_shutup
= 1;
464 static void alc_shutup_pins(struct hda_codec
*codec
)
466 struct alc_spec
*spec
= codec
->spec
;
468 switch (codec
->core
.vendor_id
) {
472 alc_headset_mic_no_shutup(codec
);
475 if (!spec
->no_shutup_pins
)
476 snd_hda_shutup_pins(codec
);
481 /* generic shutup callback;
482 * just turning off EAPD and a little pause for avoiding pop-noise
484 static void alc_eapd_shutup(struct hda_codec
*codec
)
486 struct alc_spec
*spec
= codec
->spec
;
488 alc_auto_setup_eapd(codec
, false);
489 if (!spec
->no_depop_delay
)
491 alc_shutup_pins(codec
);
494 /* generic EAPD initialization */
495 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
497 alc_fill_eapd_coef(codec
);
498 alc_auto_setup_eapd(codec
, true);
501 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
504 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
507 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
509 case ALC_INIT_DEFAULT
:
510 switch (codec
->core
.vendor_id
) {
512 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
518 alc_update_coef_idx(codec
, 7, 0, 0x2030);
521 alc888_coef_init(codec
);
528 /* get a primary headphone pin if available */
529 static hda_nid_t
alc_get_hp_pin(struct alc_spec
*spec
)
531 if (spec
->gen
.autocfg
.hp_pins
[0])
532 return spec
->gen
.autocfg
.hp_pins
[0];
533 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
534 return spec
->gen
.autocfg
.line_out_pins
[0];
539 * Realtek SSID verification
542 /* Could be any non-zero and even value. When used as fixup, tells
543 * the driver to ignore any present sku defines.
545 #define ALC_FIXUP_SKU_IGNORE (2)
547 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
548 const struct hda_fixup
*fix
, int action
)
550 struct alc_spec
*spec
= codec
->spec
;
551 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
552 spec
->cdefine
.fixup
= 1;
553 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
557 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
558 const struct hda_fixup
*fix
, int action
)
560 struct alc_spec
*spec
= codec
->spec
;
562 if (action
== HDA_FIXUP_ACT_PROBE
) {
563 spec
->no_depop_delay
= 1;
564 codec
->depop_delay
= 0;
568 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
570 unsigned int ass
, tmp
, i
;
572 struct alc_spec
*spec
= codec
->spec
;
574 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
576 if (spec
->cdefine
.fixup
) {
577 ass
= spec
->cdefine
.sku_cfg
;
578 if (ass
== ALC_FIXUP_SKU_IGNORE
)
583 if (!codec
->bus
->pci
)
585 ass
= codec
->core
.subsystem_id
& 0xffff;
586 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
590 if (codec
->core
.vendor_id
== 0x10ec0260)
592 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
595 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
596 codec
->core
.chip_name
, ass
);
602 for (i
= 1; i
< 16; i
++) {
606 if (((ass
>> 16) & 0xf) != tmp
)
609 spec
->cdefine
.port_connectivity
= ass
>> 30;
610 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
611 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
612 spec
->cdefine
.customization
= ass
>> 8;
614 spec
->cdefine
.sku_cfg
= ass
;
615 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
616 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
617 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
618 spec
->cdefine
.override
= ass
& 0x1;
620 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
621 nid
, spec
->cdefine
.sku_cfg
);
622 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
623 spec
->cdefine
.port_connectivity
);
624 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
625 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
626 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
627 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
628 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
629 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
630 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
635 /* return the position of NID in the list, or -1 if not found */
636 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
639 for (i
= 0; i
< nums
; i
++)
644 /* return true if the given NID is found in the list */
645 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
647 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
650 /* check subsystem ID and set up device-specific initialization;
651 * return 1 if initialized, 0 if invalid SSID
653 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
654 * 31 ~ 16 : Manufacture ID
656 * 7 ~ 0 : Assembly ID
657 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
659 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
661 unsigned int ass
, tmp
, i
;
663 struct alc_spec
*spec
= codec
->spec
;
665 if (spec
->cdefine
.fixup
) {
666 ass
= spec
->cdefine
.sku_cfg
;
667 if (ass
== ALC_FIXUP_SKU_IGNORE
)
672 ass
= codec
->core
.subsystem_id
& 0xffff;
673 if (codec
->bus
->pci
&&
674 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
677 /* invalid SSID, check the special NID pin defcfg instead */
679 * 31~30 : port connectivity
682 * 19~16 : Check sum (15:1)
687 if (codec
->core
.vendor_id
== 0x10ec0260)
689 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
691 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
695 if ((ass
>> 30) != 1) /* no physical connection */
700 for (i
= 1; i
< 16; i
++) {
704 if (((ass
>> 16) & 0xf) != tmp
)
707 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
708 ass
& 0xffff, codec
->core
.vendor_id
);
712 * 2 : 0 --> Desktop, 1 --> Laptop
713 * 3~5 : External Amplifier control
716 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
719 spec
->init_amp
= ALC_INIT_GPIO1
;
722 spec
->init_amp
= ALC_INIT_GPIO2
;
725 spec
->init_amp
= ALC_INIT_GPIO3
;
729 spec
->init_amp
= ALC_INIT_DEFAULT
;
733 /* is laptop or Desktop and enable the function "Mute internal speaker
734 * when the external headphone out jack is plugged"
739 * 10~8 : Jack location
740 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
742 * 15 : 1 --> enable the function "Mute internal speaker
743 * when the external headphone out jack is plugged"
745 if (!alc_get_hp_pin(spec
)) {
747 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
749 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
750 spec
->gen
.autocfg
.line_outs
))
752 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
757 /* Check the validity of ALC subsystem-id
758 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
759 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
761 if (!alc_subsystem_id(codec
, ports
)) {
762 struct alc_spec
*spec
= codec
->spec
;
764 "realtek: Enable default setup for auto mode as fallback\n");
765 spec
->init_amp
= ALC_INIT_DEFAULT
;
772 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
773 const struct hda_fixup
*fix
, int action
)
775 struct alc_spec
*spec
= codec
->spec
;
777 spec
->gen
.inv_dmic_split
= 1;
781 #ifdef CONFIG_SND_HDA_INPUT_BEEP
782 /* additional beep mixers; the actual parameters are overwritten at build */
783 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
784 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
785 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
790 static int alc_build_controls(struct hda_codec
*codec
)
792 struct alc_spec
*spec
= codec
->spec
;
795 err
= snd_hda_gen_build_controls(codec
);
799 for (i
= 0; i
< spec
->num_mixers
; i
++) {
800 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
805 #ifdef CONFIG_SND_HDA_INPUT_BEEP
806 /* create beep controls if needed */
807 if (spec
->beep_amp
) {
808 const struct snd_kcontrol_new
*knew
;
809 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
810 struct snd_kcontrol
*kctl
;
811 kctl
= snd_ctl_new1(knew
, codec
);
814 kctl
->private_value
= spec
->beep_amp
;
815 err
= snd_hda_ctl_add(codec
, 0, kctl
);
822 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
831 static int alc_init(struct hda_codec
*codec
)
833 struct alc_spec
*spec
= codec
->spec
;
836 spec
->init_hook(codec
);
838 spec
->gen
.skip_verbs
= 1; /* applied in below */
839 snd_hda_gen_init(codec
);
841 alc_auto_init_amp(codec
, spec
->init_amp
);
842 snd_hda_apply_verbs(codec
); /* apply verbs here after own init */
844 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
849 static inline void alc_shutup(struct hda_codec
*codec
)
851 struct alc_spec
*spec
= codec
->spec
;
853 if (spec
&& spec
->shutup
)
856 alc_shutup_pins(codec
);
859 static void alc_reboot_notify(struct hda_codec
*codec
)
861 struct alc_spec
*spec
= codec
->spec
;
863 if (spec
&& spec
->reboot_notify
)
864 spec
->reboot_notify(codec
);
869 #define alc_free snd_hda_gen_free
872 static void alc_power_eapd(struct hda_codec
*codec
)
874 alc_auto_setup_eapd(codec
, false);
877 static int alc_suspend(struct hda_codec
*codec
)
879 struct alc_spec
*spec
= codec
->spec
;
881 if (spec
&& spec
->power_hook
)
882 spec
->power_hook(codec
);
888 static int alc_resume(struct hda_codec
*codec
)
890 struct alc_spec
*spec
= codec
->spec
;
892 if (!spec
->no_depop_delay
)
893 msleep(150); /* to avoid pop noise */
894 codec
->patch_ops
.init(codec
);
895 regcache_sync(codec
->core
.regmap
);
896 hda_call_check_power_status(codec
, 0x01);
903 static const struct hda_codec_ops alc_patch_ops
= {
904 .build_controls
= alc_build_controls
,
905 .build_pcms
= snd_hda_gen_build_pcms
,
908 .unsol_event
= snd_hda_jack_unsol_event
,
910 .resume
= alc_resume
,
911 .suspend
= alc_suspend
,
912 .check_power_status
= snd_hda_gen_check_power_status
,
914 .reboot_notify
= alc_reboot_notify
,
918 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
921 * Rename codecs appropriately from COEF value or subvendor id
923 struct alc_codec_rename_table
{
924 unsigned int vendor_id
;
925 unsigned short coef_mask
;
926 unsigned short coef_bits
;
930 struct alc_codec_rename_pci_table
{
931 unsigned int codec_vendor_id
;
932 unsigned short pci_subvendor
;
933 unsigned short pci_subdevice
;
937 static struct alc_codec_rename_table rename_tbl
[] = {
938 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
939 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
940 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
941 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
942 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
943 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
944 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
945 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
946 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
947 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
948 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
949 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
950 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
951 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
952 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
953 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
954 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
958 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
959 { 0x10ec0280, 0x1028, 0, "ALC3220" },
960 { 0x10ec0282, 0x1028, 0, "ALC3221" },
961 { 0x10ec0283, 0x1028, 0, "ALC3223" },
962 { 0x10ec0288, 0x1028, 0, "ALC3263" },
963 { 0x10ec0292, 0x1028, 0, "ALC3226" },
964 { 0x10ec0293, 0x1028, 0, "ALC3235" },
965 { 0x10ec0255, 0x1028, 0, "ALC3234" },
966 { 0x10ec0668, 0x1028, 0, "ALC3661" },
967 { 0x10ec0275, 0x1028, 0, "ALC3260" },
968 { 0x10ec0899, 0x1028, 0, "ALC3861" },
969 { 0x10ec0298, 0x1028, 0, "ALC3266" },
970 { 0x10ec0236, 0x1028, 0, "ALC3204" },
971 { 0x10ec0256, 0x1028, 0, "ALC3246" },
972 { 0x10ec0225, 0x1028, 0, "ALC3253" },
973 { 0x10ec0295, 0x1028, 0, "ALC3254" },
974 { 0x10ec0299, 0x1028, 0, "ALC3271" },
975 { 0x10ec0670, 0x1025, 0, "ALC669X" },
976 { 0x10ec0676, 0x1025, 0, "ALC679X" },
977 { 0x10ec0282, 0x1043, 0, "ALC3229" },
978 { 0x10ec0233, 0x1043, 0, "ALC3236" },
979 { 0x10ec0280, 0x103c, 0, "ALC3228" },
980 { 0x10ec0282, 0x103c, 0, "ALC3227" },
981 { 0x10ec0286, 0x103c, 0, "ALC3242" },
982 { 0x10ec0290, 0x103c, 0, "ALC3241" },
983 { 0x10ec0668, 0x103c, 0, "ALC3662" },
984 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
985 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
989 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
991 const struct alc_codec_rename_table
*p
;
992 const struct alc_codec_rename_pci_table
*q
;
994 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
995 if (p
->vendor_id
!= codec
->core
.vendor_id
)
997 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
998 return alc_codec_rename(codec
, p
->name
);
1001 if (!codec
->bus
->pci
)
1003 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
1004 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
1006 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
1008 if (!q
->pci_subdevice
||
1009 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
1010 return alc_codec_rename(codec
, q
->name
);
1018 * Digital-beep handlers
1020 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1021 #define set_beep_amp(spec, nid, idx, dir) \
1022 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1024 static const struct snd_pci_quirk beep_white_list
[] = {
1025 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1026 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1027 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1028 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1029 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1030 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1031 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1032 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1033 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1034 /* blacklist -- no beep available */
1035 SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0),
1036 SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0),
1040 static inline int has_cdefine_beep(struct hda_codec
*codec
)
1042 struct alc_spec
*spec
= codec
->spec
;
1043 const struct snd_pci_quirk
*q
;
1044 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
1047 return spec
->cdefine
.enable_pcbeep
;
1050 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
1051 #define has_cdefine_beep(codec) 0
1054 /* parse the BIOS configuration and set up the alc_spec */
1055 /* return 1 if successful, 0 if the proper config is not found,
1056 * or a negative error code
1058 static int alc_parse_auto_config(struct hda_codec
*codec
,
1059 const hda_nid_t
*ignore_nids
,
1060 const hda_nid_t
*ssid_nids
)
1062 struct alc_spec
*spec
= codec
->spec
;
1063 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1066 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1072 alc_ssid_check(codec
, ssid_nids
);
1074 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1081 /* common preparation job for alc_spec */
1082 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1084 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1090 snd_hda_gen_spec_init(&spec
->gen
);
1091 spec
->gen
.mixer_nid
= mixer_nid
;
1092 spec
->gen
.own_eapd_ctl
= 1;
1093 codec
->single_adc_amp
= 1;
1094 /* FIXME: do we need this for all Realtek codec models? */
1095 codec
->spdif_status_reset
= 1;
1096 codec
->patch_ops
= alc_patch_ops
;
1098 err
= alc_codec_rename_from_preset(codec
);
1106 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1108 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1109 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1110 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1119 ALC880_FIXUP_MEDION_RIM
,
1121 ALC880_FIXUP_LG_LW25
,
1123 ALC880_FIXUP_EAPD_COEF
,
1124 ALC880_FIXUP_TCL_S700
,
1125 ALC880_FIXUP_VOL_KNOB
,
1126 ALC880_FIXUP_FUJITSU
,
1128 ALC880_FIXUP_UNIWILL
,
1129 ALC880_FIXUP_UNIWILL_DIG
,
1131 ALC880_FIXUP_ASUS_W5A
,
1132 ALC880_FIXUP_3ST_BASE
,
1134 ALC880_FIXUP_3ST_DIG
,
1135 ALC880_FIXUP_5ST_BASE
,
1137 ALC880_FIXUP_5ST_DIG
,
1138 ALC880_FIXUP_6ST_BASE
,
1140 ALC880_FIXUP_6ST_DIG
,
1141 ALC880_FIXUP_6ST_AUTOMUTE
,
1144 /* enable the volume-knob widget support on NID 0x21 */
1145 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1146 const struct hda_fixup
*fix
, int action
)
1148 if (action
== HDA_FIXUP_ACT_PROBE
)
1149 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1150 alc_update_knob_master
);
1153 static const struct hda_fixup alc880_fixups
[] = {
1154 [ALC880_FIXUP_GPIO1
] = {
1155 .type
= HDA_FIXUP_VERBS
,
1156 .v
.verbs
= alc_gpio1_init_verbs
,
1158 [ALC880_FIXUP_GPIO2
] = {
1159 .type
= HDA_FIXUP_VERBS
,
1160 .v
.verbs
= alc_gpio2_init_verbs
,
1162 [ALC880_FIXUP_MEDION_RIM
] = {
1163 .type
= HDA_FIXUP_VERBS
,
1164 .v
.verbs
= (const struct hda_verb
[]) {
1165 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1166 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1170 .chain_id
= ALC880_FIXUP_GPIO2
,
1172 [ALC880_FIXUP_LG
] = {
1173 .type
= HDA_FIXUP_PINS
,
1174 .v
.pins
= (const struct hda_pintbl
[]) {
1175 /* disable bogus unused pins */
1176 { 0x16, 0x411111f0 },
1177 { 0x18, 0x411111f0 },
1178 { 0x1a, 0x411111f0 },
1182 [ALC880_FIXUP_LG_LW25
] = {
1183 .type
= HDA_FIXUP_PINS
,
1184 .v
.pins
= (const struct hda_pintbl
[]) {
1185 { 0x1a, 0x0181344f }, /* line-in */
1186 { 0x1b, 0x0321403f }, /* headphone */
1190 [ALC880_FIXUP_W810
] = {
1191 .type
= HDA_FIXUP_PINS
,
1192 .v
.pins
= (const struct hda_pintbl
[]) {
1193 /* disable bogus unused pins */
1194 { 0x17, 0x411111f0 },
1198 .chain_id
= ALC880_FIXUP_GPIO2
,
1200 [ALC880_FIXUP_EAPD_COEF
] = {
1201 .type
= HDA_FIXUP_VERBS
,
1202 .v
.verbs
= (const struct hda_verb
[]) {
1203 /* change to EAPD mode */
1204 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1205 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1209 [ALC880_FIXUP_TCL_S700
] = {
1210 .type
= HDA_FIXUP_VERBS
,
1211 .v
.verbs
= (const struct hda_verb
[]) {
1212 /* change to EAPD mode */
1213 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1214 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1218 .chain_id
= ALC880_FIXUP_GPIO2
,
1220 [ALC880_FIXUP_VOL_KNOB
] = {
1221 .type
= HDA_FIXUP_FUNC
,
1222 .v
.func
= alc880_fixup_vol_knob
,
1224 [ALC880_FIXUP_FUJITSU
] = {
1225 /* override all pins as BIOS on old Amilo is broken */
1226 .type
= HDA_FIXUP_PINS
,
1227 .v
.pins
= (const struct hda_pintbl
[]) {
1228 { 0x14, 0x0121401f }, /* HP */
1229 { 0x15, 0x99030120 }, /* speaker */
1230 { 0x16, 0x99030130 }, /* bass speaker */
1231 { 0x17, 0x411111f0 }, /* N/A */
1232 { 0x18, 0x411111f0 }, /* N/A */
1233 { 0x19, 0x01a19950 }, /* mic-in */
1234 { 0x1a, 0x411111f0 }, /* N/A */
1235 { 0x1b, 0x411111f0 }, /* N/A */
1236 { 0x1c, 0x411111f0 }, /* N/A */
1237 { 0x1d, 0x411111f0 }, /* N/A */
1238 { 0x1e, 0x01454140 }, /* SPDIF out */
1242 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1244 [ALC880_FIXUP_F1734
] = {
1245 /* almost compatible with FUJITSU, but no bass and SPDIF */
1246 .type
= HDA_FIXUP_PINS
,
1247 .v
.pins
= (const struct hda_pintbl
[]) {
1248 { 0x14, 0x0121401f }, /* HP */
1249 { 0x15, 0x99030120 }, /* speaker */
1250 { 0x16, 0x411111f0 }, /* N/A */
1251 { 0x17, 0x411111f0 }, /* N/A */
1252 { 0x18, 0x411111f0 }, /* N/A */
1253 { 0x19, 0x01a19950 }, /* mic-in */
1254 { 0x1a, 0x411111f0 }, /* N/A */
1255 { 0x1b, 0x411111f0 }, /* N/A */
1256 { 0x1c, 0x411111f0 }, /* N/A */
1257 { 0x1d, 0x411111f0 }, /* N/A */
1258 { 0x1e, 0x411111f0 }, /* N/A */
1262 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1264 [ALC880_FIXUP_UNIWILL
] = {
1265 /* need to fix HP and speaker pins to be parsed correctly */
1266 .type
= HDA_FIXUP_PINS
,
1267 .v
.pins
= (const struct hda_pintbl
[]) {
1268 { 0x14, 0x0121411f }, /* HP */
1269 { 0x15, 0x99030120 }, /* speaker */
1270 { 0x16, 0x99030130 }, /* bass speaker */
1274 [ALC880_FIXUP_UNIWILL_DIG
] = {
1275 .type
= HDA_FIXUP_PINS
,
1276 .v
.pins
= (const struct hda_pintbl
[]) {
1277 /* disable bogus unused pins */
1278 { 0x17, 0x411111f0 },
1279 { 0x19, 0x411111f0 },
1280 { 0x1b, 0x411111f0 },
1281 { 0x1f, 0x411111f0 },
1285 [ALC880_FIXUP_Z71V
] = {
1286 .type
= HDA_FIXUP_PINS
,
1287 .v
.pins
= (const struct hda_pintbl
[]) {
1288 /* set up the whole pins as BIOS is utterly broken */
1289 { 0x14, 0x99030120 }, /* speaker */
1290 { 0x15, 0x0121411f }, /* HP */
1291 { 0x16, 0x411111f0 }, /* N/A */
1292 { 0x17, 0x411111f0 }, /* N/A */
1293 { 0x18, 0x01a19950 }, /* mic-in */
1294 { 0x19, 0x411111f0 }, /* N/A */
1295 { 0x1a, 0x01813031 }, /* line-in */
1296 { 0x1b, 0x411111f0 }, /* N/A */
1297 { 0x1c, 0x411111f0 }, /* N/A */
1298 { 0x1d, 0x411111f0 }, /* N/A */
1299 { 0x1e, 0x0144111e }, /* SPDIF */
1303 [ALC880_FIXUP_ASUS_W5A
] = {
1304 .type
= HDA_FIXUP_PINS
,
1305 .v
.pins
= (const struct hda_pintbl
[]) {
1306 /* set up the whole pins as BIOS is utterly broken */
1307 { 0x14, 0x0121411f }, /* HP */
1308 { 0x15, 0x411111f0 }, /* N/A */
1309 { 0x16, 0x411111f0 }, /* N/A */
1310 { 0x17, 0x411111f0 }, /* N/A */
1311 { 0x18, 0x90a60160 }, /* mic */
1312 { 0x19, 0x411111f0 }, /* N/A */
1313 { 0x1a, 0x411111f0 }, /* N/A */
1314 { 0x1b, 0x411111f0 }, /* N/A */
1315 { 0x1c, 0x411111f0 }, /* N/A */
1316 { 0x1d, 0x411111f0 }, /* N/A */
1317 { 0x1e, 0xb743111e }, /* SPDIF out */
1321 .chain_id
= ALC880_FIXUP_GPIO1
,
1323 [ALC880_FIXUP_3ST_BASE
] = {
1324 .type
= HDA_FIXUP_PINS
,
1325 .v
.pins
= (const struct hda_pintbl
[]) {
1326 { 0x14, 0x01014010 }, /* line-out */
1327 { 0x15, 0x411111f0 }, /* N/A */
1328 { 0x16, 0x411111f0 }, /* N/A */
1329 { 0x17, 0x411111f0 }, /* N/A */
1330 { 0x18, 0x01a19c30 }, /* mic-in */
1331 { 0x19, 0x0121411f }, /* HP */
1332 { 0x1a, 0x01813031 }, /* line-in */
1333 { 0x1b, 0x02a19c40 }, /* front-mic */
1334 { 0x1c, 0x411111f0 }, /* N/A */
1335 { 0x1d, 0x411111f0 }, /* N/A */
1336 /* 0x1e is filled in below */
1337 { 0x1f, 0x411111f0 }, /* N/A */
1341 [ALC880_FIXUP_3ST
] = {
1342 .type
= HDA_FIXUP_PINS
,
1343 .v
.pins
= (const struct hda_pintbl
[]) {
1344 { 0x1e, 0x411111f0 }, /* N/A */
1348 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1350 [ALC880_FIXUP_3ST_DIG
] = {
1351 .type
= HDA_FIXUP_PINS
,
1352 .v
.pins
= (const struct hda_pintbl
[]) {
1353 { 0x1e, 0x0144111e }, /* SPDIF */
1357 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1359 [ALC880_FIXUP_5ST_BASE
] = {
1360 .type
= HDA_FIXUP_PINS
,
1361 .v
.pins
= (const struct hda_pintbl
[]) {
1362 { 0x14, 0x01014010 }, /* front */
1363 { 0x15, 0x411111f0 }, /* N/A */
1364 { 0x16, 0x01011411 }, /* CLFE */
1365 { 0x17, 0x01016412 }, /* surr */
1366 { 0x18, 0x01a19c30 }, /* mic-in */
1367 { 0x19, 0x0121411f }, /* HP */
1368 { 0x1a, 0x01813031 }, /* line-in */
1369 { 0x1b, 0x02a19c40 }, /* front-mic */
1370 { 0x1c, 0x411111f0 }, /* N/A */
1371 { 0x1d, 0x411111f0 }, /* N/A */
1372 /* 0x1e is filled in below */
1373 { 0x1f, 0x411111f0 }, /* N/A */
1377 [ALC880_FIXUP_5ST
] = {
1378 .type
= HDA_FIXUP_PINS
,
1379 .v
.pins
= (const struct hda_pintbl
[]) {
1380 { 0x1e, 0x411111f0 }, /* N/A */
1384 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1386 [ALC880_FIXUP_5ST_DIG
] = {
1387 .type
= HDA_FIXUP_PINS
,
1388 .v
.pins
= (const struct hda_pintbl
[]) {
1389 { 0x1e, 0x0144111e }, /* SPDIF */
1393 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1395 [ALC880_FIXUP_6ST_BASE
] = {
1396 .type
= HDA_FIXUP_PINS
,
1397 .v
.pins
= (const struct hda_pintbl
[]) {
1398 { 0x14, 0x01014010 }, /* front */
1399 { 0x15, 0x01016412 }, /* surr */
1400 { 0x16, 0x01011411 }, /* CLFE */
1401 { 0x17, 0x01012414 }, /* side */
1402 { 0x18, 0x01a19c30 }, /* mic-in */
1403 { 0x19, 0x02a19c40 }, /* front-mic */
1404 { 0x1a, 0x01813031 }, /* line-in */
1405 { 0x1b, 0x0121411f }, /* HP */
1406 { 0x1c, 0x411111f0 }, /* N/A */
1407 { 0x1d, 0x411111f0 }, /* N/A */
1408 /* 0x1e is filled in below */
1409 { 0x1f, 0x411111f0 }, /* N/A */
1413 [ALC880_FIXUP_6ST
] = {
1414 .type
= HDA_FIXUP_PINS
,
1415 .v
.pins
= (const struct hda_pintbl
[]) {
1416 { 0x1e, 0x411111f0 }, /* N/A */
1420 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1422 [ALC880_FIXUP_6ST_DIG
] = {
1423 .type
= HDA_FIXUP_PINS
,
1424 .v
.pins
= (const struct hda_pintbl
[]) {
1425 { 0x1e, 0x0144111e }, /* SPDIF */
1429 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1431 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1432 .type
= HDA_FIXUP_PINS
,
1433 .v
.pins
= (const struct hda_pintbl
[]) {
1434 { 0x1b, 0x0121401f }, /* HP with jack detect */
1437 .chained_before
= true,
1438 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1442 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1443 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1444 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1445 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1446 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1447 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1448 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1449 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1450 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1451 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1452 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1453 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1454 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1455 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1456 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1457 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1458 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1459 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1460 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1461 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1462 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1463 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1464 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1465 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1467 /* Below is the copied entries from alc880_quirks.c.
1468 * It's not quite sure whether BIOS sets the correct pin-config table
1469 * on these machines, thus they are kept to be compatible with
1470 * the old static quirks. Once when it's confirmed to work without
1471 * these overrides, it'd be better to remove.
1473 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1474 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1475 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1476 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1477 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1478 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1479 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1480 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1481 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1482 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1483 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1484 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1485 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1486 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1487 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1488 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1489 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1490 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1491 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1492 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1493 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1494 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1495 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1496 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1497 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1498 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1499 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1500 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1501 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1502 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1503 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1504 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1505 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1507 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1508 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1509 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1513 static const struct hda_model_fixup alc880_fixup_models
[] = {
1514 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1515 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1516 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1517 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1518 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1519 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1520 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1526 * OK, here we have finally the patch for ALC880
1528 static int patch_alc880(struct hda_codec
*codec
)
1530 struct alc_spec
*spec
;
1533 err
= alc_alloc_spec(codec
, 0x0b);
1538 spec
->gen
.need_dac_fix
= 1;
1539 spec
->gen
.beep_nid
= 0x01;
1541 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1543 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1545 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1547 /* automatic parse from the BIOS config */
1548 err
= alc880_parse_auto_config(codec
);
1552 if (!spec
->gen
.no_analog
)
1553 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1555 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1568 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1570 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1571 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1572 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1579 ALC260_FIXUP_HP_DC5750
,
1580 ALC260_FIXUP_HP_PIN_0F
,
1583 ALC260_FIXUP_GPIO1_TOGGLE
,
1584 ALC260_FIXUP_REPLACER
,
1585 ALC260_FIXUP_HP_B1900
,
1587 ALC260_FIXUP_FSC_S7020
,
1588 ALC260_FIXUP_FSC_S7020_JWSE
,
1589 ALC260_FIXUP_VAIO_PINS
,
1592 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1594 struct alc_spec
*spec
= codec
->spec
;
1595 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
1596 spec
->gen
.hp_jack_present
);
1599 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1600 const struct hda_fixup
*fix
, int action
)
1602 struct alc_spec
*spec
= codec
->spec
;
1603 if (action
== HDA_FIXUP_ACT_PROBE
) {
1604 /* although the machine has only one output pin, we need to
1605 * toggle GPIO1 according to the jack state
1607 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1608 spec
->gen
.detect_hp
= 1;
1609 spec
->gen
.automute_speaker
= 1;
1610 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1611 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1612 snd_hda_gen_hp_automute
);
1613 snd_hda_add_verbs(codec
, alc_gpio1_init_verbs
);
1617 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1618 const struct hda_fixup
*fix
, int action
)
1620 struct alc_spec
*spec
= codec
->spec
;
1621 static const struct hda_pintbl pincfgs
[] = {
1622 { 0x0f, 0x02214000 }, /* HP/speaker */
1623 { 0x12, 0x90a60160 }, /* int mic */
1624 { 0x13, 0x02a19000 }, /* ext mic */
1625 { 0x18, 0x01446000 }, /* SPDIF out */
1626 /* disable bogus I/O pins */
1627 { 0x10, 0x411111f0 },
1628 { 0x11, 0x411111f0 },
1629 { 0x14, 0x411111f0 },
1630 { 0x15, 0x411111f0 },
1631 { 0x16, 0x411111f0 },
1632 { 0x17, 0x411111f0 },
1633 { 0x19, 0x411111f0 },
1638 case HDA_FIXUP_ACT_PRE_PROBE
:
1639 snd_hda_apply_pincfgs(codec
, pincfgs
);
1641 case HDA_FIXUP_ACT_PROBE
:
1642 spec
->init_amp
= ALC_INIT_NONE
;
1647 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1648 const struct hda_fixup
*fix
, int action
)
1650 struct alc_spec
*spec
= codec
->spec
;
1651 if (action
== HDA_FIXUP_ACT_PROBE
)
1652 spec
->init_amp
= ALC_INIT_NONE
;
1655 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1656 const struct hda_fixup
*fix
, int action
)
1658 struct alc_spec
*spec
= codec
->spec
;
1659 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1660 spec
->gen
.add_jack_modes
= 1;
1661 spec
->gen
.hp_mic
= 1;
1665 static const struct hda_fixup alc260_fixups
[] = {
1666 [ALC260_FIXUP_HP_DC5750
] = {
1667 .type
= HDA_FIXUP_PINS
,
1668 .v
.pins
= (const struct hda_pintbl
[]) {
1669 { 0x11, 0x90130110 }, /* speaker */
1673 [ALC260_FIXUP_HP_PIN_0F
] = {
1674 .type
= HDA_FIXUP_PINS
,
1675 .v
.pins
= (const struct hda_pintbl
[]) {
1676 { 0x0f, 0x01214000 }, /* HP */
1680 [ALC260_FIXUP_COEF
] = {
1681 .type
= HDA_FIXUP_VERBS
,
1682 .v
.verbs
= (const struct hda_verb
[]) {
1683 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1684 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1688 [ALC260_FIXUP_GPIO1
] = {
1689 .type
= HDA_FIXUP_VERBS
,
1690 .v
.verbs
= alc_gpio1_init_verbs
,
1692 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1693 .type
= HDA_FIXUP_FUNC
,
1694 .v
.func
= alc260_fixup_gpio1_toggle
,
1696 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1698 [ALC260_FIXUP_REPLACER
] = {
1699 .type
= HDA_FIXUP_VERBS
,
1700 .v
.verbs
= (const struct hda_verb
[]) {
1701 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1702 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1706 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1708 [ALC260_FIXUP_HP_B1900
] = {
1709 .type
= HDA_FIXUP_FUNC
,
1710 .v
.func
= alc260_fixup_gpio1_toggle
,
1712 .chain_id
= ALC260_FIXUP_COEF
,
1714 [ALC260_FIXUP_KN1
] = {
1715 .type
= HDA_FIXUP_FUNC
,
1716 .v
.func
= alc260_fixup_kn1
,
1718 [ALC260_FIXUP_FSC_S7020
] = {
1719 .type
= HDA_FIXUP_FUNC
,
1720 .v
.func
= alc260_fixup_fsc_s7020
,
1722 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1723 .type
= HDA_FIXUP_FUNC
,
1724 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1726 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1728 [ALC260_FIXUP_VAIO_PINS
] = {
1729 .type
= HDA_FIXUP_PINS
,
1730 .v
.pins
= (const struct hda_pintbl
[]) {
1731 /* Pin configs are missing completely on some VAIOs */
1732 { 0x0f, 0x01211020 },
1733 { 0x10, 0x0001003f },
1734 { 0x11, 0x411111f0 },
1735 { 0x12, 0x01a15930 },
1736 { 0x13, 0x411111f0 },
1737 { 0x14, 0x411111f0 },
1738 { 0x15, 0x411111f0 },
1739 { 0x16, 0x411111f0 },
1740 { 0x17, 0x411111f0 },
1741 { 0x18, 0x411111f0 },
1742 { 0x19, 0x411111f0 },
1748 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1749 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1750 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1751 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1752 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1753 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1754 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1755 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1756 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1757 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1758 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1759 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1760 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1764 static const struct hda_model_fixup alc260_fixup_models
[] = {
1765 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1766 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1767 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1768 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1774 static int patch_alc260(struct hda_codec
*codec
)
1776 struct alc_spec
*spec
;
1779 err
= alc_alloc_spec(codec
, 0x07);
1784 /* as quite a few machines require HP amp for speaker outputs,
1785 * it's easier to enable it unconditionally; even if it's unneeded,
1786 * it's almost harmless.
1788 spec
->gen
.prefer_hp_amp
= 1;
1789 spec
->gen
.beep_nid
= 0x01;
1791 spec
->shutup
= alc_eapd_shutup
;
1793 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1795 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1797 /* automatic parse from the BIOS config */
1798 err
= alc260_parse_auto_config(codec
);
1802 if (!spec
->gen
.no_analog
)
1803 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1805 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1816 * ALC882/883/885/888/889 support
1818 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1819 * configuration. Each pin widget can choose any input DACs and a mixer.
1820 * Each ADC is connected from a mixer of all inputs. This makes possible
1821 * 6-channel independent captures.
1823 * In addition, an independent DAC for the multi-playback (not used in this
1831 ALC882_FIXUP_ABIT_AW9D_MAX
,
1832 ALC882_FIXUP_LENOVO_Y530
,
1833 ALC882_FIXUP_PB_M5210
,
1834 ALC882_FIXUP_ACER_ASPIRE_7736
,
1835 ALC882_FIXUP_ASUS_W90V
,
1837 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1838 ALC889_FIXUP_VAIO_TT
,
1839 ALC888_FIXUP_EEE1601
,
1842 ALC883_FIXUP_ACER_EAPD
,
1847 ALC882_FIXUP_ASUS_W2JC
,
1848 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1849 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1850 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1851 ALC885_FIXUP_MACPRO_GPIO
,
1852 ALC889_FIXUP_DAC_ROUTE
,
1853 ALC889_FIXUP_MBP_VREF
,
1854 ALC889_FIXUP_IMAC91_VREF
,
1855 ALC889_FIXUP_MBA11_VREF
,
1856 ALC889_FIXUP_MBA21_VREF
,
1857 ALC889_FIXUP_MP11_VREF
,
1858 ALC889_FIXUP_MP41_VREF
,
1859 ALC882_FIXUP_INV_DMIC
,
1860 ALC882_FIXUP_NO_PRIMARY_HP
,
1861 ALC887_FIXUP_ASUS_BASS
,
1862 ALC887_FIXUP_BASS_CHMAP
,
1863 ALC1220_FIXUP_GB_DUAL_CODECS
,
1864 ALC1220_FIXUP_CLEVO_P950
,
1865 ALC1220_FIXUP_CLEVO_PB51ED
,
1866 ALC1220_FIXUP_CLEVO_PB51ED_PINS
,
1869 static void alc889_fixup_coef(struct hda_codec
*codec
,
1870 const struct hda_fixup
*fix
, int action
)
1872 if (action
!= HDA_FIXUP_ACT_INIT
)
1874 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1877 /* toggle speaker-output according to the hp-jack state */
1878 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
1880 unsigned int gpiostate
, gpiomask
, gpiodir
;
1882 gpiostate
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1883 AC_VERB_GET_GPIO_DATA
, 0);
1886 gpiostate
|= (1 << pin
);
1888 gpiostate
&= ~(1 << pin
);
1890 gpiomask
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1891 AC_VERB_GET_GPIO_MASK
, 0);
1892 gpiomask
|= (1 << pin
);
1894 gpiodir
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1895 AC_VERB_GET_GPIO_DIRECTION
, 0);
1896 gpiodir
|= (1 << pin
);
1899 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1900 AC_VERB_SET_GPIO_MASK
, gpiomask
);
1901 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1902 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
1906 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1907 AC_VERB_SET_GPIO_DATA
, gpiostate
);
1910 /* set up GPIO at initialization */
1911 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1912 const struct hda_fixup
*fix
, int action
)
1914 if (action
!= HDA_FIXUP_ACT_INIT
)
1916 alc882_gpio_mute(codec
, 0, 0);
1917 alc882_gpio_mute(codec
, 1, 0);
1920 /* Fix the connection of some pins for ALC889:
1921 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1922 * work correctly (bko#42740)
1924 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1925 const struct hda_fixup
*fix
, int action
)
1927 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1928 /* fake the connections during parsing the tree */
1929 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1930 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1931 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1932 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1933 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1934 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1935 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1936 /* restore the connections */
1937 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1938 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1939 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1940 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1941 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1945 /* Set VREF on HP pin */
1946 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1947 const struct hda_fixup
*fix
, int action
)
1949 struct alc_spec
*spec
= codec
->spec
;
1950 static hda_nid_t nids
[3] = { 0x14, 0x15, 0x19 };
1953 if (action
!= HDA_FIXUP_ACT_INIT
)
1955 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1956 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1957 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1959 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1960 val
|= AC_PINCTL_VREF_80
;
1961 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1962 spec
->gen
.keep_vref_in_automute
= 1;
1967 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1968 const hda_nid_t
*nids
, int num_nids
)
1970 struct alc_spec
*spec
= codec
->spec
;
1973 for (i
= 0; i
< num_nids
; i
++) {
1975 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1976 val
|= AC_PINCTL_VREF_50
;
1977 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1979 spec
->gen
.keep_vref_in_automute
= 1;
1982 /* Set VREF on speaker pins on imac91 */
1983 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1984 const struct hda_fixup
*fix
, int action
)
1986 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1988 if (action
== HDA_FIXUP_ACT_INIT
)
1989 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1992 /* Set VREF on speaker pins on mba11 */
1993 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1994 const struct hda_fixup
*fix
, int action
)
1996 static hda_nid_t nids
[1] = { 0x18 };
1998 if (action
== HDA_FIXUP_ACT_INIT
)
1999 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2002 /* Set VREF on speaker pins on mba21 */
2003 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
2004 const struct hda_fixup
*fix
, int action
)
2006 static hda_nid_t nids
[2] = { 0x18, 0x19 };
2008 if (action
== HDA_FIXUP_ACT_INIT
)
2009 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2012 /* Don't take HP output as primary
2013 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2014 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2016 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
2017 const struct hda_fixup
*fix
, int action
)
2019 struct alc_spec
*spec
= codec
->spec
;
2020 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
2021 spec
->gen
.no_primary_hp
= 1;
2022 spec
->gen
.no_multi_io
= 1;
2026 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
2027 const struct hda_fixup
*fix
, int action
);
2029 /* For dual-codec configuration, we need to disable some features to avoid
2030 * conflicts of kctls and PCM streams
2032 static void alc_fixup_dual_codecs(struct hda_codec
*codec
,
2033 const struct hda_fixup
*fix
, int action
)
2035 struct alc_spec
*spec
= codec
->spec
;
2037 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2039 /* disable vmaster */
2040 spec
->gen
.suppress_vmaster
= 1;
2041 /* auto-mute and auto-mic switch don't work with multiple codecs */
2042 spec
->gen
.suppress_auto_mute
= 1;
2043 spec
->gen
.suppress_auto_mic
= 1;
2044 /* disable aamix as well */
2045 spec
->gen
.mixer_nid
= 0;
2046 /* add location prefix to avoid conflicts */
2047 codec
->force_pin_prefix
= 1;
2050 static void rename_ctl(struct hda_codec
*codec
, const char *oldname
,
2051 const char *newname
)
2053 struct snd_kcontrol
*kctl
;
2055 kctl
= snd_hda_find_mixer_ctl(codec
, oldname
);
2057 strcpy(kctl
->id
.name
, newname
);
2060 static void alc1220_fixup_gb_dual_codecs(struct hda_codec
*codec
,
2061 const struct hda_fixup
*fix
,
2064 alc_fixup_dual_codecs(codec
, fix
, action
);
2066 case HDA_FIXUP_ACT_PRE_PROBE
:
2067 /* override card longname to provide a unique UCM profile */
2068 strcpy(codec
->card
->longname
, "HDAudio-Gigabyte-ALC1220DualCodecs");
2070 case HDA_FIXUP_ACT_BUILD
:
2071 /* rename Capture controls depending on the codec */
2072 rename_ctl(codec
, "Capture Volume",
2074 "Rear-Panel Capture Volume" :
2075 "Front-Panel Capture Volume");
2076 rename_ctl(codec
, "Capture Switch",
2078 "Rear-Panel Capture Switch" :
2079 "Front-Panel Capture Switch");
2084 static void alc1220_fixup_clevo_p950(struct hda_codec
*codec
,
2085 const struct hda_fixup
*fix
,
2088 hda_nid_t conn1
[1] = { 0x0c };
2090 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2093 alc_update_coef_idx(codec
, 0x7, 0, 0x3c3);
2094 /* We therefore want to make sure 0x14 (front headphone) and
2095 * 0x1b (speakers) use the stereo DAC 0x02
2097 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
2098 snd_hda_override_conn_list(codec
, 0x1b, 1, conn1
);
2101 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
2102 const struct hda_fixup
*fix
, int action
);
2104 static void alc1220_fixup_clevo_pb51ed(struct hda_codec
*codec
,
2105 const struct hda_fixup
*fix
,
2108 alc1220_fixup_clevo_p950(codec
, fix
, action
);
2109 alc_fixup_headset_mode_no_hp_mic(codec
, fix
, action
);
2112 static const struct hda_fixup alc882_fixups
[] = {
2113 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2114 .type
= HDA_FIXUP_PINS
,
2115 .v
.pins
= (const struct hda_pintbl
[]) {
2116 { 0x15, 0x01080104 }, /* side */
2117 { 0x16, 0x01011012 }, /* rear */
2118 { 0x17, 0x01016011 }, /* clfe */
2122 [ALC882_FIXUP_LENOVO_Y530
] = {
2123 .type
= HDA_FIXUP_PINS
,
2124 .v
.pins
= (const struct hda_pintbl
[]) {
2125 { 0x15, 0x99130112 }, /* rear int speakers */
2126 { 0x16, 0x99130111 }, /* subwoofer */
2130 [ALC882_FIXUP_PB_M5210
] = {
2131 .type
= HDA_FIXUP_PINCTLS
,
2132 .v
.pins
= (const struct hda_pintbl
[]) {
2133 { 0x19, PIN_VREF50
},
2137 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2138 .type
= HDA_FIXUP_FUNC
,
2139 .v
.func
= alc_fixup_sku_ignore
,
2141 [ALC882_FIXUP_ASUS_W90V
] = {
2142 .type
= HDA_FIXUP_PINS
,
2143 .v
.pins
= (const struct hda_pintbl
[]) {
2144 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2148 [ALC889_FIXUP_CD
] = {
2149 .type
= HDA_FIXUP_PINS
,
2150 .v
.pins
= (const struct hda_pintbl
[]) {
2151 { 0x1c, 0x993301f0 }, /* CD */
2155 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2156 .type
= HDA_FIXUP_PINS
,
2157 .v
.pins
= (const struct hda_pintbl
[]) {
2158 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2162 .chain_id
= ALC889_FIXUP_CD
,
2164 [ALC889_FIXUP_VAIO_TT
] = {
2165 .type
= HDA_FIXUP_PINS
,
2166 .v
.pins
= (const struct hda_pintbl
[]) {
2167 { 0x17, 0x90170111 }, /* hidden surround speaker */
2171 [ALC888_FIXUP_EEE1601
] = {
2172 .type
= HDA_FIXUP_VERBS
,
2173 .v
.verbs
= (const struct hda_verb
[]) {
2174 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2175 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2179 [ALC882_FIXUP_EAPD
] = {
2180 .type
= HDA_FIXUP_VERBS
,
2181 .v
.verbs
= (const struct hda_verb
[]) {
2182 /* change to EAPD mode */
2183 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2184 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2188 [ALC883_FIXUP_EAPD
] = {
2189 .type
= HDA_FIXUP_VERBS
,
2190 .v
.verbs
= (const struct hda_verb
[]) {
2191 /* change to EAPD mode */
2192 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2193 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2197 [ALC883_FIXUP_ACER_EAPD
] = {
2198 .type
= HDA_FIXUP_VERBS
,
2199 .v
.verbs
= (const struct hda_verb
[]) {
2200 /* eanable EAPD on Acer laptops */
2201 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2202 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2206 [ALC882_FIXUP_GPIO1
] = {
2207 .type
= HDA_FIXUP_VERBS
,
2208 .v
.verbs
= alc_gpio1_init_verbs
,
2210 [ALC882_FIXUP_GPIO2
] = {
2211 .type
= HDA_FIXUP_VERBS
,
2212 .v
.verbs
= alc_gpio2_init_verbs
,
2214 [ALC882_FIXUP_GPIO3
] = {
2215 .type
= HDA_FIXUP_VERBS
,
2216 .v
.verbs
= alc_gpio3_init_verbs
,
2218 [ALC882_FIXUP_ASUS_W2JC
] = {
2219 .type
= HDA_FIXUP_VERBS
,
2220 .v
.verbs
= alc_gpio1_init_verbs
,
2222 .chain_id
= ALC882_FIXUP_EAPD
,
2224 [ALC889_FIXUP_COEF
] = {
2225 .type
= HDA_FIXUP_FUNC
,
2226 .v
.func
= alc889_fixup_coef
,
2228 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2229 .type
= HDA_FIXUP_PINS
,
2230 .v
.pins
= (const struct hda_pintbl
[]) {
2231 { 0x16, 0x99130111 }, /* CLFE speaker */
2232 { 0x17, 0x99130112 }, /* surround speaker */
2236 .chain_id
= ALC882_FIXUP_GPIO1
,
2238 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2239 .type
= HDA_FIXUP_PINS
,
2240 .v
.pins
= (const struct hda_pintbl
[]) {
2241 { 0x16, 0x99130111 }, /* CLFE speaker */
2242 { 0x1b, 0x99130112 }, /* surround speaker */
2246 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2248 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2249 /* additional init verbs for Acer Aspire 8930G */
2250 .type
= HDA_FIXUP_VERBS
,
2251 .v
.verbs
= (const struct hda_verb
[]) {
2252 /* Enable all DACs */
2253 /* DAC DISABLE/MUTE 1? */
2254 /* setting bits 1-5 disables DAC nids 0x02-0x06
2255 * apparently. Init=0x38 */
2256 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2257 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2258 /* DAC DISABLE/MUTE 2? */
2259 /* some bit here disables the other DACs.
2261 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2262 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2264 * This laptop has a stereo digital microphone.
2265 * The mics are only 1cm apart which makes the stereo
2266 * useless. However, either the mic or the ALC889
2267 * makes the signal become a difference/sum signal
2268 * instead of standard stereo, which is annoying.
2269 * So instead we flip this bit which makes the
2270 * codec replicate the sum signal to both channels,
2271 * turning it into a normal mono mic.
2273 /* DMIC_CONTROL? Init value = 0x0001 */
2274 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2275 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2276 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2277 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2281 .chain_id
= ALC882_FIXUP_GPIO1
,
2283 [ALC885_FIXUP_MACPRO_GPIO
] = {
2284 .type
= HDA_FIXUP_FUNC
,
2285 .v
.func
= alc885_fixup_macpro_gpio
,
2287 [ALC889_FIXUP_DAC_ROUTE
] = {
2288 .type
= HDA_FIXUP_FUNC
,
2289 .v
.func
= alc889_fixup_dac_route
,
2291 [ALC889_FIXUP_MBP_VREF
] = {
2292 .type
= HDA_FIXUP_FUNC
,
2293 .v
.func
= alc889_fixup_mbp_vref
,
2295 .chain_id
= ALC882_FIXUP_GPIO1
,
2297 [ALC889_FIXUP_IMAC91_VREF
] = {
2298 .type
= HDA_FIXUP_FUNC
,
2299 .v
.func
= alc889_fixup_imac91_vref
,
2301 .chain_id
= ALC882_FIXUP_GPIO1
,
2303 [ALC889_FIXUP_MBA11_VREF
] = {
2304 .type
= HDA_FIXUP_FUNC
,
2305 .v
.func
= alc889_fixup_mba11_vref
,
2307 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2309 [ALC889_FIXUP_MBA21_VREF
] = {
2310 .type
= HDA_FIXUP_FUNC
,
2311 .v
.func
= alc889_fixup_mba21_vref
,
2313 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2315 [ALC889_FIXUP_MP11_VREF
] = {
2316 .type
= HDA_FIXUP_FUNC
,
2317 .v
.func
= alc889_fixup_mba11_vref
,
2319 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2321 [ALC889_FIXUP_MP41_VREF
] = {
2322 .type
= HDA_FIXUP_FUNC
,
2323 .v
.func
= alc889_fixup_mbp_vref
,
2325 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2327 [ALC882_FIXUP_INV_DMIC
] = {
2328 .type
= HDA_FIXUP_FUNC
,
2329 .v
.func
= alc_fixup_inv_dmic
,
2331 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2332 .type
= HDA_FIXUP_FUNC
,
2333 .v
.func
= alc882_fixup_no_primary_hp
,
2335 [ALC887_FIXUP_ASUS_BASS
] = {
2336 .type
= HDA_FIXUP_PINS
,
2337 .v
.pins
= (const struct hda_pintbl
[]) {
2338 {0x16, 0x99130130}, /* bass speaker */
2342 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2344 [ALC887_FIXUP_BASS_CHMAP
] = {
2345 .type
= HDA_FIXUP_FUNC
,
2346 .v
.func
= alc_fixup_bass_chmap
,
2348 [ALC1220_FIXUP_GB_DUAL_CODECS
] = {
2349 .type
= HDA_FIXUP_FUNC
,
2350 .v
.func
= alc1220_fixup_gb_dual_codecs
,
2352 [ALC1220_FIXUP_CLEVO_P950
] = {
2353 .type
= HDA_FIXUP_FUNC
,
2354 .v
.func
= alc1220_fixup_clevo_p950
,
2356 [ALC1220_FIXUP_CLEVO_PB51ED
] = {
2357 .type
= HDA_FIXUP_FUNC
,
2358 .v
.func
= alc1220_fixup_clevo_pb51ed
,
2360 [ALC1220_FIXUP_CLEVO_PB51ED_PINS
] = {
2361 .type
= HDA_FIXUP_PINS
,
2362 .v
.pins
= (const struct hda_pintbl
[]) {
2363 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2367 .chain_id
= ALC1220_FIXUP_CLEVO_PB51ED
,
2371 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2372 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2373 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2374 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2375 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2376 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2377 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2378 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2379 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2380 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2381 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2382 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2383 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2384 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2385 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2386 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2387 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2388 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2389 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2390 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2391 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2392 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2393 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2394 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2395 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2396 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2397 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2398 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2399 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2400 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2401 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2402 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2403 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2404 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2405 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2406 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2407 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP
),
2408 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2409 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2411 /* All Apple entries are in codec SSIDs */
2412 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2413 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2414 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2415 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2416 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2417 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2418 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2419 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2420 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2421 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2422 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2423 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2424 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2425 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2426 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2427 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2428 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2429 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2430 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2431 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2432 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2433 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2435 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2436 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2437 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2438 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2439 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2440 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2441 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2442 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950
),
2443 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950
),
2444 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950
),
2445 SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950
),
2446 SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950
),
2447 SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2448 SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2449 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2450 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2451 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2452 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2456 static const struct hda_model_fixup alc882_fixup_models
[] = {
2457 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2458 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2459 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2460 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2461 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2462 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2467 * BIOS auto configuration
2469 /* almost identical with ALC880 parser... */
2470 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2472 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2473 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2474 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2479 static int patch_alc882(struct hda_codec
*codec
)
2481 struct alc_spec
*spec
;
2484 err
= alc_alloc_spec(codec
, 0x0b);
2490 switch (codec
->core
.vendor_id
) {
2497 /* ALC883 and variants */
2498 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2502 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2504 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2506 alc_auto_parse_customize_define(codec
);
2508 if (has_cdefine_beep(codec
))
2509 spec
->gen
.beep_nid
= 0x01;
2511 /* automatic parse from the BIOS config */
2512 err
= alc882_parse_auto_config(codec
);
2516 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2517 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2519 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2532 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2534 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2535 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2536 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2543 ALC262_FIXUP_FSC_H270
,
2544 ALC262_FIXUP_FSC_S7110
,
2545 ALC262_FIXUP_HP_Z200
,
2547 ALC262_FIXUP_LENOVO_3000
,
2549 ALC262_FIXUP_BENQ_T31
,
2550 ALC262_FIXUP_INV_DMIC
,
2551 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2554 static const struct hda_fixup alc262_fixups
[] = {
2555 [ALC262_FIXUP_FSC_H270
] = {
2556 .type
= HDA_FIXUP_PINS
,
2557 .v
.pins
= (const struct hda_pintbl
[]) {
2558 { 0x14, 0x99130110 }, /* speaker */
2559 { 0x15, 0x0221142f }, /* front HP */
2560 { 0x1b, 0x0121141f }, /* rear HP */
2564 [ALC262_FIXUP_FSC_S7110
] = {
2565 .type
= HDA_FIXUP_PINS
,
2566 .v
.pins
= (const struct hda_pintbl
[]) {
2567 { 0x15, 0x90170110 }, /* speaker */
2571 .chain_id
= ALC262_FIXUP_BENQ
,
2573 [ALC262_FIXUP_HP_Z200
] = {
2574 .type
= HDA_FIXUP_PINS
,
2575 .v
.pins
= (const struct hda_pintbl
[]) {
2576 { 0x16, 0x99130120 }, /* internal speaker */
2580 [ALC262_FIXUP_TYAN
] = {
2581 .type
= HDA_FIXUP_PINS
,
2582 .v
.pins
= (const struct hda_pintbl
[]) {
2583 { 0x14, 0x1993e1f0 }, /* int AUX */
2587 [ALC262_FIXUP_LENOVO_3000
] = {
2588 .type
= HDA_FIXUP_PINCTLS
,
2589 .v
.pins
= (const struct hda_pintbl
[]) {
2590 { 0x19, PIN_VREF50
},
2594 .chain_id
= ALC262_FIXUP_BENQ
,
2596 [ALC262_FIXUP_BENQ
] = {
2597 .type
= HDA_FIXUP_VERBS
,
2598 .v
.verbs
= (const struct hda_verb
[]) {
2599 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2600 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2604 [ALC262_FIXUP_BENQ_T31
] = {
2605 .type
= HDA_FIXUP_VERBS
,
2606 .v
.verbs
= (const struct hda_verb
[]) {
2607 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2608 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2612 [ALC262_FIXUP_INV_DMIC
] = {
2613 .type
= HDA_FIXUP_FUNC
,
2614 .v
.func
= alc_fixup_inv_dmic
,
2616 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2617 .type
= HDA_FIXUP_FUNC
,
2618 .v
.func
= alc_fixup_no_depop_delay
,
2622 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2623 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2624 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2625 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2626 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2627 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2628 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2629 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2630 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2631 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2632 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2636 static const struct hda_model_fixup alc262_fixup_models
[] = {
2637 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2643 static int patch_alc262(struct hda_codec
*codec
)
2645 struct alc_spec
*spec
;
2648 err
= alc_alloc_spec(codec
, 0x0b);
2653 spec
->gen
.shared_mic_vref_pin
= 0x18;
2655 spec
->shutup
= alc_eapd_shutup
;
2658 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2661 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2663 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2665 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2667 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2669 alc_auto_parse_customize_define(codec
);
2671 if (has_cdefine_beep(codec
))
2672 spec
->gen
.beep_nid
= 0x01;
2674 /* automatic parse from the BIOS config */
2675 err
= alc262_parse_auto_config(codec
);
2679 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2680 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2682 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2694 /* bind Beep switches of both NID 0x0f and 0x10 */
2695 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2696 struct snd_ctl_elem_value
*ucontrol
)
2698 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2702 mutex_lock(&codec
->control_mutex
);
2703 pval
= kcontrol
->private_value
;
2704 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2705 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2707 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2708 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2710 kcontrol
->private_value
= pval
;
2711 mutex_unlock(&codec
->control_mutex
);
2715 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2716 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2718 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2719 .name
= "Beep Playback Switch",
2720 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2721 .info
= snd_hda_mixer_amp_switch_info
,
2722 .get
= snd_hda_mixer_amp_switch_get
,
2723 .put
= alc268_beep_switch_put
,
2724 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2729 /* set PCBEEP vol = 0, mute connections */
2730 static const struct hda_verb alc268_beep_init_verbs
[] = {
2731 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2732 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2733 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2738 ALC268_FIXUP_INV_DMIC
,
2739 ALC268_FIXUP_HP_EAPD
,
2743 static const struct hda_fixup alc268_fixups
[] = {
2744 [ALC268_FIXUP_INV_DMIC
] = {
2745 .type
= HDA_FIXUP_FUNC
,
2746 .v
.func
= alc_fixup_inv_dmic
,
2748 [ALC268_FIXUP_HP_EAPD
] = {
2749 .type
= HDA_FIXUP_VERBS
,
2750 .v
.verbs
= (const struct hda_verb
[]) {
2751 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2755 [ALC268_FIXUP_SPDIF
] = {
2756 .type
= HDA_FIXUP_PINS
,
2757 .v
.pins
= (const struct hda_pintbl
[]) {
2758 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2764 static const struct hda_model_fixup alc268_fixup_models
[] = {
2765 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2766 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2770 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2771 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2772 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2773 /* below is codec SSID since multiple Toshiba laptops have the
2774 * same PCI SSID 1179:ff00
2776 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2781 * BIOS auto configuration
2783 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2785 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2786 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2791 static int patch_alc268(struct hda_codec
*codec
)
2793 struct alc_spec
*spec
;
2796 /* ALC268 has no aa-loopback mixer */
2797 err
= alc_alloc_spec(codec
, 0);
2802 spec
->gen
.beep_nid
= 0x01;
2804 spec
->shutup
= alc_eapd_shutup
;
2806 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2807 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2809 /* automatic parse from the BIOS config */
2810 err
= alc268_parse_auto_config(codec
);
2814 if (err
> 0 && !spec
->gen
.no_analog
&&
2815 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2816 add_mixer(spec
, alc268_beep_mixer
);
2817 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2818 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2819 /* override the amp caps for beep generator */
2820 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2821 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2822 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2823 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2824 (0 << AC_AMPCAP_MUTE_SHIFT
));
2827 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2840 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2841 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2844 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2845 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2848 /* different alc269-variants */
2850 ALC269_TYPE_ALC269VA
,
2851 ALC269_TYPE_ALC269VB
,
2852 ALC269_TYPE_ALC269VC
,
2853 ALC269_TYPE_ALC269VD
,
2873 * BIOS auto configuration
2875 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2877 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2878 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2879 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2880 struct alc_spec
*spec
= codec
->spec
;
2881 const hda_nid_t
*ssids
;
2883 switch (spec
->codec_variant
) {
2884 case ALC269_TYPE_ALC269VA
:
2885 case ALC269_TYPE_ALC269VC
:
2886 case ALC269_TYPE_ALC280
:
2887 case ALC269_TYPE_ALC284
:
2888 case ALC269_TYPE_ALC293
:
2889 ssids
= alc269va_ssids
;
2891 case ALC269_TYPE_ALC269VB
:
2892 case ALC269_TYPE_ALC269VD
:
2893 case ALC269_TYPE_ALC282
:
2894 case ALC269_TYPE_ALC283
:
2895 case ALC269_TYPE_ALC286
:
2896 case ALC269_TYPE_ALC298
:
2897 case ALC269_TYPE_ALC255
:
2898 case ALC269_TYPE_ALC256
:
2899 case ALC269_TYPE_ALC257
:
2900 case ALC269_TYPE_ALC215
:
2901 case ALC269_TYPE_ALC225
:
2902 case ALC269_TYPE_ALC294
:
2903 case ALC269_TYPE_ALC300
:
2904 case ALC269_TYPE_ALC623
:
2905 case ALC269_TYPE_ALC700
:
2906 ssids
= alc269_ssids
;
2909 ssids
= alc269_ssids
;
2913 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2916 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2918 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2921 static void alc269_shutup(struct hda_codec
*codec
)
2923 struct alc_spec
*spec
= codec
->spec
;
2925 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2926 alc269vb_toggle_power_output(codec
, 0);
2927 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2928 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2931 alc_shutup_pins(codec
);
2934 static struct coef_fw alc282_coefs
[] = {
2935 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2936 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2937 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2938 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2939 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2940 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2941 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2942 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2943 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2944 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2945 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2946 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2947 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2948 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2949 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2950 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2951 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2952 WRITE_COEF(0x63, 0x2902), /* PLL */
2953 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2954 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2955 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2956 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2957 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2958 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2959 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2960 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2961 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2962 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2963 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2967 static void alc282_restore_default_value(struct hda_codec
*codec
)
2969 alc_process_coef_fw(codec
, alc282_coefs
);
2972 static void alc282_init(struct hda_codec
*codec
)
2974 struct alc_spec
*spec
= codec
->spec
;
2975 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
2979 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
2980 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
2981 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
2984 alc282_restore_default_value(codec
);
2988 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2989 coef78
= alc_read_coef_idx(codec
, 0x78);
2991 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2992 /* Headphone capless set to high power mode */
2993 alc_write_coef_idx(codec
, 0x78, 0x9004);
2998 snd_hda_codec_write(codec
, hp_pin
, 0,
2999 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3004 snd_hda_codec_write(codec
, hp_pin
, 0,
3005 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3010 /* Headphone capless set to normal mode */
3011 alc_write_coef_idx(codec
, 0x78, coef78
);
3014 static void alc282_shutup(struct hda_codec
*codec
)
3016 struct alc_spec
*spec
= codec
->spec
;
3017 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3021 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3022 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3023 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3027 alc269_shutup(codec
);
3031 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3032 coef78
= alc_read_coef_idx(codec
, 0x78);
3033 alc_write_coef_idx(codec
, 0x78, 0x9004);
3038 snd_hda_codec_write(codec
, hp_pin
, 0,
3039 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3044 if (!spec
->no_shutup_pins
)
3045 snd_hda_codec_write(codec
, hp_pin
, 0,
3046 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3051 alc_auto_setup_eapd(codec
, false);
3052 alc_shutup_pins(codec
);
3053 alc_write_coef_idx(codec
, 0x78, coef78
);
3056 static struct coef_fw alc283_coefs
[] = {
3057 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3058 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3059 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3060 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3061 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3062 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3063 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3064 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3065 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3066 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3067 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3068 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3069 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3070 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3071 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3072 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3073 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3074 WRITE_COEF(0x2e, 0x2902), /* PLL */
3075 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3076 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3077 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3078 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3079 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3080 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3081 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3082 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3083 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3084 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3085 WRITE_COEF(0x49, 0x0), /* test mode */
3086 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3087 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3088 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3089 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3093 static void alc283_restore_default_value(struct hda_codec
*codec
)
3095 alc_process_coef_fw(codec
, alc283_coefs
);
3098 static void alc283_init(struct hda_codec
*codec
)
3100 struct alc_spec
*spec
= codec
->spec
;
3101 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3104 alc283_restore_default_value(codec
);
3110 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3112 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3113 /* Headphone capless set to high power mode */
3114 alc_write_coef_idx(codec
, 0x43, 0x9004);
3116 snd_hda_codec_write(codec
, hp_pin
, 0,
3117 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3122 snd_hda_codec_write(codec
, hp_pin
, 0,
3123 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3127 /* Index 0x46 Combo jack auto switch control 2 */
3128 /* 3k pull low control for Headset jack. */
3129 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3130 /* Headphone capless set to normal mode */
3131 alc_write_coef_idx(codec
, 0x43, 0x9614);
3134 static void alc283_shutup(struct hda_codec
*codec
)
3136 struct alc_spec
*spec
= codec
->spec
;
3137 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3141 alc269_shutup(codec
);
3145 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3147 alc_write_coef_idx(codec
, 0x43, 0x9004);
3149 /*depop hp during suspend*/
3150 alc_write_coef_idx(codec
, 0x06, 0x2100);
3152 snd_hda_codec_write(codec
, hp_pin
, 0,
3153 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3158 if (!spec
->no_shutup_pins
)
3159 snd_hda_codec_write(codec
, hp_pin
, 0,
3160 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3162 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3166 alc_auto_setup_eapd(codec
, false);
3167 alc_shutup_pins(codec
);
3168 alc_write_coef_idx(codec
, 0x43, 0x9614);
3171 static void alc256_init(struct hda_codec
*codec
)
3173 struct alc_spec
*spec
= codec
->spec
;
3174 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3177 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3178 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3179 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3187 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3192 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3194 snd_hda_codec_write(codec
, hp_pin
, 0,
3195 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3200 snd_hda_codec_write(codec
, hp_pin
, 0,
3201 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3206 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3207 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3208 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3209 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 0 << 15);
3210 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
3213 static void alc256_shutup(struct hda_codec
*codec
)
3215 struct alc_spec
*spec
= codec
->spec
;
3216 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3219 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3220 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3221 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3225 alc269_shutup(codec
);
3229 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3234 snd_hda_codec_write(codec
, hp_pin
, 0,
3235 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3240 /* 3k pull low control for Headset jack. */
3241 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3242 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3244 if (!spec
->no_shutup_pins
)
3245 snd_hda_codec_write(codec
, hp_pin
, 0,
3246 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3251 alc_auto_setup_eapd(codec
, false);
3252 alc_shutup_pins(codec
);
3255 static void alc225_init(struct hda_codec
*codec
)
3257 struct alc_spec
*spec
= codec
->spec
;
3258 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3259 bool hp1_pin_sense
, hp2_pin_sense
;
3261 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3262 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3263 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3271 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3272 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3274 if (hp1_pin_sense
|| hp2_pin_sense
)
3277 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3280 snd_hda_codec_write(codec
, hp_pin
, 0,
3281 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3283 snd_hda_codec_write(codec
, 0x16, 0,
3284 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3286 if (hp1_pin_sense
|| hp2_pin_sense
)
3290 snd_hda_codec_write(codec
, hp_pin
, 0,
3291 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3293 snd_hda_codec_write(codec
, 0x16, 0,
3294 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3296 if (hp1_pin_sense
|| hp2_pin_sense
)
3299 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3300 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3303 static void alc225_shutup(struct hda_codec
*codec
)
3305 struct alc_spec
*spec
= codec
->spec
;
3306 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3307 bool hp1_pin_sense
, hp2_pin_sense
;
3309 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3310 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3311 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3315 alc269_shutup(codec
);
3319 /* 3k pull low control for Headset jack. */
3320 alc_update_coef_idx(codec
, 0x4a, 0, 3 << 10);
3322 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3323 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3325 if (hp1_pin_sense
|| hp2_pin_sense
)
3329 snd_hda_codec_write(codec
, hp_pin
, 0,
3330 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3332 snd_hda_codec_write(codec
, 0x16, 0,
3333 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3335 if (hp1_pin_sense
|| hp2_pin_sense
)
3339 snd_hda_codec_write(codec
, hp_pin
, 0,
3340 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3342 snd_hda_codec_write(codec
, 0x16, 0,
3343 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3345 if (hp1_pin_sense
|| hp2_pin_sense
)
3348 alc_auto_setup_eapd(codec
, false);
3349 alc_shutup_pins(codec
);
3352 static void alc_default_init(struct hda_codec
*codec
)
3354 struct alc_spec
*spec
= codec
->spec
;
3355 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3358 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3359 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3360 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3368 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3373 snd_hda_codec_write(codec
, hp_pin
, 0,
3374 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3379 snd_hda_codec_write(codec
, hp_pin
, 0,
3380 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3386 static void alc_default_shutup(struct hda_codec
*codec
)
3388 struct alc_spec
*spec
= codec
->spec
;
3389 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3392 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3393 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3394 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3398 alc269_shutup(codec
);
3402 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3407 snd_hda_codec_write(codec
, hp_pin
, 0,
3408 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3413 if (!spec
->no_shutup_pins
)
3414 snd_hda_codec_write(codec
, hp_pin
, 0,
3415 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3420 alc_auto_setup_eapd(codec
, false);
3421 alc_shutup_pins(codec
);
3424 static void alc294_hp_init(struct hda_codec
*codec
)
3426 struct alc_spec
*spec
= codec
->spec
;
3427 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3430 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3431 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3432 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3438 snd_hda_codec_write(codec
, hp_pin
, 0,
3439 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3443 snd_hda_codec_write(codec
, hp_pin
, 0,
3444 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3446 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3447 alc_update_coefex_idx(codec
, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3449 /* Wait for depop procedure finish */
3450 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3451 for (i
= 0; i
< 20 && val
& 0x0080; i
++) {
3453 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3455 /* Set HP depop to auto mode */
3456 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0x000b);
3460 static void alc294_init(struct hda_codec
*codec
)
3462 struct alc_spec
*spec
= codec
->spec
;
3464 if (!spec
->done_hp_init
) {
3465 alc294_hp_init(codec
);
3466 spec
->done_hp_init
= true;
3468 alc_default_init(codec
);
3471 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3474 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3475 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3476 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3479 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3483 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3484 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3486 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3491 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3495 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3496 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3497 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3498 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3499 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3500 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3501 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3502 val
= alc5505_coef_get(codec
, 0x6220);
3503 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3506 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3508 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3509 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3510 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3511 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3512 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3513 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3516 static void alc5505_dsp_init(struct hda_codec
*codec
)
3520 alc5505_dsp_halt(codec
);
3521 alc5505_dsp_back_from_halt(codec
);
3522 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3523 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3524 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3525 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3526 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3527 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3528 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3529 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3530 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3531 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3532 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3533 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3534 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3536 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3538 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3540 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3542 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3543 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3544 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3545 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3546 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3547 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3548 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3550 #ifdef HALT_REALTEK_ALC5505
3551 alc5505_dsp_halt(codec
);
3555 #ifdef HALT_REALTEK_ALC5505
3556 #define alc5505_dsp_suspend(codec) /* NOP */
3557 #define alc5505_dsp_resume(codec) /* NOP */
3559 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3560 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3564 static int alc269_suspend(struct hda_codec
*codec
)
3566 struct alc_spec
*spec
= codec
->spec
;
3568 if (spec
->has_alc5505_dsp
)
3569 alc5505_dsp_suspend(codec
);
3570 return alc_suspend(codec
);
3573 static int alc269_resume(struct hda_codec
*codec
)
3575 struct alc_spec
*spec
= codec
->spec
;
3577 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3578 alc269vb_toggle_power_output(codec
, 0);
3579 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3580 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3584 codec
->patch_ops
.init(codec
);
3586 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3587 alc269vb_toggle_power_output(codec
, 1);
3588 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3589 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3593 regcache_sync(codec
->core
.regmap
);
3594 hda_call_check_power_status(codec
, 0x01);
3596 /* on some machine, the BIOS will clear the codec gpio data when enter
3597 * suspend, and won't restore the data after resume, so we restore it
3601 snd_hda_codec_write(codec
, codec
->core
.afg
, 0, AC_VERB_SET_GPIO_DATA
,
3604 if (spec
->has_alc5505_dsp
)
3605 alc5505_dsp_resume(codec
);
3609 #endif /* CONFIG_PM */
3611 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3612 const struct hda_fixup
*fix
, int action
)
3614 struct alc_spec
*spec
= codec
->spec
;
3616 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3617 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3620 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3621 const struct hda_fixup
*fix
,
3624 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3625 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3627 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3628 snd_hda_codec_set_pincfg(codec
, 0x19,
3629 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3630 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3633 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3634 const struct hda_fixup
*fix
, int action
)
3636 if (action
== HDA_FIXUP_ACT_INIT
)
3637 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3640 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3641 const struct hda_fixup
*fix
, int action
)
3643 struct alc_spec
*spec
= codec
->spec
;
3645 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3646 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3649 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3650 const struct hda_fixup
*fix
, int action
)
3652 static const struct hda_verb verbs
[] = {
3653 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3654 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3659 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3660 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3662 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3663 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3664 snd_hda_sequence_write(codec
, verbs
);
3667 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3668 const struct hda_fixup
*fix
, int action
)
3670 struct alc_spec
*spec
= codec
->spec
;
3672 if (action
!= HDA_FIXUP_ACT_PROBE
)
3675 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3676 * fix the sample rate of analog I/O to 44.1kHz
3678 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3679 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3682 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3683 const struct hda_fixup
*fix
, int action
)
3685 /* The digital-mic unit sends PDM (differential signal) instead of
3686 * the standard PCM, thus you can't record a valid mono stream as is.
3687 * Below is a workaround specific to ALC269 to control the dmic
3688 * signal source as mono.
3690 if (action
== HDA_FIXUP_ACT_INIT
)
3691 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3694 static void alc269_quanta_automute(struct hda_codec
*codec
)
3696 snd_hda_gen_update_outputs(codec
);
3698 alc_write_coef_idx(codec
, 0x0c, 0x680);
3699 alc_write_coef_idx(codec
, 0x0c, 0x480);
3702 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3703 const struct hda_fixup
*fix
, int action
)
3705 struct alc_spec
*spec
= codec
->spec
;
3706 if (action
!= HDA_FIXUP_ACT_PROBE
)
3708 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3711 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3712 struct hda_jack_callback
*jack
)
3714 struct alc_spec
*spec
= codec
->spec
;
3717 snd_hda_gen_hp_automute(codec
, jack
);
3719 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3721 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3724 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3728 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3729 const struct hda_fixup
*fix
, int action
)
3731 struct alc_spec
*spec
= codec
->spec
;
3732 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3733 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3734 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3739 /* update mute-LED according to the speaker mute state via mic VREF pin */
3740 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3742 struct hda_codec
*codec
= private_data
;
3743 struct alc_spec
*spec
= codec
->spec
;
3744 unsigned int pinval
;
3746 if (spec
->mute_led_polarity
)
3748 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3749 pinval
&= ~AC_PINCTL_VREFEN
;
3750 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3751 if (spec
->mute_led_nid
) {
3752 /* temporarily power up/down for setting VREF */
3753 snd_hda_power_up_pm(codec
);
3754 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3755 snd_hda_power_down_pm(codec
);
3759 /* Make sure the led works even in runtime suspend */
3760 static unsigned int led_power_filter(struct hda_codec
*codec
,
3762 unsigned int power_state
)
3764 struct alc_spec
*spec
= codec
->spec
;
3766 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3767 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3770 /* Set pin ctl again, it might have just been set to 0 */
3771 snd_hda_set_pin_ctl(codec
, nid
,
3772 snd_hda_codec_get_pin_target(codec
, nid
));
3774 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3777 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3778 const struct hda_fixup
*fix
, int action
)
3780 struct alc_spec
*spec
= codec
->spec
;
3781 const struct dmi_device
*dev
= NULL
;
3783 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3786 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3788 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3790 if (pin
< 0x0a || pin
>= 0x10)
3792 spec
->mute_led_polarity
= pol
;
3793 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3794 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3795 spec
->gen
.vmaster_mute_enum
= 1;
3796 codec
->power_filter
= led_power_filter
;
3798 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3799 spec
->mute_led_polarity
);
3804 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3805 const struct hda_fixup
*fix
, int action
)
3807 struct alc_spec
*spec
= codec
->spec
;
3808 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3809 spec
->mute_led_polarity
= 0;
3810 spec
->mute_led_nid
= 0x18;
3811 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3812 spec
->gen
.vmaster_mute_enum
= 1;
3813 codec
->power_filter
= led_power_filter
;
3817 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3818 const struct hda_fixup
*fix
, int action
)
3820 struct alc_spec
*spec
= codec
->spec
;
3821 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3822 spec
->mute_led_polarity
= 0;
3823 spec
->mute_led_nid
= 0x19;
3824 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3825 spec
->gen
.vmaster_mute_enum
= 1;
3826 codec
->power_filter
= led_power_filter
;
3830 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec
*codec
,
3831 const struct hda_fixup
*fix
, int action
)
3833 struct alc_spec
*spec
= codec
->spec
;
3834 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3835 spec
->mute_led_polarity
= 0;
3836 spec
->mute_led_nid
= 0x1b;
3837 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3838 spec
->gen
.vmaster_mute_enum
= 1;
3839 codec
->power_filter
= led_power_filter
;
3843 /* update LED status via GPIO */
3844 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3847 struct alc_spec
*spec
= codec
->spec
;
3848 unsigned int oldval
= spec
->gpio_led
;
3850 if (spec
->mute_led_polarity
)
3854 spec
->gpio_led
&= ~mask
;
3856 spec
->gpio_led
|= mask
;
3857 if (spec
->gpio_led
!= oldval
)
3858 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3862 /* turn on/off mute LED via GPIO per vmaster hook */
3863 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3865 struct hda_codec
*codec
= private_data
;
3866 struct alc_spec
*spec
= codec
->spec
;
3868 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3871 /* turn on/off mic-mute LED via GPIO per capture hook */
3872 static void alc_fixup_gpio_mic_mute_hook(struct hda_codec
*codec
,
3873 struct snd_kcontrol
*kcontrol
,
3874 struct snd_ctl_elem_value
*ucontrol
)
3876 struct alc_spec
*spec
= codec
->spec
;
3879 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3880 ucontrol
->value
.integer
.value
[0] ||
3881 ucontrol
->value
.integer
.value
[1]);
3884 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3885 const struct hda_fixup
*fix
, int action
)
3887 struct alc_spec
*spec
= codec
->spec
;
3888 static const struct hda_verb gpio_init
[] = {
3889 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3890 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3894 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3895 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3896 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3898 spec
->mute_led_polarity
= 0;
3899 spec
->gpio_mute_led_mask
= 0x08;
3900 spec
->gpio_mic_led_mask
= 0x10;
3901 snd_hda_add_verbs(codec
, gpio_init
);
3905 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3906 const struct hda_fixup
*fix
, int action
)
3908 struct alc_spec
*spec
= codec
->spec
;
3909 static const struct hda_verb gpio_init
[] = {
3910 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x22 },
3911 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x22 },
3915 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3916 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3917 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3919 spec
->mute_led_polarity
= 0;
3920 spec
->gpio_mute_led_mask
= 0x02;
3921 spec
->gpio_mic_led_mask
= 0x20;
3922 snd_hda_add_verbs(codec
, gpio_init
);
3926 /* turn on/off mic-mute LED per capture hook */
3927 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3928 struct snd_kcontrol
*kcontrol
,
3929 struct snd_ctl_elem_value
*ucontrol
)
3931 struct alc_spec
*spec
= codec
->spec
;
3932 unsigned int pinval
, enable
, disable
;
3934 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3935 pinval
&= ~AC_PINCTL_VREFEN
;
3936 enable
= pinval
| AC_PINCTL_VREF_80
;
3937 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3942 if (ucontrol
->value
.integer
.value
[0] ||
3943 ucontrol
->value
.integer
.value
[1])
3948 if (spec
->cap_mute_led_nid
)
3949 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3952 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3953 const struct hda_fixup
*fix
, int action
)
3955 struct alc_spec
*spec
= codec
->spec
;
3956 static const struct hda_verb gpio_init
[] = {
3957 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3958 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3962 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3963 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3964 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3966 spec
->mute_led_polarity
= 0;
3967 spec
->gpio_mute_led_mask
= 0x08;
3968 spec
->cap_mute_led_nid
= 0x18;
3969 snd_hda_add_verbs(codec
, gpio_init
);
3970 codec
->power_filter
= led_power_filter
;
3974 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3975 const struct hda_fixup
*fix
, int action
)
3977 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */
3978 struct alc_spec
*spec
= codec
->spec
;
3979 static const struct hda_verb gpio_init
[] = {
3980 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3981 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3985 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3986 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3987 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3989 spec
->mute_led_polarity
= 0;
3990 spec
->gpio_mute_led_mask
= 0x08;
3991 spec
->cap_mute_led_nid
= 0x18;
3992 snd_hda_add_verbs(codec
, gpio_init
);
3993 codec
->power_filter
= led_power_filter
;
3997 #if IS_REACHABLE(CONFIG_INPUT)
3998 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3999 struct hda_jack_callback
*event
)
4001 struct alc_spec
*spec
= codec
->spec
;
4003 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
4004 send both key on and key off event for every interrupt. */
4005 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
4006 input_sync(spec
->kb_dev
);
4007 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
4008 input_sync(spec
->kb_dev
);
4011 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
4013 struct alc_spec
*spec
= codec
->spec
;
4016 spec
->kb_dev
= input_allocate_device();
4017 if (!spec
->kb_dev
) {
4018 codec_err(codec
, "Out of memory (input_allocate_device)\n");
4022 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
4024 spec
->kb_dev
->name
= "Microphone Mute Button";
4025 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
4026 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
4027 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
4028 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
4029 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
4030 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
4032 if (input_register_device(spec
->kb_dev
)) {
4033 codec_err(codec
, "input_register_device failed\n");
4034 input_free_device(spec
->kb_dev
);
4035 spec
->kb_dev
= NULL
;
4042 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
4043 const struct hda_fixup
*fix
, int action
)
4045 /* GPIO1 = set according to SKU external amp
4046 GPIO2 = mic mute hotkey
4048 GPIO4 = mic mute LED */
4049 static const struct hda_verb gpio_init
[] = {
4050 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x1e },
4051 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x1a },
4052 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x02 },
4056 struct alc_spec
*spec
= codec
->spec
;
4058 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4059 if (alc_register_micmute_input_device(codec
) != 0)
4062 snd_hda_add_verbs(codec
, gpio_init
);
4063 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
4064 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
4065 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
4066 gpio2_mic_hotkey_event
);
4068 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
4069 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4071 spec
->mute_led_polarity
= 0;
4072 spec
->gpio_mute_led_mask
= 0x08;
4073 spec
->gpio_mic_led_mask
= 0x10;
4081 case HDA_FIXUP_ACT_PROBE
:
4082 spec
->init_amp
= ALC_INIT_DEFAULT
;
4084 case HDA_FIXUP_ACT_FREE
:
4085 input_unregister_device(spec
->kb_dev
);
4086 spec
->kb_dev
= NULL
;
4090 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
4091 const struct hda_fixup
*fix
, int action
)
4093 /* Line2 = mic mute hotkey
4094 GPIO2 = mic mute LED */
4095 static const struct hda_verb gpio_init
[] = {
4096 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4097 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
4101 struct alc_spec
*spec
= codec
->spec
;
4103 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4104 if (alc_register_micmute_input_device(codec
) != 0)
4107 snd_hda_add_verbs(codec
, gpio_init
);
4108 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4109 gpio2_mic_hotkey_event
);
4111 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4113 spec
->mute_led_polarity
= 0;
4114 spec
->gpio_mic_led_mask
= 0x04;
4122 case HDA_FIXUP_ACT_PROBE
:
4123 spec
->init_amp
= ALC_INIT_DEFAULT
;
4125 case HDA_FIXUP_ACT_FREE
:
4126 input_unregister_device(spec
->kb_dev
);
4127 spec
->kb_dev
= NULL
;
4131 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4132 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4135 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
4136 const struct hda_fixup
*fix
, int action
)
4138 struct alc_spec
*spec
= codec
->spec
;
4140 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4141 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
4142 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
4143 spec
->mute_led_polarity
= 0;
4144 spec
->mute_led_nid
= 0x1a;
4145 spec
->cap_mute_led_nid
= 0x18;
4146 spec
->gen
.vmaster_mute_enum
= 1;
4147 codec
->power_filter
= led_power_filter
;
4151 static struct coef_fw alc225_pre_hsmode
[] = {
4152 UPDATE_COEF(0x4a, 1<<8, 0),
4153 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4154 UPDATE_COEF(0x63, 3<<14, 3<<14),
4155 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4156 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4157 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4158 UPDATE_COEF(0x4a, 3<<10, 0),
4162 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
4164 static struct coef_fw coef0255
[] = {
4165 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4166 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4167 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4168 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4169 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4172 static struct coef_fw coef0256
[] = {
4173 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4174 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4175 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4176 WRITE_COEFEX(0x57, 0x03, 0x09a3), /* Direct Drive HP Amp control */
4177 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4180 static struct coef_fw coef0233
[] = {
4181 WRITE_COEF(0x1b, 0x0c0b),
4182 WRITE_COEF(0x45, 0xc429),
4183 UPDATE_COEF(0x35, 0x4000, 0),
4184 WRITE_COEF(0x06, 0x2104),
4185 WRITE_COEF(0x1a, 0x0001),
4186 WRITE_COEF(0x26, 0x0004),
4187 WRITE_COEF(0x32, 0x42a3),
4190 static struct coef_fw coef0288
[] = {
4191 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4192 UPDATE_COEF(0x50, 0x2000, 0x2000),
4193 UPDATE_COEF(0x56, 0x0006, 0x0006),
4194 UPDATE_COEF(0x66, 0x0008, 0),
4195 UPDATE_COEF(0x67, 0x2000, 0),
4198 static struct coef_fw coef0298
[] = {
4199 UPDATE_COEF(0x19, 0x1300, 0x0300),
4202 static struct coef_fw coef0292
[] = {
4203 WRITE_COEF(0x76, 0x000e),
4204 WRITE_COEF(0x6c, 0x2400),
4205 WRITE_COEF(0x18, 0x7308),
4206 WRITE_COEF(0x6b, 0xc429),
4209 static struct coef_fw coef0293
[] = {
4210 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4211 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4212 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4213 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4214 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4215 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4218 static struct coef_fw coef0668
[] = {
4219 WRITE_COEF(0x15, 0x0d40),
4220 WRITE_COEF(0xb7, 0x802b),
4223 static struct coef_fw coef0225
[] = {
4224 UPDATE_COEF(0x63, 3<<14, 0),
4227 static struct coef_fw coef0274
[] = {
4228 UPDATE_COEF(0x4a, 0x0100, 0),
4229 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4230 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4231 UPDATE_COEF(0x4a, 0x0010, 0),
4232 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4233 WRITE_COEF(0x45, 0x5289),
4234 UPDATE_COEF(0x4a, 0x0c00, 0),
4238 switch (codec
->core
.vendor_id
) {
4240 alc_process_coef_fw(codec
, coef0255
);
4244 alc_process_coef_fw(codec
, coef0256
);
4249 alc_process_coef_fw(codec
, coef0274
);
4253 alc_process_coef_fw(codec
, coef0233
);
4257 alc_process_coef_fw(codec
, coef0288
);
4260 alc_process_coef_fw(codec
, coef0298
);
4261 alc_process_coef_fw(codec
, coef0288
);
4264 alc_process_coef_fw(codec
, coef0292
);
4267 alc_process_coef_fw(codec
, coef0293
);
4270 alc_process_coef_fw(codec
, coef0668
);
4278 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4279 alc_process_coef_fw(codec
, coef0225
);
4282 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4285 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
4289 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
4292 static struct coef_fw coef0255
[] = {
4293 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4294 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4297 static struct coef_fw coef0256
[] = {
4298 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14), /* Direct Drive HP Amp control(Set to verb control)*/
4299 WRITE_COEFEX(0x57, 0x03, 0x09a3),
4300 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4303 static struct coef_fw coef0233
[] = {
4304 UPDATE_COEF(0x35, 0, 1<<14),
4305 WRITE_COEF(0x06, 0x2100),
4306 WRITE_COEF(0x1a, 0x0021),
4307 WRITE_COEF(0x26, 0x008c),
4310 static struct coef_fw coef0288
[] = {
4311 UPDATE_COEF(0x4f, 0x00c0, 0),
4312 UPDATE_COEF(0x50, 0x2000, 0),
4313 UPDATE_COEF(0x56, 0x0006, 0),
4314 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4315 UPDATE_COEF(0x66, 0x0008, 0x0008),
4316 UPDATE_COEF(0x67, 0x2000, 0x2000),
4319 static struct coef_fw coef0292
[] = {
4320 WRITE_COEF(0x19, 0xa208),
4321 WRITE_COEF(0x2e, 0xacf0),
4324 static struct coef_fw coef0293
[] = {
4325 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4326 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4327 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4330 static struct coef_fw coef0688
[] = {
4331 WRITE_COEF(0xb7, 0x802b),
4332 WRITE_COEF(0xb5, 0x1040),
4333 UPDATE_COEF(0xc3, 0, 1<<12),
4336 static struct coef_fw coef0225
[] = {
4337 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4338 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4339 UPDATE_COEF(0x63, 3<<14, 0),
4342 static struct coef_fw coef0274
[] = {
4343 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4344 UPDATE_COEF(0x4a, 0x0010, 0),
4345 UPDATE_COEF(0x6b, 0xf000, 0),
4349 switch (codec
->core
.vendor_id
) {
4351 alc_write_coef_idx(codec
, 0x45, 0xc489);
4352 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4353 alc_process_coef_fw(codec
, coef0255
);
4354 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4358 alc_write_coef_idx(codec
, 0x45, 0xc489);
4359 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4360 alc_process_coef_fw(codec
, coef0256
);
4361 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4366 alc_write_coef_idx(codec
, 0x45, 0x4689);
4367 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4368 alc_process_coef_fw(codec
, coef0274
);
4369 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4373 alc_write_coef_idx(codec
, 0x45, 0xc429);
4374 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4375 alc_process_coef_fw(codec
, coef0233
);
4376 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4381 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4382 alc_process_coef_fw(codec
, coef0288
);
4383 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4386 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4387 alc_process_coef_fw(codec
, coef0292
);
4390 /* Set to TRS mode */
4391 alc_write_coef_idx(codec
, 0x45, 0xc429);
4392 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4393 alc_process_coef_fw(codec
, coef0293
);
4394 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4397 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4401 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4402 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4405 alc_write_coef_idx(codec
, 0x11, 0x0001);
4406 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4407 alc_process_coef_fw(codec
, coef0688
);
4408 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4416 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4417 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4418 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4419 alc_process_coef_fw(codec
, coef0225
);
4420 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4423 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4426 static void alc_headset_mode_default(struct hda_codec
*codec
)
4428 static struct coef_fw coef0225
[] = {
4429 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4430 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4431 UPDATE_COEF(0x49, 3<<8, 0<<8),
4432 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4433 UPDATE_COEF(0x63, 3<<14, 0),
4434 UPDATE_COEF(0x67, 0xf000, 0x3000),
4437 static struct coef_fw coef0255
[] = {
4438 WRITE_COEF(0x45, 0xc089),
4439 WRITE_COEF(0x45, 0xc489),
4440 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4441 WRITE_COEF(0x49, 0x0049),
4444 static struct coef_fw coef0256
[] = {
4445 WRITE_COEF(0x45, 0xc489),
4446 WRITE_COEFEX(0x57, 0x03, 0x0da3),
4447 WRITE_COEF(0x49, 0x0049),
4448 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4449 WRITE_COEF(0x06, 0x6100),
4452 static struct coef_fw coef0233
[] = {
4453 WRITE_COEF(0x06, 0x2100),
4454 WRITE_COEF(0x32, 0x4ea3),
4457 static struct coef_fw coef0288
[] = {
4458 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4459 UPDATE_COEF(0x50, 0x2000, 0x2000),
4460 UPDATE_COEF(0x56, 0x0006, 0x0006),
4461 UPDATE_COEF(0x66, 0x0008, 0),
4462 UPDATE_COEF(0x67, 0x2000, 0),
4465 static struct coef_fw coef0292
[] = {
4466 WRITE_COEF(0x76, 0x000e),
4467 WRITE_COEF(0x6c, 0x2400),
4468 WRITE_COEF(0x6b, 0xc429),
4469 WRITE_COEF(0x18, 0x7308),
4472 static struct coef_fw coef0293
[] = {
4473 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4474 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4475 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4478 static struct coef_fw coef0688
[] = {
4479 WRITE_COEF(0x11, 0x0041),
4480 WRITE_COEF(0x15, 0x0d40),
4481 WRITE_COEF(0xb7, 0x802b),
4484 static struct coef_fw coef0274
[] = {
4485 WRITE_COEF(0x45, 0x4289),
4486 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4487 UPDATE_COEF(0x6b, 0x0f00, 0),
4488 UPDATE_COEF(0x49, 0x0300, 0x0300),
4492 switch (codec
->core
.vendor_id
) {
4499 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4500 alc_process_coef_fw(codec
, coef0225
);
4503 alc_process_coef_fw(codec
, coef0255
);
4507 alc_write_coef_idx(codec
, 0x1b, 0x0e4b);
4508 alc_write_coef_idx(codec
, 0x45, 0xc089);
4510 alc_process_coef_fw(codec
, coef0256
);
4515 alc_process_coef_fw(codec
, coef0274
);
4519 alc_process_coef_fw(codec
, coef0233
);
4524 alc_process_coef_fw(codec
, coef0288
);
4527 alc_process_coef_fw(codec
, coef0292
);
4530 alc_process_coef_fw(codec
, coef0293
);
4533 alc_process_coef_fw(codec
, coef0688
);
4536 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4539 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4543 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4547 static struct coef_fw coef0255
[] = {
4548 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4549 WRITE_COEF(0x1b, 0x0c2b),
4550 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4553 static struct coef_fw coef0256
[] = {
4554 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4555 WRITE_COEF(0x1b, 0x0e6b),
4558 static struct coef_fw coef0233
[] = {
4559 WRITE_COEF(0x45, 0xd429),
4560 WRITE_COEF(0x1b, 0x0c2b),
4561 WRITE_COEF(0x32, 0x4ea3),
4564 static struct coef_fw coef0288
[] = {
4565 UPDATE_COEF(0x50, 0x2000, 0x2000),
4566 UPDATE_COEF(0x56, 0x0006, 0x0006),
4567 UPDATE_COEF(0x66, 0x0008, 0),
4568 UPDATE_COEF(0x67, 0x2000, 0),
4571 static struct coef_fw coef0292
[] = {
4572 WRITE_COEF(0x6b, 0xd429),
4573 WRITE_COEF(0x76, 0x0008),
4574 WRITE_COEF(0x18, 0x7388),
4577 static struct coef_fw coef0293
[] = {
4578 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4579 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4582 static struct coef_fw coef0688
[] = {
4583 WRITE_COEF(0x11, 0x0001),
4584 WRITE_COEF(0x15, 0x0d60),
4585 WRITE_COEF(0xc3, 0x0000),
4588 static struct coef_fw coef0225_1
[] = {
4589 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4590 UPDATE_COEF(0x63, 3<<14, 2<<14),
4593 static struct coef_fw coef0225_2
[] = {
4594 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4595 UPDATE_COEF(0x63, 3<<14, 1<<14),
4599 switch (codec
->core
.vendor_id
) {
4601 alc_process_coef_fw(codec
, coef0255
);
4605 alc_process_coef_fw(codec
, coef0256
);
4610 alc_write_coef_idx(codec
, 0x45, 0xd689);
4614 alc_process_coef_fw(codec
, coef0233
);
4617 val
= alc_read_coef_idx(codec
, 0x50);
4618 if (val
& (1 << 12)) {
4619 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4620 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4623 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4624 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4630 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4632 alc_process_coef_fw(codec
, coef0288
);
4635 alc_process_coef_fw(codec
, coef0292
);
4638 alc_process_coef_fw(codec
, coef0293
);
4641 alc_process_coef_fw(codec
, coef0688
);
4649 val
= alc_read_coef_idx(codec
, 0x45);
4651 alc_process_coef_fw(codec
, coef0225_2
);
4653 alc_process_coef_fw(codec
, coef0225_1
);
4656 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4659 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4663 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4665 static struct coef_fw coef0255
[] = {
4666 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4667 WRITE_COEF(0x1b, 0x0c2b),
4668 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4671 static struct coef_fw coef0256
[] = {
4672 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4673 WRITE_COEF(0x1b, 0x0e6b),
4676 static struct coef_fw coef0233
[] = {
4677 WRITE_COEF(0x45, 0xe429),
4678 WRITE_COEF(0x1b, 0x0c2b),
4679 WRITE_COEF(0x32, 0x4ea3),
4682 static struct coef_fw coef0288
[] = {
4683 UPDATE_COEF(0x50, 0x2000, 0x2000),
4684 UPDATE_COEF(0x56, 0x0006, 0x0006),
4685 UPDATE_COEF(0x66, 0x0008, 0),
4686 UPDATE_COEF(0x67, 0x2000, 0),
4689 static struct coef_fw coef0292
[] = {
4690 WRITE_COEF(0x6b, 0xe429),
4691 WRITE_COEF(0x76, 0x0008),
4692 WRITE_COEF(0x18, 0x7388),
4695 static struct coef_fw coef0293
[] = {
4696 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4697 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4700 static struct coef_fw coef0688
[] = {
4701 WRITE_COEF(0x11, 0x0001),
4702 WRITE_COEF(0x15, 0x0d50),
4703 WRITE_COEF(0xc3, 0x0000),
4706 static struct coef_fw coef0225
[] = {
4707 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4708 UPDATE_COEF(0x63, 3<<14, 2<<14),
4712 switch (codec
->core
.vendor_id
) {
4714 alc_process_coef_fw(codec
, coef0255
);
4718 alc_process_coef_fw(codec
, coef0256
);
4723 alc_write_coef_idx(codec
, 0x45, 0xe689);
4727 alc_process_coef_fw(codec
, coef0233
);
4730 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4731 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4736 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4738 alc_process_coef_fw(codec
, coef0288
);
4741 alc_process_coef_fw(codec
, coef0292
);
4744 alc_process_coef_fw(codec
, coef0293
);
4747 alc_process_coef_fw(codec
, coef0688
);
4755 alc_process_coef_fw(codec
, coef0225
);
4758 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4761 static void alc_determine_headset_type(struct hda_codec
*codec
)
4764 bool is_ctia
= false;
4765 struct alc_spec
*spec
= codec
->spec
;
4766 static struct coef_fw coef0255
[] = {
4767 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4768 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4772 static struct coef_fw coef0288
[] = {
4773 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4776 static struct coef_fw coef0298
[] = {
4777 UPDATE_COEF(0x50, 0x2000, 0x2000),
4778 UPDATE_COEF(0x56, 0x0006, 0x0006),
4779 UPDATE_COEF(0x66, 0x0008, 0),
4780 UPDATE_COEF(0x67, 0x2000, 0),
4781 UPDATE_COEF(0x19, 0x1300, 0x1300),
4784 static struct coef_fw coef0293
[] = {
4785 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4786 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4789 static struct coef_fw coef0688
[] = {
4790 WRITE_COEF(0x11, 0x0001),
4791 WRITE_COEF(0xb7, 0x802b),
4792 WRITE_COEF(0x15, 0x0d60),
4793 WRITE_COEF(0xc3, 0x0c00),
4796 static struct coef_fw coef0274
[] = {
4797 UPDATE_COEF(0x4a, 0x0010, 0),
4798 UPDATE_COEF(0x4a, 0x8000, 0),
4799 WRITE_COEF(0x45, 0xd289),
4800 UPDATE_COEF(0x49, 0x0300, 0x0300),
4804 switch (codec
->core
.vendor_id
) {
4806 alc_process_coef_fw(codec
, coef0255
);
4808 val
= alc_read_coef_idx(codec
, 0x46);
4809 is_ctia
= (val
& 0x0070) == 0x0070;
4813 alc_write_coef_idx(codec
, 0x1b, 0x0e4b);
4814 alc_write_coef_idx(codec
, 0x06, 0x6104);
4815 alc_write_coefex_idx(codec
, 0x57, 0x3, 0x09a3);
4817 snd_hda_codec_write(codec
, 0x21, 0,
4818 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4820 snd_hda_codec_write(codec
, 0x21, 0,
4821 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4823 alc_process_coef_fw(codec
, coef0255
);
4825 val
= alc_read_coef_idx(codec
, 0x46);
4826 is_ctia
= (val
& 0x0070) == 0x0070;
4828 alc_write_coefex_idx(codec
, 0x57, 0x3, 0x0da3);
4829 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4831 snd_hda_codec_write(codec
, 0x21, 0,
4832 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
4834 snd_hda_codec_write(codec
, 0x21, 0,
4835 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4840 alc_process_coef_fw(codec
, coef0274
);
4842 val
= alc_read_coef_idx(codec
, 0x46);
4843 is_ctia
= (val
& 0x00f0) == 0x00f0;
4847 alc_write_coef_idx(codec
, 0x45, 0xd029);
4849 val
= alc_read_coef_idx(codec
, 0x46);
4850 is_ctia
= (val
& 0x0070) == 0x0070;
4853 snd_hda_codec_write(codec
, 0x21, 0,
4854 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4856 snd_hda_codec_write(codec
, 0x21, 0,
4857 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4860 val
= alc_read_coef_idx(codec
, 0x50);
4861 if (val
& (1 << 12)) {
4862 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4863 alc_process_coef_fw(codec
, coef0288
);
4865 val
= alc_read_coef_idx(codec
, 0x50);
4866 is_ctia
= (val
& 0x0070) == 0x0070;
4868 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4869 alc_process_coef_fw(codec
, coef0288
);
4871 val
= alc_read_coef_idx(codec
, 0x50);
4872 is_ctia
= (val
& 0x0070) == 0x0070;
4874 alc_process_coef_fw(codec
, coef0298
);
4875 snd_hda_codec_write(codec
, 0x21, 0,
4876 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
);
4878 snd_hda_codec_write(codec
, 0x21, 0,
4879 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4883 alc_process_coef_fw(codec
, coef0288
);
4885 val
= alc_read_coef_idx(codec
, 0x50);
4886 is_ctia
= (val
& 0x0070) == 0x0070;
4889 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4891 val
= alc_read_coef_idx(codec
, 0x6c);
4892 is_ctia
= (val
& 0x001c) == 0x001c;
4895 alc_process_coef_fw(codec
, coef0293
);
4897 val
= alc_read_coef_idx(codec
, 0x46);
4898 is_ctia
= (val
& 0x0070) == 0x0070;
4901 alc_process_coef_fw(codec
, coef0688
);
4903 val
= alc_read_coef_idx(codec
, 0xbe);
4904 is_ctia
= (val
& 0x1c02) == 0x1c02;
4912 snd_hda_codec_write(codec
, 0x21, 0,
4913 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4915 snd_hda_codec_write(codec
, 0x21, 0,
4916 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4918 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4919 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x1000);
4920 val
= alc_read_coef_idx(codec
, 0x45);
4921 if (val
& (1 << 9)) {
4922 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4923 alc_update_coef_idx(codec
, 0x49, 3<<8, 2<<8);
4925 val
= alc_read_coef_idx(codec
, 0x46);
4926 is_ctia
= (val
& 0x00f0) == 0x00f0;
4928 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4929 alc_update_coef_idx(codec
, 0x49, 3<<8, 1<<8);
4931 val
= alc_read_coef_idx(codec
, 0x46);
4932 is_ctia
= (val
& 0x00f0) == 0x00f0;
4934 alc_update_coef_idx(codec
, 0x4a, 7<<6, 7<<6);
4935 alc_update_coef_idx(codec
, 0x4a, 3<<4, 3<<4);
4936 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
4938 snd_hda_codec_write(codec
, 0x21, 0,
4939 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
4941 snd_hda_codec_write(codec
, 0x21, 0,
4942 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4949 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4950 is_ctia
? "yes" : "no");
4951 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4954 static void alc_update_headset_mode(struct hda_codec
*codec
)
4956 struct alc_spec
*spec
= codec
->spec
;
4958 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4959 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
4961 int new_headset_mode
;
4963 if (!snd_hda_jack_detect(codec
, hp_pin
))
4964 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4965 else if (mux_pin
== spec
->headset_mic_pin
)
4966 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4967 else if (mux_pin
== spec
->headphone_mic_pin
)
4968 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4970 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4972 if (new_headset_mode
== spec
->current_headset_mode
) {
4973 snd_hda_gen_update_outputs(codec
);
4977 switch (new_headset_mode
) {
4978 case ALC_HEADSET_MODE_UNPLUGGED
:
4979 alc_headset_mode_unplugged(codec
);
4980 spec
->gen
.hp_jack_present
= false;
4982 case ALC_HEADSET_MODE_HEADSET
:
4983 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4984 alc_determine_headset_type(codec
);
4985 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4986 alc_headset_mode_ctia(codec
);
4987 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4988 alc_headset_mode_omtp(codec
);
4989 spec
->gen
.hp_jack_present
= true;
4991 case ALC_HEADSET_MODE_MIC
:
4992 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4993 spec
->gen
.hp_jack_present
= false;
4995 case ALC_HEADSET_MODE_HEADPHONE
:
4996 alc_headset_mode_default(codec
);
4997 spec
->gen
.hp_jack_present
= true;
5000 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
5001 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
5002 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
5003 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
5004 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
5007 spec
->current_headset_mode
= new_headset_mode
;
5009 snd_hda_gen_update_outputs(codec
);
5012 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
5013 struct snd_kcontrol
*kcontrol
,
5014 struct snd_ctl_elem_value
*ucontrol
)
5016 alc_update_headset_mode(codec
);
5019 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
5020 struct hda_jack_callback
*jack
)
5022 struct alc_spec
*spec
= codec
->spec
;
5023 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
5024 snd_hda_gen_hp_automute(codec
, jack
);
5027 static void alc_probe_headset_mode(struct hda_codec
*codec
)
5030 struct alc_spec
*spec
= codec
->spec
;
5031 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5034 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5035 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
5036 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
5037 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
5038 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
5041 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
5042 spec
->gen
.automute_hook
= alc_update_headset_mode
;
5043 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
5046 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
5047 const struct hda_fixup
*fix
, int action
)
5049 struct alc_spec
*spec
= codec
->spec
;
5052 case HDA_FIXUP_ACT_PRE_PROBE
:
5053 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
5055 case HDA_FIXUP_ACT_PROBE
:
5056 alc_probe_headset_mode(codec
);
5058 case HDA_FIXUP_ACT_INIT
:
5059 spec
->current_headset_mode
= 0;
5060 alc_update_headset_mode(codec
);
5065 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
5066 const struct hda_fixup
*fix
, int action
)
5068 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5069 struct alc_spec
*spec
= codec
->spec
;
5070 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5073 alc_fixup_headset_mode(codec
, fix
, action
);
5076 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
5078 /* Set to iphone type */
5079 static struct coef_fw alc255fw
[] = {
5080 WRITE_COEF(0x1b, 0x880b),
5081 WRITE_COEF(0x45, 0xd089),
5082 WRITE_COEF(0x1b, 0x080b),
5083 WRITE_COEF(0x46, 0x0004),
5084 WRITE_COEF(0x1b, 0x0c0b),
5087 static struct coef_fw alc256fw
[] = {
5088 WRITE_COEF(0x1b, 0x884b),
5089 WRITE_COEF(0x45, 0xd089),
5090 WRITE_COEF(0x1b, 0x084b),
5091 WRITE_COEF(0x46, 0x0004),
5092 WRITE_COEF(0x1b, 0x0c4b),
5095 switch (codec
->core
.vendor_id
) {
5097 alc_process_coef_fw(codec
, alc255fw
);
5101 alc_process_coef_fw(codec
, alc256fw
);
5107 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
5108 const struct hda_fixup
*fix
, int action
)
5110 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5111 alc255_set_default_jack_type(codec
);
5113 alc_fixup_headset_mode(codec
, fix
, action
);
5116 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
5117 const struct hda_fixup
*fix
, int action
)
5119 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5120 struct alc_spec
*spec
= codec
->spec
;
5121 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5122 alc255_set_default_jack_type(codec
);
5125 alc_fixup_headset_mode(codec
, fix
, action
);
5128 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
5129 struct hda_jack_callback
*jack
)
5131 struct alc_spec
*spec
= codec
->spec
;
5134 alc_update_headset_jack_cb(codec
, jack
);
5135 /* Headset Mic enable or disable, only for Dell Dino */
5136 present
= spec
->gen
.hp_jack_present
? 0x40 : 0;
5137 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
5141 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
5142 const struct hda_fixup
*fix
, int action
)
5144 alc_fixup_headset_mode(codec
, fix
, action
);
5145 if (action
== HDA_FIXUP_ACT_PROBE
) {
5146 struct alc_spec
*spec
= codec
->spec
;
5147 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
5151 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
5152 const struct hda_fixup
*fix
, int action
)
5154 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5155 struct alc_spec
*spec
= codec
->spec
;
5156 spec
->gen
.auto_mute_via_amp
= 1;
5160 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
5161 const struct hda_fixup
*fix
, int action
)
5163 if (action
== HDA_FIXUP_ACT_PROBE
) {
5164 struct alc_spec
*spec
= codec
->spec
;
5165 spec
->no_shutup_pins
= 1;
5169 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
5170 const struct hda_fixup
*fix
, int action
)
5172 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5173 struct alc_spec
*spec
= codec
->spec
;
5174 /* Disable AA-loopback as it causes white noise */
5175 spec
->gen
.mixer_nid
= 0;
5179 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5180 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
5181 const struct hda_fixup
*fix
, int action
)
5183 static const struct hda_pintbl pincfgs
[] = {
5184 { 0x16, 0x21211010 }, /* dock headphone */
5185 { 0x19, 0x21a11010 }, /* dock mic */
5188 struct alc_spec
*spec
= codec
->spec
;
5190 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5191 spec
->reboot_notify
= snd_hda_gen_reboot_notify
; /* reduce noise */
5192 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5193 codec
->power_save_node
= 0; /* avoid click noises */
5194 snd_hda_apply_pincfgs(codec
, pincfgs
);
5198 static void alc_fixup_tpt470_dock(struct hda_codec
*codec
,
5199 const struct hda_fixup
*fix
, int action
)
5201 static const struct hda_pintbl pincfgs
[] = {
5202 { 0x17, 0x21211010 }, /* dock headphone */
5203 { 0x19, 0x21a11010 }, /* dock mic */
5206 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5207 * the speaker output becomes too low by some reason on Thinkpads with
5210 static hda_nid_t preferred_pairs
[] = {
5211 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5214 struct alc_spec
*spec
= codec
->spec
;
5216 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5217 spec
->gen
.preferred_dacs
= preferred_pairs
;
5218 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5219 snd_hda_apply_pincfgs(codec
, pincfgs
);
5220 } else if (action
== HDA_FIXUP_ACT_INIT
) {
5221 /* Enable DOCK device */
5222 snd_hda_codec_write(codec
, 0x17, 0,
5223 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5224 /* Enable DOCK device */
5225 snd_hda_codec_write(codec
, 0x19, 0,
5226 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5230 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
5232 struct alc_spec
*spec
= codec
->spec
;
5233 int hp_pin
= alc_get_hp_pin(spec
);
5235 /* Prevent pop noises when headphones are plugged in */
5236 snd_hda_codec_write(codec
, hp_pin
, 0,
5237 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5241 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
5242 const struct hda_fixup
*fix
, int action
)
5244 struct alc_spec
*spec
= codec
->spec
;
5245 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
5249 case HDA_FIXUP_ACT_PRE_PROBE
:
5250 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5251 * it causes a click noise at start up
5253 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5255 case HDA_FIXUP_ACT_PROBE
:
5256 spec
->shutup
= alc_shutup_dell_xps13
;
5258 /* Make the internal mic the default input source. */
5259 for (i
= 0; i
< imux
->num_items
; i
++) {
5260 if (spec
->gen
.imux_pins
[i
] == 0x12) {
5261 spec
->gen
.cur_mux
[0] = i
;
5269 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
5270 const struct hda_fixup
*fix
, int action
)
5272 struct alc_spec
*spec
= codec
->spec
;
5274 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5275 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5276 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
5278 /* Disable boost for mic-in permanently. (This code is only called
5279 from quirks that guarantee that the headphone is at NID 0x1b.) */
5280 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
5281 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
5283 alc_fixup_headset_mode(codec
, fix
, action
);
5286 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
5287 const struct hda_fixup
*fix
, int action
)
5289 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5290 alc_write_coef_idx(codec
, 0xc4, 0x8000);
5291 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
5292 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
5294 alc_fixup_headset_mode(codec
, fix
, action
);
5297 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5298 static int find_ext_mic_pin(struct hda_codec
*codec
)
5300 struct alc_spec
*spec
= codec
->spec
;
5301 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5303 unsigned int defcfg
;
5306 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5307 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5309 nid
= cfg
->inputs
[i
].pin
;
5310 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5311 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
5319 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
5320 const struct hda_fixup
*fix
,
5323 struct alc_spec
*spec
= codec
->spec
;
5325 if (action
== HDA_FIXUP_ACT_PROBE
) {
5326 int mic_pin
= find_ext_mic_pin(codec
);
5327 int hp_pin
= alc_get_hp_pin(spec
);
5329 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
5331 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
5335 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
5336 const struct hda_fixup
*fix
,
5339 struct alc_spec
*spec
= codec
->spec
;
5340 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5343 /* The mic boosts on level 2 and 3 are too noisy
5344 on the internal mic input.
5345 Therefore limit the boost to 0 or 1. */
5347 if (action
!= HDA_FIXUP_ACT_PROBE
)
5350 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5351 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5352 unsigned int defcfg
;
5353 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5355 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5356 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
5359 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
5360 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
5361 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5362 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5363 (0 << AC_AMPCAP_MUTE_SHIFT
));
5367 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
5368 struct hda_jack_callback
*jack
)
5370 struct alc_spec
*spec
= codec
->spec
;
5374 snd_hda_gen_hp_automute(codec
, jack
);
5376 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
5379 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5383 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
5384 const struct hda_fixup
*fix
, int action
)
5386 struct alc_spec
*spec
= codec
->spec
;
5389 case HDA_FIXUP_ACT_PRE_PROBE
:
5390 snd_hda_override_wcaps(codec
, 0x03, 0);
5391 /* Disable AA-loopback as it causes white noise */
5392 spec
->gen
.mixer_nid
= 0;
5394 case HDA_FIXUP_ACT_INIT
:
5395 /* MIC2-VREF control */
5396 /* Set to manual mode */
5397 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5398 /* Enable Line1 input control by verb */
5399 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
5404 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
5405 const struct hda_fixup
*fix
, int action
)
5407 struct alc_spec
*spec
= codec
->spec
;
5410 case HDA_FIXUP_ACT_PRE_PROBE
:
5411 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
5413 case HDA_FIXUP_ACT_INIT
:
5414 /* MIC2-VREF control */
5415 /* Set to manual mode */
5416 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5421 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5422 static void asus_tx300_automute(struct hda_codec
*codec
)
5424 struct alc_spec
*spec
= codec
->spec
;
5425 snd_hda_gen_update_outputs(codec
);
5426 if (snd_hda_jack_detect(codec
, 0x1b))
5427 spec
->gen
.mute_bits
|= (1ULL << 0x14);
5430 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
5431 const struct hda_fixup
*fix
, int action
)
5433 struct alc_spec
*spec
= codec
->spec
;
5434 /* TX300 needs to set up GPIO2 for the speaker amp */
5435 static const struct hda_verb gpio2_verbs
[] = {
5436 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
5437 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
5438 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
5441 static const struct hda_pintbl dock_pins
[] = {
5442 { 0x1b, 0x21114000 }, /* dock speaker pin */
5447 case HDA_FIXUP_ACT_PRE_PROBE
:
5448 snd_hda_add_verbs(codec
, gpio2_verbs
);
5449 snd_hda_apply_pincfgs(codec
, dock_pins
);
5450 spec
->gen
.auto_mute_via_amp
= 1;
5451 spec
->gen
.automute_hook
= asus_tx300_automute
;
5452 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
5453 snd_hda_gen_hp_automute
);
5455 case HDA_FIXUP_ACT_BUILD
:
5456 /* this is a bit tricky; give more sane names for the main
5457 * (tablet) speaker and the dock speaker, respectively
5459 rename_ctl(codec
, "Speaker Playback Switch",
5460 "Dock Speaker Playback Switch");
5461 rename_ctl(codec
, "Bass Speaker Playback Switch",
5462 "Speaker Playback Switch");
5467 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
5468 const struct hda_fixup
*fix
, int action
)
5470 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5471 /* DAC node 0x03 is giving mono output. We therefore want to
5472 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5473 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5474 hda_nid_t conn1
[2] = { 0x0c };
5475 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
5476 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
5480 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
5481 const struct hda_fixup
*fix
, int action
)
5483 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5484 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5485 we can't adjust the speaker's volume since this node does not has
5486 Amp-out capability. we change the speaker's route to:
5487 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5488 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5489 speaker's volume now. */
5491 hda_nid_t conn1
[1] = { 0x0c };
5492 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
5496 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5497 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
5498 const struct hda_fixup
*fix
, int action
)
5500 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5501 hda_nid_t conn
[2] = { 0x02, 0x03 };
5502 snd_hda_override_conn_list(codec
, 0x17, 2, conn
);
5506 /* Hook to update amp GPIO4 for automute */
5507 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
5508 struct hda_jack_callback
*jack
)
5510 struct alc_spec
*spec
= codec
->spec
;
5512 snd_hda_gen_hp_automute(codec
, jack
);
5513 /* mute_led_polarity is set to 0, so we pass inverted value here */
5514 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
5517 /* Manage GPIOs for HP EliteBook Folio 9480m.
5519 * GPIO4 is the headphone amplifier power control
5520 * GPIO3 is the audio output mute indicator LED
5523 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5524 const struct hda_fixup
*fix
,
5527 struct alc_spec
*spec
= codec
->spec
;
5528 static const struct hda_verb gpio_init
[] = {
5529 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
5530 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
5534 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5535 /* Set the hooks to turn the headphone amp on/off
5538 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
5539 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5541 /* The GPIOs are currently off */
5544 /* GPIO3 is connected to the output mute LED,
5545 * high is on, low is off
5547 spec
->mute_led_polarity
= 0;
5548 spec
->gpio_mute_led_mask
= 0x08;
5550 /* Initialize GPIO configuration */
5551 snd_hda_add_verbs(codec
, gpio_init
);
5555 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5556 const struct hda_fixup
*fix
,
5559 alc_fixup_dual_codecs(codec
, fix
, action
);
5561 case HDA_FIXUP_ACT_PRE_PROBE
:
5562 /* override card longname to provide a unique UCM profile */
5563 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5565 case HDA_FIXUP_ACT_BUILD
:
5566 /* rename Capture controls depending on the codec */
5567 rename_ctl(codec
, "Capture Volume",
5569 "Rear-Panel Capture Volume" :
5570 "Front-Panel Capture Volume");
5571 rename_ctl(codec
, "Capture Switch",
5573 "Rear-Panel Capture Switch" :
5574 "Front-Panel Capture Switch");
5579 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5580 static void alc274_fixup_bind_dacs(struct hda_codec
*codec
,
5581 const struct hda_fixup
*fix
, int action
)
5583 struct alc_spec
*spec
= codec
->spec
;
5584 static hda_nid_t preferred_pairs
[] = {
5585 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5589 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5592 spec
->gen
.preferred_dacs
= preferred_pairs
;
5593 spec
->gen
.auto_mute_via_amp
= 1;
5594 codec
->power_save_node
= 0;
5597 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5598 static void alc285_fixup_invalidate_dacs(struct hda_codec
*codec
,
5599 const struct hda_fixup
*fix
, int action
)
5601 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5604 snd_hda_override_wcaps(codec
, 0x03, 0);
5607 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
5608 const struct hda_fixup
*fix
, int action
)
5610 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5611 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5614 /* for hda_fixup_thinkpad_acpi() */
5615 #include "thinkpad_helper.c"
5617 static void alc_fixup_thinkpad_acpi(struct hda_codec
*codec
,
5618 const struct hda_fixup
*fix
, int action
)
5620 alc_fixup_no_shutup(codec
, fix
, action
); /* reduce click noise */
5621 hda_fixup_thinkpad_acpi(codec
, fix
, action
);
5624 /* for dell wmi mic mute led */
5625 #include "dell_wmi_helper.c"
5628 ALC269_FIXUP_SONY_VAIO
,
5629 ALC275_FIXUP_SONY_VAIO_GPIO2
,
5630 ALC269_FIXUP_DELL_M101Z
,
5631 ALC269_FIXUP_SKU_IGNORE
,
5632 ALC269_FIXUP_ASUS_G73JW
,
5633 ALC269_FIXUP_LENOVO_EAPD
,
5634 ALC275_FIXUP_SONY_HWEQ
,
5635 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
5637 ALC269_FIXUP_PCM_44K
,
5638 ALC269_FIXUP_STEREO_DMIC
,
5639 ALC269_FIXUP_HEADSET_MIC
,
5640 ALC269_FIXUP_QUANTA_MUTE
,
5641 ALC269_FIXUP_LIFEBOOK
,
5642 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
5643 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
5644 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
5645 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
5648 ALC269VB_FIXUP_AMIC
,
5649 ALC269VB_FIXUP_DMIC
,
5650 ALC269_FIXUP_HP_MUTE_LED
,
5651 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5652 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
5653 ALC269_FIXUP_HP_MUTE_LED_MIC3
,
5654 ALC269_FIXUP_HP_GPIO_LED
,
5655 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
5656 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
5657 ALC269_FIXUP_INV_DMIC
,
5658 ALC269_FIXUP_LENOVO_DOCK
,
5659 ALC269_FIXUP_NO_SHUTUP
,
5660 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
5661 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
5662 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5663 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
5664 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5665 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
5666 ALC269_FIXUP_HEADSET_MODE
,
5667 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5668 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
5669 ALC269_FIXUP_ASUS_X101_FUNC
,
5670 ALC269_FIXUP_ASUS_X101_VERB
,
5671 ALC269_FIXUP_ASUS_X101
,
5672 ALC271_FIXUP_AMIC_MIC2
,
5673 ALC271_FIXUP_HP_GATE_MIC_JACK
,
5674 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
5675 ALC269_FIXUP_ACER_AC700
,
5676 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
5677 ALC269VB_FIXUP_ASUS_ZENBOOK
,
5678 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
5679 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
5680 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
5681 ALC283_FIXUP_CHROME_BOOK
,
5682 ALC283_FIXUP_SENSE_COMBO_JACK
,
5683 ALC282_FIXUP_ASUS_TX300
,
5684 ALC283_FIXUP_INT_MIC
,
5685 ALC290_FIXUP_MONO_SPEAKERS
,
5686 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5687 ALC290_FIXUP_SUBWOOFER
,
5688 ALC290_FIXUP_SUBWOOFER_HSJACK
,
5689 ALC269_FIXUP_THINKPAD_ACPI
,
5690 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
5691 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
5692 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
5693 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5694 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5695 ALC255_FIXUP_HEADSET_MODE
,
5696 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5697 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5698 ALC292_FIXUP_TPT440_DOCK
,
5699 ALC292_FIXUP_TPT440
,
5700 ALC283_FIXUP_HEADSET_MIC
,
5701 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
,
5702 ALC282_FIXUP_ASPIRE_V5_PINS
,
5703 ALC280_FIXUP_HP_GPIO4
,
5704 ALC286_FIXUP_HP_GPIO_LED
,
5705 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
5706 ALC280_FIXUP_HP_DOCK_PINS
,
5707 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
5708 ALC280_FIXUP_HP_9480M
,
5709 ALC288_FIXUP_DELL_HEADSET_MODE
,
5710 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
5711 ALC288_FIXUP_DELL_XPS_13_GPIO6
,
5712 ALC288_FIXUP_DELL_XPS_13
,
5713 ALC288_FIXUP_DISABLE_AAMIX
,
5714 ALC292_FIXUP_DELL_E7X
,
5715 ALC292_FIXUP_DISABLE_AAMIX
,
5716 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
5717 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
5718 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5719 ALC275_FIXUP_DELL_XPS
,
5720 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
5721 ALC293_FIXUP_LENOVO_SPK_NOISE
,
5722 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
5723 ALC255_FIXUP_DELL_SPK_NOISE
,
5724 ALC225_FIXUP_DISABLE_MIC_VREF
,
5725 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5726 ALC295_FIXUP_DISABLE_DAC3
,
5727 ALC280_FIXUP_HP_HEADSET_MIC
,
5728 ALC221_FIXUP_HP_FRONT_MIC
,
5729 ALC292_FIXUP_TPT460
,
5730 ALC298_FIXUP_SPK_VOLUME
,
5731 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
5732 ALC269_FIXUP_ATIV_BOOK_8
,
5733 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
5734 ALC256_FIXUP_ASUS_HEADSET_MODE
,
5735 ALC256_FIXUP_ASUS_MIC
,
5736 ALC256_FIXUP_ASUS_AIO_GPIO2
,
5737 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
5738 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
5739 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
5740 ALC294_FIXUP_LENOVO_MIC_LOCATION
,
5741 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
,
5742 ALC700_FIXUP_INTEL_REFERENCE
,
5743 ALC274_FIXUP_DELL_BIND_DACS
,
5744 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
5745 ALC298_FIXUP_TPT470_DOCK
,
5746 ALC255_FIXUP_DUMMY_LINEOUT_VERB
,
5747 ALC255_FIXUP_DELL_HEADSET_MIC
,
5748 ALC256_FIXUP_HUAWEI_MBXP_PINS
,
5749 ALC221_FIXUP_HP_HEADSET_MIC
,
5750 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
,
5751 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
5752 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
5753 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
,
5754 ALC294_FIXUP_ASUS_MIC
,
5755 ALC294_FIXUP_ASUS_HEADSET_MIC
,
5756 ALC294_FIXUP_ASUS_SPK
,
5757 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
,
5758 ALC225_FIXUP_WYSE_AUTO_MUTE
,
5759 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
,
5760 ALC286_FIXUP_ACER_AIO_HEADSET_MIC
,
5761 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
5762 ALC299_FIXUP_PREDATOR_SPK
,
5763 ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC
,
5764 ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
,
5767 static const struct hda_fixup alc269_fixups
[] = {
5768 [ALC269_FIXUP_SONY_VAIO
] = {
5769 .type
= HDA_FIXUP_PINCTLS
,
5770 .v
.pins
= (const struct hda_pintbl
[]) {
5771 {0x19, PIN_VREFGRD
},
5775 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
5776 .type
= HDA_FIXUP_VERBS
,
5777 .v
.verbs
= (const struct hda_verb
[]) {
5778 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
5779 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
5780 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5784 .chain_id
= ALC269_FIXUP_SONY_VAIO
5786 [ALC269_FIXUP_DELL_M101Z
] = {
5787 .type
= HDA_FIXUP_VERBS
,
5788 .v
.verbs
= (const struct hda_verb
[]) {
5789 /* Enables internal speaker */
5790 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
5791 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
5795 [ALC269_FIXUP_SKU_IGNORE
] = {
5796 .type
= HDA_FIXUP_FUNC
,
5797 .v
.func
= alc_fixup_sku_ignore
,
5799 [ALC269_FIXUP_ASUS_G73JW
] = {
5800 .type
= HDA_FIXUP_PINS
,
5801 .v
.pins
= (const struct hda_pintbl
[]) {
5802 { 0x17, 0x99130111 }, /* subwoofer */
5806 [ALC269_FIXUP_LENOVO_EAPD
] = {
5807 .type
= HDA_FIXUP_VERBS
,
5808 .v
.verbs
= (const struct hda_verb
[]) {
5809 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5813 [ALC275_FIXUP_SONY_HWEQ
] = {
5814 .type
= HDA_FIXUP_FUNC
,
5815 .v
.func
= alc269_fixup_hweq
,
5817 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
5819 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
5820 .type
= HDA_FIXUP_FUNC
,
5821 .v
.func
= alc_fixup_disable_aamix
,
5823 .chain_id
= ALC269_FIXUP_SONY_VAIO
5825 [ALC271_FIXUP_DMIC
] = {
5826 .type
= HDA_FIXUP_FUNC
,
5827 .v
.func
= alc271_fixup_dmic
,
5829 [ALC269_FIXUP_PCM_44K
] = {
5830 .type
= HDA_FIXUP_FUNC
,
5831 .v
.func
= alc269_fixup_pcm_44k
,
5833 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5835 [ALC269_FIXUP_STEREO_DMIC
] = {
5836 .type
= HDA_FIXUP_FUNC
,
5837 .v
.func
= alc269_fixup_stereo_dmic
,
5839 [ALC269_FIXUP_HEADSET_MIC
] = {
5840 .type
= HDA_FIXUP_FUNC
,
5841 .v
.func
= alc269_fixup_headset_mic
,
5843 [ALC269_FIXUP_QUANTA_MUTE
] = {
5844 .type
= HDA_FIXUP_FUNC
,
5845 .v
.func
= alc269_fixup_quanta_mute
,
5847 [ALC269_FIXUP_LIFEBOOK
] = {
5848 .type
= HDA_FIXUP_PINS
,
5849 .v
.pins
= (const struct hda_pintbl
[]) {
5850 { 0x1a, 0x2101103f }, /* dock line-out */
5851 { 0x1b, 0x23a11040 }, /* dock mic-in */
5855 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5857 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5858 .type
= HDA_FIXUP_PINS
,
5859 .v
.pins
= (const struct hda_pintbl
[]) {
5860 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5864 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5865 .type
= HDA_FIXUP_PINS
,
5866 .v
.pins
= (const struct hda_pintbl
[]) {
5867 { 0x21, 0x0221102f }, /* HP out */
5871 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5872 .type
= HDA_FIXUP_FUNC
,
5873 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5875 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
5876 .type
= HDA_FIXUP_FUNC
,
5877 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
5879 [ALC269_FIXUP_AMIC
] = {
5880 .type
= HDA_FIXUP_PINS
,
5881 .v
.pins
= (const struct hda_pintbl
[]) {
5882 { 0x14, 0x99130110 }, /* speaker */
5883 { 0x15, 0x0121401f }, /* HP out */
5884 { 0x18, 0x01a19c20 }, /* mic */
5885 { 0x19, 0x99a3092f }, /* int-mic */
5889 [ALC269_FIXUP_DMIC
] = {
5890 .type
= HDA_FIXUP_PINS
,
5891 .v
.pins
= (const struct hda_pintbl
[]) {
5892 { 0x12, 0x99a3092f }, /* int-mic */
5893 { 0x14, 0x99130110 }, /* speaker */
5894 { 0x15, 0x0121401f }, /* HP out */
5895 { 0x18, 0x01a19c20 }, /* mic */
5899 [ALC269VB_FIXUP_AMIC
] = {
5900 .type
= HDA_FIXUP_PINS
,
5901 .v
.pins
= (const struct hda_pintbl
[]) {
5902 { 0x14, 0x99130110 }, /* speaker */
5903 { 0x18, 0x01a19c20 }, /* mic */
5904 { 0x19, 0x99a3092f }, /* int-mic */
5905 { 0x21, 0x0121401f }, /* HP out */
5909 [ALC269VB_FIXUP_DMIC
] = {
5910 .type
= HDA_FIXUP_PINS
,
5911 .v
.pins
= (const struct hda_pintbl
[]) {
5912 { 0x12, 0x99a3092f }, /* int-mic */
5913 { 0x14, 0x99130110 }, /* speaker */
5914 { 0x18, 0x01a19c20 }, /* mic */
5915 { 0x21, 0x0121401f }, /* HP out */
5919 [ALC269_FIXUP_HP_MUTE_LED
] = {
5920 .type
= HDA_FIXUP_FUNC
,
5921 .v
.func
= alc269_fixup_hp_mute_led
,
5923 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5924 .type
= HDA_FIXUP_FUNC
,
5925 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5927 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5928 .type
= HDA_FIXUP_FUNC
,
5929 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5931 [ALC269_FIXUP_HP_MUTE_LED_MIC3
] = {
5932 .type
= HDA_FIXUP_FUNC
,
5933 .v
.func
= alc269_fixup_hp_mute_led_mic3
,
5935 [ALC269_FIXUP_HP_GPIO_LED
] = {
5936 .type
= HDA_FIXUP_FUNC
,
5937 .v
.func
= alc269_fixup_hp_gpio_led
,
5939 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5940 .type
= HDA_FIXUP_FUNC
,
5941 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5943 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5944 .type
= HDA_FIXUP_FUNC
,
5945 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5947 [ALC269_FIXUP_INV_DMIC
] = {
5948 .type
= HDA_FIXUP_FUNC
,
5949 .v
.func
= alc_fixup_inv_dmic
,
5951 [ALC269_FIXUP_NO_SHUTUP
] = {
5952 .type
= HDA_FIXUP_FUNC
,
5953 .v
.func
= alc_fixup_no_shutup
,
5955 [ALC269_FIXUP_LENOVO_DOCK
] = {
5956 .type
= HDA_FIXUP_PINS
,
5957 .v
.pins
= (const struct hda_pintbl
[]) {
5958 { 0x19, 0x23a11040 }, /* dock mic */
5959 { 0x1b, 0x2121103f }, /* dock headphone */
5963 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5965 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5966 .type
= HDA_FIXUP_FUNC
,
5967 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5969 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5971 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5972 .type
= HDA_FIXUP_PINS
,
5973 .v
.pins
= (const struct hda_pintbl
[]) {
5974 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5975 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5979 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5981 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5982 .type
= HDA_FIXUP_PINS
,
5983 .v
.pins
= (const struct hda_pintbl
[]) {
5984 { 0x16, 0x21014020 }, /* dock line out */
5985 { 0x19, 0x21a19030 }, /* dock mic */
5986 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5990 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5992 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5993 .type
= HDA_FIXUP_PINS
,
5994 .v
.pins
= (const struct hda_pintbl
[]) {
5995 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5999 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6001 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
6002 .type
= HDA_FIXUP_PINS
,
6003 .v
.pins
= (const struct hda_pintbl
[]) {
6004 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6005 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6009 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6011 [ALC269_FIXUP_HEADSET_MODE
] = {
6012 .type
= HDA_FIXUP_FUNC
,
6013 .v
.func
= alc_fixup_headset_mode
,
6015 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6017 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6018 .type
= HDA_FIXUP_FUNC
,
6019 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
6021 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
6022 .type
= HDA_FIXUP_PINS
,
6023 .v
.pins
= (const struct hda_pintbl
[]) {
6024 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
6028 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
6030 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
6031 .type
= HDA_FIXUP_PINS
,
6032 .v
.pins
= (const struct hda_pintbl
[]) {
6033 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6037 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6039 [ALC256_FIXUP_HUAWEI_MBXP_PINS
] = {
6040 .type
= HDA_FIXUP_PINS
,
6041 .v
.pins
= (const struct hda_pintbl
[]) {
6055 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
6056 .type
= HDA_FIXUP_FUNC
,
6057 .v
.func
= alc269_fixup_x101_headset_mic
,
6059 [ALC269_FIXUP_ASUS_X101_VERB
] = {
6060 .type
= HDA_FIXUP_VERBS
,
6061 .v
.verbs
= (const struct hda_verb
[]) {
6062 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6063 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
6064 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
6068 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
6070 [ALC269_FIXUP_ASUS_X101
] = {
6071 .type
= HDA_FIXUP_PINS
,
6072 .v
.pins
= (const struct hda_pintbl
[]) {
6073 { 0x18, 0x04a1182c }, /* Headset mic */
6077 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
6079 [ALC271_FIXUP_AMIC_MIC2
] = {
6080 .type
= HDA_FIXUP_PINS
,
6081 .v
.pins
= (const struct hda_pintbl
[]) {
6082 { 0x14, 0x99130110 }, /* speaker */
6083 { 0x19, 0x01a19c20 }, /* mic */
6084 { 0x1b, 0x99a7012f }, /* int-mic */
6085 { 0x21, 0x0121401f }, /* HP out */
6089 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
6090 .type
= HDA_FIXUP_FUNC
,
6091 .v
.func
= alc271_hp_gate_mic_jack
,
6093 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
6095 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
6096 .type
= HDA_FIXUP_FUNC
,
6097 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6099 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
6101 [ALC269_FIXUP_ACER_AC700
] = {
6102 .type
= HDA_FIXUP_PINS
,
6103 .v
.pins
= (const struct hda_pintbl
[]) {
6104 { 0x12, 0x99a3092f }, /* int-mic */
6105 { 0x14, 0x99130110 }, /* speaker */
6106 { 0x18, 0x03a11c20 }, /* mic */
6107 { 0x1e, 0x0346101e }, /* SPDIF1 */
6108 { 0x21, 0x0321101f }, /* HP out */
6112 .chain_id
= ALC271_FIXUP_DMIC
,
6114 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
6115 .type
= HDA_FIXUP_FUNC
,
6116 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6118 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6120 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
6121 .type
= HDA_FIXUP_FUNC
,
6122 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6124 .chain_id
= ALC269VB_FIXUP_DMIC
,
6126 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
6127 .type
= HDA_FIXUP_VERBS
,
6128 .v
.verbs
= (const struct hda_verb
[]) {
6129 /* class-D output amp +5dB */
6130 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
6131 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
6135 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
6137 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
6138 .type
= HDA_FIXUP_FUNC
,
6139 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6141 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6143 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
6144 .type
= HDA_FIXUP_PINS
,
6145 .v
.pins
= (const struct hda_pintbl
[]) {
6146 { 0x12, 0x99a3092f }, /* int-mic */
6147 { 0x18, 0x03a11d20 }, /* mic */
6148 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6152 [ALC283_FIXUP_CHROME_BOOK
] = {
6153 .type
= HDA_FIXUP_FUNC
,
6154 .v
.func
= alc283_fixup_chromebook
,
6156 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
6157 .type
= HDA_FIXUP_FUNC
,
6158 .v
.func
= alc283_fixup_sense_combo_jack
,
6160 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
6162 [ALC282_FIXUP_ASUS_TX300
] = {
6163 .type
= HDA_FIXUP_FUNC
,
6164 .v
.func
= alc282_fixup_asus_tx300
,
6166 [ALC283_FIXUP_INT_MIC
] = {
6167 .type
= HDA_FIXUP_VERBS
,
6168 .v
.verbs
= (const struct hda_verb
[]) {
6169 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
6170 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
6174 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6176 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
6177 .type
= HDA_FIXUP_PINS
,
6178 .v
.pins
= (const struct hda_pintbl
[]) {
6179 { 0x17, 0x90170112 }, /* subwoofer */
6183 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6185 [ALC290_FIXUP_SUBWOOFER
] = {
6186 .type
= HDA_FIXUP_PINS
,
6187 .v
.pins
= (const struct hda_pintbl
[]) {
6188 { 0x17, 0x90170112 }, /* subwoofer */
6192 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
6194 [ALC290_FIXUP_MONO_SPEAKERS
] = {
6195 .type
= HDA_FIXUP_FUNC
,
6196 .v
.func
= alc290_fixup_mono_speakers
,
6198 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
6199 .type
= HDA_FIXUP_FUNC
,
6200 .v
.func
= alc290_fixup_mono_speakers
,
6202 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6204 [ALC269_FIXUP_THINKPAD_ACPI
] = {
6205 .type
= HDA_FIXUP_FUNC
,
6206 .v
.func
= alc_fixup_thinkpad_acpi
,
6208 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
6210 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
6211 .type
= HDA_FIXUP_FUNC
,
6212 .v
.func
= alc_fixup_inv_dmic
,
6214 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6216 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
6217 .type
= HDA_FIXUP_PINS
,
6218 .v
.pins
= (const struct hda_pintbl
[]) {
6219 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6223 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6225 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6226 .type
= HDA_FIXUP_PINS
,
6227 .v
.pins
= (const struct hda_pintbl
[]) {
6228 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6232 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6234 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6235 .type
= HDA_FIXUP_PINS
,
6236 .v
.pins
= (const struct hda_pintbl
[]) {
6237 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6238 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6242 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6244 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6245 .type
= HDA_FIXUP_PINS
,
6246 .v
.pins
= (const struct hda_pintbl
[]) {
6247 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6251 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6253 [ALC255_FIXUP_HEADSET_MODE
] = {
6254 .type
= HDA_FIXUP_FUNC
,
6255 .v
.func
= alc_fixup_headset_mode_alc255
,
6257 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6259 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6260 .type
= HDA_FIXUP_FUNC
,
6261 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
6263 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6264 .type
= HDA_FIXUP_PINS
,
6265 .v
.pins
= (const struct hda_pintbl
[]) {
6266 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6267 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6271 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6273 [ALC292_FIXUP_TPT440_DOCK
] = {
6274 .type
= HDA_FIXUP_FUNC
,
6275 .v
.func
= alc_fixup_tpt440_dock
,
6277 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6279 [ALC292_FIXUP_TPT440
] = {
6280 .type
= HDA_FIXUP_FUNC
,
6281 .v
.func
= alc_fixup_disable_aamix
,
6283 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
6285 [ALC283_FIXUP_HEADSET_MIC
] = {
6286 .type
= HDA_FIXUP_PINS
,
6287 .v
.pins
= (const struct hda_pintbl
[]) {
6288 { 0x19, 0x04a110f0 },
6292 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
] = {
6293 .type
= HDA_FIXUP_FUNC
,
6294 .v
.func
= alc_fixup_dell_wmi
,
6296 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
6297 .type
= HDA_FIXUP_PINS
,
6298 .v
.pins
= (const struct hda_pintbl
[]) {
6299 { 0x12, 0x90a60130 },
6300 { 0x14, 0x90170110 },
6301 { 0x17, 0x40000008 },
6302 { 0x18, 0x411111f0 },
6303 { 0x19, 0x01a1913c },
6304 { 0x1a, 0x411111f0 },
6305 { 0x1b, 0x411111f0 },
6306 { 0x1d, 0x40f89b2d },
6307 { 0x1e, 0x411111f0 },
6308 { 0x21, 0x0321101f },
6312 [ALC280_FIXUP_HP_GPIO4
] = {
6313 .type
= HDA_FIXUP_FUNC
,
6314 .v
.func
= alc280_fixup_hp_gpio4
,
6316 [ALC286_FIXUP_HP_GPIO_LED
] = {
6317 .type
= HDA_FIXUP_FUNC
,
6318 .v
.func
= alc286_fixup_hp_gpio_led
,
6320 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
6321 .type
= HDA_FIXUP_FUNC
,
6322 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
6324 [ALC280_FIXUP_HP_DOCK_PINS
] = {
6325 .type
= HDA_FIXUP_PINS
,
6326 .v
.pins
= (const struct hda_pintbl
[]) {
6327 { 0x1b, 0x21011020 }, /* line-out */
6328 { 0x1a, 0x01a1903c }, /* headset mic */
6329 { 0x18, 0x2181103f }, /* line-in */
6333 .chain_id
= ALC280_FIXUP_HP_GPIO4
6335 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
6336 .type
= HDA_FIXUP_PINS
,
6337 .v
.pins
= (const struct hda_pintbl
[]) {
6338 { 0x1b, 0x21011020 }, /* line-out */
6339 { 0x18, 0x2181103f }, /* line-in */
6343 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
6345 [ALC280_FIXUP_HP_9480M
] = {
6346 .type
= HDA_FIXUP_FUNC
,
6347 .v
.func
= alc280_fixup_hp_9480m
,
6349 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
6350 .type
= HDA_FIXUP_FUNC
,
6351 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
6353 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6355 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6356 .type
= HDA_FIXUP_PINS
,
6357 .v
.pins
= (const struct hda_pintbl
[]) {
6358 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6359 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6363 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
6365 [ALC288_FIXUP_DELL_XPS_13_GPIO6
] = {
6366 .type
= HDA_FIXUP_VERBS
,
6367 .v
.verbs
= (const struct hda_verb
[]) {
6368 {0x01, AC_VERB_SET_GPIO_MASK
, 0x40},
6369 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x40},
6370 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
6374 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6376 [ALC288_FIXUP_DISABLE_AAMIX
] = {
6377 .type
= HDA_FIXUP_FUNC
,
6378 .v
.func
= alc_fixup_disable_aamix
,
6380 .chain_id
= ALC288_FIXUP_DELL_XPS_13_GPIO6
6382 [ALC288_FIXUP_DELL_XPS_13
] = {
6383 .type
= HDA_FIXUP_FUNC
,
6384 .v
.func
= alc_fixup_dell_xps13
,
6386 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
6388 [ALC292_FIXUP_DISABLE_AAMIX
] = {
6389 .type
= HDA_FIXUP_FUNC
,
6390 .v
.func
= alc_fixup_disable_aamix
,
6392 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6394 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
6395 .type
= HDA_FIXUP_FUNC
,
6396 .v
.func
= alc_fixup_disable_aamix
,
6398 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6400 [ALC292_FIXUP_DELL_E7X
] = {
6401 .type
= HDA_FIXUP_FUNC
,
6402 .v
.func
= alc_fixup_dell_xps13
,
6404 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
6406 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6407 .type
= HDA_FIXUP_PINS
,
6408 .v
.pins
= (const struct hda_pintbl
[]) {
6409 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6410 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6414 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6416 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
6417 .type
= HDA_FIXUP_PINS
,
6418 .v
.pins
= (const struct hda_pintbl
[]) {
6419 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6423 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6425 [ALC275_FIXUP_DELL_XPS
] = {
6426 .type
= HDA_FIXUP_VERBS
,
6427 .v
.verbs
= (const struct hda_verb
[]) {
6428 /* Enables internal speaker */
6429 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
6430 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
6431 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
6432 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
6436 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
6437 .type
= HDA_FIXUP_VERBS
,
6438 .v
.verbs
= (const struct hda_verb
[]) {
6439 /* Disable pass-through path for FRONT 14h */
6440 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
6441 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
6445 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6447 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
6448 .type
= HDA_FIXUP_FUNC
,
6449 .v
.func
= alc_fixup_disable_aamix
,
6451 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6453 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
6454 .type
= HDA_FIXUP_FUNC
,
6455 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
6457 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
6458 .type
= HDA_FIXUP_FUNC
,
6459 .v
.func
= alc_fixup_disable_aamix
,
6461 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6463 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
6464 .type
= HDA_FIXUP_FUNC
,
6465 .v
.func
= alc_fixup_disable_mic_vref
,
6467 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6469 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6470 .type
= HDA_FIXUP_VERBS
,
6471 .v
.verbs
= (const struct hda_verb
[]) {
6472 /* Disable pass-through path for FRONT 14h */
6473 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6474 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6478 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
6480 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
6481 .type
= HDA_FIXUP_FUNC
,
6482 .v
.func
= alc_fixup_disable_aamix
,
6484 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
6486 [ALC221_FIXUP_HP_FRONT_MIC
] = {
6487 .type
= HDA_FIXUP_PINS
,
6488 .v
.pins
= (const struct hda_pintbl
[]) {
6489 { 0x19, 0x02a19020 }, /* Front Mic */
6493 [ALC292_FIXUP_TPT460
] = {
6494 .type
= HDA_FIXUP_FUNC
,
6495 .v
.func
= alc_fixup_tpt440_dock
,
6497 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
6499 [ALC298_FIXUP_SPK_VOLUME
] = {
6500 .type
= HDA_FIXUP_FUNC
,
6501 .v
.func
= alc298_fixup_speaker_volume
,
6503 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
6505 [ALC295_FIXUP_DISABLE_DAC3
] = {
6506 .type
= HDA_FIXUP_FUNC
,
6507 .v
.func
= alc295_fixup_disable_dac3
,
6509 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
6510 .type
= HDA_FIXUP_PINS
,
6511 .v
.pins
= (const struct hda_pintbl
[]) {
6512 { 0x1b, 0x90170151 },
6516 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6518 [ALC269_FIXUP_ATIV_BOOK_8
] = {
6519 .type
= HDA_FIXUP_FUNC
,
6520 .v
.func
= alc_fixup_auto_mute_via_amp
,
6522 .chain_id
= ALC269_FIXUP_NO_SHUTUP
6524 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
6525 .type
= HDA_FIXUP_PINS
,
6526 .v
.pins
= (const struct hda_pintbl
[]) {
6527 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6528 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6532 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6534 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
6535 .type
= HDA_FIXUP_FUNC
,
6536 .v
.func
= alc_fixup_headset_mode
,
6538 [ALC256_FIXUP_ASUS_MIC
] = {
6539 .type
= HDA_FIXUP_PINS
,
6540 .v
.pins
= (const struct hda_pintbl
[]) {
6541 { 0x13, 0x90a60160 }, /* use as internal mic */
6542 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6546 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6548 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
6549 .type
= HDA_FIXUP_VERBS
,
6550 .v
.verbs
= (const struct hda_verb
[]) {
6551 /* Set up GPIO2 for the speaker amp */
6552 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
6553 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
6554 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
6558 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6559 .type
= HDA_FIXUP_PINS
,
6560 .v
.pins
= (const struct hda_pintbl
[]) {
6561 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6565 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6567 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
6568 .type
= HDA_FIXUP_VERBS
,
6569 .v
.verbs
= (const struct hda_verb
[]) {
6570 /* Enables internal speaker */
6571 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
6572 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
6576 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6578 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
6579 .type
= HDA_FIXUP_FUNC
,
6580 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
6582 [ALC294_FIXUP_LENOVO_MIC_LOCATION
] = {
6583 .type
= HDA_FIXUP_PINS
,
6584 .v
.pins
= (const struct hda_pintbl
[]) {
6585 /* Change the mic location from front to right, otherwise there are
6586 two front mics with the same name, pulseaudio can't handle them.
6587 This is just a temporary workaround, after applying this fixup,
6588 there will be one "Front Mic" and one "Mic" in this machine.
6590 { 0x1a, 0x04a19040 },
6594 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
] = {
6595 .type
= HDA_FIXUP_PINS
,
6596 .v
.pins
= (const struct hda_pintbl
[]) {
6597 { 0x16, 0x0101102f }, /* Rear Headset HP */
6598 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6599 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6600 { 0x1b, 0x02011020 },
6604 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6606 [ALC700_FIXUP_INTEL_REFERENCE
] = {
6607 .type
= HDA_FIXUP_VERBS
,
6608 .v
.verbs
= (const struct hda_verb
[]) {
6609 /* Enables internal speaker */
6610 {0x20, AC_VERB_SET_COEF_INDEX
, 0x45},
6611 {0x20, AC_VERB_SET_PROC_COEF
, 0x5289},
6612 {0x20, AC_VERB_SET_COEF_INDEX
, 0x4A},
6613 {0x20, AC_VERB_SET_PROC_COEF
, 0x001b},
6614 {0x58, AC_VERB_SET_COEF_INDEX
, 0x00},
6615 {0x58, AC_VERB_SET_PROC_COEF
, 0x3888},
6616 {0x20, AC_VERB_SET_COEF_INDEX
, 0x6f},
6617 {0x20, AC_VERB_SET_PROC_COEF
, 0x2c0b},
6621 [ALC274_FIXUP_DELL_BIND_DACS
] = {
6622 .type
= HDA_FIXUP_FUNC
,
6623 .v
.func
= alc274_fixup_bind_dacs
,
6625 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6627 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
] = {
6628 .type
= HDA_FIXUP_PINS
,
6629 .v
.pins
= (const struct hda_pintbl
[]) {
6630 { 0x1b, 0x0401102f },
6634 .chain_id
= ALC274_FIXUP_DELL_BIND_DACS
6636 [ALC298_FIXUP_TPT470_DOCK
] = {
6637 .type
= HDA_FIXUP_FUNC
,
6638 .v
.func
= alc_fixup_tpt470_dock
,
6640 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
6642 [ALC255_FIXUP_DUMMY_LINEOUT_VERB
] = {
6643 .type
= HDA_FIXUP_PINS
,
6644 .v
.pins
= (const struct hda_pintbl
[]) {
6645 { 0x14, 0x0201101f },
6649 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6651 [ALC255_FIXUP_DELL_HEADSET_MIC
] = {
6652 .type
= HDA_FIXUP_PINS
,
6653 .v
.pins
= (const struct hda_pintbl
[]) {
6654 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6658 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6660 [ALC221_FIXUP_HP_HEADSET_MIC
] = {
6661 .type
= HDA_FIXUP_PINS
,
6662 .v
.pins
= (const struct hda_pintbl
[]) {
6663 { 0x19, 0x0181313f},
6667 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6669 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
] = {
6670 .type
= HDA_FIXUP_FUNC
,
6671 .v
.func
= alc285_fixup_invalidate_dacs
,
6673 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6675 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
] = {
6676 .type
= HDA_FIXUP_VERBS
,
6677 .v
.verbs
= (const struct hda_verb
[]) {
6678 /* Disable PCBEEP-IN passthrough */
6679 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6680 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6684 .chain_id
= ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6686 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
] = {
6687 .type
= HDA_FIXUP_PINS
,
6688 .v
.pins
= (const struct hda_pintbl
[]) {
6689 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6693 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6695 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
] = {
6696 .type
= HDA_FIXUP_PINS
,
6697 .v
.pins
= (const struct hda_pintbl
[]) {
6698 { 0x16, 0x01011020 }, /* Rear Line out */
6699 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6703 .chain_id
= ALC225_FIXUP_WYSE_AUTO_MUTE
6705 [ALC225_FIXUP_WYSE_AUTO_MUTE
] = {
6706 .type
= HDA_FIXUP_FUNC
,
6707 .v
.func
= alc_fixup_auto_mute_via_amp
,
6709 .chain_id
= ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6711 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
] = {
6712 .type
= HDA_FIXUP_FUNC
,
6713 .v
.func
= alc_fixup_disable_mic_vref
,
6715 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6717 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
] = {
6718 .type
= HDA_FIXUP_PINS
,
6719 .v
.pins
= (const struct hda_pintbl
[]) {
6720 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6724 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6726 [ALC294_FIXUP_ASUS_MIC
] = {
6727 .type
= HDA_FIXUP_PINS
,
6728 .v
.pins
= (const struct hda_pintbl
[]) {
6729 { 0x13, 0x90a60160 }, /* use as internal mic */
6730 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6734 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6736 [ALC294_FIXUP_ASUS_HEADSET_MIC
] = {
6737 .type
= HDA_FIXUP_PINS
,
6738 .v
.pins
= (const struct hda_pintbl
[]) {
6739 { 0x19, 0x01a1103c }, /* use as headset mic */
6743 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6745 [ALC294_FIXUP_ASUS_SPK
] = {
6746 .type
= HDA_FIXUP_VERBS
,
6747 .v
.verbs
= (const struct hda_verb
[]) {
6749 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x40 },
6750 { 0x20, AC_VERB_SET_PROC_COEF
, 0x8800 },
6754 .chain_id
= ALC294_FIXUP_ASUS_HEADSET_MIC
6756 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC
] = {
6757 .type
= HDA_FIXUP_VERBS
,
6758 .v
.verbs
= (const struct hda_verb
[]) {
6759 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x4f },
6760 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5029 },
6764 .chain_id
= ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
6766 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6767 .type
= HDA_FIXUP_PINS
,
6768 .v
.pins
= (const struct hda_pintbl
[]) {
6769 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6773 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6775 [ALC299_FIXUP_PREDATOR_SPK
] = {
6776 .type
= HDA_FIXUP_PINS
,
6777 .v
.pins
= (const struct hda_pintbl
[]) {
6778 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
6782 [ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC
] = {
6783 .type
= HDA_FIXUP_PINS
,
6784 .v
.pins
= (const struct hda_pintbl
[]) {
6785 { 0x14, 0x411111f0 }, /* disable confusing internal speaker */
6786 { 0x19, 0x04a11150 }, /* use as headset mic, without its own jack detect */
6790 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6792 [ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
] = {
6793 .type
= HDA_FIXUP_PINS
,
6794 .v
.pins
= (const struct hda_pintbl
[]) {
6795 { 0x19, 0x04a11040 },
6796 { 0x21, 0x04211020 },
6800 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6804 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
6805 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
6806 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
6807 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
6808 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
6809 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6810 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6811 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6812 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6813 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6814 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6815 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
6816 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
),
6817 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
6818 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
6819 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
6820 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK
),
6821 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6822 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6823 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6824 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6825 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
6826 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
6827 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
6828 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
6829 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
6830 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
6831 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
6832 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6833 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6834 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6835 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6836 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6837 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
6838 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
6839 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
6840 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6841 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6842 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
6843 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6844 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6845 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6846 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6847 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6848 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6849 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6850 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6851 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6852 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6853 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6854 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6855 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
6856 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP
),
6857 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6858 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME
),
6859 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
6860 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
6861 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6862 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
),
6863 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6864 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6865 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6866 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6867 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6868 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB
),
6869 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
),
6870 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
),
6871 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6872 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6873 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6874 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
6875 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
6876 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
6877 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
6879 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6880 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6881 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6882 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6883 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6884 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6885 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6886 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6887 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6888 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6889 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6890 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6891 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
6892 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6893 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6894 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6895 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6896 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6897 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6898 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6899 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
6900 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6901 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6903 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6904 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6905 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6906 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6907 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6908 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6909 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6910 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6911 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6912 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
6913 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6914 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6915 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6916 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6917 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6918 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6919 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6920 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6921 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6922 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6923 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6924 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6925 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6926 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6927 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6928 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6929 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6930 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6931 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6932 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
6933 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6934 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6935 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
6936 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
6937 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6938 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6939 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6940 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
6941 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6942 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK
),
6943 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6944 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6945 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6946 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6947 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6948 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6949 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
6950 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
6951 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
6952 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
6953 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
6954 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
6955 SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC
),
6956 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
6957 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
6958 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
6959 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6960 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6961 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
6962 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
6963 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
6964 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
6965 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6966 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6967 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
6968 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6969 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6970 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
6971 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6972 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6973 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
6974 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
6975 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
6976 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6977 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6978 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
6979 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
6980 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE
),
6981 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE
),
6982 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
6983 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
6984 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
6985 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
6986 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC
),
6987 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6988 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6989 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6990 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
6991 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
6992 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
6993 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
6994 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
6995 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
6996 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
6997 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
6998 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
6999 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
7000 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
7001 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
7002 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
7003 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
7004 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
7005 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
7006 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
7007 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
7008 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
7009 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
7010 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7011 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
7012 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
7013 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
7014 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7015 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7016 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
7017 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
7018 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK
),
7019 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7020 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7021 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460
),
7022 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7023 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7024 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7025 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7026 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
7027 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
7028 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7029 SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7030 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7031 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7032 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
7033 SND_PCI_QUIRK(0x17aa, 0x3151, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7034 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7035 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC
),
7036 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
7037 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
7038 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
7039 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7040 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
7041 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
7042 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7043 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
7044 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
7045 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
7046 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
7047 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
7048 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
7049 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
7050 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
7051 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7052 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7053 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7054 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
7055 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7056 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
7057 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
7058 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
7059 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS
),
7060 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
7061 SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
),
7064 /* Below is a quirk table taken from the old code.
7065 * Basically the device should work as is without the fixup table.
7066 * If BIOS doesn't give a proper info, enable the corresponding
7069 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7071 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
7072 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
7073 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
7074 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
7075 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
7076 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
7077 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
7078 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
7079 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
7080 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
7081 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
7082 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
7083 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
7084 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
7085 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
7086 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
7087 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
7088 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
7089 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
7090 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
7091 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
7092 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
7093 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
7094 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
7095 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
7096 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
7097 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
7098 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
7099 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
7100 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
7101 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
7102 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
7103 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
7104 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
7105 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
7106 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
7107 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
7108 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
7109 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
7114 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
7115 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
7116 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
7117 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
7118 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
7122 static const struct hda_model_fixup alc269_fixup_models
[] = {
7123 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
7124 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
7125 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
7126 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
7127 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
7128 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
7129 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
7130 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
7131 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
7132 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
7133 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
7134 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
7135 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
7136 {.id
= ALC299_FIXUP_PREDATOR_SPK
, .name
= "predator-spk"},
7137 {.id
= ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE
, .name
= "alc256-medion-headset"},
7138 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
7139 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
7140 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
7141 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
7142 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
7143 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
7144 {.id
= ALC700_FIXUP_INTEL_REFERENCE
, .name
= "alc700-ref"},
7147 #define ALC225_STANDARD_PINS \
7150 #define ALC256_STANDARD_PINS \
7151 {0x12, 0x90a60140}, \
7152 {0x14, 0x90170110}, \
7155 #define ALC282_STANDARD_PINS \
7158 #define ALC290_STANDARD_PINS \
7161 #define ALC292_STANDARD_PINS \
7162 {0x14, 0x90170110}, \
7165 #define ALC295_STANDARD_PINS \
7166 {0x12, 0xb7a60130}, \
7167 {0x14, 0x90170110}, \
7170 #define ALC298_STANDARD_PINS \
7171 {0x12, 0x90a60130}, \
7174 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
7175 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC
,
7180 {0x21, 0x0221102f}),
7181 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
7184 {0x21, 0x02211030}),
7185 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
7188 {0x21, 0x03211020}),
7189 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
7192 {0x21, 0x03211020}),
7193 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7194 ALC225_STANDARD_PINS
,
7196 {0x14, 0x901701a0}),
7197 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7198 ALC225_STANDARD_PINS
,
7200 {0x14, 0x901701b0}),
7201 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7202 ALC225_STANDARD_PINS
,
7204 {0x14, 0x901701a0}),
7205 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7206 ALC225_STANDARD_PINS
,
7208 {0x14, 0x901701b0}),
7209 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7210 ALC225_STANDARD_PINS
,
7212 {0x1b, 0x90170110}),
7213 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7216 {0x21, 0x02211020}),
7217 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
7221 {0x21, 0x02211020}),
7222 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7227 {0x21, 0x0221101f}),
7228 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7233 {0x21, 0x0221101f}),
7234 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7238 {0x21, 0x0221101f}),
7239 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7242 {0x21, 0x02211020}),
7243 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
7247 {0x21, 0x02211020}),
7248 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7251 {0x21, 0x02211020}),
7252 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7253 {0x21, 0x02211020}),
7254 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7257 {0x21, 0x02211020}),
7258 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
7260 {0x21, 0x02211020}),
7261 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7263 {0x21, 0x02211040}),
7264 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7267 {0x21, 0x02211020}),
7268 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7271 {0x21, 0x02211030}),
7272 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7275 {0x21, 0x0221101f}),
7276 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7279 {0x21, 0x0221101f}),
7280 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7283 {0x21, 0x0221103f}),
7284 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7287 {0x21, 0x0221103f}),
7288 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7291 {0x21, 0x0221103f}),
7292 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7295 {0x21, 0x0221105f}),
7296 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7299 {0x21, 0x0221101f}),
7300 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7304 {0x21, 0x0321102f}),
7305 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7308 {0x21, 0x02211040}),
7309 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7312 {0x21, 0x02211050}),
7313 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7316 {0x21, 0x02211030}),
7317 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7320 {0x21, 0x02211040}),
7321 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7324 {0x21, 0x02211040}),
7325 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7328 {0x21, 0x02211050}),
7329 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7332 {0x21, 0x02211040}),
7333 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7336 {0x21, 0x02211030}),
7337 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7339 {0x21, 0x02211010}),
7340 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7344 {0x21, 0x0221101f}),
7345 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7348 {0x21, 0x02211030}),
7349 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7352 {0x21, 0x02211030}),
7353 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7356 {0x21, 0x02211030}),
7357 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7360 {0x21, 0x02211020}),
7361 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7365 {0x21, 0x0221101f}),
7366 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7367 ALC256_STANDARD_PINS
),
7368 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7371 {0x21, 0x0221101f}),
7372 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7375 {0x21, 0x04211020}),
7376 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7379 {0x21, 0x03211020}),
7380 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7383 {0x21, 0x03211020}),
7384 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7387 {0x21, 0x04211020}),
7388 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7391 {0x21, 0x03211020}),
7392 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
7396 {0x21, 0x04211020}),
7397 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
7401 {0x1a, 0x04a11020}),
7402 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
7408 {0x1b, 0x02011020}),
7409 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7410 ALC282_STANDARD_PINS
,
7413 {0x21, 0x0321101f}),
7414 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7415 ALC282_STANDARD_PINS
,
7418 {0x21, 0x03211040}),
7419 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7420 ALC282_STANDARD_PINS
,
7423 {0x21, 0x03211020}),
7424 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7425 ALC282_STANDARD_PINS
,
7428 {0x21, 0x0421101f}),
7429 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
7430 ALC282_STANDARD_PINS
,
7433 {0x21, 0x04211020}),
7434 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7435 ALC282_STANDARD_PINS
,
7437 {0x21, 0x0321101f}),
7438 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7441 {0x21, 0x02211030}),
7442 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7443 ALC282_STANDARD_PINS
,
7446 {0x21, 0x0321101f}),
7447 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
7451 {0x21, 0x04211020}),
7452 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6
,
7455 {0x21, 0x0321101f}),
7456 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7457 ALC290_STANDARD_PINS
,
7460 {0x1a, 0x04a11020}),
7461 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7462 ALC290_STANDARD_PINS
,
7465 {0x1a, 0x04a11020}),
7466 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7467 ALC290_STANDARD_PINS
,
7469 {0x1a, 0x04a11020}),
7470 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7471 ALC290_STANDARD_PINS
,
7473 {0x1a, 0x04a11040}),
7474 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7475 ALC290_STANDARD_PINS
,
7478 {0x1a, 0x04a11040}),
7479 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7480 ALC290_STANDARD_PINS
,
7483 {0x1a, 0x04a11020}),
7484 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7485 ALC290_STANDARD_PINS
,
7488 {0x1a, 0x04a11020}),
7489 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7490 ALC292_STANDARD_PINS
,
7493 {0x19, 0x01a19030}),
7494 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7495 ALC292_STANDARD_PINS
,
7499 {0x19, 0x01a1903e}),
7500 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
7501 ALC292_STANDARD_PINS
,
7502 {0x12, 0x90a60140}),
7503 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7504 ALC292_STANDARD_PINS
,
7507 {0x19, 0x21a19030}),
7508 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7509 ALC292_STANDARD_PINS
,
7510 {0x13, 0x90a60140}),
7511 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC
,
7514 {0x21, 0x04211020}),
7515 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7518 {0x21, 0x03211020}),
7519 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7522 {0x21, 0x04211020}),
7523 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7526 {0x21, 0x03211020}),
7527 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7529 {0x21, 0x04211020}),
7530 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7532 {0x21, 0x04211030}),
7533 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7534 ALC295_STANDARD_PINS
,
7536 {0x18, 0x21a19030}),
7537 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7538 ALC295_STANDARD_PINS
,
7540 {0x18, 0x21a19050}),
7541 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7542 ALC295_STANDARD_PINS
),
7543 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7544 ALC298_STANDARD_PINS
,
7545 {0x17, 0x90170110}),
7546 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7547 ALC298_STANDARD_PINS
,
7548 {0x17, 0x90170140}),
7549 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7550 ALC298_STANDARD_PINS
,
7551 {0x17, 0x90170150}),
7552 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
7557 {0x21, 0x03211030}),
7558 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7559 ALC225_STANDARD_PINS
,
7561 {0x17, 0x90170110}),
7562 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
7565 {0x21, 0x02211020}),
7569 /* This is the fallback pin_fixup_tbl for alc269 family, to make the tbl match
7570 * more machines, don't need to match all valid pins, just need to match
7571 * all the pins defined in the tbl. Just because of this reason, it is possible
7572 * that a single machine matches multiple tbls, so there is one limitation:
7573 * at most one tbl is allowed to define for the same vendor and same codec
7575 static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl
[] = {
7576 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7578 {0x1b, 0x40000000}),
7582 static void alc269_fill_coef(struct hda_codec
*codec
)
7584 struct alc_spec
*spec
= codec
->spec
;
7587 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
7590 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
7591 alc_write_coef_idx(codec
, 0xf, 0x960b);
7592 alc_write_coef_idx(codec
, 0xe, 0x8817);
7595 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
7596 alc_write_coef_idx(codec
, 0xf, 0x960b);
7597 alc_write_coef_idx(codec
, 0xe, 0x8814);
7600 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
7601 /* Power up output pin */
7602 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
7605 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
7606 val
= alc_read_coef_idx(codec
, 0xd);
7607 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
7608 /* Capless ramp up clock control */
7609 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
7611 val
= alc_read_coef_idx(codec
, 0x17);
7612 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
7613 /* Class D power on reset */
7614 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
7619 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
7624 static int patch_alc269(struct hda_codec
*codec
)
7626 struct alc_spec
*spec
;
7629 err
= alc_alloc_spec(codec
, 0x0b);
7634 spec
->gen
.shared_mic_vref_pin
= 0x18;
7635 codec
->power_save_node
= 0;
7638 codec
->patch_ops
.suspend
= alc269_suspend
;
7639 codec
->patch_ops
.resume
= alc269_resume
;
7641 spec
->shutup
= alc_default_shutup
;
7642 spec
->init_hook
= alc_default_init
;
7644 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
7645 alc269_fixup_tbl
, alc269_fixups
);
7646 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
, true);
7647 snd_hda_pick_pin_fixup(codec
, alc269_fallback_pin_fixup_tbl
, alc269_fixups
, false);
7648 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
7650 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7652 alc_auto_parse_customize_define(codec
);
7654 if (has_cdefine_beep(codec
))
7655 spec
->gen
.beep_nid
= 0x01;
7657 switch (codec
->core
.vendor_id
) {
7659 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
7660 switch (alc_get_coef0(codec
) & 0x00f0) {
7662 if (codec
->bus
->pci
&&
7663 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7664 spec
->cdefine
.platform_type
== 1)
7665 err
= alc_codec_rename(codec
, "ALC271X");
7666 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
7669 if (codec
->bus
->pci
&&
7670 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
7671 codec
->bus
->pci
->subsystem_device
== 0x21f3)
7672 err
= alc_codec_rename(codec
, "ALC3202");
7673 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
7676 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
7679 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7683 spec
->shutup
= alc269_shutup
;
7684 spec
->init_hook
= alc269_fill_coef
;
7685 alc269_fill_coef(codec
);
7690 spec
->codec_variant
= ALC269_TYPE_ALC280
;
7693 spec
->codec_variant
= ALC269_TYPE_ALC282
;
7694 spec
->shutup
= alc282_shutup
;
7695 spec
->init_hook
= alc282_init
;
7699 spec
->codec_variant
= ALC269_TYPE_ALC283
;
7700 spec
->shutup
= alc283_shutup
;
7701 spec
->init_hook
= alc283_init
;
7705 spec
->codec_variant
= ALC269_TYPE_ALC284
;
7708 spec
->codec_variant
= ALC269_TYPE_ALC293
;
7712 spec
->codec_variant
= ALC269_TYPE_ALC286
;
7715 spec
->codec_variant
= ALC269_TYPE_ALC298
;
7719 spec
->codec_variant
= ALC269_TYPE_ALC255
;
7720 spec
->shutup
= alc256_shutup
;
7721 spec
->init_hook
= alc256_init
;
7725 spec
->codec_variant
= ALC269_TYPE_ALC256
;
7726 spec
->shutup
= alc256_shutup
;
7727 spec
->init_hook
= alc256_init
;
7728 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
7731 spec
->codec_variant
= ALC269_TYPE_ALC257
;
7732 spec
->shutup
= alc256_shutup
;
7733 spec
->init_hook
= alc256_init
;
7734 spec
->gen
.mixer_nid
= 0;
7739 spec
->codec_variant
= ALC269_TYPE_ALC215
;
7740 spec
->gen
.mixer_nid
= 0;
7744 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7745 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225 ALC295 */
7748 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7749 spec
->shutup
= alc225_shutup
;
7750 spec
->init_hook
= alc225_init
;
7751 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225, ALC295 and ALC299 */
7756 spec
->codec_variant
= ALC269_TYPE_ALC294
;
7757 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
7758 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7759 spec
->init_hook
= alc294_init
;
7762 spec
->codec_variant
= ALC269_TYPE_ALC300
;
7763 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC300 */
7766 spec
->codec_variant
= ALC269_TYPE_ALC623
;
7772 spec
->codec_variant
= ALC269_TYPE_ALC700
;
7773 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
7774 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7775 spec
->init_hook
= alc294_init
;
7780 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
7781 spec
->has_alc5505_dsp
= 1;
7782 spec
->init_hook
= alc5505_dsp_init
;
7785 /* automatic parse from the BIOS config */
7786 err
= alc269_parse_auto_config(codec
);
7790 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
)
7791 set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
7793 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7806 static int alc861_parse_auto_config(struct hda_codec
*codec
)
7808 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
7809 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
7810 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
7813 /* Pin config fixes */
7815 ALC861_FIXUP_FSC_AMILO_PI1505
,
7816 ALC861_FIXUP_AMP_VREF_0F
,
7817 ALC861_FIXUP_NO_JACK_DETECT
,
7818 ALC861_FIXUP_ASUS_A6RP
,
7819 ALC660_FIXUP_ASUS_W7J
,
7822 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7823 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
7824 const struct hda_fixup
*fix
, int action
)
7826 struct alc_spec
*spec
= codec
->spec
;
7829 if (action
!= HDA_FIXUP_ACT_INIT
)
7831 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
7832 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
7833 val
|= AC_PINCTL_IN_EN
;
7834 val
|= AC_PINCTL_VREF_50
;
7835 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
7836 spec
->gen
.keep_vref_in_automute
= 1;
7839 /* suppress the jack-detection */
7840 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
7841 const struct hda_fixup
*fix
, int action
)
7843 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
7844 codec
->no_jack_detect
= 1;
7847 static const struct hda_fixup alc861_fixups
[] = {
7848 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
7849 .type
= HDA_FIXUP_PINS
,
7850 .v
.pins
= (const struct hda_pintbl
[]) {
7851 { 0x0b, 0x0221101f }, /* HP */
7852 { 0x0f, 0x90170310 }, /* speaker */
7856 [ALC861_FIXUP_AMP_VREF_0F
] = {
7857 .type
= HDA_FIXUP_FUNC
,
7858 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7860 [ALC861_FIXUP_NO_JACK_DETECT
] = {
7861 .type
= HDA_FIXUP_FUNC
,
7862 .v
.func
= alc_fixup_no_jack_detect
,
7864 [ALC861_FIXUP_ASUS_A6RP
] = {
7865 .type
= HDA_FIXUP_FUNC
,
7866 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7868 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
7870 [ALC660_FIXUP_ASUS_W7J
] = {
7871 .type
= HDA_FIXUP_VERBS
,
7872 .v
.verbs
= (const struct hda_verb
[]) {
7873 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7874 * for enabling outputs
7876 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
7882 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
7883 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
7884 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
7885 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
7886 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
7887 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
7888 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
7889 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
7890 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
7896 static int patch_alc861(struct hda_codec
*codec
)
7898 struct alc_spec
*spec
;
7901 err
= alc_alloc_spec(codec
, 0x15);
7906 spec
->gen
.beep_nid
= 0x23;
7909 spec
->power_hook
= alc_power_eapd
;
7912 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
7913 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7915 /* automatic parse from the BIOS config */
7916 err
= alc861_parse_auto_config(codec
);
7920 if (!spec
->gen
.no_analog
)
7921 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
7923 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7937 * In addition, an independent DAC
7939 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
7941 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
7942 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7943 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
7947 ALC660VD_FIX_ASUS_GPIO1
,
7948 ALC861VD_FIX_DALLAS
,
7951 /* exclude VREF80 */
7952 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
7953 const struct hda_fixup
*fix
, int action
)
7955 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7956 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
7957 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
7961 static const struct hda_fixup alc861vd_fixups
[] = {
7962 [ALC660VD_FIX_ASUS_GPIO1
] = {
7963 .type
= HDA_FIXUP_VERBS
,
7964 .v
.verbs
= (const struct hda_verb
[]) {
7966 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
7967 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
7968 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
7972 [ALC861VD_FIX_DALLAS
] = {
7973 .type
= HDA_FIXUP_FUNC
,
7974 .v
.func
= alc861vd_fixup_dallas
,
7978 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
7979 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
7980 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
7981 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
7987 static int patch_alc861vd(struct hda_codec
*codec
)
7989 struct alc_spec
*spec
;
7992 err
= alc_alloc_spec(codec
, 0x0b);
7997 spec
->gen
.beep_nid
= 0x23;
7999 spec
->shutup
= alc_eapd_shutup
;
8001 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
8002 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8004 /* automatic parse from the BIOS config */
8005 err
= alc861vd_parse_auto_config(codec
);
8009 if (!spec
->gen
.no_analog
)
8010 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8012 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8024 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8025 * configuration. Each pin widget can choose any input DACs and a mixer.
8026 * Each ADC is connected from a mixer of all inputs. This makes possible
8027 * 6-channel independent captures.
8029 * In addition, an independent DAC for the multi-playback (not used in this
8034 * BIOS auto configuration
8037 static int alc662_parse_auto_config(struct hda_codec
*codec
)
8039 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
8040 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
8041 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
8042 const hda_nid_t
*ssids
;
8044 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
8045 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
8046 codec
->core
.vendor_id
== 0x10ec0671)
8047 ssids
= alc663_ssids
;
8049 ssids
= alc662_ssids
;
8050 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
8053 static void alc272_fixup_mario(struct hda_codec
*codec
,
8054 const struct hda_fixup
*fix
, int action
)
8056 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
8058 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
8059 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
8060 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
8061 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
8062 (0 << AC_AMPCAP_MUTE_SHIFT
)))
8063 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
8066 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
8068 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
8070 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
8071 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
8075 /* override the 2.1 chmap */
8076 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
8077 const struct hda_fixup
*fix
, int action
)
8079 if (action
== HDA_FIXUP_ACT_BUILD
) {
8080 struct alc_spec
*spec
= codec
->spec
;
8081 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
8085 /* avoid D3 for keeping GPIO up */
8086 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
8088 unsigned int power_state
)
8090 struct alc_spec
*spec
= codec
->spec
;
8091 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
8096 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
8097 const struct hda_fixup
*fix
, int action
)
8099 struct alc_spec
*spec
= codec
->spec
;
8100 static const struct hda_verb gpio_init
[] = {
8101 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
8102 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
8106 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
8107 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
8109 spec
->mute_led_polarity
= 1;
8110 spec
->gpio_mute_led_mask
= 0x01;
8111 snd_hda_add_verbs(codec
, gpio_init
);
8112 codec
->power_filter
= gpio_led_power_filter
;
8116 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
8117 struct hda_jack_callback
*jack
)
8119 struct alc_spec
*spec
= codec
->spec
;
8122 snd_hda_gen_hp_automute(codec
, jack
);
8124 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
8126 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
8130 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
8131 const struct hda_fixup
*fix
, int action
)
8133 struct alc_spec
*spec
= codec
->spec
;
8134 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
8135 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
8136 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
8140 static struct coef_fw alc668_coefs
[] = {
8141 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
8142 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
8143 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
8144 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
8145 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
8146 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
8147 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
8148 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
8149 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
8150 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
8151 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
8152 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8153 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8154 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8155 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8156 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8157 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8158 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8159 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8160 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8164 static void alc668_restore_default_value(struct hda_codec
*codec
)
8166 alc_process_coef_fw(codec
, alc668_coefs
);
8170 ALC662_FIXUP_ASPIRE
,
8171 ALC662_FIXUP_LED_GPIO1
,
8172 ALC662_FIXUP_IDEAPAD
,
8174 ALC662_FIXUP_CZC_P10T
,
8175 ALC662_FIXUP_SKU_IGNORE
,
8176 ALC662_FIXUP_HP_RP5800
,
8177 ALC662_FIXUP_ASUS_MODE1
,
8178 ALC662_FIXUP_ASUS_MODE2
,
8179 ALC662_FIXUP_ASUS_MODE3
,
8180 ALC662_FIXUP_ASUS_MODE4
,
8181 ALC662_FIXUP_ASUS_MODE5
,
8182 ALC662_FIXUP_ASUS_MODE6
,
8183 ALC662_FIXUP_ASUS_MODE7
,
8184 ALC662_FIXUP_ASUS_MODE8
,
8185 ALC662_FIXUP_NO_JACK_DETECT
,
8186 ALC662_FIXUP_ZOTAC_Z68
,
8187 ALC662_FIXUP_INV_DMIC
,
8188 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8189 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
8190 ALC662_FIXUP_HEADSET_MODE
,
8191 ALC668_FIXUP_HEADSET_MODE
,
8192 ALC662_FIXUP_BASS_MODE4_CHMAP
,
8193 ALC662_FIXUP_BASS_16
,
8194 ALC662_FIXUP_BASS_1A
,
8195 ALC662_FIXUP_BASS_CHMAP
,
8196 ALC668_FIXUP_AUTO_MUTE
,
8197 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
8198 ALC668_FIXUP_DELL_XPS13
,
8199 ALC662_FIXUP_ASUS_Nx50
,
8200 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8201 ALC668_FIXUP_ASUS_Nx51
,
8202 ALC668_FIXUP_MIC_COEF
,
8203 ALC668_FIXUP_ASUS_G751
,
8204 ALC891_FIXUP_HEADSET_MODE
,
8205 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8206 ALC662_FIXUP_ACER_VERITON
,
8207 ALC892_FIXUP_ASROCK_MOBO
,
8208 ALC662_FIXUP_USI_FUNC
,
8209 ALC662_FIXUP_USI_HEADSET_MODE
,
8210 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
8213 static const struct hda_fixup alc662_fixups
[] = {
8214 [ALC662_FIXUP_ASPIRE
] = {
8215 .type
= HDA_FIXUP_PINS
,
8216 .v
.pins
= (const struct hda_pintbl
[]) {
8217 { 0x15, 0x99130112 }, /* subwoofer */
8221 [ALC662_FIXUP_LED_GPIO1
] = {
8222 .type
= HDA_FIXUP_FUNC
,
8223 .v
.func
= alc662_fixup_led_gpio1
,
8225 [ALC662_FIXUP_IDEAPAD
] = {
8226 .type
= HDA_FIXUP_PINS
,
8227 .v
.pins
= (const struct hda_pintbl
[]) {
8228 { 0x17, 0x99130112 }, /* subwoofer */
8232 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
8234 [ALC272_FIXUP_MARIO
] = {
8235 .type
= HDA_FIXUP_FUNC
,
8236 .v
.func
= alc272_fixup_mario
,
8238 [ALC662_FIXUP_CZC_P10T
] = {
8239 .type
= HDA_FIXUP_VERBS
,
8240 .v
.verbs
= (const struct hda_verb
[]) {
8241 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
8245 [ALC662_FIXUP_SKU_IGNORE
] = {
8246 .type
= HDA_FIXUP_FUNC
,
8247 .v
.func
= alc_fixup_sku_ignore
,
8249 [ALC662_FIXUP_HP_RP5800
] = {
8250 .type
= HDA_FIXUP_PINS
,
8251 .v
.pins
= (const struct hda_pintbl
[]) {
8252 { 0x14, 0x0221201f }, /* HP out */
8256 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8258 [ALC662_FIXUP_ASUS_MODE1
] = {
8259 .type
= HDA_FIXUP_PINS
,
8260 .v
.pins
= (const struct hda_pintbl
[]) {
8261 { 0x14, 0x99130110 }, /* speaker */
8262 { 0x18, 0x01a19c20 }, /* mic */
8263 { 0x19, 0x99a3092f }, /* int-mic */
8264 { 0x21, 0x0121401f }, /* HP out */
8268 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8270 [ALC662_FIXUP_ASUS_MODE2
] = {
8271 .type
= HDA_FIXUP_PINS
,
8272 .v
.pins
= (const struct hda_pintbl
[]) {
8273 { 0x14, 0x99130110 }, /* speaker */
8274 { 0x18, 0x01a19820 }, /* mic */
8275 { 0x19, 0x99a3092f }, /* int-mic */
8276 { 0x1b, 0x0121401f }, /* HP out */
8280 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8282 [ALC662_FIXUP_ASUS_MODE3
] = {
8283 .type
= HDA_FIXUP_PINS
,
8284 .v
.pins
= (const struct hda_pintbl
[]) {
8285 { 0x14, 0x99130110 }, /* speaker */
8286 { 0x15, 0x0121441f }, /* HP */
8287 { 0x18, 0x01a19840 }, /* mic */
8288 { 0x19, 0x99a3094f }, /* int-mic */
8289 { 0x21, 0x01211420 }, /* HP2 */
8293 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8295 [ALC662_FIXUP_ASUS_MODE4
] = {
8296 .type
= HDA_FIXUP_PINS
,
8297 .v
.pins
= (const struct hda_pintbl
[]) {
8298 { 0x14, 0x99130110 }, /* speaker */
8299 { 0x16, 0x99130111 }, /* speaker */
8300 { 0x18, 0x01a19840 }, /* mic */
8301 { 0x19, 0x99a3094f }, /* int-mic */
8302 { 0x21, 0x0121441f }, /* HP */
8306 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8308 [ALC662_FIXUP_ASUS_MODE5
] = {
8309 .type
= HDA_FIXUP_PINS
,
8310 .v
.pins
= (const struct hda_pintbl
[]) {
8311 { 0x14, 0x99130110 }, /* speaker */
8312 { 0x15, 0x0121441f }, /* HP */
8313 { 0x16, 0x99130111 }, /* speaker */
8314 { 0x18, 0x01a19840 }, /* mic */
8315 { 0x19, 0x99a3094f }, /* int-mic */
8319 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8321 [ALC662_FIXUP_ASUS_MODE6
] = {
8322 .type
= HDA_FIXUP_PINS
,
8323 .v
.pins
= (const struct hda_pintbl
[]) {
8324 { 0x14, 0x99130110 }, /* speaker */
8325 { 0x15, 0x01211420 }, /* HP2 */
8326 { 0x18, 0x01a19840 }, /* mic */
8327 { 0x19, 0x99a3094f }, /* int-mic */
8328 { 0x1b, 0x0121441f }, /* HP */
8332 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8334 [ALC662_FIXUP_ASUS_MODE7
] = {
8335 .type
= HDA_FIXUP_PINS
,
8336 .v
.pins
= (const struct hda_pintbl
[]) {
8337 { 0x14, 0x99130110 }, /* speaker */
8338 { 0x17, 0x99130111 }, /* speaker */
8339 { 0x18, 0x01a19840 }, /* mic */
8340 { 0x19, 0x99a3094f }, /* int-mic */
8341 { 0x1b, 0x01214020 }, /* HP */
8342 { 0x21, 0x0121401f }, /* HP */
8346 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8348 [ALC662_FIXUP_ASUS_MODE8
] = {
8349 .type
= HDA_FIXUP_PINS
,
8350 .v
.pins
= (const struct hda_pintbl
[]) {
8351 { 0x14, 0x99130110 }, /* speaker */
8352 { 0x12, 0x99a30970 }, /* int-mic */
8353 { 0x15, 0x01214020 }, /* HP */
8354 { 0x17, 0x99130111 }, /* speaker */
8355 { 0x18, 0x01a19840 }, /* mic */
8356 { 0x21, 0x0121401f }, /* HP */
8360 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8362 [ALC662_FIXUP_NO_JACK_DETECT
] = {
8363 .type
= HDA_FIXUP_FUNC
,
8364 .v
.func
= alc_fixup_no_jack_detect
,
8366 [ALC662_FIXUP_ZOTAC_Z68
] = {
8367 .type
= HDA_FIXUP_PINS
,
8368 .v
.pins
= (const struct hda_pintbl
[]) {
8369 { 0x1b, 0x02214020 }, /* Front HP */
8373 [ALC662_FIXUP_INV_DMIC
] = {
8374 .type
= HDA_FIXUP_FUNC
,
8375 .v
.func
= alc_fixup_inv_dmic
,
8377 [ALC668_FIXUP_DELL_XPS13
] = {
8378 .type
= HDA_FIXUP_FUNC
,
8379 .v
.func
= alc_fixup_dell_xps13
,
8381 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
8383 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
8384 .type
= HDA_FIXUP_FUNC
,
8385 .v
.func
= alc_fixup_disable_aamix
,
8387 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8389 [ALC668_FIXUP_AUTO_MUTE
] = {
8390 .type
= HDA_FIXUP_FUNC
,
8391 .v
.func
= alc_fixup_auto_mute_via_amp
,
8393 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8395 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8396 .type
= HDA_FIXUP_PINS
,
8397 .v
.pins
= (const struct hda_pintbl
[]) {
8398 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8399 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8403 .chain_id
= ALC662_FIXUP_HEADSET_MODE
8405 [ALC662_FIXUP_HEADSET_MODE
] = {
8406 .type
= HDA_FIXUP_FUNC
,
8407 .v
.func
= alc_fixup_headset_mode_alc662
,
8409 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8410 .type
= HDA_FIXUP_PINS
,
8411 .v
.pins
= (const struct hda_pintbl
[]) {
8412 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8413 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8417 .chain_id
= ALC668_FIXUP_HEADSET_MODE
8419 [ALC668_FIXUP_HEADSET_MODE
] = {
8420 .type
= HDA_FIXUP_FUNC
,
8421 .v
.func
= alc_fixup_headset_mode_alc668
,
8423 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
8424 .type
= HDA_FIXUP_FUNC
,
8425 .v
.func
= alc_fixup_bass_chmap
,
8427 .chain_id
= ALC662_FIXUP_ASUS_MODE4
8429 [ALC662_FIXUP_BASS_16
] = {
8430 .type
= HDA_FIXUP_PINS
,
8431 .v
.pins
= (const struct hda_pintbl
[]) {
8432 {0x16, 0x80106111}, /* bass speaker */
8436 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8438 [ALC662_FIXUP_BASS_1A
] = {
8439 .type
= HDA_FIXUP_PINS
,
8440 .v
.pins
= (const struct hda_pintbl
[]) {
8441 {0x1a, 0x80106111}, /* bass speaker */
8445 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8447 [ALC662_FIXUP_BASS_CHMAP
] = {
8448 .type
= HDA_FIXUP_FUNC
,
8449 .v
.func
= alc_fixup_bass_chmap
,
8451 [ALC662_FIXUP_ASUS_Nx50
] = {
8452 .type
= HDA_FIXUP_FUNC
,
8453 .v
.func
= alc_fixup_auto_mute_via_amp
,
8455 .chain_id
= ALC662_FIXUP_BASS_1A
8457 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
8458 .type
= HDA_FIXUP_FUNC
,
8459 .v
.func
= alc_fixup_headset_mode_alc668
,
8460 .chain_id
= ALC662_FIXUP_BASS_CHMAP
8462 [ALC668_FIXUP_ASUS_Nx51
] = {
8463 .type
= HDA_FIXUP_PINS
,
8464 .v
.pins
= (const struct hda_pintbl
[]) {
8465 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8466 { 0x1a, 0x90170151 }, /* bass speaker */
8467 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8471 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8473 [ALC668_FIXUP_MIC_COEF
] = {
8474 .type
= HDA_FIXUP_VERBS
,
8475 .v
.verbs
= (const struct hda_verb
[]) {
8476 { 0x20, AC_VERB_SET_COEF_INDEX
, 0xc3 },
8477 { 0x20, AC_VERB_SET_PROC_COEF
, 0x4000 },
8481 [ALC668_FIXUP_ASUS_G751
] = {
8482 .type
= HDA_FIXUP_PINS
,
8483 .v
.pins
= (const struct hda_pintbl
[]) {
8484 { 0x16, 0x0421101f }, /* HP */
8488 .chain_id
= ALC668_FIXUP_MIC_COEF
8490 [ALC891_FIXUP_HEADSET_MODE
] = {
8491 .type
= HDA_FIXUP_FUNC
,
8492 .v
.func
= alc_fixup_headset_mode
,
8494 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8495 .type
= HDA_FIXUP_PINS
,
8496 .v
.pins
= (const struct hda_pintbl
[]) {
8497 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8498 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8502 .chain_id
= ALC891_FIXUP_HEADSET_MODE
8504 [ALC662_FIXUP_ACER_VERITON
] = {
8505 .type
= HDA_FIXUP_PINS
,
8506 .v
.pins
= (const struct hda_pintbl
[]) {
8507 { 0x15, 0x50170120 }, /* no internal speaker */
8511 [ALC892_FIXUP_ASROCK_MOBO
] = {
8512 .type
= HDA_FIXUP_PINS
,
8513 .v
.pins
= (const struct hda_pintbl
[]) {
8514 { 0x15, 0x40f000f0 }, /* disabled */
8515 { 0x16, 0x40f000f0 }, /* disabled */
8519 [ALC662_FIXUP_USI_FUNC
] = {
8520 .type
= HDA_FIXUP_FUNC
,
8521 .v
.func
= alc662_fixup_usi_headset_mic
,
8523 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
8524 .type
= HDA_FIXUP_PINS
,
8525 .v
.pins
= (const struct hda_pintbl
[]) {
8526 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8527 { 0x18, 0x01a1903d },
8531 .chain_id
= ALC662_FIXUP_USI_FUNC
8533 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
8534 .type
= HDA_FIXUP_FUNC
,
8535 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
8539 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
8540 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
8541 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
8542 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
8543 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
8544 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
8545 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
8546 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
8547 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
8548 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8549 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8550 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
8551 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
8552 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
8553 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8554 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8555 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8556 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8557 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8558 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
8559 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
8560 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
8561 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
8562 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
8563 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751
),
8564 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8565 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
8566 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
8567 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
8568 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
8569 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
8570 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8571 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
8572 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
8573 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
8574 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
8575 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
8576 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
8577 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
8578 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
8579 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
8580 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
8581 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
8584 /* Below is a quirk table taken from the old code.
8585 * Basically the device should work as is without the fixup table.
8586 * If BIOS doesn't give a proper info, enable the corresponding
8589 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
8590 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
8591 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
8592 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
8593 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8594 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8595 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8596 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
8597 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
8598 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8599 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
8600 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
8601 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
8602 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
8603 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
8604 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8605 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
8606 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
8607 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8608 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8609 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8610 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8611 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
8612 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
8613 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
8614 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8615 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
8616 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8617 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8618 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
8619 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8620 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8621 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
8622 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
8623 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
8624 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
8625 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
8626 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
8627 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
8628 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8629 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
8630 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
8631 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8632 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
8633 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
8634 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
8635 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
8636 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
8637 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8638 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
8643 static const struct hda_model_fixup alc662_fixup_models
[] = {
8644 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
8645 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
8646 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
8647 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
8648 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
8649 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
8650 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
8651 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
8652 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
8653 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
8654 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
8655 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
8659 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
8660 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8664 {0x21, 0x01014020}),
8665 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8669 {0x21, 0x01014020}),
8670 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8674 {0x1b, 0x0221401f}),
8675 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8679 {0x16, 0x03011020}),
8680 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8684 {0x16, 0x03011020}),
8685 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8689 {0x16, 0x03011020}),
8690 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8693 {0x16, 0x03011020}),
8694 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
8697 {0x15, 0x0321101f}),
8703 static int patch_alc662(struct hda_codec
*codec
)
8705 struct alc_spec
*spec
;
8708 err
= alc_alloc_spec(codec
, 0x0b);
8714 spec
->shutup
= alc_eapd_shutup
;
8716 /* handle multiple HPs as is */
8717 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
8719 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
8721 switch (codec
->core
.vendor_id
) {
8723 spec
->init_hook
= alc668_restore_default_value
;
8727 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
8728 alc662_fixup_tbl
, alc662_fixups
);
8729 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
, true);
8730 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8732 alc_auto_parse_customize_define(codec
);
8734 if (has_cdefine_beep(codec
))
8735 spec
->gen
.beep_nid
= 0x01;
8737 if ((alc_get_coef0(codec
) & (1 << 14)) &&
8738 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
8739 spec
->cdefine
.platform_type
== 1) {
8740 err
= alc_codec_rename(codec
, "ALC272X");
8745 /* automatic parse from the BIOS config */
8746 err
= alc662_parse_auto_config(codec
);
8750 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
8751 switch (codec
->core
.vendor_id
) {
8753 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8759 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
8762 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
8767 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8780 static int alc680_parse_auto_config(struct hda_codec
*codec
)
8782 return alc_parse_auto_config(codec
, NULL
, NULL
);
8787 static int patch_alc680(struct hda_codec
*codec
)
8791 /* ALC680 has no aa-loopback mixer */
8792 err
= alc_alloc_spec(codec
, 0);
8796 /* automatic parse from the BIOS config */
8797 err
= alc680_parse_auto_config(codec
);
8809 static const struct hda_device_id snd_hda_id_realtek
[] = {
8810 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
8811 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
8812 HDA_CODEC_ENTRY(0x10ec0222, "ALC222", patch_alc269
),
8813 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
8814 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
8815 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
8816 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
8817 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
8818 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
8819 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
8820 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
8821 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269
),
8822 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
8823 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
8824 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
8825 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
8826 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
8827 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
8828 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
8829 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
8830 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
8831 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
8832 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
8833 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
8834 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
8835 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
8836 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
8837 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
8838 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
8839 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
8840 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
8841 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
8842 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
8843 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
8844 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
8845 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
8846 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
8847 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269
),
8848 HDA_CODEC_ENTRY(0x10ec0623, "ALC623", patch_alc269
),
8849 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
8850 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
8851 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
8852 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
8853 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
8854 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
8855 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
8856 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
8857 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
8858 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
8859 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
8860 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
8861 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
8862 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
8863 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
8864 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
8865 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
8866 HDA_CODEC_ENTRY(0x10ec0711, "ALC711", patch_alc269
),
8867 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
8868 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
8869 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
8870 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
8871 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
8872 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
8873 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
8874 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
8875 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
8876 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
8877 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
8878 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
8879 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
8880 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
8881 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882
),
8882 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
8885 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
8887 MODULE_LICENSE("GPL");
8888 MODULE_DESCRIPTION("Realtek HD-audio codec");
8890 static struct hda_codec_driver realtek_driver
= {
8891 .id
= snd_hda_id_realtek
,
8894 module_hda_codec_driver(realtek_driver
);