2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for Realtek ALC codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@just42.net>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <linux/dmi.h>
31 #include <linux/module.h>
32 #include <linux/input.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include "hda_codec.h"
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
39 #include "hda_generic.h"
41 /* keep halting ALC5505 DSP, for power saving */
42 #define HALT_REALTEK_ALC5505
44 /* extra amp-initialization sequence types */
54 ALC_HEADSET_MODE_UNKNOWN
,
55 ALC_HEADSET_MODE_UNPLUGGED
,
56 ALC_HEADSET_MODE_HEADSET
,
58 ALC_HEADSET_MODE_HEADPHONE
,
62 ALC_HEADSET_TYPE_UNKNOWN
,
63 ALC_HEADSET_TYPE_CTIA
,
64 ALC_HEADSET_TYPE_OMTP
,
68 ALC_KEY_MICMUTE_INDEX
,
71 struct alc_customize_define
{
73 unsigned char port_connectivity
;
74 unsigned char check_sum
;
75 unsigned char customization
;
76 unsigned char external_amp
;
77 unsigned int enable_pcbeep
:1;
78 unsigned int platform_type
:1;
80 unsigned int override
:1;
81 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
85 struct hda_gen_spec gen
; /* must be at head */
87 /* codec parameterization */
88 const struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
89 unsigned int num_mixers
;
90 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
92 struct alc_customize_define cdefine
;
93 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
95 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
96 int mute_led_polarity
;
97 hda_nid_t mute_led_nid
;
98 hda_nid_t cap_mute_led_nid
;
100 unsigned int gpio_led
; /* used for alc269_fixup_hp_gpio_led() */
101 unsigned int gpio_mute_led_mask
;
102 unsigned int gpio_mic_led_mask
;
104 hda_nid_t headset_mic_pin
;
105 hda_nid_t headphone_mic_pin
;
106 int current_headset_mode
;
107 int current_headset_type
;
110 void (*init_hook
)(struct hda_codec
*codec
);
112 void (*power_hook
)(struct hda_codec
*codec
);
114 void (*shutup
)(struct hda_codec
*codec
);
115 void (*reboot_notify
)(struct hda_codec
*codec
);
118 int codec_variant
; /* flag for other variants */
119 unsigned int has_alc5505_dsp
:1;
120 unsigned int no_depop_delay
:1;
121 unsigned int done_hp_init
:1;
122 unsigned int no_shutup_pins
:1;
126 unsigned int pll_coef_idx
, pll_coef_bit
;
128 struct input_dev
*kb_dev
;
129 u8 alc_mute_keycode_map
[1];
133 * COEF access helper functions
136 static int alc_read_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
137 unsigned int coef_idx
)
141 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
142 val
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
146 #define alc_read_coef_idx(codec, coef_idx) \
147 alc_read_coefex_idx(codec, 0x20, coef_idx)
149 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
150 unsigned int coef_idx
, unsigned int coef_val
)
152 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
153 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
, coef_val
);
156 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
157 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
159 static void alc_update_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
160 unsigned int coef_idx
, unsigned int mask
,
161 unsigned int bits_set
)
163 unsigned int val
= alc_read_coefex_idx(codec
, nid
, coef_idx
);
166 alc_write_coefex_idx(codec
, nid
, coef_idx
,
167 (val
& ~mask
) | bits_set
);
170 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
171 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
173 /* a special bypass for COEF 0; read the cached value at the second time */
174 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
176 struct alc_spec
*spec
= codec
->spec
;
179 spec
->coef0
= alc_read_coef_idx(codec
, 0);
183 /* coef writes/updates batch */
191 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
192 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
193 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
194 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
195 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
197 static void alc_process_coef_fw(struct hda_codec
*codec
,
198 const struct coef_fw
*fw
)
200 for (; fw
->nid
; fw
++) {
201 if (fw
->mask
== (unsigned short)-1)
202 alc_write_coefex_idx(codec
, fw
->nid
, fw
->idx
, fw
->val
);
204 alc_update_coefex_idx(codec
, fw
->nid
, fw
->idx
,
210 * Append the given mixer and verb elements for the later use
211 * The mixer array is referred in build_controls(), and init_verbs are
214 static void add_mixer(struct alc_spec
*spec
, const struct snd_kcontrol_new
*mix
)
216 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
218 spec
->mixers
[spec
->num_mixers
++] = mix
;
222 * GPIO setup tables, used in initialization
224 /* Enable GPIO mask and set output */
225 static const struct hda_verb alc_gpio1_init_verbs
[] = {
226 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
227 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
228 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
232 static const struct hda_verb alc_gpio2_init_verbs
[] = {
233 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
234 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
235 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
239 static const struct hda_verb alc_gpio3_init_verbs
[] = {
240 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
241 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
242 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
247 * Fix hardware PLL issue
248 * On some codecs, the analog PLL gating control must be off while
249 * the default value is 1.
251 static void alc_fix_pll(struct hda_codec
*codec
)
253 struct alc_spec
*spec
= codec
->spec
;
256 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
257 1 << spec
->pll_coef_bit
, 0);
260 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
261 unsigned int coef_idx
, unsigned int coef_bit
)
263 struct alc_spec
*spec
= codec
->spec
;
265 spec
->pll_coef_idx
= coef_idx
;
266 spec
->pll_coef_bit
= coef_bit
;
270 /* update the master volume per volume-knob's unsol event */
271 static void alc_update_knob_master(struct hda_codec
*codec
,
272 struct hda_jack_callback
*jack
)
275 struct snd_kcontrol
*kctl
;
276 struct snd_ctl_elem_value
*uctl
;
278 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
281 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
284 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
285 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
286 val
&= HDA_AMP_VOLMASK
;
287 uctl
->value
.integer
.value
[0] = val
;
288 uctl
->value
.integer
.value
[1] = val
;
289 kctl
->put(kctl
, uctl
);
293 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
295 /* For some reason, the res given from ALC880 is broken.
296 Here we adjust it properly. */
297 snd_hda_jack_unsol_event(codec
, res
>> 2);
300 /* Change EAPD to verb control */
301 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
305 coef
= alc_get_coef0(codec
);
307 switch (codec
->core
.vendor_id
) {
309 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
313 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
316 if ((coef
& 0x00f0) == 0x0010)
317 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
318 if ((coef
& 0x00f0) == 0x0020)
319 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
320 if ((coef
& 0x00f0) == 0x0030)
321 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
327 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
332 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
348 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
351 alc_update_coef_idx(codec
, 0xe, 0, 1<<0);
354 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
362 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
365 if ((coef
& 0x00f0) == 0x0030)
366 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
375 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
378 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
381 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
384 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
385 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
388 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
394 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
399 /* additional initialization for ALC888 variants */
400 static void alc888_coef_init(struct hda_codec
*codec
)
402 switch (alc_get_coef0(codec
) & 0x00f0) {
407 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
412 /* turn on/off EAPD control (only if available) */
413 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
415 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
417 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
418 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
422 /* turn on/off EAPD controls of the codec */
423 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
425 /* We currently only handle front, HP */
426 static hda_nid_t pins
[] = {
427 0x0f, 0x10, 0x14, 0x15, 0x17, 0
430 for (p
= pins
; *p
; p
++)
431 set_eapd(codec
, *p
, on
);
434 static int find_ext_mic_pin(struct hda_codec
*codec
);
436 static void alc_headset_mic_no_shutup(struct hda_codec
*codec
)
438 const struct hda_pincfg
*pin
;
439 int mic_pin
= find_ext_mic_pin(codec
);
442 /* don't shut up pins when unloading the driver; otherwise it breaks
443 * the default pin setup at the next load of the driver
445 if (codec
->bus
->shutdown
)
448 for (i
= 0; i
< codec
->init_pins
.used
; i
++) {
449 pin
= snd_array_elem(&codec
->init_pins
, i
);
450 /* use read here for syncing after issuing each verb */
451 if (pin
->nid
!= mic_pin
)
452 snd_hda_codec_read(codec
, pin
->nid
, 0,
453 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
456 codec
->pins_shutup
= 1;
459 static void alc_shutup_pins(struct hda_codec
*codec
)
461 struct alc_spec
*spec
= codec
->spec
;
463 switch (codec
->core
.vendor_id
) {
467 alc_headset_mic_no_shutup(codec
);
470 if (!spec
->no_shutup_pins
)
471 snd_hda_shutup_pins(codec
);
476 /* generic shutup callback;
477 * just turning off EAPD and a little pause for avoiding pop-noise
479 static void alc_eapd_shutup(struct hda_codec
*codec
)
481 struct alc_spec
*spec
= codec
->spec
;
483 alc_auto_setup_eapd(codec
, false);
484 if (!spec
->no_depop_delay
)
486 alc_shutup_pins(codec
);
489 /* generic EAPD initialization */
490 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
492 alc_fill_eapd_coef(codec
);
493 alc_auto_setup_eapd(codec
, true);
496 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
499 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
502 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
504 case ALC_INIT_DEFAULT
:
505 switch (codec
->core
.vendor_id
) {
507 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
513 alc_update_coef_idx(codec
, 7, 0, 0x2030);
516 alc888_coef_init(codec
);
525 * Realtek SSID verification
528 /* Could be any non-zero and even value. When used as fixup, tells
529 * the driver to ignore any present sku defines.
531 #define ALC_FIXUP_SKU_IGNORE (2)
533 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
534 const struct hda_fixup
*fix
, int action
)
536 struct alc_spec
*spec
= codec
->spec
;
537 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
538 spec
->cdefine
.fixup
= 1;
539 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
543 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
544 const struct hda_fixup
*fix
, int action
)
546 struct alc_spec
*spec
= codec
->spec
;
548 if (action
== HDA_FIXUP_ACT_PROBE
) {
549 spec
->no_depop_delay
= 1;
550 codec
->depop_delay
= 0;
554 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
556 unsigned int ass
, tmp
, i
;
558 struct alc_spec
*spec
= codec
->spec
;
560 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
562 if (spec
->cdefine
.fixup
) {
563 ass
= spec
->cdefine
.sku_cfg
;
564 if (ass
== ALC_FIXUP_SKU_IGNORE
)
569 if (!codec
->bus
->pci
)
571 ass
= codec
->core
.subsystem_id
& 0xffff;
572 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
576 if (codec
->core
.vendor_id
== 0x10ec0260)
578 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
581 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
582 codec
->core
.chip_name
, ass
);
588 for (i
= 1; i
< 16; i
++) {
592 if (((ass
>> 16) & 0xf) != tmp
)
595 spec
->cdefine
.port_connectivity
= ass
>> 30;
596 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
597 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
598 spec
->cdefine
.customization
= ass
>> 8;
600 spec
->cdefine
.sku_cfg
= ass
;
601 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
602 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
603 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
604 spec
->cdefine
.override
= ass
& 0x1;
606 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
607 nid
, spec
->cdefine
.sku_cfg
);
608 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
609 spec
->cdefine
.port_connectivity
);
610 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
611 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
612 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
613 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
614 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
615 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
616 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
621 /* return the position of NID in the list, or -1 if not found */
622 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
625 for (i
= 0; i
< nums
; i
++)
630 /* return true if the given NID is found in the list */
631 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
633 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
636 /* check subsystem ID and set up device-specific initialization;
637 * return 1 if initialized, 0 if invalid SSID
639 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
640 * 31 ~ 16 : Manufacture ID
642 * 7 ~ 0 : Assembly ID
643 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
645 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
647 unsigned int ass
, tmp
, i
;
649 struct alc_spec
*spec
= codec
->spec
;
651 if (spec
->cdefine
.fixup
) {
652 ass
= spec
->cdefine
.sku_cfg
;
653 if (ass
== ALC_FIXUP_SKU_IGNORE
)
658 ass
= codec
->core
.subsystem_id
& 0xffff;
659 if (codec
->bus
->pci
&&
660 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
663 /* invalid SSID, check the special NID pin defcfg instead */
665 * 31~30 : port connectivity
668 * 19~16 : Check sum (15:1)
673 if (codec
->core
.vendor_id
== 0x10ec0260)
675 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
677 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
681 if ((ass
>> 30) != 1) /* no physical connection */
686 for (i
= 1; i
< 16; i
++) {
690 if (((ass
>> 16) & 0xf) != tmp
)
693 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
694 ass
& 0xffff, codec
->core
.vendor_id
);
698 * 2 : 0 --> Desktop, 1 --> Laptop
699 * 3~5 : External Amplifier control
702 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
705 spec
->init_amp
= ALC_INIT_GPIO1
;
708 spec
->init_amp
= ALC_INIT_GPIO2
;
711 spec
->init_amp
= ALC_INIT_GPIO3
;
715 spec
->init_amp
= ALC_INIT_DEFAULT
;
719 /* is laptop or Desktop and enable the function "Mute internal speaker
720 * when the external headphone out jack is plugged"
725 * 10~8 : Jack location
726 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
728 * 15 : 1 --> enable the function "Mute internal speaker
729 * when the external headphone out jack is plugged"
731 if (!spec
->gen
.autocfg
.hp_pins
[0] &&
732 !(spec
->gen
.autocfg
.line_out_pins
[0] &&
733 spec
->gen
.autocfg
.line_out_type
== AUTO_PIN_HP_OUT
)) {
735 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
737 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
738 spec
->gen
.autocfg
.line_outs
))
740 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
745 /* Check the validity of ALC subsystem-id
746 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
747 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
749 if (!alc_subsystem_id(codec
, ports
)) {
750 struct alc_spec
*spec
= codec
->spec
;
752 "realtek: Enable default setup for auto mode as fallback\n");
753 spec
->init_amp
= ALC_INIT_DEFAULT
;
760 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
761 const struct hda_fixup
*fix
, int action
)
763 struct alc_spec
*spec
= codec
->spec
;
765 spec
->gen
.inv_dmic_split
= 1;
769 #ifdef CONFIG_SND_HDA_INPUT_BEEP
770 /* additional beep mixers; the actual parameters are overwritten at build */
771 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
772 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
773 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
778 static int alc_build_controls(struct hda_codec
*codec
)
780 struct alc_spec
*spec
= codec
->spec
;
783 err
= snd_hda_gen_build_controls(codec
);
787 for (i
= 0; i
< spec
->num_mixers
; i
++) {
788 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
793 #ifdef CONFIG_SND_HDA_INPUT_BEEP
794 /* create beep controls if needed */
795 if (spec
->beep_amp
) {
796 const struct snd_kcontrol_new
*knew
;
797 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
798 struct snd_kcontrol
*kctl
;
799 kctl
= snd_ctl_new1(knew
, codec
);
802 kctl
->private_value
= spec
->beep_amp
;
803 err
= snd_hda_ctl_add(codec
, 0, kctl
);
810 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
819 static int alc_init(struct hda_codec
*codec
)
821 struct alc_spec
*spec
= codec
->spec
;
824 spec
->init_hook(codec
);
827 alc_auto_init_amp(codec
, spec
->init_amp
);
829 snd_hda_gen_init(codec
);
831 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
836 static inline void alc_shutup(struct hda_codec
*codec
)
838 struct alc_spec
*spec
= codec
->spec
;
840 if (spec
&& spec
->shutup
)
843 alc_shutup_pins(codec
);
846 static void alc_reboot_notify(struct hda_codec
*codec
)
848 struct alc_spec
*spec
= codec
->spec
;
850 if (spec
&& spec
->reboot_notify
)
851 spec
->reboot_notify(codec
);
856 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
857 static void alc_d3_at_reboot(struct hda_codec
*codec
)
859 snd_hda_codec_set_power_to_all(codec
, codec
->core
.afg
, AC_PWRST_D3
);
860 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
861 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
865 #define alc_free snd_hda_gen_free
868 static void alc_power_eapd(struct hda_codec
*codec
)
870 alc_auto_setup_eapd(codec
, false);
873 static int alc_suspend(struct hda_codec
*codec
)
875 struct alc_spec
*spec
= codec
->spec
;
877 if (spec
&& spec
->power_hook
)
878 spec
->power_hook(codec
);
884 static int alc_resume(struct hda_codec
*codec
)
886 struct alc_spec
*spec
= codec
->spec
;
888 if (!spec
->no_depop_delay
)
889 msleep(150); /* to avoid pop noise */
890 codec
->patch_ops
.init(codec
);
891 regcache_sync(codec
->core
.regmap
);
892 hda_call_check_power_status(codec
, 0x01);
899 static const struct hda_codec_ops alc_patch_ops
= {
900 .build_controls
= alc_build_controls
,
901 .build_pcms
= snd_hda_gen_build_pcms
,
904 .unsol_event
= snd_hda_jack_unsol_event
,
906 .resume
= alc_resume
,
907 .suspend
= alc_suspend
,
908 .check_power_status
= snd_hda_gen_check_power_status
,
910 .reboot_notify
= alc_reboot_notify
,
914 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
917 * Rename codecs appropriately from COEF value or subvendor id
919 struct alc_codec_rename_table
{
920 unsigned int vendor_id
;
921 unsigned short coef_mask
;
922 unsigned short coef_bits
;
926 struct alc_codec_rename_pci_table
{
927 unsigned int codec_vendor_id
;
928 unsigned short pci_subvendor
;
929 unsigned short pci_subdevice
;
933 static struct alc_codec_rename_table rename_tbl
[] = {
934 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
935 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
936 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
937 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
938 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
939 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
940 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
941 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
942 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
943 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
944 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
945 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
946 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
947 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
948 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
949 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
950 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
954 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
955 { 0x10ec0280, 0x1028, 0, "ALC3220" },
956 { 0x10ec0282, 0x1028, 0, "ALC3221" },
957 { 0x10ec0283, 0x1028, 0, "ALC3223" },
958 { 0x10ec0288, 0x1028, 0, "ALC3263" },
959 { 0x10ec0292, 0x1028, 0, "ALC3226" },
960 { 0x10ec0293, 0x1028, 0, "ALC3235" },
961 { 0x10ec0255, 0x1028, 0, "ALC3234" },
962 { 0x10ec0668, 0x1028, 0, "ALC3661" },
963 { 0x10ec0275, 0x1028, 0, "ALC3260" },
964 { 0x10ec0899, 0x1028, 0, "ALC3861" },
965 { 0x10ec0298, 0x1028, 0, "ALC3266" },
966 { 0x10ec0236, 0x1028, 0, "ALC3204" },
967 { 0x10ec0256, 0x1028, 0, "ALC3246" },
968 { 0x10ec0225, 0x1028, 0, "ALC3253" },
969 { 0x10ec0295, 0x1028, 0, "ALC3254" },
970 { 0x10ec0299, 0x1028, 0, "ALC3271" },
971 { 0x10ec0670, 0x1025, 0, "ALC669X" },
972 { 0x10ec0676, 0x1025, 0, "ALC679X" },
973 { 0x10ec0282, 0x1043, 0, "ALC3229" },
974 { 0x10ec0233, 0x1043, 0, "ALC3236" },
975 { 0x10ec0280, 0x103c, 0, "ALC3228" },
976 { 0x10ec0282, 0x103c, 0, "ALC3227" },
977 { 0x10ec0286, 0x103c, 0, "ALC3242" },
978 { 0x10ec0290, 0x103c, 0, "ALC3241" },
979 { 0x10ec0668, 0x103c, 0, "ALC3662" },
980 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
981 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
985 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
987 const struct alc_codec_rename_table
*p
;
988 const struct alc_codec_rename_pci_table
*q
;
990 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
991 if (p
->vendor_id
!= codec
->core
.vendor_id
)
993 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
994 return alc_codec_rename(codec
, p
->name
);
997 if (!codec
->bus
->pci
)
999 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
1000 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
1002 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
1004 if (!q
->pci_subdevice
||
1005 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
1006 return alc_codec_rename(codec
, q
->name
);
1014 * Digital-beep handlers
1016 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1017 #define set_beep_amp(spec, nid, idx, dir) \
1018 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1020 static const struct snd_pci_quirk beep_white_list
[] = {
1021 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1022 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1023 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1024 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1025 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1026 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1027 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1028 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1029 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1033 static inline int has_cdefine_beep(struct hda_codec
*codec
)
1035 struct alc_spec
*spec
= codec
->spec
;
1036 const struct snd_pci_quirk
*q
;
1037 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
1040 return spec
->cdefine
.enable_pcbeep
;
1043 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
1044 #define has_cdefine_beep(codec) 0
1047 /* parse the BIOS configuration and set up the alc_spec */
1048 /* return 1 if successful, 0 if the proper config is not found,
1049 * or a negative error code
1051 static int alc_parse_auto_config(struct hda_codec
*codec
,
1052 const hda_nid_t
*ignore_nids
,
1053 const hda_nid_t
*ssid_nids
)
1055 struct alc_spec
*spec
= codec
->spec
;
1056 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1059 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1065 alc_ssid_check(codec
, ssid_nids
);
1067 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1074 /* common preparation job for alc_spec */
1075 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1077 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1083 snd_hda_gen_spec_init(&spec
->gen
);
1084 spec
->gen
.mixer_nid
= mixer_nid
;
1085 spec
->gen
.own_eapd_ctl
= 1;
1086 codec
->single_adc_amp
= 1;
1087 /* FIXME: do we need this for all Realtek codec models? */
1088 codec
->spdif_status_reset
= 1;
1089 codec
->patch_ops
= alc_patch_ops
;
1091 err
= alc_codec_rename_from_preset(codec
);
1099 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1101 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1102 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1103 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1112 ALC880_FIXUP_MEDION_RIM
,
1114 ALC880_FIXUP_LG_LW25
,
1116 ALC880_FIXUP_EAPD_COEF
,
1117 ALC880_FIXUP_TCL_S700
,
1118 ALC880_FIXUP_VOL_KNOB
,
1119 ALC880_FIXUP_FUJITSU
,
1121 ALC880_FIXUP_UNIWILL
,
1122 ALC880_FIXUP_UNIWILL_DIG
,
1124 ALC880_FIXUP_ASUS_W5A
,
1125 ALC880_FIXUP_3ST_BASE
,
1127 ALC880_FIXUP_3ST_DIG
,
1128 ALC880_FIXUP_5ST_BASE
,
1130 ALC880_FIXUP_5ST_DIG
,
1131 ALC880_FIXUP_6ST_BASE
,
1133 ALC880_FIXUP_6ST_DIG
,
1134 ALC880_FIXUP_6ST_AUTOMUTE
,
1137 /* enable the volume-knob widget support on NID 0x21 */
1138 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1139 const struct hda_fixup
*fix
, int action
)
1141 if (action
== HDA_FIXUP_ACT_PROBE
)
1142 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1143 alc_update_knob_master
);
1146 static const struct hda_fixup alc880_fixups
[] = {
1147 [ALC880_FIXUP_GPIO1
] = {
1148 .type
= HDA_FIXUP_VERBS
,
1149 .v
.verbs
= alc_gpio1_init_verbs
,
1151 [ALC880_FIXUP_GPIO2
] = {
1152 .type
= HDA_FIXUP_VERBS
,
1153 .v
.verbs
= alc_gpio2_init_verbs
,
1155 [ALC880_FIXUP_MEDION_RIM
] = {
1156 .type
= HDA_FIXUP_VERBS
,
1157 .v
.verbs
= (const struct hda_verb
[]) {
1158 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1159 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1163 .chain_id
= ALC880_FIXUP_GPIO2
,
1165 [ALC880_FIXUP_LG
] = {
1166 .type
= HDA_FIXUP_PINS
,
1167 .v
.pins
= (const struct hda_pintbl
[]) {
1168 /* disable bogus unused pins */
1169 { 0x16, 0x411111f0 },
1170 { 0x18, 0x411111f0 },
1171 { 0x1a, 0x411111f0 },
1175 [ALC880_FIXUP_LG_LW25
] = {
1176 .type
= HDA_FIXUP_PINS
,
1177 .v
.pins
= (const struct hda_pintbl
[]) {
1178 { 0x1a, 0x0181344f }, /* line-in */
1179 { 0x1b, 0x0321403f }, /* headphone */
1183 [ALC880_FIXUP_W810
] = {
1184 .type
= HDA_FIXUP_PINS
,
1185 .v
.pins
= (const struct hda_pintbl
[]) {
1186 /* disable bogus unused pins */
1187 { 0x17, 0x411111f0 },
1191 .chain_id
= ALC880_FIXUP_GPIO2
,
1193 [ALC880_FIXUP_EAPD_COEF
] = {
1194 .type
= HDA_FIXUP_VERBS
,
1195 .v
.verbs
= (const struct hda_verb
[]) {
1196 /* change to EAPD mode */
1197 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1198 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1202 [ALC880_FIXUP_TCL_S700
] = {
1203 .type
= HDA_FIXUP_VERBS
,
1204 .v
.verbs
= (const struct hda_verb
[]) {
1205 /* change to EAPD mode */
1206 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1207 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1211 .chain_id
= ALC880_FIXUP_GPIO2
,
1213 [ALC880_FIXUP_VOL_KNOB
] = {
1214 .type
= HDA_FIXUP_FUNC
,
1215 .v
.func
= alc880_fixup_vol_knob
,
1217 [ALC880_FIXUP_FUJITSU
] = {
1218 /* override all pins as BIOS on old Amilo is broken */
1219 .type
= HDA_FIXUP_PINS
,
1220 .v
.pins
= (const struct hda_pintbl
[]) {
1221 { 0x14, 0x0121401f }, /* HP */
1222 { 0x15, 0x99030120 }, /* speaker */
1223 { 0x16, 0x99030130 }, /* bass speaker */
1224 { 0x17, 0x411111f0 }, /* N/A */
1225 { 0x18, 0x411111f0 }, /* N/A */
1226 { 0x19, 0x01a19950 }, /* mic-in */
1227 { 0x1a, 0x411111f0 }, /* N/A */
1228 { 0x1b, 0x411111f0 }, /* N/A */
1229 { 0x1c, 0x411111f0 }, /* N/A */
1230 { 0x1d, 0x411111f0 }, /* N/A */
1231 { 0x1e, 0x01454140 }, /* SPDIF out */
1235 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1237 [ALC880_FIXUP_F1734
] = {
1238 /* almost compatible with FUJITSU, but no bass and SPDIF */
1239 .type
= HDA_FIXUP_PINS
,
1240 .v
.pins
= (const struct hda_pintbl
[]) {
1241 { 0x14, 0x0121401f }, /* HP */
1242 { 0x15, 0x99030120 }, /* speaker */
1243 { 0x16, 0x411111f0 }, /* N/A */
1244 { 0x17, 0x411111f0 }, /* N/A */
1245 { 0x18, 0x411111f0 }, /* N/A */
1246 { 0x19, 0x01a19950 }, /* mic-in */
1247 { 0x1a, 0x411111f0 }, /* N/A */
1248 { 0x1b, 0x411111f0 }, /* N/A */
1249 { 0x1c, 0x411111f0 }, /* N/A */
1250 { 0x1d, 0x411111f0 }, /* N/A */
1251 { 0x1e, 0x411111f0 }, /* N/A */
1255 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1257 [ALC880_FIXUP_UNIWILL
] = {
1258 /* need to fix HP and speaker pins to be parsed correctly */
1259 .type
= HDA_FIXUP_PINS
,
1260 .v
.pins
= (const struct hda_pintbl
[]) {
1261 { 0x14, 0x0121411f }, /* HP */
1262 { 0x15, 0x99030120 }, /* speaker */
1263 { 0x16, 0x99030130 }, /* bass speaker */
1267 [ALC880_FIXUP_UNIWILL_DIG
] = {
1268 .type
= HDA_FIXUP_PINS
,
1269 .v
.pins
= (const struct hda_pintbl
[]) {
1270 /* disable bogus unused pins */
1271 { 0x17, 0x411111f0 },
1272 { 0x19, 0x411111f0 },
1273 { 0x1b, 0x411111f0 },
1274 { 0x1f, 0x411111f0 },
1278 [ALC880_FIXUP_Z71V
] = {
1279 .type
= HDA_FIXUP_PINS
,
1280 .v
.pins
= (const struct hda_pintbl
[]) {
1281 /* set up the whole pins as BIOS is utterly broken */
1282 { 0x14, 0x99030120 }, /* speaker */
1283 { 0x15, 0x0121411f }, /* HP */
1284 { 0x16, 0x411111f0 }, /* N/A */
1285 { 0x17, 0x411111f0 }, /* N/A */
1286 { 0x18, 0x01a19950 }, /* mic-in */
1287 { 0x19, 0x411111f0 }, /* N/A */
1288 { 0x1a, 0x01813031 }, /* line-in */
1289 { 0x1b, 0x411111f0 }, /* N/A */
1290 { 0x1c, 0x411111f0 }, /* N/A */
1291 { 0x1d, 0x411111f0 }, /* N/A */
1292 { 0x1e, 0x0144111e }, /* SPDIF */
1296 [ALC880_FIXUP_ASUS_W5A
] = {
1297 .type
= HDA_FIXUP_PINS
,
1298 .v
.pins
= (const struct hda_pintbl
[]) {
1299 /* set up the whole pins as BIOS is utterly broken */
1300 { 0x14, 0x0121411f }, /* HP */
1301 { 0x15, 0x411111f0 }, /* N/A */
1302 { 0x16, 0x411111f0 }, /* N/A */
1303 { 0x17, 0x411111f0 }, /* N/A */
1304 { 0x18, 0x90a60160 }, /* mic */
1305 { 0x19, 0x411111f0 }, /* N/A */
1306 { 0x1a, 0x411111f0 }, /* N/A */
1307 { 0x1b, 0x411111f0 }, /* N/A */
1308 { 0x1c, 0x411111f0 }, /* N/A */
1309 { 0x1d, 0x411111f0 }, /* N/A */
1310 { 0x1e, 0xb743111e }, /* SPDIF out */
1314 .chain_id
= ALC880_FIXUP_GPIO1
,
1316 [ALC880_FIXUP_3ST_BASE
] = {
1317 .type
= HDA_FIXUP_PINS
,
1318 .v
.pins
= (const struct hda_pintbl
[]) {
1319 { 0x14, 0x01014010 }, /* line-out */
1320 { 0x15, 0x411111f0 }, /* N/A */
1321 { 0x16, 0x411111f0 }, /* N/A */
1322 { 0x17, 0x411111f0 }, /* N/A */
1323 { 0x18, 0x01a19c30 }, /* mic-in */
1324 { 0x19, 0x0121411f }, /* HP */
1325 { 0x1a, 0x01813031 }, /* line-in */
1326 { 0x1b, 0x02a19c40 }, /* front-mic */
1327 { 0x1c, 0x411111f0 }, /* N/A */
1328 { 0x1d, 0x411111f0 }, /* N/A */
1329 /* 0x1e is filled in below */
1330 { 0x1f, 0x411111f0 }, /* N/A */
1334 [ALC880_FIXUP_3ST
] = {
1335 .type
= HDA_FIXUP_PINS
,
1336 .v
.pins
= (const struct hda_pintbl
[]) {
1337 { 0x1e, 0x411111f0 }, /* N/A */
1341 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1343 [ALC880_FIXUP_3ST_DIG
] = {
1344 .type
= HDA_FIXUP_PINS
,
1345 .v
.pins
= (const struct hda_pintbl
[]) {
1346 { 0x1e, 0x0144111e }, /* SPDIF */
1350 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1352 [ALC880_FIXUP_5ST_BASE
] = {
1353 .type
= HDA_FIXUP_PINS
,
1354 .v
.pins
= (const struct hda_pintbl
[]) {
1355 { 0x14, 0x01014010 }, /* front */
1356 { 0x15, 0x411111f0 }, /* N/A */
1357 { 0x16, 0x01011411 }, /* CLFE */
1358 { 0x17, 0x01016412 }, /* surr */
1359 { 0x18, 0x01a19c30 }, /* mic-in */
1360 { 0x19, 0x0121411f }, /* HP */
1361 { 0x1a, 0x01813031 }, /* line-in */
1362 { 0x1b, 0x02a19c40 }, /* front-mic */
1363 { 0x1c, 0x411111f0 }, /* N/A */
1364 { 0x1d, 0x411111f0 }, /* N/A */
1365 /* 0x1e is filled in below */
1366 { 0x1f, 0x411111f0 }, /* N/A */
1370 [ALC880_FIXUP_5ST
] = {
1371 .type
= HDA_FIXUP_PINS
,
1372 .v
.pins
= (const struct hda_pintbl
[]) {
1373 { 0x1e, 0x411111f0 }, /* N/A */
1377 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1379 [ALC880_FIXUP_5ST_DIG
] = {
1380 .type
= HDA_FIXUP_PINS
,
1381 .v
.pins
= (const struct hda_pintbl
[]) {
1382 { 0x1e, 0x0144111e }, /* SPDIF */
1386 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1388 [ALC880_FIXUP_6ST_BASE
] = {
1389 .type
= HDA_FIXUP_PINS
,
1390 .v
.pins
= (const struct hda_pintbl
[]) {
1391 { 0x14, 0x01014010 }, /* front */
1392 { 0x15, 0x01016412 }, /* surr */
1393 { 0x16, 0x01011411 }, /* CLFE */
1394 { 0x17, 0x01012414 }, /* side */
1395 { 0x18, 0x01a19c30 }, /* mic-in */
1396 { 0x19, 0x02a19c40 }, /* front-mic */
1397 { 0x1a, 0x01813031 }, /* line-in */
1398 { 0x1b, 0x0121411f }, /* HP */
1399 { 0x1c, 0x411111f0 }, /* N/A */
1400 { 0x1d, 0x411111f0 }, /* N/A */
1401 /* 0x1e is filled in below */
1402 { 0x1f, 0x411111f0 }, /* N/A */
1406 [ALC880_FIXUP_6ST
] = {
1407 .type
= HDA_FIXUP_PINS
,
1408 .v
.pins
= (const struct hda_pintbl
[]) {
1409 { 0x1e, 0x411111f0 }, /* N/A */
1413 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1415 [ALC880_FIXUP_6ST_DIG
] = {
1416 .type
= HDA_FIXUP_PINS
,
1417 .v
.pins
= (const struct hda_pintbl
[]) {
1418 { 0x1e, 0x0144111e }, /* SPDIF */
1422 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1424 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1425 .type
= HDA_FIXUP_PINS
,
1426 .v
.pins
= (const struct hda_pintbl
[]) {
1427 { 0x1b, 0x0121401f }, /* HP with jack detect */
1430 .chained_before
= true,
1431 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1435 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1436 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1437 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1438 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1439 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1440 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1441 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1442 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1443 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1444 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1445 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1446 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1447 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1448 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1449 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1450 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1451 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1452 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1453 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1454 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1455 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1456 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1457 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1458 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1460 /* Below is the copied entries from alc880_quirks.c.
1461 * It's not quite sure whether BIOS sets the correct pin-config table
1462 * on these machines, thus they are kept to be compatible with
1463 * the old static quirks. Once when it's confirmed to work without
1464 * these overrides, it'd be better to remove.
1466 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1467 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1468 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1469 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1470 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1471 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1472 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1473 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1474 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1475 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1476 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1477 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1478 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1479 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1480 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1481 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1482 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1483 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1484 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1485 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1486 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1487 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1488 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1489 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1490 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1491 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1492 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1493 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1494 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1495 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1496 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1497 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1498 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1500 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1501 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1502 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1506 static const struct hda_model_fixup alc880_fixup_models
[] = {
1507 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1508 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1509 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1510 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1511 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1512 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1513 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1519 * OK, here we have finally the patch for ALC880
1521 static int patch_alc880(struct hda_codec
*codec
)
1523 struct alc_spec
*spec
;
1526 err
= alc_alloc_spec(codec
, 0x0b);
1531 spec
->gen
.need_dac_fix
= 1;
1532 spec
->gen
.beep_nid
= 0x01;
1534 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1536 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1538 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1540 /* automatic parse from the BIOS config */
1541 err
= alc880_parse_auto_config(codec
);
1545 if (!spec
->gen
.no_analog
)
1546 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1548 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1561 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1563 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1564 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1565 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1572 ALC260_FIXUP_HP_DC5750
,
1573 ALC260_FIXUP_HP_PIN_0F
,
1576 ALC260_FIXUP_GPIO1_TOGGLE
,
1577 ALC260_FIXUP_REPLACER
,
1578 ALC260_FIXUP_HP_B1900
,
1580 ALC260_FIXUP_FSC_S7020
,
1581 ALC260_FIXUP_FSC_S7020_JWSE
,
1582 ALC260_FIXUP_VAIO_PINS
,
1585 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1587 struct alc_spec
*spec
= codec
->spec
;
1588 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
1589 spec
->gen
.hp_jack_present
);
1592 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1593 const struct hda_fixup
*fix
, int action
)
1595 struct alc_spec
*spec
= codec
->spec
;
1596 if (action
== HDA_FIXUP_ACT_PROBE
) {
1597 /* although the machine has only one output pin, we need to
1598 * toggle GPIO1 according to the jack state
1600 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1601 spec
->gen
.detect_hp
= 1;
1602 spec
->gen
.automute_speaker
= 1;
1603 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1604 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1605 snd_hda_gen_hp_automute
);
1606 snd_hda_add_verbs(codec
, alc_gpio1_init_verbs
);
1610 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1611 const struct hda_fixup
*fix
, int action
)
1613 struct alc_spec
*spec
= codec
->spec
;
1614 static const struct hda_pintbl pincfgs
[] = {
1615 { 0x0f, 0x02214000 }, /* HP/speaker */
1616 { 0x12, 0x90a60160 }, /* int mic */
1617 { 0x13, 0x02a19000 }, /* ext mic */
1618 { 0x18, 0x01446000 }, /* SPDIF out */
1619 /* disable bogus I/O pins */
1620 { 0x10, 0x411111f0 },
1621 { 0x11, 0x411111f0 },
1622 { 0x14, 0x411111f0 },
1623 { 0x15, 0x411111f0 },
1624 { 0x16, 0x411111f0 },
1625 { 0x17, 0x411111f0 },
1626 { 0x19, 0x411111f0 },
1631 case HDA_FIXUP_ACT_PRE_PROBE
:
1632 snd_hda_apply_pincfgs(codec
, pincfgs
);
1634 case HDA_FIXUP_ACT_PROBE
:
1635 spec
->init_amp
= ALC_INIT_NONE
;
1640 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1641 const struct hda_fixup
*fix
, int action
)
1643 struct alc_spec
*spec
= codec
->spec
;
1644 if (action
== HDA_FIXUP_ACT_PROBE
)
1645 spec
->init_amp
= ALC_INIT_NONE
;
1648 static void alc260_fixup_fsc_s7020_jwse(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_PRE_PROBE
) {
1653 spec
->gen
.add_jack_modes
= 1;
1654 spec
->gen
.hp_mic
= 1;
1658 static const struct hda_fixup alc260_fixups
[] = {
1659 [ALC260_FIXUP_HP_DC5750
] = {
1660 .type
= HDA_FIXUP_PINS
,
1661 .v
.pins
= (const struct hda_pintbl
[]) {
1662 { 0x11, 0x90130110 }, /* speaker */
1666 [ALC260_FIXUP_HP_PIN_0F
] = {
1667 .type
= HDA_FIXUP_PINS
,
1668 .v
.pins
= (const struct hda_pintbl
[]) {
1669 { 0x0f, 0x01214000 }, /* HP */
1673 [ALC260_FIXUP_COEF
] = {
1674 .type
= HDA_FIXUP_VERBS
,
1675 .v
.verbs
= (const struct hda_verb
[]) {
1676 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1677 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1681 [ALC260_FIXUP_GPIO1
] = {
1682 .type
= HDA_FIXUP_VERBS
,
1683 .v
.verbs
= alc_gpio1_init_verbs
,
1685 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1686 .type
= HDA_FIXUP_FUNC
,
1687 .v
.func
= alc260_fixup_gpio1_toggle
,
1689 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1691 [ALC260_FIXUP_REPLACER
] = {
1692 .type
= HDA_FIXUP_VERBS
,
1693 .v
.verbs
= (const struct hda_verb
[]) {
1694 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1695 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1699 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1701 [ALC260_FIXUP_HP_B1900
] = {
1702 .type
= HDA_FIXUP_FUNC
,
1703 .v
.func
= alc260_fixup_gpio1_toggle
,
1705 .chain_id
= ALC260_FIXUP_COEF
,
1707 [ALC260_FIXUP_KN1
] = {
1708 .type
= HDA_FIXUP_FUNC
,
1709 .v
.func
= alc260_fixup_kn1
,
1711 [ALC260_FIXUP_FSC_S7020
] = {
1712 .type
= HDA_FIXUP_FUNC
,
1713 .v
.func
= alc260_fixup_fsc_s7020
,
1715 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1716 .type
= HDA_FIXUP_FUNC
,
1717 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1719 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1721 [ALC260_FIXUP_VAIO_PINS
] = {
1722 .type
= HDA_FIXUP_PINS
,
1723 .v
.pins
= (const struct hda_pintbl
[]) {
1724 /* Pin configs are missing completely on some VAIOs */
1725 { 0x0f, 0x01211020 },
1726 { 0x10, 0x0001003f },
1727 { 0x11, 0x411111f0 },
1728 { 0x12, 0x01a15930 },
1729 { 0x13, 0x411111f0 },
1730 { 0x14, 0x411111f0 },
1731 { 0x15, 0x411111f0 },
1732 { 0x16, 0x411111f0 },
1733 { 0x17, 0x411111f0 },
1734 { 0x18, 0x411111f0 },
1735 { 0x19, 0x411111f0 },
1741 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1742 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1743 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1744 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1745 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1746 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1747 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1748 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1749 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1750 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1751 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1752 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1753 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1757 static const struct hda_model_fixup alc260_fixup_models
[] = {
1758 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1759 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1760 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1761 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1767 static int patch_alc260(struct hda_codec
*codec
)
1769 struct alc_spec
*spec
;
1772 err
= alc_alloc_spec(codec
, 0x07);
1777 /* as quite a few machines require HP amp for speaker outputs,
1778 * it's easier to enable it unconditionally; even if it's unneeded,
1779 * it's almost harmless.
1781 spec
->gen
.prefer_hp_amp
= 1;
1782 spec
->gen
.beep_nid
= 0x01;
1784 spec
->shutup
= alc_eapd_shutup
;
1786 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1788 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1790 /* automatic parse from the BIOS config */
1791 err
= alc260_parse_auto_config(codec
);
1795 if (!spec
->gen
.no_analog
)
1796 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1798 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1809 * ALC882/883/885/888/889 support
1811 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1812 * configuration. Each pin widget can choose any input DACs and a mixer.
1813 * Each ADC is connected from a mixer of all inputs. This makes possible
1814 * 6-channel independent captures.
1816 * In addition, an independent DAC for the multi-playback (not used in this
1824 ALC882_FIXUP_ABIT_AW9D_MAX
,
1825 ALC882_FIXUP_LENOVO_Y530
,
1826 ALC882_FIXUP_PB_M5210
,
1827 ALC882_FIXUP_ACER_ASPIRE_7736
,
1828 ALC882_FIXUP_ASUS_W90V
,
1830 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1831 ALC889_FIXUP_VAIO_TT
,
1832 ALC888_FIXUP_EEE1601
,
1835 ALC883_FIXUP_ACER_EAPD
,
1840 ALC882_FIXUP_ASUS_W2JC
,
1841 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1842 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1843 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1844 ALC885_FIXUP_MACPRO_GPIO
,
1845 ALC889_FIXUP_DAC_ROUTE
,
1846 ALC889_FIXUP_MBP_VREF
,
1847 ALC889_FIXUP_IMAC91_VREF
,
1848 ALC889_FIXUP_MBA11_VREF
,
1849 ALC889_FIXUP_MBA21_VREF
,
1850 ALC889_FIXUP_MP11_VREF
,
1851 ALC889_FIXUP_MP41_VREF
,
1852 ALC882_FIXUP_INV_DMIC
,
1853 ALC882_FIXUP_NO_PRIMARY_HP
,
1854 ALC887_FIXUP_ASUS_BASS
,
1855 ALC887_FIXUP_BASS_CHMAP
,
1856 ALC1220_FIXUP_GB_DUAL_CODECS
,
1857 ALC1220_FIXUP_CLEVO_P950
,
1858 ALC1220_FIXUP_SYSTEM76_ORYP5
,
1859 ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
,
1862 static void alc889_fixup_coef(struct hda_codec
*codec
,
1863 const struct hda_fixup
*fix
, int action
)
1865 if (action
!= HDA_FIXUP_ACT_INIT
)
1867 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1870 /* toggle speaker-output according to the hp-jack state */
1871 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
1873 unsigned int gpiostate
, gpiomask
, gpiodir
;
1875 gpiostate
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1876 AC_VERB_GET_GPIO_DATA
, 0);
1879 gpiostate
|= (1 << pin
);
1881 gpiostate
&= ~(1 << pin
);
1883 gpiomask
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1884 AC_VERB_GET_GPIO_MASK
, 0);
1885 gpiomask
|= (1 << pin
);
1887 gpiodir
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1888 AC_VERB_GET_GPIO_DIRECTION
, 0);
1889 gpiodir
|= (1 << pin
);
1892 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1893 AC_VERB_SET_GPIO_MASK
, gpiomask
);
1894 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1895 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
1899 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1900 AC_VERB_SET_GPIO_DATA
, gpiostate
);
1903 /* set up GPIO at initialization */
1904 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1905 const struct hda_fixup
*fix
, int action
)
1907 if (action
!= HDA_FIXUP_ACT_INIT
)
1909 alc882_gpio_mute(codec
, 0, 0);
1910 alc882_gpio_mute(codec
, 1, 0);
1913 /* Fix the connection of some pins for ALC889:
1914 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1915 * work correctly (bko#42740)
1917 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1918 const struct hda_fixup
*fix
, int action
)
1920 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1921 /* fake the connections during parsing the tree */
1922 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1923 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1924 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1925 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1926 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1927 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1928 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1929 /* restore the connections */
1930 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1931 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1932 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1933 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1934 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1938 /* Set VREF on HP pin */
1939 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1940 const struct hda_fixup
*fix
, int action
)
1942 struct alc_spec
*spec
= codec
->spec
;
1943 static hda_nid_t nids
[3] = { 0x14, 0x15, 0x19 };
1946 if (action
!= HDA_FIXUP_ACT_INIT
)
1948 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1949 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1950 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1952 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1953 val
|= AC_PINCTL_VREF_80
;
1954 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1955 spec
->gen
.keep_vref_in_automute
= 1;
1960 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1961 const hda_nid_t
*nids
, int num_nids
)
1963 struct alc_spec
*spec
= codec
->spec
;
1966 for (i
= 0; i
< num_nids
; i
++) {
1968 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1969 val
|= AC_PINCTL_VREF_50
;
1970 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1972 spec
->gen
.keep_vref_in_automute
= 1;
1975 /* Set VREF on speaker pins on imac91 */
1976 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1977 const struct hda_fixup
*fix
, int action
)
1979 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1981 if (action
== HDA_FIXUP_ACT_INIT
)
1982 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1985 /* Set VREF on speaker pins on mba11 */
1986 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1987 const struct hda_fixup
*fix
, int action
)
1989 static hda_nid_t nids
[1] = { 0x18 };
1991 if (action
== HDA_FIXUP_ACT_INIT
)
1992 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1995 /* Set VREF on speaker pins on mba21 */
1996 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
1997 const struct hda_fixup
*fix
, int action
)
1999 static hda_nid_t nids
[2] = { 0x18, 0x19 };
2001 if (action
== HDA_FIXUP_ACT_INIT
)
2002 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
2005 /* Don't take HP output as primary
2006 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
2007 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
2009 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
2010 const struct hda_fixup
*fix
, int action
)
2012 struct alc_spec
*spec
= codec
->spec
;
2013 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
2014 spec
->gen
.no_primary_hp
= 1;
2015 spec
->gen
.no_multi_io
= 1;
2019 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
2020 const struct hda_fixup
*fix
, int action
);
2022 /* For dual-codec configuration, we need to disable some features to avoid
2023 * conflicts of kctls and PCM streams
2025 static void alc_fixup_dual_codecs(struct hda_codec
*codec
,
2026 const struct hda_fixup
*fix
, int action
)
2028 struct alc_spec
*spec
= codec
->spec
;
2030 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2032 /* disable vmaster */
2033 spec
->gen
.suppress_vmaster
= 1;
2034 /* auto-mute and auto-mic switch don't work with multiple codecs */
2035 spec
->gen
.suppress_auto_mute
= 1;
2036 spec
->gen
.suppress_auto_mic
= 1;
2037 /* disable aamix as well */
2038 spec
->gen
.mixer_nid
= 0;
2039 /* add location prefix to avoid conflicts */
2040 codec
->force_pin_prefix
= 1;
2043 static void rename_ctl(struct hda_codec
*codec
, const char *oldname
,
2044 const char *newname
)
2046 struct snd_kcontrol
*kctl
;
2048 kctl
= snd_hda_find_mixer_ctl(codec
, oldname
);
2050 strcpy(kctl
->id
.name
, newname
);
2053 static void alc1220_fixup_gb_dual_codecs(struct hda_codec
*codec
,
2054 const struct hda_fixup
*fix
,
2057 alc_fixup_dual_codecs(codec
, fix
, action
);
2059 case HDA_FIXUP_ACT_PRE_PROBE
:
2060 /* override card longname to provide a unique UCM profile */
2061 strcpy(codec
->card
->longname
, "HDAudio-Gigabyte-ALC1220DualCodecs");
2063 case HDA_FIXUP_ACT_BUILD
:
2064 /* rename Capture controls depending on the codec */
2065 rename_ctl(codec
, "Capture Volume",
2067 "Rear-Panel Capture Volume" :
2068 "Front-Panel Capture Volume");
2069 rename_ctl(codec
, "Capture Switch",
2071 "Rear-Panel Capture Switch" :
2072 "Front-Panel Capture Switch");
2077 static void alc1220_fixup_clevo_p950(struct hda_codec
*codec
,
2078 const struct hda_fixup
*fix
,
2081 hda_nid_t conn1
[1] = { 0x0c };
2083 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2086 alc_update_coef_idx(codec
, 0x7, 0, 0x3c3);
2087 /* We therefore want to make sure 0x14 (front headphone) and
2088 * 0x1b (speakers) use the stereo DAC 0x02
2090 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
2091 snd_hda_override_conn_list(codec
, 0x1b, 1, conn1
);
2094 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
2095 const struct hda_fixup
*fix
, int action
);
2097 static void alc1220_fixup_system76_oryp5(struct hda_codec
*codec
,
2098 const struct hda_fixup
*fix
,
2101 alc1220_fixup_clevo_p950(codec
, fix
, action
);
2102 alc_fixup_headset_mode_no_hp_mic(codec
, fix
, action
);
2105 static const struct hda_fixup alc882_fixups
[] = {
2106 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2107 .type
= HDA_FIXUP_PINS
,
2108 .v
.pins
= (const struct hda_pintbl
[]) {
2109 { 0x15, 0x01080104 }, /* side */
2110 { 0x16, 0x01011012 }, /* rear */
2111 { 0x17, 0x01016011 }, /* clfe */
2115 [ALC882_FIXUP_LENOVO_Y530
] = {
2116 .type
= HDA_FIXUP_PINS
,
2117 .v
.pins
= (const struct hda_pintbl
[]) {
2118 { 0x15, 0x99130112 }, /* rear int speakers */
2119 { 0x16, 0x99130111 }, /* subwoofer */
2123 [ALC882_FIXUP_PB_M5210
] = {
2124 .type
= HDA_FIXUP_PINCTLS
,
2125 .v
.pins
= (const struct hda_pintbl
[]) {
2126 { 0x19, PIN_VREF50
},
2130 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2131 .type
= HDA_FIXUP_FUNC
,
2132 .v
.func
= alc_fixup_sku_ignore
,
2134 [ALC882_FIXUP_ASUS_W90V
] = {
2135 .type
= HDA_FIXUP_PINS
,
2136 .v
.pins
= (const struct hda_pintbl
[]) {
2137 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2141 [ALC889_FIXUP_CD
] = {
2142 .type
= HDA_FIXUP_PINS
,
2143 .v
.pins
= (const struct hda_pintbl
[]) {
2144 { 0x1c, 0x993301f0 }, /* CD */
2148 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2149 .type
= HDA_FIXUP_PINS
,
2150 .v
.pins
= (const struct hda_pintbl
[]) {
2151 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2155 .chain_id
= ALC889_FIXUP_CD
,
2157 [ALC889_FIXUP_VAIO_TT
] = {
2158 .type
= HDA_FIXUP_PINS
,
2159 .v
.pins
= (const struct hda_pintbl
[]) {
2160 { 0x17, 0x90170111 }, /* hidden surround speaker */
2164 [ALC888_FIXUP_EEE1601
] = {
2165 .type
= HDA_FIXUP_VERBS
,
2166 .v
.verbs
= (const struct hda_verb
[]) {
2167 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2168 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2172 [ALC882_FIXUP_EAPD
] = {
2173 .type
= HDA_FIXUP_VERBS
,
2174 .v
.verbs
= (const struct hda_verb
[]) {
2175 /* change to EAPD mode */
2176 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2177 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2181 [ALC883_FIXUP_EAPD
] = {
2182 .type
= HDA_FIXUP_VERBS
,
2183 .v
.verbs
= (const struct hda_verb
[]) {
2184 /* change to EAPD mode */
2185 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2186 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2190 [ALC883_FIXUP_ACER_EAPD
] = {
2191 .type
= HDA_FIXUP_VERBS
,
2192 .v
.verbs
= (const struct hda_verb
[]) {
2193 /* eanable EAPD on Acer laptops */
2194 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2195 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2199 [ALC882_FIXUP_GPIO1
] = {
2200 .type
= HDA_FIXUP_VERBS
,
2201 .v
.verbs
= alc_gpio1_init_verbs
,
2203 [ALC882_FIXUP_GPIO2
] = {
2204 .type
= HDA_FIXUP_VERBS
,
2205 .v
.verbs
= alc_gpio2_init_verbs
,
2207 [ALC882_FIXUP_GPIO3
] = {
2208 .type
= HDA_FIXUP_VERBS
,
2209 .v
.verbs
= alc_gpio3_init_verbs
,
2211 [ALC882_FIXUP_ASUS_W2JC
] = {
2212 .type
= HDA_FIXUP_VERBS
,
2213 .v
.verbs
= alc_gpio1_init_verbs
,
2215 .chain_id
= ALC882_FIXUP_EAPD
,
2217 [ALC889_FIXUP_COEF
] = {
2218 .type
= HDA_FIXUP_FUNC
,
2219 .v
.func
= alc889_fixup_coef
,
2221 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2222 .type
= HDA_FIXUP_PINS
,
2223 .v
.pins
= (const struct hda_pintbl
[]) {
2224 { 0x16, 0x99130111 }, /* CLFE speaker */
2225 { 0x17, 0x99130112 }, /* surround speaker */
2229 .chain_id
= ALC882_FIXUP_GPIO1
,
2231 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2232 .type
= HDA_FIXUP_PINS
,
2233 .v
.pins
= (const struct hda_pintbl
[]) {
2234 { 0x16, 0x99130111 }, /* CLFE speaker */
2235 { 0x1b, 0x99130112 }, /* surround speaker */
2239 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2241 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2242 /* additional init verbs for Acer Aspire 8930G */
2243 .type
= HDA_FIXUP_VERBS
,
2244 .v
.verbs
= (const struct hda_verb
[]) {
2245 /* Enable all DACs */
2246 /* DAC DISABLE/MUTE 1? */
2247 /* setting bits 1-5 disables DAC nids 0x02-0x06
2248 * apparently. Init=0x38 */
2249 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2250 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2251 /* DAC DISABLE/MUTE 2? */
2252 /* some bit here disables the other DACs.
2254 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2255 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2257 * This laptop has a stereo digital microphone.
2258 * The mics are only 1cm apart which makes the stereo
2259 * useless. However, either the mic or the ALC889
2260 * makes the signal become a difference/sum signal
2261 * instead of standard stereo, which is annoying.
2262 * So instead we flip this bit which makes the
2263 * codec replicate the sum signal to both channels,
2264 * turning it into a normal mono mic.
2266 /* DMIC_CONTROL? Init value = 0x0001 */
2267 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2268 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2269 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2270 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2274 .chain_id
= ALC882_FIXUP_GPIO1
,
2276 [ALC885_FIXUP_MACPRO_GPIO
] = {
2277 .type
= HDA_FIXUP_FUNC
,
2278 .v
.func
= alc885_fixup_macpro_gpio
,
2280 [ALC889_FIXUP_DAC_ROUTE
] = {
2281 .type
= HDA_FIXUP_FUNC
,
2282 .v
.func
= alc889_fixup_dac_route
,
2284 [ALC889_FIXUP_MBP_VREF
] = {
2285 .type
= HDA_FIXUP_FUNC
,
2286 .v
.func
= alc889_fixup_mbp_vref
,
2288 .chain_id
= ALC882_FIXUP_GPIO1
,
2290 [ALC889_FIXUP_IMAC91_VREF
] = {
2291 .type
= HDA_FIXUP_FUNC
,
2292 .v
.func
= alc889_fixup_imac91_vref
,
2294 .chain_id
= ALC882_FIXUP_GPIO1
,
2296 [ALC889_FIXUP_MBA11_VREF
] = {
2297 .type
= HDA_FIXUP_FUNC
,
2298 .v
.func
= alc889_fixup_mba11_vref
,
2300 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2302 [ALC889_FIXUP_MBA21_VREF
] = {
2303 .type
= HDA_FIXUP_FUNC
,
2304 .v
.func
= alc889_fixup_mba21_vref
,
2306 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2308 [ALC889_FIXUP_MP11_VREF
] = {
2309 .type
= HDA_FIXUP_FUNC
,
2310 .v
.func
= alc889_fixup_mba11_vref
,
2312 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2314 [ALC889_FIXUP_MP41_VREF
] = {
2315 .type
= HDA_FIXUP_FUNC
,
2316 .v
.func
= alc889_fixup_mbp_vref
,
2318 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2320 [ALC882_FIXUP_INV_DMIC
] = {
2321 .type
= HDA_FIXUP_FUNC
,
2322 .v
.func
= alc_fixup_inv_dmic
,
2324 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2325 .type
= HDA_FIXUP_FUNC
,
2326 .v
.func
= alc882_fixup_no_primary_hp
,
2328 [ALC887_FIXUP_ASUS_BASS
] = {
2329 .type
= HDA_FIXUP_PINS
,
2330 .v
.pins
= (const struct hda_pintbl
[]) {
2331 {0x16, 0x99130130}, /* bass speaker */
2335 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2337 [ALC887_FIXUP_BASS_CHMAP
] = {
2338 .type
= HDA_FIXUP_FUNC
,
2339 .v
.func
= alc_fixup_bass_chmap
,
2341 [ALC1220_FIXUP_GB_DUAL_CODECS
] = {
2342 .type
= HDA_FIXUP_FUNC
,
2343 .v
.func
= alc1220_fixup_gb_dual_codecs
,
2345 [ALC1220_FIXUP_CLEVO_P950
] = {
2346 .type
= HDA_FIXUP_FUNC
,
2347 .v
.func
= alc1220_fixup_clevo_p950
,
2349 [ALC1220_FIXUP_SYSTEM76_ORYP5
] = {
2350 .type
= HDA_FIXUP_FUNC
,
2351 .v
.func
= alc1220_fixup_system76_oryp5
,
2353 [ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
] = {
2354 .type
= HDA_FIXUP_PINS
,
2355 .v
.pins
= (const struct hda_pintbl
[]) {
2356 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2360 .chain_id
= ALC1220_FIXUP_SYSTEM76_ORYP5
,
2364 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2365 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2366 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2367 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2368 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2369 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2370 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2371 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2372 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2373 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2374 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2375 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2376 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2377 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2378 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2379 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2380 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2381 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2382 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2383 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2384 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2385 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2386 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2387 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2388 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2389 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2390 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2391 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2392 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2393 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2394 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2395 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2396 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2397 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2398 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2399 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2400 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP
),
2401 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2402 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2404 /* All Apple entries are in codec SSIDs */
2405 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2406 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2407 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2408 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2409 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2410 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2411 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2412 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2413 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2414 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2415 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2416 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2417 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2418 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2419 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2420 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2421 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2422 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2423 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2424 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2425 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2426 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2428 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2429 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2430 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2431 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2432 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2433 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2434 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2435 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950
),
2436 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950
),
2437 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950
),
2438 SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
),
2439 SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS
),
2440 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2441 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2442 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2443 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2447 static const struct hda_model_fixup alc882_fixup_models
[] = {
2448 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2449 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2450 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2451 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2452 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2453 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2458 * BIOS auto configuration
2460 /* almost identical with ALC880 parser... */
2461 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2463 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2464 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2465 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2470 static int patch_alc882(struct hda_codec
*codec
)
2472 struct alc_spec
*spec
;
2475 err
= alc_alloc_spec(codec
, 0x0b);
2481 switch (codec
->core
.vendor_id
) {
2488 /* ALC883 and variants */
2489 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2493 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2495 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2497 alc_auto_parse_customize_define(codec
);
2499 if (has_cdefine_beep(codec
))
2500 spec
->gen
.beep_nid
= 0x01;
2502 /* automatic parse from the BIOS config */
2503 err
= alc882_parse_auto_config(codec
);
2507 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2508 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2510 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2523 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2525 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2526 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2527 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2534 ALC262_FIXUP_FSC_H270
,
2535 ALC262_FIXUP_FSC_S7110
,
2536 ALC262_FIXUP_HP_Z200
,
2538 ALC262_FIXUP_LENOVO_3000
,
2540 ALC262_FIXUP_BENQ_T31
,
2541 ALC262_FIXUP_INV_DMIC
,
2542 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2545 static const struct hda_fixup alc262_fixups
[] = {
2546 [ALC262_FIXUP_FSC_H270
] = {
2547 .type
= HDA_FIXUP_PINS
,
2548 .v
.pins
= (const struct hda_pintbl
[]) {
2549 { 0x14, 0x99130110 }, /* speaker */
2550 { 0x15, 0x0221142f }, /* front HP */
2551 { 0x1b, 0x0121141f }, /* rear HP */
2555 [ALC262_FIXUP_FSC_S7110
] = {
2556 .type
= HDA_FIXUP_PINS
,
2557 .v
.pins
= (const struct hda_pintbl
[]) {
2558 { 0x15, 0x90170110 }, /* speaker */
2562 .chain_id
= ALC262_FIXUP_BENQ
,
2564 [ALC262_FIXUP_HP_Z200
] = {
2565 .type
= HDA_FIXUP_PINS
,
2566 .v
.pins
= (const struct hda_pintbl
[]) {
2567 { 0x16, 0x99130120 }, /* internal speaker */
2571 [ALC262_FIXUP_TYAN
] = {
2572 .type
= HDA_FIXUP_PINS
,
2573 .v
.pins
= (const struct hda_pintbl
[]) {
2574 { 0x14, 0x1993e1f0 }, /* int AUX */
2578 [ALC262_FIXUP_LENOVO_3000
] = {
2579 .type
= HDA_FIXUP_PINCTLS
,
2580 .v
.pins
= (const struct hda_pintbl
[]) {
2581 { 0x19, PIN_VREF50
},
2585 .chain_id
= ALC262_FIXUP_BENQ
,
2587 [ALC262_FIXUP_BENQ
] = {
2588 .type
= HDA_FIXUP_VERBS
,
2589 .v
.verbs
= (const struct hda_verb
[]) {
2590 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2591 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2595 [ALC262_FIXUP_BENQ_T31
] = {
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
, 0x3050 },
2603 [ALC262_FIXUP_INV_DMIC
] = {
2604 .type
= HDA_FIXUP_FUNC
,
2605 .v
.func
= alc_fixup_inv_dmic
,
2607 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2608 .type
= HDA_FIXUP_FUNC
,
2609 .v
.func
= alc_fixup_no_depop_delay
,
2613 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2614 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2615 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2616 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2617 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2618 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2619 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2620 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2621 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2622 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2623 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2627 static const struct hda_model_fixup alc262_fixup_models
[] = {
2628 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2634 static int patch_alc262(struct hda_codec
*codec
)
2636 struct alc_spec
*spec
;
2639 err
= alc_alloc_spec(codec
, 0x0b);
2644 spec
->gen
.shared_mic_vref_pin
= 0x18;
2646 spec
->shutup
= alc_eapd_shutup
;
2649 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2652 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2654 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2656 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2658 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2660 alc_auto_parse_customize_define(codec
);
2662 if (has_cdefine_beep(codec
))
2663 spec
->gen
.beep_nid
= 0x01;
2665 /* automatic parse from the BIOS config */
2666 err
= alc262_parse_auto_config(codec
);
2670 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2671 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2673 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2685 /* bind Beep switches of both NID 0x0f and 0x10 */
2686 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2687 struct snd_ctl_elem_value
*ucontrol
)
2689 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2693 mutex_lock(&codec
->control_mutex
);
2694 pval
= kcontrol
->private_value
;
2695 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2696 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2698 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2699 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2701 kcontrol
->private_value
= pval
;
2702 mutex_unlock(&codec
->control_mutex
);
2706 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2707 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2709 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2710 .name
= "Beep Playback Switch",
2711 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2712 .info
= snd_hda_mixer_amp_switch_info
,
2713 .get
= snd_hda_mixer_amp_switch_get
,
2714 .put
= alc268_beep_switch_put
,
2715 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2720 /* set PCBEEP vol = 0, mute connections */
2721 static const struct hda_verb alc268_beep_init_verbs
[] = {
2722 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2723 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2724 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2729 ALC268_FIXUP_INV_DMIC
,
2730 ALC268_FIXUP_HP_EAPD
,
2734 static const struct hda_fixup alc268_fixups
[] = {
2735 [ALC268_FIXUP_INV_DMIC
] = {
2736 .type
= HDA_FIXUP_FUNC
,
2737 .v
.func
= alc_fixup_inv_dmic
,
2739 [ALC268_FIXUP_HP_EAPD
] = {
2740 .type
= HDA_FIXUP_VERBS
,
2741 .v
.verbs
= (const struct hda_verb
[]) {
2742 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2746 [ALC268_FIXUP_SPDIF
] = {
2747 .type
= HDA_FIXUP_PINS
,
2748 .v
.pins
= (const struct hda_pintbl
[]) {
2749 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2755 static const struct hda_model_fixup alc268_fixup_models
[] = {
2756 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2757 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2761 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2762 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2763 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2764 /* below is codec SSID since multiple Toshiba laptops have the
2765 * same PCI SSID 1179:ff00
2767 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2772 * BIOS auto configuration
2774 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2776 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2777 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2782 static int patch_alc268(struct hda_codec
*codec
)
2784 struct alc_spec
*spec
;
2787 /* ALC268 has no aa-loopback mixer */
2788 err
= alc_alloc_spec(codec
, 0);
2793 spec
->gen
.beep_nid
= 0x01;
2795 spec
->shutup
= alc_eapd_shutup
;
2797 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2798 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2800 /* automatic parse from the BIOS config */
2801 err
= alc268_parse_auto_config(codec
);
2805 if (err
> 0 && !spec
->gen
.no_analog
&&
2806 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2807 add_mixer(spec
, alc268_beep_mixer
);
2808 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2809 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2810 /* override the amp caps for beep generator */
2811 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2812 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2813 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2814 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2815 (0 << AC_AMPCAP_MUTE_SHIFT
));
2818 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2831 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2832 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2835 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2836 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2839 /* different alc269-variants */
2841 ALC269_TYPE_ALC269VA
,
2842 ALC269_TYPE_ALC269VB
,
2843 ALC269_TYPE_ALC269VC
,
2844 ALC269_TYPE_ALC269VD
,
2862 * BIOS auto configuration
2864 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2866 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2867 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2868 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2869 struct alc_spec
*spec
= codec
->spec
;
2870 const hda_nid_t
*ssids
;
2872 switch (spec
->codec_variant
) {
2873 case ALC269_TYPE_ALC269VA
:
2874 case ALC269_TYPE_ALC269VC
:
2875 case ALC269_TYPE_ALC280
:
2876 case ALC269_TYPE_ALC284
:
2877 case ALC269_TYPE_ALC293
:
2878 ssids
= alc269va_ssids
;
2880 case ALC269_TYPE_ALC269VB
:
2881 case ALC269_TYPE_ALC269VD
:
2882 case ALC269_TYPE_ALC282
:
2883 case ALC269_TYPE_ALC283
:
2884 case ALC269_TYPE_ALC286
:
2885 case ALC269_TYPE_ALC298
:
2886 case ALC269_TYPE_ALC255
:
2887 case ALC269_TYPE_ALC256
:
2888 case ALC269_TYPE_ALC257
:
2889 case ALC269_TYPE_ALC215
:
2890 case ALC269_TYPE_ALC225
:
2891 case ALC269_TYPE_ALC294
:
2892 case ALC269_TYPE_ALC700
:
2893 ssids
= alc269_ssids
;
2896 ssids
= alc269_ssids
;
2900 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2903 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2905 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2908 static void alc269_shutup(struct hda_codec
*codec
)
2910 struct alc_spec
*spec
= codec
->spec
;
2912 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2913 alc269vb_toggle_power_output(codec
, 0);
2914 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2915 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2918 alc_shutup_pins(codec
);
2921 static struct coef_fw alc282_coefs
[] = {
2922 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2923 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2924 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2925 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2926 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2927 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2928 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2929 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2930 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2931 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2932 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2933 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2934 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2935 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2936 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2937 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2938 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2939 WRITE_COEF(0x63, 0x2902), /* PLL */
2940 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2941 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2942 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2943 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2944 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2945 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2946 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2947 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2948 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2949 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2950 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2954 static void alc282_restore_default_value(struct hda_codec
*codec
)
2956 alc_process_coef_fw(codec
, alc282_coefs
);
2959 static void alc282_init(struct hda_codec
*codec
)
2961 struct alc_spec
*spec
= codec
->spec
;
2962 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2966 alc282_restore_default_value(codec
);
2970 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2971 coef78
= alc_read_coef_idx(codec
, 0x78);
2973 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2974 /* Headphone capless set to high power mode */
2975 alc_write_coef_idx(codec
, 0x78, 0x9004);
2980 snd_hda_codec_write(codec
, hp_pin
, 0,
2981 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2986 snd_hda_codec_write(codec
, hp_pin
, 0,
2987 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
2992 /* Headphone capless set to normal mode */
2993 alc_write_coef_idx(codec
, 0x78, coef78
);
2996 static void alc282_shutup(struct hda_codec
*codec
)
2998 struct alc_spec
*spec
= codec
->spec
;
2999 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3004 alc269_shutup(codec
);
3008 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3009 coef78
= alc_read_coef_idx(codec
, 0x78);
3010 alc_write_coef_idx(codec
, 0x78, 0x9004);
3015 snd_hda_codec_write(codec
, hp_pin
, 0,
3016 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3021 if (!spec
->no_shutup_pins
)
3022 snd_hda_codec_write(codec
, hp_pin
, 0,
3023 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3028 alc_auto_setup_eapd(codec
, false);
3029 alc_shutup_pins(codec
);
3030 alc_write_coef_idx(codec
, 0x78, coef78
);
3033 static struct coef_fw alc283_coefs
[] = {
3034 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3035 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3036 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3037 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3038 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3039 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3040 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3041 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3042 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3043 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3044 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3045 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3046 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3047 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3048 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3049 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3050 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3051 WRITE_COEF(0x2e, 0x2902), /* PLL */
3052 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3053 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3054 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3055 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3056 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3057 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3058 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3059 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3060 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3061 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3062 WRITE_COEF(0x49, 0x0), /* test mode */
3063 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3064 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3065 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3066 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3070 static void alc283_restore_default_value(struct hda_codec
*codec
)
3072 alc_process_coef_fw(codec
, alc283_coefs
);
3075 static void alc283_init(struct hda_codec
*codec
)
3077 struct alc_spec
*spec
= codec
->spec
;
3078 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3081 if (!spec
->gen
.autocfg
.hp_outs
) {
3082 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3083 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3086 alc283_restore_default_value(codec
);
3092 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3094 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3095 /* Headphone capless set to high power mode */
3096 alc_write_coef_idx(codec
, 0x43, 0x9004);
3098 snd_hda_codec_write(codec
, hp_pin
, 0,
3099 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3104 snd_hda_codec_write(codec
, hp_pin
, 0,
3105 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3109 /* Index 0x46 Combo jack auto switch control 2 */
3110 /* 3k pull low control for Headset jack. */
3111 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3112 /* Headphone capless set to normal mode */
3113 alc_write_coef_idx(codec
, 0x43, 0x9614);
3116 static void alc283_shutup(struct hda_codec
*codec
)
3118 struct alc_spec
*spec
= codec
->spec
;
3119 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3122 if (!spec
->gen
.autocfg
.hp_outs
) {
3123 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3124 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3128 alc269_shutup(codec
);
3132 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3134 alc_write_coef_idx(codec
, 0x43, 0x9004);
3136 /*depop hp during suspend*/
3137 alc_write_coef_idx(codec
, 0x06, 0x2100);
3139 snd_hda_codec_write(codec
, hp_pin
, 0,
3140 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3145 if (!spec
->no_shutup_pins
)
3146 snd_hda_codec_write(codec
, hp_pin
, 0,
3147 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3149 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3153 alc_auto_setup_eapd(codec
, false);
3154 alc_shutup_pins(codec
);
3155 alc_write_coef_idx(codec
, 0x43, 0x9614);
3158 static void alc256_init(struct hda_codec
*codec
)
3160 struct alc_spec
*spec
= codec
->spec
;
3161 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3169 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3174 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3176 snd_hda_codec_write(codec
, hp_pin
, 0,
3177 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3182 snd_hda_codec_write(codec
, hp_pin
, 0,
3183 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3188 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3189 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3190 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3191 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 0 << 15);
3194 static void alc256_shutup(struct hda_codec
*codec
)
3196 struct alc_spec
*spec
= codec
->spec
;
3197 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3201 alc269_shutup(codec
);
3205 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3210 snd_hda_codec_write(codec
, hp_pin
, 0,
3211 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3216 /* 3k pull low control for Headset jack. */
3217 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3218 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3220 if (!spec
->no_shutup_pins
)
3221 snd_hda_codec_write(codec
, hp_pin
, 0,
3222 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3227 alc_auto_setup_eapd(codec
, false);
3228 alc_shutup_pins(codec
);
3231 static void alc225_init(struct hda_codec
*codec
)
3233 struct alc_spec
*spec
= codec
->spec
;
3234 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3235 bool hp1_pin_sense
, hp2_pin_sense
;
3242 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3243 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3245 if (hp1_pin_sense
|| hp2_pin_sense
)
3248 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3251 snd_hda_codec_write(codec
, hp_pin
, 0,
3252 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3254 snd_hda_codec_write(codec
, 0x16, 0,
3255 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3257 if (hp1_pin_sense
|| hp2_pin_sense
)
3261 snd_hda_codec_write(codec
, hp_pin
, 0,
3262 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3264 snd_hda_codec_write(codec
, 0x16, 0,
3265 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3267 if (hp1_pin_sense
|| hp2_pin_sense
)
3270 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3271 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3274 static void alc225_shutup(struct hda_codec
*codec
)
3276 struct alc_spec
*spec
= codec
->spec
;
3277 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3278 bool hp1_pin_sense
, hp2_pin_sense
;
3281 alc269_shutup(codec
);
3285 /* 3k pull low control for Headset jack. */
3286 alc_update_coef_idx(codec
, 0x4a, 0, 3 << 10);
3288 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3289 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3291 if (hp1_pin_sense
|| hp2_pin_sense
)
3295 snd_hda_codec_write(codec
, hp_pin
, 0,
3296 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3298 snd_hda_codec_write(codec
, 0x16, 0,
3299 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3301 if (hp1_pin_sense
|| hp2_pin_sense
)
3305 snd_hda_codec_write(codec
, hp_pin
, 0,
3306 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3308 snd_hda_codec_write(codec
, 0x16, 0,
3309 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3311 if (hp1_pin_sense
|| hp2_pin_sense
)
3314 alc_auto_setup_eapd(codec
, false);
3315 alc_shutup_pins(codec
);
3318 static void alc_default_init(struct hda_codec
*codec
)
3320 struct alc_spec
*spec
= codec
->spec
;
3321 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3329 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3334 snd_hda_codec_write(codec
, hp_pin
, 0,
3335 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3340 snd_hda_codec_write(codec
, hp_pin
, 0,
3341 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3347 static void alc_default_shutup(struct hda_codec
*codec
)
3349 struct alc_spec
*spec
= codec
->spec
;
3350 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3354 alc269_shutup(codec
);
3358 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3363 snd_hda_codec_write(codec
, hp_pin
, 0,
3364 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3369 if (!spec
->no_shutup_pins
)
3370 snd_hda_codec_write(codec
, hp_pin
, 0,
3371 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3376 alc_auto_setup_eapd(codec
, false);
3377 alc_shutup_pins(codec
);
3380 static void alc294_hp_init(struct hda_codec
*codec
)
3382 struct alc_spec
*spec
= codec
->spec
;
3383 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3389 snd_hda_codec_write(codec
, hp_pin
, 0,
3390 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3394 snd_hda_codec_write(codec
, hp_pin
, 0,
3395 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3397 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3398 alc_update_coefex_idx(codec
, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3400 /* Wait for depop procedure finish */
3401 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3402 for (i
= 0; i
< 20 && val
& 0x0080; i
++) {
3404 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3406 /* Set HP depop to auto mode */
3407 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0x000b);
3411 static void alc294_init(struct hda_codec
*codec
)
3413 struct alc_spec
*spec
= codec
->spec
;
3415 if (!spec
->done_hp_init
) {
3416 alc294_hp_init(codec
);
3417 spec
->done_hp_init
= true;
3419 alc_default_init(codec
);
3422 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3425 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3426 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3427 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3430 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3434 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3435 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3437 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3442 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3446 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3447 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3448 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3449 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3450 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3451 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3452 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3453 val
= alc5505_coef_get(codec
, 0x6220);
3454 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3457 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3459 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3460 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3461 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3462 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3463 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3464 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3467 static void alc5505_dsp_init(struct hda_codec
*codec
)
3471 alc5505_dsp_halt(codec
);
3472 alc5505_dsp_back_from_halt(codec
);
3473 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3474 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3475 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3476 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3477 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3478 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3479 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3480 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3481 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3482 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3483 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3484 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3485 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3487 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3489 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3491 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3493 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3494 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3495 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3496 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3497 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3498 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3499 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3501 #ifdef HALT_REALTEK_ALC5505
3502 alc5505_dsp_halt(codec
);
3506 #ifdef HALT_REALTEK_ALC5505
3507 #define alc5505_dsp_suspend(codec) /* NOP */
3508 #define alc5505_dsp_resume(codec) /* NOP */
3510 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3511 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3515 static int alc269_suspend(struct hda_codec
*codec
)
3517 struct alc_spec
*spec
= codec
->spec
;
3519 if (spec
->has_alc5505_dsp
)
3520 alc5505_dsp_suspend(codec
);
3521 return alc_suspend(codec
);
3524 static int alc269_resume(struct hda_codec
*codec
)
3526 struct alc_spec
*spec
= codec
->spec
;
3528 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3529 alc269vb_toggle_power_output(codec
, 0);
3530 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3531 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3535 codec
->patch_ops
.init(codec
);
3537 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3538 alc269vb_toggle_power_output(codec
, 1);
3539 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3540 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3544 regcache_sync(codec
->core
.regmap
);
3545 hda_call_check_power_status(codec
, 0x01);
3547 /* on some machine, the BIOS will clear the codec gpio data when enter
3548 * suspend, and won't restore the data after resume, so we restore it
3552 snd_hda_codec_write(codec
, codec
->core
.afg
, 0, AC_VERB_SET_GPIO_DATA
,
3555 if (spec
->has_alc5505_dsp
)
3556 alc5505_dsp_resume(codec
);
3560 #endif /* CONFIG_PM */
3562 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3563 const struct hda_fixup
*fix
, int action
)
3565 struct alc_spec
*spec
= codec
->spec
;
3567 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3568 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3571 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3572 const struct hda_fixup
*fix
,
3575 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3576 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3578 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3579 snd_hda_codec_set_pincfg(codec
, 0x19,
3580 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3581 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3584 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3585 const struct hda_fixup
*fix
, int action
)
3587 if (action
== HDA_FIXUP_ACT_INIT
)
3588 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3591 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3592 const struct hda_fixup
*fix
, int action
)
3594 struct alc_spec
*spec
= codec
->spec
;
3596 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3597 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3600 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3601 const struct hda_fixup
*fix
, int action
)
3603 static const struct hda_verb verbs
[] = {
3604 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3605 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3610 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3611 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3613 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3614 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3615 snd_hda_sequence_write(codec
, verbs
);
3618 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3619 const struct hda_fixup
*fix
, int action
)
3621 struct alc_spec
*spec
= codec
->spec
;
3623 if (action
!= HDA_FIXUP_ACT_PROBE
)
3626 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3627 * fix the sample rate of analog I/O to 44.1kHz
3629 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3630 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3633 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3634 const struct hda_fixup
*fix
, int action
)
3636 /* The digital-mic unit sends PDM (differential signal) instead of
3637 * the standard PCM, thus you can't record a valid mono stream as is.
3638 * Below is a workaround specific to ALC269 to control the dmic
3639 * signal source as mono.
3641 if (action
== HDA_FIXUP_ACT_INIT
)
3642 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3645 static void alc269_quanta_automute(struct hda_codec
*codec
)
3647 snd_hda_gen_update_outputs(codec
);
3649 alc_write_coef_idx(codec
, 0x0c, 0x680);
3650 alc_write_coef_idx(codec
, 0x0c, 0x480);
3653 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3654 const struct hda_fixup
*fix
, int action
)
3656 struct alc_spec
*spec
= codec
->spec
;
3657 if (action
!= HDA_FIXUP_ACT_PROBE
)
3659 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3662 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3663 struct hda_jack_callback
*jack
)
3665 struct alc_spec
*spec
= codec
->spec
;
3668 snd_hda_gen_hp_automute(codec
, jack
);
3670 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3672 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3675 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3679 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3680 const struct hda_fixup
*fix
, int action
)
3682 struct alc_spec
*spec
= codec
->spec
;
3683 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3684 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3685 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3690 /* update mute-LED according to the speaker mute state via mic VREF pin */
3691 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3693 struct hda_codec
*codec
= private_data
;
3694 struct alc_spec
*spec
= codec
->spec
;
3695 unsigned int pinval
;
3697 if (spec
->mute_led_polarity
)
3699 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3700 pinval
&= ~AC_PINCTL_VREFEN
;
3701 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3702 if (spec
->mute_led_nid
) {
3703 /* temporarily power up/down for setting VREF */
3704 snd_hda_power_up_pm(codec
);
3705 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3706 snd_hda_power_down_pm(codec
);
3710 /* Make sure the led works even in runtime suspend */
3711 static unsigned int led_power_filter(struct hda_codec
*codec
,
3713 unsigned int power_state
)
3715 struct alc_spec
*spec
= codec
->spec
;
3717 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3718 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3721 /* Set pin ctl again, it might have just been set to 0 */
3722 snd_hda_set_pin_ctl(codec
, nid
,
3723 snd_hda_codec_get_pin_target(codec
, nid
));
3725 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3728 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3729 const struct hda_fixup
*fix
, int action
)
3731 struct alc_spec
*spec
= codec
->spec
;
3732 const struct dmi_device
*dev
= NULL
;
3734 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3737 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3739 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3741 if (pin
< 0x0a || pin
>= 0x10)
3743 spec
->mute_led_polarity
= pol
;
3744 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3745 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3746 spec
->gen
.vmaster_mute_enum
= 1;
3747 codec
->power_filter
= led_power_filter
;
3749 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3750 spec
->mute_led_polarity
);
3755 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3756 const struct hda_fixup
*fix
, int action
)
3758 struct alc_spec
*spec
= codec
->spec
;
3759 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3760 spec
->mute_led_polarity
= 0;
3761 spec
->mute_led_nid
= 0x18;
3762 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3763 spec
->gen
.vmaster_mute_enum
= 1;
3764 codec
->power_filter
= led_power_filter
;
3768 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3769 const struct hda_fixup
*fix
, int action
)
3771 struct alc_spec
*spec
= codec
->spec
;
3772 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3773 spec
->mute_led_polarity
= 0;
3774 spec
->mute_led_nid
= 0x19;
3775 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3776 spec
->gen
.vmaster_mute_enum
= 1;
3777 codec
->power_filter
= led_power_filter
;
3781 /* update LED status via GPIO */
3782 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3785 struct alc_spec
*spec
= codec
->spec
;
3786 unsigned int oldval
= spec
->gpio_led
;
3788 if (spec
->mute_led_polarity
)
3792 spec
->gpio_led
&= ~mask
;
3794 spec
->gpio_led
|= mask
;
3795 if (spec
->gpio_led
!= oldval
)
3796 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3800 /* turn on/off mute LED via GPIO per vmaster hook */
3801 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3803 struct hda_codec
*codec
= private_data
;
3804 struct alc_spec
*spec
= codec
->spec
;
3806 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3809 /* turn on/off mic-mute LED via GPIO per capture hook */
3810 static void alc_fixup_gpio_mic_mute_hook(struct hda_codec
*codec
,
3811 struct snd_kcontrol
*kcontrol
,
3812 struct snd_ctl_elem_value
*ucontrol
)
3814 struct alc_spec
*spec
= codec
->spec
;
3817 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3818 ucontrol
->value
.integer
.value
[0] ||
3819 ucontrol
->value
.integer
.value
[1]);
3822 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3823 const struct hda_fixup
*fix
, int action
)
3825 struct alc_spec
*spec
= codec
->spec
;
3826 static const struct hda_verb gpio_init
[] = {
3827 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3828 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3832 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3833 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3834 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3836 spec
->mute_led_polarity
= 0;
3837 spec
->gpio_mute_led_mask
= 0x08;
3838 spec
->gpio_mic_led_mask
= 0x10;
3839 snd_hda_add_verbs(codec
, gpio_init
);
3843 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3844 const struct hda_fixup
*fix
, int action
)
3846 struct alc_spec
*spec
= codec
->spec
;
3847 static const struct hda_verb gpio_init
[] = {
3848 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x22 },
3849 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x22 },
3853 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3854 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3855 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3857 spec
->mute_led_polarity
= 0;
3858 spec
->gpio_mute_led_mask
= 0x02;
3859 spec
->gpio_mic_led_mask
= 0x20;
3860 snd_hda_add_verbs(codec
, gpio_init
);
3864 /* turn on/off mic-mute LED per capture hook */
3865 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3866 struct snd_kcontrol
*kcontrol
,
3867 struct snd_ctl_elem_value
*ucontrol
)
3869 struct alc_spec
*spec
= codec
->spec
;
3870 unsigned int pinval
, enable
, disable
;
3872 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3873 pinval
&= ~AC_PINCTL_VREFEN
;
3874 enable
= pinval
| AC_PINCTL_VREF_80
;
3875 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3880 if (ucontrol
->value
.integer
.value
[0] ||
3881 ucontrol
->value
.integer
.value
[1])
3886 if (spec
->cap_mute_led_nid
)
3887 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3890 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3891 const struct hda_fixup
*fix
, int action
)
3893 struct alc_spec
*spec
= codec
->spec
;
3894 static const struct hda_verb gpio_init
[] = {
3895 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3896 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3900 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3901 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3902 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3904 spec
->mute_led_polarity
= 0;
3905 spec
->gpio_mute_led_mask
= 0x08;
3906 spec
->cap_mute_led_nid
= 0x18;
3907 snd_hda_add_verbs(codec
, gpio_init
);
3908 codec
->power_filter
= led_power_filter
;
3912 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3913 const struct hda_fixup
*fix
, int action
)
3915 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */
3916 struct alc_spec
*spec
= codec
->spec
;
3917 static const struct hda_verb gpio_init
[] = {
3918 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3919 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3923 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3924 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3925 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3927 spec
->mute_led_polarity
= 0;
3928 spec
->gpio_mute_led_mask
= 0x08;
3929 spec
->cap_mute_led_nid
= 0x18;
3930 snd_hda_add_verbs(codec
, gpio_init
);
3931 codec
->power_filter
= led_power_filter
;
3935 #if IS_REACHABLE(CONFIG_INPUT)
3936 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3937 struct hda_jack_callback
*event
)
3939 struct alc_spec
*spec
= codec
->spec
;
3941 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3942 send both key on and key off event for every interrupt. */
3943 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
3944 input_sync(spec
->kb_dev
);
3945 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
3946 input_sync(spec
->kb_dev
);
3949 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
3951 struct alc_spec
*spec
= codec
->spec
;
3954 spec
->kb_dev
= input_allocate_device();
3955 if (!spec
->kb_dev
) {
3956 codec_err(codec
, "Out of memory (input_allocate_device)\n");
3960 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
3962 spec
->kb_dev
->name
= "Microphone Mute Button";
3963 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
3964 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
3965 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
3966 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
3967 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
3968 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
3970 if (input_register_device(spec
->kb_dev
)) {
3971 codec_err(codec
, "input_register_device failed\n");
3972 input_free_device(spec
->kb_dev
);
3973 spec
->kb_dev
= NULL
;
3980 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
3981 const struct hda_fixup
*fix
, int action
)
3983 /* GPIO1 = set according to SKU external amp
3984 GPIO2 = mic mute hotkey
3986 GPIO4 = mic mute LED */
3987 static const struct hda_verb gpio_init
[] = {
3988 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x1e },
3989 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x1a },
3990 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x02 },
3994 struct alc_spec
*spec
= codec
->spec
;
3996 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3997 if (alc_register_micmute_input_device(codec
) != 0)
4000 snd_hda_add_verbs(codec
, gpio_init
);
4001 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
4002 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
4003 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
4004 gpio2_mic_hotkey_event
);
4006 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
4007 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4009 spec
->mute_led_polarity
= 0;
4010 spec
->gpio_mute_led_mask
= 0x08;
4011 spec
->gpio_mic_led_mask
= 0x10;
4019 case HDA_FIXUP_ACT_PROBE
:
4020 spec
->init_amp
= ALC_INIT_DEFAULT
;
4022 case HDA_FIXUP_ACT_FREE
:
4023 input_unregister_device(spec
->kb_dev
);
4024 spec
->kb_dev
= NULL
;
4028 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
4029 const struct hda_fixup
*fix
, int action
)
4031 /* Line2 = mic mute hotkey
4032 GPIO2 = mic mute LED */
4033 static const struct hda_verb gpio_init
[] = {
4034 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4035 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
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_jack_detect_enable_callback(codec
, 0x1b,
4047 gpio2_mic_hotkey_event
);
4049 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
4051 spec
->mute_led_polarity
= 0;
4052 spec
->gpio_mic_led_mask
= 0x04;
4060 case HDA_FIXUP_ACT_PROBE
:
4061 spec
->init_amp
= ALC_INIT_DEFAULT
;
4063 case HDA_FIXUP_ACT_FREE
:
4064 input_unregister_device(spec
->kb_dev
);
4065 spec
->kb_dev
= NULL
;
4069 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4070 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4073 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
4074 const struct hda_fixup
*fix
, int action
)
4076 struct alc_spec
*spec
= codec
->spec
;
4078 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4079 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
4080 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
4081 spec
->mute_led_polarity
= 0;
4082 spec
->mute_led_nid
= 0x1a;
4083 spec
->cap_mute_led_nid
= 0x18;
4084 spec
->gen
.vmaster_mute_enum
= 1;
4085 codec
->power_filter
= led_power_filter
;
4089 static struct coef_fw alc225_pre_hsmode
[] = {
4090 UPDATE_COEF(0x4a, 1<<8, 0),
4091 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4092 UPDATE_COEF(0x63, 3<<14, 3<<14),
4093 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4094 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4095 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4096 UPDATE_COEF(0x4a, 3<<10, 0),
4100 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
4102 static struct coef_fw coef0255
[] = {
4103 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4104 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4105 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4106 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4109 static struct coef_fw coef0255_1
[] = {
4110 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4113 static struct coef_fw coef0256
[] = {
4114 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4117 static struct coef_fw coef0233
[] = {
4118 WRITE_COEF(0x1b, 0x0c0b),
4119 WRITE_COEF(0x45, 0xc429),
4120 UPDATE_COEF(0x35, 0x4000, 0),
4121 WRITE_COEF(0x06, 0x2104),
4122 WRITE_COEF(0x1a, 0x0001),
4123 WRITE_COEF(0x26, 0x0004),
4124 WRITE_COEF(0x32, 0x42a3),
4127 static struct coef_fw coef0288
[] = {
4128 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4129 UPDATE_COEF(0x50, 0x2000, 0x2000),
4130 UPDATE_COEF(0x56, 0x0006, 0x0006),
4131 UPDATE_COEF(0x66, 0x0008, 0),
4132 UPDATE_COEF(0x67, 0x2000, 0),
4135 static struct coef_fw coef0298
[] = {
4136 UPDATE_COEF(0x19, 0x1300, 0x0300),
4139 static struct coef_fw coef0292
[] = {
4140 WRITE_COEF(0x76, 0x000e),
4141 WRITE_COEF(0x6c, 0x2400),
4142 WRITE_COEF(0x18, 0x7308),
4143 WRITE_COEF(0x6b, 0xc429),
4146 static struct coef_fw coef0293
[] = {
4147 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4148 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4149 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4150 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4151 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4152 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4155 static struct coef_fw coef0668
[] = {
4156 WRITE_COEF(0x15, 0x0d40),
4157 WRITE_COEF(0xb7, 0x802b),
4160 static struct coef_fw coef0225
[] = {
4161 UPDATE_COEF(0x63, 3<<14, 0),
4164 static struct coef_fw coef0274
[] = {
4165 UPDATE_COEF(0x4a, 0x0100, 0),
4166 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4167 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4168 UPDATE_COEF(0x4a, 0x0010, 0),
4169 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4170 WRITE_COEF(0x45, 0x5289),
4171 UPDATE_COEF(0x4a, 0x0c00, 0),
4175 switch (codec
->core
.vendor_id
) {
4177 alc_process_coef_fw(codec
, coef0255_1
);
4178 alc_process_coef_fw(codec
, coef0255
);
4182 alc_process_coef_fw(codec
, coef0256
);
4183 alc_process_coef_fw(codec
, coef0255
);
4188 alc_process_coef_fw(codec
, coef0274
);
4192 alc_process_coef_fw(codec
, coef0233
);
4196 alc_process_coef_fw(codec
, coef0288
);
4199 alc_process_coef_fw(codec
, coef0298
);
4200 alc_process_coef_fw(codec
, coef0288
);
4203 alc_process_coef_fw(codec
, coef0292
);
4206 alc_process_coef_fw(codec
, coef0293
);
4209 alc_process_coef_fw(codec
, coef0668
);
4217 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4218 alc_process_coef_fw(codec
, coef0225
);
4221 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4224 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
4228 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
4231 static struct coef_fw coef0255
[] = {
4232 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4233 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4236 static struct coef_fw coef0233
[] = {
4237 UPDATE_COEF(0x35, 0, 1<<14),
4238 WRITE_COEF(0x06, 0x2100),
4239 WRITE_COEF(0x1a, 0x0021),
4240 WRITE_COEF(0x26, 0x008c),
4243 static struct coef_fw coef0288
[] = {
4244 UPDATE_COEF(0x4f, 0x00c0, 0),
4245 UPDATE_COEF(0x50, 0x2000, 0),
4246 UPDATE_COEF(0x56, 0x0006, 0),
4247 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4248 UPDATE_COEF(0x66, 0x0008, 0x0008),
4249 UPDATE_COEF(0x67, 0x2000, 0x2000),
4252 static struct coef_fw coef0292
[] = {
4253 WRITE_COEF(0x19, 0xa208),
4254 WRITE_COEF(0x2e, 0xacf0),
4257 static struct coef_fw coef0293
[] = {
4258 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4259 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4260 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4263 static struct coef_fw coef0688
[] = {
4264 WRITE_COEF(0xb7, 0x802b),
4265 WRITE_COEF(0xb5, 0x1040),
4266 UPDATE_COEF(0xc3, 0, 1<<12),
4269 static struct coef_fw coef0225
[] = {
4270 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4271 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4272 UPDATE_COEF(0x63, 3<<14, 0),
4275 static struct coef_fw coef0274
[] = {
4276 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4277 UPDATE_COEF(0x4a, 0x0010, 0),
4278 UPDATE_COEF(0x6b, 0xf000, 0),
4282 switch (codec
->core
.vendor_id
) {
4286 alc_write_coef_idx(codec
, 0x45, 0xc489);
4287 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4288 alc_process_coef_fw(codec
, coef0255
);
4289 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4294 alc_write_coef_idx(codec
, 0x45, 0x4689);
4295 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4296 alc_process_coef_fw(codec
, coef0274
);
4297 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4301 alc_write_coef_idx(codec
, 0x45, 0xc429);
4302 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4303 alc_process_coef_fw(codec
, coef0233
);
4304 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4309 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4310 alc_process_coef_fw(codec
, coef0288
);
4311 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4314 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4315 alc_process_coef_fw(codec
, coef0292
);
4318 /* Set to TRS mode */
4319 alc_write_coef_idx(codec
, 0x45, 0xc429);
4320 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4321 alc_process_coef_fw(codec
, coef0293
);
4322 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4325 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4329 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4330 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4333 alc_write_coef_idx(codec
, 0x11, 0x0001);
4334 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4335 alc_process_coef_fw(codec
, coef0688
);
4336 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4344 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4345 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4346 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4347 alc_process_coef_fw(codec
, coef0225
);
4348 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4351 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4354 static void alc_headset_mode_default(struct hda_codec
*codec
)
4356 static struct coef_fw coef0225
[] = {
4357 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4358 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4359 UPDATE_COEF(0x49, 3<<8, 0<<8),
4360 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4361 UPDATE_COEF(0x63, 3<<14, 0),
4362 UPDATE_COEF(0x67, 0xf000, 0x3000),
4365 static struct coef_fw coef0255
[] = {
4366 WRITE_COEF(0x45, 0xc089),
4367 WRITE_COEF(0x45, 0xc489),
4368 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4369 WRITE_COEF(0x49, 0x0049),
4372 static struct coef_fw coef0233
[] = {
4373 WRITE_COEF(0x06, 0x2100),
4374 WRITE_COEF(0x32, 0x4ea3),
4377 static struct coef_fw coef0288
[] = {
4378 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4379 UPDATE_COEF(0x50, 0x2000, 0x2000),
4380 UPDATE_COEF(0x56, 0x0006, 0x0006),
4381 UPDATE_COEF(0x66, 0x0008, 0),
4382 UPDATE_COEF(0x67, 0x2000, 0),
4385 static struct coef_fw coef0292
[] = {
4386 WRITE_COEF(0x76, 0x000e),
4387 WRITE_COEF(0x6c, 0x2400),
4388 WRITE_COEF(0x6b, 0xc429),
4389 WRITE_COEF(0x18, 0x7308),
4392 static struct coef_fw coef0293
[] = {
4393 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4394 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4395 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4398 static struct coef_fw coef0688
[] = {
4399 WRITE_COEF(0x11, 0x0041),
4400 WRITE_COEF(0x15, 0x0d40),
4401 WRITE_COEF(0xb7, 0x802b),
4404 static struct coef_fw coef0274
[] = {
4405 WRITE_COEF(0x45, 0x4289),
4406 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4407 UPDATE_COEF(0x6b, 0x0f00, 0),
4408 UPDATE_COEF(0x49, 0x0300, 0x0300),
4412 switch (codec
->core
.vendor_id
) {
4419 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4420 alc_process_coef_fw(codec
, coef0225
);
4425 alc_process_coef_fw(codec
, coef0255
);
4430 alc_process_coef_fw(codec
, coef0274
);
4434 alc_process_coef_fw(codec
, coef0233
);
4439 alc_process_coef_fw(codec
, coef0288
);
4442 alc_process_coef_fw(codec
, coef0292
);
4445 alc_process_coef_fw(codec
, coef0293
);
4448 alc_process_coef_fw(codec
, coef0688
);
4451 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4454 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4458 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4462 static struct coef_fw coef0255
[] = {
4463 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4464 WRITE_COEF(0x1b, 0x0c2b),
4465 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4468 static struct coef_fw coef0256
[] = {
4469 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4470 WRITE_COEF(0x1b, 0x0c6b),
4471 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4474 static struct coef_fw coef0233
[] = {
4475 WRITE_COEF(0x45, 0xd429),
4476 WRITE_COEF(0x1b, 0x0c2b),
4477 WRITE_COEF(0x32, 0x4ea3),
4480 static struct coef_fw coef0288
[] = {
4481 UPDATE_COEF(0x50, 0x2000, 0x2000),
4482 UPDATE_COEF(0x56, 0x0006, 0x0006),
4483 UPDATE_COEF(0x66, 0x0008, 0),
4484 UPDATE_COEF(0x67, 0x2000, 0),
4487 static struct coef_fw coef0292
[] = {
4488 WRITE_COEF(0x6b, 0xd429),
4489 WRITE_COEF(0x76, 0x0008),
4490 WRITE_COEF(0x18, 0x7388),
4493 static struct coef_fw coef0293
[] = {
4494 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4495 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4498 static struct coef_fw coef0688
[] = {
4499 WRITE_COEF(0x11, 0x0001),
4500 WRITE_COEF(0x15, 0x0d60),
4501 WRITE_COEF(0xc3, 0x0000),
4504 static struct coef_fw coef0225_1
[] = {
4505 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4506 UPDATE_COEF(0x63, 3<<14, 2<<14),
4509 static struct coef_fw coef0225_2
[] = {
4510 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4511 UPDATE_COEF(0x63, 3<<14, 1<<14),
4515 switch (codec
->core
.vendor_id
) {
4517 alc_process_coef_fw(codec
, coef0255
);
4521 alc_process_coef_fw(codec
, coef0256
);
4526 alc_write_coef_idx(codec
, 0x45, 0xd689);
4530 alc_process_coef_fw(codec
, coef0233
);
4533 val
= alc_read_coef_idx(codec
, 0x50);
4534 if (val
& (1 << 12)) {
4535 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4536 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4539 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4540 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4546 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4548 alc_process_coef_fw(codec
, coef0288
);
4551 alc_process_coef_fw(codec
, coef0292
);
4554 alc_process_coef_fw(codec
, coef0293
);
4557 alc_process_coef_fw(codec
, coef0688
);
4565 val
= alc_read_coef_idx(codec
, 0x45);
4567 alc_process_coef_fw(codec
, coef0225_2
);
4569 alc_process_coef_fw(codec
, coef0225_1
);
4572 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4575 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4579 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4581 static struct coef_fw coef0255
[] = {
4582 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4583 WRITE_COEF(0x1b, 0x0c2b),
4584 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4587 static struct coef_fw coef0256
[] = {
4588 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4589 WRITE_COEF(0x1b, 0x0c6b),
4590 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4593 static struct coef_fw coef0233
[] = {
4594 WRITE_COEF(0x45, 0xe429),
4595 WRITE_COEF(0x1b, 0x0c2b),
4596 WRITE_COEF(0x32, 0x4ea3),
4599 static struct coef_fw coef0288
[] = {
4600 UPDATE_COEF(0x50, 0x2000, 0x2000),
4601 UPDATE_COEF(0x56, 0x0006, 0x0006),
4602 UPDATE_COEF(0x66, 0x0008, 0),
4603 UPDATE_COEF(0x67, 0x2000, 0),
4606 static struct coef_fw coef0292
[] = {
4607 WRITE_COEF(0x6b, 0xe429),
4608 WRITE_COEF(0x76, 0x0008),
4609 WRITE_COEF(0x18, 0x7388),
4612 static struct coef_fw coef0293
[] = {
4613 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4614 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4617 static struct coef_fw coef0688
[] = {
4618 WRITE_COEF(0x11, 0x0001),
4619 WRITE_COEF(0x15, 0x0d50),
4620 WRITE_COEF(0xc3, 0x0000),
4623 static struct coef_fw coef0225
[] = {
4624 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4625 UPDATE_COEF(0x63, 3<<14, 2<<14),
4629 switch (codec
->core
.vendor_id
) {
4631 alc_process_coef_fw(codec
, coef0255
);
4635 alc_process_coef_fw(codec
, coef0256
);
4640 alc_write_coef_idx(codec
, 0x45, 0xe689);
4644 alc_process_coef_fw(codec
, coef0233
);
4647 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4648 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4653 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4655 alc_process_coef_fw(codec
, coef0288
);
4658 alc_process_coef_fw(codec
, coef0292
);
4661 alc_process_coef_fw(codec
, coef0293
);
4664 alc_process_coef_fw(codec
, coef0688
);
4672 alc_process_coef_fw(codec
, coef0225
);
4675 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4678 static void alc_determine_headset_type(struct hda_codec
*codec
)
4681 bool is_ctia
= false;
4682 struct alc_spec
*spec
= codec
->spec
;
4683 static struct coef_fw coef0255
[] = {
4684 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4685 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4689 static struct coef_fw coef0288
[] = {
4690 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4693 static struct coef_fw coef0298
[] = {
4694 UPDATE_COEF(0x50, 0x2000, 0x2000),
4695 UPDATE_COEF(0x56, 0x0006, 0x0006),
4696 UPDATE_COEF(0x66, 0x0008, 0),
4697 UPDATE_COEF(0x67, 0x2000, 0),
4698 UPDATE_COEF(0x19, 0x1300, 0x1300),
4701 static struct coef_fw coef0293
[] = {
4702 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4703 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4706 static struct coef_fw coef0688
[] = {
4707 WRITE_COEF(0x11, 0x0001),
4708 WRITE_COEF(0xb7, 0x802b),
4709 WRITE_COEF(0x15, 0x0d60),
4710 WRITE_COEF(0xc3, 0x0c00),
4713 static struct coef_fw coef0274
[] = {
4714 UPDATE_COEF(0x4a, 0x0010, 0),
4715 UPDATE_COEF(0x4a, 0x8000, 0),
4716 WRITE_COEF(0x45, 0xd289),
4717 UPDATE_COEF(0x49, 0x0300, 0x0300),
4721 switch (codec
->core
.vendor_id
) {
4725 alc_process_coef_fw(codec
, coef0255
);
4727 val
= alc_read_coef_idx(codec
, 0x46);
4728 is_ctia
= (val
& 0x0070) == 0x0070;
4733 alc_process_coef_fw(codec
, coef0274
);
4735 val
= alc_read_coef_idx(codec
, 0x46);
4736 is_ctia
= (val
& 0x00f0) == 0x00f0;
4740 alc_write_coef_idx(codec
, 0x45, 0xd029);
4742 val
= alc_read_coef_idx(codec
, 0x46);
4743 is_ctia
= (val
& 0x0070) == 0x0070;
4746 snd_hda_codec_write(codec
, 0x21, 0,
4747 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4749 snd_hda_codec_write(codec
, 0x21, 0,
4750 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4753 val
= alc_read_coef_idx(codec
, 0x50);
4754 if (val
& (1 << 12)) {
4755 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4756 alc_process_coef_fw(codec
, coef0288
);
4758 val
= alc_read_coef_idx(codec
, 0x50);
4759 is_ctia
= (val
& 0x0070) == 0x0070;
4761 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4762 alc_process_coef_fw(codec
, coef0288
);
4764 val
= alc_read_coef_idx(codec
, 0x50);
4765 is_ctia
= (val
& 0x0070) == 0x0070;
4767 alc_process_coef_fw(codec
, coef0298
);
4768 snd_hda_codec_write(codec
, 0x21, 0,
4769 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
);
4771 snd_hda_codec_write(codec
, 0x21, 0,
4772 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4776 alc_process_coef_fw(codec
, coef0288
);
4778 val
= alc_read_coef_idx(codec
, 0x50);
4779 is_ctia
= (val
& 0x0070) == 0x0070;
4782 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4784 val
= alc_read_coef_idx(codec
, 0x6c);
4785 is_ctia
= (val
& 0x001c) == 0x001c;
4788 alc_process_coef_fw(codec
, coef0293
);
4790 val
= alc_read_coef_idx(codec
, 0x46);
4791 is_ctia
= (val
& 0x0070) == 0x0070;
4794 alc_process_coef_fw(codec
, coef0688
);
4796 val
= alc_read_coef_idx(codec
, 0xbe);
4797 is_ctia
= (val
& 0x1c02) == 0x1c02;
4805 snd_hda_codec_write(codec
, 0x21, 0,
4806 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4808 snd_hda_codec_write(codec
, 0x21, 0,
4809 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4811 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4812 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x1000);
4813 val
= alc_read_coef_idx(codec
, 0x45);
4814 if (val
& (1 << 9)) {
4815 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4816 alc_update_coef_idx(codec
, 0x49, 3<<8, 2<<8);
4818 val
= alc_read_coef_idx(codec
, 0x46);
4819 is_ctia
= (val
& 0x00f0) == 0x00f0;
4821 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4822 alc_update_coef_idx(codec
, 0x49, 3<<8, 1<<8);
4824 val
= alc_read_coef_idx(codec
, 0x46);
4825 is_ctia
= (val
& 0x00f0) == 0x00f0;
4827 alc_update_coef_idx(codec
, 0x4a, 7<<6, 7<<6);
4828 alc_update_coef_idx(codec
, 0x4a, 3<<4, 3<<4);
4829 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
4831 snd_hda_codec_write(codec
, 0x21, 0,
4832 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
4834 snd_hda_codec_write(codec
, 0x21, 0,
4835 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4842 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4843 is_ctia
? "yes" : "no");
4844 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4847 static void alc_update_headset_mode(struct hda_codec
*codec
)
4849 struct alc_spec
*spec
= codec
->spec
;
4851 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4852 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4854 int new_headset_mode
;
4856 if (!snd_hda_jack_detect(codec
, hp_pin
))
4857 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4858 else if (mux_pin
== spec
->headset_mic_pin
)
4859 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4860 else if (mux_pin
== spec
->headphone_mic_pin
)
4861 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4863 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4865 if (new_headset_mode
== spec
->current_headset_mode
) {
4866 snd_hda_gen_update_outputs(codec
);
4870 switch (new_headset_mode
) {
4871 case ALC_HEADSET_MODE_UNPLUGGED
:
4872 alc_headset_mode_unplugged(codec
);
4873 spec
->gen
.hp_jack_present
= false;
4875 case ALC_HEADSET_MODE_HEADSET
:
4876 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4877 alc_determine_headset_type(codec
);
4878 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4879 alc_headset_mode_ctia(codec
);
4880 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4881 alc_headset_mode_omtp(codec
);
4882 spec
->gen
.hp_jack_present
= true;
4884 case ALC_HEADSET_MODE_MIC
:
4885 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4886 spec
->gen
.hp_jack_present
= false;
4888 case ALC_HEADSET_MODE_HEADPHONE
:
4889 alc_headset_mode_default(codec
);
4890 spec
->gen
.hp_jack_present
= true;
4893 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
4894 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
4895 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
4896 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
4897 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
4900 spec
->current_headset_mode
= new_headset_mode
;
4902 snd_hda_gen_update_outputs(codec
);
4905 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
4906 struct snd_kcontrol
*kcontrol
,
4907 struct snd_ctl_elem_value
*ucontrol
)
4909 alc_update_headset_mode(codec
);
4912 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
4913 struct hda_jack_callback
*jack
)
4915 struct alc_spec
*spec
= codec
->spec
;
4916 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
4917 snd_hda_gen_hp_automute(codec
, jack
);
4920 static void alc_probe_headset_mode(struct hda_codec
*codec
)
4923 struct alc_spec
*spec
= codec
->spec
;
4924 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4927 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4928 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
4929 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
4930 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
4931 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
4934 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
4935 spec
->gen
.automute_hook
= alc_update_headset_mode
;
4936 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
4939 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
4940 const struct hda_fixup
*fix
, int action
)
4942 struct alc_spec
*spec
= codec
->spec
;
4945 case HDA_FIXUP_ACT_PRE_PROBE
:
4946 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
4948 case HDA_FIXUP_ACT_PROBE
:
4949 alc_probe_headset_mode(codec
);
4951 case HDA_FIXUP_ACT_INIT
:
4952 spec
->current_headset_mode
= 0;
4953 alc_update_headset_mode(codec
);
4958 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
4959 const struct hda_fixup
*fix
, int action
)
4961 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4962 struct alc_spec
*spec
= codec
->spec
;
4963 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4966 alc_fixup_headset_mode(codec
, fix
, action
);
4969 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
4971 /* Set to iphone type */
4972 static struct coef_fw alc255fw
[] = {
4973 WRITE_COEF(0x1b, 0x880b),
4974 WRITE_COEF(0x45, 0xd089),
4975 WRITE_COEF(0x1b, 0x080b),
4976 WRITE_COEF(0x46, 0x0004),
4977 WRITE_COEF(0x1b, 0x0c0b),
4980 static struct coef_fw alc256fw
[] = {
4981 WRITE_COEF(0x1b, 0x884b),
4982 WRITE_COEF(0x45, 0xd089),
4983 WRITE_COEF(0x1b, 0x084b),
4984 WRITE_COEF(0x46, 0x0004),
4985 WRITE_COEF(0x1b, 0x0c4b),
4988 switch (codec
->core
.vendor_id
) {
4990 alc_process_coef_fw(codec
, alc255fw
);
4994 alc_process_coef_fw(codec
, alc256fw
);
5000 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
5001 const struct hda_fixup
*fix
, int action
)
5003 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5004 alc255_set_default_jack_type(codec
);
5006 alc_fixup_headset_mode(codec
, fix
, action
);
5009 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
5010 const struct hda_fixup
*fix
, int action
)
5012 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5013 struct alc_spec
*spec
= codec
->spec
;
5014 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5015 alc255_set_default_jack_type(codec
);
5018 alc_fixup_headset_mode(codec
, fix
, action
);
5021 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
5022 struct hda_jack_callback
*jack
)
5024 struct alc_spec
*spec
= codec
->spec
;
5027 alc_update_headset_jack_cb(codec
, jack
);
5028 /* Headset Mic enable or disable, only for Dell Dino */
5029 present
= spec
->gen
.hp_jack_present
? 0x40 : 0;
5030 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
5034 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
5035 const struct hda_fixup
*fix
, int action
)
5037 alc_fixup_headset_mode(codec
, fix
, action
);
5038 if (action
== HDA_FIXUP_ACT_PROBE
) {
5039 struct alc_spec
*spec
= codec
->spec
;
5040 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
5044 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
5045 const struct hda_fixup
*fix
, int action
)
5047 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5048 struct alc_spec
*spec
= codec
->spec
;
5049 spec
->gen
.auto_mute_via_amp
= 1;
5053 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
5054 const struct hda_fixup
*fix
, int action
)
5056 if (action
== HDA_FIXUP_ACT_PROBE
) {
5057 struct alc_spec
*spec
= codec
->spec
;
5058 spec
->no_shutup_pins
= 1;
5062 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
5063 const struct hda_fixup
*fix
, int action
)
5065 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5066 struct alc_spec
*spec
= codec
->spec
;
5067 /* Disable AA-loopback as it causes white noise */
5068 spec
->gen
.mixer_nid
= 0;
5072 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5073 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
5074 const struct hda_fixup
*fix
, int action
)
5076 static const struct hda_pintbl pincfgs
[] = {
5077 { 0x16, 0x21211010 }, /* dock headphone */
5078 { 0x19, 0x21a11010 }, /* dock mic */
5081 struct alc_spec
*spec
= codec
->spec
;
5083 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5084 spec
->reboot_notify
= alc_d3_at_reboot
; /* reduce noise */
5085 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5086 codec
->power_save_node
= 0; /* avoid click noises */
5087 snd_hda_apply_pincfgs(codec
, pincfgs
);
5091 static void alc_fixup_tpt470_dock(struct hda_codec
*codec
,
5092 const struct hda_fixup
*fix
, int action
)
5094 static const struct hda_pintbl pincfgs
[] = {
5095 { 0x17, 0x21211010 }, /* dock headphone */
5096 { 0x19, 0x21a11010 }, /* dock mic */
5099 struct alc_spec
*spec
= codec
->spec
;
5101 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5102 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5103 snd_hda_apply_pincfgs(codec
, pincfgs
);
5104 } else if (action
== HDA_FIXUP_ACT_INIT
) {
5105 /* Enable DOCK device */
5106 snd_hda_codec_write(codec
, 0x17, 0,
5107 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5108 /* Enable DOCK device */
5109 snd_hda_codec_write(codec
, 0x19, 0,
5110 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5114 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
5116 struct alc_spec
*spec
= codec
->spec
;
5117 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
5119 /* Prevent pop noises when headphones are plugged in */
5120 snd_hda_codec_write(codec
, hp_pin
, 0,
5121 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5125 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
5126 const struct hda_fixup
*fix
, int action
)
5128 struct alc_spec
*spec
= codec
->spec
;
5129 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
5133 case HDA_FIXUP_ACT_PRE_PROBE
:
5134 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5135 * it causes a click noise at start up
5137 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5139 case HDA_FIXUP_ACT_PROBE
:
5140 spec
->shutup
= alc_shutup_dell_xps13
;
5142 /* Make the internal mic the default input source. */
5143 for (i
= 0; i
< imux
->num_items
; i
++) {
5144 if (spec
->gen
.imux_pins
[i
] == 0x12) {
5145 spec
->gen
.cur_mux
[0] = i
;
5153 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
5154 const struct hda_fixup
*fix
, int action
)
5156 struct alc_spec
*spec
= codec
->spec
;
5158 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5159 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5160 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
5162 /* Disable boost for mic-in permanently. (This code is only called
5163 from quirks that guarantee that the headphone is at NID 0x1b.) */
5164 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
5165 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
5167 alc_fixup_headset_mode(codec
, fix
, action
);
5170 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
5171 const struct hda_fixup
*fix
, int action
)
5173 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5174 alc_write_coef_idx(codec
, 0xc4, 0x8000);
5175 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
5176 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
5178 alc_fixup_headset_mode(codec
, fix
, action
);
5181 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5182 static int find_ext_mic_pin(struct hda_codec
*codec
)
5184 struct alc_spec
*spec
= codec
->spec
;
5185 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5187 unsigned int defcfg
;
5190 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5191 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5193 nid
= cfg
->inputs
[i
].pin
;
5194 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5195 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
5203 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
5204 const struct hda_fixup
*fix
,
5207 struct alc_spec
*spec
= codec
->spec
;
5209 if (action
== HDA_FIXUP_ACT_PROBE
) {
5210 int mic_pin
= find_ext_mic_pin(codec
);
5211 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
5213 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
5215 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
5219 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
5220 const struct hda_fixup
*fix
,
5223 struct alc_spec
*spec
= codec
->spec
;
5224 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5227 /* The mic boosts on level 2 and 3 are too noisy
5228 on the internal mic input.
5229 Therefore limit the boost to 0 or 1. */
5231 if (action
!= HDA_FIXUP_ACT_PROBE
)
5234 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5235 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5236 unsigned int defcfg
;
5237 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5239 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5240 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
5243 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
5244 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
5245 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5246 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5247 (0 << AC_AMPCAP_MUTE_SHIFT
));
5251 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
5252 struct hda_jack_callback
*jack
)
5254 struct alc_spec
*spec
= codec
->spec
;
5258 snd_hda_gen_hp_automute(codec
, jack
);
5260 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
5263 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5267 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
5268 const struct hda_fixup
*fix
, int action
)
5270 struct alc_spec
*spec
= codec
->spec
;
5273 case HDA_FIXUP_ACT_PRE_PROBE
:
5274 snd_hda_override_wcaps(codec
, 0x03, 0);
5275 /* Disable AA-loopback as it causes white noise */
5276 spec
->gen
.mixer_nid
= 0;
5278 case HDA_FIXUP_ACT_INIT
:
5279 /* MIC2-VREF control */
5280 /* Set to manual mode */
5281 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5282 /* Enable Line1 input control by verb */
5283 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
5288 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
5289 const struct hda_fixup
*fix
, int action
)
5291 struct alc_spec
*spec
= codec
->spec
;
5294 case HDA_FIXUP_ACT_PRE_PROBE
:
5295 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
5297 case HDA_FIXUP_ACT_INIT
:
5298 /* MIC2-VREF control */
5299 /* Set to manual mode */
5300 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5305 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5306 static void asus_tx300_automute(struct hda_codec
*codec
)
5308 struct alc_spec
*spec
= codec
->spec
;
5309 snd_hda_gen_update_outputs(codec
);
5310 if (snd_hda_jack_detect(codec
, 0x1b))
5311 spec
->gen
.mute_bits
|= (1ULL << 0x14);
5314 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
5315 const struct hda_fixup
*fix
, int action
)
5317 struct alc_spec
*spec
= codec
->spec
;
5318 /* TX300 needs to set up GPIO2 for the speaker amp */
5319 static const struct hda_verb gpio2_verbs
[] = {
5320 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
5321 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
5322 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
5325 static const struct hda_pintbl dock_pins
[] = {
5326 { 0x1b, 0x21114000 }, /* dock speaker pin */
5331 case HDA_FIXUP_ACT_PRE_PROBE
:
5332 snd_hda_add_verbs(codec
, gpio2_verbs
);
5333 snd_hda_apply_pincfgs(codec
, dock_pins
);
5334 spec
->gen
.auto_mute_via_amp
= 1;
5335 spec
->gen
.automute_hook
= asus_tx300_automute
;
5336 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
5337 snd_hda_gen_hp_automute
);
5339 case HDA_FIXUP_ACT_BUILD
:
5340 /* this is a bit tricky; give more sane names for the main
5341 * (tablet) speaker and the dock speaker, respectively
5343 rename_ctl(codec
, "Speaker Playback Switch",
5344 "Dock Speaker Playback Switch");
5345 rename_ctl(codec
, "Bass Speaker Playback Switch",
5346 "Speaker Playback Switch");
5351 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
5352 const struct hda_fixup
*fix
, int action
)
5354 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5355 /* DAC node 0x03 is giving mono output. We therefore want to
5356 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5357 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5358 hda_nid_t conn1
[2] = { 0x0c };
5359 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
5360 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
5364 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
5365 const struct hda_fixup
*fix
, int action
)
5367 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5368 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5369 we can't adjust the speaker's volume since this node does not has
5370 Amp-out capability. we change the speaker's route to:
5371 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5372 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5373 speaker's volume now. */
5375 hda_nid_t conn1
[1] = { 0x0c };
5376 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
5380 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5381 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
5382 const struct hda_fixup
*fix
, int action
)
5384 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5385 hda_nid_t conn
[2] = { 0x02, 0x03 };
5386 snd_hda_override_conn_list(codec
, 0x17, 2, conn
);
5390 /* Hook to update amp GPIO4 for automute */
5391 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
5392 struct hda_jack_callback
*jack
)
5394 struct alc_spec
*spec
= codec
->spec
;
5396 snd_hda_gen_hp_automute(codec
, jack
);
5397 /* mute_led_polarity is set to 0, so we pass inverted value here */
5398 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
5401 /* Manage GPIOs for HP EliteBook Folio 9480m.
5403 * GPIO4 is the headphone amplifier power control
5404 * GPIO3 is the audio output mute indicator LED
5407 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5408 const struct hda_fixup
*fix
,
5411 struct alc_spec
*spec
= codec
->spec
;
5412 static const struct hda_verb gpio_init
[] = {
5413 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
5414 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
5418 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5419 /* Set the hooks to turn the headphone amp on/off
5422 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
5423 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5425 /* The GPIOs are currently off */
5428 /* GPIO3 is connected to the output mute LED,
5429 * high is on, low is off
5431 spec
->mute_led_polarity
= 0;
5432 spec
->gpio_mute_led_mask
= 0x08;
5434 /* Initialize GPIO configuration */
5435 snd_hda_add_verbs(codec
, gpio_init
);
5439 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5440 const struct hda_fixup
*fix
,
5443 alc_fixup_dual_codecs(codec
, fix
, action
);
5445 case HDA_FIXUP_ACT_PRE_PROBE
:
5446 /* override card longname to provide a unique UCM profile */
5447 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5449 case HDA_FIXUP_ACT_BUILD
:
5450 /* rename Capture controls depending on the codec */
5451 rename_ctl(codec
, "Capture Volume",
5453 "Rear-Panel Capture Volume" :
5454 "Front-Panel Capture Volume");
5455 rename_ctl(codec
, "Capture Switch",
5457 "Rear-Panel Capture Switch" :
5458 "Front-Panel Capture Switch");
5463 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5464 static void alc274_fixup_bind_dacs(struct hda_codec
*codec
,
5465 const struct hda_fixup
*fix
, int action
)
5467 struct alc_spec
*spec
= codec
->spec
;
5468 static hda_nid_t preferred_pairs
[] = {
5469 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5473 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5476 spec
->gen
.preferred_dacs
= preferred_pairs
;
5477 spec
->gen
.auto_mute_via_amp
= 1;
5478 codec
->power_save_node
= 0;
5481 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5482 static void alc285_fixup_invalidate_dacs(struct hda_codec
*codec
,
5483 const struct hda_fixup
*fix
, int action
)
5485 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5488 snd_hda_override_wcaps(codec
, 0x03, 0);
5491 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
5492 const struct hda_fixup
*fix
, int action
)
5494 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5495 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5498 /* for hda_fixup_thinkpad_acpi() */
5499 #include "thinkpad_helper.c"
5501 static void alc_fixup_thinkpad_acpi(struct hda_codec
*codec
,
5502 const struct hda_fixup
*fix
, int action
)
5504 alc_fixup_no_shutup(codec
, fix
, action
); /* reduce click noise */
5505 hda_fixup_thinkpad_acpi(codec
, fix
, action
);
5508 /* for dell wmi mic mute led */
5509 #include "dell_wmi_helper.c"
5512 ALC269_FIXUP_SONY_VAIO
,
5513 ALC275_FIXUP_SONY_VAIO_GPIO2
,
5514 ALC269_FIXUP_DELL_M101Z
,
5515 ALC269_FIXUP_SKU_IGNORE
,
5516 ALC269_FIXUP_ASUS_G73JW
,
5517 ALC269_FIXUP_LENOVO_EAPD
,
5518 ALC275_FIXUP_SONY_HWEQ
,
5519 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
5521 ALC269_FIXUP_PCM_44K
,
5522 ALC269_FIXUP_STEREO_DMIC
,
5523 ALC269_FIXUP_HEADSET_MIC
,
5524 ALC269_FIXUP_QUANTA_MUTE
,
5525 ALC269_FIXUP_LIFEBOOK
,
5526 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
5527 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
5528 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
5529 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
5532 ALC269VB_FIXUP_AMIC
,
5533 ALC269VB_FIXUP_DMIC
,
5534 ALC269_FIXUP_HP_MUTE_LED
,
5535 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5536 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
5537 ALC269_FIXUP_HP_GPIO_LED
,
5538 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
5539 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
5540 ALC269_FIXUP_INV_DMIC
,
5541 ALC269_FIXUP_LENOVO_DOCK
,
5542 ALC269_FIXUP_NO_SHUTUP
,
5543 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
5544 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
5545 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5546 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
5547 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5548 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
5549 ALC269_FIXUP_HEADSET_MODE
,
5550 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5551 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
5552 ALC269_FIXUP_ASUS_X101_FUNC
,
5553 ALC269_FIXUP_ASUS_X101_VERB
,
5554 ALC269_FIXUP_ASUS_X101
,
5555 ALC271_FIXUP_AMIC_MIC2
,
5556 ALC271_FIXUP_HP_GATE_MIC_JACK
,
5557 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
5558 ALC269_FIXUP_ACER_AC700
,
5559 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
5560 ALC269VB_FIXUP_ASUS_ZENBOOK
,
5561 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
5562 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
5563 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
5564 ALC283_FIXUP_CHROME_BOOK
,
5565 ALC283_FIXUP_SENSE_COMBO_JACK
,
5566 ALC282_FIXUP_ASUS_TX300
,
5567 ALC283_FIXUP_INT_MIC
,
5568 ALC290_FIXUP_MONO_SPEAKERS
,
5569 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5570 ALC290_FIXUP_SUBWOOFER
,
5571 ALC290_FIXUP_SUBWOOFER_HSJACK
,
5572 ALC269_FIXUP_THINKPAD_ACPI
,
5573 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
5574 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
5575 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
5576 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5577 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5578 ALC255_FIXUP_HEADSET_MODE
,
5579 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5580 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5581 ALC292_FIXUP_TPT440_DOCK
,
5582 ALC292_FIXUP_TPT440
,
5583 ALC283_FIXUP_HEADSET_MIC
,
5584 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
,
5585 ALC282_FIXUP_ASPIRE_V5_PINS
,
5586 ALC280_FIXUP_HP_GPIO4
,
5587 ALC286_FIXUP_HP_GPIO_LED
,
5588 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
5589 ALC280_FIXUP_HP_DOCK_PINS
,
5590 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
5591 ALC280_FIXUP_HP_9480M
,
5592 ALC288_FIXUP_DELL_HEADSET_MODE
,
5593 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
5594 ALC288_FIXUP_DELL_XPS_13_GPIO6
,
5595 ALC288_FIXUP_DELL_XPS_13
,
5596 ALC288_FIXUP_DISABLE_AAMIX
,
5597 ALC292_FIXUP_DELL_E7X
,
5598 ALC292_FIXUP_DISABLE_AAMIX
,
5599 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
5600 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
5601 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5602 ALC275_FIXUP_DELL_XPS
,
5603 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
5604 ALC293_FIXUP_LENOVO_SPK_NOISE
,
5605 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
5606 ALC255_FIXUP_DELL_SPK_NOISE
,
5607 ALC225_FIXUP_DISABLE_MIC_VREF
,
5608 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5609 ALC295_FIXUP_DISABLE_DAC3
,
5610 ALC280_FIXUP_HP_HEADSET_MIC
,
5611 ALC221_FIXUP_HP_FRONT_MIC
,
5612 ALC292_FIXUP_TPT460
,
5613 ALC298_FIXUP_SPK_VOLUME
,
5614 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
5615 ALC269_FIXUP_ATIV_BOOK_8
,
5616 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
5617 ALC256_FIXUP_ASUS_HEADSET_MODE
,
5618 ALC256_FIXUP_ASUS_MIC
,
5619 ALC256_FIXUP_ASUS_AIO_GPIO2
,
5620 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
5621 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
5622 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
5623 ALC294_FIXUP_LENOVO_MIC_LOCATION
,
5624 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
,
5625 ALC700_FIXUP_INTEL_REFERENCE
,
5626 ALC274_FIXUP_DELL_BIND_DACS
,
5627 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
5628 ALC298_FIXUP_TPT470_DOCK
,
5629 ALC255_FIXUP_DUMMY_LINEOUT_VERB
,
5630 ALC255_FIXUP_DELL_HEADSET_MIC
,
5631 ALC221_FIXUP_HP_HEADSET_MIC
,
5632 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
,
5633 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
5634 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
,
5635 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
,
5636 ALC225_FIXUP_WYSE_AUTO_MUTE
,
5637 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
,
5640 static const struct hda_fixup alc269_fixups
[] = {
5641 [ALC269_FIXUP_SONY_VAIO
] = {
5642 .type
= HDA_FIXUP_PINCTLS
,
5643 .v
.pins
= (const struct hda_pintbl
[]) {
5644 {0x19, PIN_VREFGRD
},
5648 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
5649 .type
= HDA_FIXUP_VERBS
,
5650 .v
.verbs
= (const struct hda_verb
[]) {
5651 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
5652 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
5653 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5657 .chain_id
= ALC269_FIXUP_SONY_VAIO
5659 [ALC269_FIXUP_DELL_M101Z
] = {
5660 .type
= HDA_FIXUP_VERBS
,
5661 .v
.verbs
= (const struct hda_verb
[]) {
5662 /* Enables internal speaker */
5663 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
5664 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
5668 [ALC269_FIXUP_SKU_IGNORE
] = {
5669 .type
= HDA_FIXUP_FUNC
,
5670 .v
.func
= alc_fixup_sku_ignore
,
5672 [ALC269_FIXUP_ASUS_G73JW
] = {
5673 .type
= HDA_FIXUP_PINS
,
5674 .v
.pins
= (const struct hda_pintbl
[]) {
5675 { 0x17, 0x99130111 }, /* subwoofer */
5679 [ALC269_FIXUP_LENOVO_EAPD
] = {
5680 .type
= HDA_FIXUP_VERBS
,
5681 .v
.verbs
= (const struct hda_verb
[]) {
5682 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5686 [ALC275_FIXUP_SONY_HWEQ
] = {
5687 .type
= HDA_FIXUP_FUNC
,
5688 .v
.func
= alc269_fixup_hweq
,
5690 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
5692 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
5693 .type
= HDA_FIXUP_FUNC
,
5694 .v
.func
= alc_fixup_disable_aamix
,
5696 .chain_id
= ALC269_FIXUP_SONY_VAIO
5698 [ALC271_FIXUP_DMIC
] = {
5699 .type
= HDA_FIXUP_FUNC
,
5700 .v
.func
= alc271_fixup_dmic
,
5702 [ALC269_FIXUP_PCM_44K
] = {
5703 .type
= HDA_FIXUP_FUNC
,
5704 .v
.func
= alc269_fixup_pcm_44k
,
5706 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5708 [ALC269_FIXUP_STEREO_DMIC
] = {
5709 .type
= HDA_FIXUP_FUNC
,
5710 .v
.func
= alc269_fixup_stereo_dmic
,
5712 [ALC269_FIXUP_HEADSET_MIC
] = {
5713 .type
= HDA_FIXUP_FUNC
,
5714 .v
.func
= alc269_fixup_headset_mic
,
5716 [ALC269_FIXUP_QUANTA_MUTE
] = {
5717 .type
= HDA_FIXUP_FUNC
,
5718 .v
.func
= alc269_fixup_quanta_mute
,
5720 [ALC269_FIXUP_LIFEBOOK
] = {
5721 .type
= HDA_FIXUP_PINS
,
5722 .v
.pins
= (const struct hda_pintbl
[]) {
5723 { 0x1a, 0x2101103f }, /* dock line-out */
5724 { 0x1b, 0x23a11040 }, /* dock mic-in */
5728 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5730 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5731 .type
= HDA_FIXUP_PINS
,
5732 .v
.pins
= (const struct hda_pintbl
[]) {
5733 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5737 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5738 .type
= HDA_FIXUP_PINS
,
5739 .v
.pins
= (const struct hda_pintbl
[]) {
5740 { 0x21, 0x0221102f }, /* HP out */
5744 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5745 .type
= HDA_FIXUP_FUNC
,
5746 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5748 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
5749 .type
= HDA_FIXUP_FUNC
,
5750 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
5752 [ALC269_FIXUP_AMIC
] = {
5753 .type
= HDA_FIXUP_PINS
,
5754 .v
.pins
= (const struct hda_pintbl
[]) {
5755 { 0x14, 0x99130110 }, /* speaker */
5756 { 0x15, 0x0121401f }, /* HP out */
5757 { 0x18, 0x01a19c20 }, /* mic */
5758 { 0x19, 0x99a3092f }, /* int-mic */
5762 [ALC269_FIXUP_DMIC
] = {
5763 .type
= HDA_FIXUP_PINS
,
5764 .v
.pins
= (const struct hda_pintbl
[]) {
5765 { 0x12, 0x99a3092f }, /* int-mic */
5766 { 0x14, 0x99130110 }, /* speaker */
5767 { 0x15, 0x0121401f }, /* HP out */
5768 { 0x18, 0x01a19c20 }, /* mic */
5772 [ALC269VB_FIXUP_AMIC
] = {
5773 .type
= HDA_FIXUP_PINS
,
5774 .v
.pins
= (const struct hda_pintbl
[]) {
5775 { 0x14, 0x99130110 }, /* speaker */
5776 { 0x18, 0x01a19c20 }, /* mic */
5777 { 0x19, 0x99a3092f }, /* int-mic */
5778 { 0x21, 0x0121401f }, /* HP out */
5782 [ALC269VB_FIXUP_DMIC
] = {
5783 .type
= HDA_FIXUP_PINS
,
5784 .v
.pins
= (const struct hda_pintbl
[]) {
5785 { 0x12, 0x99a3092f }, /* int-mic */
5786 { 0x14, 0x99130110 }, /* speaker */
5787 { 0x18, 0x01a19c20 }, /* mic */
5788 { 0x21, 0x0121401f }, /* HP out */
5792 [ALC269_FIXUP_HP_MUTE_LED
] = {
5793 .type
= HDA_FIXUP_FUNC
,
5794 .v
.func
= alc269_fixup_hp_mute_led
,
5796 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5797 .type
= HDA_FIXUP_FUNC
,
5798 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5800 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5801 .type
= HDA_FIXUP_FUNC
,
5802 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5804 [ALC269_FIXUP_HP_GPIO_LED
] = {
5805 .type
= HDA_FIXUP_FUNC
,
5806 .v
.func
= alc269_fixup_hp_gpio_led
,
5808 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5809 .type
= HDA_FIXUP_FUNC
,
5810 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5812 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5813 .type
= HDA_FIXUP_FUNC
,
5814 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5816 [ALC269_FIXUP_INV_DMIC
] = {
5817 .type
= HDA_FIXUP_FUNC
,
5818 .v
.func
= alc_fixup_inv_dmic
,
5820 [ALC269_FIXUP_NO_SHUTUP
] = {
5821 .type
= HDA_FIXUP_FUNC
,
5822 .v
.func
= alc_fixup_no_shutup
,
5824 [ALC269_FIXUP_LENOVO_DOCK
] = {
5825 .type
= HDA_FIXUP_PINS
,
5826 .v
.pins
= (const struct hda_pintbl
[]) {
5827 { 0x19, 0x23a11040 }, /* dock mic */
5828 { 0x1b, 0x2121103f }, /* dock headphone */
5832 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5834 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5835 .type
= HDA_FIXUP_FUNC
,
5836 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5838 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5840 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5841 .type
= HDA_FIXUP_PINS
,
5842 .v
.pins
= (const struct hda_pintbl
[]) {
5843 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5844 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5848 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5850 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5851 .type
= HDA_FIXUP_PINS
,
5852 .v
.pins
= (const struct hda_pintbl
[]) {
5853 { 0x16, 0x21014020 }, /* dock line out */
5854 { 0x19, 0x21a19030 }, /* dock mic */
5855 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5859 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5861 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5862 .type
= HDA_FIXUP_PINS
,
5863 .v
.pins
= (const struct hda_pintbl
[]) {
5864 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5868 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5870 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
5871 .type
= HDA_FIXUP_PINS
,
5872 .v
.pins
= (const struct hda_pintbl
[]) {
5873 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5874 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5878 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5880 [ALC269_FIXUP_HEADSET_MODE
] = {
5881 .type
= HDA_FIXUP_FUNC
,
5882 .v
.func
= alc_fixup_headset_mode
,
5884 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5886 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5887 .type
= HDA_FIXUP_FUNC
,
5888 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
5890 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
5891 .type
= HDA_FIXUP_PINS
,
5892 .v
.pins
= (const struct hda_pintbl
[]) {
5893 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5897 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
5899 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
5900 .type
= HDA_FIXUP_PINS
,
5901 .v
.pins
= (const struct hda_pintbl
[]) {
5902 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5906 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5908 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
5909 .type
= HDA_FIXUP_FUNC
,
5910 .v
.func
= alc269_fixup_x101_headset_mic
,
5912 [ALC269_FIXUP_ASUS_X101_VERB
] = {
5913 .type
= HDA_FIXUP_VERBS
,
5914 .v
.verbs
= (const struct hda_verb
[]) {
5915 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5916 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
5917 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
5921 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
5923 [ALC269_FIXUP_ASUS_X101
] = {
5924 .type
= HDA_FIXUP_PINS
,
5925 .v
.pins
= (const struct hda_pintbl
[]) {
5926 { 0x18, 0x04a1182c }, /* Headset mic */
5930 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
5932 [ALC271_FIXUP_AMIC_MIC2
] = {
5933 .type
= HDA_FIXUP_PINS
,
5934 .v
.pins
= (const struct hda_pintbl
[]) {
5935 { 0x14, 0x99130110 }, /* speaker */
5936 { 0x19, 0x01a19c20 }, /* mic */
5937 { 0x1b, 0x99a7012f }, /* int-mic */
5938 { 0x21, 0x0121401f }, /* HP out */
5942 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
5943 .type
= HDA_FIXUP_FUNC
,
5944 .v
.func
= alc271_hp_gate_mic_jack
,
5946 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
5948 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
5949 .type
= HDA_FIXUP_FUNC
,
5950 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5952 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
5954 [ALC269_FIXUP_ACER_AC700
] = {
5955 .type
= HDA_FIXUP_PINS
,
5956 .v
.pins
= (const struct hda_pintbl
[]) {
5957 { 0x12, 0x99a3092f }, /* int-mic */
5958 { 0x14, 0x99130110 }, /* speaker */
5959 { 0x18, 0x03a11c20 }, /* mic */
5960 { 0x1e, 0x0346101e }, /* SPDIF1 */
5961 { 0x21, 0x0321101f }, /* HP out */
5965 .chain_id
= ALC271_FIXUP_DMIC
,
5967 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
5968 .type
= HDA_FIXUP_FUNC
,
5969 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5971 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5973 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
5974 .type
= HDA_FIXUP_FUNC
,
5975 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5977 .chain_id
= ALC269VB_FIXUP_DMIC
,
5979 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
5980 .type
= HDA_FIXUP_VERBS
,
5981 .v
.verbs
= (const struct hda_verb
[]) {
5982 /* class-D output amp +5dB */
5983 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
5984 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
5988 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
5990 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
5991 .type
= HDA_FIXUP_FUNC
,
5992 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5994 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5996 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
5997 .type
= HDA_FIXUP_PINS
,
5998 .v
.pins
= (const struct hda_pintbl
[]) {
5999 { 0x12, 0x99a3092f }, /* int-mic */
6000 { 0x18, 0x03a11d20 }, /* mic */
6001 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6005 [ALC283_FIXUP_CHROME_BOOK
] = {
6006 .type
= HDA_FIXUP_FUNC
,
6007 .v
.func
= alc283_fixup_chromebook
,
6009 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
6010 .type
= HDA_FIXUP_FUNC
,
6011 .v
.func
= alc283_fixup_sense_combo_jack
,
6013 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
6015 [ALC282_FIXUP_ASUS_TX300
] = {
6016 .type
= HDA_FIXUP_FUNC
,
6017 .v
.func
= alc282_fixup_asus_tx300
,
6019 [ALC283_FIXUP_INT_MIC
] = {
6020 .type
= HDA_FIXUP_VERBS
,
6021 .v
.verbs
= (const struct hda_verb
[]) {
6022 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
6023 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
6027 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6029 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
6030 .type
= HDA_FIXUP_PINS
,
6031 .v
.pins
= (const struct hda_pintbl
[]) {
6032 { 0x17, 0x90170112 }, /* subwoofer */
6036 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6038 [ALC290_FIXUP_SUBWOOFER
] = {
6039 .type
= HDA_FIXUP_PINS
,
6040 .v
.pins
= (const struct hda_pintbl
[]) {
6041 { 0x17, 0x90170112 }, /* subwoofer */
6045 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
6047 [ALC290_FIXUP_MONO_SPEAKERS
] = {
6048 .type
= HDA_FIXUP_FUNC
,
6049 .v
.func
= alc290_fixup_mono_speakers
,
6051 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
6052 .type
= HDA_FIXUP_FUNC
,
6053 .v
.func
= alc290_fixup_mono_speakers
,
6055 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6057 [ALC269_FIXUP_THINKPAD_ACPI
] = {
6058 .type
= HDA_FIXUP_FUNC
,
6059 .v
.func
= alc_fixup_thinkpad_acpi
,
6061 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
6063 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
6064 .type
= HDA_FIXUP_FUNC
,
6065 .v
.func
= alc_fixup_inv_dmic
,
6067 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6069 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
6070 .type
= HDA_FIXUP_PINS
,
6071 .v
.pins
= (const struct hda_pintbl
[]) {
6072 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6076 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6078 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6079 .type
= HDA_FIXUP_PINS
,
6080 .v
.pins
= (const struct hda_pintbl
[]) {
6081 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6085 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6087 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6088 .type
= HDA_FIXUP_PINS
,
6089 .v
.pins
= (const struct hda_pintbl
[]) {
6090 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6091 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6095 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6097 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6098 .type
= HDA_FIXUP_PINS
,
6099 .v
.pins
= (const struct hda_pintbl
[]) {
6100 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6104 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6106 [ALC255_FIXUP_HEADSET_MODE
] = {
6107 .type
= HDA_FIXUP_FUNC
,
6108 .v
.func
= alc_fixup_headset_mode_alc255
,
6110 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6112 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6113 .type
= HDA_FIXUP_FUNC
,
6114 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
6116 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6117 .type
= HDA_FIXUP_PINS
,
6118 .v
.pins
= (const struct hda_pintbl
[]) {
6119 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6120 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6124 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6126 [ALC292_FIXUP_TPT440_DOCK
] = {
6127 .type
= HDA_FIXUP_FUNC
,
6128 .v
.func
= alc_fixup_tpt440_dock
,
6130 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6132 [ALC292_FIXUP_TPT440
] = {
6133 .type
= HDA_FIXUP_FUNC
,
6134 .v
.func
= alc_fixup_disable_aamix
,
6136 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
6138 [ALC283_FIXUP_HEADSET_MIC
] = {
6139 .type
= HDA_FIXUP_PINS
,
6140 .v
.pins
= (const struct hda_pintbl
[]) {
6141 { 0x19, 0x04a110f0 },
6145 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
] = {
6146 .type
= HDA_FIXUP_FUNC
,
6147 .v
.func
= alc_fixup_dell_wmi
,
6149 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
6150 .type
= HDA_FIXUP_PINS
,
6151 .v
.pins
= (const struct hda_pintbl
[]) {
6152 { 0x12, 0x90a60130 },
6153 { 0x14, 0x90170110 },
6154 { 0x17, 0x40000008 },
6155 { 0x18, 0x411111f0 },
6156 { 0x19, 0x01a1913c },
6157 { 0x1a, 0x411111f0 },
6158 { 0x1b, 0x411111f0 },
6159 { 0x1d, 0x40f89b2d },
6160 { 0x1e, 0x411111f0 },
6161 { 0x21, 0x0321101f },
6165 [ALC280_FIXUP_HP_GPIO4
] = {
6166 .type
= HDA_FIXUP_FUNC
,
6167 .v
.func
= alc280_fixup_hp_gpio4
,
6169 [ALC286_FIXUP_HP_GPIO_LED
] = {
6170 .type
= HDA_FIXUP_FUNC
,
6171 .v
.func
= alc286_fixup_hp_gpio_led
,
6173 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
6174 .type
= HDA_FIXUP_FUNC
,
6175 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
6177 [ALC280_FIXUP_HP_DOCK_PINS
] = {
6178 .type
= HDA_FIXUP_PINS
,
6179 .v
.pins
= (const struct hda_pintbl
[]) {
6180 { 0x1b, 0x21011020 }, /* line-out */
6181 { 0x1a, 0x01a1903c }, /* headset mic */
6182 { 0x18, 0x2181103f }, /* line-in */
6186 .chain_id
= ALC280_FIXUP_HP_GPIO4
6188 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
6189 .type
= HDA_FIXUP_PINS
,
6190 .v
.pins
= (const struct hda_pintbl
[]) {
6191 { 0x1b, 0x21011020 }, /* line-out */
6192 { 0x18, 0x2181103f }, /* line-in */
6196 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
6198 [ALC280_FIXUP_HP_9480M
] = {
6199 .type
= HDA_FIXUP_FUNC
,
6200 .v
.func
= alc280_fixup_hp_9480m
,
6202 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
6203 .type
= HDA_FIXUP_FUNC
,
6204 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
6206 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
6208 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6209 .type
= HDA_FIXUP_PINS
,
6210 .v
.pins
= (const struct hda_pintbl
[]) {
6211 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6212 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6216 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
6218 [ALC288_FIXUP_DELL_XPS_13_GPIO6
] = {
6219 .type
= HDA_FIXUP_VERBS
,
6220 .v
.verbs
= (const struct hda_verb
[]) {
6221 {0x01, AC_VERB_SET_GPIO_MASK
, 0x40},
6222 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x40},
6223 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
6227 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6229 [ALC288_FIXUP_DISABLE_AAMIX
] = {
6230 .type
= HDA_FIXUP_FUNC
,
6231 .v
.func
= alc_fixup_disable_aamix
,
6233 .chain_id
= ALC288_FIXUP_DELL_XPS_13_GPIO6
6235 [ALC288_FIXUP_DELL_XPS_13
] = {
6236 .type
= HDA_FIXUP_FUNC
,
6237 .v
.func
= alc_fixup_dell_xps13
,
6239 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
6241 [ALC292_FIXUP_DISABLE_AAMIX
] = {
6242 .type
= HDA_FIXUP_FUNC
,
6243 .v
.func
= alc_fixup_disable_aamix
,
6245 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6247 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
6248 .type
= HDA_FIXUP_FUNC
,
6249 .v
.func
= alc_fixup_disable_aamix
,
6251 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6253 [ALC292_FIXUP_DELL_E7X
] = {
6254 .type
= HDA_FIXUP_FUNC
,
6255 .v
.func
= alc_fixup_dell_xps13
,
6257 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
6259 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6260 .type
= HDA_FIXUP_PINS
,
6261 .v
.pins
= (const struct hda_pintbl
[]) {
6262 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6263 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6267 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6269 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
6270 .type
= HDA_FIXUP_PINS
,
6271 .v
.pins
= (const struct hda_pintbl
[]) {
6272 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6276 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6278 [ALC275_FIXUP_DELL_XPS
] = {
6279 .type
= HDA_FIXUP_VERBS
,
6280 .v
.verbs
= (const struct hda_verb
[]) {
6281 /* Enables internal speaker */
6282 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
6283 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
6284 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
6285 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
6289 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
6290 .type
= HDA_FIXUP_VERBS
,
6291 .v
.verbs
= (const struct hda_verb
[]) {
6292 /* Disable pass-through path for FRONT 14h */
6293 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
6294 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
6298 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6300 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
6301 .type
= HDA_FIXUP_FUNC
,
6302 .v
.func
= alc_fixup_disable_aamix
,
6304 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6306 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
6307 .type
= HDA_FIXUP_FUNC
,
6308 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
6310 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
6311 .type
= HDA_FIXUP_FUNC
,
6312 .v
.func
= alc_fixup_disable_aamix
,
6314 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6316 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
6317 .type
= HDA_FIXUP_FUNC
,
6318 .v
.func
= alc_fixup_disable_mic_vref
,
6320 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6322 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6323 .type
= HDA_FIXUP_VERBS
,
6324 .v
.verbs
= (const struct hda_verb
[]) {
6325 /* Disable pass-through path for FRONT 14h */
6326 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6327 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6331 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
6333 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
6334 .type
= HDA_FIXUP_FUNC
,
6335 .v
.func
= alc_fixup_disable_aamix
,
6337 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
6339 [ALC221_FIXUP_HP_FRONT_MIC
] = {
6340 .type
= HDA_FIXUP_PINS
,
6341 .v
.pins
= (const struct hda_pintbl
[]) {
6342 { 0x19, 0x02a19020 }, /* Front Mic */
6346 [ALC292_FIXUP_TPT460
] = {
6347 .type
= HDA_FIXUP_FUNC
,
6348 .v
.func
= alc_fixup_tpt440_dock
,
6350 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
6352 [ALC298_FIXUP_SPK_VOLUME
] = {
6353 .type
= HDA_FIXUP_FUNC
,
6354 .v
.func
= alc298_fixup_speaker_volume
,
6356 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
6358 [ALC295_FIXUP_DISABLE_DAC3
] = {
6359 .type
= HDA_FIXUP_FUNC
,
6360 .v
.func
= alc295_fixup_disable_dac3
,
6362 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
6363 .type
= HDA_FIXUP_PINS
,
6364 .v
.pins
= (const struct hda_pintbl
[]) {
6365 { 0x1b, 0x90170151 },
6369 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6371 [ALC269_FIXUP_ATIV_BOOK_8
] = {
6372 .type
= HDA_FIXUP_FUNC
,
6373 .v
.func
= alc_fixup_auto_mute_via_amp
,
6375 .chain_id
= ALC269_FIXUP_NO_SHUTUP
6377 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
6378 .type
= HDA_FIXUP_PINS
,
6379 .v
.pins
= (const struct hda_pintbl
[]) {
6380 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6381 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6385 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6387 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
6388 .type
= HDA_FIXUP_FUNC
,
6389 .v
.func
= alc_fixup_headset_mode
,
6391 [ALC256_FIXUP_ASUS_MIC
] = {
6392 .type
= HDA_FIXUP_PINS
,
6393 .v
.pins
= (const struct hda_pintbl
[]) {
6394 { 0x13, 0x90a60160 }, /* use as internal mic */
6395 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6399 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6401 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
6402 .type
= HDA_FIXUP_VERBS
,
6403 .v
.verbs
= (const struct hda_verb
[]) {
6404 /* Set up GPIO2 for the speaker amp */
6405 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
6406 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
6407 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
6411 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6412 .type
= HDA_FIXUP_PINS
,
6413 .v
.pins
= (const struct hda_pintbl
[]) {
6414 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6418 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6420 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
6421 .type
= HDA_FIXUP_VERBS
,
6422 .v
.verbs
= (const struct hda_verb
[]) {
6423 /* Enables internal speaker */
6424 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
6425 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
6429 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6431 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
6432 .type
= HDA_FIXUP_FUNC
,
6433 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
6435 [ALC294_FIXUP_LENOVO_MIC_LOCATION
] = {
6436 .type
= HDA_FIXUP_PINS
,
6437 .v
.pins
= (const struct hda_pintbl
[]) {
6438 /* Change the mic location from front to right, otherwise there are
6439 two front mics with the same name, pulseaudio can't handle them.
6440 This is just a temporary workaround, after applying this fixup,
6441 there will be one "Front Mic" and one "Mic" in this machine.
6443 { 0x1a, 0x04a19040 },
6447 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
] = {
6448 .type
= HDA_FIXUP_PINS
,
6449 .v
.pins
= (const struct hda_pintbl
[]) {
6450 { 0x16, 0x0101102f }, /* Rear Headset HP */
6451 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6452 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6453 { 0x1b, 0x02011020 },
6457 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6459 [ALC700_FIXUP_INTEL_REFERENCE
] = {
6460 .type
= HDA_FIXUP_VERBS
,
6461 .v
.verbs
= (const struct hda_verb
[]) {
6462 /* Enables internal speaker */
6463 {0x20, AC_VERB_SET_COEF_INDEX
, 0x45},
6464 {0x20, AC_VERB_SET_PROC_COEF
, 0x5289},
6465 {0x20, AC_VERB_SET_COEF_INDEX
, 0x4A},
6466 {0x20, AC_VERB_SET_PROC_COEF
, 0x001b},
6467 {0x58, AC_VERB_SET_COEF_INDEX
, 0x00},
6468 {0x58, AC_VERB_SET_PROC_COEF
, 0x3888},
6469 {0x20, AC_VERB_SET_COEF_INDEX
, 0x6f},
6470 {0x20, AC_VERB_SET_PROC_COEF
, 0x2c0b},
6474 [ALC274_FIXUP_DELL_BIND_DACS
] = {
6475 .type
= HDA_FIXUP_FUNC
,
6476 .v
.func
= alc274_fixup_bind_dacs
,
6478 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6480 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
] = {
6481 .type
= HDA_FIXUP_PINS
,
6482 .v
.pins
= (const struct hda_pintbl
[]) {
6483 { 0x1b, 0x0401102f },
6487 .chain_id
= ALC274_FIXUP_DELL_BIND_DACS
6489 [ALC298_FIXUP_TPT470_DOCK
] = {
6490 .type
= HDA_FIXUP_FUNC
,
6491 .v
.func
= alc_fixup_tpt470_dock
,
6493 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
6495 [ALC255_FIXUP_DUMMY_LINEOUT_VERB
] = {
6496 .type
= HDA_FIXUP_PINS
,
6497 .v
.pins
= (const struct hda_pintbl
[]) {
6498 { 0x14, 0x0201101f },
6502 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6504 [ALC255_FIXUP_DELL_HEADSET_MIC
] = {
6505 .type
= HDA_FIXUP_PINS
,
6506 .v
.pins
= (const struct hda_pintbl
[]) {
6507 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6511 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6513 [ALC221_FIXUP_HP_HEADSET_MIC
] = {
6514 .type
= HDA_FIXUP_PINS
,
6515 .v
.pins
= (const struct hda_pintbl
[]) {
6516 { 0x19, 0x0181313f},
6520 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6522 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
] = {
6523 .type
= HDA_FIXUP_FUNC
,
6524 .v
.func
= alc285_fixup_invalidate_dacs
,
6526 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6528 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
] = {
6529 .type
= HDA_FIXUP_VERBS
,
6530 .v
.verbs
= (const struct hda_verb
[]) {
6531 /* Disable PCBEEP-IN passthrough */
6532 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6533 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6537 .chain_id
= ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6539 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
] = {
6540 .type
= HDA_FIXUP_PINS
,
6541 .v
.pins
= (const struct hda_pintbl
[]) {
6542 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6546 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6548 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
] = {
6549 .type
= HDA_FIXUP_PINS
,
6550 .v
.pins
= (const struct hda_pintbl
[]) {
6551 { 0x16, 0x01011020 }, /* Rear Line out */
6552 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6556 .chain_id
= ALC225_FIXUP_WYSE_AUTO_MUTE
6558 [ALC225_FIXUP_WYSE_AUTO_MUTE
] = {
6559 .type
= HDA_FIXUP_FUNC
,
6560 .v
.func
= alc_fixup_auto_mute_via_amp
,
6562 .chain_id
= ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6564 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
] = {
6565 .type
= HDA_FIXUP_FUNC
,
6566 .v
.func
= alc_fixup_disable_mic_vref
,
6568 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6572 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
6573 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
6574 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
6575 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
6576 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
6577 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6578 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6579 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6580 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6581 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6582 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6583 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
6584 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
6585 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
6586 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
6587 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
6588 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
6589 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
6590 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
6591 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
6592 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6593 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6594 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6595 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6596 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6597 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
6598 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
6599 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
6600 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6601 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6602 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
6603 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6604 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6605 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6606 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6607 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6608 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6609 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6610 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6611 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6612 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6613 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6614 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6615 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
6616 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP
),
6617 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6618 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
6619 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
6620 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6621 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
),
6622 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6623 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6624 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6625 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6626 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6627 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB
),
6628 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
),
6629 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
),
6630 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6631 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6632 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6633 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
6634 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
6635 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
6636 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
6638 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6639 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6640 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6641 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6642 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6643 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6644 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6645 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6646 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6647 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6648 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6649 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6650 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
6651 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6652 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6653 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6654 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6655 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6656 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6657 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6658 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
6659 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6660 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6662 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6663 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6664 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6665 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6666 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6667 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6668 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6669 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6670 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6671 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
6672 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6673 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6674 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6675 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6676 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6677 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6678 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6679 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6680 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6681 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6682 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6683 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6684 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6685 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6686 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6687 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6688 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6689 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6690 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6691 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
6692 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
6693 SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6694 SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6695 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6696 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
6697 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6698 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6699 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6700 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6701 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6702 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6703 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6704 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
6705 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
6706 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
6707 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
6708 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
6709 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
6710 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
6711 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
6712 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
6713 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6714 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6715 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
6716 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
6717 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
6718 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
6719 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6720 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6721 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
6722 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6723 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6724 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
6725 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6726 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6727 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
6728 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
6729 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
6730 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6731 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6732 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
6733 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
6734 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE
),
6735 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE
),
6736 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
6737 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
6738 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
6739 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
6740 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6741 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
6742 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
6743 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
6744 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
6745 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
6746 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
6747 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
6748 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
6749 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
6750 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
6751 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
6752 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
6753 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
6754 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
6755 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
6756 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
6757 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
6758 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
6759 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6760 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
6761 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
6762 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
6763 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6764 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6765 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
6766 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
6767 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK
),
6768 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6769 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6770 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460
),
6771 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6772 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6773 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6774 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6775 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6776 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6777 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6778 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6779 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6780 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6781 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
6782 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
6783 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP
),
6784 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6785 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
6786 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
6787 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6788 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
6789 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
6790 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
6791 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
6792 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
6793 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
6794 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
6795 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
6796 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6797 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6798 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6799 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6800 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6801 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6802 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
6803 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
6804 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
6807 /* Below is a quirk table taken from the old code.
6808 * Basically the device should work as is without the fixup table.
6809 * If BIOS doesn't give a proper info, enable the corresponding
6812 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
6814 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
6815 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
6816 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
6817 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
6818 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
6819 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
6820 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
6821 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
6822 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
6823 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
6824 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
6825 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
6826 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
6827 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
6828 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
6829 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
6830 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
6831 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
6832 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
6833 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
6834 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
6835 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
6836 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
6837 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
6838 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
6839 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
6840 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
6841 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
6842 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
6843 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
6844 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
6845 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
6846 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
6847 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
6848 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
6849 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
6850 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
6851 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
6852 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
6857 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
6858 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
6859 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
6860 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
6861 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
6865 static const struct hda_model_fixup alc269_fixup_models
[] = {
6866 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
6867 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
6868 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
6869 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
6870 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
6871 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
6872 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
6873 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
6874 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
6875 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
6876 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
6877 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
6878 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
6879 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
6880 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
6881 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
6882 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
6883 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
6884 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
6885 {.id
= ALC700_FIXUP_INTEL_REFERENCE
, .name
= "alc700-ref"},
6888 #define ALC225_STANDARD_PINS \
6891 #define ALC256_STANDARD_PINS \
6892 {0x12, 0x90a60140}, \
6893 {0x14, 0x90170110}, \
6896 #define ALC282_STANDARD_PINS \
6899 #define ALC290_STANDARD_PINS \
6902 #define ALC292_STANDARD_PINS \
6903 {0x14, 0x90170110}, \
6906 #define ALC295_STANDARD_PINS \
6907 {0x12, 0xb7a60130}, \
6908 {0x14, 0x90170110}, \
6911 #define ALC298_STANDARD_PINS \
6912 {0x12, 0x90a60130}, \
6915 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
6916 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC
,
6921 {0x21, 0x0221102f}),
6922 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
6925 {0x21, 0x02211030}),
6926 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6929 {0x21, 0x03211020}),
6930 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6933 {0x21, 0x03211020}),
6934 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6935 ALC225_STANDARD_PINS
,
6937 {0x14, 0x901701a0}),
6938 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6939 ALC225_STANDARD_PINS
,
6941 {0x14, 0x901701b0}),
6942 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6943 ALC225_STANDARD_PINS
,
6945 {0x14, 0x901701a0}),
6946 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6947 ALC225_STANDARD_PINS
,
6949 {0x14, 0x901701b0}),
6950 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6951 ALC225_STANDARD_PINS
,
6953 {0x1b, 0x90170110}),
6954 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6957 {0x21, 0x02211020}),
6958 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
6962 {0x21, 0x02211020}),
6963 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6968 {0x21, 0x0221101f}),
6969 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6974 {0x21, 0x0221101f}),
6975 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
6979 {0x21, 0x0221101f}),
6980 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6983 {0x21, 0x02211020}),
6984 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
6988 {0x21, 0x02211020}),
6989 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6992 {0x21, 0x02211020}),
6993 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6994 {0x21, 0x02211020}),
6995 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
6997 {0x21, 0x02211020}),
6998 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7000 {0x21, 0x02211040}),
7001 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7004 {0x21, 0x02211020}),
7005 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7008 {0x21, 0x02211030}),
7009 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7012 {0x21, 0x0221101f}),
7013 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7016 {0x21, 0x0221101f}),
7017 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7020 {0x21, 0x0221103f}),
7021 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7024 {0x21, 0x0221103f}),
7025 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7028 {0x21, 0x0221103f}),
7029 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7032 {0x21, 0x0221105f}),
7033 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7036 {0x21, 0x0221101f}),
7037 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7041 {0x21, 0x0321102f}),
7042 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7045 {0x21, 0x02211040}),
7046 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7049 {0x21, 0x02211050}),
7050 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7053 {0x21, 0x02211030}),
7054 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7057 {0x21, 0x02211040}),
7058 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7061 {0x21, 0x02211040}),
7062 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7065 {0x21, 0x02211050}),
7066 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7069 {0x21, 0x02211040}),
7070 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7073 {0x21, 0x02211030}),
7074 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7076 {0x21, 0x02211010}),
7077 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7081 {0x21, 0x0221101f}),
7082 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7085 {0x21, 0x02211030}),
7086 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7089 {0x21, 0x02211030}),
7090 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7093 {0x21, 0x02211030}),
7094 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7097 {0x21, 0x02211020}),
7098 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7102 {0x21, 0x0221101f}),
7103 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7104 ALC256_STANDARD_PINS
),
7105 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7108 {0x21, 0x0221101f}),
7109 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7112 {0x21, 0x04211020}),
7113 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7116 {0x21, 0x03211020}),
7117 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
7121 {0x21, 0x04211020}),
7122 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
7126 {0x1a, 0x04a11020}),
7127 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
7133 {0x1b, 0x02011020}),
7134 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7135 ALC282_STANDARD_PINS
,
7138 {0x21, 0x0321101f}),
7139 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7140 ALC282_STANDARD_PINS
,
7143 {0x21, 0x03211040}),
7144 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7145 ALC282_STANDARD_PINS
,
7148 {0x21, 0x03211020}),
7149 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7150 ALC282_STANDARD_PINS
,
7153 {0x21, 0x0421101f}),
7154 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
7155 ALC282_STANDARD_PINS
,
7158 {0x21, 0x04211020}),
7159 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7160 ALC282_STANDARD_PINS
,
7162 {0x21, 0x0321101f}),
7163 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7166 {0x21, 0x02211030}),
7167 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7168 ALC282_STANDARD_PINS
,
7171 {0x21, 0x0321101f}),
7172 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
7176 {0x21, 0x04211020}),
7177 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6
,
7180 {0x21, 0x0321101f}),
7181 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7184 {0x21, 0x04211020}),
7185 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7186 ALC290_STANDARD_PINS
,
7189 {0x1a, 0x04a11020}),
7190 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7191 ALC290_STANDARD_PINS
,
7194 {0x1a, 0x04a11020}),
7195 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7196 ALC290_STANDARD_PINS
,
7198 {0x1a, 0x04a11020}),
7199 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7200 ALC290_STANDARD_PINS
,
7202 {0x1a, 0x04a11040}),
7203 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7204 ALC290_STANDARD_PINS
,
7207 {0x1a, 0x04a11040}),
7208 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7209 ALC290_STANDARD_PINS
,
7212 {0x1a, 0x04a11020}),
7213 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7214 ALC290_STANDARD_PINS
,
7217 {0x1a, 0x04a11020}),
7218 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7219 ALC292_STANDARD_PINS
,
7222 {0x19, 0x01a19030}),
7223 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7224 ALC292_STANDARD_PINS
,
7228 {0x19, 0x01a1903e}),
7229 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
7230 ALC292_STANDARD_PINS
,
7231 {0x12, 0x90a60140}),
7232 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7233 ALC292_STANDARD_PINS
,
7236 {0x19, 0x21a19030}),
7237 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7238 ALC292_STANDARD_PINS
,
7239 {0x13, 0x90a60140}),
7240 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7241 ALC295_STANDARD_PINS
,
7243 {0x18, 0x21a19030}),
7244 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7245 ALC295_STANDARD_PINS
,
7247 {0x18, 0x21a19050}),
7248 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7249 ALC295_STANDARD_PINS
),
7250 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7251 ALC298_STANDARD_PINS
,
7252 {0x17, 0x90170110}),
7253 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7254 ALC298_STANDARD_PINS
,
7255 {0x17, 0x90170140}),
7256 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7257 ALC298_STANDARD_PINS
,
7258 {0x17, 0x90170150}),
7259 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
7264 {0x21, 0x03211030}),
7265 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7266 ALC225_STANDARD_PINS
,
7268 {0x17, 0x90170110}),
7272 static void alc269_fill_coef(struct hda_codec
*codec
)
7274 struct alc_spec
*spec
= codec
->spec
;
7277 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
7280 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
7281 alc_write_coef_idx(codec
, 0xf, 0x960b);
7282 alc_write_coef_idx(codec
, 0xe, 0x8817);
7285 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
7286 alc_write_coef_idx(codec
, 0xf, 0x960b);
7287 alc_write_coef_idx(codec
, 0xe, 0x8814);
7290 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
7291 /* Power up output pin */
7292 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
7295 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
7296 val
= alc_read_coef_idx(codec
, 0xd);
7297 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
7298 /* Capless ramp up clock control */
7299 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
7301 val
= alc_read_coef_idx(codec
, 0x17);
7302 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
7303 /* Class D power on reset */
7304 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
7309 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
7314 static int patch_alc269(struct hda_codec
*codec
)
7316 struct alc_spec
*spec
;
7319 err
= alc_alloc_spec(codec
, 0x0b);
7324 spec
->gen
.shared_mic_vref_pin
= 0x18;
7325 codec
->power_save_node
= 1;
7328 codec
->patch_ops
.suspend
= alc269_suspend
;
7329 codec
->patch_ops
.resume
= alc269_resume
;
7331 spec
->shutup
= alc_default_shutup
;
7332 spec
->init_hook
= alc_default_init
;
7334 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
7335 alc269_fixup_tbl
, alc269_fixups
);
7336 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
7337 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
7339 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7341 alc_auto_parse_customize_define(codec
);
7343 if (has_cdefine_beep(codec
))
7344 spec
->gen
.beep_nid
= 0x01;
7346 switch (codec
->core
.vendor_id
) {
7348 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
7349 switch (alc_get_coef0(codec
) & 0x00f0) {
7351 if (codec
->bus
->pci
&&
7352 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7353 spec
->cdefine
.platform_type
== 1)
7354 err
= alc_codec_rename(codec
, "ALC271X");
7355 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
7358 if (codec
->bus
->pci
&&
7359 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
7360 codec
->bus
->pci
->subsystem_device
== 0x21f3)
7361 err
= alc_codec_rename(codec
, "ALC3202");
7362 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
7365 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
7368 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7372 spec
->shutup
= alc269_shutup
;
7373 spec
->init_hook
= alc269_fill_coef
;
7374 alc269_fill_coef(codec
);
7379 spec
->codec_variant
= ALC269_TYPE_ALC280
;
7382 spec
->codec_variant
= ALC269_TYPE_ALC282
;
7383 spec
->shutup
= alc282_shutup
;
7384 spec
->init_hook
= alc282_init
;
7388 spec
->codec_variant
= ALC269_TYPE_ALC283
;
7389 spec
->shutup
= alc283_shutup
;
7390 spec
->init_hook
= alc283_init
;
7394 spec
->codec_variant
= ALC269_TYPE_ALC284
;
7397 spec
->codec_variant
= ALC269_TYPE_ALC293
;
7401 spec
->codec_variant
= ALC269_TYPE_ALC286
;
7404 spec
->codec_variant
= ALC269_TYPE_ALC298
;
7408 spec
->codec_variant
= ALC269_TYPE_ALC255
;
7409 spec
->shutup
= alc256_shutup
;
7410 spec
->init_hook
= alc256_init
;
7414 spec
->codec_variant
= ALC269_TYPE_ALC256
;
7415 spec
->shutup
= alc256_shutup
;
7416 spec
->init_hook
= alc256_init
;
7417 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
7418 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
7421 spec
->codec_variant
= ALC269_TYPE_ALC257
;
7422 spec
->shutup
= alc256_shutup
;
7423 spec
->init_hook
= alc256_init
;
7424 spec
->gen
.mixer_nid
= 0;
7429 spec
->codec_variant
= ALC269_TYPE_ALC215
;
7430 spec
->gen
.mixer_nid
= 0;
7434 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7435 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225 ALC295 */
7438 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7439 spec
->shutup
= alc225_shutup
;
7440 spec
->init_hook
= alc225_init
;
7441 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225, ALC295 and ALC299 */
7446 spec
->codec_variant
= ALC269_TYPE_ALC294
;
7447 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
7448 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7449 spec
->init_hook
= alc294_init
;
7454 spec
->codec_variant
= ALC269_TYPE_ALC700
;
7455 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
7456 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7457 spec
->init_hook
= alc294_init
;
7462 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
7463 spec
->has_alc5505_dsp
= 1;
7464 spec
->init_hook
= alc5505_dsp_init
;
7467 /* automatic parse from the BIOS config */
7468 err
= alc269_parse_auto_config(codec
);
7472 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
)
7473 set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
7475 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7488 static int alc861_parse_auto_config(struct hda_codec
*codec
)
7490 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
7491 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
7492 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
7495 /* Pin config fixes */
7497 ALC861_FIXUP_FSC_AMILO_PI1505
,
7498 ALC861_FIXUP_AMP_VREF_0F
,
7499 ALC861_FIXUP_NO_JACK_DETECT
,
7500 ALC861_FIXUP_ASUS_A6RP
,
7501 ALC660_FIXUP_ASUS_W7J
,
7504 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7505 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
7506 const struct hda_fixup
*fix
, int action
)
7508 struct alc_spec
*spec
= codec
->spec
;
7511 if (action
!= HDA_FIXUP_ACT_INIT
)
7513 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
7514 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
7515 val
|= AC_PINCTL_IN_EN
;
7516 val
|= AC_PINCTL_VREF_50
;
7517 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
7518 spec
->gen
.keep_vref_in_automute
= 1;
7521 /* suppress the jack-detection */
7522 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
7523 const struct hda_fixup
*fix
, int action
)
7525 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
7526 codec
->no_jack_detect
= 1;
7529 static const struct hda_fixup alc861_fixups
[] = {
7530 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
7531 .type
= HDA_FIXUP_PINS
,
7532 .v
.pins
= (const struct hda_pintbl
[]) {
7533 { 0x0b, 0x0221101f }, /* HP */
7534 { 0x0f, 0x90170310 }, /* speaker */
7538 [ALC861_FIXUP_AMP_VREF_0F
] = {
7539 .type
= HDA_FIXUP_FUNC
,
7540 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7542 [ALC861_FIXUP_NO_JACK_DETECT
] = {
7543 .type
= HDA_FIXUP_FUNC
,
7544 .v
.func
= alc_fixup_no_jack_detect
,
7546 [ALC861_FIXUP_ASUS_A6RP
] = {
7547 .type
= HDA_FIXUP_FUNC
,
7548 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7550 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
7552 [ALC660_FIXUP_ASUS_W7J
] = {
7553 .type
= HDA_FIXUP_VERBS
,
7554 .v
.verbs
= (const struct hda_verb
[]) {
7555 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7556 * for enabling outputs
7558 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
7564 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
7565 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
7566 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
7567 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
7568 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
7569 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
7570 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
7571 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
7572 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
7578 static int patch_alc861(struct hda_codec
*codec
)
7580 struct alc_spec
*spec
;
7583 err
= alc_alloc_spec(codec
, 0x15);
7588 spec
->gen
.beep_nid
= 0x23;
7591 spec
->power_hook
= alc_power_eapd
;
7594 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
7595 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7597 /* automatic parse from the BIOS config */
7598 err
= alc861_parse_auto_config(codec
);
7602 if (!spec
->gen
.no_analog
)
7603 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
7605 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7619 * In addition, an independent DAC
7621 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
7623 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
7624 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7625 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
7629 ALC660VD_FIX_ASUS_GPIO1
,
7630 ALC861VD_FIX_DALLAS
,
7633 /* exclude VREF80 */
7634 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
7635 const struct hda_fixup
*fix
, int action
)
7637 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7638 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
7639 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
7643 static const struct hda_fixup alc861vd_fixups
[] = {
7644 [ALC660VD_FIX_ASUS_GPIO1
] = {
7645 .type
= HDA_FIXUP_VERBS
,
7646 .v
.verbs
= (const struct hda_verb
[]) {
7648 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
7649 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
7650 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
7654 [ALC861VD_FIX_DALLAS
] = {
7655 .type
= HDA_FIXUP_FUNC
,
7656 .v
.func
= alc861vd_fixup_dallas
,
7660 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
7661 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
7662 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
7663 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
7669 static int patch_alc861vd(struct hda_codec
*codec
)
7671 struct alc_spec
*spec
;
7674 err
= alc_alloc_spec(codec
, 0x0b);
7679 spec
->gen
.beep_nid
= 0x23;
7681 spec
->shutup
= alc_eapd_shutup
;
7683 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
7684 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7686 /* automatic parse from the BIOS config */
7687 err
= alc861vd_parse_auto_config(codec
);
7691 if (!spec
->gen
.no_analog
)
7692 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
7694 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7706 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
7707 * configuration. Each pin widget can choose any input DACs and a mixer.
7708 * Each ADC is connected from a mixer of all inputs. This makes possible
7709 * 6-channel independent captures.
7711 * In addition, an independent DAC for the multi-playback (not used in this
7716 * BIOS auto configuration
7719 static int alc662_parse_auto_config(struct hda_codec
*codec
)
7721 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
7722 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
7723 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7724 const hda_nid_t
*ssids
;
7726 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
7727 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
7728 codec
->core
.vendor_id
== 0x10ec0671)
7729 ssids
= alc663_ssids
;
7731 ssids
= alc662_ssids
;
7732 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
7735 static void alc272_fixup_mario(struct hda_codec
*codec
,
7736 const struct hda_fixup
*fix
, int action
)
7738 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
7740 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
7741 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
7742 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
7743 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
7744 (0 << AC_AMPCAP_MUTE_SHIFT
)))
7745 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
7748 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
7750 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
7752 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
7753 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
7757 /* override the 2.1 chmap */
7758 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
7759 const struct hda_fixup
*fix
, int action
)
7761 if (action
== HDA_FIXUP_ACT_BUILD
) {
7762 struct alc_spec
*spec
= codec
->spec
;
7763 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
7767 /* avoid D3 for keeping GPIO up */
7768 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
7770 unsigned int power_state
)
7772 struct alc_spec
*spec
= codec
->spec
;
7773 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
7778 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
7779 const struct hda_fixup
*fix
, int action
)
7781 struct alc_spec
*spec
= codec
->spec
;
7782 static const struct hda_verb gpio_init
[] = {
7783 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
7784 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
7788 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7789 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
7791 spec
->mute_led_polarity
= 1;
7792 spec
->gpio_mute_led_mask
= 0x01;
7793 snd_hda_add_verbs(codec
, gpio_init
);
7794 codec
->power_filter
= gpio_led_power_filter
;
7798 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
7799 struct hda_jack_callback
*jack
)
7801 struct alc_spec
*spec
= codec
->spec
;
7804 snd_hda_gen_hp_automute(codec
, jack
);
7806 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
7808 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
7812 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
7813 const struct hda_fixup
*fix
, int action
)
7815 struct alc_spec
*spec
= codec
->spec
;
7816 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7817 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
7818 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
7822 static struct coef_fw alc668_coefs
[] = {
7823 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
7824 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
7825 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
7826 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
7827 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
7828 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
7829 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
7830 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
7831 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
7832 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
7833 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
7834 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
7835 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
7836 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
7837 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
7838 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
7839 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
7840 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
7841 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
7842 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
7846 static void alc668_restore_default_value(struct hda_codec
*codec
)
7848 alc_process_coef_fw(codec
, alc668_coefs
);
7852 ALC662_FIXUP_ASPIRE
,
7853 ALC662_FIXUP_LED_GPIO1
,
7854 ALC662_FIXUP_IDEAPAD
,
7856 ALC662_FIXUP_CZC_P10T
,
7857 ALC662_FIXUP_SKU_IGNORE
,
7858 ALC662_FIXUP_HP_RP5800
,
7859 ALC662_FIXUP_ASUS_MODE1
,
7860 ALC662_FIXUP_ASUS_MODE2
,
7861 ALC662_FIXUP_ASUS_MODE3
,
7862 ALC662_FIXUP_ASUS_MODE4
,
7863 ALC662_FIXUP_ASUS_MODE5
,
7864 ALC662_FIXUP_ASUS_MODE6
,
7865 ALC662_FIXUP_ASUS_MODE7
,
7866 ALC662_FIXUP_ASUS_MODE8
,
7867 ALC662_FIXUP_NO_JACK_DETECT
,
7868 ALC662_FIXUP_ZOTAC_Z68
,
7869 ALC662_FIXUP_INV_DMIC
,
7870 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
7871 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
7872 ALC662_FIXUP_HEADSET_MODE
,
7873 ALC668_FIXUP_HEADSET_MODE
,
7874 ALC662_FIXUP_BASS_MODE4_CHMAP
,
7875 ALC662_FIXUP_BASS_16
,
7876 ALC662_FIXUP_BASS_1A
,
7877 ALC662_FIXUP_BASS_CHMAP
,
7878 ALC668_FIXUP_AUTO_MUTE
,
7879 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
7880 ALC668_FIXUP_DELL_XPS13
,
7881 ALC662_FIXUP_ASUS_Nx50
,
7882 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
7883 ALC668_FIXUP_ASUS_Nx51
,
7884 ALC891_FIXUP_HEADSET_MODE
,
7885 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
7886 ALC662_FIXUP_ACER_VERITON
,
7887 ALC892_FIXUP_ASROCK_MOBO
,
7888 ALC662_FIXUP_USI_FUNC
,
7889 ALC662_FIXUP_USI_HEADSET_MODE
,
7890 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
7893 static const struct hda_fixup alc662_fixups
[] = {
7894 [ALC662_FIXUP_ASPIRE
] = {
7895 .type
= HDA_FIXUP_PINS
,
7896 .v
.pins
= (const struct hda_pintbl
[]) {
7897 { 0x15, 0x99130112 }, /* subwoofer */
7901 [ALC662_FIXUP_LED_GPIO1
] = {
7902 .type
= HDA_FIXUP_FUNC
,
7903 .v
.func
= alc662_fixup_led_gpio1
,
7905 [ALC662_FIXUP_IDEAPAD
] = {
7906 .type
= HDA_FIXUP_PINS
,
7907 .v
.pins
= (const struct hda_pintbl
[]) {
7908 { 0x17, 0x99130112 }, /* subwoofer */
7912 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
7914 [ALC272_FIXUP_MARIO
] = {
7915 .type
= HDA_FIXUP_FUNC
,
7916 .v
.func
= alc272_fixup_mario
,
7918 [ALC662_FIXUP_CZC_P10T
] = {
7919 .type
= HDA_FIXUP_VERBS
,
7920 .v
.verbs
= (const struct hda_verb
[]) {
7921 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
7925 [ALC662_FIXUP_SKU_IGNORE
] = {
7926 .type
= HDA_FIXUP_FUNC
,
7927 .v
.func
= alc_fixup_sku_ignore
,
7929 [ALC662_FIXUP_HP_RP5800
] = {
7930 .type
= HDA_FIXUP_PINS
,
7931 .v
.pins
= (const struct hda_pintbl
[]) {
7932 { 0x14, 0x0221201f }, /* HP out */
7936 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7938 [ALC662_FIXUP_ASUS_MODE1
] = {
7939 .type
= HDA_FIXUP_PINS
,
7940 .v
.pins
= (const struct hda_pintbl
[]) {
7941 { 0x14, 0x99130110 }, /* speaker */
7942 { 0x18, 0x01a19c20 }, /* mic */
7943 { 0x19, 0x99a3092f }, /* int-mic */
7944 { 0x21, 0x0121401f }, /* HP out */
7948 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7950 [ALC662_FIXUP_ASUS_MODE2
] = {
7951 .type
= HDA_FIXUP_PINS
,
7952 .v
.pins
= (const struct hda_pintbl
[]) {
7953 { 0x14, 0x99130110 }, /* speaker */
7954 { 0x18, 0x01a19820 }, /* mic */
7955 { 0x19, 0x99a3092f }, /* int-mic */
7956 { 0x1b, 0x0121401f }, /* HP out */
7960 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7962 [ALC662_FIXUP_ASUS_MODE3
] = {
7963 .type
= HDA_FIXUP_PINS
,
7964 .v
.pins
= (const struct hda_pintbl
[]) {
7965 { 0x14, 0x99130110 }, /* speaker */
7966 { 0x15, 0x0121441f }, /* HP */
7967 { 0x18, 0x01a19840 }, /* mic */
7968 { 0x19, 0x99a3094f }, /* int-mic */
7969 { 0x21, 0x01211420 }, /* HP2 */
7973 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7975 [ALC662_FIXUP_ASUS_MODE4
] = {
7976 .type
= HDA_FIXUP_PINS
,
7977 .v
.pins
= (const struct hda_pintbl
[]) {
7978 { 0x14, 0x99130110 }, /* speaker */
7979 { 0x16, 0x99130111 }, /* speaker */
7980 { 0x18, 0x01a19840 }, /* mic */
7981 { 0x19, 0x99a3094f }, /* int-mic */
7982 { 0x21, 0x0121441f }, /* HP */
7986 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7988 [ALC662_FIXUP_ASUS_MODE5
] = {
7989 .type
= HDA_FIXUP_PINS
,
7990 .v
.pins
= (const struct hda_pintbl
[]) {
7991 { 0x14, 0x99130110 }, /* speaker */
7992 { 0x15, 0x0121441f }, /* HP */
7993 { 0x16, 0x99130111 }, /* speaker */
7994 { 0x18, 0x01a19840 }, /* mic */
7995 { 0x19, 0x99a3094f }, /* int-mic */
7999 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8001 [ALC662_FIXUP_ASUS_MODE6
] = {
8002 .type
= HDA_FIXUP_PINS
,
8003 .v
.pins
= (const struct hda_pintbl
[]) {
8004 { 0x14, 0x99130110 }, /* speaker */
8005 { 0x15, 0x01211420 }, /* HP2 */
8006 { 0x18, 0x01a19840 }, /* mic */
8007 { 0x19, 0x99a3094f }, /* int-mic */
8008 { 0x1b, 0x0121441f }, /* HP */
8012 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8014 [ALC662_FIXUP_ASUS_MODE7
] = {
8015 .type
= HDA_FIXUP_PINS
,
8016 .v
.pins
= (const struct hda_pintbl
[]) {
8017 { 0x14, 0x99130110 }, /* speaker */
8018 { 0x17, 0x99130111 }, /* speaker */
8019 { 0x18, 0x01a19840 }, /* mic */
8020 { 0x19, 0x99a3094f }, /* int-mic */
8021 { 0x1b, 0x01214020 }, /* HP */
8022 { 0x21, 0x0121401f }, /* HP */
8026 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8028 [ALC662_FIXUP_ASUS_MODE8
] = {
8029 .type
= HDA_FIXUP_PINS
,
8030 .v
.pins
= (const struct hda_pintbl
[]) {
8031 { 0x14, 0x99130110 }, /* speaker */
8032 { 0x12, 0x99a30970 }, /* int-mic */
8033 { 0x15, 0x01214020 }, /* HP */
8034 { 0x17, 0x99130111 }, /* speaker */
8035 { 0x18, 0x01a19840 }, /* mic */
8036 { 0x21, 0x0121401f }, /* HP */
8040 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8042 [ALC662_FIXUP_NO_JACK_DETECT
] = {
8043 .type
= HDA_FIXUP_FUNC
,
8044 .v
.func
= alc_fixup_no_jack_detect
,
8046 [ALC662_FIXUP_ZOTAC_Z68
] = {
8047 .type
= HDA_FIXUP_PINS
,
8048 .v
.pins
= (const struct hda_pintbl
[]) {
8049 { 0x1b, 0x02214020 }, /* Front HP */
8053 [ALC662_FIXUP_INV_DMIC
] = {
8054 .type
= HDA_FIXUP_FUNC
,
8055 .v
.func
= alc_fixup_inv_dmic
,
8057 [ALC668_FIXUP_DELL_XPS13
] = {
8058 .type
= HDA_FIXUP_FUNC
,
8059 .v
.func
= alc_fixup_dell_xps13
,
8061 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
8063 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
8064 .type
= HDA_FIXUP_FUNC
,
8065 .v
.func
= alc_fixup_disable_aamix
,
8067 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8069 [ALC668_FIXUP_AUTO_MUTE
] = {
8070 .type
= HDA_FIXUP_FUNC
,
8071 .v
.func
= alc_fixup_auto_mute_via_amp
,
8073 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8075 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8076 .type
= HDA_FIXUP_PINS
,
8077 .v
.pins
= (const struct hda_pintbl
[]) {
8078 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8079 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8083 .chain_id
= ALC662_FIXUP_HEADSET_MODE
8085 [ALC662_FIXUP_HEADSET_MODE
] = {
8086 .type
= HDA_FIXUP_FUNC
,
8087 .v
.func
= alc_fixup_headset_mode_alc662
,
8089 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8090 .type
= HDA_FIXUP_PINS
,
8091 .v
.pins
= (const struct hda_pintbl
[]) {
8092 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8093 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8097 .chain_id
= ALC668_FIXUP_HEADSET_MODE
8099 [ALC668_FIXUP_HEADSET_MODE
] = {
8100 .type
= HDA_FIXUP_FUNC
,
8101 .v
.func
= alc_fixup_headset_mode_alc668
,
8103 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
8104 .type
= HDA_FIXUP_FUNC
,
8105 .v
.func
= alc_fixup_bass_chmap
,
8107 .chain_id
= ALC662_FIXUP_ASUS_MODE4
8109 [ALC662_FIXUP_BASS_16
] = {
8110 .type
= HDA_FIXUP_PINS
,
8111 .v
.pins
= (const struct hda_pintbl
[]) {
8112 {0x16, 0x80106111}, /* bass speaker */
8116 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8118 [ALC662_FIXUP_BASS_1A
] = {
8119 .type
= HDA_FIXUP_PINS
,
8120 .v
.pins
= (const struct hda_pintbl
[]) {
8121 {0x1a, 0x80106111}, /* bass speaker */
8125 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8127 [ALC662_FIXUP_BASS_CHMAP
] = {
8128 .type
= HDA_FIXUP_FUNC
,
8129 .v
.func
= alc_fixup_bass_chmap
,
8131 [ALC662_FIXUP_ASUS_Nx50
] = {
8132 .type
= HDA_FIXUP_FUNC
,
8133 .v
.func
= alc_fixup_auto_mute_via_amp
,
8135 .chain_id
= ALC662_FIXUP_BASS_1A
8137 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
8138 .type
= HDA_FIXUP_FUNC
,
8139 .v
.func
= alc_fixup_headset_mode_alc668
,
8140 .chain_id
= ALC662_FIXUP_BASS_CHMAP
8142 [ALC668_FIXUP_ASUS_Nx51
] = {
8143 .type
= HDA_FIXUP_PINS
,
8144 .v
.pins
= (const struct hda_pintbl
[]) {
8145 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8146 { 0x1a, 0x90170151 }, /* bass speaker */
8147 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8151 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8153 [ALC891_FIXUP_HEADSET_MODE
] = {
8154 .type
= HDA_FIXUP_FUNC
,
8155 .v
.func
= alc_fixup_headset_mode
,
8157 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8158 .type
= HDA_FIXUP_PINS
,
8159 .v
.pins
= (const struct hda_pintbl
[]) {
8160 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8161 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8165 .chain_id
= ALC891_FIXUP_HEADSET_MODE
8167 [ALC662_FIXUP_ACER_VERITON
] = {
8168 .type
= HDA_FIXUP_PINS
,
8169 .v
.pins
= (const struct hda_pintbl
[]) {
8170 { 0x15, 0x50170120 }, /* no internal speaker */
8174 [ALC892_FIXUP_ASROCK_MOBO
] = {
8175 .type
= HDA_FIXUP_PINS
,
8176 .v
.pins
= (const struct hda_pintbl
[]) {
8177 { 0x15, 0x40f000f0 }, /* disabled */
8178 { 0x16, 0x40f000f0 }, /* disabled */
8182 [ALC662_FIXUP_USI_FUNC
] = {
8183 .type
= HDA_FIXUP_FUNC
,
8184 .v
.func
= alc662_fixup_usi_headset_mic
,
8186 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
8187 .type
= HDA_FIXUP_PINS
,
8188 .v
.pins
= (const struct hda_pintbl
[]) {
8189 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8190 { 0x18, 0x01a1903d },
8194 .chain_id
= ALC662_FIXUP_USI_FUNC
8196 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
8197 .type
= HDA_FIXUP_FUNC
,
8198 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
8202 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
8203 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
8204 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
8205 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
8206 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
8207 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
8208 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
8209 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
8210 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
8211 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8212 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8213 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
8214 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
8215 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
8216 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8217 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8218 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8219 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8220 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8221 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
8222 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
8223 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
8224 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
8225 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
8226 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8227 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
8228 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
8229 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
8230 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
8231 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
8232 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8233 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
8234 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
8235 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
8236 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
8237 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
8238 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
8239 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
8240 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
8241 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
8242 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
8243 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
8246 /* Below is a quirk table taken from the old code.
8247 * Basically the device should work as is without the fixup table.
8248 * If BIOS doesn't give a proper info, enable the corresponding
8251 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
8252 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
8253 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
8254 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
8255 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8256 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8257 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8258 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
8259 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
8260 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8261 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
8262 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
8263 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
8264 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
8265 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
8266 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8267 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
8268 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
8269 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8270 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8271 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8272 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8273 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
8274 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
8275 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
8276 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8277 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
8278 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8279 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8280 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
8281 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8282 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8283 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
8284 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
8285 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
8286 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
8287 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
8288 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
8289 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
8290 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8291 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
8292 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
8293 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8294 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
8295 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
8296 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
8297 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
8298 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
8299 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8300 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
8305 static const struct hda_model_fixup alc662_fixup_models
[] = {
8306 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
8307 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
8308 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
8309 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
8310 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
8311 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
8312 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
8313 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
8314 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
8315 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
8316 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
8317 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
8321 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
8322 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8326 {0x21, 0x01014020}),
8327 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8331 {0x1b, 0x0221401f}),
8332 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8336 {0x16, 0x03011020}),
8337 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8341 {0x16, 0x03011020}),
8342 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8346 {0x16, 0x03011020}),
8347 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8350 {0x16, 0x03011020}),
8351 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
8354 {0x15, 0x0321101f}),
8360 static int patch_alc662(struct hda_codec
*codec
)
8362 struct alc_spec
*spec
;
8365 err
= alc_alloc_spec(codec
, 0x0b);
8371 spec
->shutup
= alc_eapd_shutup
;
8373 /* handle multiple HPs as is */
8374 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
8376 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
8378 switch (codec
->core
.vendor_id
) {
8380 spec
->init_hook
= alc668_restore_default_value
;
8384 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
8385 alc662_fixup_tbl
, alc662_fixups
);
8386 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
8387 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8389 alc_auto_parse_customize_define(codec
);
8391 if (has_cdefine_beep(codec
))
8392 spec
->gen
.beep_nid
= 0x01;
8394 if ((alc_get_coef0(codec
) & (1 << 14)) &&
8395 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
8396 spec
->cdefine
.platform_type
== 1) {
8397 err
= alc_codec_rename(codec
, "ALC272X");
8402 /* automatic parse from the BIOS config */
8403 err
= alc662_parse_auto_config(codec
);
8407 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
8408 switch (codec
->core
.vendor_id
) {
8410 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8416 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
8419 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
8424 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8437 static int alc680_parse_auto_config(struct hda_codec
*codec
)
8439 return alc_parse_auto_config(codec
, NULL
, NULL
);
8444 static int patch_alc680(struct hda_codec
*codec
)
8448 /* ALC680 has no aa-loopback mixer */
8449 err
= alc_alloc_spec(codec
, 0);
8453 /* automatic parse from the BIOS config */
8454 err
= alc680_parse_auto_config(codec
);
8466 static const struct hda_device_id snd_hda_id_realtek
[] = {
8467 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
8468 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
8469 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
8470 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
8471 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
8472 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
8473 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
8474 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
8475 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
8476 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
8477 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269
),
8478 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
8479 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
8480 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
8481 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
8482 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
8483 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
8484 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
8485 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
8486 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
8487 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
8488 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
8489 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
8490 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
8491 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
8492 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
8493 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
8494 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
8495 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
8496 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
8497 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
8498 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
8499 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
8500 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
8501 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
8502 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
8503 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
8504 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
8505 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
8506 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
8507 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
8508 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
8509 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
8510 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
8511 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
8512 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
8513 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
8514 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
8515 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
8516 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
8517 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
8518 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
8519 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
8520 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
8521 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
8522 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
8523 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
8524 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
8525 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
8526 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
8527 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
8528 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
8529 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
8530 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
8531 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
8532 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
8533 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
8534 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882
),
8535 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
8538 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
8540 MODULE_LICENSE("GPL");
8541 MODULE_DESCRIPTION("Realtek HD-audio codec");
8543 static struct hda_codec_driver realtek_driver
= {
8544 .id
= snd_hda_id_realtek
,
8547 module_hda_codec_driver(realtek_driver
);