2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for Realtek ALC codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@just42.net>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <linux/dmi.h>
31 #include <linux/module.h>
32 #include <linux/input.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include "hda_codec.h"
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
39 #include "hda_generic.h"
41 /* keep halting ALC5505 DSP, for power saving */
42 #define HALT_REALTEK_ALC5505
44 /* extra amp-initialization sequence types */
54 ALC_HEADSET_MODE_UNKNOWN
,
55 ALC_HEADSET_MODE_UNPLUGGED
,
56 ALC_HEADSET_MODE_HEADSET
,
58 ALC_HEADSET_MODE_HEADPHONE
,
62 ALC_HEADSET_TYPE_UNKNOWN
,
63 ALC_HEADSET_TYPE_CTIA
,
64 ALC_HEADSET_TYPE_OMTP
,
68 ALC_KEY_MICMUTE_INDEX
,
71 struct alc_customize_define
{
73 unsigned char port_connectivity
;
74 unsigned char check_sum
;
75 unsigned char customization
;
76 unsigned char external_amp
;
77 unsigned int enable_pcbeep
:1;
78 unsigned int platform_type
:1;
80 unsigned int override
:1;
81 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
85 struct hda_gen_spec gen
; /* must be at head */
87 /* codec parameterization */
88 const struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
89 unsigned int num_mixers
;
90 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
92 struct alc_customize_define cdefine
;
93 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
95 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
96 int mute_led_polarity
;
97 hda_nid_t mute_led_nid
;
98 hda_nid_t cap_mute_led_nid
;
100 unsigned int gpio_led
; /* used for alc269_fixup_hp_gpio_led() */
101 unsigned int gpio_mute_led_mask
;
102 unsigned int gpio_mic_led_mask
;
104 hda_nid_t headset_mic_pin
;
105 hda_nid_t headphone_mic_pin
;
106 int current_headset_mode
;
107 int current_headset_type
;
110 void (*init_hook
)(struct hda_codec
*codec
);
112 void (*power_hook
)(struct hda_codec
*codec
);
114 void (*shutup
)(struct hda_codec
*codec
);
115 void (*reboot_notify
)(struct hda_codec
*codec
);
118 int codec_variant
; /* flag for other variants */
119 unsigned int has_alc5505_dsp
:1;
120 unsigned int no_depop_delay
:1;
121 unsigned int done_hp_init
:1;
122 unsigned int no_shutup_pins
:1;
126 unsigned int pll_coef_idx
, pll_coef_bit
;
128 struct input_dev
*kb_dev
;
129 u8 alc_mute_keycode_map
[1];
133 * COEF access helper functions
136 static int alc_read_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
137 unsigned int coef_idx
)
141 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
142 val
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
146 #define alc_read_coef_idx(codec, coef_idx) \
147 alc_read_coefex_idx(codec, 0x20, coef_idx)
149 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
150 unsigned int coef_idx
, unsigned int coef_val
)
152 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
153 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
, coef_val
);
156 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
157 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
159 static void alc_update_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
160 unsigned int coef_idx
, unsigned int mask
,
161 unsigned int bits_set
)
163 unsigned int val
= alc_read_coefex_idx(codec
, nid
, coef_idx
);
166 alc_write_coefex_idx(codec
, nid
, coef_idx
,
167 (val
& ~mask
) | bits_set
);
170 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
171 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
173 /* a special bypass for COEF 0; read the cached value at the second time */
174 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
176 struct alc_spec
*spec
= codec
->spec
;
179 spec
->coef0
= alc_read_coef_idx(codec
, 0);
183 /* coef writes/updates batch */
191 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
192 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
193 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
194 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
195 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
197 static void alc_process_coef_fw(struct hda_codec
*codec
,
198 const struct coef_fw
*fw
)
200 for (; fw
->nid
; fw
++) {
201 if (fw
->mask
== (unsigned short)-1)
202 alc_write_coefex_idx(codec
, fw
->nid
, fw
->idx
, fw
->val
);
204 alc_update_coefex_idx(codec
, fw
->nid
, fw
->idx
,
210 * Append the given mixer and verb elements for the later use
211 * The mixer array is referred in build_controls(), and init_verbs are
214 static void add_mixer(struct alc_spec
*spec
, const struct snd_kcontrol_new
*mix
)
216 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
218 spec
->mixers
[spec
->num_mixers
++] = mix
;
222 * GPIO setup tables, used in initialization
224 /* Enable GPIO mask and set output */
225 static const struct hda_verb alc_gpio1_init_verbs
[] = {
226 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
227 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
228 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
232 static const struct hda_verb alc_gpio2_init_verbs
[] = {
233 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
234 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
235 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
239 static const struct hda_verb alc_gpio3_init_verbs
[] = {
240 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
241 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
242 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
247 * Fix hardware PLL issue
248 * On some codecs, the analog PLL gating control must be off while
249 * the default value is 1.
251 static void alc_fix_pll(struct hda_codec
*codec
)
253 struct alc_spec
*spec
= codec
->spec
;
256 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
257 1 << spec
->pll_coef_bit
, 0);
260 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
261 unsigned int coef_idx
, unsigned int coef_bit
)
263 struct alc_spec
*spec
= codec
->spec
;
265 spec
->pll_coef_idx
= coef_idx
;
266 spec
->pll_coef_bit
= coef_bit
;
270 /* update the master volume per volume-knob's unsol event */
271 static void alc_update_knob_master(struct hda_codec
*codec
,
272 struct hda_jack_callback
*jack
)
275 struct snd_kcontrol
*kctl
;
276 struct snd_ctl_elem_value
*uctl
;
278 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
281 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
284 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
285 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
286 val
&= HDA_AMP_VOLMASK
;
287 uctl
->value
.integer
.value
[0] = val
;
288 uctl
->value
.integer
.value
[1] = val
;
289 kctl
->put(kctl
, uctl
);
293 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
295 /* For some reason, the res given from ALC880 is broken.
296 Here we adjust it properly. */
297 snd_hda_jack_unsol_event(codec
, res
>> 2);
300 /* Change EAPD to verb control */
301 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
305 coef
= alc_get_coef0(codec
);
307 switch (codec
->core
.vendor_id
) {
309 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
313 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
316 if ((coef
& 0x00f0) == 0x0010)
317 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
318 if ((coef
& 0x00f0) == 0x0020)
319 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
320 if ((coef
& 0x00f0) == 0x0030)
321 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
327 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
332 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
349 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
352 alc_update_coef_idx(codec
, 0xe, 0, 1<<0);
355 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
363 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
366 if ((coef
& 0x00f0) == 0x0030)
367 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
376 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
379 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
382 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
385 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
386 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
389 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
395 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
400 /* additional initialization for ALC888 variants */
401 static void alc888_coef_init(struct hda_codec
*codec
)
403 switch (alc_get_coef0(codec
) & 0x00f0) {
408 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
413 /* turn on/off EAPD control (only if available) */
414 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
416 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
418 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
419 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
423 /* turn on/off EAPD controls of the codec */
424 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
426 /* We currently only handle front, HP */
427 static hda_nid_t pins
[] = {
428 0x0f, 0x10, 0x14, 0x15, 0x17, 0
431 for (p
= pins
; *p
; p
++)
432 set_eapd(codec
, *p
, on
);
435 static int find_ext_mic_pin(struct hda_codec
*codec
);
437 static void alc_headset_mic_no_shutup(struct hda_codec
*codec
)
439 const struct hda_pincfg
*pin
;
440 int mic_pin
= find_ext_mic_pin(codec
);
443 /* don't shut up pins when unloading the driver; otherwise it breaks
444 * the default pin setup at the next load of the driver
446 if (codec
->bus
->shutdown
)
449 for (i
= 0; i
< codec
->init_pins
.used
; i
++) {
450 pin
= snd_array_elem(&codec
->init_pins
, i
);
451 /* use read here for syncing after issuing each verb */
452 if (pin
->nid
!= mic_pin
)
453 snd_hda_codec_read(codec
, pin
->nid
, 0,
454 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
457 codec
->pins_shutup
= 1;
460 static void alc_shutup_pins(struct hda_codec
*codec
)
462 struct alc_spec
*spec
= codec
->spec
;
464 switch (codec
->core
.vendor_id
) {
468 alc_headset_mic_no_shutup(codec
);
471 if (!spec
->no_shutup_pins
)
472 snd_hda_shutup_pins(codec
);
477 /* generic shutup callback;
478 * just turning off EAPD and a little pause for avoiding pop-noise
480 static void alc_eapd_shutup(struct hda_codec
*codec
)
482 struct alc_spec
*spec
= codec
->spec
;
484 alc_auto_setup_eapd(codec
, false);
485 if (!spec
->no_depop_delay
)
487 alc_shutup_pins(codec
);
490 /* generic EAPD initialization */
491 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
493 alc_fill_eapd_coef(codec
);
494 alc_auto_setup_eapd(codec
, true);
497 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
500 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
503 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
505 case ALC_INIT_DEFAULT
:
506 switch (codec
->core
.vendor_id
) {
508 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
514 alc_update_coef_idx(codec
, 7, 0, 0x2030);
517 alc888_coef_init(codec
);
524 /* get a primary headphone pin if available */
525 static hda_nid_t
alc_get_hp_pin(struct alc_spec
*spec
)
527 if (spec
->gen
.autocfg
.hp_pins
[0])
528 return spec
->gen
.autocfg
.hp_pins
[0];
529 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
530 return spec
->gen
.autocfg
.line_out_pins
[0];
535 * Realtek SSID verification
538 /* Could be any non-zero and even value. When used as fixup, tells
539 * the driver to ignore any present sku defines.
541 #define ALC_FIXUP_SKU_IGNORE (2)
543 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
544 const struct hda_fixup
*fix
, int action
)
546 struct alc_spec
*spec
= codec
->spec
;
547 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
548 spec
->cdefine
.fixup
= 1;
549 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
553 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
554 const struct hda_fixup
*fix
, int action
)
556 struct alc_spec
*spec
= codec
->spec
;
558 if (action
== HDA_FIXUP_ACT_PROBE
) {
559 spec
->no_depop_delay
= 1;
560 codec
->depop_delay
= 0;
564 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
566 unsigned int ass
, tmp
, i
;
568 struct alc_spec
*spec
= codec
->spec
;
570 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
572 if (spec
->cdefine
.fixup
) {
573 ass
= spec
->cdefine
.sku_cfg
;
574 if (ass
== ALC_FIXUP_SKU_IGNORE
)
579 if (!codec
->bus
->pci
)
581 ass
= codec
->core
.subsystem_id
& 0xffff;
582 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
586 if (codec
->core
.vendor_id
== 0x10ec0260)
588 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
591 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
592 codec
->core
.chip_name
, ass
);
598 for (i
= 1; i
< 16; i
++) {
602 if (((ass
>> 16) & 0xf) != tmp
)
605 spec
->cdefine
.port_connectivity
= ass
>> 30;
606 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
607 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
608 spec
->cdefine
.customization
= ass
>> 8;
610 spec
->cdefine
.sku_cfg
= ass
;
611 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
612 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
613 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
614 spec
->cdefine
.override
= ass
& 0x1;
616 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
617 nid
, spec
->cdefine
.sku_cfg
);
618 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
619 spec
->cdefine
.port_connectivity
);
620 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
621 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
622 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
623 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
624 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
625 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
626 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
631 /* return the position of NID in the list, or -1 if not found */
632 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
635 for (i
= 0; i
< nums
; i
++)
640 /* return true if the given NID is found in the list */
641 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
643 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
646 /* check subsystem ID and set up device-specific initialization;
647 * return 1 if initialized, 0 if invalid SSID
649 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
650 * 31 ~ 16 : Manufacture ID
652 * 7 ~ 0 : Assembly ID
653 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
655 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
657 unsigned int ass
, tmp
, i
;
659 struct alc_spec
*spec
= codec
->spec
;
661 if (spec
->cdefine
.fixup
) {
662 ass
= spec
->cdefine
.sku_cfg
;
663 if (ass
== ALC_FIXUP_SKU_IGNORE
)
668 ass
= codec
->core
.subsystem_id
& 0xffff;
669 if (codec
->bus
->pci
&&
670 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
673 /* invalid SSID, check the special NID pin defcfg instead */
675 * 31~30 : port connectivity
678 * 19~16 : Check sum (15:1)
683 if (codec
->core
.vendor_id
== 0x10ec0260)
685 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
687 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
691 if ((ass
>> 30) != 1) /* no physical connection */
696 for (i
= 1; i
< 16; i
++) {
700 if (((ass
>> 16) & 0xf) != tmp
)
703 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
704 ass
& 0xffff, codec
->core
.vendor_id
);
708 * 2 : 0 --> Desktop, 1 --> Laptop
709 * 3~5 : External Amplifier control
712 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
715 spec
->init_amp
= ALC_INIT_GPIO1
;
718 spec
->init_amp
= ALC_INIT_GPIO2
;
721 spec
->init_amp
= ALC_INIT_GPIO3
;
725 spec
->init_amp
= ALC_INIT_DEFAULT
;
729 /* is laptop or Desktop and enable the function "Mute internal speaker
730 * when the external headphone out jack is plugged"
735 * 10~8 : Jack location
736 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
738 * 15 : 1 --> enable the function "Mute internal speaker
739 * when the external headphone out jack is plugged"
741 if (!alc_get_hp_pin(spec
)) {
743 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
745 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
746 spec
->gen
.autocfg
.line_outs
))
748 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
753 /* Check the validity of ALC subsystem-id
754 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
755 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
757 if (!alc_subsystem_id(codec
, ports
)) {
758 struct alc_spec
*spec
= codec
->spec
;
760 "realtek: Enable default setup for auto mode as fallback\n");
761 spec
->init_amp
= ALC_INIT_DEFAULT
;
768 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
769 const struct hda_fixup
*fix
, int action
)
771 struct alc_spec
*spec
= codec
->spec
;
773 spec
->gen
.inv_dmic_split
= 1;
777 #ifdef CONFIG_SND_HDA_INPUT_BEEP
778 /* additional beep mixers; the actual parameters are overwritten at build */
779 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
780 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
781 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
786 static int alc_build_controls(struct hda_codec
*codec
)
788 struct alc_spec
*spec
= codec
->spec
;
791 err
= snd_hda_gen_build_controls(codec
);
795 for (i
= 0; i
< spec
->num_mixers
; i
++) {
796 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
801 #ifdef CONFIG_SND_HDA_INPUT_BEEP
802 /* create beep controls if needed */
803 if (spec
->beep_amp
) {
804 const struct snd_kcontrol_new
*knew
;
805 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
806 struct snd_kcontrol
*kctl
;
807 kctl
= snd_ctl_new1(knew
, codec
);
810 kctl
->private_value
= spec
->beep_amp
;
811 err
= snd_hda_ctl_add(codec
, 0, kctl
);
818 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
827 static int alc_init(struct hda_codec
*codec
)
829 struct alc_spec
*spec
= codec
->spec
;
832 spec
->init_hook(codec
);
835 alc_auto_init_amp(codec
, spec
->init_amp
);
837 snd_hda_gen_init(codec
);
839 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
844 static inline void alc_shutup(struct hda_codec
*codec
)
846 struct alc_spec
*spec
= codec
->spec
;
848 if (spec
&& spec
->shutup
)
851 alc_shutup_pins(codec
);
854 static void alc_reboot_notify(struct hda_codec
*codec
)
856 struct alc_spec
*spec
= codec
->spec
;
858 if (spec
&& spec
->reboot_notify
)
859 spec
->reboot_notify(codec
);
864 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
865 static void alc_d3_at_reboot(struct hda_codec
*codec
)
867 snd_hda_codec_set_power_to_all(codec
, codec
->core
.afg
, AC_PWRST_D3
);
868 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
869 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
873 #define alc_free snd_hda_gen_free
876 static void alc_power_eapd(struct hda_codec
*codec
)
878 alc_auto_setup_eapd(codec
, false);
881 static int alc_suspend(struct hda_codec
*codec
)
883 struct alc_spec
*spec
= codec
->spec
;
885 if (spec
&& spec
->power_hook
)
886 spec
->power_hook(codec
);
892 static int alc_resume(struct hda_codec
*codec
)
894 struct alc_spec
*spec
= codec
->spec
;
896 if (!spec
->no_depop_delay
)
897 msleep(150); /* to avoid pop noise */
898 codec
->patch_ops
.init(codec
);
899 regcache_sync(codec
->core
.regmap
);
900 hda_call_check_power_status(codec
, 0x01);
907 static const struct hda_codec_ops alc_patch_ops
= {
908 .build_controls
= alc_build_controls
,
909 .build_pcms
= snd_hda_gen_build_pcms
,
912 .unsol_event
= snd_hda_jack_unsol_event
,
914 .resume
= alc_resume
,
915 .suspend
= alc_suspend
,
916 .check_power_status
= snd_hda_gen_check_power_status
,
918 .reboot_notify
= alc_reboot_notify
,
922 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
925 * Rename codecs appropriately from COEF value or subvendor id
927 struct alc_codec_rename_table
{
928 unsigned int vendor_id
;
929 unsigned short coef_mask
;
930 unsigned short coef_bits
;
934 struct alc_codec_rename_pci_table
{
935 unsigned int codec_vendor_id
;
936 unsigned short pci_subvendor
;
937 unsigned short pci_subdevice
;
941 static struct alc_codec_rename_table rename_tbl
[] = {
942 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
943 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
944 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
945 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
946 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
947 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
948 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
949 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
950 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
951 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
952 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
953 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
954 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
955 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
956 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
957 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
958 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
962 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
963 { 0x10ec0280, 0x1028, 0, "ALC3220" },
964 { 0x10ec0282, 0x1028, 0, "ALC3221" },
965 { 0x10ec0283, 0x1028, 0, "ALC3223" },
966 { 0x10ec0288, 0x1028, 0, "ALC3263" },
967 { 0x10ec0292, 0x1028, 0, "ALC3226" },
968 { 0x10ec0293, 0x1028, 0, "ALC3235" },
969 { 0x10ec0255, 0x1028, 0, "ALC3234" },
970 { 0x10ec0668, 0x1028, 0, "ALC3661" },
971 { 0x10ec0275, 0x1028, 0, "ALC3260" },
972 { 0x10ec0899, 0x1028, 0, "ALC3861" },
973 { 0x10ec0298, 0x1028, 0, "ALC3266" },
974 { 0x10ec0236, 0x1028, 0, "ALC3204" },
975 { 0x10ec0256, 0x1028, 0, "ALC3246" },
976 { 0x10ec0225, 0x1028, 0, "ALC3253" },
977 { 0x10ec0295, 0x1028, 0, "ALC3254" },
978 { 0x10ec0299, 0x1028, 0, "ALC3271" },
979 { 0x10ec0670, 0x1025, 0, "ALC669X" },
980 { 0x10ec0676, 0x1025, 0, "ALC679X" },
981 { 0x10ec0282, 0x1043, 0, "ALC3229" },
982 { 0x10ec0233, 0x1043, 0, "ALC3236" },
983 { 0x10ec0280, 0x103c, 0, "ALC3228" },
984 { 0x10ec0282, 0x103c, 0, "ALC3227" },
985 { 0x10ec0286, 0x103c, 0, "ALC3242" },
986 { 0x10ec0290, 0x103c, 0, "ALC3241" },
987 { 0x10ec0668, 0x103c, 0, "ALC3662" },
988 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
989 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
993 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
995 const struct alc_codec_rename_table
*p
;
996 const struct alc_codec_rename_pci_table
*q
;
998 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
999 if (p
->vendor_id
!= codec
->core
.vendor_id
)
1001 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
1002 return alc_codec_rename(codec
, p
->name
);
1005 if (!codec
->bus
->pci
)
1007 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
1008 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
1010 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
1012 if (!q
->pci_subdevice
||
1013 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
1014 return alc_codec_rename(codec
, q
->name
);
1022 * Digital-beep handlers
1024 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1025 #define set_beep_amp(spec, nid, idx, dir) \
1026 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1028 static const struct snd_pci_quirk beep_white_list
[] = {
1029 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1030 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1031 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1032 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1033 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1034 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1035 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1036 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1037 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1041 static inline int has_cdefine_beep(struct hda_codec
*codec
)
1043 struct alc_spec
*spec
= codec
->spec
;
1044 const struct snd_pci_quirk
*q
;
1045 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
1048 return spec
->cdefine
.enable_pcbeep
;
1051 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
1052 #define has_cdefine_beep(codec) 0
1055 /* parse the BIOS configuration and set up the alc_spec */
1056 /* return 1 if successful, 0 if the proper config is not found,
1057 * or a negative error code
1059 static int alc_parse_auto_config(struct hda_codec
*codec
,
1060 const hda_nid_t
*ignore_nids
,
1061 const hda_nid_t
*ssid_nids
)
1063 struct alc_spec
*spec
= codec
->spec
;
1064 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1067 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1073 alc_ssid_check(codec
, ssid_nids
);
1075 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1082 /* common preparation job for alc_spec */
1083 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1085 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1091 snd_hda_gen_spec_init(&spec
->gen
);
1092 spec
->gen
.mixer_nid
= mixer_nid
;
1093 spec
->gen
.own_eapd_ctl
= 1;
1094 codec
->single_adc_amp
= 1;
1095 /* FIXME: do we need this for all Realtek codec models? */
1096 codec
->spdif_status_reset
= 1;
1097 codec
->patch_ops
= alc_patch_ops
;
1099 err
= alc_codec_rename_from_preset(codec
);
1107 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1109 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1110 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1111 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1120 ALC880_FIXUP_MEDION_RIM
,
1122 ALC880_FIXUP_LG_LW25
,
1124 ALC880_FIXUP_EAPD_COEF
,
1125 ALC880_FIXUP_TCL_S700
,
1126 ALC880_FIXUP_VOL_KNOB
,
1127 ALC880_FIXUP_FUJITSU
,
1129 ALC880_FIXUP_UNIWILL
,
1130 ALC880_FIXUP_UNIWILL_DIG
,
1132 ALC880_FIXUP_ASUS_W5A
,
1133 ALC880_FIXUP_3ST_BASE
,
1135 ALC880_FIXUP_3ST_DIG
,
1136 ALC880_FIXUP_5ST_BASE
,
1138 ALC880_FIXUP_5ST_DIG
,
1139 ALC880_FIXUP_6ST_BASE
,
1141 ALC880_FIXUP_6ST_DIG
,
1142 ALC880_FIXUP_6ST_AUTOMUTE
,
1145 /* enable the volume-knob widget support on NID 0x21 */
1146 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1147 const struct hda_fixup
*fix
, int action
)
1149 if (action
== HDA_FIXUP_ACT_PROBE
)
1150 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1151 alc_update_knob_master
);
1154 static const struct hda_fixup alc880_fixups
[] = {
1155 [ALC880_FIXUP_GPIO1
] = {
1156 .type
= HDA_FIXUP_VERBS
,
1157 .v
.verbs
= alc_gpio1_init_verbs
,
1159 [ALC880_FIXUP_GPIO2
] = {
1160 .type
= HDA_FIXUP_VERBS
,
1161 .v
.verbs
= alc_gpio2_init_verbs
,
1163 [ALC880_FIXUP_MEDION_RIM
] = {
1164 .type
= HDA_FIXUP_VERBS
,
1165 .v
.verbs
= (const struct hda_verb
[]) {
1166 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1167 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1171 .chain_id
= ALC880_FIXUP_GPIO2
,
1173 [ALC880_FIXUP_LG
] = {
1174 .type
= HDA_FIXUP_PINS
,
1175 .v
.pins
= (const struct hda_pintbl
[]) {
1176 /* disable bogus unused pins */
1177 { 0x16, 0x411111f0 },
1178 { 0x18, 0x411111f0 },
1179 { 0x1a, 0x411111f0 },
1183 [ALC880_FIXUP_LG_LW25
] = {
1184 .type
= HDA_FIXUP_PINS
,
1185 .v
.pins
= (const struct hda_pintbl
[]) {
1186 { 0x1a, 0x0181344f }, /* line-in */
1187 { 0x1b, 0x0321403f }, /* headphone */
1191 [ALC880_FIXUP_W810
] = {
1192 .type
= HDA_FIXUP_PINS
,
1193 .v
.pins
= (const struct hda_pintbl
[]) {
1194 /* disable bogus unused pins */
1195 { 0x17, 0x411111f0 },
1199 .chain_id
= ALC880_FIXUP_GPIO2
,
1201 [ALC880_FIXUP_EAPD_COEF
] = {
1202 .type
= HDA_FIXUP_VERBS
,
1203 .v
.verbs
= (const struct hda_verb
[]) {
1204 /* change to EAPD mode */
1205 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1206 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1210 [ALC880_FIXUP_TCL_S700
] = {
1211 .type
= HDA_FIXUP_VERBS
,
1212 .v
.verbs
= (const struct hda_verb
[]) {
1213 /* change to EAPD mode */
1214 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1215 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1219 .chain_id
= ALC880_FIXUP_GPIO2
,
1221 [ALC880_FIXUP_VOL_KNOB
] = {
1222 .type
= HDA_FIXUP_FUNC
,
1223 .v
.func
= alc880_fixup_vol_knob
,
1225 [ALC880_FIXUP_FUJITSU
] = {
1226 /* override all pins as BIOS on old Amilo is broken */
1227 .type
= HDA_FIXUP_PINS
,
1228 .v
.pins
= (const struct hda_pintbl
[]) {
1229 { 0x14, 0x0121401f }, /* HP */
1230 { 0x15, 0x99030120 }, /* speaker */
1231 { 0x16, 0x99030130 }, /* bass speaker */
1232 { 0x17, 0x411111f0 }, /* N/A */
1233 { 0x18, 0x411111f0 }, /* N/A */
1234 { 0x19, 0x01a19950 }, /* mic-in */
1235 { 0x1a, 0x411111f0 }, /* N/A */
1236 { 0x1b, 0x411111f0 }, /* N/A */
1237 { 0x1c, 0x411111f0 }, /* N/A */
1238 { 0x1d, 0x411111f0 }, /* N/A */
1239 { 0x1e, 0x01454140 }, /* SPDIF out */
1243 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1245 [ALC880_FIXUP_F1734
] = {
1246 /* almost compatible with FUJITSU, but no bass and SPDIF */
1247 .type
= HDA_FIXUP_PINS
,
1248 .v
.pins
= (const struct hda_pintbl
[]) {
1249 { 0x14, 0x0121401f }, /* HP */
1250 { 0x15, 0x99030120 }, /* speaker */
1251 { 0x16, 0x411111f0 }, /* N/A */
1252 { 0x17, 0x411111f0 }, /* N/A */
1253 { 0x18, 0x411111f0 }, /* N/A */
1254 { 0x19, 0x01a19950 }, /* mic-in */
1255 { 0x1a, 0x411111f0 }, /* N/A */
1256 { 0x1b, 0x411111f0 }, /* N/A */
1257 { 0x1c, 0x411111f0 }, /* N/A */
1258 { 0x1d, 0x411111f0 }, /* N/A */
1259 { 0x1e, 0x411111f0 }, /* N/A */
1263 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1265 [ALC880_FIXUP_UNIWILL
] = {
1266 /* need to fix HP and speaker pins to be parsed correctly */
1267 .type
= HDA_FIXUP_PINS
,
1268 .v
.pins
= (const struct hda_pintbl
[]) {
1269 { 0x14, 0x0121411f }, /* HP */
1270 { 0x15, 0x99030120 }, /* speaker */
1271 { 0x16, 0x99030130 }, /* bass speaker */
1275 [ALC880_FIXUP_UNIWILL_DIG
] = {
1276 .type
= HDA_FIXUP_PINS
,
1277 .v
.pins
= (const struct hda_pintbl
[]) {
1278 /* disable bogus unused pins */
1279 { 0x17, 0x411111f0 },
1280 { 0x19, 0x411111f0 },
1281 { 0x1b, 0x411111f0 },
1282 { 0x1f, 0x411111f0 },
1286 [ALC880_FIXUP_Z71V
] = {
1287 .type
= HDA_FIXUP_PINS
,
1288 .v
.pins
= (const struct hda_pintbl
[]) {
1289 /* set up the whole pins as BIOS is utterly broken */
1290 { 0x14, 0x99030120 }, /* speaker */
1291 { 0x15, 0x0121411f }, /* HP */
1292 { 0x16, 0x411111f0 }, /* N/A */
1293 { 0x17, 0x411111f0 }, /* N/A */
1294 { 0x18, 0x01a19950 }, /* mic-in */
1295 { 0x19, 0x411111f0 }, /* N/A */
1296 { 0x1a, 0x01813031 }, /* line-in */
1297 { 0x1b, 0x411111f0 }, /* N/A */
1298 { 0x1c, 0x411111f0 }, /* N/A */
1299 { 0x1d, 0x411111f0 }, /* N/A */
1300 { 0x1e, 0x0144111e }, /* SPDIF */
1304 [ALC880_FIXUP_ASUS_W5A
] = {
1305 .type
= HDA_FIXUP_PINS
,
1306 .v
.pins
= (const struct hda_pintbl
[]) {
1307 /* set up the whole pins as BIOS is utterly broken */
1308 { 0x14, 0x0121411f }, /* HP */
1309 { 0x15, 0x411111f0 }, /* N/A */
1310 { 0x16, 0x411111f0 }, /* N/A */
1311 { 0x17, 0x411111f0 }, /* N/A */
1312 { 0x18, 0x90a60160 }, /* mic */
1313 { 0x19, 0x411111f0 }, /* N/A */
1314 { 0x1a, 0x411111f0 }, /* N/A */
1315 { 0x1b, 0x411111f0 }, /* N/A */
1316 { 0x1c, 0x411111f0 }, /* N/A */
1317 { 0x1d, 0x411111f0 }, /* N/A */
1318 { 0x1e, 0xb743111e }, /* SPDIF out */
1322 .chain_id
= ALC880_FIXUP_GPIO1
,
1324 [ALC880_FIXUP_3ST_BASE
] = {
1325 .type
= HDA_FIXUP_PINS
,
1326 .v
.pins
= (const struct hda_pintbl
[]) {
1327 { 0x14, 0x01014010 }, /* line-out */
1328 { 0x15, 0x411111f0 }, /* N/A */
1329 { 0x16, 0x411111f0 }, /* N/A */
1330 { 0x17, 0x411111f0 }, /* N/A */
1331 { 0x18, 0x01a19c30 }, /* mic-in */
1332 { 0x19, 0x0121411f }, /* HP */
1333 { 0x1a, 0x01813031 }, /* line-in */
1334 { 0x1b, 0x02a19c40 }, /* front-mic */
1335 { 0x1c, 0x411111f0 }, /* N/A */
1336 { 0x1d, 0x411111f0 }, /* N/A */
1337 /* 0x1e is filled in below */
1338 { 0x1f, 0x411111f0 }, /* N/A */
1342 [ALC880_FIXUP_3ST
] = {
1343 .type
= HDA_FIXUP_PINS
,
1344 .v
.pins
= (const struct hda_pintbl
[]) {
1345 { 0x1e, 0x411111f0 }, /* N/A */
1349 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1351 [ALC880_FIXUP_3ST_DIG
] = {
1352 .type
= HDA_FIXUP_PINS
,
1353 .v
.pins
= (const struct hda_pintbl
[]) {
1354 { 0x1e, 0x0144111e }, /* SPDIF */
1358 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1360 [ALC880_FIXUP_5ST_BASE
] = {
1361 .type
= HDA_FIXUP_PINS
,
1362 .v
.pins
= (const struct hda_pintbl
[]) {
1363 { 0x14, 0x01014010 }, /* front */
1364 { 0x15, 0x411111f0 }, /* N/A */
1365 { 0x16, 0x01011411 }, /* CLFE */
1366 { 0x17, 0x01016412 }, /* surr */
1367 { 0x18, 0x01a19c30 }, /* mic-in */
1368 { 0x19, 0x0121411f }, /* HP */
1369 { 0x1a, 0x01813031 }, /* line-in */
1370 { 0x1b, 0x02a19c40 }, /* front-mic */
1371 { 0x1c, 0x411111f0 }, /* N/A */
1372 { 0x1d, 0x411111f0 }, /* N/A */
1373 /* 0x1e is filled in below */
1374 { 0x1f, 0x411111f0 }, /* N/A */
1378 [ALC880_FIXUP_5ST
] = {
1379 .type
= HDA_FIXUP_PINS
,
1380 .v
.pins
= (const struct hda_pintbl
[]) {
1381 { 0x1e, 0x411111f0 }, /* N/A */
1385 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1387 [ALC880_FIXUP_5ST_DIG
] = {
1388 .type
= HDA_FIXUP_PINS
,
1389 .v
.pins
= (const struct hda_pintbl
[]) {
1390 { 0x1e, 0x0144111e }, /* SPDIF */
1394 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1396 [ALC880_FIXUP_6ST_BASE
] = {
1397 .type
= HDA_FIXUP_PINS
,
1398 .v
.pins
= (const struct hda_pintbl
[]) {
1399 { 0x14, 0x01014010 }, /* front */
1400 { 0x15, 0x01016412 }, /* surr */
1401 { 0x16, 0x01011411 }, /* CLFE */
1402 { 0x17, 0x01012414 }, /* side */
1403 { 0x18, 0x01a19c30 }, /* mic-in */
1404 { 0x19, 0x02a19c40 }, /* front-mic */
1405 { 0x1a, 0x01813031 }, /* line-in */
1406 { 0x1b, 0x0121411f }, /* HP */
1407 { 0x1c, 0x411111f0 }, /* N/A */
1408 { 0x1d, 0x411111f0 }, /* N/A */
1409 /* 0x1e is filled in below */
1410 { 0x1f, 0x411111f0 }, /* N/A */
1414 [ALC880_FIXUP_6ST
] = {
1415 .type
= HDA_FIXUP_PINS
,
1416 .v
.pins
= (const struct hda_pintbl
[]) {
1417 { 0x1e, 0x411111f0 }, /* N/A */
1421 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1423 [ALC880_FIXUP_6ST_DIG
] = {
1424 .type
= HDA_FIXUP_PINS
,
1425 .v
.pins
= (const struct hda_pintbl
[]) {
1426 { 0x1e, 0x0144111e }, /* SPDIF */
1430 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1432 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1433 .type
= HDA_FIXUP_PINS
,
1434 .v
.pins
= (const struct hda_pintbl
[]) {
1435 { 0x1b, 0x0121401f }, /* HP with jack detect */
1438 .chained_before
= true,
1439 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1443 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1444 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1445 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1446 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1447 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1448 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1449 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1450 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1451 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1452 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1453 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1454 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1455 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1456 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1457 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1458 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1459 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1460 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1461 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1462 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1463 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1464 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1465 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1466 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1468 /* Below is the copied entries from alc880_quirks.c.
1469 * It's not quite sure whether BIOS sets the correct pin-config table
1470 * on these machines, thus they are kept to be compatible with
1471 * the old static quirks. Once when it's confirmed to work without
1472 * these overrides, it'd be better to remove.
1474 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1475 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1476 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1477 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1478 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1479 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1480 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1481 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1482 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1483 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1484 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1485 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1486 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1487 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1488 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1489 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1490 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1491 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1492 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1493 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1494 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1495 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1496 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1497 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1498 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1499 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1500 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1501 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1502 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1503 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1504 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1505 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1506 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1508 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1509 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1510 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1514 static const struct hda_model_fixup alc880_fixup_models
[] = {
1515 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1516 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1517 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1518 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1519 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1520 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1521 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1527 * OK, here we have finally the patch for ALC880
1529 static int patch_alc880(struct hda_codec
*codec
)
1531 struct alc_spec
*spec
;
1534 err
= alc_alloc_spec(codec
, 0x0b);
1539 spec
->gen
.need_dac_fix
= 1;
1540 spec
->gen
.beep_nid
= 0x01;
1542 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1544 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1546 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1548 /* automatic parse from the BIOS config */
1549 err
= alc880_parse_auto_config(codec
);
1553 if (!spec
->gen
.no_analog
)
1554 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1556 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1569 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1571 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1572 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1573 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1580 ALC260_FIXUP_HP_DC5750
,
1581 ALC260_FIXUP_HP_PIN_0F
,
1584 ALC260_FIXUP_GPIO1_TOGGLE
,
1585 ALC260_FIXUP_REPLACER
,
1586 ALC260_FIXUP_HP_B1900
,
1588 ALC260_FIXUP_FSC_S7020
,
1589 ALC260_FIXUP_FSC_S7020_JWSE
,
1590 ALC260_FIXUP_VAIO_PINS
,
1593 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1595 struct alc_spec
*spec
= codec
->spec
;
1596 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
1597 spec
->gen
.hp_jack_present
);
1600 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1601 const struct hda_fixup
*fix
, int action
)
1603 struct alc_spec
*spec
= codec
->spec
;
1604 if (action
== HDA_FIXUP_ACT_PROBE
) {
1605 /* although the machine has only one output pin, we need to
1606 * toggle GPIO1 according to the jack state
1608 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1609 spec
->gen
.detect_hp
= 1;
1610 spec
->gen
.automute_speaker
= 1;
1611 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1612 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1613 snd_hda_gen_hp_automute
);
1614 snd_hda_add_verbs(codec
, alc_gpio1_init_verbs
);
1618 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1619 const struct hda_fixup
*fix
, int action
)
1621 struct alc_spec
*spec
= codec
->spec
;
1622 static const struct hda_pintbl pincfgs
[] = {
1623 { 0x0f, 0x02214000 }, /* HP/speaker */
1624 { 0x12, 0x90a60160 }, /* int mic */
1625 { 0x13, 0x02a19000 }, /* ext mic */
1626 { 0x18, 0x01446000 }, /* SPDIF out */
1627 /* disable bogus I/O pins */
1628 { 0x10, 0x411111f0 },
1629 { 0x11, 0x411111f0 },
1630 { 0x14, 0x411111f0 },
1631 { 0x15, 0x411111f0 },
1632 { 0x16, 0x411111f0 },
1633 { 0x17, 0x411111f0 },
1634 { 0x19, 0x411111f0 },
1639 case HDA_FIXUP_ACT_PRE_PROBE
:
1640 snd_hda_apply_pincfgs(codec
, pincfgs
);
1642 case HDA_FIXUP_ACT_PROBE
:
1643 spec
->init_amp
= ALC_INIT_NONE
;
1648 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1649 const struct hda_fixup
*fix
, int action
)
1651 struct alc_spec
*spec
= codec
->spec
;
1652 if (action
== HDA_FIXUP_ACT_PROBE
)
1653 spec
->init_amp
= ALC_INIT_NONE
;
1656 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1657 const struct hda_fixup
*fix
, int action
)
1659 struct alc_spec
*spec
= codec
->spec
;
1660 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1661 spec
->gen
.add_jack_modes
= 1;
1662 spec
->gen
.hp_mic
= 1;
1666 static const struct hda_fixup alc260_fixups
[] = {
1667 [ALC260_FIXUP_HP_DC5750
] = {
1668 .type
= HDA_FIXUP_PINS
,
1669 .v
.pins
= (const struct hda_pintbl
[]) {
1670 { 0x11, 0x90130110 }, /* speaker */
1674 [ALC260_FIXUP_HP_PIN_0F
] = {
1675 .type
= HDA_FIXUP_PINS
,
1676 .v
.pins
= (const struct hda_pintbl
[]) {
1677 { 0x0f, 0x01214000 }, /* HP */
1681 [ALC260_FIXUP_COEF
] = {
1682 .type
= HDA_FIXUP_VERBS
,
1683 .v
.verbs
= (const struct hda_verb
[]) {
1684 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1685 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1689 [ALC260_FIXUP_GPIO1
] = {
1690 .type
= HDA_FIXUP_VERBS
,
1691 .v
.verbs
= alc_gpio1_init_verbs
,
1693 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1694 .type
= HDA_FIXUP_FUNC
,
1695 .v
.func
= alc260_fixup_gpio1_toggle
,
1697 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1699 [ALC260_FIXUP_REPLACER
] = {
1700 .type
= HDA_FIXUP_VERBS
,
1701 .v
.verbs
= (const struct hda_verb
[]) {
1702 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1703 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1707 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1709 [ALC260_FIXUP_HP_B1900
] = {
1710 .type
= HDA_FIXUP_FUNC
,
1711 .v
.func
= alc260_fixup_gpio1_toggle
,
1713 .chain_id
= ALC260_FIXUP_COEF
,
1715 [ALC260_FIXUP_KN1
] = {
1716 .type
= HDA_FIXUP_FUNC
,
1717 .v
.func
= alc260_fixup_kn1
,
1719 [ALC260_FIXUP_FSC_S7020
] = {
1720 .type
= HDA_FIXUP_FUNC
,
1721 .v
.func
= alc260_fixup_fsc_s7020
,
1723 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1724 .type
= HDA_FIXUP_FUNC
,
1725 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1727 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1729 [ALC260_FIXUP_VAIO_PINS
] = {
1730 .type
= HDA_FIXUP_PINS
,
1731 .v
.pins
= (const struct hda_pintbl
[]) {
1732 /* Pin configs are missing completely on some VAIOs */
1733 { 0x0f, 0x01211020 },
1734 { 0x10, 0x0001003f },
1735 { 0x11, 0x411111f0 },
1736 { 0x12, 0x01a15930 },
1737 { 0x13, 0x411111f0 },
1738 { 0x14, 0x411111f0 },
1739 { 0x15, 0x411111f0 },
1740 { 0x16, 0x411111f0 },
1741 { 0x17, 0x411111f0 },
1742 { 0x18, 0x411111f0 },
1743 { 0x19, 0x411111f0 },
1749 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1750 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1751 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1752 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1753 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1754 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1755 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1756 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1757 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1758 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1759 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1760 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1761 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1765 static const struct hda_model_fixup alc260_fixup_models
[] = {
1766 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1767 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1768 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1769 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1775 static int patch_alc260(struct hda_codec
*codec
)
1777 struct alc_spec
*spec
;
1780 err
= alc_alloc_spec(codec
, 0x07);
1785 /* as quite a few machines require HP amp for speaker outputs,
1786 * it's easier to enable it unconditionally; even if it's unneeded,
1787 * it's almost harmless.
1789 spec
->gen
.prefer_hp_amp
= 1;
1790 spec
->gen
.beep_nid
= 0x01;
1792 spec
->shutup
= alc_eapd_shutup
;
1794 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1796 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1798 /* automatic parse from the BIOS config */
1799 err
= alc260_parse_auto_config(codec
);
1803 if (!spec
->gen
.no_analog
)
1804 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1806 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1817 * ALC882/883/885/888/889 support
1819 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1820 * configuration. Each pin widget can choose any input DACs and a mixer.
1821 * Each ADC is connected from a mixer of all inputs. This makes possible
1822 * 6-channel independent captures.
1824 * In addition, an independent DAC for the multi-playback (not used in this
1832 ALC882_FIXUP_ABIT_AW9D_MAX
,
1833 ALC882_FIXUP_LENOVO_Y530
,
1834 ALC882_FIXUP_PB_M5210
,
1835 ALC882_FIXUP_ACER_ASPIRE_7736
,
1836 ALC882_FIXUP_ASUS_W90V
,
1838 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1839 ALC889_FIXUP_VAIO_TT
,
1840 ALC888_FIXUP_EEE1601
,
1843 ALC883_FIXUP_ACER_EAPD
,
1848 ALC882_FIXUP_ASUS_W2JC
,
1849 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1850 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1851 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1852 ALC885_FIXUP_MACPRO_GPIO
,
1853 ALC889_FIXUP_DAC_ROUTE
,
1854 ALC889_FIXUP_MBP_VREF
,
1855 ALC889_FIXUP_IMAC91_VREF
,
1856 ALC889_FIXUP_MBA11_VREF
,
1857 ALC889_FIXUP_MBA21_VREF
,
1858 ALC889_FIXUP_MP11_VREF
,
1859 ALC889_FIXUP_MP41_VREF
,
1860 ALC882_FIXUP_INV_DMIC
,
1861 ALC882_FIXUP_NO_PRIMARY_HP
,
1862 ALC887_FIXUP_ASUS_BASS
,
1863 ALC887_FIXUP_BASS_CHMAP
,
1864 ALC1220_FIXUP_GB_DUAL_CODECS
,
1865 ALC1220_FIXUP_CLEVO_P950
,
1866 ALC1220_FIXUP_SYSTEM76_ORYP5
,
1867 ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
,
1870 static void alc889_fixup_coef(struct hda_codec
*codec
,
1871 const struct hda_fixup
*fix
, int action
)
1873 if (action
!= HDA_FIXUP_ACT_INIT
)
1875 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1878 /* toggle speaker-output according to the hp-jack state */
1879 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
1881 unsigned int gpiostate
, gpiomask
, gpiodir
;
1883 gpiostate
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1884 AC_VERB_GET_GPIO_DATA
, 0);
1887 gpiostate
|= (1 << pin
);
1889 gpiostate
&= ~(1 << pin
);
1891 gpiomask
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1892 AC_VERB_GET_GPIO_MASK
, 0);
1893 gpiomask
|= (1 << pin
);
1895 gpiodir
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1896 AC_VERB_GET_GPIO_DIRECTION
, 0);
1897 gpiodir
|= (1 << pin
);
1900 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1901 AC_VERB_SET_GPIO_MASK
, gpiomask
);
1902 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1903 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
1907 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1908 AC_VERB_SET_GPIO_DATA
, gpiostate
);
1911 /* set up GPIO at initialization */
1912 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1913 const struct hda_fixup
*fix
, int action
)
1915 if (action
!= HDA_FIXUP_ACT_INIT
)
1917 alc882_gpio_mute(codec
, 0, 0);
1918 alc882_gpio_mute(codec
, 1, 0);
1921 /* Fix the connection of some pins for ALC889:
1922 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1923 * work correctly (bko#42740)
1925 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1926 const struct hda_fixup
*fix
, int action
)
1928 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1929 /* fake the connections during parsing the tree */
1930 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1931 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1932 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1933 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1934 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1935 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1936 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1937 /* restore the connections */
1938 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1939 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1940 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1941 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1942 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1946 /* Set VREF on HP pin */
1947 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1948 const struct hda_fixup
*fix
, int action
)
1950 struct alc_spec
*spec
= codec
->spec
;
1951 static hda_nid_t nids
[3] = { 0x14, 0x15, 0x19 };
1954 if (action
!= HDA_FIXUP_ACT_INIT
)
1956 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1957 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1958 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1960 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1961 val
|= AC_PINCTL_VREF_80
;
1962 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1963 spec
->gen
.keep_vref_in_automute
= 1;
1968 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1969 const hda_nid_t
*nids
, int num_nids
)
1971 struct alc_spec
*spec
= codec
->spec
;
1974 for (i
= 0; i
< num_nids
; i
++) {
1976 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1977 val
|= AC_PINCTL_VREF_50
;
1978 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1980 spec
->gen
.keep_vref_in_automute
= 1;
1983 /* Set VREF on speaker pins on imac91 */
1984 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1985 const struct hda_fixup
*fix
, int action
)
1987 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1989 if (action
== HDA_FIXUP_ACT_INIT
)
1990 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1993 /* Set VREF on speaker pins on mba11 */
1994 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1995 const struct hda_fixup
*fix
, int action
)
1997 static hda_nid_t nids
[1] = { 0x18 };
1999 if (action
== HDA_FIXUP_ACT_INIT
)
2000 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2003 /* Set VREF on speaker pins on mba21 */
2004 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
2005 const struct hda_fixup
*fix
, int action
)
2007 static hda_nid_t nids
[2] = { 0x18, 0x19 };
2009 if (action
== HDA_FIXUP_ACT_INIT
)
2010 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2013 /* Don't take HP output as primary
2014 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2015 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2017 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
2018 const struct hda_fixup
*fix
, int action
)
2020 struct alc_spec
*spec
= codec
->spec
;
2021 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
2022 spec
->gen
.no_primary_hp
= 1;
2023 spec
->gen
.no_multi_io
= 1;
2027 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
2028 const struct hda_fixup
*fix
, int action
);
2030 /* For dual-codec configuration, we need to disable some features to avoid
2031 * conflicts of kctls and PCM streams
2033 static void alc_fixup_dual_codecs(struct hda_codec
*codec
,
2034 const struct hda_fixup
*fix
, int action
)
2036 struct alc_spec
*spec
= codec
->spec
;
2038 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2040 /* disable vmaster */
2041 spec
->gen
.suppress_vmaster
= 1;
2042 /* auto-mute and auto-mic switch don't work with multiple codecs */
2043 spec
->gen
.suppress_auto_mute
= 1;
2044 spec
->gen
.suppress_auto_mic
= 1;
2045 /* disable aamix as well */
2046 spec
->gen
.mixer_nid
= 0;
2047 /* add location prefix to avoid conflicts */
2048 codec
->force_pin_prefix
= 1;
2051 static void rename_ctl(struct hda_codec
*codec
, const char *oldname
,
2052 const char *newname
)
2054 struct snd_kcontrol
*kctl
;
2056 kctl
= snd_hda_find_mixer_ctl(codec
, oldname
);
2058 strcpy(kctl
->id
.name
, newname
);
2061 static void alc1220_fixup_gb_dual_codecs(struct hda_codec
*codec
,
2062 const struct hda_fixup
*fix
,
2065 alc_fixup_dual_codecs(codec
, fix
, action
);
2067 case HDA_FIXUP_ACT_PRE_PROBE
:
2068 /* override card longname to provide a unique UCM profile */
2069 strcpy(codec
->card
->longname
, "HDAudio-Gigabyte-ALC1220DualCodecs");
2071 case HDA_FIXUP_ACT_BUILD
:
2072 /* rename Capture controls depending on the codec */
2073 rename_ctl(codec
, "Capture Volume",
2075 "Rear-Panel Capture Volume" :
2076 "Front-Panel Capture Volume");
2077 rename_ctl(codec
, "Capture Switch",
2079 "Rear-Panel Capture Switch" :
2080 "Front-Panel Capture Switch");
2085 static void alc1220_fixup_clevo_p950(struct hda_codec
*codec
,
2086 const struct hda_fixup
*fix
,
2089 hda_nid_t conn1
[1] = { 0x0c };
2091 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2094 alc_update_coef_idx(codec
, 0x7, 0, 0x3c3);
2095 /* We therefore want to make sure 0x14 (front headphone) and
2096 * 0x1b (speakers) use the stereo DAC 0x02
2098 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
2099 snd_hda_override_conn_list(codec
, 0x1b, 1, conn1
);
2102 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
2103 const struct hda_fixup
*fix
, int action
);
2105 static void alc1220_fixup_system76_oryp5(struct hda_codec
*codec
,
2106 const struct hda_fixup
*fix
,
2109 alc1220_fixup_clevo_p950(codec
, fix
, action
);
2110 alc_fixup_headset_mode_no_hp_mic(codec
, fix
, action
);
2113 static const struct hda_fixup alc882_fixups
[] = {
2114 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2115 .type
= HDA_FIXUP_PINS
,
2116 .v
.pins
= (const struct hda_pintbl
[]) {
2117 { 0x15, 0x01080104 }, /* side */
2118 { 0x16, 0x01011012 }, /* rear */
2119 { 0x17, 0x01016011 }, /* clfe */
2123 [ALC882_FIXUP_LENOVO_Y530
] = {
2124 .type
= HDA_FIXUP_PINS
,
2125 .v
.pins
= (const struct hda_pintbl
[]) {
2126 { 0x15, 0x99130112 }, /* rear int speakers */
2127 { 0x16, 0x99130111 }, /* subwoofer */
2131 [ALC882_FIXUP_PB_M5210
] = {
2132 .type
= HDA_FIXUP_PINCTLS
,
2133 .v
.pins
= (const struct hda_pintbl
[]) {
2134 { 0x19, PIN_VREF50
},
2138 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2139 .type
= HDA_FIXUP_FUNC
,
2140 .v
.func
= alc_fixup_sku_ignore
,
2142 [ALC882_FIXUP_ASUS_W90V
] = {
2143 .type
= HDA_FIXUP_PINS
,
2144 .v
.pins
= (const struct hda_pintbl
[]) {
2145 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2149 [ALC889_FIXUP_CD
] = {
2150 .type
= HDA_FIXUP_PINS
,
2151 .v
.pins
= (const struct hda_pintbl
[]) {
2152 { 0x1c, 0x993301f0 }, /* CD */
2156 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2157 .type
= HDA_FIXUP_PINS
,
2158 .v
.pins
= (const struct hda_pintbl
[]) {
2159 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2163 .chain_id
= ALC889_FIXUP_CD
,
2165 [ALC889_FIXUP_VAIO_TT
] = {
2166 .type
= HDA_FIXUP_PINS
,
2167 .v
.pins
= (const struct hda_pintbl
[]) {
2168 { 0x17, 0x90170111 }, /* hidden surround speaker */
2172 [ALC888_FIXUP_EEE1601
] = {
2173 .type
= HDA_FIXUP_VERBS
,
2174 .v
.verbs
= (const struct hda_verb
[]) {
2175 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2176 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2180 [ALC882_FIXUP_EAPD
] = {
2181 .type
= HDA_FIXUP_VERBS
,
2182 .v
.verbs
= (const struct hda_verb
[]) {
2183 /* change to EAPD mode */
2184 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2185 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2189 [ALC883_FIXUP_EAPD
] = {
2190 .type
= HDA_FIXUP_VERBS
,
2191 .v
.verbs
= (const struct hda_verb
[]) {
2192 /* change to EAPD mode */
2193 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2194 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2198 [ALC883_FIXUP_ACER_EAPD
] = {
2199 .type
= HDA_FIXUP_VERBS
,
2200 .v
.verbs
= (const struct hda_verb
[]) {
2201 /* eanable EAPD on Acer laptops */
2202 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2203 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2207 [ALC882_FIXUP_GPIO1
] = {
2208 .type
= HDA_FIXUP_VERBS
,
2209 .v
.verbs
= alc_gpio1_init_verbs
,
2211 [ALC882_FIXUP_GPIO2
] = {
2212 .type
= HDA_FIXUP_VERBS
,
2213 .v
.verbs
= alc_gpio2_init_verbs
,
2215 [ALC882_FIXUP_GPIO3
] = {
2216 .type
= HDA_FIXUP_VERBS
,
2217 .v
.verbs
= alc_gpio3_init_verbs
,
2219 [ALC882_FIXUP_ASUS_W2JC
] = {
2220 .type
= HDA_FIXUP_VERBS
,
2221 .v
.verbs
= alc_gpio1_init_verbs
,
2223 .chain_id
= ALC882_FIXUP_EAPD
,
2225 [ALC889_FIXUP_COEF
] = {
2226 .type
= HDA_FIXUP_FUNC
,
2227 .v
.func
= alc889_fixup_coef
,
2229 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2230 .type
= HDA_FIXUP_PINS
,
2231 .v
.pins
= (const struct hda_pintbl
[]) {
2232 { 0x16, 0x99130111 }, /* CLFE speaker */
2233 { 0x17, 0x99130112 }, /* surround speaker */
2237 .chain_id
= ALC882_FIXUP_GPIO1
,
2239 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2240 .type
= HDA_FIXUP_PINS
,
2241 .v
.pins
= (const struct hda_pintbl
[]) {
2242 { 0x16, 0x99130111 }, /* CLFE speaker */
2243 { 0x1b, 0x99130112 }, /* surround speaker */
2247 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2249 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2250 /* additional init verbs for Acer Aspire 8930G */
2251 .type
= HDA_FIXUP_VERBS
,
2252 .v
.verbs
= (const struct hda_verb
[]) {
2253 /* Enable all DACs */
2254 /* DAC DISABLE/MUTE 1? */
2255 /* setting bits 1-5 disables DAC nids 0x02-0x06
2256 * apparently. Init=0x38 */
2257 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2258 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2259 /* DAC DISABLE/MUTE 2? */
2260 /* some bit here disables the other DACs.
2262 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2263 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2265 * This laptop has a stereo digital microphone.
2266 * The mics are only 1cm apart which makes the stereo
2267 * useless. However, either the mic or the ALC889
2268 * makes the signal become a difference/sum signal
2269 * instead of standard stereo, which is annoying.
2270 * So instead we flip this bit which makes the
2271 * codec replicate the sum signal to both channels,
2272 * turning it into a normal mono mic.
2274 /* DMIC_CONTROL? Init value = 0x0001 */
2275 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2276 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2277 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2278 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2282 .chain_id
= ALC882_FIXUP_GPIO1
,
2284 [ALC885_FIXUP_MACPRO_GPIO
] = {
2285 .type
= HDA_FIXUP_FUNC
,
2286 .v
.func
= alc885_fixup_macpro_gpio
,
2288 [ALC889_FIXUP_DAC_ROUTE
] = {
2289 .type
= HDA_FIXUP_FUNC
,
2290 .v
.func
= alc889_fixup_dac_route
,
2292 [ALC889_FIXUP_MBP_VREF
] = {
2293 .type
= HDA_FIXUP_FUNC
,
2294 .v
.func
= alc889_fixup_mbp_vref
,
2296 .chain_id
= ALC882_FIXUP_GPIO1
,
2298 [ALC889_FIXUP_IMAC91_VREF
] = {
2299 .type
= HDA_FIXUP_FUNC
,
2300 .v
.func
= alc889_fixup_imac91_vref
,
2302 .chain_id
= ALC882_FIXUP_GPIO1
,
2304 [ALC889_FIXUP_MBA11_VREF
] = {
2305 .type
= HDA_FIXUP_FUNC
,
2306 .v
.func
= alc889_fixup_mba11_vref
,
2308 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2310 [ALC889_FIXUP_MBA21_VREF
] = {
2311 .type
= HDA_FIXUP_FUNC
,
2312 .v
.func
= alc889_fixup_mba21_vref
,
2314 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2316 [ALC889_FIXUP_MP11_VREF
] = {
2317 .type
= HDA_FIXUP_FUNC
,
2318 .v
.func
= alc889_fixup_mba11_vref
,
2320 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2322 [ALC889_FIXUP_MP41_VREF
] = {
2323 .type
= HDA_FIXUP_FUNC
,
2324 .v
.func
= alc889_fixup_mbp_vref
,
2326 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2328 [ALC882_FIXUP_INV_DMIC
] = {
2329 .type
= HDA_FIXUP_FUNC
,
2330 .v
.func
= alc_fixup_inv_dmic
,
2332 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2333 .type
= HDA_FIXUP_FUNC
,
2334 .v
.func
= alc882_fixup_no_primary_hp
,
2336 [ALC887_FIXUP_ASUS_BASS
] = {
2337 .type
= HDA_FIXUP_PINS
,
2338 .v
.pins
= (const struct hda_pintbl
[]) {
2339 {0x16, 0x99130130}, /* bass speaker */
2343 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2345 [ALC887_FIXUP_BASS_CHMAP
] = {
2346 .type
= HDA_FIXUP_FUNC
,
2347 .v
.func
= alc_fixup_bass_chmap
,
2349 [ALC1220_FIXUP_GB_DUAL_CODECS
] = {
2350 .type
= HDA_FIXUP_FUNC
,
2351 .v
.func
= alc1220_fixup_gb_dual_codecs
,
2353 [ALC1220_FIXUP_CLEVO_P950
] = {
2354 .type
= HDA_FIXUP_FUNC
,
2355 .v
.func
= alc1220_fixup_clevo_p950
,
2357 [ALC1220_FIXUP_SYSTEM76_ORYP5
] = {
2358 .type
= HDA_FIXUP_FUNC
,
2359 .v
.func
= alc1220_fixup_system76_oryp5
,
2361 [ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
] = {
2362 .type
= HDA_FIXUP_PINS
,
2363 .v
.pins
= (const struct hda_pintbl
[]) {
2364 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2368 .chain_id
= ALC1220_FIXUP_SYSTEM76_ORYP5
,
2372 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2373 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2374 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2375 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2376 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2377 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2378 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2379 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2380 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2381 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2382 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2383 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2384 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2385 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2386 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2387 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2388 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2389 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2390 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2391 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2392 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2393 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2394 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2395 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2396 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2397 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2398 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2399 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2400 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2401 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2402 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2403 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2404 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2405 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2406 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2407 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2408 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP
),
2409 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2410 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2412 /* All Apple entries are in codec SSIDs */
2413 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2414 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2415 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2416 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2417 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2418 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2419 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2420 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2421 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2422 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2423 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2424 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2425 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2426 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2427 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2428 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2429 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2430 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2431 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2432 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2433 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2434 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2436 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2437 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2438 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2439 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2440 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2441 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2442 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2443 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950
),
2444 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950
),
2445 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950
),
2446 SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
),
2447 SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
),
2448 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2449 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2450 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2451 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2455 static const struct hda_model_fixup alc882_fixup_models
[] = {
2456 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2457 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2458 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2459 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2460 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2461 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2466 * BIOS auto configuration
2468 /* almost identical with ALC880 parser... */
2469 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2471 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2472 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2473 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2478 static int patch_alc882(struct hda_codec
*codec
)
2480 struct alc_spec
*spec
;
2483 err
= alc_alloc_spec(codec
, 0x0b);
2489 switch (codec
->core
.vendor_id
) {
2496 /* ALC883 and variants */
2497 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2501 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2503 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2505 alc_auto_parse_customize_define(codec
);
2507 if (has_cdefine_beep(codec
))
2508 spec
->gen
.beep_nid
= 0x01;
2510 /* automatic parse from the BIOS config */
2511 err
= alc882_parse_auto_config(codec
);
2515 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2516 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2518 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2531 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2533 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2534 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2535 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2542 ALC262_FIXUP_FSC_H270
,
2543 ALC262_FIXUP_FSC_S7110
,
2544 ALC262_FIXUP_HP_Z200
,
2546 ALC262_FIXUP_LENOVO_3000
,
2548 ALC262_FIXUP_BENQ_T31
,
2549 ALC262_FIXUP_INV_DMIC
,
2550 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2553 static const struct hda_fixup alc262_fixups
[] = {
2554 [ALC262_FIXUP_FSC_H270
] = {
2555 .type
= HDA_FIXUP_PINS
,
2556 .v
.pins
= (const struct hda_pintbl
[]) {
2557 { 0x14, 0x99130110 }, /* speaker */
2558 { 0x15, 0x0221142f }, /* front HP */
2559 { 0x1b, 0x0121141f }, /* rear HP */
2563 [ALC262_FIXUP_FSC_S7110
] = {
2564 .type
= HDA_FIXUP_PINS
,
2565 .v
.pins
= (const struct hda_pintbl
[]) {
2566 { 0x15, 0x90170110 }, /* speaker */
2570 .chain_id
= ALC262_FIXUP_BENQ
,
2572 [ALC262_FIXUP_HP_Z200
] = {
2573 .type
= HDA_FIXUP_PINS
,
2574 .v
.pins
= (const struct hda_pintbl
[]) {
2575 { 0x16, 0x99130120 }, /* internal speaker */
2579 [ALC262_FIXUP_TYAN
] = {
2580 .type
= HDA_FIXUP_PINS
,
2581 .v
.pins
= (const struct hda_pintbl
[]) {
2582 { 0x14, 0x1993e1f0 }, /* int AUX */
2586 [ALC262_FIXUP_LENOVO_3000
] = {
2587 .type
= HDA_FIXUP_PINCTLS
,
2588 .v
.pins
= (const struct hda_pintbl
[]) {
2589 { 0x19, PIN_VREF50
},
2593 .chain_id
= ALC262_FIXUP_BENQ
,
2595 [ALC262_FIXUP_BENQ
] = {
2596 .type
= HDA_FIXUP_VERBS
,
2597 .v
.verbs
= (const struct hda_verb
[]) {
2598 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2599 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2603 [ALC262_FIXUP_BENQ_T31
] = {
2604 .type
= HDA_FIXUP_VERBS
,
2605 .v
.verbs
= (const struct hda_verb
[]) {
2606 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2607 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2611 [ALC262_FIXUP_INV_DMIC
] = {
2612 .type
= HDA_FIXUP_FUNC
,
2613 .v
.func
= alc_fixup_inv_dmic
,
2615 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2616 .type
= HDA_FIXUP_FUNC
,
2617 .v
.func
= alc_fixup_no_depop_delay
,
2621 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2622 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2623 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2624 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2625 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2626 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2627 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2628 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2629 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2630 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2631 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2635 static const struct hda_model_fixup alc262_fixup_models
[] = {
2636 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2642 static int patch_alc262(struct hda_codec
*codec
)
2644 struct alc_spec
*spec
;
2647 err
= alc_alloc_spec(codec
, 0x0b);
2652 spec
->gen
.shared_mic_vref_pin
= 0x18;
2654 spec
->shutup
= alc_eapd_shutup
;
2657 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2660 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2662 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2664 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2666 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2668 alc_auto_parse_customize_define(codec
);
2670 if (has_cdefine_beep(codec
))
2671 spec
->gen
.beep_nid
= 0x01;
2673 /* automatic parse from the BIOS config */
2674 err
= alc262_parse_auto_config(codec
);
2678 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2679 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2681 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2693 /* bind Beep switches of both NID 0x0f and 0x10 */
2694 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2695 struct snd_ctl_elem_value
*ucontrol
)
2697 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2701 mutex_lock(&codec
->control_mutex
);
2702 pval
= kcontrol
->private_value
;
2703 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2704 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2706 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2707 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2709 kcontrol
->private_value
= pval
;
2710 mutex_unlock(&codec
->control_mutex
);
2714 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2715 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2717 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2718 .name
= "Beep Playback Switch",
2719 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2720 .info
= snd_hda_mixer_amp_switch_info
,
2721 .get
= snd_hda_mixer_amp_switch_get
,
2722 .put
= alc268_beep_switch_put
,
2723 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2728 /* set PCBEEP vol = 0, mute connections */
2729 static const struct hda_verb alc268_beep_init_verbs
[] = {
2730 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2731 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2732 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2737 ALC268_FIXUP_INV_DMIC
,
2738 ALC268_FIXUP_HP_EAPD
,
2742 static const struct hda_fixup alc268_fixups
[] = {
2743 [ALC268_FIXUP_INV_DMIC
] = {
2744 .type
= HDA_FIXUP_FUNC
,
2745 .v
.func
= alc_fixup_inv_dmic
,
2747 [ALC268_FIXUP_HP_EAPD
] = {
2748 .type
= HDA_FIXUP_VERBS
,
2749 .v
.verbs
= (const struct hda_verb
[]) {
2750 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2754 [ALC268_FIXUP_SPDIF
] = {
2755 .type
= HDA_FIXUP_PINS
,
2756 .v
.pins
= (const struct hda_pintbl
[]) {
2757 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2763 static const struct hda_model_fixup alc268_fixup_models
[] = {
2764 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2765 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2769 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2770 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2771 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2772 /* below is codec SSID since multiple Toshiba laptops have the
2773 * same PCI SSID 1179:ff00
2775 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2780 * BIOS auto configuration
2782 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2784 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2785 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2790 static int patch_alc268(struct hda_codec
*codec
)
2792 struct alc_spec
*spec
;
2795 /* ALC268 has no aa-loopback mixer */
2796 err
= alc_alloc_spec(codec
, 0);
2801 spec
->gen
.beep_nid
= 0x01;
2803 spec
->shutup
= alc_eapd_shutup
;
2805 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2806 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2808 /* automatic parse from the BIOS config */
2809 err
= alc268_parse_auto_config(codec
);
2813 if (err
> 0 && !spec
->gen
.no_analog
&&
2814 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2815 add_mixer(spec
, alc268_beep_mixer
);
2816 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2817 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2818 /* override the amp caps for beep generator */
2819 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2820 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2821 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2822 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2823 (0 << AC_AMPCAP_MUTE_SHIFT
));
2826 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2839 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2840 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2843 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2844 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2847 /* different alc269-variants */
2849 ALC269_TYPE_ALC269VA
,
2850 ALC269_TYPE_ALC269VB
,
2851 ALC269_TYPE_ALC269VC
,
2852 ALC269_TYPE_ALC269VD
,
2871 * BIOS auto configuration
2873 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2875 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2876 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2877 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2878 struct alc_spec
*spec
= codec
->spec
;
2879 const hda_nid_t
*ssids
;
2881 switch (spec
->codec_variant
) {
2882 case ALC269_TYPE_ALC269VA
:
2883 case ALC269_TYPE_ALC269VC
:
2884 case ALC269_TYPE_ALC280
:
2885 case ALC269_TYPE_ALC284
:
2886 case ALC269_TYPE_ALC293
:
2887 ssids
= alc269va_ssids
;
2889 case ALC269_TYPE_ALC269VB
:
2890 case ALC269_TYPE_ALC269VD
:
2891 case ALC269_TYPE_ALC282
:
2892 case ALC269_TYPE_ALC283
:
2893 case ALC269_TYPE_ALC286
:
2894 case ALC269_TYPE_ALC298
:
2895 case ALC269_TYPE_ALC255
:
2896 case ALC269_TYPE_ALC256
:
2897 case ALC269_TYPE_ALC257
:
2898 case ALC269_TYPE_ALC215
:
2899 case ALC269_TYPE_ALC225
:
2900 case ALC269_TYPE_ALC294
:
2901 case ALC269_TYPE_ALC300
:
2902 case ALC269_TYPE_ALC700
:
2903 ssids
= alc269_ssids
;
2906 ssids
= alc269_ssids
;
2910 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2913 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2915 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2918 static void alc269_shutup(struct hda_codec
*codec
)
2920 struct alc_spec
*spec
= codec
->spec
;
2922 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2923 alc269vb_toggle_power_output(codec
, 0);
2924 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2925 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2928 alc_shutup_pins(codec
);
2931 static struct coef_fw alc282_coefs
[] = {
2932 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2933 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2934 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2935 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2936 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2937 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2938 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2939 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2940 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2941 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2942 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2943 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2944 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2945 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2946 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2947 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2948 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2949 WRITE_COEF(0x63, 0x2902), /* PLL */
2950 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2951 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2952 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2953 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2954 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2955 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2956 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2957 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2958 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2959 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2960 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2964 static void alc282_restore_default_value(struct hda_codec
*codec
)
2966 alc_process_coef_fw(codec
, alc282_coefs
);
2969 static void alc282_init(struct hda_codec
*codec
)
2971 struct alc_spec
*spec
= codec
->spec
;
2972 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
2976 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
2977 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
2978 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
2981 alc282_restore_default_value(codec
);
2985 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2986 coef78
= alc_read_coef_idx(codec
, 0x78);
2988 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2989 /* Headphone capless set to high power mode */
2990 alc_write_coef_idx(codec
, 0x78, 0x9004);
2995 snd_hda_codec_write(codec
, hp_pin
, 0,
2996 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3001 snd_hda_codec_write(codec
, hp_pin
, 0,
3002 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3007 /* Headphone capless set to normal mode */
3008 alc_write_coef_idx(codec
, 0x78, coef78
);
3011 static void alc282_shutup(struct hda_codec
*codec
)
3013 struct alc_spec
*spec
= codec
->spec
;
3014 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3018 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3019 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3020 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3024 alc269_shutup(codec
);
3028 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3029 coef78
= alc_read_coef_idx(codec
, 0x78);
3030 alc_write_coef_idx(codec
, 0x78, 0x9004);
3035 snd_hda_codec_write(codec
, hp_pin
, 0,
3036 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3041 if (!spec
->no_shutup_pins
)
3042 snd_hda_codec_write(codec
, hp_pin
, 0,
3043 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3048 alc_auto_setup_eapd(codec
, false);
3049 alc_shutup_pins(codec
);
3050 alc_write_coef_idx(codec
, 0x78, coef78
);
3053 static struct coef_fw alc283_coefs
[] = {
3054 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3055 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3056 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3057 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3058 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3059 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3060 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3061 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3062 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3063 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3064 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3065 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3066 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3067 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3068 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3069 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3070 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3071 WRITE_COEF(0x2e, 0x2902), /* PLL */
3072 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3073 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3074 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3075 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3076 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3077 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3078 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3079 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3080 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3081 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3082 WRITE_COEF(0x49, 0x0), /* test mode */
3083 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3084 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3085 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3086 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3090 static void alc283_restore_default_value(struct hda_codec
*codec
)
3092 alc_process_coef_fw(codec
, alc283_coefs
);
3095 static void alc283_init(struct hda_codec
*codec
)
3097 struct alc_spec
*spec
= codec
->spec
;
3098 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3101 alc283_restore_default_value(codec
);
3107 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3109 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3110 /* Headphone capless set to high power mode */
3111 alc_write_coef_idx(codec
, 0x43, 0x9004);
3113 snd_hda_codec_write(codec
, hp_pin
, 0,
3114 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3119 snd_hda_codec_write(codec
, hp_pin
, 0,
3120 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3124 /* Index 0x46 Combo jack auto switch control 2 */
3125 /* 3k pull low control for Headset jack. */
3126 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3127 /* Headphone capless set to normal mode */
3128 alc_write_coef_idx(codec
, 0x43, 0x9614);
3131 static void alc283_shutup(struct hda_codec
*codec
)
3133 struct alc_spec
*spec
= codec
->spec
;
3134 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3138 alc269_shutup(codec
);
3142 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3144 alc_write_coef_idx(codec
, 0x43, 0x9004);
3146 /*depop hp during suspend*/
3147 alc_write_coef_idx(codec
, 0x06, 0x2100);
3149 snd_hda_codec_write(codec
, hp_pin
, 0,
3150 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3155 if (!spec
->no_shutup_pins
)
3156 snd_hda_codec_write(codec
, hp_pin
, 0,
3157 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3159 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3163 alc_auto_setup_eapd(codec
, false);
3164 alc_shutup_pins(codec
);
3165 alc_write_coef_idx(codec
, 0x43, 0x9614);
3168 static void alc256_init(struct hda_codec
*codec
)
3170 struct alc_spec
*spec
= codec
->spec
;
3171 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3174 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3175 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3176 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3184 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3189 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3191 snd_hda_codec_write(codec
, hp_pin
, 0,
3192 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3197 snd_hda_codec_write(codec
, hp_pin
, 0,
3198 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3203 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3204 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3205 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3206 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 0 << 15);
3209 static void alc256_shutup(struct hda_codec
*codec
)
3211 struct alc_spec
*spec
= codec
->spec
;
3212 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3215 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3216 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3217 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3221 alc269_shutup(codec
);
3225 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3230 snd_hda_codec_write(codec
, hp_pin
, 0,
3231 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3236 /* 3k pull low control for Headset jack. */
3237 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3238 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3240 if (!spec
->no_shutup_pins
)
3241 snd_hda_codec_write(codec
, hp_pin
, 0,
3242 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3247 alc_auto_setup_eapd(codec
, false);
3248 alc_shutup_pins(codec
);
3251 static void alc225_init(struct hda_codec
*codec
)
3253 struct alc_spec
*spec
= codec
->spec
;
3254 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3255 bool hp1_pin_sense
, hp2_pin_sense
;
3257 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3258 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3259 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3267 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3268 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3270 if (hp1_pin_sense
|| hp2_pin_sense
)
3273 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3276 snd_hda_codec_write(codec
, hp_pin
, 0,
3277 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3279 snd_hda_codec_write(codec
, 0x16, 0,
3280 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3282 if (hp1_pin_sense
|| hp2_pin_sense
)
3286 snd_hda_codec_write(codec
, hp_pin
, 0,
3287 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3289 snd_hda_codec_write(codec
, 0x16, 0,
3290 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3292 if (hp1_pin_sense
|| hp2_pin_sense
)
3295 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3296 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3299 static void alc225_shutup(struct hda_codec
*codec
)
3301 struct alc_spec
*spec
= codec
->spec
;
3302 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3303 bool hp1_pin_sense
, hp2_pin_sense
;
3305 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3306 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3307 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3311 alc269_shutup(codec
);
3315 /* 3k pull low control for Headset jack. */
3316 alc_update_coef_idx(codec
, 0x4a, 0, 3 << 10);
3318 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3319 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3321 if (hp1_pin_sense
|| hp2_pin_sense
)
3325 snd_hda_codec_write(codec
, hp_pin
, 0,
3326 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3328 snd_hda_codec_write(codec
, 0x16, 0,
3329 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3331 if (hp1_pin_sense
|| hp2_pin_sense
)
3335 snd_hda_codec_write(codec
, hp_pin
, 0,
3336 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3338 snd_hda_codec_write(codec
, 0x16, 0,
3339 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3341 if (hp1_pin_sense
|| hp2_pin_sense
)
3344 alc_auto_setup_eapd(codec
, false);
3345 alc_shutup_pins(codec
);
3348 static void alc_default_init(struct hda_codec
*codec
)
3350 struct alc_spec
*spec
= codec
->spec
;
3351 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3354 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3355 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3356 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3364 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3369 snd_hda_codec_write(codec
, hp_pin
, 0,
3370 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3375 snd_hda_codec_write(codec
, hp_pin
, 0,
3376 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3382 static void alc_default_shutup(struct hda_codec
*codec
)
3384 struct alc_spec
*spec
= codec
->spec
;
3385 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3388 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3389 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3390 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3394 alc269_shutup(codec
);
3398 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3403 snd_hda_codec_write(codec
, hp_pin
, 0,
3404 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3409 if (!spec
->no_shutup_pins
)
3410 snd_hda_codec_write(codec
, hp_pin
, 0,
3411 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3416 alc_auto_setup_eapd(codec
, false);
3417 alc_shutup_pins(codec
);
3420 static void alc294_hp_init(struct hda_codec
*codec
)
3422 struct alc_spec
*spec
= codec
->spec
;
3423 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3426 if (!spec
->gen
.autocfg
.hp_outs
&& spec
->gen
.suppress_auto_mute
) {
3427 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3428 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3434 snd_hda_codec_write(codec
, hp_pin
, 0,
3435 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3439 snd_hda_codec_write(codec
, hp_pin
, 0,
3440 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3442 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3443 alc_update_coefex_idx(codec
, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3445 /* Wait for depop procedure finish */
3446 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3447 for (i
= 0; i
< 20 && val
& 0x0080; i
++) {
3449 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3451 /* Set HP depop to auto mode */
3452 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0x000b);
3456 static void alc294_init(struct hda_codec
*codec
)
3458 struct alc_spec
*spec
= codec
->spec
;
3460 if (!spec
->done_hp_init
) {
3461 alc294_hp_init(codec
);
3462 spec
->done_hp_init
= true;
3464 alc_default_init(codec
);
3467 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3470 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3471 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3472 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3475 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3479 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3480 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3482 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3487 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3491 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3492 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3493 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3494 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3495 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3496 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3497 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3498 val
= alc5505_coef_get(codec
, 0x6220);
3499 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3502 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3504 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3505 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3506 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3507 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3508 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3509 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3512 static void alc5505_dsp_init(struct hda_codec
*codec
)
3516 alc5505_dsp_halt(codec
);
3517 alc5505_dsp_back_from_halt(codec
);
3518 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3519 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3520 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3521 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3522 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3523 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3524 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3525 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3526 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3527 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3528 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3529 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3530 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3532 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3534 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3536 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3538 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3539 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3540 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3541 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3542 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3543 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3544 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3546 #ifdef HALT_REALTEK_ALC5505
3547 alc5505_dsp_halt(codec
);
3551 #ifdef HALT_REALTEK_ALC5505
3552 #define alc5505_dsp_suspend(codec) /* NOP */
3553 #define alc5505_dsp_resume(codec) /* NOP */
3555 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3556 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3560 static int alc269_suspend(struct hda_codec
*codec
)
3562 struct alc_spec
*spec
= codec
->spec
;
3564 if (spec
->has_alc5505_dsp
)
3565 alc5505_dsp_suspend(codec
);
3566 return alc_suspend(codec
);
3569 static int alc269_resume(struct hda_codec
*codec
)
3571 struct alc_spec
*spec
= codec
->spec
;
3573 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3574 alc269vb_toggle_power_output(codec
, 0);
3575 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3576 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3580 codec
->patch_ops
.init(codec
);
3582 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3583 alc269vb_toggle_power_output(codec
, 1);
3584 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3585 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3589 regcache_sync(codec
->core
.regmap
);
3590 hda_call_check_power_status(codec
, 0x01);
3592 /* on some machine, the BIOS will clear the codec gpio data when enter
3593 * suspend, and won't restore the data after resume, so we restore it
3597 snd_hda_codec_write(codec
, codec
->core
.afg
, 0, AC_VERB_SET_GPIO_DATA
,
3600 if (spec
->has_alc5505_dsp
)
3601 alc5505_dsp_resume(codec
);
3605 #endif /* CONFIG_PM */
3607 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3608 const struct hda_fixup
*fix
, int action
)
3610 struct alc_spec
*spec
= codec
->spec
;
3612 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3613 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3616 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3617 const struct hda_fixup
*fix
,
3620 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3621 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3623 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3624 snd_hda_codec_set_pincfg(codec
, 0x19,
3625 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3626 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3629 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3630 const struct hda_fixup
*fix
, int action
)
3632 if (action
== HDA_FIXUP_ACT_INIT
)
3633 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3636 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3637 const struct hda_fixup
*fix
, int action
)
3639 struct alc_spec
*spec
= codec
->spec
;
3641 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3642 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3645 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3646 const struct hda_fixup
*fix
, int action
)
3648 static const struct hda_verb verbs
[] = {
3649 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3650 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3655 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3656 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3658 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3659 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3660 snd_hda_sequence_write(codec
, verbs
);
3663 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3664 const struct hda_fixup
*fix
, int action
)
3666 struct alc_spec
*spec
= codec
->spec
;
3668 if (action
!= HDA_FIXUP_ACT_PROBE
)
3671 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3672 * fix the sample rate of analog I/O to 44.1kHz
3674 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3675 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3678 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3679 const struct hda_fixup
*fix
, int action
)
3681 /* The digital-mic unit sends PDM (differential signal) instead of
3682 * the standard PCM, thus you can't record a valid mono stream as is.
3683 * Below is a workaround specific to ALC269 to control the dmic
3684 * signal source as mono.
3686 if (action
== HDA_FIXUP_ACT_INIT
)
3687 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3690 static void alc269_quanta_automute(struct hda_codec
*codec
)
3692 snd_hda_gen_update_outputs(codec
);
3694 alc_write_coef_idx(codec
, 0x0c, 0x680);
3695 alc_write_coef_idx(codec
, 0x0c, 0x480);
3698 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3699 const struct hda_fixup
*fix
, int action
)
3701 struct alc_spec
*spec
= codec
->spec
;
3702 if (action
!= HDA_FIXUP_ACT_PROBE
)
3704 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3707 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3708 struct hda_jack_callback
*jack
)
3710 struct alc_spec
*spec
= codec
->spec
;
3713 snd_hda_gen_hp_automute(codec
, jack
);
3715 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3717 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3720 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3724 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3725 const struct hda_fixup
*fix
, int action
)
3727 struct alc_spec
*spec
= codec
->spec
;
3728 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3729 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3730 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3735 /* update mute-LED according to the speaker mute state via mic VREF pin */
3736 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3738 struct hda_codec
*codec
= private_data
;
3739 struct alc_spec
*spec
= codec
->spec
;
3740 unsigned int pinval
;
3742 if (spec
->mute_led_polarity
)
3744 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3745 pinval
&= ~AC_PINCTL_VREFEN
;
3746 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3747 if (spec
->mute_led_nid
) {
3748 /* temporarily power up/down for setting VREF */
3749 snd_hda_power_up_pm(codec
);
3750 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3751 snd_hda_power_down_pm(codec
);
3755 /* Make sure the led works even in runtime suspend */
3756 static unsigned int led_power_filter(struct hda_codec
*codec
,
3758 unsigned int power_state
)
3760 struct alc_spec
*spec
= codec
->spec
;
3762 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3763 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3766 /* Set pin ctl again, it might have just been set to 0 */
3767 snd_hda_set_pin_ctl(codec
, nid
,
3768 snd_hda_codec_get_pin_target(codec
, nid
));
3770 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3773 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3774 const struct hda_fixup
*fix
, int action
)
3776 struct alc_spec
*spec
= codec
->spec
;
3777 const struct dmi_device
*dev
= NULL
;
3779 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3782 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3784 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3786 if (pin
< 0x0a || pin
>= 0x10)
3788 spec
->mute_led_polarity
= pol
;
3789 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3790 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3791 spec
->gen
.vmaster_mute_enum
= 1;
3792 codec
->power_filter
= led_power_filter
;
3794 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3795 spec
->mute_led_polarity
);
3800 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3801 const struct hda_fixup
*fix
, int action
)
3803 struct alc_spec
*spec
= codec
->spec
;
3804 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3805 spec
->mute_led_polarity
= 0;
3806 spec
->mute_led_nid
= 0x18;
3807 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3808 spec
->gen
.vmaster_mute_enum
= 1;
3809 codec
->power_filter
= led_power_filter
;
3813 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3814 const struct hda_fixup
*fix
, int action
)
3816 struct alc_spec
*spec
= codec
->spec
;
3817 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3818 spec
->mute_led_polarity
= 0;
3819 spec
->mute_led_nid
= 0x19;
3820 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3821 spec
->gen
.vmaster_mute_enum
= 1;
3822 codec
->power_filter
= led_power_filter
;
3826 /* update LED status via GPIO */
3827 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3830 struct alc_spec
*spec
= codec
->spec
;
3831 unsigned int oldval
= spec
->gpio_led
;
3833 if (spec
->mute_led_polarity
)
3837 spec
->gpio_led
&= ~mask
;
3839 spec
->gpio_led
|= mask
;
3840 if (spec
->gpio_led
!= oldval
)
3841 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3845 /* turn on/off mute LED via GPIO per vmaster hook */
3846 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3848 struct hda_codec
*codec
= private_data
;
3849 struct alc_spec
*spec
= codec
->spec
;
3851 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3854 /* turn on/off mic-mute LED via GPIO per capture hook */
3855 static void alc_fixup_gpio_mic_mute_hook(struct hda_codec
*codec
,
3856 struct snd_kcontrol
*kcontrol
,
3857 struct snd_ctl_elem_value
*ucontrol
)
3859 struct alc_spec
*spec
= codec
->spec
;
3862 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3863 ucontrol
->value
.integer
.value
[0] ||
3864 ucontrol
->value
.integer
.value
[1]);
3867 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3868 const struct hda_fixup
*fix
, int action
)
3870 struct alc_spec
*spec
= codec
->spec
;
3871 static const struct hda_verb gpio_init
[] = {
3872 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3873 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3877 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3878 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3879 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3881 spec
->mute_led_polarity
= 0;
3882 spec
->gpio_mute_led_mask
= 0x08;
3883 spec
->gpio_mic_led_mask
= 0x10;
3884 snd_hda_add_verbs(codec
, gpio_init
);
3888 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3889 const struct hda_fixup
*fix
, int action
)
3891 struct alc_spec
*spec
= codec
->spec
;
3892 static const struct hda_verb gpio_init
[] = {
3893 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x22 },
3894 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x22 },
3898 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3899 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3900 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3902 spec
->mute_led_polarity
= 0;
3903 spec
->gpio_mute_led_mask
= 0x02;
3904 spec
->gpio_mic_led_mask
= 0x20;
3905 snd_hda_add_verbs(codec
, gpio_init
);
3909 /* turn on/off mic-mute LED per capture hook */
3910 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3911 struct snd_kcontrol
*kcontrol
,
3912 struct snd_ctl_elem_value
*ucontrol
)
3914 struct alc_spec
*spec
= codec
->spec
;
3915 unsigned int pinval
, enable
, disable
;
3917 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3918 pinval
&= ~AC_PINCTL_VREFEN
;
3919 enable
= pinval
| AC_PINCTL_VREF_80
;
3920 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3925 if (ucontrol
->value
.integer
.value
[0] ||
3926 ucontrol
->value
.integer
.value
[1])
3931 if (spec
->cap_mute_led_nid
)
3932 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3935 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3936 const struct hda_fixup
*fix
, int action
)
3938 struct alc_spec
*spec
= codec
->spec
;
3939 static const struct hda_verb gpio_init
[] = {
3940 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3941 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3945 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3946 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3947 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3949 spec
->mute_led_polarity
= 0;
3950 spec
->gpio_mute_led_mask
= 0x08;
3951 spec
->cap_mute_led_nid
= 0x18;
3952 snd_hda_add_verbs(codec
, gpio_init
);
3953 codec
->power_filter
= led_power_filter
;
3957 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3958 const struct hda_fixup
*fix
, int action
)
3960 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */
3961 struct alc_spec
*spec
= codec
->spec
;
3962 static const struct hda_verb gpio_init
[] = {
3963 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3964 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3968 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3969 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3970 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3972 spec
->mute_led_polarity
= 0;
3973 spec
->gpio_mute_led_mask
= 0x08;
3974 spec
->cap_mute_led_nid
= 0x18;
3975 snd_hda_add_verbs(codec
, gpio_init
);
3976 codec
->power_filter
= led_power_filter
;
3980 #if IS_REACHABLE(CONFIG_INPUT)
3981 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3982 struct hda_jack_callback
*event
)
3984 struct alc_spec
*spec
= codec
->spec
;
3986 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3987 send both key on and key off event for every interrupt. */
3988 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
3989 input_sync(spec
->kb_dev
);
3990 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
3991 input_sync(spec
->kb_dev
);
3994 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
3996 struct alc_spec
*spec
= codec
->spec
;
3999 spec
->kb_dev
= input_allocate_device();
4000 if (!spec
->kb_dev
) {
4001 codec_err(codec
, "Out of memory (input_allocate_device)\n");
4005 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
4007 spec
->kb_dev
->name
= "Microphone Mute Button";
4008 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
4009 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
4010 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
4011 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
4012 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
4013 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
4015 if (input_register_device(spec
->kb_dev
)) {
4016 codec_err(codec
, "input_register_device failed\n");
4017 input_free_device(spec
->kb_dev
);
4018 spec
->kb_dev
= NULL
;
4025 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
4026 const struct hda_fixup
*fix
, int action
)
4028 /* GPIO1 = set according to SKU external amp
4029 GPIO2 = mic mute hotkey
4031 GPIO4 = mic mute LED */
4032 static const struct hda_verb gpio_init
[] = {
4033 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x1e },
4034 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x1a },
4035 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x02 },
4039 struct alc_spec
*spec
= codec
->spec
;
4041 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4042 if (alc_register_micmute_input_device(codec
) != 0)
4045 snd_hda_add_verbs(codec
, gpio_init
);
4046 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
4047 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
4048 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
4049 gpio2_mic_hotkey_event
);
4051 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
4052 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4054 spec
->mute_led_polarity
= 0;
4055 spec
->gpio_mute_led_mask
= 0x08;
4056 spec
->gpio_mic_led_mask
= 0x10;
4064 case HDA_FIXUP_ACT_PROBE
:
4065 spec
->init_amp
= ALC_INIT_DEFAULT
;
4067 case HDA_FIXUP_ACT_FREE
:
4068 input_unregister_device(spec
->kb_dev
);
4069 spec
->kb_dev
= NULL
;
4073 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
4074 const struct hda_fixup
*fix
, int action
)
4076 /* Line2 = mic mute hotkey
4077 GPIO2 = mic mute LED */
4078 static const struct hda_verb gpio_init
[] = {
4079 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4080 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
4084 struct alc_spec
*spec
= codec
->spec
;
4086 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4087 if (alc_register_micmute_input_device(codec
) != 0)
4090 snd_hda_add_verbs(codec
, gpio_init
);
4091 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4092 gpio2_mic_hotkey_event
);
4094 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4096 spec
->mute_led_polarity
= 0;
4097 spec
->gpio_mic_led_mask
= 0x04;
4105 case HDA_FIXUP_ACT_PROBE
:
4106 spec
->init_amp
= ALC_INIT_DEFAULT
;
4108 case HDA_FIXUP_ACT_FREE
:
4109 input_unregister_device(spec
->kb_dev
);
4110 spec
->kb_dev
= NULL
;
4114 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4115 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4118 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
4119 const struct hda_fixup
*fix
, int action
)
4121 struct alc_spec
*spec
= codec
->spec
;
4123 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4124 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
4125 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
4126 spec
->mute_led_polarity
= 0;
4127 spec
->mute_led_nid
= 0x1a;
4128 spec
->cap_mute_led_nid
= 0x18;
4129 spec
->gen
.vmaster_mute_enum
= 1;
4130 codec
->power_filter
= led_power_filter
;
4134 static struct coef_fw alc225_pre_hsmode
[] = {
4135 UPDATE_COEF(0x4a, 1<<8, 0),
4136 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4137 UPDATE_COEF(0x63, 3<<14, 3<<14),
4138 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4139 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4140 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4141 UPDATE_COEF(0x4a, 3<<10, 0),
4145 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
4147 static struct coef_fw coef0255
[] = {
4148 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4149 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4150 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4151 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4154 static struct coef_fw coef0255_1
[] = {
4155 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4158 static struct coef_fw coef0256
[] = {
4159 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4162 static struct coef_fw coef0233
[] = {
4163 WRITE_COEF(0x1b, 0x0c0b),
4164 WRITE_COEF(0x45, 0xc429),
4165 UPDATE_COEF(0x35, 0x4000, 0),
4166 WRITE_COEF(0x06, 0x2104),
4167 WRITE_COEF(0x1a, 0x0001),
4168 WRITE_COEF(0x26, 0x0004),
4169 WRITE_COEF(0x32, 0x42a3),
4172 static struct coef_fw coef0288
[] = {
4173 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4174 UPDATE_COEF(0x50, 0x2000, 0x2000),
4175 UPDATE_COEF(0x56, 0x0006, 0x0006),
4176 UPDATE_COEF(0x66, 0x0008, 0),
4177 UPDATE_COEF(0x67, 0x2000, 0),
4180 static struct coef_fw coef0298
[] = {
4181 UPDATE_COEF(0x19, 0x1300, 0x0300),
4184 static struct coef_fw coef0292
[] = {
4185 WRITE_COEF(0x76, 0x000e),
4186 WRITE_COEF(0x6c, 0x2400),
4187 WRITE_COEF(0x18, 0x7308),
4188 WRITE_COEF(0x6b, 0xc429),
4191 static struct coef_fw coef0293
[] = {
4192 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4193 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4194 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4195 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4196 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4197 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4200 static struct coef_fw coef0668
[] = {
4201 WRITE_COEF(0x15, 0x0d40),
4202 WRITE_COEF(0xb7, 0x802b),
4205 static struct coef_fw coef0225
[] = {
4206 UPDATE_COEF(0x63, 3<<14, 0),
4209 static struct coef_fw coef0274
[] = {
4210 UPDATE_COEF(0x4a, 0x0100, 0),
4211 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4212 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4213 UPDATE_COEF(0x4a, 0x0010, 0),
4214 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4215 WRITE_COEF(0x45, 0x5289),
4216 UPDATE_COEF(0x4a, 0x0c00, 0),
4220 switch (codec
->core
.vendor_id
) {
4222 alc_process_coef_fw(codec
, coef0255_1
);
4223 alc_process_coef_fw(codec
, coef0255
);
4227 alc_process_coef_fw(codec
, coef0256
);
4228 alc_process_coef_fw(codec
, coef0255
);
4233 alc_process_coef_fw(codec
, coef0274
);
4237 alc_process_coef_fw(codec
, coef0233
);
4241 alc_process_coef_fw(codec
, coef0288
);
4244 alc_process_coef_fw(codec
, coef0298
);
4245 alc_process_coef_fw(codec
, coef0288
);
4248 alc_process_coef_fw(codec
, coef0292
);
4251 alc_process_coef_fw(codec
, coef0293
);
4254 alc_process_coef_fw(codec
, coef0668
);
4262 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4263 alc_process_coef_fw(codec
, coef0225
);
4266 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4269 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
4273 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
4276 static struct coef_fw coef0255
[] = {
4277 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4278 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4281 static struct coef_fw coef0233
[] = {
4282 UPDATE_COEF(0x35, 0, 1<<14),
4283 WRITE_COEF(0x06, 0x2100),
4284 WRITE_COEF(0x1a, 0x0021),
4285 WRITE_COEF(0x26, 0x008c),
4288 static struct coef_fw coef0288
[] = {
4289 UPDATE_COEF(0x4f, 0x00c0, 0),
4290 UPDATE_COEF(0x50, 0x2000, 0),
4291 UPDATE_COEF(0x56, 0x0006, 0),
4292 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4293 UPDATE_COEF(0x66, 0x0008, 0x0008),
4294 UPDATE_COEF(0x67, 0x2000, 0x2000),
4297 static struct coef_fw coef0292
[] = {
4298 WRITE_COEF(0x19, 0xa208),
4299 WRITE_COEF(0x2e, 0xacf0),
4302 static struct coef_fw coef0293
[] = {
4303 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4304 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4305 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4308 static struct coef_fw coef0688
[] = {
4309 WRITE_COEF(0xb7, 0x802b),
4310 WRITE_COEF(0xb5, 0x1040),
4311 UPDATE_COEF(0xc3, 0, 1<<12),
4314 static struct coef_fw coef0225
[] = {
4315 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4316 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4317 UPDATE_COEF(0x63, 3<<14, 0),
4320 static struct coef_fw coef0274
[] = {
4321 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4322 UPDATE_COEF(0x4a, 0x0010, 0),
4323 UPDATE_COEF(0x6b, 0xf000, 0),
4327 switch (codec
->core
.vendor_id
) {
4331 alc_write_coef_idx(codec
, 0x45, 0xc489);
4332 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4333 alc_process_coef_fw(codec
, coef0255
);
4334 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4339 alc_write_coef_idx(codec
, 0x45, 0x4689);
4340 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4341 alc_process_coef_fw(codec
, coef0274
);
4342 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4346 alc_write_coef_idx(codec
, 0x45, 0xc429);
4347 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4348 alc_process_coef_fw(codec
, coef0233
);
4349 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4354 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4355 alc_process_coef_fw(codec
, coef0288
);
4356 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4359 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4360 alc_process_coef_fw(codec
, coef0292
);
4363 /* Set to TRS mode */
4364 alc_write_coef_idx(codec
, 0x45, 0xc429);
4365 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4366 alc_process_coef_fw(codec
, coef0293
);
4367 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4370 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4374 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4375 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4378 alc_write_coef_idx(codec
, 0x11, 0x0001);
4379 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4380 alc_process_coef_fw(codec
, coef0688
);
4381 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4389 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4390 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4391 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4392 alc_process_coef_fw(codec
, coef0225
);
4393 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4396 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4399 static void alc_headset_mode_default(struct hda_codec
*codec
)
4401 static struct coef_fw coef0225
[] = {
4402 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4403 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4404 UPDATE_COEF(0x49, 3<<8, 0<<8),
4405 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4406 UPDATE_COEF(0x63, 3<<14, 0),
4407 UPDATE_COEF(0x67, 0xf000, 0x3000),
4410 static struct coef_fw coef0255
[] = {
4411 WRITE_COEF(0x45, 0xc089),
4412 WRITE_COEF(0x45, 0xc489),
4413 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4414 WRITE_COEF(0x49, 0x0049),
4417 static struct coef_fw coef0233
[] = {
4418 WRITE_COEF(0x06, 0x2100),
4419 WRITE_COEF(0x32, 0x4ea3),
4422 static struct coef_fw coef0288
[] = {
4423 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4424 UPDATE_COEF(0x50, 0x2000, 0x2000),
4425 UPDATE_COEF(0x56, 0x0006, 0x0006),
4426 UPDATE_COEF(0x66, 0x0008, 0),
4427 UPDATE_COEF(0x67, 0x2000, 0),
4430 static struct coef_fw coef0292
[] = {
4431 WRITE_COEF(0x76, 0x000e),
4432 WRITE_COEF(0x6c, 0x2400),
4433 WRITE_COEF(0x6b, 0xc429),
4434 WRITE_COEF(0x18, 0x7308),
4437 static struct coef_fw coef0293
[] = {
4438 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4439 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4440 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4443 static struct coef_fw coef0688
[] = {
4444 WRITE_COEF(0x11, 0x0041),
4445 WRITE_COEF(0x15, 0x0d40),
4446 WRITE_COEF(0xb7, 0x802b),
4449 static struct coef_fw coef0274
[] = {
4450 WRITE_COEF(0x45, 0x4289),
4451 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4452 UPDATE_COEF(0x6b, 0x0f00, 0),
4453 UPDATE_COEF(0x49, 0x0300, 0x0300),
4457 switch (codec
->core
.vendor_id
) {
4464 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4465 alc_process_coef_fw(codec
, coef0225
);
4470 alc_process_coef_fw(codec
, coef0255
);
4475 alc_process_coef_fw(codec
, coef0274
);
4479 alc_process_coef_fw(codec
, coef0233
);
4484 alc_process_coef_fw(codec
, coef0288
);
4487 alc_process_coef_fw(codec
, coef0292
);
4490 alc_process_coef_fw(codec
, coef0293
);
4493 alc_process_coef_fw(codec
, coef0688
);
4496 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4499 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4503 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4507 static struct coef_fw coef0255
[] = {
4508 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4509 WRITE_COEF(0x1b, 0x0c2b),
4510 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4513 static struct coef_fw coef0256
[] = {
4514 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4515 WRITE_COEF(0x1b, 0x0c6b),
4516 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4519 static struct coef_fw coef0233
[] = {
4520 WRITE_COEF(0x45, 0xd429),
4521 WRITE_COEF(0x1b, 0x0c2b),
4522 WRITE_COEF(0x32, 0x4ea3),
4525 static struct coef_fw coef0288
[] = {
4526 UPDATE_COEF(0x50, 0x2000, 0x2000),
4527 UPDATE_COEF(0x56, 0x0006, 0x0006),
4528 UPDATE_COEF(0x66, 0x0008, 0),
4529 UPDATE_COEF(0x67, 0x2000, 0),
4532 static struct coef_fw coef0292
[] = {
4533 WRITE_COEF(0x6b, 0xd429),
4534 WRITE_COEF(0x76, 0x0008),
4535 WRITE_COEF(0x18, 0x7388),
4538 static struct coef_fw coef0293
[] = {
4539 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4540 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4543 static struct coef_fw coef0688
[] = {
4544 WRITE_COEF(0x11, 0x0001),
4545 WRITE_COEF(0x15, 0x0d60),
4546 WRITE_COEF(0xc3, 0x0000),
4549 static struct coef_fw coef0225_1
[] = {
4550 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4551 UPDATE_COEF(0x63, 3<<14, 2<<14),
4554 static struct coef_fw coef0225_2
[] = {
4555 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4556 UPDATE_COEF(0x63, 3<<14, 1<<14),
4560 switch (codec
->core
.vendor_id
) {
4562 alc_process_coef_fw(codec
, coef0255
);
4566 alc_process_coef_fw(codec
, coef0256
);
4571 alc_write_coef_idx(codec
, 0x45, 0xd689);
4575 alc_process_coef_fw(codec
, coef0233
);
4578 val
= alc_read_coef_idx(codec
, 0x50);
4579 if (val
& (1 << 12)) {
4580 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4581 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4584 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4585 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4591 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4593 alc_process_coef_fw(codec
, coef0288
);
4596 alc_process_coef_fw(codec
, coef0292
);
4599 alc_process_coef_fw(codec
, coef0293
);
4602 alc_process_coef_fw(codec
, coef0688
);
4610 val
= alc_read_coef_idx(codec
, 0x45);
4612 alc_process_coef_fw(codec
, coef0225_2
);
4614 alc_process_coef_fw(codec
, coef0225_1
);
4617 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4620 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4624 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4626 static struct coef_fw coef0255
[] = {
4627 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4628 WRITE_COEF(0x1b, 0x0c2b),
4629 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4632 static struct coef_fw coef0256
[] = {
4633 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4634 WRITE_COEF(0x1b, 0x0c6b),
4635 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4638 static struct coef_fw coef0233
[] = {
4639 WRITE_COEF(0x45, 0xe429),
4640 WRITE_COEF(0x1b, 0x0c2b),
4641 WRITE_COEF(0x32, 0x4ea3),
4644 static struct coef_fw coef0288
[] = {
4645 UPDATE_COEF(0x50, 0x2000, 0x2000),
4646 UPDATE_COEF(0x56, 0x0006, 0x0006),
4647 UPDATE_COEF(0x66, 0x0008, 0),
4648 UPDATE_COEF(0x67, 0x2000, 0),
4651 static struct coef_fw coef0292
[] = {
4652 WRITE_COEF(0x6b, 0xe429),
4653 WRITE_COEF(0x76, 0x0008),
4654 WRITE_COEF(0x18, 0x7388),
4657 static struct coef_fw coef0293
[] = {
4658 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4659 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4662 static struct coef_fw coef0688
[] = {
4663 WRITE_COEF(0x11, 0x0001),
4664 WRITE_COEF(0x15, 0x0d50),
4665 WRITE_COEF(0xc3, 0x0000),
4668 static struct coef_fw coef0225
[] = {
4669 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4670 UPDATE_COEF(0x63, 3<<14, 2<<14),
4674 switch (codec
->core
.vendor_id
) {
4676 alc_process_coef_fw(codec
, coef0255
);
4680 alc_process_coef_fw(codec
, coef0256
);
4685 alc_write_coef_idx(codec
, 0x45, 0xe689);
4689 alc_process_coef_fw(codec
, coef0233
);
4692 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4693 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4698 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4700 alc_process_coef_fw(codec
, coef0288
);
4703 alc_process_coef_fw(codec
, coef0292
);
4706 alc_process_coef_fw(codec
, coef0293
);
4709 alc_process_coef_fw(codec
, coef0688
);
4717 alc_process_coef_fw(codec
, coef0225
);
4720 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4723 static void alc_determine_headset_type(struct hda_codec
*codec
)
4726 bool is_ctia
= false;
4727 struct alc_spec
*spec
= codec
->spec
;
4728 static struct coef_fw coef0255
[] = {
4729 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4730 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4734 static struct coef_fw coef0288
[] = {
4735 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4738 static struct coef_fw coef0298
[] = {
4739 UPDATE_COEF(0x50, 0x2000, 0x2000),
4740 UPDATE_COEF(0x56, 0x0006, 0x0006),
4741 UPDATE_COEF(0x66, 0x0008, 0),
4742 UPDATE_COEF(0x67, 0x2000, 0),
4743 UPDATE_COEF(0x19, 0x1300, 0x1300),
4746 static struct coef_fw coef0293
[] = {
4747 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4748 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4751 static struct coef_fw coef0688
[] = {
4752 WRITE_COEF(0x11, 0x0001),
4753 WRITE_COEF(0xb7, 0x802b),
4754 WRITE_COEF(0x15, 0x0d60),
4755 WRITE_COEF(0xc3, 0x0c00),
4758 static struct coef_fw coef0274
[] = {
4759 UPDATE_COEF(0x4a, 0x0010, 0),
4760 UPDATE_COEF(0x4a, 0x8000, 0),
4761 WRITE_COEF(0x45, 0xd289),
4762 UPDATE_COEF(0x49, 0x0300, 0x0300),
4766 switch (codec
->core
.vendor_id
) {
4770 alc_process_coef_fw(codec
, coef0255
);
4772 val
= alc_read_coef_idx(codec
, 0x46);
4773 is_ctia
= (val
& 0x0070) == 0x0070;
4778 alc_process_coef_fw(codec
, coef0274
);
4780 val
= alc_read_coef_idx(codec
, 0x46);
4781 is_ctia
= (val
& 0x00f0) == 0x00f0;
4785 alc_write_coef_idx(codec
, 0x45, 0xd029);
4787 val
= alc_read_coef_idx(codec
, 0x46);
4788 is_ctia
= (val
& 0x0070) == 0x0070;
4791 snd_hda_codec_write(codec
, 0x21, 0,
4792 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4794 snd_hda_codec_write(codec
, 0x21, 0,
4795 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4798 val
= alc_read_coef_idx(codec
, 0x50);
4799 if (val
& (1 << 12)) {
4800 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4801 alc_process_coef_fw(codec
, coef0288
);
4803 val
= alc_read_coef_idx(codec
, 0x50);
4804 is_ctia
= (val
& 0x0070) == 0x0070;
4806 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4807 alc_process_coef_fw(codec
, coef0288
);
4809 val
= alc_read_coef_idx(codec
, 0x50);
4810 is_ctia
= (val
& 0x0070) == 0x0070;
4812 alc_process_coef_fw(codec
, coef0298
);
4813 snd_hda_codec_write(codec
, 0x21, 0,
4814 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
);
4816 snd_hda_codec_write(codec
, 0x21, 0,
4817 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4821 alc_process_coef_fw(codec
, coef0288
);
4823 val
= alc_read_coef_idx(codec
, 0x50);
4824 is_ctia
= (val
& 0x0070) == 0x0070;
4827 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4829 val
= alc_read_coef_idx(codec
, 0x6c);
4830 is_ctia
= (val
& 0x001c) == 0x001c;
4833 alc_process_coef_fw(codec
, coef0293
);
4835 val
= alc_read_coef_idx(codec
, 0x46);
4836 is_ctia
= (val
& 0x0070) == 0x0070;
4839 alc_process_coef_fw(codec
, coef0688
);
4841 val
= alc_read_coef_idx(codec
, 0xbe);
4842 is_ctia
= (val
& 0x1c02) == 0x1c02;
4850 snd_hda_codec_write(codec
, 0x21, 0,
4851 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4853 snd_hda_codec_write(codec
, 0x21, 0,
4854 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4856 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4857 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x1000);
4858 val
= alc_read_coef_idx(codec
, 0x45);
4859 if (val
& (1 << 9)) {
4860 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4861 alc_update_coef_idx(codec
, 0x49, 3<<8, 2<<8);
4863 val
= alc_read_coef_idx(codec
, 0x46);
4864 is_ctia
= (val
& 0x00f0) == 0x00f0;
4866 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4867 alc_update_coef_idx(codec
, 0x49, 3<<8, 1<<8);
4869 val
= alc_read_coef_idx(codec
, 0x46);
4870 is_ctia
= (val
& 0x00f0) == 0x00f0;
4872 alc_update_coef_idx(codec
, 0x4a, 7<<6, 7<<6);
4873 alc_update_coef_idx(codec
, 0x4a, 3<<4, 3<<4);
4874 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
4876 snd_hda_codec_write(codec
, 0x21, 0,
4877 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
4879 snd_hda_codec_write(codec
, 0x21, 0,
4880 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4887 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4888 is_ctia
? "yes" : "no");
4889 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4892 static void alc_update_headset_mode(struct hda_codec
*codec
)
4894 struct alc_spec
*spec
= codec
->spec
;
4896 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4897 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
4899 int new_headset_mode
;
4901 if (!snd_hda_jack_detect(codec
, hp_pin
))
4902 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4903 else if (mux_pin
== spec
->headset_mic_pin
)
4904 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4905 else if (mux_pin
== spec
->headphone_mic_pin
)
4906 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4908 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4910 if (new_headset_mode
== spec
->current_headset_mode
) {
4911 snd_hda_gen_update_outputs(codec
);
4915 switch (new_headset_mode
) {
4916 case ALC_HEADSET_MODE_UNPLUGGED
:
4917 alc_headset_mode_unplugged(codec
);
4918 spec
->gen
.hp_jack_present
= false;
4920 case ALC_HEADSET_MODE_HEADSET
:
4921 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4922 alc_determine_headset_type(codec
);
4923 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4924 alc_headset_mode_ctia(codec
);
4925 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4926 alc_headset_mode_omtp(codec
);
4927 spec
->gen
.hp_jack_present
= true;
4929 case ALC_HEADSET_MODE_MIC
:
4930 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4931 spec
->gen
.hp_jack_present
= false;
4933 case ALC_HEADSET_MODE_HEADPHONE
:
4934 alc_headset_mode_default(codec
);
4935 spec
->gen
.hp_jack_present
= true;
4938 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
4939 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
4940 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
4941 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
4942 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
4945 spec
->current_headset_mode
= new_headset_mode
;
4947 snd_hda_gen_update_outputs(codec
);
4950 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
4951 struct snd_kcontrol
*kcontrol
,
4952 struct snd_ctl_elem_value
*ucontrol
)
4954 alc_update_headset_mode(codec
);
4957 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
4958 struct hda_jack_callback
*jack
)
4960 struct alc_spec
*spec
= codec
->spec
;
4961 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
4962 snd_hda_gen_hp_automute(codec
, jack
);
4965 static void alc_probe_headset_mode(struct hda_codec
*codec
)
4968 struct alc_spec
*spec
= codec
->spec
;
4969 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4972 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4973 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
4974 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
4975 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
4976 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
4979 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
4980 spec
->gen
.automute_hook
= alc_update_headset_mode
;
4981 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
4984 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
4985 const struct hda_fixup
*fix
, int action
)
4987 struct alc_spec
*spec
= codec
->spec
;
4990 case HDA_FIXUP_ACT_PRE_PROBE
:
4991 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
4993 case HDA_FIXUP_ACT_PROBE
:
4994 alc_probe_headset_mode(codec
);
4996 case HDA_FIXUP_ACT_INIT
:
4997 spec
->current_headset_mode
= 0;
4998 alc_update_headset_mode(codec
);
5003 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
5004 const struct hda_fixup
*fix
, int action
)
5006 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5007 struct alc_spec
*spec
= codec
->spec
;
5008 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5011 alc_fixup_headset_mode(codec
, fix
, action
);
5014 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
5016 /* Set to iphone type */
5017 static struct coef_fw alc255fw
[] = {
5018 WRITE_COEF(0x1b, 0x880b),
5019 WRITE_COEF(0x45, 0xd089),
5020 WRITE_COEF(0x1b, 0x080b),
5021 WRITE_COEF(0x46, 0x0004),
5022 WRITE_COEF(0x1b, 0x0c0b),
5025 static struct coef_fw alc256fw
[] = {
5026 WRITE_COEF(0x1b, 0x884b),
5027 WRITE_COEF(0x45, 0xd089),
5028 WRITE_COEF(0x1b, 0x084b),
5029 WRITE_COEF(0x46, 0x0004),
5030 WRITE_COEF(0x1b, 0x0c4b),
5033 switch (codec
->core
.vendor_id
) {
5035 alc_process_coef_fw(codec
, alc255fw
);
5039 alc_process_coef_fw(codec
, alc256fw
);
5045 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
5046 const struct hda_fixup
*fix
, int action
)
5048 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5049 alc255_set_default_jack_type(codec
);
5051 alc_fixup_headset_mode(codec
, fix
, action
);
5054 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
5055 const struct hda_fixup
*fix
, int action
)
5057 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5058 struct alc_spec
*spec
= codec
->spec
;
5059 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5060 alc255_set_default_jack_type(codec
);
5063 alc_fixup_headset_mode(codec
, fix
, action
);
5066 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
5067 struct hda_jack_callback
*jack
)
5069 struct alc_spec
*spec
= codec
->spec
;
5072 alc_update_headset_jack_cb(codec
, jack
);
5073 /* Headset Mic enable or disable, only for Dell Dino */
5074 present
= spec
->gen
.hp_jack_present
? 0x40 : 0;
5075 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
5079 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
5080 const struct hda_fixup
*fix
, int action
)
5082 alc_fixup_headset_mode(codec
, fix
, action
);
5083 if (action
== HDA_FIXUP_ACT_PROBE
) {
5084 struct alc_spec
*spec
= codec
->spec
;
5085 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
5089 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
5090 const struct hda_fixup
*fix
, int action
)
5092 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5093 struct alc_spec
*spec
= codec
->spec
;
5094 spec
->gen
.auto_mute_via_amp
= 1;
5098 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
5099 const struct hda_fixup
*fix
, int action
)
5101 if (action
== HDA_FIXUP_ACT_PROBE
) {
5102 struct alc_spec
*spec
= codec
->spec
;
5103 spec
->no_shutup_pins
= 1;
5107 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
5108 const struct hda_fixup
*fix
, int action
)
5110 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5111 struct alc_spec
*spec
= codec
->spec
;
5112 /* Disable AA-loopback as it causes white noise */
5113 spec
->gen
.mixer_nid
= 0;
5117 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5118 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
5119 const struct hda_fixup
*fix
, int action
)
5121 static const struct hda_pintbl pincfgs
[] = {
5122 { 0x16, 0x21211010 }, /* dock headphone */
5123 { 0x19, 0x21a11010 }, /* dock mic */
5126 struct alc_spec
*spec
= codec
->spec
;
5128 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5129 spec
->reboot_notify
= alc_d3_at_reboot
; /* reduce noise */
5130 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5131 codec
->power_save_node
= 0; /* avoid click noises */
5132 snd_hda_apply_pincfgs(codec
, pincfgs
);
5136 static void alc_fixup_tpt470_dock(struct hda_codec
*codec
,
5137 const struct hda_fixup
*fix
, int action
)
5139 static const struct hda_pintbl pincfgs
[] = {
5140 { 0x17, 0x21211010 }, /* dock headphone */
5141 { 0x19, 0x21a11010 }, /* dock mic */
5144 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5145 * the speaker output becomes too low by some reason on Thinkpads with
5148 static hda_nid_t preferred_pairs
[] = {
5149 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5152 struct alc_spec
*spec
= codec
->spec
;
5154 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5155 spec
->gen
.preferred_dacs
= preferred_pairs
;
5156 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5157 snd_hda_apply_pincfgs(codec
, pincfgs
);
5158 } else if (action
== HDA_FIXUP_ACT_INIT
) {
5159 /* Enable DOCK device */
5160 snd_hda_codec_write(codec
, 0x17, 0,
5161 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5162 /* Enable DOCK device */
5163 snd_hda_codec_write(codec
, 0x19, 0,
5164 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5168 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
5170 struct alc_spec
*spec
= codec
->spec
;
5171 int hp_pin
= alc_get_hp_pin(spec
);
5173 /* Prevent pop noises when headphones are plugged in */
5174 snd_hda_codec_write(codec
, hp_pin
, 0,
5175 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5179 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
5180 const struct hda_fixup
*fix
, int action
)
5182 struct alc_spec
*spec
= codec
->spec
;
5183 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
5187 case HDA_FIXUP_ACT_PRE_PROBE
:
5188 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5189 * it causes a click noise at start up
5191 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5193 case HDA_FIXUP_ACT_PROBE
:
5194 spec
->shutup
= alc_shutup_dell_xps13
;
5196 /* Make the internal mic the default input source. */
5197 for (i
= 0; i
< imux
->num_items
; i
++) {
5198 if (spec
->gen
.imux_pins
[i
] == 0x12) {
5199 spec
->gen
.cur_mux
[0] = i
;
5207 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
5208 const struct hda_fixup
*fix
, int action
)
5210 struct alc_spec
*spec
= codec
->spec
;
5212 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5213 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5214 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
5216 /* Disable boost for mic-in permanently. (This code is only called
5217 from quirks that guarantee that the headphone is at NID 0x1b.) */
5218 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
5219 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
5221 alc_fixup_headset_mode(codec
, fix
, action
);
5224 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
5225 const struct hda_fixup
*fix
, int action
)
5227 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5228 alc_write_coef_idx(codec
, 0xc4, 0x8000);
5229 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
5230 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
5232 alc_fixup_headset_mode(codec
, fix
, action
);
5235 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5236 static int find_ext_mic_pin(struct hda_codec
*codec
)
5238 struct alc_spec
*spec
= codec
->spec
;
5239 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5241 unsigned int defcfg
;
5244 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5245 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5247 nid
= cfg
->inputs
[i
].pin
;
5248 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5249 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
5257 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
5258 const struct hda_fixup
*fix
,
5261 struct alc_spec
*spec
= codec
->spec
;
5263 if (action
== HDA_FIXUP_ACT_PROBE
) {
5264 int mic_pin
= find_ext_mic_pin(codec
);
5265 int hp_pin
= alc_get_hp_pin(spec
);
5267 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
5269 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
5273 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
5274 const struct hda_fixup
*fix
,
5277 struct alc_spec
*spec
= codec
->spec
;
5278 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5281 /* The mic boosts on level 2 and 3 are too noisy
5282 on the internal mic input.
5283 Therefore limit the boost to 0 or 1. */
5285 if (action
!= HDA_FIXUP_ACT_PROBE
)
5288 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5289 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5290 unsigned int defcfg
;
5291 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5293 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5294 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
5297 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
5298 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
5299 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5300 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5301 (0 << AC_AMPCAP_MUTE_SHIFT
));
5305 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
5306 struct hda_jack_callback
*jack
)
5308 struct alc_spec
*spec
= codec
->spec
;
5312 snd_hda_gen_hp_automute(codec
, jack
);
5314 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
5317 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5321 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
5322 const struct hda_fixup
*fix
, int action
)
5324 struct alc_spec
*spec
= codec
->spec
;
5327 case HDA_FIXUP_ACT_PRE_PROBE
:
5328 snd_hda_override_wcaps(codec
, 0x03, 0);
5329 /* Disable AA-loopback as it causes white noise */
5330 spec
->gen
.mixer_nid
= 0;
5332 case HDA_FIXUP_ACT_INIT
:
5333 /* MIC2-VREF control */
5334 /* Set to manual mode */
5335 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5336 /* Enable Line1 input control by verb */
5337 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
5342 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
5343 const struct hda_fixup
*fix
, int action
)
5345 struct alc_spec
*spec
= codec
->spec
;
5348 case HDA_FIXUP_ACT_PRE_PROBE
:
5349 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
5351 case HDA_FIXUP_ACT_INIT
:
5352 /* MIC2-VREF control */
5353 /* Set to manual mode */
5354 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5359 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5360 static void asus_tx300_automute(struct hda_codec
*codec
)
5362 struct alc_spec
*spec
= codec
->spec
;
5363 snd_hda_gen_update_outputs(codec
);
5364 if (snd_hda_jack_detect(codec
, 0x1b))
5365 spec
->gen
.mute_bits
|= (1ULL << 0x14);
5368 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
5369 const struct hda_fixup
*fix
, int action
)
5371 struct alc_spec
*spec
= codec
->spec
;
5372 /* TX300 needs to set up GPIO2 for the speaker amp */
5373 static const struct hda_verb gpio2_verbs
[] = {
5374 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
5375 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
5376 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
5379 static const struct hda_pintbl dock_pins
[] = {
5380 { 0x1b, 0x21114000 }, /* dock speaker pin */
5385 case HDA_FIXUP_ACT_PRE_PROBE
:
5386 snd_hda_add_verbs(codec
, gpio2_verbs
);
5387 snd_hda_apply_pincfgs(codec
, dock_pins
);
5388 spec
->gen
.auto_mute_via_amp
= 1;
5389 spec
->gen
.automute_hook
= asus_tx300_automute
;
5390 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
5391 snd_hda_gen_hp_automute
);
5393 case HDA_FIXUP_ACT_BUILD
:
5394 /* this is a bit tricky; give more sane names for the main
5395 * (tablet) speaker and the dock speaker, respectively
5397 rename_ctl(codec
, "Speaker Playback Switch",
5398 "Dock Speaker Playback Switch");
5399 rename_ctl(codec
, "Bass Speaker Playback Switch",
5400 "Speaker Playback Switch");
5405 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
5406 const struct hda_fixup
*fix
, int action
)
5408 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5409 /* DAC node 0x03 is giving mono output. We therefore want to
5410 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5411 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5412 hda_nid_t conn1
[2] = { 0x0c };
5413 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
5414 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
5418 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
5419 const struct hda_fixup
*fix
, int action
)
5421 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5422 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5423 we can't adjust the speaker's volume since this node does not has
5424 Amp-out capability. we change the speaker's route to:
5425 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5426 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5427 speaker's volume now. */
5429 hda_nid_t conn1
[1] = { 0x0c };
5430 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
5434 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5435 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
5436 const struct hda_fixup
*fix
, int action
)
5438 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5439 hda_nid_t conn
[2] = { 0x02, 0x03 };
5440 snd_hda_override_conn_list(codec
, 0x17, 2, conn
);
5444 /* Hook to update amp GPIO4 for automute */
5445 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
5446 struct hda_jack_callback
*jack
)
5448 struct alc_spec
*spec
= codec
->spec
;
5450 snd_hda_gen_hp_automute(codec
, jack
);
5451 /* mute_led_polarity is set to 0, so we pass inverted value here */
5452 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
5455 /* Manage GPIOs for HP EliteBook Folio 9480m.
5457 * GPIO4 is the headphone amplifier power control
5458 * GPIO3 is the audio output mute indicator LED
5461 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5462 const struct hda_fixup
*fix
,
5465 struct alc_spec
*spec
= codec
->spec
;
5466 static const struct hda_verb gpio_init
[] = {
5467 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
5468 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
5472 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5473 /* Set the hooks to turn the headphone amp on/off
5476 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
5477 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5479 /* The GPIOs are currently off */
5482 /* GPIO3 is connected to the output mute LED,
5483 * high is on, low is off
5485 spec
->mute_led_polarity
= 0;
5486 spec
->gpio_mute_led_mask
= 0x08;
5488 /* Initialize GPIO configuration */
5489 snd_hda_add_verbs(codec
, gpio_init
);
5493 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5494 const struct hda_fixup
*fix
,
5497 alc_fixup_dual_codecs(codec
, fix
, action
);
5499 case HDA_FIXUP_ACT_PRE_PROBE
:
5500 /* override card longname to provide a unique UCM profile */
5501 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5503 case HDA_FIXUP_ACT_BUILD
:
5504 /* rename Capture controls depending on the codec */
5505 rename_ctl(codec
, "Capture Volume",
5507 "Rear-Panel Capture Volume" :
5508 "Front-Panel Capture Volume");
5509 rename_ctl(codec
, "Capture Switch",
5511 "Rear-Panel Capture Switch" :
5512 "Front-Panel Capture Switch");
5517 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5518 static void alc274_fixup_bind_dacs(struct hda_codec
*codec
,
5519 const struct hda_fixup
*fix
, int action
)
5521 struct alc_spec
*spec
= codec
->spec
;
5522 static hda_nid_t preferred_pairs
[] = {
5523 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5527 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5530 spec
->gen
.preferred_dacs
= preferred_pairs
;
5531 spec
->gen
.auto_mute_via_amp
= 1;
5532 codec
->power_save_node
= 0;
5535 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5536 static void alc285_fixup_invalidate_dacs(struct hda_codec
*codec
,
5537 const struct hda_fixup
*fix
, int action
)
5539 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5542 snd_hda_override_wcaps(codec
, 0x03, 0);
5545 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
5546 const struct hda_fixup
*fix
, int action
)
5548 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5549 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5552 /* for hda_fixup_thinkpad_acpi() */
5553 #include "thinkpad_helper.c"
5555 static void alc_fixup_thinkpad_acpi(struct hda_codec
*codec
,
5556 const struct hda_fixup
*fix
, int action
)
5558 alc_fixup_no_shutup(codec
, fix
, action
); /* reduce click noise */
5559 hda_fixup_thinkpad_acpi(codec
, fix
, action
);
5562 /* for dell wmi mic mute led */
5563 #include "dell_wmi_helper.c"
5566 ALC269_FIXUP_SONY_VAIO
,
5567 ALC275_FIXUP_SONY_VAIO_GPIO2
,
5568 ALC269_FIXUP_DELL_M101Z
,
5569 ALC269_FIXUP_SKU_IGNORE
,
5570 ALC269_FIXUP_ASUS_G73JW
,
5571 ALC269_FIXUP_LENOVO_EAPD
,
5572 ALC275_FIXUP_SONY_HWEQ
,
5573 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
5575 ALC269_FIXUP_PCM_44K
,
5576 ALC269_FIXUP_STEREO_DMIC
,
5577 ALC269_FIXUP_HEADSET_MIC
,
5578 ALC269_FIXUP_QUANTA_MUTE
,
5579 ALC269_FIXUP_LIFEBOOK
,
5580 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
5581 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
5582 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
5583 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
5586 ALC269VB_FIXUP_AMIC
,
5587 ALC269VB_FIXUP_DMIC
,
5588 ALC269_FIXUP_HP_MUTE_LED
,
5589 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5590 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
5591 ALC269_FIXUP_HP_GPIO_LED
,
5592 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
5593 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
5594 ALC269_FIXUP_INV_DMIC
,
5595 ALC269_FIXUP_LENOVO_DOCK
,
5596 ALC269_FIXUP_NO_SHUTUP
,
5597 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
5598 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
5599 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5600 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
5601 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5602 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
5603 ALC269_FIXUP_HEADSET_MODE
,
5604 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5605 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
5606 ALC269_FIXUP_ASUS_X101_FUNC
,
5607 ALC269_FIXUP_ASUS_X101_VERB
,
5608 ALC269_FIXUP_ASUS_X101
,
5609 ALC271_FIXUP_AMIC_MIC2
,
5610 ALC271_FIXUP_HP_GATE_MIC_JACK
,
5611 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
5612 ALC269_FIXUP_ACER_AC700
,
5613 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
5614 ALC269VB_FIXUP_ASUS_ZENBOOK
,
5615 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
5616 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
5617 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
5618 ALC283_FIXUP_CHROME_BOOK
,
5619 ALC283_FIXUP_SENSE_COMBO_JACK
,
5620 ALC282_FIXUP_ASUS_TX300
,
5621 ALC283_FIXUP_INT_MIC
,
5622 ALC290_FIXUP_MONO_SPEAKERS
,
5623 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5624 ALC290_FIXUP_SUBWOOFER
,
5625 ALC290_FIXUP_SUBWOOFER_HSJACK
,
5626 ALC269_FIXUP_THINKPAD_ACPI
,
5627 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
5628 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
5629 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
5630 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5631 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5632 ALC255_FIXUP_HEADSET_MODE
,
5633 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5634 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5635 ALC292_FIXUP_TPT440_DOCK
,
5636 ALC292_FIXUP_TPT440
,
5637 ALC283_FIXUP_HEADSET_MIC
,
5638 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
,
5639 ALC282_FIXUP_ASPIRE_V5_PINS
,
5640 ALC280_FIXUP_HP_GPIO4
,
5641 ALC286_FIXUP_HP_GPIO_LED
,
5642 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
5643 ALC280_FIXUP_HP_DOCK_PINS
,
5644 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
5645 ALC280_FIXUP_HP_9480M
,
5646 ALC288_FIXUP_DELL_HEADSET_MODE
,
5647 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
5648 ALC288_FIXUP_DELL_XPS_13_GPIO6
,
5649 ALC288_FIXUP_DELL_XPS_13
,
5650 ALC288_FIXUP_DISABLE_AAMIX
,
5651 ALC292_FIXUP_DELL_E7X
,
5652 ALC292_FIXUP_DISABLE_AAMIX
,
5653 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
5654 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
5655 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5656 ALC275_FIXUP_DELL_XPS
,
5657 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
5658 ALC293_FIXUP_LENOVO_SPK_NOISE
,
5659 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
5660 ALC255_FIXUP_DELL_SPK_NOISE
,
5661 ALC225_FIXUP_DISABLE_MIC_VREF
,
5662 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5663 ALC295_FIXUP_DISABLE_DAC3
,
5664 ALC280_FIXUP_HP_HEADSET_MIC
,
5665 ALC221_FIXUP_HP_FRONT_MIC
,
5666 ALC292_FIXUP_TPT460
,
5667 ALC298_FIXUP_SPK_VOLUME
,
5668 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
5669 ALC269_FIXUP_ATIV_BOOK_8
,
5670 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
5671 ALC256_FIXUP_ASUS_HEADSET_MODE
,
5672 ALC256_FIXUP_ASUS_MIC
,
5673 ALC256_FIXUP_ASUS_AIO_GPIO2
,
5674 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
5675 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
5676 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
5677 ALC294_FIXUP_LENOVO_MIC_LOCATION
,
5678 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
,
5679 ALC700_FIXUP_INTEL_REFERENCE
,
5680 ALC274_FIXUP_DELL_BIND_DACS
,
5681 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
5682 ALC298_FIXUP_TPT470_DOCK
,
5683 ALC255_FIXUP_DUMMY_LINEOUT_VERB
,
5684 ALC255_FIXUP_DELL_HEADSET_MIC
,
5685 ALC221_FIXUP_HP_HEADSET_MIC
,
5686 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
,
5687 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
5688 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
5689 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
,
5690 ALC294_FIXUP_ASUS_MIC
,
5691 ALC294_FIXUP_ASUS_HEADSET_MIC
,
5692 ALC294_FIXUP_ASUS_SPK
,
5693 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
,
5694 ALC225_FIXUP_WYSE_AUTO_MUTE
,
5695 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
,
5696 ALC286_FIXUP_ACER_AIO_HEADSET_MIC
,
5697 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
5700 static const struct hda_fixup alc269_fixups
[] = {
5701 [ALC269_FIXUP_SONY_VAIO
] = {
5702 .type
= HDA_FIXUP_PINCTLS
,
5703 .v
.pins
= (const struct hda_pintbl
[]) {
5704 {0x19, PIN_VREFGRD
},
5708 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
5709 .type
= HDA_FIXUP_VERBS
,
5710 .v
.verbs
= (const struct hda_verb
[]) {
5711 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
5712 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
5713 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5717 .chain_id
= ALC269_FIXUP_SONY_VAIO
5719 [ALC269_FIXUP_DELL_M101Z
] = {
5720 .type
= HDA_FIXUP_VERBS
,
5721 .v
.verbs
= (const struct hda_verb
[]) {
5722 /* Enables internal speaker */
5723 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
5724 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
5728 [ALC269_FIXUP_SKU_IGNORE
] = {
5729 .type
= HDA_FIXUP_FUNC
,
5730 .v
.func
= alc_fixup_sku_ignore
,
5732 [ALC269_FIXUP_ASUS_G73JW
] = {
5733 .type
= HDA_FIXUP_PINS
,
5734 .v
.pins
= (const struct hda_pintbl
[]) {
5735 { 0x17, 0x99130111 }, /* subwoofer */
5739 [ALC269_FIXUP_LENOVO_EAPD
] = {
5740 .type
= HDA_FIXUP_VERBS
,
5741 .v
.verbs
= (const struct hda_verb
[]) {
5742 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5746 [ALC275_FIXUP_SONY_HWEQ
] = {
5747 .type
= HDA_FIXUP_FUNC
,
5748 .v
.func
= alc269_fixup_hweq
,
5750 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
5752 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
5753 .type
= HDA_FIXUP_FUNC
,
5754 .v
.func
= alc_fixup_disable_aamix
,
5756 .chain_id
= ALC269_FIXUP_SONY_VAIO
5758 [ALC271_FIXUP_DMIC
] = {
5759 .type
= HDA_FIXUP_FUNC
,
5760 .v
.func
= alc271_fixup_dmic
,
5762 [ALC269_FIXUP_PCM_44K
] = {
5763 .type
= HDA_FIXUP_FUNC
,
5764 .v
.func
= alc269_fixup_pcm_44k
,
5766 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5768 [ALC269_FIXUP_STEREO_DMIC
] = {
5769 .type
= HDA_FIXUP_FUNC
,
5770 .v
.func
= alc269_fixup_stereo_dmic
,
5772 [ALC269_FIXUP_HEADSET_MIC
] = {
5773 .type
= HDA_FIXUP_FUNC
,
5774 .v
.func
= alc269_fixup_headset_mic
,
5776 [ALC269_FIXUP_QUANTA_MUTE
] = {
5777 .type
= HDA_FIXUP_FUNC
,
5778 .v
.func
= alc269_fixup_quanta_mute
,
5780 [ALC269_FIXUP_LIFEBOOK
] = {
5781 .type
= HDA_FIXUP_PINS
,
5782 .v
.pins
= (const struct hda_pintbl
[]) {
5783 { 0x1a, 0x2101103f }, /* dock line-out */
5784 { 0x1b, 0x23a11040 }, /* dock mic-in */
5788 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5790 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5791 .type
= HDA_FIXUP_PINS
,
5792 .v
.pins
= (const struct hda_pintbl
[]) {
5793 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5797 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5798 .type
= HDA_FIXUP_PINS
,
5799 .v
.pins
= (const struct hda_pintbl
[]) {
5800 { 0x21, 0x0221102f }, /* HP out */
5804 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5805 .type
= HDA_FIXUP_FUNC
,
5806 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5808 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
5809 .type
= HDA_FIXUP_FUNC
,
5810 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
5812 [ALC269_FIXUP_AMIC
] = {
5813 .type
= HDA_FIXUP_PINS
,
5814 .v
.pins
= (const struct hda_pintbl
[]) {
5815 { 0x14, 0x99130110 }, /* speaker */
5816 { 0x15, 0x0121401f }, /* HP out */
5817 { 0x18, 0x01a19c20 }, /* mic */
5818 { 0x19, 0x99a3092f }, /* int-mic */
5822 [ALC269_FIXUP_DMIC
] = {
5823 .type
= HDA_FIXUP_PINS
,
5824 .v
.pins
= (const struct hda_pintbl
[]) {
5825 { 0x12, 0x99a3092f }, /* int-mic */
5826 { 0x14, 0x99130110 }, /* speaker */
5827 { 0x15, 0x0121401f }, /* HP out */
5828 { 0x18, 0x01a19c20 }, /* mic */
5832 [ALC269VB_FIXUP_AMIC
] = {
5833 .type
= HDA_FIXUP_PINS
,
5834 .v
.pins
= (const struct hda_pintbl
[]) {
5835 { 0x14, 0x99130110 }, /* speaker */
5836 { 0x18, 0x01a19c20 }, /* mic */
5837 { 0x19, 0x99a3092f }, /* int-mic */
5838 { 0x21, 0x0121401f }, /* HP out */
5842 [ALC269VB_FIXUP_DMIC
] = {
5843 .type
= HDA_FIXUP_PINS
,
5844 .v
.pins
= (const struct hda_pintbl
[]) {
5845 { 0x12, 0x99a3092f }, /* int-mic */
5846 { 0x14, 0x99130110 }, /* speaker */
5847 { 0x18, 0x01a19c20 }, /* mic */
5848 { 0x21, 0x0121401f }, /* HP out */
5852 [ALC269_FIXUP_HP_MUTE_LED
] = {
5853 .type
= HDA_FIXUP_FUNC
,
5854 .v
.func
= alc269_fixup_hp_mute_led
,
5856 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5857 .type
= HDA_FIXUP_FUNC
,
5858 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5860 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5861 .type
= HDA_FIXUP_FUNC
,
5862 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5864 [ALC269_FIXUP_HP_GPIO_LED
] = {
5865 .type
= HDA_FIXUP_FUNC
,
5866 .v
.func
= alc269_fixup_hp_gpio_led
,
5868 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5869 .type
= HDA_FIXUP_FUNC
,
5870 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5872 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5873 .type
= HDA_FIXUP_FUNC
,
5874 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5876 [ALC269_FIXUP_INV_DMIC
] = {
5877 .type
= HDA_FIXUP_FUNC
,
5878 .v
.func
= alc_fixup_inv_dmic
,
5880 [ALC269_FIXUP_NO_SHUTUP
] = {
5881 .type
= HDA_FIXUP_FUNC
,
5882 .v
.func
= alc_fixup_no_shutup
,
5884 [ALC269_FIXUP_LENOVO_DOCK
] = {
5885 .type
= HDA_FIXUP_PINS
,
5886 .v
.pins
= (const struct hda_pintbl
[]) {
5887 { 0x19, 0x23a11040 }, /* dock mic */
5888 { 0x1b, 0x2121103f }, /* dock headphone */
5892 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5894 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5895 .type
= HDA_FIXUP_FUNC
,
5896 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5898 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5900 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5901 .type
= HDA_FIXUP_PINS
,
5902 .v
.pins
= (const struct hda_pintbl
[]) {
5903 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5904 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5908 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5910 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5911 .type
= HDA_FIXUP_PINS
,
5912 .v
.pins
= (const struct hda_pintbl
[]) {
5913 { 0x16, 0x21014020 }, /* dock line out */
5914 { 0x19, 0x21a19030 }, /* dock mic */
5915 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5919 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5921 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5922 .type
= HDA_FIXUP_PINS
,
5923 .v
.pins
= (const struct hda_pintbl
[]) {
5924 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5928 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5930 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
5931 .type
= HDA_FIXUP_PINS
,
5932 .v
.pins
= (const struct hda_pintbl
[]) {
5933 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5934 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5938 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5940 [ALC269_FIXUP_HEADSET_MODE
] = {
5941 .type
= HDA_FIXUP_FUNC
,
5942 .v
.func
= alc_fixup_headset_mode
,
5944 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5946 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5947 .type
= HDA_FIXUP_FUNC
,
5948 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
5950 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
5951 .type
= HDA_FIXUP_PINS
,
5952 .v
.pins
= (const struct hda_pintbl
[]) {
5953 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5957 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
5959 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
5960 .type
= HDA_FIXUP_PINS
,
5961 .v
.pins
= (const struct hda_pintbl
[]) {
5962 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5966 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5968 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
5969 .type
= HDA_FIXUP_FUNC
,
5970 .v
.func
= alc269_fixup_x101_headset_mic
,
5972 [ALC269_FIXUP_ASUS_X101_VERB
] = {
5973 .type
= HDA_FIXUP_VERBS
,
5974 .v
.verbs
= (const struct hda_verb
[]) {
5975 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5976 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
5977 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
5981 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
5983 [ALC269_FIXUP_ASUS_X101
] = {
5984 .type
= HDA_FIXUP_PINS
,
5985 .v
.pins
= (const struct hda_pintbl
[]) {
5986 { 0x18, 0x04a1182c }, /* Headset mic */
5990 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
5992 [ALC271_FIXUP_AMIC_MIC2
] = {
5993 .type
= HDA_FIXUP_PINS
,
5994 .v
.pins
= (const struct hda_pintbl
[]) {
5995 { 0x14, 0x99130110 }, /* speaker */
5996 { 0x19, 0x01a19c20 }, /* mic */
5997 { 0x1b, 0x99a7012f }, /* int-mic */
5998 { 0x21, 0x0121401f }, /* HP out */
6002 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
6003 .type
= HDA_FIXUP_FUNC
,
6004 .v
.func
= alc271_hp_gate_mic_jack
,
6006 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
6008 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
6009 .type
= HDA_FIXUP_FUNC
,
6010 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6012 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
6014 [ALC269_FIXUP_ACER_AC700
] = {
6015 .type
= HDA_FIXUP_PINS
,
6016 .v
.pins
= (const struct hda_pintbl
[]) {
6017 { 0x12, 0x99a3092f }, /* int-mic */
6018 { 0x14, 0x99130110 }, /* speaker */
6019 { 0x18, 0x03a11c20 }, /* mic */
6020 { 0x1e, 0x0346101e }, /* SPDIF1 */
6021 { 0x21, 0x0321101f }, /* HP out */
6025 .chain_id
= ALC271_FIXUP_DMIC
,
6027 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
6028 .type
= HDA_FIXUP_FUNC
,
6029 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6031 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6033 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
6034 .type
= HDA_FIXUP_FUNC
,
6035 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6037 .chain_id
= ALC269VB_FIXUP_DMIC
,
6039 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
6040 .type
= HDA_FIXUP_VERBS
,
6041 .v
.verbs
= (const struct hda_verb
[]) {
6042 /* class-D output amp +5dB */
6043 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
6044 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
6048 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
6050 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
6051 .type
= HDA_FIXUP_FUNC
,
6052 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6054 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6056 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
6057 .type
= HDA_FIXUP_PINS
,
6058 .v
.pins
= (const struct hda_pintbl
[]) {
6059 { 0x12, 0x99a3092f }, /* int-mic */
6060 { 0x18, 0x03a11d20 }, /* mic */
6061 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6065 [ALC283_FIXUP_CHROME_BOOK
] = {
6066 .type
= HDA_FIXUP_FUNC
,
6067 .v
.func
= alc283_fixup_chromebook
,
6069 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
6070 .type
= HDA_FIXUP_FUNC
,
6071 .v
.func
= alc283_fixup_sense_combo_jack
,
6073 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
6075 [ALC282_FIXUP_ASUS_TX300
] = {
6076 .type
= HDA_FIXUP_FUNC
,
6077 .v
.func
= alc282_fixup_asus_tx300
,
6079 [ALC283_FIXUP_INT_MIC
] = {
6080 .type
= HDA_FIXUP_VERBS
,
6081 .v
.verbs
= (const struct hda_verb
[]) {
6082 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
6083 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
6087 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6089 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
6090 .type
= HDA_FIXUP_PINS
,
6091 .v
.pins
= (const struct hda_pintbl
[]) {
6092 { 0x17, 0x90170112 }, /* subwoofer */
6096 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6098 [ALC290_FIXUP_SUBWOOFER
] = {
6099 .type
= HDA_FIXUP_PINS
,
6100 .v
.pins
= (const struct hda_pintbl
[]) {
6101 { 0x17, 0x90170112 }, /* subwoofer */
6105 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
6107 [ALC290_FIXUP_MONO_SPEAKERS
] = {
6108 .type
= HDA_FIXUP_FUNC
,
6109 .v
.func
= alc290_fixup_mono_speakers
,
6111 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
6112 .type
= HDA_FIXUP_FUNC
,
6113 .v
.func
= alc290_fixup_mono_speakers
,
6115 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6117 [ALC269_FIXUP_THINKPAD_ACPI
] = {
6118 .type
= HDA_FIXUP_FUNC
,
6119 .v
.func
= alc_fixup_thinkpad_acpi
,
6121 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
6123 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
6124 .type
= HDA_FIXUP_FUNC
,
6125 .v
.func
= alc_fixup_inv_dmic
,
6127 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6129 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
6130 .type
= HDA_FIXUP_PINS
,
6131 .v
.pins
= (const struct hda_pintbl
[]) {
6132 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6136 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6138 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6139 .type
= HDA_FIXUP_PINS
,
6140 .v
.pins
= (const struct hda_pintbl
[]) {
6141 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6145 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6147 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6148 .type
= HDA_FIXUP_PINS
,
6149 .v
.pins
= (const struct hda_pintbl
[]) {
6150 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6151 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6155 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6157 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6158 .type
= HDA_FIXUP_PINS
,
6159 .v
.pins
= (const struct hda_pintbl
[]) {
6160 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6164 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6166 [ALC255_FIXUP_HEADSET_MODE
] = {
6167 .type
= HDA_FIXUP_FUNC
,
6168 .v
.func
= alc_fixup_headset_mode_alc255
,
6170 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6172 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6173 .type
= HDA_FIXUP_FUNC
,
6174 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
6176 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6177 .type
= HDA_FIXUP_PINS
,
6178 .v
.pins
= (const struct hda_pintbl
[]) {
6179 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6180 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6184 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6186 [ALC292_FIXUP_TPT440_DOCK
] = {
6187 .type
= HDA_FIXUP_FUNC
,
6188 .v
.func
= alc_fixup_tpt440_dock
,
6190 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6192 [ALC292_FIXUP_TPT440
] = {
6193 .type
= HDA_FIXUP_FUNC
,
6194 .v
.func
= alc_fixup_disable_aamix
,
6196 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
6198 [ALC283_FIXUP_HEADSET_MIC
] = {
6199 .type
= HDA_FIXUP_PINS
,
6200 .v
.pins
= (const struct hda_pintbl
[]) {
6201 { 0x19, 0x04a110f0 },
6205 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
] = {
6206 .type
= HDA_FIXUP_FUNC
,
6207 .v
.func
= alc_fixup_dell_wmi
,
6209 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
6210 .type
= HDA_FIXUP_PINS
,
6211 .v
.pins
= (const struct hda_pintbl
[]) {
6212 { 0x12, 0x90a60130 },
6213 { 0x14, 0x90170110 },
6214 { 0x17, 0x40000008 },
6215 { 0x18, 0x411111f0 },
6216 { 0x19, 0x01a1913c },
6217 { 0x1a, 0x411111f0 },
6218 { 0x1b, 0x411111f0 },
6219 { 0x1d, 0x40f89b2d },
6220 { 0x1e, 0x411111f0 },
6221 { 0x21, 0x0321101f },
6225 [ALC280_FIXUP_HP_GPIO4
] = {
6226 .type
= HDA_FIXUP_FUNC
,
6227 .v
.func
= alc280_fixup_hp_gpio4
,
6229 [ALC286_FIXUP_HP_GPIO_LED
] = {
6230 .type
= HDA_FIXUP_FUNC
,
6231 .v
.func
= alc286_fixup_hp_gpio_led
,
6233 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
6234 .type
= HDA_FIXUP_FUNC
,
6235 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
6237 [ALC280_FIXUP_HP_DOCK_PINS
] = {
6238 .type
= HDA_FIXUP_PINS
,
6239 .v
.pins
= (const struct hda_pintbl
[]) {
6240 { 0x1b, 0x21011020 }, /* line-out */
6241 { 0x1a, 0x01a1903c }, /* headset mic */
6242 { 0x18, 0x2181103f }, /* line-in */
6246 .chain_id
= ALC280_FIXUP_HP_GPIO4
6248 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
6249 .type
= HDA_FIXUP_PINS
,
6250 .v
.pins
= (const struct hda_pintbl
[]) {
6251 { 0x1b, 0x21011020 }, /* line-out */
6252 { 0x18, 0x2181103f }, /* line-in */
6256 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
6258 [ALC280_FIXUP_HP_9480M
] = {
6259 .type
= HDA_FIXUP_FUNC
,
6260 .v
.func
= alc280_fixup_hp_9480m
,
6262 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
6263 .type
= HDA_FIXUP_FUNC
,
6264 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
6266 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6268 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6269 .type
= HDA_FIXUP_PINS
,
6270 .v
.pins
= (const struct hda_pintbl
[]) {
6271 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6272 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6276 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
6278 [ALC288_FIXUP_DELL_XPS_13_GPIO6
] = {
6279 .type
= HDA_FIXUP_VERBS
,
6280 .v
.verbs
= (const struct hda_verb
[]) {
6281 {0x01, AC_VERB_SET_GPIO_MASK
, 0x40},
6282 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x40},
6283 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
6287 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6289 [ALC288_FIXUP_DISABLE_AAMIX
] = {
6290 .type
= HDA_FIXUP_FUNC
,
6291 .v
.func
= alc_fixup_disable_aamix
,
6293 .chain_id
= ALC288_FIXUP_DELL_XPS_13_GPIO6
6295 [ALC288_FIXUP_DELL_XPS_13
] = {
6296 .type
= HDA_FIXUP_FUNC
,
6297 .v
.func
= alc_fixup_dell_xps13
,
6299 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
6301 [ALC292_FIXUP_DISABLE_AAMIX
] = {
6302 .type
= HDA_FIXUP_FUNC
,
6303 .v
.func
= alc_fixup_disable_aamix
,
6305 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6307 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
6308 .type
= HDA_FIXUP_FUNC
,
6309 .v
.func
= alc_fixup_disable_aamix
,
6311 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6313 [ALC292_FIXUP_DELL_E7X
] = {
6314 .type
= HDA_FIXUP_FUNC
,
6315 .v
.func
= alc_fixup_dell_xps13
,
6317 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
6319 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6320 .type
= HDA_FIXUP_PINS
,
6321 .v
.pins
= (const struct hda_pintbl
[]) {
6322 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6323 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6327 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6329 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
6330 .type
= HDA_FIXUP_PINS
,
6331 .v
.pins
= (const struct hda_pintbl
[]) {
6332 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6336 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6338 [ALC275_FIXUP_DELL_XPS
] = {
6339 .type
= HDA_FIXUP_VERBS
,
6340 .v
.verbs
= (const struct hda_verb
[]) {
6341 /* Enables internal speaker */
6342 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
6343 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
6344 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
6345 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
6349 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
6350 .type
= HDA_FIXUP_VERBS
,
6351 .v
.verbs
= (const struct hda_verb
[]) {
6352 /* Disable pass-through path for FRONT 14h */
6353 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
6354 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
6358 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6360 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
6361 .type
= HDA_FIXUP_FUNC
,
6362 .v
.func
= alc_fixup_disable_aamix
,
6364 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6366 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
6367 .type
= HDA_FIXUP_FUNC
,
6368 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
6370 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
6371 .type
= HDA_FIXUP_FUNC
,
6372 .v
.func
= alc_fixup_disable_aamix
,
6374 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6376 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
6377 .type
= HDA_FIXUP_FUNC
,
6378 .v
.func
= alc_fixup_disable_mic_vref
,
6380 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6382 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6383 .type
= HDA_FIXUP_VERBS
,
6384 .v
.verbs
= (const struct hda_verb
[]) {
6385 /* Disable pass-through path for FRONT 14h */
6386 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6387 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6391 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
6393 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
6394 .type
= HDA_FIXUP_FUNC
,
6395 .v
.func
= alc_fixup_disable_aamix
,
6397 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
6399 [ALC221_FIXUP_HP_FRONT_MIC
] = {
6400 .type
= HDA_FIXUP_PINS
,
6401 .v
.pins
= (const struct hda_pintbl
[]) {
6402 { 0x19, 0x02a19020 }, /* Front Mic */
6406 [ALC292_FIXUP_TPT460
] = {
6407 .type
= HDA_FIXUP_FUNC
,
6408 .v
.func
= alc_fixup_tpt440_dock
,
6410 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
6412 [ALC298_FIXUP_SPK_VOLUME
] = {
6413 .type
= HDA_FIXUP_FUNC
,
6414 .v
.func
= alc298_fixup_speaker_volume
,
6416 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
6418 [ALC295_FIXUP_DISABLE_DAC3
] = {
6419 .type
= HDA_FIXUP_FUNC
,
6420 .v
.func
= alc295_fixup_disable_dac3
,
6422 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
6423 .type
= HDA_FIXUP_PINS
,
6424 .v
.pins
= (const struct hda_pintbl
[]) {
6425 { 0x1b, 0x90170151 },
6429 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6431 [ALC269_FIXUP_ATIV_BOOK_8
] = {
6432 .type
= HDA_FIXUP_FUNC
,
6433 .v
.func
= alc_fixup_auto_mute_via_amp
,
6435 .chain_id
= ALC269_FIXUP_NO_SHUTUP
6437 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
6438 .type
= HDA_FIXUP_PINS
,
6439 .v
.pins
= (const struct hda_pintbl
[]) {
6440 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6441 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6445 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6447 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
6448 .type
= HDA_FIXUP_FUNC
,
6449 .v
.func
= alc_fixup_headset_mode
,
6451 [ALC256_FIXUP_ASUS_MIC
] = {
6452 .type
= HDA_FIXUP_PINS
,
6453 .v
.pins
= (const struct hda_pintbl
[]) {
6454 { 0x13, 0x90a60160 }, /* use as internal mic */
6455 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6459 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6461 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
6462 .type
= HDA_FIXUP_VERBS
,
6463 .v
.verbs
= (const struct hda_verb
[]) {
6464 /* Set up GPIO2 for the speaker amp */
6465 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
6466 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
6467 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
6471 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6472 .type
= HDA_FIXUP_PINS
,
6473 .v
.pins
= (const struct hda_pintbl
[]) {
6474 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6478 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6480 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
6481 .type
= HDA_FIXUP_VERBS
,
6482 .v
.verbs
= (const struct hda_verb
[]) {
6483 /* Enables internal speaker */
6484 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
6485 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
6489 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6491 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
6492 .type
= HDA_FIXUP_FUNC
,
6493 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
6495 [ALC294_FIXUP_LENOVO_MIC_LOCATION
] = {
6496 .type
= HDA_FIXUP_PINS
,
6497 .v
.pins
= (const struct hda_pintbl
[]) {
6498 /* Change the mic location from front to right, otherwise there are
6499 two front mics with the same name, pulseaudio can't handle them.
6500 This is just a temporary workaround, after applying this fixup,
6501 there will be one "Front Mic" and one "Mic" in this machine.
6503 { 0x1a, 0x04a19040 },
6507 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
] = {
6508 .type
= HDA_FIXUP_PINS
,
6509 .v
.pins
= (const struct hda_pintbl
[]) {
6510 { 0x16, 0x0101102f }, /* Rear Headset HP */
6511 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6512 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6513 { 0x1b, 0x02011020 },
6517 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6519 [ALC700_FIXUP_INTEL_REFERENCE
] = {
6520 .type
= HDA_FIXUP_VERBS
,
6521 .v
.verbs
= (const struct hda_verb
[]) {
6522 /* Enables internal speaker */
6523 {0x20, AC_VERB_SET_COEF_INDEX
, 0x45},
6524 {0x20, AC_VERB_SET_PROC_COEF
, 0x5289},
6525 {0x20, AC_VERB_SET_COEF_INDEX
, 0x4A},
6526 {0x20, AC_VERB_SET_PROC_COEF
, 0x001b},
6527 {0x58, AC_VERB_SET_COEF_INDEX
, 0x00},
6528 {0x58, AC_VERB_SET_PROC_COEF
, 0x3888},
6529 {0x20, AC_VERB_SET_COEF_INDEX
, 0x6f},
6530 {0x20, AC_VERB_SET_PROC_COEF
, 0x2c0b},
6534 [ALC274_FIXUP_DELL_BIND_DACS
] = {
6535 .type
= HDA_FIXUP_FUNC
,
6536 .v
.func
= alc274_fixup_bind_dacs
,
6538 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6540 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
] = {
6541 .type
= HDA_FIXUP_PINS
,
6542 .v
.pins
= (const struct hda_pintbl
[]) {
6543 { 0x1b, 0x0401102f },
6547 .chain_id
= ALC274_FIXUP_DELL_BIND_DACS
6549 [ALC298_FIXUP_TPT470_DOCK
] = {
6550 .type
= HDA_FIXUP_FUNC
,
6551 .v
.func
= alc_fixup_tpt470_dock
,
6553 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
6555 [ALC255_FIXUP_DUMMY_LINEOUT_VERB
] = {
6556 .type
= HDA_FIXUP_PINS
,
6557 .v
.pins
= (const struct hda_pintbl
[]) {
6558 { 0x14, 0x0201101f },
6562 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6564 [ALC255_FIXUP_DELL_HEADSET_MIC
] = {
6565 .type
= HDA_FIXUP_PINS
,
6566 .v
.pins
= (const struct hda_pintbl
[]) {
6567 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6571 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6573 [ALC221_FIXUP_HP_HEADSET_MIC
] = {
6574 .type
= HDA_FIXUP_PINS
,
6575 .v
.pins
= (const struct hda_pintbl
[]) {
6576 { 0x19, 0x0181313f},
6580 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6582 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
] = {
6583 .type
= HDA_FIXUP_FUNC
,
6584 .v
.func
= alc285_fixup_invalidate_dacs
,
6586 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6588 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
] = {
6589 .type
= HDA_FIXUP_VERBS
,
6590 .v
.verbs
= (const struct hda_verb
[]) {
6591 /* Disable PCBEEP-IN passthrough */
6592 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6593 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6597 .chain_id
= ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6599 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
] = {
6600 .type
= HDA_FIXUP_PINS
,
6601 .v
.pins
= (const struct hda_pintbl
[]) {
6602 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6606 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6608 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
] = {
6609 .type
= HDA_FIXUP_PINS
,
6610 .v
.pins
= (const struct hda_pintbl
[]) {
6611 { 0x16, 0x01011020 }, /* Rear Line out */
6612 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6616 .chain_id
= ALC225_FIXUP_WYSE_AUTO_MUTE
6618 [ALC225_FIXUP_WYSE_AUTO_MUTE
] = {
6619 .type
= HDA_FIXUP_FUNC
,
6620 .v
.func
= alc_fixup_auto_mute_via_amp
,
6622 .chain_id
= ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6624 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
] = {
6625 .type
= HDA_FIXUP_FUNC
,
6626 .v
.func
= alc_fixup_disable_mic_vref
,
6628 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6630 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
] = {
6631 .type
= HDA_FIXUP_PINS
,
6632 .v
.pins
= (const struct hda_pintbl
[]) {
6633 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6637 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6639 [ALC294_FIXUP_ASUS_MIC
] = {
6640 .type
= HDA_FIXUP_PINS
,
6641 .v
.pins
= (const struct hda_pintbl
[]) {
6642 { 0x13, 0x90a60160 }, /* use as internal mic */
6643 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6647 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6649 [ALC294_FIXUP_ASUS_HEADSET_MIC
] = {
6650 .type
= HDA_FIXUP_PINS
,
6651 .v
.pins
= (const struct hda_pintbl
[]) {
6652 { 0x19, 0x01a1103c }, /* use as headset mic */
6656 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6658 [ALC294_FIXUP_ASUS_SPK
] = {
6659 .type
= HDA_FIXUP_VERBS
,
6660 .v
.verbs
= (const struct hda_verb
[]) {
6662 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x40 },
6663 { 0x20, AC_VERB_SET_PROC_COEF
, 0x8800 },
6667 .chain_id
= ALC294_FIXUP_ASUS_HEADSET_MIC
6669 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC
] = {
6670 .type
= HDA_FIXUP_VERBS
,
6671 .v
.verbs
= (const struct hda_verb
[]) {
6672 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x4f },
6673 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5029 },
6677 .chain_id
= ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
6679 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6680 .type
= HDA_FIXUP_PINS
,
6681 .v
.pins
= (const struct hda_pintbl
[]) {
6682 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6686 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6690 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
6691 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
6692 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
6693 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
6694 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
6695 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6696 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6697 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6698 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6699 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6700 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6701 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
6702 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
),
6703 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
6704 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
6705 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
6706 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6707 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6708 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6709 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6710 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
6711 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
6712 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
6713 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
6714 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
6715 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
6716 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
6717 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6718 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6719 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6720 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6721 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6722 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
6723 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
6724 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
6725 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6726 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6727 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
6728 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6729 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6730 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6731 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6732 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6733 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6734 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6735 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6736 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6737 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6738 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6739 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6740 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
6741 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP
),
6742 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6743 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME
),
6744 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
6745 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
6746 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6747 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
),
6748 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6749 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6750 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6751 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6752 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6753 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB
),
6754 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
),
6755 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
),
6756 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6757 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6758 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6759 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
6760 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
6761 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
6762 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
6764 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6765 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6766 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6767 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6768 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6769 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6770 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6771 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6772 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6773 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6774 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6775 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6776 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
6777 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6778 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6779 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6780 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6781 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6782 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6783 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6784 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
6785 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6786 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6788 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6789 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6790 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6791 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6792 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6793 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6794 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6795 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6796 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6797 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
6798 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6799 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6800 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6801 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6802 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6803 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6804 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6805 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6806 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6807 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6808 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6809 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6810 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6811 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6812 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6813 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6814 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6815 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6816 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6817 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
6818 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6819 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6820 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
6821 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6822 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6823 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6824 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
6825 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6826 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK
),
6827 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6828 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6829 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6830 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6831 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6832 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6833 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
6834 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
6835 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
6836 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
6837 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
6838 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
6839 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
6840 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
6841 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
6842 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6843 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6844 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
6845 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
6846 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
6847 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
6848 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6849 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6850 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
6851 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6852 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6853 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
6854 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6855 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6856 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
6857 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
6858 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
6859 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6860 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6861 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
6862 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
6863 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE
),
6864 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE
),
6865 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
6866 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
6867 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
6868 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
6869 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC
),
6870 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6871 SND_PCI_QUIRK(0x1558, 0x8550, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6872 SND_PCI_QUIRK(0x1558, 0x8551, "System76 Gazelle (gaze14)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6873 SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
6874 SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC
),
6875 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
6876 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
6877 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
6878 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
6879 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
6880 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
6881 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
6882 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
6883 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
6884 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
6885 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
6886 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
6887 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
6888 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
6889 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
6890 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
6891 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
6892 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
6893 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6894 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
6895 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
6896 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
6897 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6898 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6899 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
6900 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
6901 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK
),
6902 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6903 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6904 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460
),
6905 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6906 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6907 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6908 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6909 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6910 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6911 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6912 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6913 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6914 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6915 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
6916 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
6917 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP
),
6918 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6919 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
6920 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
6921 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6922 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
6923 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
6924 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
6925 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
6926 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
6927 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
6928 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
6929 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
6930 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6931 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6932 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6933 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6934 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6935 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6936 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
6937 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
6938 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
6941 /* Below is a quirk table taken from the old code.
6942 * Basically the device should work as is without the fixup table.
6943 * If BIOS doesn't give a proper info, enable the corresponding
6946 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
6948 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
6949 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
6950 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
6951 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
6952 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
6953 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
6954 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
6955 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
6956 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
6957 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
6958 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
6959 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
6960 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
6961 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
6962 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
6963 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
6964 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
6965 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
6966 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
6967 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
6968 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
6969 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
6970 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
6971 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
6972 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
6973 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
6974 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
6975 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
6976 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
6977 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
6978 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
6979 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
6980 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
6981 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
6982 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
6983 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
6984 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
6985 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
6986 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
6991 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
6992 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
6993 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
6994 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
6995 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
6999 static const struct hda_model_fixup alc269_fixup_models
[] = {
7000 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
7001 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
7002 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
7003 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
7004 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
7005 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
7006 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
7007 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
7008 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
7009 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
7010 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
7011 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
7012 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
7013 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
7014 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
7015 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
7016 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
7017 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
7018 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
7019 {.id
= ALC700_FIXUP_INTEL_REFERENCE
, .name
= "alc700-ref"},
7022 #define ALC225_STANDARD_PINS \
7025 #define ALC256_STANDARD_PINS \
7026 {0x12, 0x90a60140}, \
7027 {0x14, 0x90170110}, \
7030 #define ALC282_STANDARD_PINS \
7033 #define ALC290_STANDARD_PINS \
7036 #define ALC292_STANDARD_PINS \
7037 {0x14, 0x90170110}, \
7040 #define ALC295_STANDARD_PINS \
7041 {0x12, 0xb7a60130}, \
7042 {0x14, 0x90170110}, \
7045 #define ALC298_STANDARD_PINS \
7046 {0x12, 0x90a60130}, \
7049 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
7050 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC
,
7055 {0x21, 0x0221102f}),
7056 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
7059 {0x21, 0x02211030}),
7060 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
7063 {0x21, 0x03211020}),
7064 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
7067 {0x21, 0x03211020}),
7068 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7069 ALC225_STANDARD_PINS
,
7071 {0x14, 0x901701a0}),
7072 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7073 ALC225_STANDARD_PINS
,
7075 {0x14, 0x901701b0}),
7076 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7077 ALC225_STANDARD_PINS
,
7079 {0x14, 0x901701a0}),
7080 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7081 ALC225_STANDARD_PINS
,
7083 {0x14, 0x901701b0}),
7084 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7085 ALC225_STANDARD_PINS
,
7087 {0x1b, 0x90170110}),
7088 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7091 {0x21, 0x02211020}),
7092 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
7096 {0x21, 0x02211020}),
7097 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7102 {0x21, 0x0221101f}),
7103 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7108 {0x21, 0x0221101f}),
7109 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7113 {0x21, 0x0221101f}),
7114 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7117 {0x21, 0x02211020}),
7118 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
7122 {0x21, 0x02211020}),
7123 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7126 {0x21, 0x02211020}),
7127 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7128 {0x21, 0x02211020}),
7129 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
7131 {0x21, 0x02211020}),
7132 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7134 {0x21, 0x02211040}),
7135 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7138 {0x21, 0x02211020}),
7139 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7142 {0x21, 0x02211030}),
7143 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7146 {0x21, 0x0221101f}),
7147 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7150 {0x21, 0x0221101f}),
7151 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7154 {0x21, 0x0221103f}),
7155 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7158 {0x21, 0x0221103f}),
7159 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7162 {0x21, 0x0221103f}),
7163 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7166 {0x21, 0x0221105f}),
7167 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7170 {0x21, 0x0221101f}),
7171 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7175 {0x21, 0x0321102f}),
7176 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7179 {0x21, 0x02211040}),
7180 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7183 {0x21, 0x02211050}),
7184 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7187 {0x21, 0x02211030}),
7188 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7191 {0x21, 0x02211040}),
7192 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7195 {0x21, 0x02211040}),
7196 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7199 {0x21, 0x02211050}),
7200 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7203 {0x21, 0x02211040}),
7204 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7207 {0x21, 0x02211030}),
7208 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7210 {0x21, 0x02211010}),
7211 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7215 {0x21, 0x0221101f}),
7216 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7219 {0x21, 0x02211030}),
7220 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7223 {0x21, 0x02211030}),
7224 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7227 {0x21, 0x02211030}),
7228 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7231 {0x21, 0x02211020}),
7232 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7236 {0x21, 0x0221101f}),
7237 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7238 ALC256_STANDARD_PINS
),
7239 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7242 {0x21, 0x0221101f}),
7243 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7246 {0x21, 0x04211020}),
7247 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7250 {0x21, 0x03211020}),
7251 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7254 {0x21, 0x03211020}),
7255 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
7259 {0x21, 0x04211020}),
7260 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
7264 {0x1a, 0x04a11020}),
7265 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
7271 {0x1b, 0x02011020}),
7272 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7273 ALC282_STANDARD_PINS
,
7276 {0x21, 0x0321101f}),
7277 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7278 ALC282_STANDARD_PINS
,
7281 {0x21, 0x03211040}),
7282 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7283 ALC282_STANDARD_PINS
,
7286 {0x21, 0x03211020}),
7287 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7288 ALC282_STANDARD_PINS
,
7291 {0x21, 0x0421101f}),
7292 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
7293 ALC282_STANDARD_PINS
,
7296 {0x21, 0x04211020}),
7297 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7298 ALC282_STANDARD_PINS
,
7300 {0x21, 0x0321101f}),
7301 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7304 {0x21, 0x02211030}),
7305 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7306 ALC282_STANDARD_PINS
,
7309 {0x21, 0x0321101f}),
7310 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
7314 {0x21, 0x04211020}),
7315 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6
,
7318 {0x21, 0x0321101f}),
7319 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7322 {0x21, 0x04211020}),
7323 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7324 ALC290_STANDARD_PINS
,
7327 {0x1a, 0x04a11020}),
7328 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7329 ALC290_STANDARD_PINS
,
7332 {0x1a, 0x04a11020}),
7333 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7334 ALC290_STANDARD_PINS
,
7336 {0x1a, 0x04a11020}),
7337 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7338 ALC290_STANDARD_PINS
,
7340 {0x1a, 0x04a11040}),
7341 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7342 ALC290_STANDARD_PINS
,
7345 {0x1a, 0x04a11040}),
7346 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7347 ALC290_STANDARD_PINS
,
7350 {0x1a, 0x04a11020}),
7351 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7352 ALC290_STANDARD_PINS
,
7355 {0x1a, 0x04a11020}),
7356 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7357 ALC292_STANDARD_PINS
,
7360 {0x19, 0x01a19030}),
7361 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7362 ALC292_STANDARD_PINS
,
7366 {0x19, 0x01a1903e}),
7367 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
7368 ALC292_STANDARD_PINS
,
7369 {0x12, 0x90a60140}),
7370 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7371 ALC292_STANDARD_PINS
,
7374 {0x19, 0x21a19030}),
7375 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7376 ALC292_STANDARD_PINS
,
7377 {0x13, 0x90a60140}),
7378 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC
,
7381 {0x21, 0x04211020}),
7382 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7385 {0x21, 0x03211020}),
7386 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7389 {0x21, 0x04211020}),
7390 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7391 ALC295_STANDARD_PINS
,
7393 {0x18, 0x21a19030}),
7394 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7395 ALC295_STANDARD_PINS
,
7397 {0x18, 0x21a19050}),
7398 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7399 ALC295_STANDARD_PINS
),
7400 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7401 ALC298_STANDARD_PINS
,
7402 {0x17, 0x90170110}),
7403 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7404 ALC298_STANDARD_PINS
,
7405 {0x17, 0x90170140}),
7406 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7407 ALC298_STANDARD_PINS
,
7408 {0x17, 0x90170150}),
7409 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
7414 {0x21, 0x03211030}),
7415 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7416 ALC225_STANDARD_PINS
,
7418 {0x17, 0x90170110}),
7419 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
7422 {0x21, 0x02211020}),
7426 static void alc269_fill_coef(struct hda_codec
*codec
)
7428 struct alc_spec
*spec
= codec
->spec
;
7431 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
7434 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
7435 alc_write_coef_idx(codec
, 0xf, 0x960b);
7436 alc_write_coef_idx(codec
, 0xe, 0x8817);
7439 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
7440 alc_write_coef_idx(codec
, 0xf, 0x960b);
7441 alc_write_coef_idx(codec
, 0xe, 0x8814);
7444 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
7445 /* Power up output pin */
7446 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
7449 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
7450 val
= alc_read_coef_idx(codec
, 0xd);
7451 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
7452 /* Capless ramp up clock control */
7453 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
7455 val
= alc_read_coef_idx(codec
, 0x17);
7456 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
7457 /* Class D power on reset */
7458 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
7463 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
7468 static int patch_alc269(struct hda_codec
*codec
)
7470 struct alc_spec
*spec
;
7473 err
= alc_alloc_spec(codec
, 0x0b);
7478 spec
->gen
.shared_mic_vref_pin
= 0x18;
7479 codec
->power_save_node
= 1;
7482 codec
->patch_ops
.suspend
= alc269_suspend
;
7483 codec
->patch_ops
.resume
= alc269_resume
;
7485 spec
->shutup
= alc_default_shutup
;
7486 spec
->init_hook
= alc_default_init
;
7488 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
7489 alc269_fixup_tbl
, alc269_fixups
);
7490 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
7491 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
7493 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7495 alc_auto_parse_customize_define(codec
);
7497 if (has_cdefine_beep(codec
))
7498 spec
->gen
.beep_nid
= 0x01;
7500 switch (codec
->core
.vendor_id
) {
7502 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
7503 switch (alc_get_coef0(codec
) & 0x00f0) {
7505 if (codec
->bus
->pci
&&
7506 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7507 spec
->cdefine
.platform_type
== 1)
7508 err
= alc_codec_rename(codec
, "ALC271X");
7509 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
7512 if (codec
->bus
->pci
&&
7513 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
7514 codec
->bus
->pci
->subsystem_device
== 0x21f3)
7515 err
= alc_codec_rename(codec
, "ALC3202");
7516 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
7519 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
7522 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7526 spec
->shutup
= alc269_shutup
;
7527 spec
->init_hook
= alc269_fill_coef
;
7528 alc269_fill_coef(codec
);
7533 spec
->codec_variant
= ALC269_TYPE_ALC280
;
7536 spec
->codec_variant
= ALC269_TYPE_ALC282
;
7537 spec
->shutup
= alc282_shutup
;
7538 spec
->init_hook
= alc282_init
;
7542 spec
->codec_variant
= ALC269_TYPE_ALC283
;
7543 spec
->shutup
= alc283_shutup
;
7544 spec
->init_hook
= alc283_init
;
7548 spec
->codec_variant
= ALC269_TYPE_ALC284
;
7551 spec
->codec_variant
= ALC269_TYPE_ALC293
;
7555 spec
->codec_variant
= ALC269_TYPE_ALC286
;
7558 spec
->codec_variant
= ALC269_TYPE_ALC298
;
7562 spec
->codec_variant
= ALC269_TYPE_ALC255
;
7563 spec
->shutup
= alc256_shutup
;
7564 spec
->init_hook
= alc256_init
;
7568 spec
->codec_variant
= ALC269_TYPE_ALC256
;
7569 spec
->shutup
= alc256_shutup
;
7570 spec
->init_hook
= alc256_init
;
7571 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
7572 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
7575 spec
->codec_variant
= ALC269_TYPE_ALC257
;
7576 spec
->shutup
= alc256_shutup
;
7577 spec
->init_hook
= alc256_init
;
7578 spec
->gen
.mixer_nid
= 0;
7583 spec
->codec_variant
= ALC269_TYPE_ALC215
;
7584 spec
->gen
.mixer_nid
= 0;
7588 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7589 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225 ALC295 */
7592 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7593 spec
->shutup
= alc225_shutup
;
7594 spec
->init_hook
= alc225_init
;
7595 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225, ALC295 and ALC299 */
7600 spec
->codec_variant
= ALC269_TYPE_ALC294
;
7601 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
7602 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7603 spec
->init_hook
= alc294_init
;
7606 spec
->codec_variant
= ALC269_TYPE_ALC300
;
7607 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC300 */
7612 spec
->codec_variant
= ALC269_TYPE_ALC700
;
7613 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
7614 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7615 spec
->init_hook
= alc294_init
;
7620 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
7621 spec
->has_alc5505_dsp
= 1;
7622 spec
->init_hook
= alc5505_dsp_init
;
7625 /* automatic parse from the BIOS config */
7626 err
= alc269_parse_auto_config(codec
);
7630 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
)
7631 set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
7633 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7646 static int alc861_parse_auto_config(struct hda_codec
*codec
)
7648 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
7649 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
7650 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
7653 /* Pin config fixes */
7655 ALC861_FIXUP_FSC_AMILO_PI1505
,
7656 ALC861_FIXUP_AMP_VREF_0F
,
7657 ALC861_FIXUP_NO_JACK_DETECT
,
7658 ALC861_FIXUP_ASUS_A6RP
,
7659 ALC660_FIXUP_ASUS_W7J
,
7662 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7663 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
7664 const struct hda_fixup
*fix
, int action
)
7666 struct alc_spec
*spec
= codec
->spec
;
7669 if (action
!= HDA_FIXUP_ACT_INIT
)
7671 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
7672 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
7673 val
|= AC_PINCTL_IN_EN
;
7674 val
|= AC_PINCTL_VREF_50
;
7675 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
7676 spec
->gen
.keep_vref_in_automute
= 1;
7679 /* suppress the jack-detection */
7680 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
7681 const struct hda_fixup
*fix
, int action
)
7683 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
7684 codec
->no_jack_detect
= 1;
7687 static const struct hda_fixup alc861_fixups
[] = {
7688 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
7689 .type
= HDA_FIXUP_PINS
,
7690 .v
.pins
= (const struct hda_pintbl
[]) {
7691 { 0x0b, 0x0221101f }, /* HP */
7692 { 0x0f, 0x90170310 }, /* speaker */
7696 [ALC861_FIXUP_AMP_VREF_0F
] = {
7697 .type
= HDA_FIXUP_FUNC
,
7698 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7700 [ALC861_FIXUP_NO_JACK_DETECT
] = {
7701 .type
= HDA_FIXUP_FUNC
,
7702 .v
.func
= alc_fixup_no_jack_detect
,
7704 [ALC861_FIXUP_ASUS_A6RP
] = {
7705 .type
= HDA_FIXUP_FUNC
,
7706 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7708 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
7710 [ALC660_FIXUP_ASUS_W7J
] = {
7711 .type
= HDA_FIXUP_VERBS
,
7712 .v
.verbs
= (const struct hda_verb
[]) {
7713 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7714 * for enabling outputs
7716 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
7722 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
7723 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
7724 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
7725 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
7726 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
7727 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
7728 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
7729 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
7730 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
7736 static int patch_alc861(struct hda_codec
*codec
)
7738 struct alc_spec
*spec
;
7741 err
= alc_alloc_spec(codec
, 0x15);
7746 spec
->gen
.beep_nid
= 0x23;
7749 spec
->power_hook
= alc_power_eapd
;
7752 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
7753 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7755 /* automatic parse from the BIOS config */
7756 err
= alc861_parse_auto_config(codec
);
7760 if (!spec
->gen
.no_analog
)
7761 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
7763 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7777 * In addition, an independent DAC
7779 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
7781 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
7782 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7783 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
7787 ALC660VD_FIX_ASUS_GPIO1
,
7788 ALC861VD_FIX_DALLAS
,
7791 /* exclude VREF80 */
7792 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
7793 const struct hda_fixup
*fix
, int action
)
7795 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7796 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
7797 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
7801 static const struct hda_fixup alc861vd_fixups
[] = {
7802 [ALC660VD_FIX_ASUS_GPIO1
] = {
7803 .type
= HDA_FIXUP_VERBS
,
7804 .v
.verbs
= (const struct hda_verb
[]) {
7806 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
7807 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
7808 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
7812 [ALC861VD_FIX_DALLAS
] = {
7813 .type
= HDA_FIXUP_FUNC
,
7814 .v
.func
= alc861vd_fixup_dallas
,
7818 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
7819 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
7820 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
7821 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
7827 static int patch_alc861vd(struct hda_codec
*codec
)
7829 struct alc_spec
*spec
;
7832 err
= alc_alloc_spec(codec
, 0x0b);
7837 spec
->gen
.beep_nid
= 0x23;
7839 spec
->shutup
= alc_eapd_shutup
;
7841 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
7842 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7844 /* automatic parse from the BIOS config */
7845 err
= alc861vd_parse_auto_config(codec
);
7849 if (!spec
->gen
.no_analog
)
7850 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
7852 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7864 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
7865 * configuration. Each pin widget can choose any input DACs and a mixer.
7866 * Each ADC is connected from a mixer of all inputs. This makes possible
7867 * 6-channel independent captures.
7869 * In addition, an independent DAC for the multi-playback (not used in this
7874 * BIOS auto configuration
7877 static int alc662_parse_auto_config(struct hda_codec
*codec
)
7879 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
7880 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
7881 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7882 const hda_nid_t
*ssids
;
7884 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
7885 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
7886 codec
->core
.vendor_id
== 0x10ec0671)
7887 ssids
= alc663_ssids
;
7889 ssids
= alc662_ssids
;
7890 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
7893 static void alc272_fixup_mario(struct hda_codec
*codec
,
7894 const struct hda_fixup
*fix
, int action
)
7896 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
7898 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
7899 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
7900 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
7901 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
7902 (0 << AC_AMPCAP_MUTE_SHIFT
)))
7903 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
7906 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
7908 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
7910 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
7911 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
7915 /* override the 2.1 chmap */
7916 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
7917 const struct hda_fixup
*fix
, int action
)
7919 if (action
== HDA_FIXUP_ACT_BUILD
) {
7920 struct alc_spec
*spec
= codec
->spec
;
7921 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
7925 /* avoid D3 for keeping GPIO up */
7926 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
7928 unsigned int power_state
)
7930 struct alc_spec
*spec
= codec
->spec
;
7931 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
7936 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
7937 const struct hda_fixup
*fix
, int action
)
7939 struct alc_spec
*spec
= codec
->spec
;
7940 static const struct hda_verb gpio_init
[] = {
7941 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
7942 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
7946 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7947 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
7949 spec
->mute_led_polarity
= 1;
7950 spec
->gpio_mute_led_mask
= 0x01;
7951 snd_hda_add_verbs(codec
, gpio_init
);
7952 codec
->power_filter
= gpio_led_power_filter
;
7956 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
7957 struct hda_jack_callback
*jack
)
7959 struct alc_spec
*spec
= codec
->spec
;
7962 snd_hda_gen_hp_automute(codec
, jack
);
7964 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
7966 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
7970 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
7971 const struct hda_fixup
*fix
, int action
)
7973 struct alc_spec
*spec
= codec
->spec
;
7974 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7975 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
7976 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
7980 static struct coef_fw alc668_coefs
[] = {
7981 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
7982 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
7983 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
7984 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
7985 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
7986 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
7987 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
7988 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
7989 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
7990 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
7991 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
7992 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
7993 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
7994 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
7995 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
7996 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
7997 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
7998 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
7999 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8000 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8004 static void alc668_restore_default_value(struct hda_codec
*codec
)
8006 alc_process_coef_fw(codec
, alc668_coefs
);
8010 ALC662_FIXUP_ASPIRE
,
8011 ALC662_FIXUP_LED_GPIO1
,
8012 ALC662_FIXUP_IDEAPAD
,
8014 ALC662_FIXUP_CZC_P10T
,
8015 ALC662_FIXUP_SKU_IGNORE
,
8016 ALC662_FIXUP_HP_RP5800
,
8017 ALC662_FIXUP_ASUS_MODE1
,
8018 ALC662_FIXUP_ASUS_MODE2
,
8019 ALC662_FIXUP_ASUS_MODE3
,
8020 ALC662_FIXUP_ASUS_MODE4
,
8021 ALC662_FIXUP_ASUS_MODE5
,
8022 ALC662_FIXUP_ASUS_MODE6
,
8023 ALC662_FIXUP_ASUS_MODE7
,
8024 ALC662_FIXUP_ASUS_MODE8
,
8025 ALC662_FIXUP_NO_JACK_DETECT
,
8026 ALC662_FIXUP_ZOTAC_Z68
,
8027 ALC662_FIXUP_INV_DMIC
,
8028 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8029 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
8030 ALC662_FIXUP_HEADSET_MODE
,
8031 ALC668_FIXUP_HEADSET_MODE
,
8032 ALC662_FIXUP_BASS_MODE4_CHMAP
,
8033 ALC662_FIXUP_BASS_16
,
8034 ALC662_FIXUP_BASS_1A
,
8035 ALC662_FIXUP_BASS_CHMAP
,
8036 ALC668_FIXUP_AUTO_MUTE
,
8037 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
8038 ALC668_FIXUP_DELL_XPS13
,
8039 ALC662_FIXUP_ASUS_Nx50
,
8040 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8041 ALC668_FIXUP_ASUS_Nx51
,
8042 ALC668_FIXUP_MIC_COEF
,
8043 ALC668_FIXUP_ASUS_G751
,
8044 ALC891_FIXUP_HEADSET_MODE
,
8045 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8046 ALC662_FIXUP_ACER_VERITON
,
8047 ALC892_FIXUP_ASROCK_MOBO
,
8048 ALC662_FIXUP_USI_FUNC
,
8049 ALC662_FIXUP_USI_HEADSET_MODE
,
8050 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
8053 static const struct hda_fixup alc662_fixups
[] = {
8054 [ALC662_FIXUP_ASPIRE
] = {
8055 .type
= HDA_FIXUP_PINS
,
8056 .v
.pins
= (const struct hda_pintbl
[]) {
8057 { 0x15, 0x99130112 }, /* subwoofer */
8061 [ALC662_FIXUP_LED_GPIO1
] = {
8062 .type
= HDA_FIXUP_FUNC
,
8063 .v
.func
= alc662_fixup_led_gpio1
,
8065 [ALC662_FIXUP_IDEAPAD
] = {
8066 .type
= HDA_FIXUP_PINS
,
8067 .v
.pins
= (const struct hda_pintbl
[]) {
8068 { 0x17, 0x99130112 }, /* subwoofer */
8072 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
8074 [ALC272_FIXUP_MARIO
] = {
8075 .type
= HDA_FIXUP_FUNC
,
8076 .v
.func
= alc272_fixup_mario
,
8078 [ALC662_FIXUP_CZC_P10T
] = {
8079 .type
= HDA_FIXUP_VERBS
,
8080 .v
.verbs
= (const struct hda_verb
[]) {
8081 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
8085 [ALC662_FIXUP_SKU_IGNORE
] = {
8086 .type
= HDA_FIXUP_FUNC
,
8087 .v
.func
= alc_fixup_sku_ignore
,
8089 [ALC662_FIXUP_HP_RP5800
] = {
8090 .type
= HDA_FIXUP_PINS
,
8091 .v
.pins
= (const struct hda_pintbl
[]) {
8092 { 0x14, 0x0221201f }, /* HP out */
8096 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8098 [ALC662_FIXUP_ASUS_MODE1
] = {
8099 .type
= HDA_FIXUP_PINS
,
8100 .v
.pins
= (const struct hda_pintbl
[]) {
8101 { 0x14, 0x99130110 }, /* speaker */
8102 { 0x18, 0x01a19c20 }, /* mic */
8103 { 0x19, 0x99a3092f }, /* int-mic */
8104 { 0x21, 0x0121401f }, /* HP out */
8108 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8110 [ALC662_FIXUP_ASUS_MODE2
] = {
8111 .type
= HDA_FIXUP_PINS
,
8112 .v
.pins
= (const struct hda_pintbl
[]) {
8113 { 0x14, 0x99130110 }, /* speaker */
8114 { 0x18, 0x01a19820 }, /* mic */
8115 { 0x19, 0x99a3092f }, /* int-mic */
8116 { 0x1b, 0x0121401f }, /* HP out */
8120 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8122 [ALC662_FIXUP_ASUS_MODE3
] = {
8123 .type
= HDA_FIXUP_PINS
,
8124 .v
.pins
= (const struct hda_pintbl
[]) {
8125 { 0x14, 0x99130110 }, /* speaker */
8126 { 0x15, 0x0121441f }, /* HP */
8127 { 0x18, 0x01a19840 }, /* mic */
8128 { 0x19, 0x99a3094f }, /* int-mic */
8129 { 0x21, 0x01211420 }, /* HP2 */
8133 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8135 [ALC662_FIXUP_ASUS_MODE4
] = {
8136 .type
= HDA_FIXUP_PINS
,
8137 .v
.pins
= (const struct hda_pintbl
[]) {
8138 { 0x14, 0x99130110 }, /* speaker */
8139 { 0x16, 0x99130111 }, /* speaker */
8140 { 0x18, 0x01a19840 }, /* mic */
8141 { 0x19, 0x99a3094f }, /* int-mic */
8142 { 0x21, 0x0121441f }, /* HP */
8146 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8148 [ALC662_FIXUP_ASUS_MODE5
] = {
8149 .type
= HDA_FIXUP_PINS
,
8150 .v
.pins
= (const struct hda_pintbl
[]) {
8151 { 0x14, 0x99130110 }, /* speaker */
8152 { 0x15, 0x0121441f }, /* HP */
8153 { 0x16, 0x99130111 }, /* speaker */
8154 { 0x18, 0x01a19840 }, /* mic */
8155 { 0x19, 0x99a3094f }, /* int-mic */
8159 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8161 [ALC662_FIXUP_ASUS_MODE6
] = {
8162 .type
= HDA_FIXUP_PINS
,
8163 .v
.pins
= (const struct hda_pintbl
[]) {
8164 { 0x14, 0x99130110 }, /* speaker */
8165 { 0x15, 0x01211420 }, /* HP2 */
8166 { 0x18, 0x01a19840 }, /* mic */
8167 { 0x19, 0x99a3094f }, /* int-mic */
8168 { 0x1b, 0x0121441f }, /* HP */
8172 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8174 [ALC662_FIXUP_ASUS_MODE7
] = {
8175 .type
= HDA_FIXUP_PINS
,
8176 .v
.pins
= (const struct hda_pintbl
[]) {
8177 { 0x14, 0x99130110 }, /* speaker */
8178 { 0x17, 0x99130111 }, /* speaker */
8179 { 0x18, 0x01a19840 }, /* mic */
8180 { 0x19, 0x99a3094f }, /* int-mic */
8181 { 0x1b, 0x01214020 }, /* HP */
8182 { 0x21, 0x0121401f }, /* HP */
8186 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8188 [ALC662_FIXUP_ASUS_MODE8
] = {
8189 .type
= HDA_FIXUP_PINS
,
8190 .v
.pins
= (const struct hda_pintbl
[]) {
8191 { 0x14, 0x99130110 }, /* speaker */
8192 { 0x12, 0x99a30970 }, /* int-mic */
8193 { 0x15, 0x01214020 }, /* HP */
8194 { 0x17, 0x99130111 }, /* speaker */
8195 { 0x18, 0x01a19840 }, /* mic */
8196 { 0x21, 0x0121401f }, /* HP */
8200 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8202 [ALC662_FIXUP_NO_JACK_DETECT
] = {
8203 .type
= HDA_FIXUP_FUNC
,
8204 .v
.func
= alc_fixup_no_jack_detect
,
8206 [ALC662_FIXUP_ZOTAC_Z68
] = {
8207 .type
= HDA_FIXUP_PINS
,
8208 .v
.pins
= (const struct hda_pintbl
[]) {
8209 { 0x1b, 0x02214020 }, /* Front HP */
8213 [ALC662_FIXUP_INV_DMIC
] = {
8214 .type
= HDA_FIXUP_FUNC
,
8215 .v
.func
= alc_fixup_inv_dmic
,
8217 [ALC668_FIXUP_DELL_XPS13
] = {
8218 .type
= HDA_FIXUP_FUNC
,
8219 .v
.func
= alc_fixup_dell_xps13
,
8221 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
8223 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
8224 .type
= HDA_FIXUP_FUNC
,
8225 .v
.func
= alc_fixup_disable_aamix
,
8227 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8229 [ALC668_FIXUP_AUTO_MUTE
] = {
8230 .type
= HDA_FIXUP_FUNC
,
8231 .v
.func
= alc_fixup_auto_mute_via_amp
,
8233 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8235 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8236 .type
= HDA_FIXUP_PINS
,
8237 .v
.pins
= (const struct hda_pintbl
[]) {
8238 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8239 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8243 .chain_id
= ALC662_FIXUP_HEADSET_MODE
8245 [ALC662_FIXUP_HEADSET_MODE
] = {
8246 .type
= HDA_FIXUP_FUNC
,
8247 .v
.func
= alc_fixup_headset_mode_alc662
,
8249 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8250 .type
= HDA_FIXUP_PINS
,
8251 .v
.pins
= (const struct hda_pintbl
[]) {
8252 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8253 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8257 .chain_id
= ALC668_FIXUP_HEADSET_MODE
8259 [ALC668_FIXUP_HEADSET_MODE
] = {
8260 .type
= HDA_FIXUP_FUNC
,
8261 .v
.func
= alc_fixup_headset_mode_alc668
,
8263 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
8264 .type
= HDA_FIXUP_FUNC
,
8265 .v
.func
= alc_fixup_bass_chmap
,
8267 .chain_id
= ALC662_FIXUP_ASUS_MODE4
8269 [ALC662_FIXUP_BASS_16
] = {
8270 .type
= HDA_FIXUP_PINS
,
8271 .v
.pins
= (const struct hda_pintbl
[]) {
8272 {0x16, 0x80106111}, /* bass speaker */
8276 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8278 [ALC662_FIXUP_BASS_1A
] = {
8279 .type
= HDA_FIXUP_PINS
,
8280 .v
.pins
= (const struct hda_pintbl
[]) {
8281 {0x1a, 0x80106111}, /* bass speaker */
8285 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8287 [ALC662_FIXUP_BASS_CHMAP
] = {
8288 .type
= HDA_FIXUP_FUNC
,
8289 .v
.func
= alc_fixup_bass_chmap
,
8291 [ALC662_FIXUP_ASUS_Nx50
] = {
8292 .type
= HDA_FIXUP_FUNC
,
8293 .v
.func
= alc_fixup_auto_mute_via_amp
,
8295 .chain_id
= ALC662_FIXUP_BASS_1A
8297 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
8298 .type
= HDA_FIXUP_FUNC
,
8299 .v
.func
= alc_fixup_headset_mode_alc668
,
8300 .chain_id
= ALC662_FIXUP_BASS_CHMAP
8302 [ALC668_FIXUP_ASUS_Nx51
] = {
8303 .type
= HDA_FIXUP_PINS
,
8304 .v
.pins
= (const struct hda_pintbl
[]) {
8305 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8306 { 0x1a, 0x90170151 }, /* bass speaker */
8307 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8311 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8313 [ALC668_FIXUP_MIC_COEF
] = {
8314 .type
= HDA_FIXUP_VERBS
,
8315 .v
.verbs
= (const struct hda_verb
[]) {
8316 { 0x20, AC_VERB_SET_COEF_INDEX
, 0xc3 },
8317 { 0x20, AC_VERB_SET_PROC_COEF
, 0x4000 },
8321 [ALC668_FIXUP_ASUS_G751
] = {
8322 .type
= HDA_FIXUP_PINS
,
8323 .v
.pins
= (const struct hda_pintbl
[]) {
8324 { 0x16, 0x0421101f }, /* HP */
8328 .chain_id
= ALC668_FIXUP_MIC_COEF
8330 [ALC891_FIXUP_HEADSET_MODE
] = {
8331 .type
= HDA_FIXUP_FUNC
,
8332 .v
.func
= alc_fixup_headset_mode
,
8334 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8335 .type
= HDA_FIXUP_PINS
,
8336 .v
.pins
= (const struct hda_pintbl
[]) {
8337 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8338 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8342 .chain_id
= ALC891_FIXUP_HEADSET_MODE
8344 [ALC662_FIXUP_ACER_VERITON
] = {
8345 .type
= HDA_FIXUP_PINS
,
8346 .v
.pins
= (const struct hda_pintbl
[]) {
8347 { 0x15, 0x50170120 }, /* no internal speaker */
8351 [ALC892_FIXUP_ASROCK_MOBO
] = {
8352 .type
= HDA_FIXUP_PINS
,
8353 .v
.pins
= (const struct hda_pintbl
[]) {
8354 { 0x15, 0x40f000f0 }, /* disabled */
8355 { 0x16, 0x40f000f0 }, /* disabled */
8359 [ALC662_FIXUP_USI_FUNC
] = {
8360 .type
= HDA_FIXUP_FUNC
,
8361 .v
.func
= alc662_fixup_usi_headset_mic
,
8363 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
8364 .type
= HDA_FIXUP_PINS
,
8365 .v
.pins
= (const struct hda_pintbl
[]) {
8366 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8367 { 0x18, 0x01a1903d },
8371 .chain_id
= ALC662_FIXUP_USI_FUNC
8373 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
8374 .type
= HDA_FIXUP_FUNC
,
8375 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
8379 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
8380 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
8381 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
8382 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
8383 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
8384 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
8385 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
8386 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
8387 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
8388 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8389 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8390 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
8391 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
8392 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
8393 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8394 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8395 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8396 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8397 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8398 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
8399 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
8400 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
8401 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
8402 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
8403 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751
),
8404 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8405 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
8406 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
8407 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
8408 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
8409 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
8410 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8411 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
8412 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
8413 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
8414 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
8415 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
8416 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
8417 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
8418 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
8419 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
8420 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
8421 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
8424 /* Below is a quirk table taken from the old code.
8425 * Basically the device should work as is without the fixup table.
8426 * If BIOS doesn't give a proper info, enable the corresponding
8429 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
8430 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
8431 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
8432 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
8433 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8434 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8435 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8436 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
8437 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
8438 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8439 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
8440 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
8441 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
8442 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
8443 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
8444 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8445 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
8446 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
8447 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8448 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8449 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8450 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8451 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
8452 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
8453 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
8454 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8455 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
8456 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8457 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8458 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
8459 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8460 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8461 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
8462 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
8463 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
8464 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
8465 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
8466 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
8467 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
8468 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8469 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
8470 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
8471 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8472 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
8473 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
8474 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
8475 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
8476 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
8477 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8478 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
8483 static const struct hda_model_fixup alc662_fixup_models
[] = {
8484 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
8485 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
8486 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
8487 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
8488 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
8489 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
8490 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
8491 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
8492 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
8493 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
8494 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
8495 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
8499 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
8500 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8504 {0x21, 0x01014020}),
8505 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8509 {0x21, 0x01014020}),
8510 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8514 {0x1b, 0x0221401f}),
8515 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8519 {0x16, 0x03011020}),
8520 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8524 {0x16, 0x03011020}),
8525 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8529 {0x16, 0x03011020}),
8530 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8533 {0x16, 0x03011020}),
8534 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
8537 {0x15, 0x0321101f}),
8543 static int patch_alc662(struct hda_codec
*codec
)
8545 struct alc_spec
*spec
;
8548 err
= alc_alloc_spec(codec
, 0x0b);
8554 spec
->shutup
= alc_eapd_shutup
;
8556 /* handle multiple HPs as is */
8557 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
8559 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
8561 switch (codec
->core
.vendor_id
) {
8563 spec
->init_hook
= alc668_restore_default_value
;
8567 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
8568 alc662_fixup_tbl
, alc662_fixups
);
8569 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
8570 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8572 alc_auto_parse_customize_define(codec
);
8574 if (has_cdefine_beep(codec
))
8575 spec
->gen
.beep_nid
= 0x01;
8577 if ((alc_get_coef0(codec
) & (1 << 14)) &&
8578 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
8579 spec
->cdefine
.platform_type
== 1) {
8580 err
= alc_codec_rename(codec
, "ALC272X");
8585 /* automatic parse from the BIOS config */
8586 err
= alc662_parse_auto_config(codec
);
8590 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
8591 switch (codec
->core
.vendor_id
) {
8593 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8599 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
8602 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
8607 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8620 static int alc680_parse_auto_config(struct hda_codec
*codec
)
8622 return alc_parse_auto_config(codec
, NULL
, NULL
);
8627 static int patch_alc680(struct hda_codec
*codec
)
8631 /* ALC680 has no aa-loopback mixer */
8632 err
= alc_alloc_spec(codec
, 0);
8636 /* automatic parse from the BIOS config */
8637 err
= alc680_parse_auto_config(codec
);
8649 static const struct hda_device_id snd_hda_id_realtek
[] = {
8650 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
8651 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
8652 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
8653 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
8654 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
8655 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
8656 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
8657 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
8658 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
8659 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
8660 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269
),
8661 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
8662 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
8663 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
8664 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
8665 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
8666 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
8667 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
8668 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
8669 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
8670 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
8671 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
8672 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
8673 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
8674 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
8675 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
8676 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
8677 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
8678 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
8679 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
8680 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
8681 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
8682 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
8683 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
8684 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
8685 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
8686 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269
),
8687 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
8688 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
8689 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
8690 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
8691 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
8692 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
8693 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
8694 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
8695 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
8696 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
8697 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
8698 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
8699 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
8700 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
8701 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
8702 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
8703 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
8704 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
8705 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
8706 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
8707 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
8708 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
8709 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
8710 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
8711 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
8712 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
8713 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
8714 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
8715 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
8716 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
8717 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
8718 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882
),
8719 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
8722 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
8724 MODULE_LICENSE("GPL");
8725 MODULE_DESCRIPTION("Realtek HD-audio codec");
8727 static struct hda_codec_driver realtek_driver
= {
8728 .id
= snd_hda_id_realtek
,
8731 module_hda_codec_driver(realtek_driver
);