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);
348 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
351 alc_update_coef_idx(codec
, 0xe, 0, 1<<0);
354 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
362 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
365 if ((coef
& 0x00f0) == 0x0030)
366 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
375 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
378 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
381 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
384 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
385 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
388 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
394 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
399 /* additional initialization for ALC888 variants */
400 static void alc888_coef_init(struct hda_codec
*codec
)
402 switch (alc_get_coef0(codec
) & 0x00f0) {
407 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
412 /* turn on/off EAPD control (only if available) */
413 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
415 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
417 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
418 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
422 /* turn on/off EAPD controls of the codec */
423 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
425 /* We currently only handle front, HP */
426 static hda_nid_t pins
[] = {
427 0x0f, 0x10, 0x14, 0x15, 0x17, 0
430 for (p
= pins
; *p
; p
++)
431 set_eapd(codec
, *p
, on
);
434 static int find_ext_mic_pin(struct hda_codec
*codec
);
436 static void alc_headset_mic_no_shutup(struct hda_codec
*codec
)
438 const struct hda_pincfg
*pin
;
439 int mic_pin
= find_ext_mic_pin(codec
);
442 /* don't shut up pins when unloading the driver; otherwise it breaks
443 * the default pin setup at the next load of the driver
445 if (codec
->bus
->shutdown
)
448 for (i
= 0; i
< codec
->init_pins
.used
; i
++) {
449 pin
= snd_array_elem(&codec
->init_pins
, i
);
450 /* use read here for syncing after issuing each verb */
451 if (pin
->nid
!= mic_pin
)
452 snd_hda_codec_read(codec
, pin
->nid
, 0,
453 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
456 codec
->pins_shutup
= 1;
459 static void alc_shutup_pins(struct hda_codec
*codec
)
461 struct alc_spec
*spec
= codec
->spec
;
463 switch (codec
->core
.vendor_id
) {
467 alc_headset_mic_no_shutup(codec
);
470 if (!spec
->no_shutup_pins
)
471 snd_hda_shutup_pins(codec
);
476 /* generic shutup callback;
477 * just turning off EAPD and a little pause for avoiding pop-noise
479 static void alc_eapd_shutup(struct hda_codec
*codec
)
481 struct alc_spec
*spec
= codec
->spec
;
483 alc_auto_setup_eapd(codec
, false);
484 if (!spec
->no_depop_delay
)
486 alc_shutup_pins(codec
);
489 /* generic EAPD initialization */
490 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
492 alc_fill_eapd_coef(codec
);
493 alc_auto_setup_eapd(codec
, true);
496 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
499 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
502 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
504 case ALC_INIT_DEFAULT
:
505 switch (codec
->core
.vendor_id
) {
507 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
513 alc_update_coef_idx(codec
, 7, 0, 0x2030);
516 alc888_coef_init(codec
);
523 /* get a primary headphone pin if available */
524 static hda_nid_t
alc_get_hp_pin(struct alc_spec
*spec
)
526 if (spec
->gen
.autocfg
.hp_pins
[0])
527 return spec
->gen
.autocfg
.hp_pins
[0];
528 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
529 return spec
->gen
.autocfg
.line_out_pins
[0];
534 * Realtek SSID verification
537 /* Could be any non-zero and even value. When used as fixup, tells
538 * the driver to ignore any present sku defines.
540 #define ALC_FIXUP_SKU_IGNORE (2)
542 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
543 const struct hda_fixup
*fix
, int action
)
545 struct alc_spec
*spec
= codec
->spec
;
546 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
547 spec
->cdefine
.fixup
= 1;
548 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
552 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
553 const struct hda_fixup
*fix
, int action
)
555 struct alc_spec
*spec
= codec
->spec
;
557 if (action
== HDA_FIXUP_ACT_PROBE
) {
558 spec
->no_depop_delay
= 1;
559 codec
->depop_delay
= 0;
563 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
565 unsigned int ass
, tmp
, i
;
567 struct alc_spec
*spec
= codec
->spec
;
569 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
571 if (spec
->cdefine
.fixup
) {
572 ass
= spec
->cdefine
.sku_cfg
;
573 if (ass
== ALC_FIXUP_SKU_IGNORE
)
578 if (!codec
->bus
->pci
)
580 ass
= codec
->core
.subsystem_id
& 0xffff;
581 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
585 if (codec
->core
.vendor_id
== 0x10ec0260)
587 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
590 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
591 codec
->core
.chip_name
, ass
);
597 for (i
= 1; i
< 16; i
++) {
601 if (((ass
>> 16) & 0xf) != tmp
)
604 spec
->cdefine
.port_connectivity
= ass
>> 30;
605 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
606 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
607 spec
->cdefine
.customization
= ass
>> 8;
609 spec
->cdefine
.sku_cfg
= ass
;
610 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
611 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
612 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
613 spec
->cdefine
.override
= ass
& 0x1;
615 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
616 nid
, spec
->cdefine
.sku_cfg
);
617 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
618 spec
->cdefine
.port_connectivity
);
619 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
620 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
621 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
622 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
623 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
624 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
625 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
630 /* return the position of NID in the list, or -1 if not found */
631 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
634 for (i
= 0; i
< nums
; i
++)
639 /* return true if the given NID is found in the list */
640 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
642 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
645 /* check subsystem ID and set up device-specific initialization;
646 * return 1 if initialized, 0 if invalid SSID
648 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
649 * 31 ~ 16 : Manufacture ID
651 * 7 ~ 0 : Assembly ID
652 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
654 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
656 unsigned int ass
, tmp
, i
;
658 struct alc_spec
*spec
= codec
->spec
;
660 if (spec
->cdefine
.fixup
) {
661 ass
= spec
->cdefine
.sku_cfg
;
662 if (ass
== ALC_FIXUP_SKU_IGNORE
)
667 ass
= codec
->core
.subsystem_id
& 0xffff;
668 if (codec
->bus
->pci
&&
669 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
672 /* invalid SSID, check the special NID pin defcfg instead */
674 * 31~30 : port connectivity
677 * 19~16 : Check sum (15:1)
682 if (codec
->core
.vendor_id
== 0x10ec0260)
684 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
686 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
690 if ((ass
>> 30) != 1) /* no physical connection */
695 for (i
= 1; i
< 16; i
++) {
699 if (((ass
>> 16) & 0xf) != tmp
)
702 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
703 ass
& 0xffff, codec
->core
.vendor_id
);
707 * 2 : 0 --> Desktop, 1 --> Laptop
708 * 3~5 : External Amplifier control
711 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
714 spec
->init_amp
= ALC_INIT_GPIO1
;
717 spec
->init_amp
= ALC_INIT_GPIO2
;
720 spec
->init_amp
= ALC_INIT_GPIO3
;
724 spec
->init_amp
= ALC_INIT_DEFAULT
;
728 /* is laptop or Desktop and enable the function "Mute internal speaker
729 * when the external headphone out jack is plugged"
734 * 10~8 : Jack location
735 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
737 * 15 : 1 --> enable the function "Mute internal speaker
738 * when the external headphone out jack is plugged"
740 if (!alc_get_hp_pin(spec
)) {
742 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
744 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
745 spec
->gen
.autocfg
.line_outs
))
747 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
752 /* Check the validity of ALC subsystem-id
753 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
754 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
756 if (!alc_subsystem_id(codec
, ports
)) {
757 struct alc_spec
*spec
= codec
->spec
;
759 "realtek: Enable default setup for auto mode as fallback\n");
760 spec
->init_amp
= ALC_INIT_DEFAULT
;
767 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
768 const struct hda_fixup
*fix
, int action
)
770 struct alc_spec
*spec
= codec
->spec
;
772 spec
->gen
.inv_dmic_split
= 1;
776 #ifdef CONFIG_SND_HDA_INPUT_BEEP
777 /* additional beep mixers; the actual parameters are overwritten at build */
778 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
779 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
780 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
785 static int alc_build_controls(struct hda_codec
*codec
)
787 struct alc_spec
*spec
= codec
->spec
;
790 err
= snd_hda_gen_build_controls(codec
);
794 for (i
= 0; i
< spec
->num_mixers
; i
++) {
795 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
800 #ifdef CONFIG_SND_HDA_INPUT_BEEP
801 /* create beep controls if needed */
802 if (spec
->beep_amp
) {
803 const struct snd_kcontrol_new
*knew
;
804 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
805 struct snd_kcontrol
*kctl
;
806 kctl
= snd_ctl_new1(knew
, codec
);
809 kctl
->private_value
= spec
->beep_amp
;
810 err
= snd_hda_ctl_add(codec
, 0, kctl
);
817 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
826 static int alc_init(struct hda_codec
*codec
)
828 struct alc_spec
*spec
= codec
->spec
;
831 spec
->init_hook(codec
);
834 alc_auto_init_amp(codec
, spec
->init_amp
);
836 snd_hda_gen_init(codec
);
838 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
843 static inline void alc_shutup(struct hda_codec
*codec
)
845 struct alc_spec
*spec
= codec
->spec
;
847 if (spec
&& spec
->shutup
)
850 alc_shutup_pins(codec
);
853 static void alc_reboot_notify(struct hda_codec
*codec
)
855 struct alc_spec
*spec
= codec
->spec
;
857 if (spec
&& spec
->reboot_notify
)
858 spec
->reboot_notify(codec
);
863 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
864 static void alc_d3_at_reboot(struct hda_codec
*codec
)
866 snd_hda_codec_set_power_to_all(codec
, codec
->core
.afg
, AC_PWRST_D3
);
867 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
868 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
872 #define alc_free snd_hda_gen_free
875 static void alc_power_eapd(struct hda_codec
*codec
)
877 alc_auto_setup_eapd(codec
, false);
880 static int alc_suspend(struct hda_codec
*codec
)
882 struct alc_spec
*spec
= codec
->spec
;
884 if (spec
&& spec
->power_hook
)
885 spec
->power_hook(codec
);
891 static int alc_resume(struct hda_codec
*codec
)
893 struct alc_spec
*spec
= codec
->spec
;
895 if (!spec
->no_depop_delay
)
896 msleep(150); /* to avoid pop noise */
897 codec
->patch_ops
.init(codec
);
898 regcache_sync(codec
->core
.regmap
);
899 hda_call_check_power_status(codec
, 0x01);
906 static const struct hda_codec_ops alc_patch_ops
= {
907 .build_controls
= alc_build_controls
,
908 .build_pcms
= snd_hda_gen_build_pcms
,
911 .unsol_event
= snd_hda_jack_unsol_event
,
913 .resume
= alc_resume
,
914 .suspend
= alc_suspend
,
915 .check_power_status
= snd_hda_gen_check_power_status
,
917 .reboot_notify
= alc_reboot_notify
,
921 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
924 * Rename codecs appropriately from COEF value or subvendor id
926 struct alc_codec_rename_table
{
927 unsigned int vendor_id
;
928 unsigned short coef_mask
;
929 unsigned short coef_bits
;
933 struct alc_codec_rename_pci_table
{
934 unsigned int codec_vendor_id
;
935 unsigned short pci_subvendor
;
936 unsigned short pci_subdevice
;
940 static struct alc_codec_rename_table rename_tbl
[] = {
941 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
942 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
943 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
944 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
945 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
946 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
947 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
948 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
949 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
950 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
951 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
952 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
953 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
954 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
955 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
956 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
957 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
961 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
962 { 0x10ec0280, 0x1028, 0, "ALC3220" },
963 { 0x10ec0282, 0x1028, 0, "ALC3221" },
964 { 0x10ec0283, 0x1028, 0, "ALC3223" },
965 { 0x10ec0288, 0x1028, 0, "ALC3263" },
966 { 0x10ec0292, 0x1028, 0, "ALC3226" },
967 { 0x10ec0293, 0x1028, 0, "ALC3235" },
968 { 0x10ec0255, 0x1028, 0, "ALC3234" },
969 { 0x10ec0668, 0x1028, 0, "ALC3661" },
970 { 0x10ec0275, 0x1028, 0, "ALC3260" },
971 { 0x10ec0899, 0x1028, 0, "ALC3861" },
972 { 0x10ec0298, 0x1028, 0, "ALC3266" },
973 { 0x10ec0236, 0x1028, 0, "ALC3204" },
974 { 0x10ec0256, 0x1028, 0, "ALC3246" },
975 { 0x10ec0225, 0x1028, 0, "ALC3253" },
976 { 0x10ec0295, 0x1028, 0, "ALC3254" },
977 { 0x10ec0299, 0x1028, 0, "ALC3271" },
978 { 0x10ec0670, 0x1025, 0, "ALC669X" },
979 { 0x10ec0676, 0x1025, 0, "ALC679X" },
980 { 0x10ec0282, 0x1043, 0, "ALC3229" },
981 { 0x10ec0233, 0x1043, 0, "ALC3236" },
982 { 0x10ec0280, 0x103c, 0, "ALC3228" },
983 { 0x10ec0282, 0x103c, 0, "ALC3227" },
984 { 0x10ec0286, 0x103c, 0, "ALC3242" },
985 { 0x10ec0290, 0x103c, 0, "ALC3241" },
986 { 0x10ec0668, 0x103c, 0, "ALC3662" },
987 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
988 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
992 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
994 const struct alc_codec_rename_table
*p
;
995 const struct alc_codec_rename_pci_table
*q
;
997 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
998 if (p
->vendor_id
!= codec
->core
.vendor_id
)
1000 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
1001 return alc_codec_rename(codec
, p
->name
);
1004 if (!codec
->bus
->pci
)
1006 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
1007 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
1009 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
1011 if (!q
->pci_subdevice
||
1012 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
1013 return alc_codec_rename(codec
, q
->name
);
1021 * Digital-beep handlers
1023 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1024 #define set_beep_amp(spec, nid, idx, dir) \
1025 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1027 static const struct snd_pci_quirk beep_white_list
[] = {
1028 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1029 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1030 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1031 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1032 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1033 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1034 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1035 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1036 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
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_SYSTEM76_ORYP5
,
1866 ALC1220_FIXUP_SYSTEM76_ORYP5_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_system76_oryp5(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_SYSTEM76_ORYP5
] = {
2357 .type
= HDA_FIXUP_FUNC
,
2358 .v
.func
= alc1220_fixup_system76_oryp5
,
2360 [ALC1220_FIXUP_SYSTEM76_ORYP5_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_SYSTEM76_ORYP5
,
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, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
),
2446 SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
),
2447 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2448 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2449 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2450 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2454 static const struct hda_model_fixup alc882_fixup_models
[] = {
2455 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2456 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2457 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2458 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2459 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2460 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2465 * BIOS auto configuration
2467 /* almost identical with ALC880 parser... */
2468 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2470 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2471 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2472 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2477 static int patch_alc882(struct hda_codec
*codec
)
2479 struct alc_spec
*spec
;
2482 err
= alc_alloc_spec(codec
, 0x0b);
2488 switch (codec
->core
.vendor_id
) {
2495 /* ALC883 and variants */
2496 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2500 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2502 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2504 alc_auto_parse_customize_define(codec
);
2506 if (has_cdefine_beep(codec
))
2507 spec
->gen
.beep_nid
= 0x01;
2509 /* automatic parse from the BIOS config */
2510 err
= alc882_parse_auto_config(codec
);
2514 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2515 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2517 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2530 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2532 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2533 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2534 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2541 ALC262_FIXUP_FSC_H270
,
2542 ALC262_FIXUP_FSC_S7110
,
2543 ALC262_FIXUP_HP_Z200
,
2545 ALC262_FIXUP_LENOVO_3000
,
2547 ALC262_FIXUP_BENQ_T31
,
2548 ALC262_FIXUP_INV_DMIC
,
2549 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2552 static const struct hda_fixup alc262_fixups
[] = {
2553 [ALC262_FIXUP_FSC_H270
] = {
2554 .type
= HDA_FIXUP_PINS
,
2555 .v
.pins
= (const struct hda_pintbl
[]) {
2556 { 0x14, 0x99130110 }, /* speaker */
2557 { 0x15, 0x0221142f }, /* front HP */
2558 { 0x1b, 0x0121141f }, /* rear HP */
2562 [ALC262_FIXUP_FSC_S7110
] = {
2563 .type
= HDA_FIXUP_PINS
,
2564 .v
.pins
= (const struct hda_pintbl
[]) {
2565 { 0x15, 0x90170110 }, /* speaker */
2569 .chain_id
= ALC262_FIXUP_BENQ
,
2571 [ALC262_FIXUP_HP_Z200
] = {
2572 .type
= HDA_FIXUP_PINS
,
2573 .v
.pins
= (const struct hda_pintbl
[]) {
2574 { 0x16, 0x99130120 }, /* internal speaker */
2578 [ALC262_FIXUP_TYAN
] = {
2579 .type
= HDA_FIXUP_PINS
,
2580 .v
.pins
= (const struct hda_pintbl
[]) {
2581 { 0x14, 0x1993e1f0 }, /* int AUX */
2585 [ALC262_FIXUP_LENOVO_3000
] = {
2586 .type
= HDA_FIXUP_PINCTLS
,
2587 .v
.pins
= (const struct hda_pintbl
[]) {
2588 { 0x19, PIN_VREF50
},
2592 .chain_id
= ALC262_FIXUP_BENQ
,
2594 [ALC262_FIXUP_BENQ
] = {
2595 .type
= HDA_FIXUP_VERBS
,
2596 .v
.verbs
= (const struct hda_verb
[]) {
2597 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2598 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2602 [ALC262_FIXUP_BENQ_T31
] = {
2603 .type
= HDA_FIXUP_VERBS
,
2604 .v
.verbs
= (const struct hda_verb
[]) {
2605 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2606 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2610 [ALC262_FIXUP_INV_DMIC
] = {
2611 .type
= HDA_FIXUP_FUNC
,
2612 .v
.func
= alc_fixup_inv_dmic
,
2614 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2615 .type
= HDA_FIXUP_FUNC
,
2616 .v
.func
= alc_fixup_no_depop_delay
,
2620 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2621 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2622 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2623 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2624 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2625 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2626 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2627 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2628 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2629 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2630 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2634 static const struct hda_model_fixup alc262_fixup_models
[] = {
2635 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2641 static int patch_alc262(struct hda_codec
*codec
)
2643 struct alc_spec
*spec
;
2646 err
= alc_alloc_spec(codec
, 0x0b);
2651 spec
->gen
.shared_mic_vref_pin
= 0x18;
2653 spec
->shutup
= alc_eapd_shutup
;
2656 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2659 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2661 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2663 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2665 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2667 alc_auto_parse_customize_define(codec
);
2669 if (has_cdefine_beep(codec
))
2670 spec
->gen
.beep_nid
= 0x01;
2672 /* automatic parse from the BIOS config */
2673 err
= alc262_parse_auto_config(codec
);
2677 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2678 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2680 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2692 /* bind Beep switches of both NID 0x0f and 0x10 */
2693 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2694 struct snd_ctl_elem_value
*ucontrol
)
2696 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2700 mutex_lock(&codec
->control_mutex
);
2701 pval
= kcontrol
->private_value
;
2702 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2703 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2705 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2706 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2708 kcontrol
->private_value
= pval
;
2709 mutex_unlock(&codec
->control_mutex
);
2713 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2714 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2716 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2717 .name
= "Beep Playback Switch",
2718 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2719 .info
= snd_hda_mixer_amp_switch_info
,
2720 .get
= snd_hda_mixer_amp_switch_get
,
2721 .put
= alc268_beep_switch_put
,
2722 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2727 /* set PCBEEP vol = 0, mute connections */
2728 static const struct hda_verb alc268_beep_init_verbs
[] = {
2729 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2730 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2731 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2736 ALC268_FIXUP_INV_DMIC
,
2737 ALC268_FIXUP_HP_EAPD
,
2741 static const struct hda_fixup alc268_fixups
[] = {
2742 [ALC268_FIXUP_INV_DMIC
] = {
2743 .type
= HDA_FIXUP_FUNC
,
2744 .v
.func
= alc_fixup_inv_dmic
,
2746 [ALC268_FIXUP_HP_EAPD
] = {
2747 .type
= HDA_FIXUP_VERBS
,
2748 .v
.verbs
= (const struct hda_verb
[]) {
2749 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2753 [ALC268_FIXUP_SPDIF
] = {
2754 .type
= HDA_FIXUP_PINS
,
2755 .v
.pins
= (const struct hda_pintbl
[]) {
2756 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2762 static const struct hda_model_fixup alc268_fixup_models
[] = {
2763 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2764 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2768 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2769 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2770 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2771 /* below is codec SSID since multiple Toshiba laptops have the
2772 * same PCI SSID 1179:ff00
2774 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2779 * BIOS auto configuration
2781 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2783 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2784 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2789 static int patch_alc268(struct hda_codec
*codec
)
2791 struct alc_spec
*spec
;
2794 /* ALC268 has no aa-loopback mixer */
2795 err
= alc_alloc_spec(codec
, 0);
2800 spec
->gen
.beep_nid
= 0x01;
2802 spec
->shutup
= alc_eapd_shutup
;
2804 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2805 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2807 /* automatic parse from the BIOS config */
2808 err
= alc268_parse_auto_config(codec
);
2812 if (err
> 0 && !spec
->gen
.no_analog
&&
2813 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2814 add_mixer(spec
, alc268_beep_mixer
);
2815 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2816 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2817 /* override the amp caps for beep generator */
2818 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2819 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2820 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2821 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2822 (0 << AC_AMPCAP_MUTE_SHIFT
));
2825 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2838 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2839 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2842 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2843 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2846 /* different alc269-variants */
2848 ALC269_TYPE_ALC269VA
,
2849 ALC269_TYPE_ALC269VB
,
2850 ALC269_TYPE_ALC269VC
,
2851 ALC269_TYPE_ALC269VD
,
2869 * BIOS auto configuration
2871 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2873 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2874 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2875 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2876 struct alc_spec
*spec
= codec
->spec
;
2877 const hda_nid_t
*ssids
;
2879 switch (spec
->codec_variant
) {
2880 case ALC269_TYPE_ALC269VA
:
2881 case ALC269_TYPE_ALC269VC
:
2882 case ALC269_TYPE_ALC280
:
2883 case ALC269_TYPE_ALC284
:
2884 case ALC269_TYPE_ALC293
:
2885 ssids
= alc269va_ssids
;
2887 case ALC269_TYPE_ALC269VB
:
2888 case ALC269_TYPE_ALC269VD
:
2889 case ALC269_TYPE_ALC282
:
2890 case ALC269_TYPE_ALC283
:
2891 case ALC269_TYPE_ALC286
:
2892 case ALC269_TYPE_ALC298
:
2893 case ALC269_TYPE_ALC255
:
2894 case ALC269_TYPE_ALC256
:
2895 case ALC269_TYPE_ALC257
:
2896 case ALC269_TYPE_ALC215
:
2897 case ALC269_TYPE_ALC225
:
2898 case ALC269_TYPE_ALC294
:
2899 case ALC269_TYPE_ALC700
:
2900 ssids
= alc269_ssids
;
2903 ssids
= alc269_ssids
;
2907 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2910 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2912 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2915 static void alc269_shutup(struct hda_codec
*codec
)
2917 struct alc_spec
*spec
= codec
->spec
;
2919 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2920 alc269vb_toggle_power_output(codec
, 0);
2921 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2922 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2925 alc_shutup_pins(codec
);
2928 static struct coef_fw alc282_coefs
[] = {
2929 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2930 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2931 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2932 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2933 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2934 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2935 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2936 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2937 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2938 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2939 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2940 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2941 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2942 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2943 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2944 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2945 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2946 WRITE_COEF(0x63, 0x2902), /* PLL */
2947 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2948 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2949 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2950 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2951 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2952 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2953 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2954 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2955 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2956 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2957 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2961 static void alc282_restore_default_value(struct hda_codec
*codec
)
2963 alc_process_coef_fw(codec
, alc282_coefs
);
2966 static void alc282_init(struct hda_codec
*codec
)
2968 struct alc_spec
*spec
= codec
->spec
;
2969 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
2973 alc282_restore_default_value(codec
);
2977 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2978 coef78
= alc_read_coef_idx(codec
, 0x78);
2980 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2981 /* Headphone capless set to high power mode */
2982 alc_write_coef_idx(codec
, 0x78, 0x9004);
2987 snd_hda_codec_write(codec
, hp_pin
, 0,
2988 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2993 snd_hda_codec_write(codec
, hp_pin
, 0,
2994 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
2999 /* Headphone capless set to normal mode */
3000 alc_write_coef_idx(codec
, 0x78, coef78
);
3003 static void alc282_shutup(struct hda_codec
*codec
)
3005 struct alc_spec
*spec
= codec
->spec
;
3006 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3011 alc269_shutup(codec
);
3015 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3016 coef78
= alc_read_coef_idx(codec
, 0x78);
3017 alc_write_coef_idx(codec
, 0x78, 0x9004);
3022 snd_hda_codec_write(codec
, hp_pin
, 0,
3023 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3028 if (!spec
->no_shutup_pins
)
3029 snd_hda_codec_write(codec
, hp_pin
, 0,
3030 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3035 alc_auto_setup_eapd(codec
, false);
3036 alc_shutup_pins(codec
);
3037 alc_write_coef_idx(codec
, 0x78, coef78
);
3040 static struct coef_fw alc283_coefs
[] = {
3041 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3042 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3043 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3044 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3045 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3046 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3047 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3048 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3049 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3050 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3051 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3052 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3053 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3054 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3055 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3056 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3057 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3058 WRITE_COEF(0x2e, 0x2902), /* PLL */
3059 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3060 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3061 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3062 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3063 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3064 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3065 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3066 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3067 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3068 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3069 WRITE_COEF(0x49, 0x0), /* test mode */
3070 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3071 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3072 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3073 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3077 static void alc283_restore_default_value(struct hda_codec
*codec
)
3079 alc_process_coef_fw(codec
, alc283_coefs
);
3082 static void alc283_init(struct hda_codec
*codec
)
3084 struct alc_spec
*spec
= codec
->spec
;
3085 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3088 alc283_restore_default_value(codec
);
3094 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3096 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3097 /* Headphone capless set to high power mode */
3098 alc_write_coef_idx(codec
, 0x43, 0x9004);
3100 snd_hda_codec_write(codec
, hp_pin
, 0,
3101 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3106 snd_hda_codec_write(codec
, hp_pin
, 0,
3107 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3111 /* Index 0x46 Combo jack auto switch control 2 */
3112 /* 3k pull low control for Headset jack. */
3113 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3114 /* Headphone capless set to normal mode */
3115 alc_write_coef_idx(codec
, 0x43, 0x9614);
3118 static void alc283_shutup(struct hda_codec
*codec
)
3120 struct alc_spec
*spec
= codec
->spec
;
3121 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3125 alc269_shutup(codec
);
3129 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3131 alc_write_coef_idx(codec
, 0x43, 0x9004);
3133 /*depop hp during suspend*/
3134 alc_write_coef_idx(codec
, 0x06, 0x2100);
3136 snd_hda_codec_write(codec
, hp_pin
, 0,
3137 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3142 if (!spec
->no_shutup_pins
)
3143 snd_hda_codec_write(codec
, hp_pin
, 0,
3144 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3146 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3150 alc_auto_setup_eapd(codec
, false);
3151 alc_shutup_pins(codec
);
3152 alc_write_coef_idx(codec
, 0x43, 0x9614);
3155 static void alc256_init(struct hda_codec
*codec
)
3157 struct alc_spec
*spec
= codec
->spec
;
3158 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3166 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3171 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3173 snd_hda_codec_write(codec
, hp_pin
, 0,
3174 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3179 snd_hda_codec_write(codec
, hp_pin
, 0,
3180 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3185 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3186 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3187 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3188 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 0 << 15);
3191 static void alc256_shutup(struct hda_codec
*codec
)
3193 struct alc_spec
*spec
= codec
->spec
;
3194 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3198 alc269_shutup(codec
);
3202 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3207 snd_hda_codec_write(codec
, hp_pin
, 0,
3208 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3213 /* 3k pull low control for Headset jack. */
3214 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3215 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3217 if (!spec
->no_shutup_pins
)
3218 snd_hda_codec_write(codec
, hp_pin
, 0,
3219 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3224 alc_auto_setup_eapd(codec
, false);
3225 alc_shutup_pins(codec
);
3228 static void alc225_init(struct hda_codec
*codec
)
3230 struct alc_spec
*spec
= codec
->spec
;
3231 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3232 bool hp1_pin_sense
, hp2_pin_sense
;
3239 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3240 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3242 if (hp1_pin_sense
|| hp2_pin_sense
)
3245 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3248 snd_hda_codec_write(codec
, hp_pin
, 0,
3249 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3251 snd_hda_codec_write(codec
, 0x16, 0,
3252 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3254 if (hp1_pin_sense
|| hp2_pin_sense
)
3258 snd_hda_codec_write(codec
, hp_pin
, 0,
3259 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3261 snd_hda_codec_write(codec
, 0x16, 0,
3262 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3264 if (hp1_pin_sense
|| hp2_pin_sense
)
3267 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3268 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3271 static void alc225_shutup(struct hda_codec
*codec
)
3273 struct alc_spec
*spec
= codec
->spec
;
3274 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3275 bool hp1_pin_sense
, hp2_pin_sense
;
3278 alc269_shutup(codec
);
3282 /* 3k pull low control for Headset jack. */
3283 alc_update_coef_idx(codec
, 0x4a, 0, 3 << 10);
3285 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3286 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3288 if (hp1_pin_sense
|| hp2_pin_sense
)
3292 snd_hda_codec_write(codec
, hp_pin
, 0,
3293 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3295 snd_hda_codec_write(codec
, 0x16, 0,
3296 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3298 if (hp1_pin_sense
|| hp2_pin_sense
)
3302 snd_hda_codec_write(codec
, hp_pin
, 0,
3303 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3305 snd_hda_codec_write(codec
, 0x16, 0,
3306 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3308 if (hp1_pin_sense
|| hp2_pin_sense
)
3311 alc_auto_setup_eapd(codec
, false);
3312 alc_shutup_pins(codec
);
3315 static void alc_default_init(struct hda_codec
*codec
)
3317 struct alc_spec
*spec
= codec
->spec
;
3318 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3326 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3331 snd_hda_codec_write(codec
, hp_pin
, 0,
3332 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3337 snd_hda_codec_write(codec
, hp_pin
, 0,
3338 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3344 static void alc_default_shutup(struct hda_codec
*codec
)
3346 struct alc_spec
*spec
= codec
->spec
;
3347 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3351 alc269_shutup(codec
);
3355 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3360 snd_hda_codec_write(codec
, hp_pin
, 0,
3361 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3366 if (!spec
->no_shutup_pins
)
3367 snd_hda_codec_write(codec
, hp_pin
, 0,
3368 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3373 alc_auto_setup_eapd(codec
, false);
3374 alc_shutup_pins(codec
);
3377 static void alc294_hp_init(struct hda_codec
*codec
)
3379 struct alc_spec
*spec
= codec
->spec
;
3380 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3386 snd_hda_codec_write(codec
, hp_pin
, 0,
3387 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3391 snd_hda_codec_write(codec
, hp_pin
, 0,
3392 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3394 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3395 alc_update_coefex_idx(codec
, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3397 /* Wait for depop procedure finish */
3398 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3399 for (i
= 0; i
< 20 && val
& 0x0080; i
++) {
3401 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3403 /* Set HP depop to auto mode */
3404 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0x000b);
3408 static void alc294_init(struct hda_codec
*codec
)
3410 struct alc_spec
*spec
= codec
->spec
;
3412 if (!spec
->done_hp_init
) {
3413 alc294_hp_init(codec
);
3414 spec
->done_hp_init
= true;
3416 alc_default_init(codec
);
3419 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3422 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3423 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3424 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3427 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3431 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3432 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3434 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3439 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3443 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3444 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3445 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3446 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3447 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3448 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3449 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3450 val
= alc5505_coef_get(codec
, 0x6220);
3451 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3454 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3456 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3457 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3458 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3459 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3460 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3461 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3464 static void alc5505_dsp_init(struct hda_codec
*codec
)
3468 alc5505_dsp_halt(codec
);
3469 alc5505_dsp_back_from_halt(codec
);
3470 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3471 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3472 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3473 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3474 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3475 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3476 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3477 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3478 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3479 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3480 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3481 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3482 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3484 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3486 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3488 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3490 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3491 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3492 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3493 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3494 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3495 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3496 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3498 #ifdef HALT_REALTEK_ALC5505
3499 alc5505_dsp_halt(codec
);
3503 #ifdef HALT_REALTEK_ALC5505
3504 #define alc5505_dsp_suspend(codec) /* NOP */
3505 #define alc5505_dsp_resume(codec) /* NOP */
3507 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3508 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3512 static int alc269_suspend(struct hda_codec
*codec
)
3514 struct alc_spec
*spec
= codec
->spec
;
3516 if (spec
->has_alc5505_dsp
)
3517 alc5505_dsp_suspend(codec
);
3518 return alc_suspend(codec
);
3521 static int alc269_resume(struct hda_codec
*codec
)
3523 struct alc_spec
*spec
= codec
->spec
;
3525 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3526 alc269vb_toggle_power_output(codec
, 0);
3527 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3528 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3532 codec
->patch_ops
.init(codec
);
3534 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3535 alc269vb_toggle_power_output(codec
, 1);
3536 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3537 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3541 regcache_sync(codec
->core
.regmap
);
3542 hda_call_check_power_status(codec
, 0x01);
3544 /* on some machine, the BIOS will clear the codec gpio data when enter
3545 * suspend, and won't restore the data after resume, so we restore it
3549 snd_hda_codec_write(codec
, codec
->core
.afg
, 0, AC_VERB_SET_GPIO_DATA
,
3552 if (spec
->has_alc5505_dsp
)
3553 alc5505_dsp_resume(codec
);
3557 #endif /* CONFIG_PM */
3559 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3560 const struct hda_fixup
*fix
, int action
)
3562 struct alc_spec
*spec
= codec
->spec
;
3564 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3565 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3568 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3569 const struct hda_fixup
*fix
,
3572 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3573 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3575 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3576 snd_hda_codec_set_pincfg(codec
, 0x19,
3577 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3578 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3581 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3582 const struct hda_fixup
*fix
, int action
)
3584 if (action
== HDA_FIXUP_ACT_INIT
)
3585 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3588 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3589 const struct hda_fixup
*fix
, int action
)
3591 struct alc_spec
*spec
= codec
->spec
;
3593 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3594 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3597 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3598 const struct hda_fixup
*fix
, int action
)
3600 static const struct hda_verb verbs
[] = {
3601 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3602 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3607 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3608 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3610 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3611 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3612 snd_hda_sequence_write(codec
, verbs
);
3615 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3616 const struct hda_fixup
*fix
, int action
)
3618 struct alc_spec
*spec
= codec
->spec
;
3620 if (action
!= HDA_FIXUP_ACT_PROBE
)
3623 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3624 * fix the sample rate of analog I/O to 44.1kHz
3626 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3627 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3630 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3631 const struct hda_fixup
*fix
, int action
)
3633 /* The digital-mic unit sends PDM (differential signal) instead of
3634 * the standard PCM, thus you can't record a valid mono stream as is.
3635 * Below is a workaround specific to ALC269 to control the dmic
3636 * signal source as mono.
3638 if (action
== HDA_FIXUP_ACT_INIT
)
3639 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3642 static void alc269_quanta_automute(struct hda_codec
*codec
)
3644 snd_hda_gen_update_outputs(codec
);
3646 alc_write_coef_idx(codec
, 0x0c, 0x680);
3647 alc_write_coef_idx(codec
, 0x0c, 0x480);
3650 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3651 const struct hda_fixup
*fix
, int action
)
3653 struct alc_spec
*spec
= codec
->spec
;
3654 if (action
!= HDA_FIXUP_ACT_PROBE
)
3656 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3659 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3660 struct hda_jack_callback
*jack
)
3662 struct alc_spec
*spec
= codec
->spec
;
3665 snd_hda_gen_hp_automute(codec
, jack
);
3667 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3669 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3672 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3676 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3677 const struct hda_fixup
*fix
, int action
)
3679 struct alc_spec
*spec
= codec
->spec
;
3680 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3681 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3682 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3687 /* update mute-LED according to the speaker mute state via mic VREF pin */
3688 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3690 struct hda_codec
*codec
= private_data
;
3691 struct alc_spec
*spec
= codec
->spec
;
3692 unsigned int pinval
;
3694 if (spec
->mute_led_polarity
)
3696 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3697 pinval
&= ~AC_PINCTL_VREFEN
;
3698 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3699 if (spec
->mute_led_nid
) {
3700 /* temporarily power up/down for setting VREF */
3701 snd_hda_power_up_pm(codec
);
3702 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3703 snd_hda_power_down_pm(codec
);
3707 /* Make sure the led works even in runtime suspend */
3708 static unsigned int led_power_filter(struct hda_codec
*codec
,
3710 unsigned int power_state
)
3712 struct alc_spec
*spec
= codec
->spec
;
3714 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3715 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3718 /* Set pin ctl again, it might have just been set to 0 */
3719 snd_hda_set_pin_ctl(codec
, nid
,
3720 snd_hda_codec_get_pin_target(codec
, nid
));
3722 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3725 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3726 const struct hda_fixup
*fix
, int action
)
3728 struct alc_spec
*spec
= codec
->spec
;
3729 const struct dmi_device
*dev
= NULL
;
3731 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3734 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3736 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3738 if (pin
< 0x0a || pin
>= 0x10)
3740 spec
->mute_led_polarity
= pol
;
3741 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3742 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3743 spec
->gen
.vmaster_mute_enum
= 1;
3744 codec
->power_filter
= led_power_filter
;
3746 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3747 spec
->mute_led_polarity
);
3752 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3753 const struct hda_fixup
*fix
, int action
)
3755 struct alc_spec
*spec
= codec
->spec
;
3756 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3757 spec
->mute_led_polarity
= 0;
3758 spec
->mute_led_nid
= 0x18;
3759 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3760 spec
->gen
.vmaster_mute_enum
= 1;
3761 codec
->power_filter
= led_power_filter
;
3765 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3766 const struct hda_fixup
*fix
, int action
)
3768 struct alc_spec
*spec
= codec
->spec
;
3769 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3770 spec
->mute_led_polarity
= 0;
3771 spec
->mute_led_nid
= 0x19;
3772 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3773 spec
->gen
.vmaster_mute_enum
= 1;
3774 codec
->power_filter
= led_power_filter
;
3778 /* update LED status via GPIO */
3779 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3782 struct alc_spec
*spec
= codec
->spec
;
3783 unsigned int oldval
= spec
->gpio_led
;
3785 if (spec
->mute_led_polarity
)
3789 spec
->gpio_led
&= ~mask
;
3791 spec
->gpio_led
|= mask
;
3792 if (spec
->gpio_led
!= oldval
)
3793 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3797 /* turn on/off mute LED via GPIO per vmaster hook */
3798 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3800 struct hda_codec
*codec
= private_data
;
3801 struct alc_spec
*spec
= codec
->spec
;
3803 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3806 /* turn on/off mic-mute LED via GPIO per capture hook */
3807 static void alc_fixup_gpio_mic_mute_hook(struct hda_codec
*codec
,
3808 struct snd_kcontrol
*kcontrol
,
3809 struct snd_ctl_elem_value
*ucontrol
)
3811 struct alc_spec
*spec
= codec
->spec
;
3814 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3815 ucontrol
->value
.integer
.value
[0] ||
3816 ucontrol
->value
.integer
.value
[1]);
3819 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3820 const struct hda_fixup
*fix
, int action
)
3822 struct alc_spec
*spec
= codec
->spec
;
3823 static const struct hda_verb gpio_init
[] = {
3824 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3825 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3829 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3830 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3831 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3833 spec
->mute_led_polarity
= 0;
3834 spec
->gpio_mute_led_mask
= 0x08;
3835 spec
->gpio_mic_led_mask
= 0x10;
3836 snd_hda_add_verbs(codec
, gpio_init
);
3840 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3841 const struct hda_fixup
*fix
, int action
)
3843 struct alc_spec
*spec
= codec
->spec
;
3844 static const struct hda_verb gpio_init
[] = {
3845 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x22 },
3846 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x22 },
3850 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3851 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3852 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3854 spec
->mute_led_polarity
= 0;
3855 spec
->gpio_mute_led_mask
= 0x02;
3856 spec
->gpio_mic_led_mask
= 0x20;
3857 snd_hda_add_verbs(codec
, gpio_init
);
3861 /* turn on/off mic-mute LED per capture hook */
3862 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3863 struct snd_kcontrol
*kcontrol
,
3864 struct snd_ctl_elem_value
*ucontrol
)
3866 struct alc_spec
*spec
= codec
->spec
;
3867 unsigned int pinval
, enable
, disable
;
3869 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3870 pinval
&= ~AC_PINCTL_VREFEN
;
3871 enable
= pinval
| AC_PINCTL_VREF_80
;
3872 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3877 if (ucontrol
->value
.integer
.value
[0] ||
3878 ucontrol
->value
.integer
.value
[1])
3883 if (spec
->cap_mute_led_nid
)
3884 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3887 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3888 const struct hda_fixup
*fix
, int action
)
3890 struct alc_spec
*spec
= codec
->spec
;
3891 static const struct hda_verb gpio_init
[] = {
3892 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3893 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3897 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3898 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3899 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3901 spec
->mute_led_polarity
= 0;
3902 spec
->gpio_mute_led_mask
= 0x08;
3903 spec
->cap_mute_led_nid
= 0x18;
3904 snd_hda_add_verbs(codec
, gpio_init
);
3905 codec
->power_filter
= led_power_filter
;
3909 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3910 const struct hda_fixup
*fix
, int action
)
3912 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */
3913 struct alc_spec
*spec
= codec
->spec
;
3914 static const struct hda_verb gpio_init
[] = {
3915 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3916 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3920 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3921 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3922 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3924 spec
->mute_led_polarity
= 0;
3925 spec
->gpio_mute_led_mask
= 0x08;
3926 spec
->cap_mute_led_nid
= 0x18;
3927 snd_hda_add_verbs(codec
, gpio_init
);
3928 codec
->power_filter
= led_power_filter
;
3932 #if IS_REACHABLE(CONFIG_INPUT)
3933 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3934 struct hda_jack_callback
*event
)
3936 struct alc_spec
*spec
= codec
->spec
;
3938 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3939 send both key on and key off event for every interrupt. */
3940 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
3941 input_sync(spec
->kb_dev
);
3942 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
3943 input_sync(spec
->kb_dev
);
3946 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
3948 struct alc_spec
*spec
= codec
->spec
;
3951 spec
->kb_dev
= input_allocate_device();
3952 if (!spec
->kb_dev
) {
3953 codec_err(codec
, "Out of memory (input_allocate_device)\n");
3957 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
3959 spec
->kb_dev
->name
= "Microphone Mute Button";
3960 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
3961 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
3962 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
3963 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
3964 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
3965 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
3967 if (input_register_device(spec
->kb_dev
)) {
3968 codec_err(codec
, "input_register_device failed\n");
3969 input_free_device(spec
->kb_dev
);
3970 spec
->kb_dev
= NULL
;
3977 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
3978 const struct hda_fixup
*fix
, int action
)
3980 /* GPIO1 = set according to SKU external amp
3981 GPIO2 = mic mute hotkey
3983 GPIO4 = mic mute LED */
3984 static const struct hda_verb gpio_init
[] = {
3985 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x1e },
3986 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x1a },
3987 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x02 },
3991 struct alc_spec
*spec
= codec
->spec
;
3993 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3994 if (alc_register_micmute_input_device(codec
) != 0)
3997 snd_hda_add_verbs(codec
, gpio_init
);
3998 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
3999 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
4000 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
4001 gpio2_mic_hotkey_event
);
4003 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
4004 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4006 spec
->mute_led_polarity
= 0;
4007 spec
->gpio_mute_led_mask
= 0x08;
4008 spec
->gpio_mic_led_mask
= 0x10;
4016 case HDA_FIXUP_ACT_PROBE
:
4017 spec
->init_amp
= ALC_INIT_DEFAULT
;
4019 case HDA_FIXUP_ACT_FREE
:
4020 input_unregister_device(spec
->kb_dev
);
4021 spec
->kb_dev
= NULL
;
4025 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
4026 const struct hda_fixup
*fix
, int action
)
4028 /* Line2 = mic mute hotkey
4029 GPIO2 = mic mute LED */
4030 static const struct hda_verb gpio_init
[] = {
4031 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4032 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
4036 struct alc_spec
*spec
= codec
->spec
;
4038 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4039 if (alc_register_micmute_input_device(codec
) != 0)
4042 snd_hda_add_verbs(codec
, gpio_init
);
4043 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4044 gpio2_mic_hotkey_event
);
4046 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4048 spec
->mute_led_polarity
= 0;
4049 spec
->gpio_mic_led_mask
= 0x04;
4057 case HDA_FIXUP_ACT_PROBE
:
4058 spec
->init_amp
= ALC_INIT_DEFAULT
;
4060 case HDA_FIXUP_ACT_FREE
:
4061 input_unregister_device(spec
->kb_dev
);
4062 spec
->kb_dev
= NULL
;
4066 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4067 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4070 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
4071 const struct hda_fixup
*fix
, int action
)
4073 struct alc_spec
*spec
= codec
->spec
;
4075 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4076 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
4077 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
4078 spec
->mute_led_polarity
= 0;
4079 spec
->mute_led_nid
= 0x1a;
4080 spec
->cap_mute_led_nid
= 0x18;
4081 spec
->gen
.vmaster_mute_enum
= 1;
4082 codec
->power_filter
= led_power_filter
;
4086 static struct coef_fw alc225_pre_hsmode
[] = {
4087 UPDATE_COEF(0x4a, 1<<8, 0),
4088 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4089 UPDATE_COEF(0x63, 3<<14, 3<<14),
4090 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4091 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4092 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4093 UPDATE_COEF(0x4a, 3<<10, 0),
4097 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
4099 static struct coef_fw coef0255
[] = {
4100 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4101 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4102 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4103 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4106 static struct coef_fw coef0255_1
[] = {
4107 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4110 static struct coef_fw coef0256
[] = {
4111 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4114 static struct coef_fw coef0233
[] = {
4115 WRITE_COEF(0x1b, 0x0c0b),
4116 WRITE_COEF(0x45, 0xc429),
4117 UPDATE_COEF(0x35, 0x4000, 0),
4118 WRITE_COEF(0x06, 0x2104),
4119 WRITE_COEF(0x1a, 0x0001),
4120 WRITE_COEF(0x26, 0x0004),
4121 WRITE_COEF(0x32, 0x42a3),
4124 static struct coef_fw coef0288
[] = {
4125 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4126 UPDATE_COEF(0x50, 0x2000, 0x2000),
4127 UPDATE_COEF(0x56, 0x0006, 0x0006),
4128 UPDATE_COEF(0x66, 0x0008, 0),
4129 UPDATE_COEF(0x67, 0x2000, 0),
4132 static struct coef_fw coef0298
[] = {
4133 UPDATE_COEF(0x19, 0x1300, 0x0300),
4136 static struct coef_fw coef0292
[] = {
4137 WRITE_COEF(0x76, 0x000e),
4138 WRITE_COEF(0x6c, 0x2400),
4139 WRITE_COEF(0x18, 0x7308),
4140 WRITE_COEF(0x6b, 0xc429),
4143 static struct coef_fw coef0293
[] = {
4144 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4145 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4146 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4147 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4148 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4149 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4152 static struct coef_fw coef0668
[] = {
4153 WRITE_COEF(0x15, 0x0d40),
4154 WRITE_COEF(0xb7, 0x802b),
4157 static struct coef_fw coef0225
[] = {
4158 UPDATE_COEF(0x63, 3<<14, 0),
4161 static struct coef_fw coef0274
[] = {
4162 UPDATE_COEF(0x4a, 0x0100, 0),
4163 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4164 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4165 UPDATE_COEF(0x4a, 0x0010, 0),
4166 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4167 WRITE_COEF(0x45, 0x5289),
4168 UPDATE_COEF(0x4a, 0x0c00, 0),
4172 switch (codec
->core
.vendor_id
) {
4174 alc_process_coef_fw(codec
, coef0255_1
);
4175 alc_process_coef_fw(codec
, coef0255
);
4179 alc_process_coef_fw(codec
, coef0256
);
4180 alc_process_coef_fw(codec
, coef0255
);
4185 alc_process_coef_fw(codec
, coef0274
);
4189 alc_process_coef_fw(codec
, coef0233
);
4193 alc_process_coef_fw(codec
, coef0288
);
4196 alc_process_coef_fw(codec
, coef0298
);
4197 alc_process_coef_fw(codec
, coef0288
);
4200 alc_process_coef_fw(codec
, coef0292
);
4203 alc_process_coef_fw(codec
, coef0293
);
4206 alc_process_coef_fw(codec
, coef0668
);
4214 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4215 alc_process_coef_fw(codec
, coef0225
);
4218 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4221 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
4225 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
4228 static struct coef_fw coef0255
[] = {
4229 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4230 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4233 static struct coef_fw coef0233
[] = {
4234 UPDATE_COEF(0x35, 0, 1<<14),
4235 WRITE_COEF(0x06, 0x2100),
4236 WRITE_COEF(0x1a, 0x0021),
4237 WRITE_COEF(0x26, 0x008c),
4240 static struct coef_fw coef0288
[] = {
4241 UPDATE_COEF(0x4f, 0x00c0, 0),
4242 UPDATE_COEF(0x50, 0x2000, 0),
4243 UPDATE_COEF(0x56, 0x0006, 0),
4244 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4245 UPDATE_COEF(0x66, 0x0008, 0x0008),
4246 UPDATE_COEF(0x67, 0x2000, 0x2000),
4249 static struct coef_fw coef0292
[] = {
4250 WRITE_COEF(0x19, 0xa208),
4251 WRITE_COEF(0x2e, 0xacf0),
4254 static struct coef_fw coef0293
[] = {
4255 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4256 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4257 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4260 static struct coef_fw coef0688
[] = {
4261 WRITE_COEF(0xb7, 0x802b),
4262 WRITE_COEF(0xb5, 0x1040),
4263 UPDATE_COEF(0xc3, 0, 1<<12),
4266 static struct coef_fw coef0225
[] = {
4267 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4268 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4269 UPDATE_COEF(0x63, 3<<14, 0),
4272 static struct coef_fw coef0274
[] = {
4273 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4274 UPDATE_COEF(0x4a, 0x0010, 0),
4275 UPDATE_COEF(0x6b, 0xf000, 0),
4279 switch (codec
->core
.vendor_id
) {
4283 alc_write_coef_idx(codec
, 0x45, 0xc489);
4284 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4285 alc_process_coef_fw(codec
, coef0255
);
4286 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4291 alc_write_coef_idx(codec
, 0x45, 0x4689);
4292 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4293 alc_process_coef_fw(codec
, coef0274
);
4294 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4298 alc_write_coef_idx(codec
, 0x45, 0xc429);
4299 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4300 alc_process_coef_fw(codec
, coef0233
);
4301 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4306 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4307 alc_process_coef_fw(codec
, coef0288
);
4308 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4311 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4312 alc_process_coef_fw(codec
, coef0292
);
4315 /* Set to TRS mode */
4316 alc_write_coef_idx(codec
, 0x45, 0xc429);
4317 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4318 alc_process_coef_fw(codec
, coef0293
);
4319 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4322 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4326 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4327 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4330 alc_write_coef_idx(codec
, 0x11, 0x0001);
4331 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4332 alc_process_coef_fw(codec
, coef0688
);
4333 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4341 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4342 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4343 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4344 alc_process_coef_fw(codec
, coef0225
);
4345 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4348 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4351 static void alc_headset_mode_default(struct hda_codec
*codec
)
4353 static struct coef_fw coef0225
[] = {
4354 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4355 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4356 UPDATE_COEF(0x49, 3<<8, 0<<8),
4357 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4358 UPDATE_COEF(0x63, 3<<14, 0),
4359 UPDATE_COEF(0x67, 0xf000, 0x3000),
4362 static struct coef_fw coef0255
[] = {
4363 WRITE_COEF(0x45, 0xc089),
4364 WRITE_COEF(0x45, 0xc489),
4365 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4366 WRITE_COEF(0x49, 0x0049),
4369 static struct coef_fw coef0233
[] = {
4370 WRITE_COEF(0x06, 0x2100),
4371 WRITE_COEF(0x32, 0x4ea3),
4374 static struct coef_fw coef0288
[] = {
4375 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4376 UPDATE_COEF(0x50, 0x2000, 0x2000),
4377 UPDATE_COEF(0x56, 0x0006, 0x0006),
4378 UPDATE_COEF(0x66, 0x0008, 0),
4379 UPDATE_COEF(0x67, 0x2000, 0),
4382 static struct coef_fw coef0292
[] = {
4383 WRITE_COEF(0x76, 0x000e),
4384 WRITE_COEF(0x6c, 0x2400),
4385 WRITE_COEF(0x6b, 0xc429),
4386 WRITE_COEF(0x18, 0x7308),
4389 static struct coef_fw coef0293
[] = {
4390 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4391 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4392 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4395 static struct coef_fw coef0688
[] = {
4396 WRITE_COEF(0x11, 0x0041),
4397 WRITE_COEF(0x15, 0x0d40),
4398 WRITE_COEF(0xb7, 0x802b),
4401 static struct coef_fw coef0274
[] = {
4402 WRITE_COEF(0x45, 0x4289),
4403 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4404 UPDATE_COEF(0x6b, 0x0f00, 0),
4405 UPDATE_COEF(0x49, 0x0300, 0x0300),
4409 switch (codec
->core
.vendor_id
) {
4416 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4417 alc_process_coef_fw(codec
, coef0225
);
4422 alc_process_coef_fw(codec
, coef0255
);
4427 alc_process_coef_fw(codec
, coef0274
);
4431 alc_process_coef_fw(codec
, coef0233
);
4436 alc_process_coef_fw(codec
, coef0288
);
4439 alc_process_coef_fw(codec
, coef0292
);
4442 alc_process_coef_fw(codec
, coef0293
);
4445 alc_process_coef_fw(codec
, coef0688
);
4448 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4451 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4455 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4459 static struct coef_fw coef0255
[] = {
4460 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4461 WRITE_COEF(0x1b, 0x0c2b),
4462 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4465 static struct coef_fw coef0256
[] = {
4466 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4467 WRITE_COEF(0x1b, 0x0c6b),
4468 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4471 static struct coef_fw coef0233
[] = {
4472 WRITE_COEF(0x45, 0xd429),
4473 WRITE_COEF(0x1b, 0x0c2b),
4474 WRITE_COEF(0x32, 0x4ea3),
4477 static struct coef_fw coef0288
[] = {
4478 UPDATE_COEF(0x50, 0x2000, 0x2000),
4479 UPDATE_COEF(0x56, 0x0006, 0x0006),
4480 UPDATE_COEF(0x66, 0x0008, 0),
4481 UPDATE_COEF(0x67, 0x2000, 0),
4484 static struct coef_fw coef0292
[] = {
4485 WRITE_COEF(0x6b, 0xd429),
4486 WRITE_COEF(0x76, 0x0008),
4487 WRITE_COEF(0x18, 0x7388),
4490 static struct coef_fw coef0293
[] = {
4491 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4492 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4495 static struct coef_fw coef0688
[] = {
4496 WRITE_COEF(0x11, 0x0001),
4497 WRITE_COEF(0x15, 0x0d60),
4498 WRITE_COEF(0xc3, 0x0000),
4501 static struct coef_fw coef0225_1
[] = {
4502 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4503 UPDATE_COEF(0x63, 3<<14, 2<<14),
4506 static struct coef_fw coef0225_2
[] = {
4507 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4508 UPDATE_COEF(0x63, 3<<14, 1<<14),
4512 switch (codec
->core
.vendor_id
) {
4514 alc_process_coef_fw(codec
, coef0255
);
4518 alc_process_coef_fw(codec
, coef0256
);
4523 alc_write_coef_idx(codec
, 0x45, 0xd689);
4527 alc_process_coef_fw(codec
, coef0233
);
4530 val
= alc_read_coef_idx(codec
, 0x50);
4531 if (val
& (1 << 12)) {
4532 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4533 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4536 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4537 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4543 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4545 alc_process_coef_fw(codec
, coef0288
);
4548 alc_process_coef_fw(codec
, coef0292
);
4551 alc_process_coef_fw(codec
, coef0293
);
4554 alc_process_coef_fw(codec
, coef0688
);
4562 val
= alc_read_coef_idx(codec
, 0x45);
4564 alc_process_coef_fw(codec
, coef0225_2
);
4566 alc_process_coef_fw(codec
, coef0225_1
);
4569 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4572 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4576 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4578 static struct coef_fw coef0255
[] = {
4579 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4580 WRITE_COEF(0x1b, 0x0c2b),
4581 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4584 static struct coef_fw coef0256
[] = {
4585 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4586 WRITE_COEF(0x1b, 0x0c6b),
4587 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4590 static struct coef_fw coef0233
[] = {
4591 WRITE_COEF(0x45, 0xe429),
4592 WRITE_COEF(0x1b, 0x0c2b),
4593 WRITE_COEF(0x32, 0x4ea3),
4596 static struct coef_fw coef0288
[] = {
4597 UPDATE_COEF(0x50, 0x2000, 0x2000),
4598 UPDATE_COEF(0x56, 0x0006, 0x0006),
4599 UPDATE_COEF(0x66, 0x0008, 0),
4600 UPDATE_COEF(0x67, 0x2000, 0),
4603 static struct coef_fw coef0292
[] = {
4604 WRITE_COEF(0x6b, 0xe429),
4605 WRITE_COEF(0x76, 0x0008),
4606 WRITE_COEF(0x18, 0x7388),
4609 static struct coef_fw coef0293
[] = {
4610 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4611 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4614 static struct coef_fw coef0688
[] = {
4615 WRITE_COEF(0x11, 0x0001),
4616 WRITE_COEF(0x15, 0x0d50),
4617 WRITE_COEF(0xc3, 0x0000),
4620 static struct coef_fw coef0225
[] = {
4621 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4622 UPDATE_COEF(0x63, 3<<14, 2<<14),
4626 switch (codec
->core
.vendor_id
) {
4628 alc_process_coef_fw(codec
, coef0255
);
4632 alc_process_coef_fw(codec
, coef0256
);
4637 alc_write_coef_idx(codec
, 0x45, 0xe689);
4641 alc_process_coef_fw(codec
, coef0233
);
4644 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4645 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4650 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4652 alc_process_coef_fw(codec
, coef0288
);
4655 alc_process_coef_fw(codec
, coef0292
);
4658 alc_process_coef_fw(codec
, coef0293
);
4661 alc_process_coef_fw(codec
, coef0688
);
4669 alc_process_coef_fw(codec
, coef0225
);
4672 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4675 static void alc_determine_headset_type(struct hda_codec
*codec
)
4678 bool is_ctia
= false;
4679 struct alc_spec
*spec
= codec
->spec
;
4680 static struct coef_fw coef0255
[] = {
4681 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4682 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4686 static struct coef_fw coef0288
[] = {
4687 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4690 static struct coef_fw coef0298
[] = {
4691 UPDATE_COEF(0x50, 0x2000, 0x2000),
4692 UPDATE_COEF(0x56, 0x0006, 0x0006),
4693 UPDATE_COEF(0x66, 0x0008, 0),
4694 UPDATE_COEF(0x67, 0x2000, 0),
4695 UPDATE_COEF(0x19, 0x1300, 0x1300),
4698 static struct coef_fw coef0293
[] = {
4699 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4700 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4703 static struct coef_fw coef0688
[] = {
4704 WRITE_COEF(0x11, 0x0001),
4705 WRITE_COEF(0xb7, 0x802b),
4706 WRITE_COEF(0x15, 0x0d60),
4707 WRITE_COEF(0xc3, 0x0c00),
4710 static struct coef_fw coef0274
[] = {
4711 UPDATE_COEF(0x4a, 0x0010, 0),
4712 UPDATE_COEF(0x4a, 0x8000, 0),
4713 WRITE_COEF(0x45, 0xd289),
4714 UPDATE_COEF(0x49, 0x0300, 0x0300),
4718 switch (codec
->core
.vendor_id
) {
4722 alc_process_coef_fw(codec
, coef0255
);
4724 val
= alc_read_coef_idx(codec
, 0x46);
4725 is_ctia
= (val
& 0x0070) == 0x0070;
4730 alc_process_coef_fw(codec
, coef0274
);
4732 val
= alc_read_coef_idx(codec
, 0x46);
4733 is_ctia
= (val
& 0x00f0) == 0x00f0;
4737 alc_write_coef_idx(codec
, 0x45, 0xd029);
4739 val
= alc_read_coef_idx(codec
, 0x46);
4740 is_ctia
= (val
& 0x0070) == 0x0070;
4743 snd_hda_codec_write(codec
, 0x21, 0,
4744 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4746 snd_hda_codec_write(codec
, 0x21, 0,
4747 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4750 val
= alc_read_coef_idx(codec
, 0x50);
4751 if (val
& (1 << 12)) {
4752 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4753 alc_process_coef_fw(codec
, coef0288
);
4755 val
= alc_read_coef_idx(codec
, 0x50);
4756 is_ctia
= (val
& 0x0070) == 0x0070;
4758 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4759 alc_process_coef_fw(codec
, coef0288
);
4761 val
= alc_read_coef_idx(codec
, 0x50);
4762 is_ctia
= (val
& 0x0070) == 0x0070;
4764 alc_process_coef_fw(codec
, coef0298
);
4765 snd_hda_codec_write(codec
, 0x21, 0,
4766 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
);
4768 snd_hda_codec_write(codec
, 0x21, 0,
4769 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4773 alc_process_coef_fw(codec
, coef0288
);
4775 val
= alc_read_coef_idx(codec
, 0x50);
4776 is_ctia
= (val
& 0x0070) == 0x0070;
4779 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4781 val
= alc_read_coef_idx(codec
, 0x6c);
4782 is_ctia
= (val
& 0x001c) == 0x001c;
4785 alc_process_coef_fw(codec
, coef0293
);
4787 val
= alc_read_coef_idx(codec
, 0x46);
4788 is_ctia
= (val
& 0x0070) == 0x0070;
4791 alc_process_coef_fw(codec
, coef0688
);
4793 val
= alc_read_coef_idx(codec
, 0xbe);
4794 is_ctia
= (val
& 0x1c02) == 0x1c02;
4802 snd_hda_codec_write(codec
, 0x21, 0,
4803 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4805 snd_hda_codec_write(codec
, 0x21, 0,
4806 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4808 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4809 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x1000);
4810 val
= alc_read_coef_idx(codec
, 0x45);
4811 if (val
& (1 << 9)) {
4812 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4813 alc_update_coef_idx(codec
, 0x49, 3<<8, 2<<8);
4815 val
= alc_read_coef_idx(codec
, 0x46);
4816 is_ctia
= (val
& 0x00f0) == 0x00f0;
4818 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4819 alc_update_coef_idx(codec
, 0x49, 3<<8, 1<<8);
4821 val
= alc_read_coef_idx(codec
, 0x46);
4822 is_ctia
= (val
& 0x00f0) == 0x00f0;
4824 alc_update_coef_idx(codec
, 0x4a, 7<<6, 7<<6);
4825 alc_update_coef_idx(codec
, 0x4a, 3<<4, 3<<4);
4826 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
4828 snd_hda_codec_write(codec
, 0x21, 0,
4829 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
4831 snd_hda_codec_write(codec
, 0x21, 0,
4832 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4839 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4840 is_ctia
? "yes" : "no");
4841 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4844 static void alc_update_headset_mode(struct hda_codec
*codec
)
4846 struct alc_spec
*spec
= codec
->spec
;
4848 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4849 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
4851 int new_headset_mode
;
4853 if (!snd_hda_jack_detect(codec
, hp_pin
))
4854 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4855 else if (mux_pin
== spec
->headset_mic_pin
)
4856 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4857 else if (mux_pin
== spec
->headphone_mic_pin
)
4858 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4860 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4862 if (new_headset_mode
== spec
->current_headset_mode
) {
4863 snd_hda_gen_update_outputs(codec
);
4867 switch (new_headset_mode
) {
4868 case ALC_HEADSET_MODE_UNPLUGGED
:
4869 alc_headset_mode_unplugged(codec
);
4870 spec
->gen
.hp_jack_present
= false;
4872 case ALC_HEADSET_MODE_HEADSET
:
4873 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4874 alc_determine_headset_type(codec
);
4875 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4876 alc_headset_mode_ctia(codec
);
4877 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4878 alc_headset_mode_omtp(codec
);
4879 spec
->gen
.hp_jack_present
= true;
4881 case ALC_HEADSET_MODE_MIC
:
4882 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4883 spec
->gen
.hp_jack_present
= false;
4885 case ALC_HEADSET_MODE_HEADPHONE
:
4886 alc_headset_mode_default(codec
);
4887 spec
->gen
.hp_jack_present
= true;
4890 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
4891 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
4892 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
4893 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
4894 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
4897 spec
->current_headset_mode
= new_headset_mode
;
4899 snd_hda_gen_update_outputs(codec
);
4902 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
4903 struct snd_kcontrol
*kcontrol
,
4904 struct snd_ctl_elem_value
*ucontrol
)
4906 alc_update_headset_mode(codec
);
4909 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
4910 struct hda_jack_callback
*jack
)
4912 struct alc_spec
*spec
= codec
->spec
;
4913 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
4914 snd_hda_gen_hp_automute(codec
, jack
);
4917 static void alc_probe_headset_mode(struct hda_codec
*codec
)
4920 struct alc_spec
*spec
= codec
->spec
;
4921 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4924 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4925 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
4926 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
4927 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
4928 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
4931 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
4932 spec
->gen
.automute_hook
= alc_update_headset_mode
;
4933 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
4936 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
4937 const struct hda_fixup
*fix
, int action
)
4939 struct alc_spec
*spec
= codec
->spec
;
4942 case HDA_FIXUP_ACT_PRE_PROBE
:
4943 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
4945 case HDA_FIXUP_ACT_PROBE
:
4946 alc_probe_headset_mode(codec
);
4948 case HDA_FIXUP_ACT_INIT
:
4949 spec
->current_headset_mode
= 0;
4950 alc_update_headset_mode(codec
);
4955 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
4956 const struct hda_fixup
*fix
, int action
)
4958 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4959 struct alc_spec
*spec
= codec
->spec
;
4960 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4963 alc_fixup_headset_mode(codec
, fix
, action
);
4966 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
4968 /* Set to iphone type */
4969 static struct coef_fw alc255fw
[] = {
4970 WRITE_COEF(0x1b, 0x880b),
4971 WRITE_COEF(0x45, 0xd089),
4972 WRITE_COEF(0x1b, 0x080b),
4973 WRITE_COEF(0x46, 0x0004),
4974 WRITE_COEF(0x1b, 0x0c0b),
4977 static struct coef_fw alc256fw
[] = {
4978 WRITE_COEF(0x1b, 0x884b),
4979 WRITE_COEF(0x45, 0xd089),
4980 WRITE_COEF(0x1b, 0x084b),
4981 WRITE_COEF(0x46, 0x0004),
4982 WRITE_COEF(0x1b, 0x0c4b),
4985 switch (codec
->core
.vendor_id
) {
4987 alc_process_coef_fw(codec
, alc255fw
);
4991 alc_process_coef_fw(codec
, alc256fw
);
4997 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
4998 const struct hda_fixup
*fix
, int action
)
5000 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5001 alc255_set_default_jack_type(codec
);
5003 alc_fixup_headset_mode(codec
, fix
, action
);
5006 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
5007 const struct hda_fixup
*fix
, int action
)
5009 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5010 struct alc_spec
*spec
= codec
->spec
;
5011 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5012 alc255_set_default_jack_type(codec
);
5015 alc_fixup_headset_mode(codec
, fix
, action
);
5018 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
5019 struct hda_jack_callback
*jack
)
5021 struct alc_spec
*spec
= codec
->spec
;
5024 alc_update_headset_jack_cb(codec
, jack
);
5025 /* Headset Mic enable or disable, only for Dell Dino */
5026 present
= spec
->gen
.hp_jack_present
? 0x40 : 0;
5027 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
5031 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
5032 const struct hda_fixup
*fix
, int action
)
5034 alc_fixup_headset_mode(codec
, fix
, action
);
5035 if (action
== HDA_FIXUP_ACT_PROBE
) {
5036 struct alc_spec
*spec
= codec
->spec
;
5037 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
5041 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
5042 const struct hda_fixup
*fix
, int action
)
5044 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5045 struct alc_spec
*spec
= codec
->spec
;
5046 spec
->gen
.auto_mute_via_amp
= 1;
5050 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
5051 const struct hda_fixup
*fix
, int action
)
5053 if (action
== HDA_FIXUP_ACT_PROBE
) {
5054 struct alc_spec
*spec
= codec
->spec
;
5055 spec
->no_shutup_pins
= 1;
5059 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
5060 const struct hda_fixup
*fix
, int action
)
5062 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5063 struct alc_spec
*spec
= codec
->spec
;
5064 /* Disable AA-loopback as it causes white noise */
5065 spec
->gen
.mixer_nid
= 0;
5069 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5070 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
5071 const struct hda_fixup
*fix
, int action
)
5073 static const struct hda_pintbl pincfgs
[] = {
5074 { 0x16, 0x21211010 }, /* dock headphone */
5075 { 0x19, 0x21a11010 }, /* dock mic */
5078 struct alc_spec
*spec
= codec
->spec
;
5080 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5081 spec
->reboot_notify
= alc_d3_at_reboot
; /* reduce noise */
5082 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5083 codec
->power_save_node
= 0; /* avoid click noises */
5084 snd_hda_apply_pincfgs(codec
, pincfgs
);
5088 static void alc_fixup_tpt470_dock(struct hda_codec
*codec
,
5089 const struct hda_fixup
*fix
, int action
)
5091 static const struct hda_pintbl pincfgs
[] = {
5092 { 0x17, 0x21211010 }, /* dock headphone */
5093 { 0x19, 0x21a11010 }, /* dock mic */
5096 struct alc_spec
*spec
= codec
->spec
;
5098 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5099 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5100 snd_hda_apply_pincfgs(codec
, pincfgs
);
5101 } else if (action
== HDA_FIXUP_ACT_INIT
) {
5102 /* Enable DOCK device */
5103 snd_hda_codec_write(codec
, 0x17, 0,
5104 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5105 /* Enable DOCK device */
5106 snd_hda_codec_write(codec
, 0x19, 0,
5107 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5111 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
5113 struct alc_spec
*spec
= codec
->spec
;
5114 int hp_pin
= alc_get_hp_pin(spec
);
5116 /* Prevent pop noises when headphones are plugged in */
5117 snd_hda_codec_write(codec
, hp_pin
, 0,
5118 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5122 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
5123 const struct hda_fixup
*fix
, int action
)
5125 struct alc_spec
*spec
= codec
->spec
;
5126 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
5130 case HDA_FIXUP_ACT_PRE_PROBE
:
5131 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5132 * it causes a click noise at start up
5134 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5136 case HDA_FIXUP_ACT_PROBE
:
5137 spec
->shutup
= alc_shutup_dell_xps13
;
5139 /* Make the internal mic the default input source. */
5140 for (i
= 0; i
< imux
->num_items
; i
++) {
5141 if (spec
->gen
.imux_pins
[i
] == 0x12) {
5142 spec
->gen
.cur_mux
[0] = i
;
5150 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
5151 const struct hda_fixup
*fix
, int action
)
5153 struct alc_spec
*spec
= codec
->spec
;
5155 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5156 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5157 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
5159 /* Disable boost for mic-in permanently. (This code is only called
5160 from quirks that guarantee that the headphone is at NID 0x1b.) */
5161 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
5162 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
5164 alc_fixup_headset_mode(codec
, fix
, action
);
5167 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
5168 const struct hda_fixup
*fix
, int action
)
5170 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5171 alc_write_coef_idx(codec
, 0xc4, 0x8000);
5172 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
5173 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
5175 alc_fixup_headset_mode(codec
, fix
, action
);
5178 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5179 static int find_ext_mic_pin(struct hda_codec
*codec
)
5181 struct alc_spec
*spec
= codec
->spec
;
5182 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5184 unsigned int defcfg
;
5187 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5188 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5190 nid
= cfg
->inputs
[i
].pin
;
5191 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5192 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
5200 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
5201 const struct hda_fixup
*fix
,
5204 struct alc_spec
*spec
= codec
->spec
;
5206 if (action
== HDA_FIXUP_ACT_PROBE
) {
5207 int mic_pin
= find_ext_mic_pin(codec
);
5208 int hp_pin
= alc_get_hp_pin(spec
);
5210 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
5212 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
5216 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
5217 const struct hda_fixup
*fix
,
5220 struct alc_spec
*spec
= codec
->spec
;
5221 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5224 /* The mic boosts on level 2 and 3 are too noisy
5225 on the internal mic input.
5226 Therefore limit the boost to 0 or 1. */
5228 if (action
!= HDA_FIXUP_ACT_PROBE
)
5231 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5232 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5233 unsigned int defcfg
;
5234 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5236 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5237 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
5240 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
5241 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
5242 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5243 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5244 (0 << AC_AMPCAP_MUTE_SHIFT
));
5248 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
5249 struct hda_jack_callback
*jack
)
5251 struct alc_spec
*spec
= codec
->spec
;
5255 snd_hda_gen_hp_automute(codec
, jack
);
5257 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
5260 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5264 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
5265 const struct hda_fixup
*fix
, int action
)
5267 struct alc_spec
*spec
= codec
->spec
;
5270 case HDA_FIXUP_ACT_PRE_PROBE
:
5271 snd_hda_override_wcaps(codec
, 0x03, 0);
5272 /* Disable AA-loopback as it causes white noise */
5273 spec
->gen
.mixer_nid
= 0;
5275 case HDA_FIXUP_ACT_INIT
:
5276 /* MIC2-VREF control */
5277 /* Set to manual mode */
5278 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5279 /* Enable Line1 input control by verb */
5280 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
5285 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
5286 const struct hda_fixup
*fix
, int action
)
5288 struct alc_spec
*spec
= codec
->spec
;
5291 case HDA_FIXUP_ACT_PRE_PROBE
:
5292 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
5294 case HDA_FIXUP_ACT_INIT
:
5295 /* MIC2-VREF control */
5296 /* Set to manual mode */
5297 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5302 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5303 static void asus_tx300_automute(struct hda_codec
*codec
)
5305 struct alc_spec
*spec
= codec
->spec
;
5306 snd_hda_gen_update_outputs(codec
);
5307 if (snd_hda_jack_detect(codec
, 0x1b))
5308 spec
->gen
.mute_bits
|= (1ULL << 0x14);
5311 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
5312 const struct hda_fixup
*fix
, int action
)
5314 struct alc_spec
*spec
= codec
->spec
;
5315 /* TX300 needs to set up GPIO2 for the speaker amp */
5316 static const struct hda_verb gpio2_verbs
[] = {
5317 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
5318 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
5319 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
5322 static const struct hda_pintbl dock_pins
[] = {
5323 { 0x1b, 0x21114000 }, /* dock speaker pin */
5328 case HDA_FIXUP_ACT_PRE_PROBE
:
5329 snd_hda_add_verbs(codec
, gpio2_verbs
);
5330 snd_hda_apply_pincfgs(codec
, dock_pins
);
5331 spec
->gen
.auto_mute_via_amp
= 1;
5332 spec
->gen
.automute_hook
= asus_tx300_automute
;
5333 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
5334 snd_hda_gen_hp_automute
);
5336 case HDA_FIXUP_ACT_BUILD
:
5337 /* this is a bit tricky; give more sane names for the main
5338 * (tablet) speaker and the dock speaker, respectively
5340 rename_ctl(codec
, "Speaker Playback Switch",
5341 "Dock Speaker Playback Switch");
5342 rename_ctl(codec
, "Bass Speaker Playback Switch",
5343 "Speaker Playback Switch");
5348 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
5349 const struct hda_fixup
*fix
, int action
)
5351 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5352 /* DAC node 0x03 is giving mono output. We therefore want to
5353 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5354 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5355 hda_nid_t conn1
[2] = { 0x0c };
5356 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
5357 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
5361 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
5362 const struct hda_fixup
*fix
, int action
)
5364 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5365 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5366 we can't adjust the speaker's volume since this node does not has
5367 Amp-out capability. we change the speaker's route to:
5368 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5369 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5370 speaker's volume now. */
5372 hda_nid_t conn1
[1] = { 0x0c };
5373 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
5377 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5378 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
5379 const struct hda_fixup
*fix
, int action
)
5381 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5382 hda_nid_t conn
[2] = { 0x02, 0x03 };
5383 snd_hda_override_conn_list(codec
, 0x17, 2, conn
);
5387 /* Hook to update amp GPIO4 for automute */
5388 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
5389 struct hda_jack_callback
*jack
)
5391 struct alc_spec
*spec
= codec
->spec
;
5393 snd_hda_gen_hp_automute(codec
, jack
);
5394 /* mute_led_polarity is set to 0, so we pass inverted value here */
5395 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
5398 /* Manage GPIOs for HP EliteBook Folio 9480m.
5400 * GPIO4 is the headphone amplifier power control
5401 * GPIO3 is the audio output mute indicator LED
5404 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5405 const struct hda_fixup
*fix
,
5408 struct alc_spec
*spec
= codec
->spec
;
5409 static const struct hda_verb gpio_init
[] = {
5410 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
5411 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
5415 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5416 /* Set the hooks to turn the headphone amp on/off
5419 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
5420 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5422 /* The GPIOs are currently off */
5425 /* GPIO3 is connected to the output mute LED,
5426 * high is on, low is off
5428 spec
->mute_led_polarity
= 0;
5429 spec
->gpio_mute_led_mask
= 0x08;
5431 /* Initialize GPIO configuration */
5432 snd_hda_add_verbs(codec
, gpio_init
);
5436 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5437 const struct hda_fixup
*fix
,
5440 alc_fixup_dual_codecs(codec
, fix
, action
);
5442 case HDA_FIXUP_ACT_PRE_PROBE
:
5443 /* override card longname to provide a unique UCM profile */
5444 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5446 case HDA_FIXUP_ACT_BUILD
:
5447 /* rename Capture controls depending on the codec */
5448 rename_ctl(codec
, "Capture Volume",
5450 "Rear-Panel Capture Volume" :
5451 "Front-Panel Capture Volume");
5452 rename_ctl(codec
, "Capture Switch",
5454 "Rear-Panel Capture Switch" :
5455 "Front-Panel Capture Switch");
5460 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5461 static void alc274_fixup_bind_dacs(struct hda_codec
*codec
,
5462 const struct hda_fixup
*fix
, int action
)
5464 struct alc_spec
*spec
= codec
->spec
;
5465 static hda_nid_t preferred_pairs
[] = {
5466 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5470 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5473 spec
->gen
.preferred_dacs
= preferred_pairs
;
5474 spec
->gen
.auto_mute_via_amp
= 1;
5475 codec
->power_save_node
= 0;
5478 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5479 static void alc285_fixup_invalidate_dacs(struct hda_codec
*codec
,
5480 const struct hda_fixup
*fix
, int action
)
5482 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5485 snd_hda_override_wcaps(codec
, 0x03, 0);
5488 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
5489 const struct hda_fixup
*fix
, int action
)
5491 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5492 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5495 /* for hda_fixup_thinkpad_acpi() */
5496 #include "thinkpad_helper.c"
5498 static void alc_fixup_thinkpad_acpi(struct hda_codec
*codec
,
5499 const struct hda_fixup
*fix
, int action
)
5501 alc_fixup_no_shutup(codec
, fix
, action
); /* reduce click noise */
5502 hda_fixup_thinkpad_acpi(codec
, fix
, action
);
5505 /* for dell wmi mic mute led */
5506 #include "dell_wmi_helper.c"
5509 ALC269_FIXUP_SONY_VAIO
,
5510 ALC275_FIXUP_SONY_VAIO_GPIO2
,
5511 ALC269_FIXUP_DELL_M101Z
,
5512 ALC269_FIXUP_SKU_IGNORE
,
5513 ALC269_FIXUP_ASUS_G73JW
,
5514 ALC269_FIXUP_LENOVO_EAPD
,
5515 ALC275_FIXUP_SONY_HWEQ
,
5516 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
5518 ALC269_FIXUP_PCM_44K
,
5519 ALC269_FIXUP_STEREO_DMIC
,
5520 ALC269_FIXUP_HEADSET_MIC
,
5521 ALC269_FIXUP_QUANTA_MUTE
,
5522 ALC269_FIXUP_LIFEBOOK
,
5523 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
5524 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
5525 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
5526 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
5529 ALC269VB_FIXUP_AMIC
,
5530 ALC269VB_FIXUP_DMIC
,
5531 ALC269_FIXUP_HP_MUTE_LED
,
5532 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5533 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
5534 ALC269_FIXUP_HP_GPIO_LED
,
5535 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
5536 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
5537 ALC269_FIXUP_INV_DMIC
,
5538 ALC269_FIXUP_LENOVO_DOCK
,
5539 ALC269_FIXUP_NO_SHUTUP
,
5540 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
5541 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
5542 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5543 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
5544 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5545 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
5546 ALC269_FIXUP_HEADSET_MODE
,
5547 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5548 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
5549 ALC269_FIXUP_ASUS_X101_FUNC
,
5550 ALC269_FIXUP_ASUS_X101_VERB
,
5551 ALC269_FIXUP_ASUS_X101
,
5552 ALC271_FIXUP_AMIC_MIC2
,
5553 ALC271_FIXUP_HP_GATE_MIC_JACK
,
5554 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
5555 ALC269_FIXUP_ACER_AC700
,
5556 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
5557 ALC269VB_FIXUP_ASUS_ZENBOOK
,
5558 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
5559 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
5560 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
5561 ALC283_FIXUP_CHROME_BOOK
,
5562 ALC283_FIXUP_SENSE_COMBO_JACK
,
5563 ALC282_FIXUP_ASUS_TX300
,
5564 ALC283_FIXUP_INT_MIC
,
5565 ALC290_FIXUP_MONO_SPEAKERS
,
5566 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5567 ALC290_FIXUP_SUBWOOFER
,
5568 ALC290_FIXUP_SUBWOOFER_HSJACK
,
5569 ALC269_FIXUP_THINKPAD_ACPI
,
5570 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
5571 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
5572 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
5573 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5574 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5575 ALC255_FIXUP_HEADSET_MODE
,
5576 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5577 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5578 ALC292_FIXUP_TPT440_DOCK
,
5579 ALC292_FIXUP_TPT440
,
5580 ALC283_FIXUP_HEADSET_MIC
,
5581 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
,
5582 ALC282_FIXUP_ASPIRE_V5_PINS
,
5583 ALC280_FIXUP_HP_GPIO4
,
5584 ALC286_FIXUP_HP_GPIO_LED
,
5585 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
5586 ALC280_FIXUP_HP_DOCK_PINS
,
5587 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
5588 ALC280_FIXUP_HP_9480M
,
5589 ALC288_FIXUP_DELL_HEADSET_MODE
,
5590 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
5591 ALC288_FIXUP_DELL_XPS_13_GPIO6
,
5592 ALC288_FIXUP_DELL_XPS_13
,
5593 ALC288_FIXUP_DISABLE_AAMIX
,
5594 ALC292_FIXUP_DELL_E7X
,
5595 ALC292_FIXUP_DISABLE_AAMIX
,
5596 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
5597 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
5598 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5599 ALC275_FIXUP_DELL_XPS
,
5600 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
5601 ALC293_FIXUP_LENOVO_SPK_NOISE
,
5602 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
5603 ALC255_FIXUP_DELL_SPK_NOISE
,
5604 ALC225_FIXUP_DISABLE_MIC_VREF
,
5605 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5606 ALC295_FIXUP_DISABLE_DAC3
,
5607 ALC280_FIXUP_HP_HEADSET_MIC
,
5608 ALC221_FIXUP_HP_FRONT_MIC
,
5609 ALC292_FIXUP_TPT460
,
5610 ALC298_FIXUP_SPK_VOLUME
,
5611 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
5612 ALC269_FIXUP_ATIV_BOOK_8
,
5613 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
5614 ALC256_FIXUP_ASUS_HEADSET_MODE
,
5615 ALC256_FIXUP_ASUS_MIC
,
5616 ALC256_FIXUP_ASUS_AIO_GPIO2
,
5617 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
5618 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
5619 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
5620 ALC294_FIXUP_LENOVO_MIC_LOCATION
,
5621 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
,
5622 ALC700_FIXUP_INTEL_REFERENCE
,
5623 ALC274_FIXUP_DELL_BIND_DACS
,
5624 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
5625 ALC298_FIXUP_TPT470_DOCK
,
5626 ALC255_FIXUP_DUMMY_LINEOUT_VERB
,
5627 ALC255_FIXUP_DELL_HEADSET_MIC
,
5628 ALC221_FIXUP_HP_HEADSET_MIC
,
5629 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
,
5630 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
5631 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
,
5632 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
,
5633 ALC225_FIXUP_WYSE_AUTO_MUTE
,
5634 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
,
5637 static const struct hda_fixup alc269_fixups
[] = {
5638 [ALC269_FIXUP_SONY_VAIO
] = {
5639 .type
= HDA_FIXUP_PINCTLS
,
5640 .v
.pins
= (const struct hda_pintbl
[]) {
5641 {0x19, PIN_VREFGRD
},
5645 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
5646 .type
= HDA_FIXUP_VERBS
,
5647 .v
.verbs
= (const struct hda_verb
[]) {
5648 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
5649 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
5650 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5654 .chain_id
= ALC269_FIXUP_SONY_VAIO
5656 [ALC269_FIXUP_DELL_M101Z
] = {
5657 .type
= HDA_FIXUP_VERBS
,
5658 .v
.verbs
= (const struct hda_verb
[]) {
5659 /* Enables internal speaker */
5660 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
5661 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
5665 [ALC269_FIXUP_SKU_IGNORE
] = {
5666 .type
= HDA_FIXUP_FUNC
,
5667 .v
.func
= alc_fixup_sku_ignore
,
5669 [ALC269_FIXUP_ASUS_G73JW
] = {
5670 .type
= HDA_FIXUP_PINS
,
5671 .v
.pins
= (const struct hda_pintbl
[]) {
5672 { 0x17, 0x99130111 }, /* subwoofer */
5676 [ALC269_FIXUP_LENOVO_EAPD
] = {
5677 .type
= HDA_FIXUP_VERBS
,
5678 .v
.verbs
= (const struct hda_verb
[]) {
5679 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5683 [ALC275_FIXUP_SONY_HWEQ
] = {
5684 .type
= HDA_FIXUP_FUNC
,
5685 .v
.func
= alc269_fixup_hweq
,
5687 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
5689 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
5690 .type
= HDA_FIXUP_FUNC
,
5691 .v
.func
= alc_fixup_disable_aamix
,
5693 .chain_id
= ALC269_FIXUP_SONY_VAIO
5695 [ALC271_FIXUP_DMIC
] = {
5696 .type
= HDA_FIXUP_FUNC
,
5697 .v
.func
= alc271_fixup_dmic
,
5699 [ALC269_FIXUP_PCM_44K
] = {
5700 .type
= HDA_FIXUP_FUNC
,
5701 .v
.func
= alc269_fixup_pcm_44k
,
5703 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5705 [ALC269_FIXUP_STEREO_DMIC
] = {
5706 .type
= HDA_FIXUP_FUNC
,
5707 .v
.func
= alc269_fixup_stereo_dmic
,
5709 [ALC269_FIXUP_HEADSET_MIC
] = {
5710 .type
= HDA_FIXUP_FUNC
,
5711 .v
.func
= alc269_fixup_headset_mic
,
5713 [ALC269_FIXUP_QUANTA_MUTE
] = {
5714 .type
= HDA_FIXUP_FUNC
,
5715 .v
.func
= alc269_fixup_quanta_mute
,
5717 [ALC269_FIXUP_LIFEBOOK
] = {
5718 .type
= HDA_FIXUP_PINS
,
5719 .v
.pins
= (const struct hda_pintbl
[]) {
5720 { 0x1a, 0x2101103f }, /* dock line-out */
5721 { 0x1b, 0x23a11040 }, /* dock mic-in */
5725 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5727 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5728 .type
= HDA_FIXUP_PINS
,
5729 .v
.pins
= (const struct hda_pintbl
[]) {
5730 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5734 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5735 .type
= HDA_FIXUP_PINS
,
5736 .v
.pins
= (const struct hda_pintbl
[]) {
5737 { 0x21, 0x0221102f }, /* HP out */
5741 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5742 .type
= HDA_FIXUP_FUNC
,
5743 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5745 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
5746 .type
= HDA_FIXUP_FUNC
,
5747 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
5749 [ALC269_FIXUP_AMIC
] = {
5750 .type
= HDA_FIXUP_PINS
,
5751 .v
.pins
= (const struct hda_pintbl
[]) {
5752 { 0x14, 0x99130110 }, /* speaker */
5753 { 0x15, 0x0121401f }, /* HP out */
5754 { 0x18, 0x01a19c20 }, /* mic */
5755 { 0x19, 0x99a3092f }, /* int-mic */
5759 [ALC269_FIXUP_DMIC
] = {
5760 .type
= HDA_FIXUP_PINS
,
5761 .v
.pins
= (const struct hda_pintbl
[]) {
5762 { 0x12, 0x99a3092f }, /* int-mic */
5763 { 0x14, 0x99130110 }, /* speaker */
5764 { 0x15, 0x0121401f }, /* HP out */
5765 { 0x18, 0x01a19c20 }, /* mic */
5769 [ALC269VB_FIXUP_AMIC
] = {
5770 .type
= HDA_FIXUP_PINS
,
5771 .v
.pins
= (const struct hda_pintbl
[]) {
5772 { 0x14, 0x99130110 }, /* speaker */
5773 { 0x18, 0x01a19c20 }, /* mic */
5774 { 0x19, 0x99a3092f }, /* int-mic */
5775 { 0x21, 0x0121401f }, /* HP out */
5779 [ALC269VB_FIXUP_DMIC
] = {
5780 .type
= HDA_FIXUP_PINS
,
5781 .v
.pins
= (const struct hda_pintbl
[]) {
5782 { 0x12, 0x99a3092f }, /* int-mic */
5783 { 0x14, 0x99130110 }, /* speaker */
5784 { 0x18, 0x01a19c20 }, /* mic */
5785 { 0x21, 0x0121401f }, /* HP out */
5789 [ALC269_FIXUP_HP_MUTE_LED
] = {
5790 .type
= HDA_FIXUP_FUNC
,
5791 .v
.func
= alc269_fixup_hp_mute_led
,
5793 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5794 .type
= HDA_FIXUP_FUNC
,
5795 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5797 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5798 .type
= HDA_FIXUP_FUNC
,
5799 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5801 [ALC269_FIXUP_HP_GPIO_LED
] = {
5802 .type
= HDA_FIXUP_FUNC
,
5803 .v
.func
= alc269_fixup_hp_gpio_led
,
5805 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5806 .type
= HDA_FIXUP_FUNC
,
5807 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5809 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5810 .type
= HDA_FIXUP_FUNC
,
5811 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5813 [ALC269_FIXUP_INV_DMIC
] = {
5814 .type
= HDA_FIXUP_FUNC
,
5815 .v
.func
= alc_fixup_inv_dmic
,
5817 [ALC269_FIXUP_NO_SHUTUP
] = {
5818 .type
= HDA_FIXUP_FUNC
,
5819 .v
.func
= alc_fixup_no_shutup
,
5821 [ALC269_FIXUP_LENOVO_DOCK
] = {
5822 .type
= HDA_FIXUP_PINS
,
5823 .v
.pins
= (const struct hda_pintbl
[]) {
5824 { 0x19, 0x23a11040 }, /* dock mic */
5825 { 0x1b, 0x2121103f }, /* dock headphone */
5829 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5831 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5832 .type
= HDA_FIXUP_FUNC
,
5833 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5835 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5837 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5838 .type
= HDA_FIXUP_PINS
,
5839 .v
.pins
= (const struct hda_pintbl
[]) {
5840 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5841 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5845 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5847 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5848 .type
= HDA_FIXUP_PINS
,
5849 .v
.pins
= (const struct hda_pintbl
[]) {
5850 { 0x16, 0x21014020 }, /* dock line out */
5851 { 0x19, 0x21a19030 }, /* dock mic */
5852 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5856 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5858 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5859 .type
= HDA_FIXUP_PINS
,
5860 .v
.pins
= (const struct hda_pintbl
[]) {
5861 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5865 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5867 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
5868 .type
= HDA_FIXUP_PINS
,
5869 .v
.pins
= (const struct hda_pintbl
[]) {
5870 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5871 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5875 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5877 [ALC269_FIXUP_HEADSET_MODE
] = {
5878 .type
= HDA_FIXUP_FUNC
,
5879 .v
.func
= alc_fixup_headset_mode
,
5881 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5883 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5884 .type
= HDA_FIXUP_FUNC
,
5885 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
5887 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
5888 .type
= HDA_FIXUP_PINS
,
5889 .v
.pins
= (const struct hda_pintbl
[]) {
5890 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5894 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
5896 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
5897 .type
= HDA_FIXUP_PINS
,
5898 .v
.pins
= (const struct hda_pintbl
[]) {
5899 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5903 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5905 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
5906 .type
= HDA_FIXUP_FUNC
,
5907 .v
.func
= alc269_fixup_x101_headset_mic
,
5909 [ALC269_FIXUP_ASUS_X101_VERB
] = {
5910 .type
= HDA_FIXUP_VERBS
,
5911 .v
.verbs
= (const struct hda_verb
[]) {
5912 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5913 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
5914 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
5918 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
5920 [ALC269_FIXUP_ASUS_X101
] = {
5921 .type
= HDA_FIXUP_PINS
,
5922 .v
.pins
= (const struct hda_pintbl
[]) {
5923 { 0x18, 0x04a1182c }, /* Headset mic */
5927 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
5929 [ALC271_FIXUP_AMIC_MIC2
] = {
5930 .type
= HDA_FIXUP_PINS
,
5931 .v
.pins
= (const struct hda_pintbl
[]) {
5932 { 0x14, 0x99130110 }, /* speaker */
5933 { 0x19, 0x01a19c20 }, /* mic */
5934 { 0x1b, 0x99a7012f }, /* int-mic */
5935 { 0x21, 0x0121401f }, /* HP out */
5939 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
5940 .type
= HDA_FIXUP_FUNC
,
5941 .v
.func
= alc271_hp_gate_mic_jack
,
5943 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
5945 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
5946 .type
= HDA_FIXUP_FUNC
,
5947 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5949 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
5951 [ALC269_FIXUP_ACER_AC700
] = {
5952 .type
= HDA_FIXUP_PINS
,
5953 .v
.pins
= (const struct hda_pintbl
[]) {
5954 { 0x12, 0x99a3092f }, /* int-mic */
5955 { 0x14, 0x99130110 }, /* speaker */
5956 { 0x18, 0x03a11c20 }, /* mic */
5957 { 0x1e, 0x0346101e }, /* SPDIF1 */
5958 { 0x21, 0x0321101f }, /* HP out */
5962 .chain_id
= ALC271_FIXUP_DMIC
,
5964 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
5965 .type
= HDA_FIXUP_FUNC
,
5966 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5968 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5970 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
5971 .type
= HDA_FIXUP_FUNC
,
5972 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5974 .chain_id
= ALC269VB_FIXUP_DMIC
,
5976 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
5977 .type
= HDA_FIXUP_VERBS
,
5978 .v
.verbs
= (const struct hda_verb
[]) {
5979 /* class-D output amp +5dB */
5980 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
5981 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
5985 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
5987 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
5988 .type
= HDA_FIXUP_FUNC
,
5989 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5991 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5993 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
5994 .type
= HDA_FIXUP_PINS
,
5995 .v
.pins
= (const struct hda_pintbl
[]) {
5996 { 0x12, 0x99a3092f }, /* int-mic */
5997 { 0x18, 0x03a11d20 }, /* mic */
5998 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6002 [ALC283_FIXUP_CHROME_BOOK
] = {
6003 .type
= HDA_FIXUP_FUNC
,
6004 .v
.func
= alc283_fixup_chromebook
,
6006 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
6007 .type
= HDA_FIXUP_FUNC
,
6008 .v
.func
= alc283_fixup_sense_combo_jack
,
6010 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
6012 [ALC282_FIXUP_ASUS_TX300
] = {
6013 .type
= HDA_FIXUP_FUNC
,
6014 .v
.func
= alc282_fixup_asus_tx300
,
6016 [ALC283_FIXUP_INT_MIC
] = {
6017 .type
= HDA_FIXUP_VERBS
,
6018 .v
.verbs
= (const struct hda_verb
[]) {
6019 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
6020 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
6024 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6026 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
6027 .type
= HDA_FIXUP_PINS
,
6028 .v
.pins
= (const struct hda_pintbl
[]) {
6029 { 0x17, 0x90170112 }, /* subwoofer */
6033 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6035 [ALC290_FIXUP_SUBWOOFER
] = {
6036 .type
= HDA_FIXUP_PINS
,
6037 .v
.pins
= (const struct hda_pintbl
[]) {
6038 { 0x17, 0x90170112 }, /* subwoofer */
6042 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
6044 [ALC290_FIXUP_MONO_SPEAKERS
] = {
6045 .type
= HDA_FIXUP_FUNC
,
6046 .v
.func
= alc290_fixup_mono_speakers
,
6048 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
6049 .type
= HDA_FIXUP_FUNC
,
6050 .v
.func
= alc290_fixup_mono_speakers
,
6052 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6054 [ALC269_FIXUP_THINKPAD_ACPI
] = {
6055 .type
= HDA_FIXUP_FUNC
,
6056 .v
.func
= alc_fixup_thinkpad_acpi
,
6058 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
6060 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
6061 .type
= HDA_FIXUP_FUNC
,
6062 .v
.func
= alc_fixup_inv_dmic
,
6064 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6066 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
6067 .type
= HDA_FIXUP_PINS
,
6068 .v
.pins
= (const struct hda_pintbl
[]) {
6069 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6073 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6075 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6076 .type
= HDA_FIXUP_PINS
,
6077 .v
.pins
= (const struct hda_pintbl
[]) {
6078 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6082 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6084 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6085 .type
= HDA_FIXUP_PINS
,
6086 .v
.pins
= (const struct hda_pintbl
[]) {
6087 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6088 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6092 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6094 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6095 .type
= HDA_FIXUP_PINS
,
6096 .v
.pins
= (const struct hda_pintbl
[]) {
6097 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6101 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6103 [ALC255_FIXUP_HEADSET_MODE
] = {
6104 .type
= HDA_FIXUP_FUNC
,
6105 .v
.func
= alc_fixup_headset_mode_alc255
,
6107 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6109 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6110 .type
= HDA_FIXUP_FUNC
,
6111 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
6113 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6114 .type
= HDA_FIXUP_PINS
,
6115 .v
.pins
= (const struct hda_pintbl
[]) {
6116 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6117 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6121 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6123 [ALC292_FIXUP_TPT440_DOCK
] = {
6124 .type
= HDA_FIXUP_FUNC
,
6125 .v
.func
= alc_fixup_tpt440_dock
,
6127 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6129 [ALC292_FIXUP_TPT440
] = {
6130 .type
= HDA_FIXUP_FUNC
,
6131 .v
.func
= alc_fixup_disable_aamix
,
6133 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
6135 [ALC283_FIXUP_HEADSET_MIC
] = {
6136 .type
= HDA_FIXUP_PINS
,
6137 .v
.pins
= (const struct hda_pintbl
[]) {
6138 { 0x19, 0x04a110f0 },
6142 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
] = {
6143 .type
= HDA_FIXUP_FUNC
,
6144 .v
.func
= alc_fixup_dell_wmi
,
6146 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
6147 .type
= HDA_FIXUP_PINS
,
6148 .v
.pins
= (const struct hda_pintbl
[]) {
6149 { 0x12, 0x90a60130 },
6150 { 0x14, 0x90170110 },
6151 { 0x17, 0x40000008 },
6152 { 0x18, 0x411111f0 },
6153 { 0x19, 0x01a1913c },
6154 { 0x1a, 0x411111f0 },
6155 { 0x1b, 0x411111f0 },
6156 { 0x1d, 0x40f89b2d },
6157 { 0x1e, 0x411111f0 },
6158 { 0x21, 0x0321101f },
6162 [ALC280_FIXUP_HP_GPIO4
] = {
6163 .type
= HDA_FIXUP_FUNC
,
6164 .v
.func
= alc280_fixup_hp_gpio4
,
6166 [ALC286_FIXUP_HP_GPIO_LED
] = {
6167 .type
= HDA_FIXUP_FUNC
,
6168 .v
.func
= alc286_fixup_hp_gpio_led
,
6170 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
6171 .type
= HDA_FIXUP_FUNC
,
6172 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
6174 [ALC280_FIXUP_HP_DOCK_PINS
] = {
6175 .type
= HDA_FIXUP_PINS
,
6176 .v
.pins
= (const struct hda_pintbl
[]) {
6177 { 0x1b, 0x21011020 }, /* line-out */
6178 { 0x1a, 0x01a1903c }, /* headset mic */
6179 { 0x18, 0x2181103f }, /* line-in */
6183 .chain_id
= ALC280_FIXUP_HP_GPIO4
6185 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
6186 .type
= HDA_FIXUP_PINS
,
6187 .v
.pins
= (const struct hda_pintbl
[]) {
6188 { 0x1b, 0x21011020 }, /* line-out */
6189 { 0x18, 0x2181103f }, /* line-in */
6193 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
6195 [ALC280_FIXUP_HP_9480M
] = {
6196 .type
= HDA_FIXUP_FUNC
,
6197 .v
.func
= alc280_fixup_hp_9480m
,
6199 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
6200 .type
= HDA_FIXUP_FUNC
,
6201 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
6203 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6205 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6206 .type
= HDA_FIXUP_PINS
,
6207 .v
.pins
= (const struct hda_pintbl
[]) {
6208 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6209 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6213 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
6215 [ALC288_FIXUP_DELL_XPS_13_GPIO6
] = {
6216 .type
= HDA_FIXUP_VERBS
,
6217 .v
.verbs
= (const struct hda_verb
[]) {
6218 {0x01, AC_VERB_SET_GPIO_MASK
, 0x40},
6219 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x40},
6220 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
6224 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6226 [ALC288_FIXUP_DISABLE_AAMIX
] = {
6227 .type
= HDA_FIXUP_FUNC
,
6228 .v
.func
= alc_fixup_disable_aamix
,
6230 .chain_id
= ALC288_FIXUP_DELL_XPS_13_GPIO6
6232 [ALC288_FIXUP_DELL_XPS_13
] = {
6233 .type
= HDA_FIXUP_FUNC
,
6234 .v
.func
= alc_fixup_dell_xps13
,
6236 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
6238 [ALC292_FIXUP_DISABLE_AAMIX
] = {
6239 .type
= HDA_FIXUP_FUNC
,
6240 .v
.func
= alc_fixup_disable_aamix
,
6242 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6244 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
6245 .type
= HDA_FIXUP_FUNC
,
6246 .v
.func
= alc_fixup_disable_aamix
,
6248 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6250 [ALC292_FIXUP_DELL_E7X
] = {
6251 .type
= HDA_FIXUP_FUNC
,
6252 .v
.func
= alc_fixup_dell_xps13
,
6254 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
6256 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6257 .type
= HDA_FIXUP_PINS
,
6258 .v
.pins
= (const struct hda_pintbl
[]) {
6259 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6260 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6264 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6266 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
6267 .type
= HDA_FIXUP_PINS
,
6268 .v
.pins
= (const struct hda_pintbl
[]) {
6269 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6273 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6275 [ALC275_FIXUP_DELL_XPS
] = {
6276 .type
= HDA_FIXUP_VERBS
,
6277 .v
.verbs
= (const struct hda_verb
[]) {
6278 /* Enables internal speaker */
6279 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
6280 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
6281 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
6282 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
6286 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
6287 .type
= HDA_FIXUP_VERBS
,
6288 .v
.verbs
= (const struct hda_verb
[]) {
6289 /* Disable pass-through path for FRONT 14h */
6290 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
6291 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
6295 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6297 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
6298 .type
= HDA_FIXUP_FUNC
,
6299 .v
.func
= alc_fixup_disable_aamix
,
6301 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6303 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
6304 .type
= HDA_FIXUP_FUNC
,
6305 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
6307 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
6308 .type
= HDA_FIXUP_FUNC
,
6309 .v
.func
= alc_fixup_disable_aamix
,
6311 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6313 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
6314 .type
= HDA_FIXUP_FUNC
,
6315 .v
.func
= alc_fixup_disable_mic_vref
,
6317 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6319 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6320 .type
= HDA_FIXUP_VERBS
,
6321 .v
.verbs
= (const struct hda_verb
[]) {
6322 /* Disable pass-through path for FRONT 14h */
6323 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6324 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6328 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
6330 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
6331 .type
= HDA_FIXUP_FUNC
,
6332 .v
.func
= alc_fixup_disable_aamix
,
6334 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
6336 [ALC221_FIXUP_HP_FRONT_MIC
] = {
6337 .type
= HDA_FIXUP_PINS
,
6338 .v
.pins
= (const struct hda_pintbl
[]) {
6339 { 0x19, 0x02a19020 }, /* Front Mic */
6343 [ALC292_FIXUP_TPT460
] = {
6344 .type
= HDA_FIXUP_FUNC
,
6345 .v
.func
= alc_fixup_tpt440_dock
,
6347 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
6349 [ALC298_FIXUP_SPK_VOLUME
] = {
6350 .type
= HDA_FIXUP_FUNC
,
6351 .v
.func
= alc298_fixup_speaker_volume
,
6353 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
6355 [ALC295_FIXUP_DISABLE_DAC3
] = {
6356 .type
= HDA_FIXUP_FUNC
,
6357 .v
.func
= alc295_fixup_disable_dac3
,
6359 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
6360 .type
= HDA_FIXUP_PINS
,
6361 .v
.pins
= (const struct hda_pintbl
[]) {
6362 { 0x1b, 0x90170151 },
6366 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6368 [ALC269_FIXUP_ATIV_BOOK_8
] = {
6369 .type
= HDA_FIXUP_FUNC
,
6370 .v
.func
= alc_fixup_auto_mute_via_amp
,
6372 .chain_id
= ALC269_FIXUP_NO_SHUTUP
6374 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
6375 .type
= HDA_FIXUP_PINS
,
6376 .v
.pins
= (const struct hda_pintbl
[]) {
6377 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6378 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6382 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6384 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
6385 .type
= HDA_FIXUP_FUNC
,
6386 .v
.func
= alc_fixup_headset_mode
,
6388 [ALC256_FIXUP_ASUS_MIC
] = {
6389 .type
= HDA_FIXUP_PINS
,
6390 .v
.pins
= (const struct hda_pintbl
[]) {
6391 { 0x13, 0x90a60160 }, /* use as internal mic */
6392 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6396 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6398 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
6399 .type
= HDA_FIXUP_VERBS
,
6400 .v
.verbs
= (const struct hda_verb
[]) {
6401 /* Set up GPIO2 for the speaker amp */
6402 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
6403 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
6404 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
6408 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6409 .type
= HDA_FIXUP_PINS
,
6410 .v
.pins
= (const struct hda_pintbl
[]) {
6411 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6415 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6417 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
6418 .type
= HDA_FIXUP_VERBS
,
6419 .v
.verbs
= (const struct hda_verb
[]) {
6420 /* Enables internal speaker */
6421 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
6422 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
6426 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6428 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
6429 .type
= HDA_FIXUP_FUNC
,
6430 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
6432 [ALC294_FIXUP_LENOVO_MIC_LOCATION
] = {
6433 .type
= HDA_FIXUP_PINS
,
6434 .v
.pins
= (const struct hda_pintbl
[]) {
6435 /* Change the mic location from front to right, otherwise there are
6436 two front mics with the same name, pulseaudio can't handle them.
6437 This is just a temporary workaround, after applying this fixup,
6438 there will be one "Front Mic" and one "Mic" in this machine.
6440 { 0x1a, 0x04a19040 },
6444 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
] = {
6445 .type
= HDA_FIXUP_PINS
,
6446 .v
.pins
= (const struct hda_pintbl
[]) {
6447 { 0x16, 0x0101102f }, /* Rear Headset HP */
6448 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6449 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6450 { 0x1b, 0x02011020 },
6454 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6456 [ALC700_FIXUP_INTEL_REFERENCE
] = {
6457 .type
= HDA_FIXUP_VERBS
,
6458 .v
.verbs
= (const struct hda_verb
[]) {
6459 /* Enables internal speaker */
6460 {0x20, AC_VERB_SET_COEF_INDEX
, 0x45},
6461 {0x20, AC_VERB_SET_PROC_COEF
, 0x5289},
6462 {0x20, AC_VERB_SET_COEF_INDEX
, 0x4A},
6463 {0x20, AC_VERB_SET_PROC_COEF
, 0x001b},
6464 {0x58, AC_VERB_SET_COEF_INDEX
, 0x00},
6465 {0x58, AC_VERB_SET_PROC_COEF
, 0x3888},
6466 {0x20, AC_VERB_SET_COEF_INDEX
, 0x6f},
6467 {0x20, AC_VERB_SET_PROC_COEF
, 0x2c0b},
6471 [ALC274_FIXUP_DELL_BIND_DACS
] = {
6472 .type
= HDA_FIXUP_FUNC
,
6473 .v
.func
= alc274_fixup_bind_dacs
,
6475 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6477 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
] = {
6478 .type
= HDA_FIXUP_PINS
,
6479 .v
.pins
= (const struct hda_pintbl
[]) {
6480 { 0x1b, 0x0401102f },
6484 .chain_id
= ALC274_FIXUP_DELL_BIND_DACS
6486 [ALC298_FIXUP_TPT470_DOCK
] = {
6487 .type
= HDA_FIXUP_FUNC
,
6488 .v
.func
= alc_fixup_tpt470_dock
,
6490 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
6492 [ALC255_FIXUP_DUMMY_LINEOUT_VERB
] = {
6493 .type
= HDA_FIXUP_PINS
,
6494 .v
.pins
= (const struct hda_pintbl
[]) {
6495 { 0x14, 0x0201101f },
6499 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6501 [ALC255_FIXUP_DELL_HEADSET_MIC
] = {
6502 .type
= HDA_FIXUP_PINS
,
6503 .v
.pins
= (const struct hda_pintbl
[]) {
6504 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6508 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6510 [ALC221_FIXUP_HP_HEADSET_MIC
] = {
6511 .type
= HDA_FIXUP_PINS
,
6512 .v
.pins
= (const struct hda_pintbl
[]) {
6513 { 0x19, 0x0181313f},
6517 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6519 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
] = {
6520 .type
= HDA_FIXUP_FUNC
,
6521 .v
.func
= alc285_fixup_invalidate_dacs
,
6523 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6525 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
] = {
6526 .type
= HDA_FIXUP_VERBS
,
6527 .v
.verbs
= (const struct hda_verb
[]) {
6528 /* Disable PCBEEP-IN passthrough */
6529 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6530 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6534 .chain_id
= ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6536 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
] = {
6537 .type
= HDA_FIXUP_PINS
,
6538 .v
.pins
= (const struct hda_pintbl
[]) {
6539 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6543 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6545 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
] = {
6546 .type
= HDA_FIXUP_PINS
,
6547 .v
.pins
= (const struct hda_pintbl
[]) {
6548 { 0x16, 0x01011020 }, /* Rear Line out */
6549 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6553 .chain_id
= ALC225_FIXUP_WYSE_AUTO_MUTE
6555 [ALC225_FIXUP_WYSE_AUTO_MUTE
] = {
6556 .type
= HDA_FIXUP_FUNC
,
6557 .v
.func
= alc_fixup_auto_mute_via_amp
,
6559 .chain_id
= ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6561 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
] = {
6562 .type
= HDA_FIXUP_FUNC
,
6563 .v
.func
= alc_fixup_disable_mic_vref
,
6565 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6569 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
6570 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
6571 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
6572 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
6573 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
6574 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6575 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6576 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6577 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6578 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6579 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6580 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
6581 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
6582 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
6583 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
6584 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
6585 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
6586 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
6587 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
6588 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
6589 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6590 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6591 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6592 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6593 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6594 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
6595 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
6596 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
6597 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6598 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6599 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
6600 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6601 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6602 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6603 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6604 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6605 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6606 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6607 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6608 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6609 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6610 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6611 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6612 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
6613 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP
),
6614 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6615 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
6616 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
6617 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6618 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
),
6619 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6620 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6621 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6622 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6623 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6624 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB
),
6625 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
),
6626 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
),
6627 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6628 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6629 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6630 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
6631 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
6632 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
6633 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
6635 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6636 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6637 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6638 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6639 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6640 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6641 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6642 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6643 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6644 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6645 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6646 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6647 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
6648 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6649 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6650 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6651 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6652 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6653 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6654 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6655 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
6656 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6657 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6659 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6660 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6661 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6662 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6663 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6664 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6665 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6666 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6667 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6668 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
6669 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6670 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6671 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6672 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6673 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6674 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6675 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6676 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6677 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6678 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6679 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6680 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6681 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6682 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6683 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6684 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6685 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6686 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6687 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6688 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
6689 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
6690 SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6691 SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6692 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6693 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
6694 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6695 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6696 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6697 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6698 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6699 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6700 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6701 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
6702 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
6703 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
6704 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
6705 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
6706 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
6707 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
6708 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
6709 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
6710 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6711 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6712 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
6713 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
6714 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
6715 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
6716 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6717 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6718 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
6719 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6720 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6721 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
6722 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6723 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6724 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
6725 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
6726 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
6727 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6728 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6729 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
6730 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
6731 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE
),
6732 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE
),
6733 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
6734 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
6735 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
6736 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
6737 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6738 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6739 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6740 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
6741 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
6742 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
6743 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
6744 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
6745 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
6746 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
6747 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
6748 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
6749 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
6750 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
6751 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
6752 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
6753 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
6754 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
6755 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
6756 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
6757 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
6758 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
6759 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
6760 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6761 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
6762 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
6763 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
6764 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6765 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6766 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
6767 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
6768 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK
),
6769 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6770 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6771 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460
),
6772 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6773 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6774 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6775 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6776 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6777 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6778 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6779 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6780 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6781 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6782 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
6783 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
6784 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP
),
6785 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6786 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
6787 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
6788 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6789 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
6790 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
6791 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
6792 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
6793 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
6794 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
6795 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
6796 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
6797 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6798 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6799 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6800 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6801 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6802 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6803 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
6804 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
6805 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
6808 /* Below is a quirk table taken from the old code.
6809 * Basically the device should work as is without the fixup table.
6810 * If BIOS doesn't give a proper info, enable the corresponding
6813 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
6815 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
6816 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
6817 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
6818 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
6819 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
6820 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
6821 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
6822 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
6823 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
6824 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
6825 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
6826 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
6827 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
6828 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
6829 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
6830 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
6831 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
6832 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
6833 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
6834 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
6835 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
6836 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
6837 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
6838 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
6839 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
6840 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
6841 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
6842 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
6843 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
6844 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
6845 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
6846 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
6847 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
6848 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
6849 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
6850 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
6851 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
6852 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
6853 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
6858 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
6859 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
6860 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
6861 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
6862 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
6866 static const struct hda_model_fixup alc269_fixup_models
[] = {
6867 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
6868 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
6869 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
6870 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
6871 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
6872 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
6873 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
6874 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
6875 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
6876 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
6877 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
6878 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
6879 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
6880 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
6881 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
6882 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
6883 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
6884 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
6885 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
6886 {.id
= ALC700_FIXUP_INTEL_REFERENCE
, .name
= "alc700-ref"},
6889 #define ALC225_STANDARD_PINS \
6892 #define ALC256_STANDARD_PINS \
6893 {0x12, 0x90a60140}, \
6894 {0x14, 0x90170110}, \
6897 #define ALC282_STANDARD_PINS \
6900 #define ALC290_STANDARD_PINS \
6903 #define ALC292_STANDARD_PINS \
6904 {0x14, 0x90170110}, \
6907 #define ALC295_STANDARD_PINS \
6908 {0x12, 0xb7a60130}, \
6909 {0x14, 0x90170110}, \
6912 #define ALC298_STANDARD_PINS \
6913 {0x12, 0x90a60130}, \
6916 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
6917 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC
,
6922 {0x21, 0x0221102f}),
6923 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
6926 {0x21, 0x02211030}),
6927 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6930 {0x21, 0x03211020}),
6931 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6934 {0x21, 0x03211020}),
6935 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6936 ALC225_STANDARD_PINS
,
6938 {0x14, 0x901701a0}),
6939 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6940 ALC225_STANDARD_PINS
,
6942 {0x14, 0x901701b0}),
6943 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6944 ALC225_STANDARD_PINS
,
6946 {0x14, 0x901701a0}),
6947 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6948 ALC225_STANDARD_PINS
,
6950 {0x14, 0x901701b0}),
6951 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6952 ALC225_STANDARD_PINS
,
6954 {0x1b, 0x90170110}),
6955 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6958 {0x21, 0x02211020}),
6959 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
6963 {0x21, 0x02211020}),
6964 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6969 {0x21, 0x0221101f}),
6970 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6975 {0x21, 0x0221101f}),
6976 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6980 {0x21, 0x0221101f}),
6981 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6984 {0x21, 0x02211020}),
6985 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
6989 {0x21, 0x02211020}),
6990 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6993 {0x21, 0x02211020}),
6994 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6995 {0x21, 0x02211020}),
6996 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
6998 {0x21, 0x02211020}),
6999 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7001 {0x21, 0x02211040}),
7002 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7005 {0x21, 0x02211020}),
7006 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7009 {0x21, 0x02211030}),
7010 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7013 {0x21, 0x0221101f}),
7014 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7017 {0x21, 0x0221101f}),
7018 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7021 {0x21, 0x0221103f}),
7022 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7025 {0x21, 0x0221103f}),
7026 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7029 {0x21, 0x0221103f}),
7030 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7033 {0x21, 0x0221105f}),
7034 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7037 {0x21, 0x0221101f}),
7038 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7042 {0x21, 0x0321102f}),
7043 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7046 {0x21, 0x02211040}),
7047 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7050 {0x21, 0x02211050}),
7051 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7054 {0x21, 0x02211030}),
7055 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7058 {0x21, 0x02211040}),
7059 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7062 {0x21, 0x02211040}),
7063 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7066 {0x21, 0x02211050}),
7067 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7070 {0x21, 0x02211040}),
7071 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7074 {0x21, 0x02211030}),
7075 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7077 {0x21, 0x02211010}),
7078 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7082 {0x21, 0x0221101f}),
7083 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7086 {0x21, 0x02211030}),
7087 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7090 {0x21, 0x02211030}),
7091 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7094 {0x21, 0x02211030}),
7095 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7098 {0x21, 0x02211020}),
7099 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7103 {0x21, 0x0221101f}),
7104 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7105 ALC256_STANDARD_PINS
),
7106 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7109 {0x21, 0x0221101f}),
7110 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7113 {0x21, 0x04211020}),
7114 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7117 {0x21, 0x03211020}),
7118 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
7122 {0x21, 0x04211020}),
7123 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
7127 {0x1a, 0x04a11020}),
7128 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
7134 {0x1b, 0x02011020}),
7135 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7136 ALC282_STANDARD_PINS
,
7139 {0x21, 0x0321101f}),
7140 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7141 ALC282_STANDARD_PINS
,
7144 {0x21, 0x03211040}),
7145 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7146 ALC282_STANDARD_PINS
,
7149 {0x21, 0x03211020}),
7150 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7151 ALC282_STANDARD_PINS
,
7154 {0x21, 0x0421101f}),
7155 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
7156 ALC282_STANDARD_PINS
,
7159 {0x21, 0x04211020}),
7160 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7161 ALC282_STANDARD_PINS
,
7163 {0x21, 0x0321101f}),
7164 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7167 {0x21, 0x02211030}),
7168 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7169 ALC282_STANDARD_PINS
,
7172 {0x21, 0x0321101f}),
7173 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
7177 {0x21, 0x04211020}),
7178 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6
,
7181 {0x21, 0x0321101f}),
7182 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7185 {0x21, 0x04211020}),
7186 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7187 ALC290_STANDARD_PINS
,
7190 {0x1a, 0x04a11020}),
7191 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7192 ALC290_STANDARD_PINS
,
7195 {0x1a, 0x04a11020}),
7196 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7197 ALC290_STANDARD_PINS
,
7199 {0x1a, 0x04a11020}),
7200 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7201 ALC290_STANDARD_PINS
,
7203 {0x1a, 0x04a11040}),
7204 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7205 ALC290_STANDARD_PINS
,
7208 {0x1a, 0x04a11040}),
7209 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7210 ALC290_STANDARD_PINS
,
7213 {0x1a, 0x04a11020}),
7214 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7215 ALC290_STANDARD_PINS
,
7218 {0x1a, 0x04a11020}),
7219 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7220 ALC292_STANDARD_PINS
,
7223 {0x19, 0x01a19030}),
7224 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7225 ALC292_STANDARD_PINS
,
7229 {0x19, 0x01a1903e}),
7230 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
7231 ALC292_STANDARD_PINS
,
7232 {0x12, 0x90a60140}),
7233 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7234 ALC292_STANDARD_PINS
,
7237 {0x19, 0x21a19030}),
7238 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7239 ALC292_STANDARD_PINS
,
7240 {0x13, 0x90a60140}),
7241 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7242 ALC295_STANDARD_PINS
,
7244 {0x18, 0x21a19030}),
7245 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7246 ALC295_STANDARD_PINS
,
7248 {0x18, 0x21a19050}),
7249 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7250 ALC295_STANDARD_PINS
),
7251 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7252 ALC298_STANDARD_PINS
,
7253 {0x17, 0x90170110}),
7254 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7255 ALC298_STANDARD_PINS
,
7256 {0x17, 0x90170140}),
7257 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7258 ALC298_STANDARD_PINS
,
7259 {0x17, 0x90170150}),
7260 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
7265 {0x21, 0x03211030}),
7266 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7267 ALC225_STANDARD_PINS
,
7269 {0x17, 0x90170110}),
7273 static void alc269_fill_coef(struct hda_codec
*codec
)
7275 struct alc_spec
*spec
= codec
->spec
;
7278 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
7281 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
7282 alc_write_coef_idx(codec
, 0xf, 0x960b);
7283 alc_write_coef_idx(codec
, 0xe, 0x8817);
7286 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
7287 alc_write_coef_idx(codec
, 0xf, 0x960b);
7288 alc_write_coef_idx(codec
, 0xe, 0x8814);
7291 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
7292 /* Power up output pin */
7293 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
7296 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
7297 val
= alc_read_coef_idx(codec
, 0xd);
7298 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
7299 /* Capless ramp up clock control */
7300 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
7302 val
= alc_read_coef_idx(codec
, 0x17);
7303 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
7304 /* Class D power on reset */
7305 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
7310 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
7315 static int patch_alc269(struct hda_codec
*codec
)
7317 struct alc_spec
*spec
;
7320 err
= alc_alloc_spec(codec
, 0x0b);
7325 spec
->gen
.shared_mic_vref_pin
= 0x18;
7326 codec
->power_save_node
= 1;
7329 codec
->patch_ops
.suspend
= alc269_suspend
;
7330 codec
->patch_ops
.resume
= alc269_resume
;
7332 spec
->shutup
= alc_default_shutup
;
7333 spec
->init_hook
= alc_default_init
;
7335 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
7336 alc269_fixup_tbl
, alc269_fixups
);
7337 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
7338 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
7340 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7342 alc_auto_parse_customize_define(codec
);
7344 if (has_cdefine_beep(codec
))
7345 spec
->gen
.beep_nid
= 0x01;
7347 switch (codec
->core
.vendor_id
) {
7349 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
7350 switch (alc_get_coef0(codec
) & 0x00f0) {
7352 if (codec
->bus
->pci
&&
7353 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7354 spec
->cdefine
.platform_type
== 1)
7355 err
= alc_codec_rename(codec
, "ALC271X");
7356 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
7359 if (codec
->bus
->pci
&&
7360 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
7361 codec
->bus
->pci
->subsystem_device
== 0x21f3)
7362 err
= alc_codec_rename(codec
, "ALC3202");
7363 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
7366 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
7369 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7373 spec
->shutup
= alc269_shutup
;
7374 spec
->init_hook
= alc269_fill_coef
;
7375 alc269_fill_coef(codec
);
7380 spec
->codec_variant
= ALC269_TYPE_ALC280
;
7383 spec
->codec_variant
= ALC269_TYPE_ALC282
;
7384 spec
->shutup
= alc282_shutup
;
7385 spec
->init_hook
= alc282_init
;
7389 spec
->codec_variant
= ALC269_TYPE_ALC283
;
7390 spec
->shutup
= alc283_shutup
;
7391 spec
->init_hook
= alc283_init
;
7395 spec
->codec_variant
= ALC269_TYPE_ALC284
;
7398 spec
->codec_variant
= ALC269_TYPE_ALC293
;
7402 spec
->codec_variant
= ALC269_TYPE_ALC286
;
7405 spec
->codec_variant
= ALC269_TYPE_ALC298
;
7409 spec
->codec_variant
= ALC269_TYPE_ALC255
;
7410 spec
->shutup
= alc256_shutup
;
7411 spec
->init_hook
= alc256_init
;
7415 spec
->codec_variant
= ALC269_TYPE_ALC256
;
7416 spec
->shutup
= alc256_shutup
;
7417 spec
->init_hook
= alc256_init
;
7418 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
7419 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
7422 spec
->codec_variant
= ALC269_TYPE_ALC257
;
7423 spec
->shutup
= alc256_shutup
;
7424 spec
->init_hook
= alc256_init
;
7425 spec
->gen
.mixer_nid
= 0;
7430 spec
->codec_variant
= ALC269_TYPE_ALC215
;
7431 spec
->gen
.mixer_nid
= 0;
7435 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7436 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225 ALC295 */
7439 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7440 spec
->shutup
= alc225_shutup
;
7441 spec
->init_hook
= alc225_init
;
7442 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225, ALC295 and ALC299 */
7447 spec
->codec_variant
= ALC269_TYPE_ALC294
;
7448 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
7449 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7450 spec
->init_hook
= alc294_init
;
7455 spec
->codec_variant
= ALC269_TYPE_ALC700
;
7456 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
7457 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7458 spec
->init_hook
= alc294_init
;
7463 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
7464 spec
->has_alc5505_dsp
= 1;
7465 spec
->init_hook
= alc5505_dsp_init
;
7468 /* automatic parse from the BIOS config */
7469 err
= alc269_parse_auto_config(codec
);
7473 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
)
7474 set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
7476 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7489 static int alc861_parse_auto_config(struct hda_codec
*codec
)
7491 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
7492 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
7493 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
7496 /* Pin config fixes */
7498 ALC861_FIXUP_FSC_AMILO_PI1505
,
7499 ALC861_FIXUP_AMP_VREF_0F
,
7500 ALC861_FIXUP_NO_JACK_DETECT
,
7501 ALC861_FIXUP_ASUS_A6RP
,
7502 ALC660_FIXUP_ASUS_W7J
,
7505 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7506 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
7507 const struct hda_fixup
*fix
, int action
)
7509 struct alc_spec
*spec
= codec
->spec
;
7512 if (action
!= HDA_FIXUP_ACT_INIT
)
7514 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
7515 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
7516 val
|= AC_PINCTL_IN_EN
;
7517 val
|= AC_PINCTL_VREF_50
;
7518 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
7519 spec
->gen
.keep_vref_in_automute
= 1;
7522 /* suppress the jack-detection */
7523 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
7524 const struct hda_fixup
*fix
, int action
)
7526 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
7527 codec
->no_jack_detect
= 1;
7530 static const struct hda_fixup alc861_fixups
[] = {
7531 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
7532 .type
= HDA_FIXUP_PINS
,
7533 .v
.pins
= (const struct hda_pintbl
[]) {
7534 { 0x0b, 0x0221101f }, /* HP */
7535 { 0x0f, 0x90170310 }, /* speaker */
7539 [ALC861_FIXUP_AMP_VREF_0F
] = {
7540 .type
= HDA_FIXUP_FUNC
,
7541 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7543 [ALC861_FIXUP_NO_JACK_DETECT
] = {
7544 .type
= HDA_FIXUP_FUNC
,
7545 .v
.func
= alc_fixup_no_jack_detect
,
7547 [ALC861_FIXUP_ASUS_A6RP
] = {
7548 .type
= HDA_FIXUP_FUNC
,
7549 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7551 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
7553 [ALC660_FIXUP_ASUS_W7J
] = {
7554 .type
= HDA_FIXUP_VERBS
,
7555 .v
.verbs
= (const struct hda_verb
[]) {
7556 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7557 * for enabling outputs
7559 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
7565 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
7566 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
7567 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
7568 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
7569 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
7570 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
7571 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
7572 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
7573 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
7579 static int patch_alc861(struct hda_codec
*codec
)
7581 struct alc_spec
*spec
;
7584 err
= alc_alloc_spec(codec
, 0x15);
7589 spec
->gen
.beep_nid
= 0x23;
7592 spec
->power_hook
= alc_power_eapd
;
7595 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
7596 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7598 /* automatic parse from the BIOS config */
7599 err
= alc861_parse_auto_config(codec
);
7603 if (!spec
->gen
.no_analog
)
7604 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
7606 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7620 * In addition, an independent DAC
7622 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
7624 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
7625 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7626 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
7630 ALC660VD_FIX_ASUS_GPIO1
,
7631 ALC861VD_FIX_DALLAS
,
7634 /* exclude VREF80 */
7635 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
7636 const struct hda_fixup
*fix
, int action
)
7638 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7639 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
7640 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
7644 static const struct hda_fixup alc861vd_fixups
[] = {
7645 [ALC660VD_FIX_ASUS_GPIO1
] = {
7646 .type
= HDA_FIXUP_VERBS
,
7647 .v
.verbs
= (const struct hda_verb
[]) {
7649 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
7650 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
7651 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
7655 [ALC861VD_FIX_DALLAS
] = {
7656 .type
= HDA_FIXUP_FUNC
,
7657 .v
.func
= alc861vd_fixup_dallas
,
7661 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
7662 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
7663 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
7664 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
7670 static int patch_alc861vd(struct hda_codec
*codec
)
7672 struct alc_spec
*spec
;
7675 err
= alc_alloc_spec(codec
, 0x0b);
7680 spec
->gen
.beep_nid
= 0x23;
7682 spec
->shutup
= alc_eapd_shutup
;
7684 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
7685 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7687 /* automatic parse from the BIOS config */
7688 err
= alc861vd_parse_auto_config(codec
);
7692 if (!spec
->gen
.no_analog
)
7693 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
7695 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7707 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
7708 * configuration. Each pin widget can choose any input DACs and a mixer.
7709 * Each ADC is connected from a mixer of all inputs. This makes possible
7710 * 6-channel independent captures.
7712 * In addition, an independent DAC for the multi-playback (not used in this
7717 * BIOS auto configuration
7720 static int alc662_parse_auto_config(struct hda_codec
*codec
)
7722 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
7723 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
7724 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7725 const hda_nid_t
*ssids
;
7727 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
7728 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
7729 codec
->core
.vendor_id
== 0x10ec0671)
7730 ssids
= alc663_ssids
;
7732 ssids
= alc662_ssids
;
7733 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
7736 static void alc272_fixup_mario(struct hda_codec
*codec
,
7737 const struct hda_fixup
*fix
, int action
)
7739 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
7741 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
7742 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
7743 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
7744 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
7745 (0 << AC_AMPCAP_MUTE_SHIFT
)))
7746 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
7749 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
7751 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
7753 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
7754 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
7758 /* override the 2.1 chmap */
7759 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
7760 const struct hda_fixup
*fix
, int action
)
7762 if (action
== HDA_FIXUP_ACT_BUILD
) {
7763 struct alc_spec
*spec
= codec
->spec
;
7764 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
7768 /* avoid D3 for keeping GPIO up */
7769 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
7771 unsigned int power_state
)
7773 struct alc_spec
*spec
= codec
->spec
;
7774 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
7779 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
7780 const struct hda_fixup
*fix
, int action
)
7782 struct alc_spec
*spec
= codec
->spec
;
7783 static const struct hda_verb gpio_init
[] = {
7784 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
7785 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
7789 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7790 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
7792 spec
->mute_led_polarity
= 1;
7793 spec
->gpio_mute_led_mask
= 0x01;
7794 snd_hda_add_verbs(codec
, gpio_init
);
7795 codec
->power_filter
= gpio_led_power_filter
;
7799 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
7800 struct hda_jack_callback
*jack
)
7802 struct alc_spec
*spec
= codec
->spec
;
7805 snd_hda_gen_hp_automute(codec
, jack
);
7807 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
7809 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
7813 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
7814 const struct hda_fixup
*fix
, int action
)
7816 struct alc_spec
*spec
= codec
->spec
;
7817 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7818 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
7819 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
7823 static struct coef_fw alc668_coefs
[] = {
7824 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
7825 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
7826 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
7827 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
7828 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
7829 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
7830 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
7831 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
7832 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
7833 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
7834 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
7835 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
7836 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
7837 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
7838 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
7839 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
7840 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
7841 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
7842 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
7843 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
7847 static void alc668_restore_default_value(struct hda_codec
*codec
)
7849 alc_process_coef_fw(codec
, alc668_coefs
);
7853 ALC662_FIXUP_ASPIRE
,
7854 ALC662_FIXUP_LED_GPIO1
,
7855 ALC662_FIXUP_IDEAPAD
,
7857 ALC662_FIXUP_CZC_P10T
,
7858 ALC662_FIXUP_SKU_IGNORE
,
7859 ALC662_FIXUP_HP_RP5800
,
7860 ALC662_FIXUP_ASUS_MODE1
,
7861 ALC662_FIXUP_ASUS_MODE2
,
7862 ALC662_FIXUP_ASUS_MODE3
,
7863 ALC662_FIXUP_ASUS_MODE4
,
7864 ALC662_FIXUP_ASUS_MODE5
,
7865 ALC662_FIXUP_ASUS_MODE6
,
7866 ALC662_FIXUP_ASUS_MODE7
,
7867 ALC662_FIXUP_ASUS_MODE8
,
7868 ALC662_FIXUP_NO_JACK_DETECT
,
7869 ALC662_FIXUP_ZOTAC_Z68
,
7870 ALC662_FIXUP_INV_DMIC
,
7871 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
7872 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
7873 ALC662_FIXUP_HEADSET_MODE
,
7874 ALC668_FIXUP_HEADSET_MODE
,
7875 ALC662_FIXUP_BASS_MODE4_CHMAP
,
7876 ALC662_FIXUP_BASS_16
,
7877 ALC662_FIXUP_BASS_1A
,
7878 ALC662_FIXUP_BASS_CHMAP
,
7879 ALC668_FIXUP_AUTO_MUTE
,
7880 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
7881 ALC668_FIXUP_DELL_XPS13
,
7882 ALC662_FIXUP_ASUS_Nx50
,
7883 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
7884 ALC668_FIXUP_ASUS_Nx51
,
7885 ALC891_FIXUP_HEADSET_MODE
,
7886 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
7887 ALC662_FIXUP_ACER_VERITON
,
7888 ALC892_FIXUP_ASROCK_MOBO
,
7889 ALC662_FIXUP_USI_FUNC
,
7890 ALC662_FIXUP_USI_HEADSET_MODE
,
7891 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
7894 static const struct hda_fixup alc662_fixups
[] = {
7895 [ALC662_FIXUP_ASPIRE
] = {
7896 .type
= HDA_FIXUP_PINS
,
7897 .v
.pins
= (const struct hda_pintbl
[]) {
7898 { 0x15, 0x99130112 }, /* subwoofer */
7902 [ALC662_FIXUP_LED_GPIO1
] = {
7903 .type
= HDA_FIXUP_FUNC
,
7904 .v
.func
= alc662_fixup_led_gpio1
,
7906 [ALC662_FIXUP_IDEAPAD
] = {
7907 .type
= HDA_FIXUP_PINS
,
7908 .v
.pins
= (const struct hda_pintbl
[]) {
7909 { 0x17, 0x99130112 }, /* subwoofer */
7913 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
7915 [ALC272_FIXUP_MARIO
] = {
7916 .type
= HDA_FIXUP_FUNC
,
7917 .v
.func
= alc272_fixup_mario
,
7919 [ALC662_FIXUP_CZC_P10T
] = {
7920 .type
= HDA_FIXUP_VERBS
,
7921 .v
.verbs
= (const struct hda_verb
[]) {
7922 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
7926 [ALC662_FIXUP_SKU_IGNORE
] = {
7927 .type
= HDA_FIXUP_FUNC
,
7928 .v
.func
= alc_fixup_sku_ignore
,
7930 [ALC662_FIXUP_HP_RP5800
] = {
7931 .type
= HDA_FIXUP_PINS
,
7932 .v
.pins
= (const struct hda_pintbl
[]) {
7933 { 0x14, 0x0221201f }, /* HP out */
7937 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7939 [ALC662_FIXUP_ASUS_MODE1
] = {
7940 .type
= HDA_FIXUP_PINS
,
7941 .v
.pins
= (const struct hda_pintbl
[]) {
7942 { 0x14, 0x99130110 }, /* speaker */
7943 { 0x18, 0x01a19c20 }, /* mic */
7944 { 0x19, 0x99a3092f }, /* int-mic */
7945 { 0x21, 0x0121401f }, /* HP out */
7949 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7951 [ALC662_FIXUP_ASUS_MODE2
] = {
7952 .type
= HDA_FIXUP_PINS
,
7953 .v
.pins
= (const struct hda_pintbl
[]) {
7954 { 0x14, 0x99130110 }, /* speaker */
7955 { 0x18, 0x01a19820 }, /* mic */
7956 { 0x19, 0x99a3092f }, /* int-mic */
7957 { 0x1b, 0x0121401f }, /* HP out */
7961 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7963 [ALC662_FIXUP_ASUS_MODE3
] = {
7964 .type
= HDA_FIXUP_PINS
,
7965 .v
.pins
= (const struct hda_pintbl
[]) {
7966 { 0x14, 0x99130110 }, /* speaker */
7967 { 0x15, 0x0121441f }, /* HP */
7968 { 0x18, 0x01a19840 }, /* mic */
7969 { 0x19, 0x99a3094f }, /* int-mic */
7970 { 0x21, 0x01211420 }, /* HP2 */
7974 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7976 [ALC662_FIXUP_ASUS_MODE4
] = {
7977 .type
= HDA_FIXUP_PINS
,
7978 .v
.pins
= (const struct hda_pintbl
[]) {
7979 { 0x14, 0x99130110 }, /* speaker */
7980 { 0x16, 0x99130111 }, /* speaker */
7981 { 0x18, 0x01a19840 }, /* mic */
7982 { 0x19, 0x99a3094f }, /* int-mic */
7983 { 0x21, 0x0121441f }, /* HP */
7987 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7989 [ALC662_FIXUP_ASUS_MODE5
] = {
7990 .type
= HDA_FIXUP_PINS
,
7991 .v
.pins
= (const struct hda_pintbl
[]) {
7992 { 0x14, 0x99130110 }, /* speaker */
7993 { 0x15, 0x0121441f }, /* HP */
7994 { 0x16, 0x99130111 }, /* speaker */
7995 { 0x18, 0x01a19840 }, /* mic */
7996 { 0x19, 0x99a3094f }, /* int-mic */
8000 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8002 [ALC662_FIXUP_ASUS_MODE6
] = {
8003 .type
= HDA_FIXUP_PINS
,
8004 .v
.pins
= (const struct hda_pintbl
[]) {
8005 { 0x14, 0x99130110 }, /* speaker */
8006 { 0x15, 0x01211420 }, /* HP2 */
8007 { 0x18, 0x01a19840 }, /* mic */
8008 { 0x19, 0x99a3094f }, /* int-mic */
8009 { 0x1b, 0x0121441f }, /* HP */
8013 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8015 [ALC662_FIXUP_ASUS_MODE7
] = {
8016 .type
= HDA_FIXUP_PINS
,
8017 .v
.pins
= (const struct hda_pintbl
[]) {
8018 { 0x14, 0x99130110 }, /* speaker */
8019 { 0x17, 0x99130111 }, /* speaker */
8020 { 0x18, 0x01a19840 }, /* mic */
8021 { 0x19, 0x99a3094f }, /* int-mic */
8022 { 0x1b, 0x01214020 }, /* HP */
8023 { 0x21, 0x0121401f }, /* HP */
8027 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8029 [ALC662_FIXUP_ASUS_MODE8
] = {
8030 .type
= HDA_FIXUP_PINS
,
8031 .v
.pins
= (const struct hda_pintbl
[]) {
8032 { 0x14, 0x99130110 }, /* speaker */
8033 { 0x12, 0x99a30970 }, /* int-mic */
8034 { 0x15, 0x01214020 }, /* HP */
8035 { 0x17, 0x99130111 }, /* speaker */
8036 { 0x18, 0x01a19840 }, /* mic */
8037 { 0x21, 0x0121401f }, /* HP */
8041 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8043 [ALC662_FIXUP_NO_JACK_DETECT
] = {
8044 .type
= HDA_FIXUP_FUNC
,
8045 .v
.func
= alc_fixup_no_jack_detect
,
8047 [ALC662_FIXUP_ZOTAC_Z68
] = {
8048 .type
= HDA_FIXUP_PINS
,
8049 .v
.pins
= (const struct hda_pintbl
[]) {
8050 { 0x1b, 0x02214020 }, /* Front HP */
8054 [ALC662_FIXUP_INV_DMIC
] = {
8055 .type
= HDA_FIXUP_FUNC
,
8056 .v
.func
= alc_fixup_inv_dmic
,
8058 [ALC668_FIXUP_DELL_XPS13
] = {
8059 .type
= HDA_FIXUP_FUNC
,
8060 .v
.func
= alc_fixup_dell_xps13
,
8062 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
8064 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
8065 .type
= HDA_FIXUP_FUNC
,
8066 .v
.func
= alc_fixup_disable_aamix
,
8068 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8070 [ALC668_FIXUP_AUTO_MUTE
] = {
8071 .type
= HDA_FIXUP_FUNC
,
8072 .v
.func
= alc_fixup_auto_mute_via_amp
,
8074 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8076 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8077 .type
= HDA_FIXUP_PINS
,
8078 .v
.pins
= (const struct hda_pintbl
[]) {
8079 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8080 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8084 .chain_id
= ALC662_FIXUP_HEADSET_MODE
8086 [ALC662_FIXUP_HEADSET_MODE
] = {
8087 .type
= HDA_FIXUP_FUNC
,
8088 .v
.func
= alc_fixup_headset_mode_alc662
,
8090 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8091 .type
= HDA_FIXUP_PINS
,
8092 .v
.pins
= (const struct hda_pintbl
[]) {
8093 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8094 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8098 .chain_id
= ALC668_FIXUP_HEADSET_MODE
8100 [ALC668_FIXUP_HEADSET_MODE
] = {
8101 .type
= HDA_FIXUP_FUNC
,
8102 .v
.func
= alc_fixup_headset_mode_alc668
,
8104 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
8105 .type
= HDA_FIXUP_FUNC
,
8106 .v
.func
= alc_fixup_bass_chmap
,
8108 .chain_id
= ALC662_FIXUP_ASUS_MODE4
8110 [ALC662_FIXUP_BASS_16
] = {
8111 .type
= HDA_FIXUP_PINS
,
8112 .v
.pins
= (const struct hda_pintbl
[]) {
8113 {0x16, 0x80106111}, /* bass speaker */
8117 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8119 [ALC662_FIXUP_BASS_1A
] = {
8120 .type
= HDA_FIXUP_PINS
,
8121 .v
.pins
= (const struct hda_pintbl
[]) {
8122 {0x1a, 0x80106111}, /* bass speaker */
8126 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8128 [ALC662_FIXUP_BASS_CHMAP
] = {
8129 .type
= HDA_FIXUP_FUNC
,
8130 .v
.func
= alc_fixup_bass_chmap
,
8132 [ALC662_FIXUP_ASUS_Nx50
] = {
8133 .type
= HDA_FIXUP_FUNC
,
8134 .v
.func
= alc_fixup_auto_mute_via_amp
,
8136 .chain_id
= ALC662_FIXUP_BASS_1A
8138 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
8139 .type
= HDA_FIXUP_FUNC
,
8140 .v
.func
= alc_fixup_headset_mode_alc668
,
8141 .chain_id
= ALC662_FIXUP_BASS_CHMAP
8143 [ALC668_FIXUP_ASUS_Nx51
] = {
8144 .type
= HDA_FIXUP_PINS
,
8145 .v
.pins
= (const struct hda_pintbl
[]) {
8146 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8147 { 0x1a, 0x90170151 }, /* bass speaker */
8148 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8152 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8154 [ALC891_FIXUP_HEADSET_MODE
] = {
8155 .type
= HDA_FIXUP_FUNC
,
8156 .v
.func
= alc_fixup_headset_mode
,
8158 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8159 .type
= HDA_FIXUP_PINS
,
8160 .v
.pins
= (const struct hda_pintbl
[]) {
8161 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8162 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8166 .chain_id
= ALC891_FIXUP_HEADSET_MODE
8168 [ALC662_FIXUP_ACER_VERITON
] = {
8169 .type
= HDA_FIXUP_PINS
,
8170 .v
.pins
= (const struct hda_pintbl
[]) {
8171 { 0x15, 0x50170120 }, /* no internal speaker */
8175 [ALC892_FIXUP_ASROCK_MOBO
] = {
8176 .type
= HDA_FIXUP_PINS
,
8177 .v
.pins
= (const struct hda_pintbl
[]) {
8178 { 0x15, 0x40f000f0 }, /* disabled */
8179 { 0x16, 0x40f000f0 }, /* disabled */
8183 [ALC662_FIXUP_USI_FUNC
] = {
8184 .type
= HDA_FIXUP_FUNC
,
8185 .v
.func
= alc662_fixup_usi_headset_mic
,
8187 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
8188 .type
= HDA_FIXUP_PINS
,
8189 .v
.pins
= (const struct hda_pintbl
[]) {
8190 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8191 { 0x18, 0x01a1903d },
8195 .chain_id
= ALC662_FIXUP_USI_FUNC
8197 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
8198 .type
= HDA_FIXUP_FUNC
,
8199 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
8203 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
8204 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
8205 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
8206 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
8207 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
8208 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
8209 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
8210 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
8211 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
8212 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8213 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8214 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
8215 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
8216 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
8217 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8218 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8219 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8220 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8221 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8222 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
8223 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
8224 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
8225 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
8226 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
8227 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8228 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
8229 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
8230 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
8231 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
8232 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
8233 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8234 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
8235 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
8236 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
8237 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
8238 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
8239 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
8240 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
8241 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
8242 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
8243 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
8244 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
8247 /* Below is a quirk table taken from the old code.
8248 * Basically the device should work as is without the fixup table.
8249 * If BIOS doesn't give a proper info, enable the corresponding
8252 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
8253 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
8254 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
8255 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
8256 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8257 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8258 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8259 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
8260 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
8261 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8262 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
8263 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
8264 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
8265 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
8266 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
8267 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8268 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
8269 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
8270 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8271 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8272 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8273 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8274 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
8275 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
8276 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
8277 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8278 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
8279 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8280 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8281 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
8282 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8283 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8284 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
8285 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
8286 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
8287 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
8288 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
8289 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
8290 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
8291 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8292 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
8293 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
8294 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8295 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
8296 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
8297 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
8298 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
8299 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
8300 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8301 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
8306 static const struct hda_model_fixup alc662_fixup_models
[] = {
8307 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
8308 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
8309 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
8310 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
8311 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
8312 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
8313 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
8314 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
8315 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
8316 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
8317 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
8318 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
8322 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
8323 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8327 {0x21, 0x01014020}),
8328 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8332 {0x1b, 0x0221401f}),
8333 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8337 {0x16, 0x03011020}),
8338 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8342 {0x16, 0x03011020}),
8343 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8347 {0x16, 0x03011020}),
8348 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8351 {0x16, 0x03011020}),
8352 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
8355 {0x15, 0x0321101f}),
8361 static int patch_alc662(struct hda_codec
*codec
)
8363 struct alc_spec
*spec
;
8366 err
= alc_alloc_spec(codec
, 0x0b);
8372 spec
->shutup
= alc_eapd_shutup
;
8374 /* handle multiple HPs as is */
8375 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
8377 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
8379 switch (codec
->core
.vendor_id
) {
8381 spec
->init_hook
= alc668_restore_default_value
;
8385 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
8386 alc662_fixup_tbl
, alc662_fixups
);
8387 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
8388 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8390 alc_auto_parse_customize_define(codec
);
8392 if (has_cdefine_beep(codec
))
8393 spec
->gen
.beep_nid
= 0x01;
8395 if ((alc_get_coef0(codec
) & (1 << 14)) &&
8396 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
8397 spec
->cdefine
.platform_type
== 1) {
8398 err
= alc_codec_rename(codec
, "ALC272X");
8403 /* automatic parse from the BIOS config */
8404 err
= alc662_parse_auto_config(codec
);
8408 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
8409 switch (codec
->core
.vendor_id
) {
8411 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8417 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
8420 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
8425 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8438 static int alc680_parse_auto_config(struct hda_codec
*codec
)
8440 return alc_parse_auto_config(codec
, NULL
, NULL
);
8445 static int patch_alc680(struct hda_codec
*codec
)
8449 /* ALC680 has no aa-loopback mixer */
8450 err
= alc_alloc_spec(codec
, 0);
8454 /* automatic parse from the BIOS config */
8455 err
= alc680_parse_auto_config(codec
);
8467 static const struct hda_device_id snd_hda_id_realtek
[] = {
8468 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
8469 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
8470 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
8471 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
8472 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
8473 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
8474 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
8475 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
8476 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
8477 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
8478 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269
),
8479 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
8480 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
8481 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
8482 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
8483 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
8484 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
8485 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
8486 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
8487 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
8488 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
8489 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
8490 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
8491 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
8492 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
8493 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
8494 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
8495 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
8496 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
8497 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
8498 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
8499 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
8500 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
8501 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
8502 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
8503 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
8504 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
8505 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
8506 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
8507 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
8508 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
8509 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
8510 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
8511 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
8512 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
8513 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
8514 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
8515 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
8516 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
8517 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
8518 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
8519 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
8520 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
8521 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
8522 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
8523 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
8524 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
8525 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
8526 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
8527 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
8528 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
8529 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
8530 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
8531 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
8532 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
8533 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
8534 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
8535 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882
),
8536 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
8539 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
8541 MODULE_LICENSE("GPL");
8542 MODULE_DESCRIPTION("Realtek HD-audio codec");
8544 static struct hda_codec_driver realtek_driver
= {
8545 .id
= snd_hda_id_realtek
,
8548 module_hda_codec_driver(realtek_driver
);