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 <sound/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 */
52 ALC_HEADSET_MODE_UNKNOWN
,
53 ALC_HEADSET_MODE_UNPLUGGED
,
54 ALC_HEADSET_MODE_HEADSET
,
56 ALC_HEADSET_MODE_HEADPHONE
,
60 ALC_HEADSET_TYPE_UNKNOWN
,
61 ALC_HEADSET_TYPE_CTIA
,
62 ALC_HEADSET_TYPE_OMTP
,
66 ALC_KEY_MICMUTE_INDEX
,
69 struct alc_customize_define
{
71 unsigned char port_connectivity
;
72 unsigned char check_sum
;
73 unsigned char customization
;
74 unsigned char external_amp
;
75 unsigned int enable_pcbeep
:1;
76 unsigned int platform_type
:1;
78 unsigned int override
:1;
79 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
83 struct hda_gen_spec gen
; /* must be at head */
85 /* codec parameterization */
86 struct alc_customize_define cdefine
;
87 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
90 unsigned int gpio_mask
;
91 unsigned int gpio_dir
;
92 unsigned int gpio_data
;
93 bool gpio_write_delay
; /* add a delay before writing gpio_data */
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_mute_led_mask
;
101 unsigned int gpio_mic_led_mask
;
103 hda_nid_t headset_mic_pin
;
104 hda_nid_t headphone_mic_pin
;
105 int current_headset_mode
;
106 int current_headset_type
;
109 void (*init_hook
)(struct hda_codec
*codec
);
111 void (*power_hook
)(struct hda_codec
*codec
);
113 void (*shutup
)(struct hda_codec
*codec
);
114 void (*reboot_notify
)(struct hda_codec
*codec
);
117 int codec_variant
; /* flag for other variants */
118 unsigned int has_alc5505_dsp
:1;
119 unsigned int no_depop_delay
:1;
120 unsigned int done_hp_init
:1;
121 unsigned int no_shutup_pins
:1;
125 unsigned int pll_coef_idx
, pll_coef_bit
;
127 struct input_dev
*kb_dev
;
128 u8 alc_mute_keycode_map
[1];
132 * COEF access helper functions
135 static int alc_read_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
136 unsigned int coef_idx
)
140 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
141 val
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
145 #define alc_read_coef_idx(codec, coef_idx) \
146 alc_read_coefex_idx(codec, 0x20, coef_idx)
148 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
149 unsigned int coef_idx
, unsigned int coef_val
)
151 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
152 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
, coef_val
);
155 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
156 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
158 static void alc_update_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
159 unsigned int coef_idx
, unsigned int mask
,
160 unsigned int bits_set
)
162 unsigned int val
= alc_read_coefex_idx(codec
, nid
, coef_idx
);
165 alc_write_coefex_idx(codec
, nid
, coef_idx
,
166 (val
& ~mask
) | bits_set
);
169 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
170 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
172 /* a special bypass for COEF 0; read the cached value at the second time */
173 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
175 struct alc_spec
*spec
= codec
->spec
;
178 spec
->coef0
= alc_read_coef_idx(codec
, 0);
182 /* coef writes/updates batch */
190 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
191 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
192 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
193 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
194 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
196 static void alc_process_coef_fw(struct hda_codec
*codec
,
197 const struct coef_fw
*fw
)
199 for (; fw
->nid
; fw
++) {
200 if (fw
->mask
== (unsigned short)-1)
201 alc_write_coefex_idx(codec
, fw
->nid
, fw
->idx
, fw
->val
);
203 alc_update_coefex_idx(codec
, fw
->nid
, fw
->idx
,
209 * GPIO setup tables, used in initialization
212 /* Enable GPIO mask and set output */
213 static void alc_setup_gpio(struct hda_codec
*codec
, unsigned int mask
)
215 struct alc_spec
*spec
= codec
->spec
;
217 spec
->gpio_mask
|= mask
;
218 spec
->gpio_dir
|= mask
;
219 spec
->gpio_data
|= mask
;
222 static void alc_write_gpio_data(struct hda_codec
*codec
)
224 struct alc_spec
*spec
= codec
->spec
;
226 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
230 static void alc_update_gpio_data(struct hda_codec
*codec
, unsigned int mask
,
233 struct alc_spec
*spec
= codec
->spec
;
234 unsigned int oldval
= spec
->gpio_data
;
237 spec
->gpio_data
|= mask
;
239 spec
->gpio_data
&= ~mask
;
240 if (oldval
!= spec
->gpio_data
)
241 alc_write_gpio_data(codec
);
244 static void alc_write_gpio(struct hda_codec
*codec
)
246 struct alc_spec
*spec
= codec
->spec
;
248 if (!spec
->gpio_mask
)
251 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
252 AC_VERB_SET_GPIO_MASK
, spec
->gpio_mask
);
253 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
254 AC_VERB_SET_GPIO_DIRECTION
, spec
->gpio_dir
);
255 if (spec
->gpio_write_delay
)
257 alc_write_gpio_data(codec
);
260 static void alc_fixup_gpio(struct hda_codec
*codec
, int action
,
263 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
264 alc_setup_gpio(codec
, mask
);
267 static void alc_fixup_gpio1(struct hda_codec
*codec
,
268 const struct hda_fixup
*fix
, int action
)
270 alc_fixup_gpio(codec
, action
, 0x01);
273 static void alc_fixup_gpio2(struct hda_codec
*codec
,
274 const struct hda_fixup
*fix
, int action
)
276 alc_fixup_gpio(codec
, action
, 0x02);
279 static void alc_fixup_gpio3(struct hda_codec
*codec
,
280 const struct hda_fixup
*fix
, int action
)
282 alc_fixup_gpio(codec
, action
, 0x03);
285 static void alc_fixup_gpio4(struct hda_codec
*codec
,
286 const struct hda_fixup
*fix
, int action
)
288 alc_fixup_gpio(codec
, action
, 0x04);
292 * Fix hardware PLL issue
293 * On some codecs, the analog PLL gating control must be off while
294 * the default value is 1.
296 static void alc_fix_pll(struct hda_codec
*codec
)
298 struct alc_spec
*spec
= codec
->spec
;
301 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
302 1 << spec
->pll_coef_bit
, 0);
305 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
306 unsigned int coef_idx
, unsigned int coef_bit
)
308 struct alc_spec
*spec
= codec
->spec
;
310 spec
->pll_coef_idx
= coef_idx
;
311 spec
->pll_coef_bit
= coef_bit
;
315 /* update the master volume per volume-knob's unsol event */
316 static void alc_update_knob_master(struct hda_codec
*codec
,
317 struct hda_jack_callback
*jack
)
320 struct snd_kcontrol
*kctl
;
321 struct snd_ctl_elem_value
*uctl
;
323 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
326 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
329 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
330 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
331 val
&= HDA_AMP_VOLMASK
;
332 uctl
->value
.integer
.value
[0] = val
;
333 uctl
->value
.integer
.value
[1] = val
;
334 kctl
->put(kctl
, uctl
);
338 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
340 /* For some reason, the res given from ALC880 is broken.
341 Here we adjust it properly. */
342 snd_hda_jack_unsol_event(codec
, res
>> 2);
345 /* Change EAPD to verb control */
346 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
350 coef
= alc_get_coef0(codec
);
352 switch (codec
->core
.vendor_id
) {
354 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
358 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
361 if ((coef
& 0x00f0) == 0x0010)
362 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
363 if ((coef
& 0x00f0) == 0x0020)
364 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
365 if ((coef
& 0x00f0) == 0x0030)
366 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
372 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
377 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
394 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
397 alc_update_coef_idx(codec
, 0xe, 0, 1<<0);
400 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
408 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
411 if ((coef
& 0x00f0) == 0x0030)
412 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
421 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
424 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
427 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
430 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
431 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
434 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
440 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
445 /* additional initialization for ALC888 variants */
446 static void alc888_coef_init(struct hda_codec
*codec
)
448 switch (alc_get_coef0(codec
) & 0x00f0) {
453 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
458 /* turn on/off EAPD control (only if available) */
459 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
461 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
463 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
464 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
468 /* turn on/off EAPD controls of the codec */
469 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
471 /* We currently only handle front, HP */
472 static hda_nid_t pins
[] = {
473 0x0f, 0x10, 0x14, 0x15, 0x17, 0
476 for (p
= pins
; *p
; p
++)
477 set_eapd(codec
, *p
, on
);
480 static void alc_shutup_pins(struct hda_codec
*codec
)
482 struct alc_spec
*spec
= codec
->spec
;
484 if (!spec
->no_shutup_pins
)
485 snd_hda_shutup_pins(codec
);
488 /* generic shutup callback;
489 * just turning off EAPD and a little pause for avoiding pop-noise
491 static void alc_eapd_shutup(struct hda_codec
*codec
)
493 struct alc_spec
*spec
= codec
->spec
;
495 alc_auto_setup_eapd(codec
, false);
496 if (!spec
->no_depop_delay
)
498 alc_shutup_pins(codec
);
501 /* generic EAPD initialization */
502 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
504 alc_fill_eapd_coef(codec
);
505 alc_auto_setup_eapd(codec
, true);
506 alc_write_gpio(codec
);
508 case ALC_INIT_DEFAULT
:
509 switch (codec
->core
.vendor_id
) {
511 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
517 alc_update_coef_idx(codec
, 7, 0, 0x2030);
520 alc888_coef_init(codec
);
527 /* get a primary headphone pin if available */
528 static hda_nid_t
alc_get_hp_pin(struct alc_spec
*spec
)
530 if (spec
->gen
.autocfg
.hp_pins
[0])
531 return spec
->gen
.autocfg
.hp_pins
[0];
532 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
533 return spec
->gen
.autocfg
.line_out_pins
[0];
538 * Realtek SSID verification
541 /* Could be any non-zero and even value. When used as fixup, tells
542 * the driver to ignore any present sku defines.
544 #define ALC_FIXUP_SKU_IGNORE (2)
546 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
547 const struct hda_fixup
*fix
, int action
)
549 struct alc_spec
*spec
= codec
->spec
;
550 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
551 spec
->cdefine
.fixup
= 1;
552 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
556 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
557 const struct hda_fixup
*fix
, int action
)
559 struct alc_spec
*spec
= codec
->spec
;
561 if (action
== HDA_FIXUP_ACT_PROBE
) {
562 spec
->no_depop_delay
= 1;
563 codec
->depop_delay
= 0;
567 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
569 unsigned int ass
, tmp
, i
;
571 struct alc_spec
*spec
= codec
->spec
;
573 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
575 if (spec
->cdefine
.fixup
) {
576 ass
= spec
->cdefine
.sku_cfg
;
577 if (ass
== ALC_FIXUP_SKU_IGNORE
)
582 if (!codec
->bus
->pci
)
584 ass
= codec
->core
.subsystem_id
& 0xffff;
585 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
589 if (codec
->core
.vendor_id
== 0x10ec0260)
591 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
594 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
595 codec
->core
.chip_name
, ass
);
601 for (i
= 1; i
< 16; i
++) {
605 if (((ass
>> 16) & 0xf) != tmp
)
608 spec
->cdefine
.port_connectivity
= ass
>> 30;
609 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
610 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
611 spec
->cdefine
.customization
= ass
>> 8;
613 spec
->cdefine
.sku_cfg
= ass
;
614 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
615 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
616 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
617 spec
->cdefine
.override
= ass
& 0x1;
619 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
620 nid
, spec
->cdefine
.sku_cfg
);
621 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
622 spec
->cdefine
.port_connectivity
);
623 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
624 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
625 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
626 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
627 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
628 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
629 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
634 /* return the position of NID in the list, or -1 if not found */
635 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
638 for (i
= 0; i
< nums
; i
++)
643 /* return true if the given NID is found in the list */
644 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
646 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
649 /* check subsystem ID and set up device-specific initialization;
650 * return 1 if initialized, 0 if invalid SSID
652 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
653 * 31 ~ 16 : Manufacture ID
655 * 7 ~ 0 : Assembly ID
656 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
658 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
660 unsigned int ass
, tmp
, i
;
662 struct alc_spec
*spec
= codec
->spec
;
664 if (spec
->cdefine
.fixup
) {
665 ass
= spec
->cdefine
.sku_cfg
;
666 if (ass
== ALC_FIXUP_SKU_IGNORE
)
671 ass
= codec
->core
.subsystem_id
& 0xffff;
672 if (codec
->bus
->pci
&&
673 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
676 /* invalid SSID, check the special NID pin defcfg instead */
678 * 31~30 : port connectivity
681 * 19~16 : Check sum (15:1)
686 if (codec
->core
.vendor_id
== 0x10ec0260)
688 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
690 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
694 if ((ass
>> 30) != 1) /* no physical connection */
699 for (i
= 1; i
< 16; i
++) {
703 if (((ass
>> 16) & 0xf) != tmp
)
706 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
707 ass
& 0xffff, codec
->core
.vendor_id
);
711 * 2 : 0 --> Desktop, 1 --> Laptop
712 * 3~5 : External Amplifier control
715 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
716 if (spec
->init_amp
== ALC_INIT_UNDEFINED
) {
719 alc_setup_gpio(codec
, 0x01);
722 alc_setup_gpio(codec
, 0x02);
725 alc_setup_gpio(codec
, 0x03);
729 spec
->init_amp
= ALC_INIT_DEFAULT
;
734 /* is laptop or Desktop and enable the function "Mute internal speaker
735 * when the external headphone out jack is plugged"
740 * 10~8 : Jack location
741 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
743 * 15 : 1 --> enable the function "Mute internal speaker
744 * when the external headphone out jack is plugged"
746 if (!alc_get_hp_pin(spec
)) {
748 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
750 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
751 spec
->gen
.autocfg
.line_outs
))
753 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
758 /* Check the validity of ALC subsystem-id
759 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
760 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
762 if (!alc_subsystem_id(codec
, ports
)) {
763 struct alc_spec
*spec
= codec
->spec
;
765 "realtek: Enable default setup for auto mode as fallback\n");
766 spec
->init_amp
= ALC_INIT_DEFAULT
;
773 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
774 const struct hda_fixup
*fix
, int action
)
776 struct alc_spec
*spec
= codec
->spec
;
778 spec
->gen
.inv_dmic_split
= 1;
782 static int alc_build_controls(struct hda_codec
*codec
)
786 err
= snd_hda_gen_build_controls(codec
);
790 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
799 static int alc_init(struct hda_codec
*codec
)
801 struct alc_spec
*spec
= codec
->spec
;
804 spec
->init_hook(codec
);
807 alc_auto_init_amp(codec
, spec
->init_amp
);
809 snd_hda_gen_init(codec
);
811 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
816 static inline void alc_shutup(struct hda_codec
*codec
)
818 struct alc_spec
*spec
= codec
->spec
;
820 if (!snd_hda_get_bool_hint(codec
, "shutup"))
821 return; /* disabled explicitly by hints */
823 if (spec
&& spec
->shutup
)
826 alc_shutup_pins(codec
);
829 static void alc_reboot_notify(struct hda_codec
*codec
)
831 struct alc_spec
*spec
= codec
->spec
;
833 if (spec
&& spec
->reboot_notify
)
834 spec
->reboot_notify(codec
);
839 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
840 static void alc_d3_at_reboot(struct hda_codec
*codec
)
842 snd_hda_codec_set_power_to_all(codec
, codec
->core
.afg
, AC_PWRST_D3
);
843 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
844 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
848 #define alc_free snd_hda_gen_free
851 static void alc_power_eapd(struct hda_codec
*codec
)
853 alc_auto_setup_eapd(codec
, false);
856 static int alc_suspend(struct hda_codec
*codec
)
858 struct alc_spec
*spec
= codec
->spec
;
860 if (spec
&& spec
->power_hook
)
861 spec
->power_hook(codec
);
867 static int alc_resume(struct hda_codec
*codec
)
869 struct alc_spec
*spec
= codec
->spec
;
871 if (!spec
->no_depop_delay
)
872 msleep(150); /* to avoid pop noise */
873 codec
->patch_ops
.init(codec
);
874 regcache_sync(codec
->core
.regmap
);
875 hda_call_check_power_status(codec
, 0x01);
882 static const struct hda_codec_ops alc_patch_ops
= {
883 .build_controls
= alc_build_controls
,
884 .build_pcms
= snd_hda_gen_build_pcms
,
887 .unsol_event
= snd_hda_jack_unsol_event
,
889 .resume
= alc_resume
,
890 .suspend
= alc_suspend
,
891 .check_power_status
= snd_hda_gen_check_power_status
,
893 .reboot_notify
= alc_reboot_notify
,
897 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
900 * Rename codecs appropriately from COEF value or subvendor id
902 struct alc_codec_rename_table
{
903 unsigned int vendor_id
;
904 unsigned short coef_mask
;
905 unsigned short coef_bits
;
909 struct alc_codec_rename_pci_table
{
910 unsigned int codec_vendor_id
;
911 unsigned short pci_subvendor
;
912 unsigned short pci_subdevice
;
916 static struct alc_codec_rename_table rename_tbl
[] = {
917 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
918 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
919 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
920 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
921 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
922 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
923 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
924 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
925 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
926 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
927 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
928 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
929 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
930 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
931 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
932 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
933 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
937 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
938 { 0x10ec0280, 0x1028, 0, "ALC3220" },
939 { 0x10ec0282, 0x1028, 0, "ALC3221" },
940 { 0x10ec0283, 0x1028, 0, "ALC3223" },
941 { 0x10ec0288, 0x1028, 0, "ALC3263" },
942 { 0x10ec0292, 0x1028, 0, "ALC3226" },
943 { 0x10ec0293, 0x1028, 0, "ALC3235" },
944 { 0x10ec0255, 0x1028, 0, "ALC3234" },
945 { 0x10ec0668, 0x1028, 0, "ALC3661" },
946 { 0x10ec0275, 0x1028, 0, "ALC3260" },
947 { 0x10ec0899, 0x1028, 0, "ALC3861" },
948 { 0x10ec0298, 0x1028, 0, "ALC3266" },
949 { 0x10ec0236, 0x1028, 0, "ALC3204" },
950 { 0x10ec0256, 0x1028, 0, "ALC3246" },
951 { 0x10ec0225, 0x1028, 0, "ALC3253" },
952 { 0x10ec0295, 0x1028, 0, "ALC3254" },
953 { 0x10ec0299, 0x1028, 0, "ALC3271" },
954 { 0x10ec0670, 0x1025, 0, "ALC669X" },
955 { 0x10ec0676, 0x1025, 0, "ALC679X" },
956 { 0x10ec0282, 0x1043, 0, "ALC3229" },
957 { 0x10ec0233, 0x1043, 0, "ALC3236" },
958 { 0x10ec0280, 0x103c, 0, "ALC3228" },
959 { 0x10ec0282, 0x103c, 0, "ALC3227" },
960 { 0x10ec0286, 0x103c, 0, "ALC3242" },
961 { 0x10ec0290, 0x103c, 0, "ALC3241" },
962 { 0x10ec0668, 0x103c, 0, "ALC3662" },
963 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
964 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
968 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
970 const struct alc_codec_rename_table
*p
;
971 const struct alc_codec_rename_pci_table
*q
;
973 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
974 if (p
->vendor_id
!= codec
->core
.vendor_id
)
976 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
977 return alc_codec_rename(codec
, p
->name
);
980 if (!codec
->bus
->pci
)
982 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
983 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
985 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
987 if (!q
->pci_subdevice
||
988 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
989 return alc_codec_rename(codec
, q
->name
);
997 * Digital-beep handlers
999 #ifdef CONFIG_SND_HDA_INPUT_BEEP
1001 /* additional beep mixers; private_value will be overwritten */
1002 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
1003 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
1004 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
1007 /* set up and create beep controls */
1008 static int set_beep_amp(struct alc_spec
*spec
, hda_nid_t nid
,
1011 struct snd_kcontrol_new
*knew
;
1012 unsigned int beep_amp
= HDA_COMPOSE_AMP_VAL(nid
, 3, idx
, dir
);
1015 for (i
= 0; i
< ARRAY_SIZE(alc_beep_mixer
); i
++) {
1016 knew
= snd_hda_gen_add_kctl(&spec
->gen
, NULL
,
1017 &alc_beep_mixer
[i
]);
1020 knew
->private_value
= beep_amp
;
1025 static const struct snd_pci_quirk beep_white_list
[] = {
1026 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1027 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
1028 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1029 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
1030 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1031 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1032 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
1033 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
1034 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
1038 static inline int has_cdefine_beep(struct hda_codec
*codec
)
1040 struct alc_spec
*spec
= codec
->spec
;
1041 const struct snd_pci_quirk
*q
;
1042 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
1045 return spec
->cdefine
.enable_pcbeep
;
1048 #define set_beep_amp(spec, nid, idx, dir) 0
1049 #define has_cdefine_beep(codec) 0
1052 /* parse the BIOS configuration and set up the alc_spec */
1053 /* return 1 if successful, 0 if the proper config is not found,
1054 * or a negative error code
1056 static int alc_parse_auto_config(struct hda_codec
*codec
,
1057 const hda_nid_t
*ignore_nids
,
1058 const hda_nid_t
*ssid_nids
)
1060 struct alc_spec
*spec
= codec
->spec
;
1061 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1064 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1070 alc_ssid_check(codec
, ssid_nids
);
1072 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1079 /* common preparation job for alc_spec */
1080 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1082 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1088 snd_hda_gen_spec_init(&spec
->gen
);
1089 spec
->gen
.mixer_nid
= mixer_nid
;
1090 spec
->gen
.own_eapd_ctl
= 1;
1091 codec
->single_adc_amp
= 1;
1092 /* FIXME: do we need this for all Realtek codec models? */
1093 codec
->spdif_status_reset
= 1;
1094 codec
->patch_ops
= alc_patch_ops
;
1096 err
= alc_codec_rename_from_preset(codec
);
1104 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1106 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1107 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1108 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1117 ALC880_FIXUP_MEDION_RIM
,
1119 ALC880_FIXUP_LG_LW25
,
1121 ALC880_FIXUP_EAPD_COEF
,
1122 ALC880_FIXUP_TCL_S700
,
1123 ALC880_FIXUP_VOL_KNOB
,
1124 ALC880_FIXUP_FUJITSU
,
1126 ALC880_FIXUP_UNIWILL
,
1127 ALC880_FIXUP_UNIWILL_DIG
,
1129 ALC880_FIXUP_ASUS_W5A
,
1130 ALC880_FIXUP_3ST_BASE
,
1132 ALC880_FIXUP_3ST_DIG
,
1133 ALC880_FIXUP_5ST_BASE
,
1135 ALC880_FIXUP_5ST_DIG
,
1136 ALC880_FIXUP_6ST_BASE
,
1138 ALC880_FIXUP_6ST_DIG
,
1139 ALC880_FIXUP_6ST_AUTOMUTE
,
1142 /* enable the volume-knob widget support on NID 0x21 */
1143 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1144 const struct hda_fixup
*fix
, int action
)
1146 if (action
== HDA_FIXUP_ACT_PROBE
)
1147 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1148 alc_update_knob_master
);
1151 static const struct hda_fixup alc880_fixups
[] = {
1152 [ALC880_FIXUP_GPIO1
] = {
1153 .type
= HDA_FIXUP_FUNC
,
1154 .v
.func
= alc_fixup_gpio1
,
1156 [ALC880_FIXUP_GPIO2
] = {
1157 .type
= HDA_FIXUP_FUNC
,
1158 .v
.func
= alc_fixup_gpio2
,
1160 [ALC880_FIXUP_MEDION_RIM
] = {
1161 .type
= HDA_FIXUP_VERBS
,
1162 .v
.verbs
= (const struct hda_verb
[]) {
1163 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1164 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1168 .chain_id
= ALC880_FIXUP_GPIO2
,
1170 [ALC880_FIXUP_LG
] = {
1171 .type
= HDA_FIXUP_PINS
,
1172 .v
.pins
= (const struct hda_pintbl
[]) {
1173 /* disable bogus unused pins */
1174 { 0x16, 0x411111f0 },
1175 { 0x18, 0x411111f0 },
1176 { 0x1a, 0x411111f0 },
1180 [ALC880_FIXUP_LG_LW25
] = {
1181 .type
= HDA_FIXUP_PINS
,
1182 .v
.pins
= (const struct hda_pintbl
[]) {
1183 { 0x1a, 0x0181344f }, /* line-in */
1184 { 0x1b, 0x0321403f }, /* headphone */
1188 [ALC880_FIXUP_W810
] = {
1189 .type
= HDA_FIXUP_PINS
,
1190 .v
.pins
= (const struct hda_pintbl
[]) {
1191 /* disable bogus unused pins */
1192 { 0x17, 0x411111f0 },
1196 .chain_id
= ALC880_FIXUP_GPIO2
,
1198 [ALC880_FIXUP_EAPD_COEF
] = {
1199 .type
= HDA_FIXUP_VERBS
,
1200 .v
.verbs
= (const struct hda_verb
[]) {
1201 /* change to EAPD mode */
1202 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1203 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1207 [ALC880_FIXUP_TCL_S700
] = {
1208 .type
= HDA_FIXUP_VERBS
,
1209 .v
.verbs
= (const struct hda_verb
[]) {
1210 /* change to EAPD mode */
1211 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1212 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1216 .chain_id
= ALC880_FIXUP_GPIO2
,
1218 [ALC880_FIXUP_VOL_KNOB
] = {
1219 .type
= HDA_FIXUP_FUNC
,
1220 .v
.func
= alc880_fixup_vol_knob
,
1222 [ALC880_FIXUP_FUJITSU
] = {
1223 /* override all pins as BIOS on old Amilo is broken */
1224 .type
= HDA_FIXUP_PINS
,
1225 .v
.pins
= (const struct hda_pintbl
[]) {
1226 { 0x14, 0x0121401f }, /* HP */
1227 { 0x15, 0x99030120 }, /* speaker */
1228 { 0x16, 0x99030130 }, /* bass speaker */
1229 { 0x17, 0x411111f0 }, /* N/A */
1230 { 0x18, 0x411111f0 }, /* N/A */
1231 { 0x19, 0x01a19950 }, /* mic-in */
1232 { 0x1a, 0x411111f0 }, /* N/A */
1233 { 0x1b, 0x411111f0 }, /* N/A */
1234 { 0x1c, 0x411111f0 }, /* N/A */
1235 { 0x1d, 0x411111f0 }, /* N/A */
1236 { 0x1e, 0x01454140 }, /* SPDIF out */
1240 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1242 [ALC880_FIXUP_F1734
] = {
1243 /* almost compatible with FUJITSU, but no bass and SPDIF */
1244 .type
= HDA_FIXUP_PINS
,
1245 .v
.pins
= (const struct hda_pintbl
[]) {
1246 { 0x14, 0x0121401f }, /* HP */
1247 { 0x15, 0x99030120 }, /* speaker */
1248 { 0x16, 0x411111f0 }, /* N/A */
1249 { 0x17, 0x411111f0 }, /* N/A */
1250 { 0x18, 0x411111f0 }, /* N/A */
1251 { 0x19, 0x01a19950 }, /* mic-in */
1252 { 0x1a, 0x411111f0 }, /* N/A */
1253 { 0x1b, 0x411111f0 }, /* N/A */
1254 { 0x1c, 0x411111f0 }, /* N/A */
1255 { 0x1d, 0x411111f0 }, /* N/A */
1256 { 0x1e, 0x411111f0 }, /* N/A */
1260 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1262 [ALC880_FIXUP_UNIWILL
] = {
1263 /* need to fix HP and speaker pins to be parsed correctly */
1264 .type
= HDA_FIXUP_PINS
,
1265 .v
.pins
= (const struct hda_pintbl
[]) {
1266 { 0x14, 0x0121411f }, /* HP */
1267 { 0x15, 0x99030120 }, /* speaker */
1268 { 0x16, 0x99030130 }, /* bass speaker */
1272 [ALC880_FIXUP_UNIWILL_DIG
] = {
1273 .type
= HDA_FIXUP_PINS
,
1274 .v
.pins
= (const struct hda_pintbl
[]) {
1275 /* disable bogus unused pins */
1276 { 0x17, 0x411111f0 },
1277 { 0x19, 0x411111f0 },
1278 { 0x1b, 0x411111f0 },
1279 { 0x1f, 0x411111f0 },
1283 [ALC880_FIXUP_Z71V
] = {
1284 .type
= HDA_FIXUP_PINS
,
1285 .v
.pins
= (const struct hda_pintbl
[]) {
1286 /* set up the whole pins as BIOS is utterly broken */
1287 { 0x14, 0x99030120 }, /* speaker */
1288 { 0x15, 0x0121411f }, /* HP */
1289 { 0x16, 0x411111f0 }, /* N/A */
1290 { 0x17, 0x411111f0 }, /* N/A */
1291 { 0x18, 0x01a19950 }, /* mic-in */
1292 { 0x19, 0x411111f0 }, /* N/A */
1293 { 0x1a, 0x01813031 }, /* line-in */
1294 { 0x1b, 0x411111f0 }, /* N/A */
1295 { 0x1c, 0x411111f0 }, /* N/A */
1296 { 0x1d, 0x411111f0 }, /* N/A */
1297 { 0x1e, 0x0144111e }, /* SPDIF */
1301 [ALC880_FIXUP_ASUS_W5A
] = {
1302 .type
= HDA_FIXUP_PINS
,
1303 .v
.pins
= (const struct hda_pintbl
[]) {
1304 /* set up the whole pins as BIOS is utterly broken */
1305 { 0x14, 0x0121411f }, /* HP */
1306 { 0x15, 0x411111f0 }, /* N/A */
1307 { 0x16, 0x411111f0 }, /* N/A */
1308 { 0x17, 0x411111f0 }, /* N/A */
1309 { 0x18, 0x90a60160 }, /* mic */
1310 { 0x19, 0x411111f0 }, /* N/A */
1311 { 0x1a, 0x411111f0 }, /* N/A */
1312 { 0x1b, 0x411111f0 }, /* N/A */
1313 { 0x1c, 0x411111f0 }, /* N/A */
1314 { 0x1d, 0x411111f0 }, /* N/A */
1315 { 0x1e, 0xb743111e }, /* SPDIF out */
1319 .chain_id
= ALC880_FIXUP_GPIO1
,
1321 [ALC880_FIXUP_3ST_BASE
] = {
1322 .type
= HDA_FIXUP_PINS
,
1323 .v
.pins
= (const struct hda_pintbl
[]) {
1324 { 0x14, 0x01014010 }, /* line-out */
1325 { 0x15, 0x411111f0 }, /* N/A */
1326 { 0x16, 0x411111f0 }, /* N/A */
1327 { 0x17, 0x411111f0 }, /* N/A */
1328 { 0x18, 0x01a19c30 }, /* mic-in */
1329 { 0x19, 0x0121411f }, /* HP */
1330 { 0x1a, 0x01813031 }, /* line-in */
1331 { 0x1b, 0x02a19c40 }, /* front-mic */
1332 { 0x1c, 0x411111f0 }, /* N/A */
1333 { 0x1d, 0x411111f0 }, /* N/A */
1334 /* 0x1e is filled in below */
1335 { 0x1f, 0x411111f0 }, /* N/A */
1339 [ALC880_FIXUP_3ST
] = {
1340 .type
= HDA_FIXUP_PINS
,
1341 .v
.pins
= (const struct hda_pintbl
[]) {
1342 { 0x1e, 0x411111f0 }, /* N/A */
1346 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1348 [ALC880_FIXUP_3ST_DIG
] = {
1349 .type
= HDA_FIXUP_PINS
,
1350 .v
.pins
= (const struct hda_pintbl
[]) {
1351 { 0x1e, 0x0144111e }, /* SPDIF */
1355 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1357 [ALC880_FIXUP_5ST_BASE
] = {
1358 .type
= HDA_FIXUP_PINS
,
1359 .v
.pins
= (const struct hda_pintbl
[]) {
1360 { 0x14, 0x01014010 }, /* front */
1361 { 0x15, 0x411111f0 }, /* N/A */
1362 { 0x16, 0x01011411 }, /* CLFE */
1363 { 0x17, 0x01016412 }, /* surr */
1364 { 0x18, 0x01a19c30 }, /* mic-in */
1365 { 0x19, 0x0121411f }, /* HP */
1366 { 0x1a, 0x01813031 }, /* line-in */
1367 { 0x1b, 0x02a19c40 }, /* front-mic */
1368 { 0x1c, 0x411111f0 }, /* N/A */
1369 { 0x1d, 0x411111f0 }, /* N/A */
1370 /* 0x1e is filled in below */
1371 { 0x1f, 0x411111f0 }, /* N/A */
1375 [ALC880_FIXUP_5ST
] = {
1376 .type
= HDA_FIXUP_PINS
,
1377 .v
.pins
= (const struct hda_pintbl
[]) {
1378 { 0x1e, 0x411111f0 }, /* N/A */
1382 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1384 [ALC880_FIXUP_5ST_DIG
] = {
1385 .type
= HDA_FIXUP_PINS
,
1386 .v
.pins
= (const struct hda_pintbl
[]) {
1387 { 0x1e, 0x0144111e }, /* SPDIF */
1391 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1393 [ALC880_FIXUP_6ST_BASE
] = {
1394 .type
= HDA_FIXUP_PINS
,
1395 .v
.pins
= (const struct hda_pintbl
[]) {
1396 { 0x14, 0x01014010 }, /* front */
1397 { 0x15, 0x01016412 }, /* surr */
1398 { 0x16, 0x01011411 }, /* CLFE */
1399 { 0x17, 0x01012414 }, /* side */
1400 { 0x18, 0x01a19c30 }, /* mic-in */
1401 { 0x19, 0x02a19c40 }, /* front-mic */
1402 { 0x1a, 0x01813031 }, /* line-in */
1403 { 0x1b, 0x0121411f }, /* HP */
1404 { 0x1c, 0x411111f0 }, /* N/A */
1405 { 0x1d, 0x411111f0 }, /* N/A */
1406 /* 0x1e is filled in below */
1407 { 0x1f, 0x411111f0 }, /* N/A */
1411 [ALC880_FIXUP_6ST
] = {
1412 .type
= HDA_FIXUP_PINS
,
1413 .v
.pins
= (const struct hda_pintbl
[]) {
1414 { 0x1e, 0x411111f0 }, /* N/A */
1418 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1420 [ALC880_FIXUP_6ST_DIG
] = {
1421 .type
= HDA_FIXUP_PINS
,
1422 .v
.pins
= (const struct hda_pintbl
[]) {
1423 { 0x1e, 0x0144111e }, /* SPDIF */
1427 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1429 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1430 .type
= HDA_FIXUP_PINS
,
1431 .v
.pins
= (const struct hda_pintbl
[]) {
1432 { 0x1b, 0x0121401f }, /* HP with jack detect */
1435 .chained_before
= true,
1436 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1440 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1441 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1442 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1443 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1444 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1445 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1446 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1447 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1448 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1449 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1450 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1451 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1452 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1453 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1454 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1455 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1456 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1457 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1458 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1459 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1460 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1461 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1462 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1463 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1465 /* Below is the copied entries from alc880_quirks.c.
1466 * It's not quite sure whether BIOS sets the correct pin-config table
1467 * on these machines, thus they are kept to be compatible with
1468 * the old static quirks. Once when it's confirmed to work without
1469 * these overrides, it'd be better to remove.
1471 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1472 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1473 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1474 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1475 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1476 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1477 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1478 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1479 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1480 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1481 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1482 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1483 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1484 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1485 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1486 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1487 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1488 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1489 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1490 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1491 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1492 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1493 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1494 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1495 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1496 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1497 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1498 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1499 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1500 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1501 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1502 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1503 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1505 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1506 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1507 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1511 static const struct hda_model_fixup alc880_fixup_models
[] = {
1512 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1513 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1514 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1515 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1516 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1517 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1518 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1524 * OK, here we have finally the patch for ALC880
1526 static int patch_alc880(struct hda_codec
*codec
)
1528 struct alc_spec
*spec
;
1531 err
= alc_alloc_spec(codec
, 0x0b);
1536 spec
->gen
.need_dac_fix
= 1;
1537 spec
->gen
.beep_nid
= 0x01;
1539 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1541 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1543 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1545 /* automatic parse from the BIOS config */
1546 err
= alc880_parse_auto_config(codec
);
1550 if (!spec
->gen
.no_analog
) {
1551 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1556 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1569 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1571 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1572 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1573 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1580 ALC260_FIXUP_HP_DC5750
,
1581 ALC260_FIXUP_HP_PIN_0F
,
1584 ALC260_FIXUP_GPIO1_TOGGLE
,
1585 ALC260_FIXUP_REPLACER
,
1586 ALC260_FIXUP_HP_B1900
,
1588 ALC260_FIXUP_FSC_S7020
,
1589 ALC260_FIXUP_FSC_S7020_JWSE
,
1590 ALC260_FIXUP_VAIO_PINS
,
1593 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1595 struct alc_spec
*spec
= codec
->spec
;
1597 alc_update_gpio_data(codec
, 0x01, spec
->gen
.hp_jack_present
);
1600 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1601 const struct hda_fixup
*fix
, int action
)
1603 struct alc_spec
*spec
= codec
->spec
;
1604 if (action
== HDA_FIXUP_ACT_PROBE
) {
1605 /* although the machine has only one output pin, we need to
1606 * toggle GPIO1 according to the jack state
1608 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1609 spec
->gen
.detect_hp
= 1;
1610 spec
->gen
.automute_speaker
= 1;
1611 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1612 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1613 snd_hda_gen_hp_automute
);
1614 alc_setup_gpio(codec
, 0x01);
1618 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1619 const struct hda_fixup
*fix
, int action
)
1621 struct alc_spec
*spec
= codec
->spec
;
1622 static const struct hda_pintbl pincfgs
[] = {
1623 { 0x0f, 0x02214000 }, /* HP/speaker */
1624 { 0x12, 0x90a60160 }, /* int mic */
1625 { 0x13, 0x02a19000 }, /* ext mic */
1626 { 0x18, 0x01446000 }, /* SPDIF out */
1627 /* disable bogus I/O pins */
1628 { 0x10, 0x411111f0 },
1629 { 0x11, 0x411111f0 },
1630 { 0x14, 0x411111f0 },
1631 { 0x15, 0x411111f0 },
1632 { 0x16, 0x411111f0 },
1633 { 0x17, 0x411111f0 },
1634 { 0x19, 0x411111f0 },
1639 case HDA_FIXUP_ACT_PRE_PROBE
:
1640 snd_hda_apply_pincfgs(codec
, pincfgs
);
1641 spec
->init_amp
= ALC_INIT_NONE
;
1646 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1647 const struct hda_fixup
*fix
, int action
)
1649 struct alc_spec
*spec
= codec
->spec
;
1650 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
1651 spec
->init_amp
= ALC_INIT_NONE
;
1654 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1655 const struct hda_fixup
*fix
, int action
)
1657 struct alc_spec
*spec
= codec
->spec
;
1658 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1659 spec
->gen
.add_jack_modes
= 1;
1660 spec
->gen
.hp_mic
= 1;
1664 static const struct hda_fixup alc260_fixups
[] = {
1665 [ALC260_FIXUP_HP_DC5750
] = {
1666 .type
= HDA_FIXUP_PINS
,
1667 .v
.pins
= (const struct hda_pintbl
[]) {
1668 { 0x11, 0x90130110 }, /* speaker */
1672 [ALC260_FIXUP_HP_PIN_0F
] = {
1673 .type
= HDA_FIXUP_PINS
,
1674 .v
.pins
= (const struct hda_pintbl
[]) {
1675 { 0x0f, 0x01214000 }, /* HP */
1679 [ALC260_FIXUP_COEF
] = {
1680 .type
= HDA_FIXUP_VERBS
,
1681 .v
.verbs
= (const struct hda_verb
[]) {
1682 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1683 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1687 [ALC260_FIXUP_GPIO1
] = {
1688 .type
= HDA_FIXUP_FUNC
,
1689 .v
.func
= alc_fixup_gpio1
,
1691 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1692 .type
= HDA_FIXUP_FUNC
,
1693 .v
.func
= alc260_fixup_gpio1_toggle
,
1695 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1697 [ALC260_FIXUP_REPLACER
] = {
1698 .type
= HDA_FIXUP_VERBS
,
1699 .v
.verbs
= (const struct hda_verb
[]) {
1700 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1701 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1705 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1707 [ALC260_FIXUP_HP_B1900
] = {
1708 .type
= HDA_FIXUP_FUNC
,
1709 .v
.func
= alc260_fixup_gpio1_toggle
,
1711 .chain_id
= ALC260_FIXUP_COEF
,
1713 [ALC260_FIXUP_KN1
] = {
1714 .type
= HDA_FIXUP_FUNC
,
1715 .v
.func
= alc260_fixup_kn1
,
1717 [ALC260_FIXUP_FSC_S7020
] = {
1718 .type
= HDA_FIXUP_FUNC
,
1719 .v
.func
= alc260_fixup_fsc_s7020
,
1721 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1722 .type
= HDA_FIXUP_FUNC
,
1723 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1725 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1727 [ALC260_FIXUP_VAIO_PINS
] = {
1728 .type
= HDA_FIXUP_PINS
,
1729 .v
.pins
= (const struct hda_pintbl
[]) {
1730 /* Pin configs are missing completely on some VAIOs */
1731 { 0x0f, 0x01211020 },
1732 { 0x10, 0x0001003f },
1733 { 0x11, 0x411111f0 },
1734 { 0x12, 0x01a15930 },
1735 { 0x13, 0x411111f0 },
1736 { 0x14, 0x411111f0 },
1737 { 0x15, 0x411111f0 },
1738 { 0x16, 0x411111f0 },
1739 { 0x17, 0x411111f0 },
1740 { 0x18, 0x411111f0 },
1741 { 0x19, 0x411111f0 },
1747 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1748 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1749 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1750 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1751 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1752 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1753 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1754 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1755 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1756 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1757 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1758 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1759 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1763 static const struct hda_model_fixup alc260_fixup_models
[] = {
1764 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1765 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1766 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1767 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1773 static int patch_alc260(struct hda_codec
*codec
)
1775 struct alc_spec
*spec
;
1778 err
= alc_alloc_spec(codec
, 0x07);
1783 /* as quite a few machines require HP amp for speaker outputs,
1784 * it's easier to enable it unconditionally; even if it's unneeded,
1785 * it's almost harmless.
1787 spec
->gen
.prefer_hp_amp
= 1;
1788 spec
->gen
.beep_nid
= 0x01;
1790 spec
->shutup
= alc_eapd_shutup
;
1792 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1794 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1796 /* automatic parse from the BIOS config */
1797 err
= alc260_parse_auto_config(codec
);
1801 if (!spec
->gen
.no_analog
) {
1802 err
= set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1807 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1818 * ALC882/883/885/888/889 support
1820 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1821 * configuration. Each pin widget can choose any input DACs and a mixer.
1822 * Each ADC is connected from a mixer of all inputs. This makes possible
1823 * 6-channel independent captures.
1825 * In addition, an independent DAC for the multi-playback (not used in this
1833 ALC882_FIXUP_ABIT_AW9D_MAX
,
1834 ALC882_FIXUP_LENOVO_Y530
,
1835 ALC882_FIXUP_PB_M5210
,
1836 ALC882_FIXUP_ACER_ASPIRE_7736
,
1837 ALC882_FIXUP_ASUS_W90V
,
1839 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1840 ALC889_FIXUP_VAIO_TT
,
1841 ALC888_FIXUP_EEE1601
,
1844 ALC883_FIXUP_ACER_EAPD
,
1849 ALC882_FIXUP_ASUS_W2JC
,
1850 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1851 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1852 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1853 ALC885_FIXUP_MACPRO_GPIO
,
1854 ALC889_FIXUP_DAC_ROUTE
,
1855 ALC889_FIXUP_MBP_VREF
,
1856 ALC889_FIXUP_IMAC91_VREF
,
1857 ALC889_FIXUP_MBA11_VREF
,
1858 ALC889_FIXUP_MBA21_VREF
,
1859 ALC889_FIXUP_MP11_VREF
,
1860 ALC889_FIXUP_MP41_VREF
,
1861 ALC882_FIXUP_INV_DMIC
,
1862 ALC882_FIXUP_NO_PRIMARY_HP
,
1863 ALC887_FIXUP_ASUS_BASS
,
1864 ALC887_FIXUP_BASS_CHMAP
,
1865 ALC1220_FIXUP_GB_DUAL_CODECS
,
1866 ALC1220_FIXUP_CLEVO_P950
,
1867 ALC1220_FIXUP_CLEVO_PB51ED
,
1868 ALC1220_FIXUP_CLEVO_PB51ED_PINS
,
1871 static void alc889_fixup_coef(struct hda_codec
*codec
,
1872 const struct hda_fixup
*fix
, int action
)
1874 if (action
!= HDA_FIXUP_ACT_INIT
)
1876 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1879 /* set up GPIO at initialization */
1880 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1881 const struct hda_fixup
*fix
, int action
)
1883 struct alc_spec
*spec
= codec
->spec
;
1885 spec
->gpio_write_delay
= true;
1886 alc_fixup_gpio3(codec
, fix
, action
);
1889 /* Fix the connection of some pins for ALC889:
1890 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1891 * work correctly (bko#42740)
1893 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1894 const struct hda_fixup
*fix
, int action
)
1896 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1897 /* fake the connections during parsing the tree */
1898 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1899 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1900 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1901 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1902 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1903 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1904 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1905 /* restore the connections */
1906 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1907 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1908 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1909 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1910 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1914 /* Set VREF on HP pin */
1915 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1916 const struct hda_fixup
*fix
, int action
)
1918 struct alc_spec
*spec
= codec
->spec
;
1919 static hda_nid_t nids
[3] = { 0x14, 0x15, 0x19 };
1922 if (action
!= HDA_FIXUP_ACT_INIT
)
1924 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1925 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1926 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1928 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1929 val
|= AC_PINCTL_VREF_80
;
1930 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1931 spec
->gen
.keep_vref_in_automute
= 1;
1936 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1937 const hda_nid_t
*nids
, int num_nids
)
1939 struct alc_spec
*spec
= codec
->spec
;
1942 for (i
= 0; i
< num_nids
; i
++) {
1944 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1945 val
|= AC_PINCTL_VREF_50
;
1946 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1948 spec
->gen
.keep_vref_in_automute
= 1;
1951 /* Set VREF on speaker pins on imac91 */
1952 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1953 const struct hda_fixup
*fix
, int action
)
1955 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1957 if (action
== HDA_FIXUP_ACT_INIT
)
1958 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1961 /* Set VREF on speaker pins on mba11 */
1962 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1963 const struct hda_fixup
*fix
, int action
)
1965 static hda_nid_t nids
[1] = { 0x18 };
1967 if (action
== HDA_FIXUP_ACT_INIT
)
1968 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1971 /* Set VREF on speaker pins on mba21 */
1972 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
1973 const struct hda_fixup
*fix
, int action
)
1975 static hda_nid_t nids
[2] = { 0x18, 0x19 };
1977 if (action
== HDA_FIXUP_ACT_INIT
)
1978 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1981 /* Don't take HP output as primary
1982 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1983 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
1985 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
1986 const struct hda_fixup
*fix
, int action
)
1988 struct alc_spec
*spec
= codec
->spec
;
1989 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1990 spec
->gen
.no_primary_hp
= 1;
1991 spec
->gen
.no_multi_io
= 1;
1995 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
1996 const struct hda_fixup
*fix
, int action
);
1998 /* For dual-codec configuration, we need to disable some features to avoid
1999 * conflicts of kctls and PCM streams
2001 static void alc_fixup_dual_codecs(struct hda_codec
*codec
,
2002 const struct hda_fixup
*fix
, int action
)
2004 struct alc_spec
*spec
= codec
->spec
;
2006 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2008 /* disable vmaster */
2009 spec
->gen
.suppress_vmaster
= 1;
2010 /* auto-mute and auto-mic switch don't work with multiple codecs */
2011 spec
->gen
.suppress_auto_mute
= 1;
2012 spec
->gen
.suppress_auto_mic
= 1;
2013 /* disable aamix as well */
2014 spec
->gen
.mixer_nid
= 0;
2015 /* add location prefix to avoid conflicts */
2016 codec
->force_pin_prefix
= 1;
2019 static void rename_ctl(struct hda_codec
*codec
, const char *oldname
,
2020 const char *newname
)
2022 struct snd_kcontrol
*kctl
;
2024 kctl
= snd_hda_find_mixer_ctl(codec
, oldname
);
2026 strcpy(kctl
->id
.name
, newname
);
2029 static void alc1220_fixup_gb_dual_codecs(struct hda_codec
*codec
,
2030 const struct hda_fixup
*fix
,
2033 alc_fixup_dual_codecs(codec
, fix
, action
);
2035 case HDA_FIXUP_ACT_PRE_PROBE
:
2036 /* override card longname to provide a unique UCM profile */
2037 strcpy(codec
->card
->longname
, "HDAudio-Gigabyte-ALC1220DualCodecs");
2039 case HDA_FIXUP_ACT_BUILD
:
2040 /* rename Capture controls depending on the codec */
2041 rename_ctl(codec
, "Capture Volume",
2043 "Rear-Panel Capture Volume" :
2044 "Front-Panel Capture Volume");
2045 rename_ctl(codec
, "Capture Switch",
2047 "Rear-Panel Capture Switch" :
2048 "Front-Panel Capture Switch");
2053 static void alc1220_fixup_clevo_p950(struct hda_codec
*codec
,
2054 const struct hda_fixup
*fix
,
2057 hda_nid_t conn1
[1] = { 0x0c };
2059 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
2062 alc_update_coef_idx(codec
, 0x7, 0, 0x3c3);
2063 /* We therefore want to make sure 0x14 (front headphone) and
2064 * 0x1b (speakers) use the stereo DAC 0x02
2066 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
2067 snd_hda_override_conn_list(codec
, 0x1b, 1, conn1
);
2070 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
2071 const struct hda_fixup
*fix
, int action
);
2073 static void alc1220_fixup_clevo_pb51ed(struct hda_codec
*codec
,
2074 const struct hda_fixup
*fix
,
2077 alc1220_fixup_clevo_p950(codec
, fix
, action
);
2078 alc_fixup_headset_mode_no_hp_mic(codec
, fix
, action
);
2081 static const struct hda_fixup alc882_fixups
[] = {
2082 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2083 .type
= HDA_FIXUP_PINS
,
2084 .v
.pins
= (const struct hda_pintbl
[]) {
2085 { 0x15, 0x01080104 }, /* side */
2086 { 0x16, 0x01011012 }, /* rear */
2087 { 0x17, 0x01016011 }, /* clfe */
2091 [ALC882_FIXUP_LENOVO_Y530
] = {
2092 .type
= HDA_FIXUP_PINS
,
2093 .v
.pins
= (const struct hda_pintbl
[]) {
2094 { 0x15, 0x99130112 }, /* rear int speakers */
2095 { 0x16, 0x99130111 }, /* subwoofer */
2099 [ALC882_FIXUP_PB_M5210
] = {
2100 .type
= HDA_FIXUP_PINCTLS
,
2101 .v
.pins
= (const struct hda_pintbl
[]) {
2102 { 0x19, PIN_VREF50
},
2106 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2107 .type
= HDA_FIXUP_FUNC
,
2108 .v
.func
= alc_fixup_sku_ignore
,
2110 [ALC882_FIXUP_ASUS_W90V
] = {
2111 .type
= HDA_FIXUP_PINS
,
2112 .v
.pins
= (const struct hda_pintbl
[]) {
2113 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2117 [ALC889_FIXUP_CD
] = {
2118 .type
= HDA_FIXUP_PINS
,
2119 .v
.pins
= (const struct hda_pintbl
[]) {
2120 { 0x1c, 0x993301f0 }, /* CD */
2124 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2125 .type
= HDA_FIXUP_PINS
,
2126 .v
.pins
= (const struct hda_pintbl
[]) {
2127 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2131 .chain_id
= ALC889_FIXUP_CD
,
2133 [ALC889_FIXUP_VAIO_TT
] = {
2134 .type
= HDA_FIXUP_PINS
,
2135 .v
.pins
= (const struct hda_pintbl
[]) {
2136 { 0x17, 0x90170111 }, /* hidden surround speaker */
2140 [ALC888_FIXUP_EEE1601
] = {
2141 .type
= HDA_FIXUP_VERBS
,
2142 .v
.verbs
= (const struct hda_verb
[]) {
2143 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2144 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2148 [ALC882_FIXUP_EAPD
] = {
2149 .type
= HDA_FIXUP_VERBS
,
2150 .v
.verbs
= (const struct hda_verb
[]) {
2151 /* change to EAPD mode */
2152 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2153 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2157 [ALC883_FIXUP_EAPD
] = {
2158 .type
= HDA_FIXUP_VERBS
,
2159 .v
.verbs
= (const struct hda_verb
[]) {
2160 /* change to EAPD mode */
2161 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2162 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2166 [ALC883_FIXUP_ACER_EAPD
] = {
2167 .type
= HDA_FIXUP_VERBS
,
2168 .v
.verbs
= (const struct hda_verb
[]) {
2169 /* eanable EAPD on Acer laptops */
2170 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2171 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2175 [ALC882_FIXUP_GPIO1
] = {
2176 .type
= HDA_FIXUP_FUNC
,
2177 .v
.func
= alc_fixup_gpio1
,
2179 [ALC882_FIXUP_GPIO2
] = {
2180 .type
= HDA_FIXUP_FUNC
,
2181 .v
.func
= alc_fixup_gpio2
,
2183 [ALC882_FIXUP_GPIO3
] = {
2184 .type
= HDA_FIXUP_FUNC
,
2185 .v
.func
= alc_fixup_gpio3
,
2187 [ALC882_FIXUP_ASUS_W2JC
] = {
2188 .type
= HDA_FIXUP_FUNC
,
2189 .v
.func
= alc_fixup_gpio1
,
2191 .chain_id
= ALC882_FIXUP_EAPD
,
2193 [ALC889_FIXUP_COEF
] = {
2194 .type
= HDA_FIXUP_FUNC
,
2195 .v
.func
= alc889_fixup_coef
,
2197 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2198 .type
= HDA_FIXUP_PINS
,
2199 .v
.pins
= (const struct hda_pintbl
[]) {
2200 { 0x16, 0x99130111 }, /* CLFE speaker */
2201 { 0x17, 0x99130112 }, /* surround speaker */
2205 .chain_id
= ALC882_FIXUP_GPIO1
,
2207 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2208 .type
= HDA_FIXUP_PINS
,
2209 .v
.pins
= (const struct hda_pintbl
[]) {
2210 { 0x16, 0x99130111 }, /* CLFE speaker */
2211 { 0x1b, 0x99130112 }, /* surround speaker */
2215 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2217 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2218 /* additional init verbs for Acer Aspire 8930G */
2219 .type
= HDA_FIXUP_VERBS
,
2220 .v
.verbs
= (const struct hda_verb
[]) {
2221 /* Enable all DACs */
2222 /* DAC DISABLE/MUTE 1? */
2223 /* setting bits 1-5 disables DAC nids 0x02-0x06
2224 * apparently. Init=0x38 */
2225 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2226 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2227 /* DAC DISABLE/MUTE 2? */
2228 /* some bit here disables the other DACs.
2230 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2231 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2233 * This laptop has a stereo digital microphone.
2234 * The mics are only 1cm apart which makes the stereo
2235 * useless. However, either the mic or the ALC889
2236 * makes the signal become a difference/sum signal
2237 * instead of standard stereo, which is annoying.
2238 * So instead we flip this bit which makes the
2239 * codec replicate the sum signal to both channels,
2240 * turning it into a normal mono mic.
2242 /* DMIC_CONTROL? Init value = 0x0001 */
2243 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2244 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2245 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2246 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2250 .chain_id
= ALC882_FIXUP_GPIO1
,
2252 [ALC885_FIXUP_MACPRO_GPIO
] = {
2253 .type
= HDA_FIXUP_FUNC
,
2254 .v
.func
= alc885_fixup_macpro_gpio
,
2256 [ALC889_FIXUP_DAC_ROUTE
] = {
2257 .type
= HDA_FIXUP_FUNC
,
2258 .v
.func
= alc889_fixup_dac_route
,
2260 [ALC889_FIXUP_MBP_VREF
] = {
2261 .type
= HDA_FIXUP_FUNC
,
2262 .v
.func
= alc889_fixup_mbp_vref
,
2264 .chain_id
= ALC882_FIXUP_GPIO1
,
2266 [ALC889_FIXUP_IMAC91_VREF
] = {
2267 .type
= HDA_FIXUP_FUNC
,
2268 .v
.func
= alc889_fixup_imac91_vref
,
2270 .chain_id
= ALC882_FIXUP_GPIO1
,
2272 [ALC889_FIXUP_MBA11_VREF
] = {
2273 .type
= HDA_FIXUP_FUNC
,
2274 .v
.func
= alc889_fixup_mba11_vref
,
2276 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2278 [ALC889_FIXUP_MBA21_VREF
] = {
2279 .type
= HDA_FIXUP_FUNC
,
2280 .v
.func
= alc889_fixup_mba21_vref
,
2282 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2284 [ALC889_FIXUP_MP11_VREF
] = {
2285 .type
= HDA_FIXUP_FUNC
,
2286 .v
.func
= alc889_fixup_mba11_vref
,
2288 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2290 [ALC889_FIXUP_MP41_VREF
] = {
2291 .type
= HDA_FIXUP_FUNC
,
2292 .v
.func
= alc889_fixup_mbp_vref
,
2294 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2296 [ALC882_FIXUP_INV_DMIC
] = {
2297 .type
= HDA_FIXUP_FUNC
,
2298 .v
.func
= alc_fixup_inv_dmic
,
2300 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2301 .type
= HDA_FIXUP_FUNC
,
2302 .v
.func
= alc882_fixup_no_primary_hp
,
2304 [ALC887_FIXUP_ASUS_BASS
] = {
2305 .type
= HDA_FIXUP_PINS
,
2306 .v
.pins
= (const struct hda_pintbl
[]) {
2307 {0x16, 0x99130130}, /* bass speaker */
2311 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2313 [ALC887_FIXUP_BASS_CHMAP
] = {
2314 .type
= HDA_FIXUP_FUNC
,
2315 .v
.func
= alc_fixup_bass_chmap
,
2317 [ALC1220_FIXUP_GB_DUAL_CODECS
] = {
2318 .type
= HDA_FIXUP_FUNC
,
2319 .v
.func
= alc1220_fixup_gb_dual_codecs
,
2321 [ALC1220_FIXUP_CLEVO_P950
] = {
2322 .type
= HDA_FIXUP_FUNC
,
2323 .v
.func
= alc1220_fixup_clevo_p950
,
2325 [ALC1220_FIXUP_CLEVO_PB51ED
] = {
2326 .type
= HDA_FIXUP_FUNC
,
2327 .v
.func
= alc1220_fixup_clevo_pb51ed
,
2329 [ALC1220_FIXUP_CLEVO_PB51ED_PINS
] = {
2330 .type
= HDA_FIXUP_PINS
,
2331 .v
.pins
= (const struct hda_pintbl
[]) {
2332 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
2336 .chain_id
= ALC1220_FIXUP_CLEVO_PB51ED
,
2340 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2341 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2342 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2343 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2344 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2345 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2346 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2347 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2348 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2349 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2350 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2351 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2352 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2353 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2354 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2355 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2356 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2357 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2358 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2359 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2360 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2361 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2362 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2363 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2364 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2365 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2366 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2367 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2368 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2369 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2370 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2371 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2372 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2373 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2374 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2375 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2376 SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP
),
2377 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2378 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2380 /* All Apple entries are in codec SSIDs */
2381 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2382 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2383 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2384 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2385 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2386 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2387 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2388 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2389 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2390 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2391 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2392 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2393 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2394 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2395 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2396 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2397 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2398 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2399 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2400 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2401 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2402 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2404 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2405 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2406 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2407 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2408 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2409 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2410 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2411 SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950
),
2412 SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950
),
2413 SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950
),
2414 SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2415 SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2416 SND_PCI_QUIRK(0x1558, 0x65d1, "Tuxedo Book XC1509", ALC1220_FIXUP_CLEVO_PB51ED_PINS
),
2417 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2418 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2419 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2420 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2424 static const struct hda_model_fixup alc882_fixup_models
[] = {
2425 {.id
= ALC882_FIXUP_ABIT_AW9D_MAX
, .name
= "abit-aw9d"},
2426 {.id
= ALC882_FIXUP_LENOVO_Y530
, .name
= "lenovo-y530"},
2427 {.id
= ALC882_FIXUP_ACER_ASPIRE_7736
, .name
= "acer-aspire-7736"},
2428 {.id
= ALC882_FIXUP_ASUS_W90V
, .name
= "asus-w90v"},
2429 {.id
= ALC889_FIXUP_CD
, .name
= "cd"},
2430 {.id
= ALC889_FIXUP_FRONT_HP_NO_PRESENCE
, .name
= "no-front-hp"},
2431 {.id
= ALC889_FIXUP_VAIO_TT
, .name
= "vaio-tt"},
2432 {.id
= ALC888_FIXUP_EEE1601
, .name
= "eee1601"},
2433 {.id
= ALC882_FIXUP_EAPD
, .name
= "alc882-eapd"},
2434 {.id
= ALC883_FIXUP_EAPD
, .name
= "alc883-eapd"},
2435 {.id
= ALC882_FIXUP_GPIO1
, .name
= "gpio1"},
2436 {.id
= ALC882_FIXUP_GPIO2
, .name
= "gpio2"},
2437 {.id
= ALC882_FIXUP_GPIO3
, .name
= "gpio3"},
2438 {.id
= ALC889_FIXUP_COEF
, .name
= "alc889-coef"},
2439 {.id
= ALC882_FIXUP_ASUS_W2JC
, .name
= "asus-w2jc"},
2440 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2441 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2442 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2443 {.id
= ALC885_FIXUP_MACPRO_GPIO
, .name
= "macpro-gpio"},
2444 {.id
= ALC889_FIXUP_DAC_ROUTE
, .name
= "dac-route"},
2445 {.id
= ALC889_FIXUP_MBP_VREF
, .name
= "mbp-vref"},
2446 {.id
= ALC889_FIXUP_IMAC91_VREF
, .name
= "imac91-vref"},
2447 {.id
= ALC889_FIXUP_MBA11_VREF
, .name
= "mba11-vref"},
2448 {.id
= ALC889_FIXUP_MBA21_VREF
, .name
= "mba21-vref"},
2449 {.id
= ALC889_FIXUP_MP11_VREF
, .name
= "mp11-vref"},
2450 {.id
= ALC889_FIXUP_MP41_VREF
, .name
= "mp41-vref"},
2451 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2452 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2453 {.id
= ALC887_FIXUP_ASUS_BASS
, .name
= "asus-bass"},
2454 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2455 {.id
= ALC1220_FIXUP_CLEVO_P950
, .name
= "clevo-p950"},
2460 * BIOS auto configuration
2462 /* almost identical with ALC880 parser... */
2463 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2465 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2466 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2467 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2472 static int patch_alc882(struct hda_codec
*codec
)
2474 struct alc_spec
*spec
;
2477 err
= alc_alloc_spec(codec
, 0x0b);
2483 switch (codec
->core
.vendor_id
) {
2490 /* ALC883 and variants */
2491 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2495 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2497 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2499 alc_auto_parse_customize_define(codec
);
2501 if (has_cdefine_beep(codec
))
2502 spec
->gen
.beep_nid
= 0x01;
2504 /* automatic parse from the BIOS config */
2505 err
= alc882_parse_auto_config(codec
);
2509 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
2510 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2515 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2528 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2530 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2531 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2532 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2539 ALC262_FIXUP_FSC_H270
,
2540 ALC262_FIXUP_FSC_S7110
,
2541 ALC262_FIXUP_HP_Z200
,
2543 ALC262_FIXUP_LENOVO_3000
,
2545 ALC262_FIXUP_BENQ_T31
,
2546 ALC262_FIXUP_INV_DMIC
,
2547 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2550 static const struct hda_fixup alc262_fixups
[] = {
2551 [ALC262_FIXUP_FSC_H270
] = {
2552 .type
= HDA_FIXUP_PINS
,
2553 .v
.pins
= (const struct hda_pintbl
[]) {
2554 { 0x14, 0x99130110 }, /* speaker */
2555 { 0x15, 0x0221142f }, /* front HP */
2556 { 0x1b, 0x0121141f }, /* rear HP */
2560 [ALC262_FIXUP_FSC_S7110
] = {
2561 .type
= HDA_FIXUP_PINS
,
2562 .v
.pins
= (const struct hda_pintbl
[]) {
2563 { 0x15, 0x90170110 }, /* speaker */
2567 .chain_id
= ALC262_FIXUP_BENQ
,
2569 [ALC262_FIXUP_HP_Z200
] = {
2570 .type
= HDA_FIXUP_PINS
,
2571 .v
.pins
= (const struct hda_pintbl
[]) {
2572 { 0x16, 0x99130120 }, /* internal speaker */
2576 [ALC262_FIXUP_TYAN
] = {
2577 .type
= HDA_FIXUP_PINS
,
2578 .v
.pins
= (const struct hda_pintbl
[]) {
2579 { 0x14, 0x1993e1f0 }, /* int AUX */
2583 [ALC262_FIXUP_LENOVO_3000
] = {
2584 .type
= HDA_FIXUP_PINCTLS
,
2585 .v
.pins
= (const struct hda_pintbl
[]) {
2586 { 0x19, PIN_VREF50
},
2590 .chain_id
= ALC262_FIXUP_BENQ
,
2592 [ALC262_FIXUP_BENQ
] = {
2593 .type
= HDA_FIXUP_VERBS
,
2594 .v
.verbs
= (const struct hda_verb
[]) {
2595 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2596 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2600 [ALC262_FIXUP_BENQ_T31
] = {
2601 .type
= HDA_FIXUP_VERBS
,
2602 .v
.verbs
= (const struct hda_verb
[]) {
2603 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2604 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2608 [ALC262_FIXUP_INV_DMIC
] = {
2609 .type
= HDA_FIXUP_FUNC
,
2610 .v
.func
= alc_fixup_inv_dmic
,
2612 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2613 .type
= HDA_FIXUP_FUNC
,
2614 .v
.func
= alc_fixup_no_depop_delay
,
2618 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2619 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2620 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2621 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2622 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2623 SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270
),
2624 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2625 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2626 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2627 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2628 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2632 static const struct hda_model_fixup alc262_fixup_models
[] = {
2633 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2634 {.id
= ALC262_FIXUP_FSC_H270
, .name
= "fsc-h270"},
2635 {.id
= ALC262_FIXUP_FSC_S7110
, .name
= "fsc-s7110"},
2636 {.id
= ALC262_FIXUP_HP_Z200
, .name
= "hp-z200"},
2637 {.id
= ALC262_FIXUP_TYAN
, .name
= "tyan"},
2638 {.id
= ALC262_FIXUP_LENOVO_3000
, .name
= "lenovo-3000"},
2639 {.id
= ALC262_FIXUP_BENQ
, .name
= "benq"},
2640 {.id
= ALC262_FIXUP_BENQ_T31
, .name
= "benq-t31"},
2641 {.id
= ALC262_FIXUP_INTEL_BAYLEYBAY
, .name
= "bayleybay"},
2647 static int patch_alc262(struct hda_codec
*codec
)
2649 struct alc_spec
*spec
;
2652 err
= alc_alloc_spec(codec
, 0x0b);
2657 spec
->gen
.shared_mic_vref_pin
= 0x18;
2659 spec
->shutup
= alc_eapd_shutup
;
2662 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2665 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2667 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2669 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2671 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2673 alc_auto_parse_customize_define(codec
);
2675 if (has_cdefine_beep(codec
))
2676 spec
->gen
.beep_nid
= 0x01;
2678 /* automatic parse from the BIOS config */
2679 err
= alc262_parse_auto_config(codec
);
2683 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
2684 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2689 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2701 /* bind Beep switches of both NID 0x0f and 0x10 */
2702 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2703 struct snd_ctl_elem_value
*ucontrol
)
2705 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2709 mutex_lock(&codec
->control_mutex
);
2710 pval
= kcontrol
->private_value
;
2711 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2712 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2714 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2715 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2717 kcontrol
->private_value
= pval
;
2718 mutex_unlock(&codec
->control_mutex
);
2722 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2723 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2725 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2726 .name
= "Beep Playback Switch",
2727 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2728 .info
= snd_hda_mixer_amp_switch_info
,
2729 .get
= snd_hda_mixer_amp_switch_get
,
2730 .put
= alc268_beep_switch_put
,
2731 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2735 /* set PCBEEP vol = 0, mute connections */
2736 static const struct hda_verb alc268_beep_init_verbs
[] = {
2737 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2738 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2739 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2744 ALC268_FIXUP_INV_DMIC
,
2745 ALC268_FIXUP_HP_EAPD
,
2749 static const struct hda_fixup alc268_fixups
[] = {
2750 [ALC268_FIXUP_INV_DMIC
] = {
2751 .type
= HDA_FIXUP_FUNC
,
2752 .v
.func
= alc_fixup_inv_dmic
,
2754 [ALC268_FIXUP_HP_EAPD
] = {
2755 .type
= HDA_FIXUP_VERBS
,
2756 .v
.verbs
= (const struct hda_verb
[]) {
2757 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2761 [ALC268_FIXUP_SPDIF
] = {
2762 .type
= HDA_FIXUP_PINS
,
2763 .v
.pins
= (const struct hda_pintbl
[]) {
2764 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2770 static const struct hda_model_fixup alc268_fixup_models
[] = {
2771 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2772 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2773 {.id
= ALC268_FIXUP_SPDIF
, .name
= "spdif"},
2777 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2778 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2779 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2780 /* below is codec SSID since multiple Toshiba laptops have the
2781 * same PCI SSID 1179:ff00
2783 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2788 * BIOS auto configuration
2790 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2792 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2793 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2798 static int patch_alc268(struct hda_codec
*codec
)
2800 struct alc_spec
*spec
;
2803 /* ALC268 has no aa-loopback mixer */
2804 err
= alc_alloc_spec(codec
, 0);
2809 spec
->gen
.beep_nid
= 0x01;
2811 spec
->shutup
= alc_eapd_shutup
;
2813 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2814 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2816 /* automatic parse from the BIOS config */
2817 err
= alc268_parse_auto_config(codec
);
2821 if (err
> 0 && !spec
->gen
.no_analog
&&
2822 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2823 for (i
= 0; i
< ARRAY_SIZE(alc268_beep_mixer
); i
++) {
2824 if (!snd_hda_gen_add_kctl(&spec
->gen
, NULL
,
2825 &alc268_beep_mixer
[i
])) {
2830 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2831 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2832 /* override the amp caps for beep generator */
2833 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2834 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2835 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2836 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2837 (0 << AC_AMPCAP_MUTE_SHIFT
));
2840 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2853 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2854 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2857 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2858 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2861 /* different alc269-variants */
2863 ALC269_TYPE_ALC269VA
,
2864 ALC269_TYPE_ALC269VB
,
2865 ALC269_TYPE_ALC269VC
,
2866 ALC269_TYPE_ALC269VD
,
2885 * BIOS auto configuration
2887 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2889 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2890 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2891 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2892 struct alc_spec
*spec
= codec
->spec
;
2893 const hda_nid_t
*ssids
;
2895 switch (spec
->codec_variant
) {
2896 case ALC269_TYPE_ALC269VA
:
2897 case ALC269_TYPE_ALC269VC
:
2898 case ALC269_TYPE_ALC280
:
2899 case ALC269_TYPE_ALC284
:
2900 case ALC269_TYPE_ALC293
:
2901 ssids
= alc269va_ssids
;
2903 case ALC269_TYPE_ALC269VB
:
2904 case ALC269_TYPE_ALC269VD
:
2905 case ALC269_TYPE_ALC282
:
2906 case ALC269_TYPE_ALC283
:
2907 case ALC269_TYPE_ALC286
:
2908 case ALC269_TYPE_ALC298
:
2909 case ALC269_TYPE_ALC255
:
2910 case ALC269_TYPE_ALC256
:
2911 case ALC269_TYPE_ALC257
:
2912 case ALC269_TYPE_ALC215
:
2913 case ALC269_TYPE_ALC225
:
2914 case ALC269_TYPE_ALC294
:
2915 case ALC269_TYPE_ALC300
:
2916 case ALC269_TYPE_ALC700
:
2917 ssids
= alc269_ssids
;
2920 ssids
= alc269_ssids
;
2924 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2927 static int find_ext_mic_pin(struct hda_codec
*codec
);
2929 static void alc286_shutup(struct hda_codec
*codec
)
2931 const struct hda_pincfg
*pin
;
2933 int mic_pin
= find_ext_mic_pin(codec
);
2934 /* don't shut up pins when unloading the driver; otherwise it breaks
2935 * the default pin setup at the next load of the driver
2937 if (codec
->bus
->shutdown
)
2939 snd_array_for_each(&codec
->init_pins
, i
, pin
) {
2940 /* use read here for syncing after issuing each verb */
2941 if (pin
->nid
!= mic_pin
)
2942 snd_hda_codec_read(codec
, pin
->nid
, 0,
2943 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
2945 codec
->pins_shutup
= 1;
2948 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2950 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2953 static void alc269_shutup(struct hda_codec
*codec
)
2955 struct alc_spec
*spec
= codec
->spec
;
2957 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2958 alc269vb_toggle_power_output(codec
, 0);
2959 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2960 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2963 alc_shutup_pins(codec
);
2966 static struct coef_fw alc282_coefs
[] = {
2967 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2968 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2969 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2970 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2971 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2972 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2973 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2974 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2975 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2976 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2977 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2978 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2979 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2980 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2981 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2982 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2983 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2984 WRITE_COEF(0x63, 0x2902), /* PLL */
2985 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2986 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2987 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2988 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2989 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2990 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2991 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2992 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2993 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2994 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2995 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2999 static void alc282_restore_default_value(struct hda_codec
*codec
)
3001 alc_process_coef_fw(codec
, alc282_coefs
);
3004 static void alc282_init(struct hda_codec
*codec
)
3006 struct alc_spec
*spec
= codec
->spec
;
3007 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3011 alc282_restore_default_value(codec
);
3015 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3016 coef78
= alc_read_coef_idx(codec
, 0x78);
3018 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
3019 /* Headphone capless set to high power mode */
3020 alc_write_coef_idx(codec
, 0x78, 0x9004);
3025 snd_hda_codec_write(codec
, hp_pin
, 0,
3026 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3031 snd_hda_codec_write(codec
, hp_pin
, 0,
3032 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3037 /* Headphone capless set to normal mode */
3038 alc_write_coef_idx(codec
, 0x78, coef78
);
3041 static void alc282_shutup(struct hda_codec
*codec
)
3043 struct alc_spec
*spec
= codec
->spec
;
3044 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3049 alc269_shutup(codec
);
3053 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3054 coef78
= alc_read_coef_idx(codec
, 0x78);
3055 alc_write_coef_idx(codec
, 0x78, 0x9004);
3060 snd_hda_codec_write(codec
, hp_pin
, 0,
3061 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3066 if (!spec
->no_shutup_pins
)
3067 snd_hda_codec_write(codec
, hp_pin
, 0,
3068 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3073 alc_auto_setup_eapd(codec
, false);
3074 alc_shutup_pins(codec
);
3075 alc_write_coef_idx(codec
, 0x78, coef78
);
3078 static struct coef_fw alc283_coefs
[] = {
3079 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
3080 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
3081 WRITE_COEF(0x07, 0x0200), /* DMIC control */
3082 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
3083 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
3084 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
3085 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
3086 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
3087 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
3088 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
3089 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
3090 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
3091 WRITE_COEF(0x22, 0xa0c0), /* ANC */
3092 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
3093 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
3094 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
3095 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
3096 WRITE_COEF(0x2e, 0x2902), /* PLL */
3097 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
3098 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
3099 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
3100 WRITE_COEF(0x36, 0x0), /* capless control 5 */
3101 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
3102 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
3103 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
3104 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
3105 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
3106 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
3107 WRITE_COEF(0x49, 0x0), /* test mode */
3108 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
3109 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
3110 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
3111 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
3115 static void alc283_restore_default_value(struct hda_codec
*codec
)
3117 alc_process_coef_fw(codec
, alc283_coefs
);
3120 static void alc283_init(struct hda_codec
*codec
)
3122 struct alc_spec
*spec
= codec
->spec
;
3123 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3126 alc283_restore_default_value(codec
);
3132 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3134 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3135 /* Headphone capless set to high power mode */
3136 alc_write_coef_idx(codec
, 0x43, 0x9004);
3138 snd_hda_codec_write(codec
, hp_pin
, 0,
3139 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3144 snd_hda_codec_write(codec
, hp_pin
, 0,
3145 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3149 /* Index 0x46 Combo jack auto switch control 2 */
3150 /* 3k pull low control for Headset jack. */
3151 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3152 /* Headphone capless set to normal mode */
3153 alc_write_coef_idx(codec
, 0x43, 0x9614);
3156 static void alc283_shutup(struct hda_codec
*codec
)
3158 struct alc_spec
*spec
= codec
->spec
;
3159 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3163 alc269_shutup(codec
);
3167 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3169 alc_write_coef_idx(codec
, 0x43, 0x9004);
3171 /*depop hp during suspend*/
3172 alc_write_coef_idx(codec
, 0x06, 0x2100);
3174 snd_hda_codec_write(codec
, hp_pin
, 0,
3175 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3180 if (!spec
->no_shutup_pins
)
3181 snd_hda_codec_write(codec
, hp_pin
, 0,
3182 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3184 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3188 alc_auto_setup_eapd(codec
, false);
3189 alc_shutup_pins(codec
);
3190 alc_write_coef_idx(codec
, 0x43, 0x9614);
3193 static void alc256_init(struct hda_codec
*codec
)
3195 struct alc_spec
*spec
= codec
->spec
;
3196 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3204 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3209 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3211 snd_hda_codec_write(codec
, hp_pin
, 0,
3212 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3217 snd_hda_codec_write(codec
, hp_pin
, 0,
3218 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3223 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3224 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3225 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 1 << 15); /* Clear bit */
3226 alc_update_coefex_idx(codec
, 0x53, 0x02, 0x8000, 0 << 15);
3229 static void alc256_shutup(struct hda_codec
*codec
)
3231 struct alc_spec
*spec
= codec
->spec
;
3232 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3236 alc269_shutup(codec
);
3240 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3245 snd_hda_codec_write(codec
, hp_pin
, 0,
3246 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3251 /* 3k pull low control for Headset jack. */
3252 /* NOTE: call this before clearing the pin, otherwise codec stalls */
3253 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3255 if (!spec
->no_shutup_pins
)
3256 snd_hda_codec_write(codec
, hp_pin
, 0,
3257 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3262 alc_auto_setup_eapd(codec
, false);
3263 alc_shutup_pins(codec
);
3266 static void alc225_init(struct hda_codec
*codec
)
3268 struct alc_spec
*spec
= codec
->spec
;
3269 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3270 bool hp1_pin_sense
, hp2_pin_sense
;
3277 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3278 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3280 if (hp1_pin_sense
|| hp2_pin_sense
)
3283 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3286 snd_hda_codec_write(codec
, hp_pin
, 0,
3287 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3289 snd_hda_codec_write(codec
, 0x16, 0,
3290 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3292 if (hp1_pin_sense
|| hp2_pin_sense
)
3296 snd_hda_codec_write(codec
, hp_pin
, 0,
3297 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3299 snd_hda_codec_write(codec
, 0x16, 0,
3300 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3302 if (hp1_pin_sense
|| hp2_pin_sense
)
3305 alc_update_coef_idx(codec
, 0x4a, 3 << 10, 0);
3306 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3309 static void alc225_shutup(struct hda_codec
*codec
)
3311 struct alc_spec
*spec
= codec
->spec
;
3312 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3313 bool hp1_pin_sense
, hp2_pin_sense
;
3316 alc269_shutup(codec
);
3320 /* 3k pull low control for Headset jack. */
3321 alc_update_coef_idx(codec
, 0x4a, 0, 3 << 10);
3323 hp1_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3324 hp2_pin_sense
= snd_hda_jack_detect(codec
, 0x16);
3326 if (hp1_pin_sense
|| hp2_pin_sense
)
3330 snd_hda_codec_write(codec
, hp_pin
, 0,
3331 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3333 snd_hda_codec_write(codec
, 0x16, 0,
3334 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3336 if (hp1_pin_sense
|| hp2_pin_sense
)
3340 snd_hda_codec_write(codec
, hp_pin
, 0,
3341 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3343 snd_hda_codec_write(codec
, 0x16, 0,
3344 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3346 if (hp1_pin_sense
|| hp2_pin_sense
)
3349 alc_auto_setup_eapd(codec
, false);
3350 alc_shutup_pins(codec
);
3353 static void alc_default_init(struct hda_codec
*codec
)
3355 struct alc_spec
*spec
= codec
->spec
;
3356 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3364 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3369 snd_hda_codec_write(codec
, hp_pin
, 0,
3370 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3375 snd_hda_codec_write(codec
, hp_pin
, 0,
3376 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3382 static void alc_default_shutup(struct hda_codec
*codec
)
3384 struct alc_spec
*spec
= codec
->spec
;
3385 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3389 alc269_shutup(codec
);
3393 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3398 snd_hda_codec_write(codec
, hp_pin
, 0,
3399 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3404 if (!spec
->no_shutup_pins
)
3405 snd_hda_codec_write(codec
, hp_pin
, 0,
3406 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3411 alc_auto_setup_eapd(codec
, false);
3412 alc_shutup_pins(codec
);
3415 static void alc294_hp_init(struct hda_codec
*codec
)
3417 struct alc_spec
*spec
= codec
->spec
;
3418 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
3424 snd_hda_codec_write(codec
, hp_pin
, 0,
3425 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3429 if (!spec
->no_shutup_pins
)
3430 snd_hda_codec_write(codec
, hp_pin
, 0,
3431 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3433 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0);/* Set HP depop to manual mode */
3434 alc_update_coefex_idx(codec
, 0x58, 0x00, 0x8000, 0x8000); /* HP depop procedure start */
3436 /* Wait for depop procedure finish */
3437 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3438 for (i
= 0; i
< 20 && val
& 0x0080; i
++) {
3440 val
= alc_read_coefex_idx(codec
, 0x58, 0x01);
3442 /* Set HP depop to auto mode */
3443 alc_update_coef_idx(codec
, 0x6f, 0x000f, 0x000b);
3447 static void alc294_init(struct hda_codec
*codec
)
3449 struct alc_spec
*spec
= codec
->spec
;
3451 /* required only at boot or S4 resume time */
3452 if (!spec
->done_hp_init
||
3453 codec
->core
.dev
.power
.power_state
.event
== PM_EVENT_RESTORE
) {
3454 alc294_hp_init(codec
);
3455 spec
->done_hp_init
= true;
3457 alc_default_init(codec
);
3460 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3463 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3464 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3465 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3468 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3472 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3473 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3475 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3480 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3484 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3485 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3486 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3487 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3488 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3489 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3490 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3491 val
= alc5505_coef_get(codec
, 0x6220);
3492 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3495 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3497 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3498 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3499 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3500 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3501 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3502 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3505 static void alc5505_dsp_init(struct hda_codec
*codec
)
3509 alc5505_dsp_halt(codec
);
3510 alc5505_dsp_back_from_halt(codec
);
3511 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3512 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3513 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3514 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3515 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3516 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3517 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3518 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3519 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3520 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3521 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3522 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3523 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3525 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3527 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3529 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3531 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3532 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3533 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3534 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3535 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3536 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3537 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3539 #ifdef HALT_REALTEK_ALC5505
3540 alc5505_dsp_halt(codec
);
3544 #ifdef HALT_REALTEK_ALC5505
3545 #define alc5505_dsp_suspend(codec) /* NOP */
3546 #define alc5505_dsp_resume(codec) /* NOP */
3548 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3549 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3553 static int alc269_suspend(struct hda_codec
*codec
)
3555 struct alc_spec
*spec
= codec
->spec
;
3557 if (spec
->has_alc5505_dsp
)
3558 alc5505_dsp_suspend(codec
);
3559 return alc_suspend(codec
);
3562 static int alc269_resume(struct hda_codec
*codec
)
3564 struct alc_spec
*spec
= codec
->spec
;
3566 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3567 alc269vb_toggle_power_output(codec
, 0);
3568 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3569 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3573 codec
->patch_ops
.init(codec
);
3575 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3576 alc269vb_toggle_power_output(codec
, 1);
3577 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3578 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3582 regcache_sync(codec
->core
.regmap
);
3583 hda_call_check_power_status(codec
, 0x01);
3585 /* on some machine, the BIOS will clear the codec gpio data when enter
3586 * suspend, and won't restore the data after resume, so we restore it
3589 if (spec
->gpio_data
)
3590 alc_write_gpio_data(codec
);
3592 if (spec
->has_alc5505_dsp
)
3593 alc5505_dsp_resume(codec
);
3597 #endif /* CONFIG_PM */
3599 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3600 const struct hda_fixup
*fix
, int action
)
3602 struct alc_spec
*spec
= codec
->spec
;
3604 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3605 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3608 static void alc269_fixup_pincfg_U7x7_headset_mic(struct hda_codec
*codec
,
3609 const struct hda_fixup
*fix
,
3612 unsigned int cfg_headphone
= snd_hda_codec_get_pincfg(codec
, 0x21);
3613 unsigned int cfg_headset_mic
= snd_hda_codec_get_pincfg(codec
, 0x19);
3615 if (cfg_headphone
&& cfg_headset_mic
== 0x411111f0)
3616 snd_hda_codec_set_pincfg(codec
, 0x19,
3617 (cfg_headphone
& ~AC_DEFCFG_DEVICE
) |
3618 (AC_JACK_MIC_IN
<< AC_DEFCFG_DEVICE_SHIFT
));
3621 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3622 const struct hda_fixup
*fix
, int action
)
3624 if (action
== HDA_FIXUP_ACT_INIT
)
3625 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3628 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3629 const struct hda_fixup
*fix
, int action
)
3631 struct alc_spec
*spec
= codec
->spec
;
3633 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3634 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3637 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3638 const struct hda_fixup
*fix
, int action
)
3640 static const struct hda_verb verbs
[] = {
3641 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3642 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3647 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3648 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3650 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3651 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3652 snd_hda_sequence_write(codec
, verbs
);
3655 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3656 const struct hda_fixup
*fix
, int action
)
3658 struct alc_spec
*spec
= codec
->spec
;
3660 if (action
!= HDA_FIXUP_ACT_PROBE
)
3663 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3664 * fix the sample rate of analog I/O to 44.1kHz
3666 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3667 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3670 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3671 const struct hda_fixup
*fix
, int action
)
3673 /* The digital-mic unit sends PDM (differential signal) instead of
3674 * the standard PCM, thus you can't record a valid mono stream as is.
3675 * Below is a workaround specific to ALC269 to control the dmic
3676 * signal source as mono.
3678 if (action
== HDA_FIXUP_ACT_INIT
)
3679 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3682 static void alc269_quanta_automute(struct hda_codec
*codec
)
3684 snd_hda_gen_update_outputs(codec
);
3686 alc_write_coef_idx(codec
, 0x0c, 0x680);
3687 alc_write_coef_idx(codec
, 0x0c, 0x480);
3690 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3691 const struct hda_fixup
*fix
, int action
)
3693 struct alc_spec
*spec
= codec
->spec
;
3694 if (action
!= HDA_FIXUP_ACT_PROBE
)
3696 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3699 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3700 struct hda_jack_callback
*jack
)
3702 struct alc_spec
*spec
= codec
->spec
;
3705 snd_hda_gen_hp_automute(codec
, jack
);
3707 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3709 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3712 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3716 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3717 const struct hda_fixup
*fix
, int action
)
3719 struct alc_spec
*spec
= codec
->spec
;
3720 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3721 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3722 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3727 /* update mute-LED according to the speaker mute state via mic VREF pin */
3728 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3730 struct hda_codec
*codec
= private_data
;
3731 struct alc_spec
*spec
= codec
->spec
;
3732 unsigned int pinval
;
3734 if (spec
->mute_led_polarity
)
3736 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3737 pinval
&= ~AC_PINCTL_VREFEN
;
3738 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3739 if (spec
->mute_led_nid
) {
3740 /* temporarily power up/down for setting VREF */
3741 snd_hda_power_up_pm(codec
);
3742 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3743 snd_hda_power_down_pm(codec
);
3747 /* Make sure the led works even in runtime suspend */
3748 static unsigned int led_power_filter(struct hda_codec
*codec
,
3750 unsigned int power_state
)
3752 struct alc_spec
*spec
= codec
->spec
;
3754 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3755 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3758 /* Set pin ctl again, it might have just been set to 0 */
3759 snd_hda_set_pin_ctl(codec
, nid
,
3760 snd_hda_codec_get_pin_target(codec
, nid
));
3762 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3765 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3766 const struct hda_fixup
*fix
, int action
)
3768 struct alc_spec
*spec
= codec
->spec
;
3769 const struct dmi_device
*dev
= NULL
;
3771 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3774 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3776 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3778 if (pin
< 0x0a || pin
>= 0x10)
3780 spec
->mute_led_polarity
= pol
;
3781 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3782 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3783 spec
->gen
.vmaster_mute_enum
= 1;
3784 codec
->power_filter
= led_power_filter
;
3786 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3787 spec
->mute_led_polarity
);
3792 static void alc269_fixup_hp_mute_led_micx(struct hda_codec
*codec
,
3793 const struct hda_fixup
*fix
,
3794 int action
, hda_nid_t pin
)
3796 struct alc_spec
*spec
= codec
->spec
;
3798 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3799 spec
->mute_led_polarity
= 0;
3800 spec
->mute_led_nid
= pin
;
3801 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3802 spec
->gen
.vmaster_mute_enum
= 1;
3803 codec
->power_filter
= led_power_filter
;
3807 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3808 const struct hda_fixup
*fix
, int action
)
3810 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x18);
3813 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3814 const struct hda_fixup
*fix
, int action
)
3816 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x19);
3819 static void alc269_fixup_hp_mute_led_mic3(struct hda_codec
*codec
,
3820 const struct hda_fixup
*fix
, int action
)
3822 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x1b);
3825 /* update LED status via GPIO */
3826 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3829 struct alc_spec
*spec
= codec
->spec
;
3831 if (spec
->mute_led_polarity
)
3833 alc_update_gpio_data(codec
, mask
, !enabled
); /* muted -> LED on */
3836 /* turn on/off mute LED via GPIO per vmaster hook */
3837 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3839 struct hda_codec
*codec
= private_data
;
3840 struct alc_spec
*spec
= codec
->spec
;
3842 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3845 /* turn on/off mic-mute LED via GPIO per capture hook */
3846 static void alc_gpio_micmute_update(struct hda_codec
*codec
)
3848 struct alc_spec
*spec
= codec
->spec
;
3850 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3851 spec
->gen
.micmute_led
.led_value
);
3854 /* setup mute and mic-mute GPIO bits, add hooks appropriately */
3855 static void alc_fixup_hp_gpio_led(struct hda_codec
*codec
,
3857 unsigned int mute_mask
,
3858 unsigned int micmute_mask
)
3860 struct alc_spec
*spec
= codec
->spec
;
3862 alc_fixup_gpio(codec
, action
, mute_mask
| micmute_mask
);
3864 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3867 spec
->gpio_mute_led_mask
= mute_mask
;
3868 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3871 spec
->gpio_mic_led_mask
= micmute_mask
;
3872 snd_hda_gen_add_micmute_led(codec
, alc_gpio_micmute_update
);
3876 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3877 const struct hda_fixup
*fix
, int action
)
3879 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0x10);
3882 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3883 const struct hda_fixup
*fix
, int action
)
3885 alc_fixup_hp_gpio_led(codec
, action
, 0x02, 0x20);
3888 /* turn on/off mic-mute LED per capture hook */
3889 static void alc_cap_micmute_update(struct hda_codec
*codec
)
3891 struct alc_spec
*spec
= codec
->spec
;
3892 unsigned int pinval
;
3894 if (!spec
->cap_mute_led_nid
)
3896 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3897 pinval
&= ~AC_PINCTL_VREFEN
;
3898 if (spec
->gen
.micmute_led
.led_value
)
3899 pinval
|= AC_PINCTL_VREF_80
;
3901 pinval
|= AC_PINCTL_VREF_HIZ
;
3902 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3905 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3906 const struct hda_fixup
*fix
, int action
)
3908 struct alc_spec
*spec
= codec
->spec
;
3910 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0);
3911 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3912 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to
3913 * enable headphone amp
3915 spec
->gpio_mask
|= 0x10;
3916 spec
->gpio_dir
|= 0x10;
3917 spec
->cap_mute_led_nid
= 0x18;
3918 snd_hda_gen_add_micmute_led(codec
, alc_cap_micmute_update
);
3919 codec
->power_filter
= led_power_filter
;
3923 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3924 const struct hda_fixup
*fix
, int action
)
3926 struct alc_spec
*spec
= codec
->spec
;
3928 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0);
3929 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3930 spec
->cap_mute_led_nid
= 0x18;
3931 snd_hda_gen_add_micmute_led(codec
, alc_cap_micmute_update
);
3932 codec
->power_filter
= led_power_filter
;
3936 #if IS_REACHABLE(CONFIG_INPUT)
3937 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3938 struct hda_jack_callback
*event
)
3940 struct alc_spec
*spec
= codec
->spec
;
3942 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3943 send both key on and key off event for every interrupt. */
3944 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
3945 input_sync(spec
->kb_dev
);
3946 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
3947 input_sync(spec
->kb_dev
);
3950 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
3952 struct alc_spec
*spec
= codec
->spec
;
3955 spec
->kb_dev
= input_allocate_device();
3956 if (!spec
->kb_dev
) {
3957 codec_err(codec
, "Out of memory (input_allocate_device)\n");
3961 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
3963 spec
->kb_dev
->name
= "Microphone Mute Button";
3964 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
3965 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
3966 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
3967 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
3968 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
3969 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
3971 if (input_register_device(spec
->kb_dev
)) {
3972 codec_err(codec
, "input_register_device failed\n");
3973 input_free_device(spec
->kb_dev
);
3974 spec
->kb_dev
= NULL
;
3981 /* GPIO1 = set according to SKU external amp
3982 * GPIO2 = mic mute hotkey
3984 * GPIO4 = mic mute LED
3986 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
3987 const struct hda_fixup
*fix
, int action
)
3989 struct alc_spec
*spec
= codec
->spec
;
3991 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0x10);
3992 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3993 spec
->init_amp
= ALC_INIT_DEFAULT
;
3994 if (alc_register_micmute_input_device(codec
) != 0)
3997 spec
->gpio_mask
|= 0x06;
3998 spec
->gpio_dir
|= 0x02;
3999 spec
->gpio_data
|= 0x02;
4000 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
4001 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
4002 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
4003 gpio2_mic_hotkey_event
);
4011 case HDA_FIXUP_ACT_FREE
:
4012 input_unregister_device(spec
->kb_dev
);
4013 spec
->kb_dev
= NULL
;
4017 /* Line2 = mic mute hotkey
4018 * GPIO2 = mic mute LED
4020 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
4021 const struct hda_fixup
*fix
, int action
)
4023 struct alc_spec
*spec
= codec
->spec
;
4025 alc_fixup_hp_gpio_led(codec
, action
, 0, 0x04);
4026 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4027 spec
->init_amp
= ALC_INIT_DEFAULT
;
4028 if (alc_register_micmute_input_device(codec
) != 0)
4031 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4032 gpio2_mic_hotkey_event
);
4040 case HDA_FIXUP_ACT_FREE
:
4041 input_unregister_device(spec
->kb_dev
);
4042 spec
->kb_dev
= NULL
;
4046 #define alc280_fixup_hp_gpio2_mic_hotkey NULL
4047 #define alc233_fixup_lenovo_line2_mic_hotkey NULL
4050 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
4051 const struct hda_fixup
*fix
, int action
)
4053 struct alc_spec
*spec
= codec
->spec
;
4055 alc269_fixup_hp_mute_led_micx(codec
, fix
, action
, 0x1a);
4056 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4057 spec
->cap_mute_led_nid
= 0x18;
4058 snd_hda_gen_add_micmute_led(codec
, alc_cap_micmute_update
);
4062 static struct coef_fw alc225_pre_hsmode
[] = {
4063 UPDATE_COEF(0x4a, 1<<8, 0),
4064 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
4065 UPDATE_COEF(0x63, 3<<14, 3<<14),
4066 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4067 UPDATE_COEF(0x4a, 3<<10, 3<<10),
4068 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4069 UPDATE_COEF(0x4a, 3<<10, 0),
4073 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
4075 static struct coef_fw coef0255
[] = {
4076 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
4077 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
4078 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
4079 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
4082 static struct coef_fw coef0255_1
[] = {
4083 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
4086 static struct coef_fw coef0256
[] = {
4087 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
4090 static struct coef_fw coef0233
[] = {
4091 WRITE_COEF(0x1b, 0x0c0b),
4092 WRITE_COEF(0x45, 0xc429),
4093 UPDATE_COEF(0x35, 0x4000, 0),
4094 WRITE_COEF(0x06, 0x2104),
4095 WRITE_COEF(0x1a, 0x0001),
4096 WRITE_COEF(0x26, 0x0004),
4097 WRITE_COEF(0x32, 0x42a3),
4100 static struct coef_fw coef0288
[] = {
4101 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4102 UPDATE_COEF(0x50, 0x2000, 0x2000),
4103 UPDATE_COEF(0x56, 0x0006, 0x0006),
4104 UPDATE_COEF(0x66, 0x0008, 0),
4105 UPDATE_COEF(0x67, 0x2000, 0),
4108 static struct coef_fw coef0298
[] = {
4109 UPDATE_COEF(0x19, 0x1300, 0x0300),
4112 static struct coef_fw coef0292
[] = {
4113 WRITE_COEF(0x76, 0x000e),
4114 WRITE_COEF(0x6c, 0x2400),
4115 WRITE_COEF(0x18, 0x7308),
4116 WRITE_COEF(0x6b, 0xc429),
4119 static struct coef_fw coef0293
[] = {
4120 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
4121 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
4122 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
4123 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
4124 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
4125 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4128 static struct coef_fw coef0668
[] = {
4129 WRITE_COEF(0x15, 0x0d40),
4130 WRITE_COEF(0xb7, 0x802b),
4133 static struct coef_fw coef0225
[] = {
4134 UPDATE_COEF(0x63, 3<<14, 0),
4137 static struct coef_fw coef0274
[] = {
4138 UPDATE_COEF(0x4a, 0x0100, 0),
4139 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
4140 UPDATE_COEF(0x6b, 0xf000, 0x5000),
4141 UPDATE_COEF(0x4a, 0x0010, 0),
4142 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
4143 WRITE_COEF(0x45, 0x5289),
4144 UPDATE_COEF(0x4a, 0x0c00, 0),
4148 switch (codec
->core
.vendor_id
) {
4150 alc_process_coef_fw(codec
, coef0255_1
);
4151 alc_process_coef_fw(codec
, coef0255
);
4155 alc_process_coef_fw(codec
, coef0256
);
4156 alc_process_coef_fw(codec
, coef0255
);
4161 alc_process_coef_fw(codec
, coef0274
);
4165 alc_process_coef_fw(codec
, coef0233
);
4169 alc_process_coef_fw(codec
, coef0288
);
4172 alc_process_coef_fw(codec
, coef0298
);
4173 alc_process_coef_fw(codec
, coef0288
);
4176 alc_process_coef_fw(codec
, coef0292
);
4179 alc_process_coef_fw(codec
, coef0293
);
4182 alc_process_coef_fw(codec
, coef0668
);
4190 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4191 alc_process_coef_fw(codec
, coef0225
);
4194 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4197 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
4201 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
4204 static struct coef_fw coef0255
[] = {
4205 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
4206 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
4209 static struct coef_fw coef0233
[] = {
4210 UPDATE_COEF(0x35, 0, 1<<14),
4211 WRITE_COEF(0x06, 0x2100),
4212 WRITE_COEF(0x1a, 0x0021),
4213 WRITE_COEF(0x26, 0x008c),
4216 static struct coef_fw coef0288
[] = {
4217 UPDATE_COEF(0x4f, 0x00c0, 0),
4218 UPDATE_COEF(0x50, 0x2000, 0),
4219 UPDATE_COEF(0x56, 0x0006, 0),
4220 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
4221 UPDATE_COEF(0x66, 0x0008, 0x0008),
4222 UPDATE_COEF(0x67, 0x2000, 0x2000),
4225 static struct coef_fw coef0292
[] = {
4226 WRITE_COEF(0x19, 0xa208),
4227 WRITE_COEF(0x2e, 0xacf0),
4230 static struct coef_fw coef0293
[] = {
4231 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
4232 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
4233 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4236 static struct coef_fw coef0688
[] = {
4237 WRITE_COEF(0xb7, 0x802b),
4238 WRITE_COEF(0xb5, 0x1040),
4239 UPDATE_COEF(0xc3, 0, 1<<12),
4242 static struct coef_fw coef0225
[] = {
4243 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4244 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4245 UPDATE_COEF(0x63, 3<<14, 0),
4248 static struct coef_fw coef0274
[] = {
4249 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4250 UPDATE_COEF(0x4a, 0x0010, 0),
4251 UPDATE_COEF(0x6b, 0xf000, 0),
4255 switch (codec
->core
.vendor_id
) {
4259 alc_write_coef_idx(codec
, 0x45, 0xc489);
4260 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4261 alc_process_coef_fw(codec
, coef0255
);
4262 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4267 alc_write_coef_idx(codec
, 0x45, 0x4689);
4268 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4269 alc_process_coef_fw(codec
, coef0274
);
4270 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4274 alc_write_coef_idx(codec
, 0x45, 0xc429);
4275 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4276 alc_process_coef_fw(codec
, coef0233
);
4277 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4282 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4283 alc_process_coef_fw(codec
, coef0288
);
4284 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4287 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4288 alc_process_coef_fw(codec
, coef0292
);
4291 /* Set to TRS mode */
4292 alc_write_coef_idx(codec
, 0x45, 0xc429);
4293 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4294 alc_process_coef_fw(codec
, coef0293
);
4295 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4298 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4302 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4303 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4306 alc_write_coef_idx(codec
, 0x11, 0x0001);
4307 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4308 alc_process_coef_fw(codec
, coef0688
);
4309 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4317 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4318 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4319 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4320 alc_process_coef_fw(codec
, coef0225
);
4321 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4324 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4327 static void alc_headset_mode_default(struct hda_codec
*codec
)
4329 static struct coef_fw coef0225
[] = {
4330 UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
4331 UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
4332 UPDATE_COEF(0x49, 3<<8, 0<<8),
4333 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4334 UPDATE_COEF(0x63, 3<<14, 0),
4335 UPDATE_COEF(0x67, 0xf000, 0x3000),
4338 static struct coef_fw coef0255
[] = {
4339 WRITE_COEF(0x45, 0xc089),
4340 WRITE_COEF(0x45, 0xc489),
4341 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4342 WRITE_COEF(0x49, 0x0049),
4345 static struct coef_fw coef0233
[] = {
4346 WRITE_COEF(0x06, 0x2100),
4347 WRITE_COEF(0x32, 0x4ea3),
4350 static struct coef_fw coef0288
[] = {
4351 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4352 UPDATE_COEF(0x50, 0x2000, 0x2000),
4353 UPDATE_COEF(0x56, 0x0006, 0x0006),
4354 UPDATE_COEF(0x66, 0x0008, 0),
4355 UPDATE_COEF(0x67, 0x2000, 0),
4358 static struct coef_fw coef0292
[] = {
4359 WRITE_COEF(0x76, 0x000e),
4360 WRITE_COEF(0x6c, 0x2400),
4361 WRITE_COEF(0x6b, 0xc429),
4362 WRITE_COEF(0x18, 0x7308),
4365 static struct coef_fw coef0293
[] = {
4366 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4367 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4368 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4371 static struct coef_fw coef0688
[] = {
4372 WRITE_COEF(0x11, 0x0041),
4373 WRITE_COEF(0x15, 0x0d40),
4374 WRITE_COEF(0xb7, 0x802b),
4377 static struct coef_fw coef0274
[] = {
4378 WRITE_COEF(0x45, 0x4289),
4379 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4380 UPDATE_COEF(0x6b, 0x0f00, 0),
4381 UPDATE_COEF(0x49, 0x0300, 0x0300),
4385 switch (codec
->core
.vendor_id
) {
4392 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4393 alc_process_coef_fw(codec
, coef0225
);
4398 alc_process_coef_fw(codec
, coef0255
);
4403 alc_process_coef_fw(codec
, coef0274
);
4407 alc_process_coef_fw(codec
, coef0233
);
4412 alc_process_coef_fw(codec
, coef0288
);
4415 alc_process_coef_fw(codec
, coef0292
);
4418 alc_process_coef_fw(codec
, coef0293
);
4421 alc_process_coef_fw(codec
, coef0688
);
4424 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4427 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4431 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4435 static struct coef_fw coef0255
[] = {
4436 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4437 WRITE_COEF(0x1b, 0x0c2b),
4438 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4441 static struct coef_fw coef0256
[] = {
4442 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4443 WRITE_COEF(0x1b, 0x0c6b),
4444 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4447 static struct coef_fw coef0233
[] = {
4448 WRITE_COEF(0x45, 0xd429),
4449 WRITE_COEF(0x1b, 0x0c2b),
4450 WRITE_COEF(0x32, 0x4ea3),
4453 static struct coef_fw coef0288
[] = {
4454 UPDATE_COEF(0x50, 0x2000, 0x2000),
4455 UPDATE_COEF(0x56, 0x0006, 0x0006),
4456 UPDATE_COEF(0x66, 0x0008, 0),
4457 UPDATE_COEF(0x67, 0x2000, 0),
4460 static struct coef_fw coef0292
[] = {
4461 WRITE_COEF(0x6b, 0xd429),
4462 WRITE_COEF(0x76, 0x0008),
4463 WRITE_COEF(0x18, 0x7388),
4466 static struct coef_fw coef0293
[] = {
4467 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4468 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4471 static struct coef_fw coef0688
[] = {
4472 WRITE_COEF(0x11, 0x0001),
4473 WRITE_COEF(0x15, 0x0d60),
4474 WRITE_COEF(0xc3, 0x0000),
4477 static struct coef_fw coef0225_1
[] = {
4478 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4479 UPDATE_COEF(0x63, 3<<14, 2<<14),
4482 static struct coef_fw coef0225_2
[] = {
4483 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4484 UPDATE_COEF(0x63, 3<<14, 1<<14),
4488 switch (codec
->core
.vendor_id
) {
4490 alc_process_coef_fw(codec
, coef0255
);
4494 alc_process_coef_fw(codec
, coef0256
);
4499 alc_write_coef_idx(codec
, 0x45, 0xd689);
4503 alc_process_coef_fw(codec
, coef0233
);
4506 val
= alc_read_coef_idx(codec
, 0x50);
4507 if (val
& (1 << 12)) {
4508 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4509 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4512 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4513 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4519 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4521 alc_process_coef_fw(codec
, coef0288
);
4524 alc_process_coef_fw(codec
, coef0292
);
4527 alc_process_coef_fw(codec
, coef0293
);
4530 alc_process_coef_fw(codec
, coef0688
);
4538 val
= alc_read_coef_idx(codec
, 0x45);
4540 alc_process_coef_fw(codec
, coef0225_2
);
4542 alc_process_coef_fw(codec
, coef0225_1
);
4545 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4548 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4552 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4554 static struct coef_fw coef0255
[] = {
4555 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4556 WRITE_COEF(0x1b, 0x0c2b),
4557 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4560 static struct coef_fw coef0256
[] = {
4561 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4562 WRITE_COEF(0x1b, 0x0c6b),
4563 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4566 static struct coef_fw coef0233
[] = {
4567 WRITE_COEF(0x45, 0xe429),
4568 WRITE_COEF(0x1b, 0x0c2b),
4569 WRITE_COEF(0x32, 0x4ea3),
4572 static struct coef_fw coef0288
[] = {
4573 UPDATE_COEF(0x50, 0x2000, 0x2000),
4574 UPDATE_COEF(0x56, 0x0006, 0x0006),
4575 UPDATE_COEF(0x66, 0x0008, 0),
4576 UPDATE_COEF(0x67, 0x2000, 0),
4579 static struct coef_fw coef0292
[] = {
4580 WRITE_COEF(0x6b, 0xe429),
4581 WRITE_COEF(0x76, 0x0008),
4582 WRITE_COEF(0x18, 0x7388),
4585 static struct coef_fw coef0293
[] = {
4586 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4587 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4590 static struct coef_fw coef0688
[] = {
4591 WRITE_COEF(0x11, 0x0001),
4592 WRITE_COEF(0x15, 0x0d50),
4593 WRITE_COEF(0xc3, 0x0000),
4596 static struct coef_fw coef0225
[] = {
4597 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4598 UPDATE_COEF(0x63, 3<<14, 2<<14),
4602 switch (codec
->core
.vendor_id
) {
4604 alc_process_coef_fw(codec
, coef0255
);
4608 alc_process_coef_fw(codec
, coef0256
);
4613 alc_write_coef_idx(codec
, 0x45, 0xe689);
4617 alc_process_coef_fw(codec
, coef0233
);
4620 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4621 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4626 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4628 alc_process_coef_fw(codec
, coef0288
);
4631 alc_process_coef_fw(codec
, coef0292
);
4634 alc_process_coef_fw(codec
, coef0293
);
4637 alc_process_coef_fw(codec
, coef0688
);
4645 alc_process_coef_fw(codec
, coef0225
);
4648 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4651 static void alc_determine_headset_type(struct hda_codec
*codec
)
4654 bool is_ctia
= false;
4655 struct alc_spec
*spec
= codec
->spec
;
4656 static struct coef_fw coef0255
[] = {
4657 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4658 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4662 static struct coef_fw coef0288
[] = {
4663 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4666 static struct coef_fw coef0298
[] = {
4667 UPDATE_COEF(0x50, 0x2000, 0x2000),
4668 UPDATE_COEF(0x56, 0x0006, 0x0006),
4669 UPDATE_COEF(0x66, 0x0008, 0),
4670 UPDATE_COEF(0x67, 0x2000, 0),
4671 UPDATE_COEF(0x19, 0x1300, 0x1300),
4674 static struct coef_fw coef0293
[] = {
4675 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4676 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4679 static struct coef_fw coef0688
[] = {
4680 WRITE_COEF(0x11, 0x0001),
4681 WRITE_COEF(0xb7, 0x802b),
4682 WRITE_COEF(0x15, 0x0d60),
4683 WRITE_COEF(0xc3, 0x0c00),
4686 static struct coef_fw coef0274
[] = {
4687 UPDATE_COEF(0x4a, 0x0010, 0),
4688 UPDATE_COEF(0x4a, 0x8000, 0),
4689 WRITE_COEF(0x45, 0xd289),
4690 UPDATE_COEF(0x49, 0x0300, 0x0300),
4694 switch (codec
->core
.vendor_id
) {
4698 alc_process_coef_fw(codec
, coef0255
);
4700 val
= alc_read_coef_idx(codec
, 0x46);
4701 is_ctia
= (val
& 0x0070) == 0x0070;
4706 alc_process_coef_fw(codec
, coef0274
);
4708 val
= alc_read_coef_idx(codec
, 0x46);
4709 is_ctia
= (val
& 0x00f0) == 0x00f0;
4713 alc_write_coef_idx(codec
, 0x45, 0xd029);
4715 val
= alc_read_coef_idx(codec
, 0x46);
4716 is_ctia
= (val
& 0x0070) == 0x0070;
4719 snd_hda_codec_write(codec
, 0x21, 0,
4720 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4722 snd_hda_codec_write(codec
, 0x21, 0,
4723 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4726 val
= alc_read_coef_idx(codec
, 0x50);
4727 if (val
& (1 << 12)) {
4728 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);
4729 alc_process_coef_fw(codec
, coef0288
);
4731 val
= alc_read_coef_idx(codec
, 0x50);
4732 is_ctia
= (val
& 0x0070) == 0x0070;
4734 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);
4735 alc_process_coef_fw(codec
, coef0288
);
4737 val
= alc_read_coef_idx(codec
, 0x50);
4738 is_ctia
= (val
& 0x0070) == 0x0070;
4740 alc_process_coef_fw(codec
, coef0298
);
4741 snd_hda_codec_write(codec
, 0x21, 0,
4742 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_HP
);
4744 snd_hda_codec_write(codec
, 0x21, 0,
4745 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4749 alc_process_coef_fw(codec
, coef0288
);
4751 val
= alc_read_coef_idx(codec
, 0x50);
4752 is_ctia
= (val
& 0x0070) == 0x0070;
4755 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4757 val
= alc_read_coef_idx(codec
, 0x6c);
4758 is_ctia
= (val
& 0x001c) == 0x001c;
4761 alc_process_coef_fw(codec
, coef0293
);
4763 val
= alc_read_coef_idx(codec
, 0x46);
4764 is_ctia
= (val
& 0x0070) == 0x0070;
4767 alc_process_coef_fw(codec
, coef0688
);
4769 val
= alc_read_coef_idx(codec
, 0xbe);
4770 is_ctia
= (val
& 0x1c02) == 0x1c02;
4778 snd_hda_codec_write(codec
, 0x21, 0,
4779 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4781 snd_hda_codec_write(codec
, 0x21, 0,
4782 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
4784 alc_process_coef_fw(codec
, alc225_pre_hsmode
);
4785 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x1000);
4786 val
= alc_read_coef_idx(codec
, 0x45);
4787 if (val
& (1 << 9)) {
4788 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4789 alc_update_coef_idx(codec
, 0x49, 3<<8, 2<<8);
4791 val
= alc_read_coef_idx(codec
, 0x46);
4792 is_ctia
= (val
& 0x00f0) == 0x00f0;
4794 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x34<<10);
4795 alc_update_coef_idx(codec
, 0x49, 3<<8, 1<<8);
4797 val
= alc_read_coef_idx(codec
, 0x46);
4798 is_ctia
= (val
& 0x00f0) == 0x00f0;
4800 alc_update_coef_idx(codec
, 0x4a, 7<<6, 7<<6);
4801 alc_update_coef_idx(codec
, 0x4a, 3<<4, 3<<4);
4802 alc_update_coef_idx(codec
, 0x67, 0xf000, 0x3000);
4804 snd_hda_codec_write(codec
, 0x21, 0,
4805 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
4807 snd_hda_codec_write(codec
, 0x21, 0,
4808 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_UNMUTE
);
4815 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4816 is_ctia
? "yes" : "no");
4817 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4820 static void alc_update_headset_mode(struct hda_codec
*codec
)
4822 struct alc_spec
*spec
= codec
->spec
;
4824 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4825 hda_nid_t hp_pin
= alc_get_hp_pin(spec
);
4827 int new_headset_mode
;
4829 if (!snd_hda_jack_detect(codec
, hp_pin
))
4830 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4831 else if (mux_pin
== spec
->headset_mic_pin
)
4832 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4833 else if (mux_pin
== spec
->headphone_mic_pin
)
4834 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4836 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4838 if (new_headset_mode
== spec
->current_headset_mode
) {
4839 snd_hda_gen_update_outputs(codec
);
4843 switch (new_headset_mode
) {
4844 case ALC_HEADSET_MODE_UNPLUGGED
:
4845 alc_headset_mode_unplugged(codec
);
4846 spec
->gen
.hp_jack_present
= false;
4848 case ALC_HEADSET_MODE_HEADSET
:
4849 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4850 alc_determine_headset_type(codec
);
4851 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4852 alc_headset_mode_ctia(codec
);
4853 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4854 alc_headset_mode_omtp(codec
);
4855 spec
->gen
.hp_jack_present
= true;
4857 case ALC_HEADSET_MODE_MIC
:
4858 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4859 spec
->gen
.hp_jack_present
= false;
4861 case ALC_HEADSET_MODE_HEADPHONE
:
4862 alc_headset_mode_default(codec
);
4863 spec
->gen
.hp_jack_present
= true;
4866 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
4867 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
4868 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
4869 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
4870 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
4873 spec
->current_headset_mode
= new_headset_mode
;
4875 snd_hda_gen_update_outputs(codec
);
4878 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
4879 struct snd_kcontrol
*kcontrol
,
4880 struct snd_ctl_elem_value
*ucontrol
)
4882 alc_update_headset_mode(codec
);
4885 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
4886 struct hda_jack_callback
*jack
)
4888 struct alc_spec
*spec
= codec
->spec
;
4889 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
4890 snd_hda_gen_hp_automute(codec
, jack
);
4893 static void alc_probe_headset_mode(struct hda_codec
*codec
)
4896 struct alc_spec
*spec
= codec
->spec
;
4897 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4900 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4901 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
4902 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
4903 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
4904 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
4907 WARN_ON(spec
->gen
.cap_sync_hook
);
4908 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
4909 spec
->gen
.automute_hook
= alc_update_headset_mode
;
4910 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
4913 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
4914 const struct hda_fixup
*fix
, int action
)
4916 struct alc_spec
*spec
= codec
->spec
;
4919 case HDA_FIXUP_ACT_PRE_PROBE
:
4920 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
4922 case HDA_FIXUP_ACT_PROBE
:
4923 alc_probe_headset_mode(codec
);
4925 case HDA_FIXUP_ACT_INIT
:
4926 spec
->current_headset_mode
= 0;
4927 alc_update_headset_mode(codec
);
4932 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
4933 const struct hda_fixup
*fix
, int action
)
4935 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4936 struct alc_spec
*spec
= codec
->spec
;
4937 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4940 alc_fixup_headset_mode(codec
, fix
, action
);
4943 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
4945 /* Set to iphone type */
4946 static struct coef_fw alc255fw
[] = {
4947 WRITE_COEF(0x1b, 0x880b),
4948 WRITE_COEF(0x45, 0xd089),
4949 WRITE_COEF(0x1b, 0x080b),
4950 WRITE_COEF(0x46, 0x0004),
4951 WRITE_COEF(0x1b, 0x0c0b),
4954 static struct coef_fw alc256fw
[] = {
4955 WRITE_COEF(0x1b, 0x884b),
4956 WRITE_COEF(0x45, 0xd089),
4957 WRITE_COEF(0x1b, 0x084b),
4958 WRITE_COEF(0x46, 0x0004),
4959 WRITE_COEF(0x1b, 0x0c4b),
4962 switch (codec
->core
.vendor_id
) {
4964 alc_process_coef_fw(codec
, alc255fw
);
4968 alc_process_coef_fw(codec
, alc256fw
);
4974 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
4975 const struct hda_fixup
*fix
, int action
)
4977 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4978 alc255_set_default_jack_type(codec
);
4980 alc_fixup_headset_mode(codec
, fix
, action
);
4983 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
4984 const struct hda_fixup
*fix
, int action
)
4986 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4987 struct alc_spec
*spec
= codec
->spec
;
4988 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4989 alc255_set_default_jack_type(codec
);
4992 alc_fixup_headset_mode(codec
, fix
, action
);
4995 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
4996 struct hda_jack_callback
*jack
)
4998 struct alc_spec
*spec
= codec
->spec
;
5000 alc_update_headset_jack_cb(codec
, jack
);
5001 /* Headset Mic enable or disable, only for Dell Dino */
5002 alc_update_gpio_data(codec
, 0x40, spec
->gen
.hp_jack_present
);
5005 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
5006 const struct hda_fixup
*fix
, int action
)
5008 alc_fixup_headset_mode(codec
, fix
, action
);
5009 if (action
== HDA_FIXUP_ACT_PROBE
) {
5010 struct alc_spec
*spec
= codec
->spec
;
5011 /* toggled via hp_automute_hook */
5012 spec
->gpio_mask
|= 0x40;
5013 spec
->gpio_dir
|= 0x40;
5014 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
5018 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
5019 const struct hda_fixup
*fix
, int action
)
5021 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5022 struct alc_spec
*spec
= codec
->spec
;
5023 spec
->gen
.auto_mute_via_amp
= 1;
5027 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
5028 const struct hda_fixup
*fix
, int action
)
5030 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5031 struct alc_spec
*spec
= codec
->spec
;
5032 spec
->no_shutup_pins
= 1;
5036 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
5037 const struct hda_fixup
*fix
, int action
)
5039 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5040 struct alc_spec
*spec
= codec
->spec
;
5041 /* Disable AA-loopback as it causes white noise */
5042 spec
->gen
.mixer_nid
= 0;
5046 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
5047 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
5048 const struct hda_fixup
*fix
, int action
)
5050 static const struct hda_pintbl pincfgs
[] = {
5051 { 0x16, 0x21211010 }, /* dock headphone */
5052 { 0x19, 0x21a11010 }, /* dock mic */
5055 struct alc_spec
*spec
= codec
->spec
;
5057 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5058 spec
->reboot_notify
= alc_d3_at_reboot
; /* reduce noise */
5059 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5060 codec
->power_save_node
= 0; /* avoid click noises */
5061 snd_hda_apply_pincfgs(codec
, pincfgs
);
5065 static void alc_fixup_tpt470_dock(struct hda_codec
*codec
,
5066 const struct hda_fixup
*fix
, int action
)
5068 static const struct hda_pintbl pincfgs
[] = {
5069 { 0x17, 0x21211010 }, /* dock headphone */
5070 { 0x19, 0x21a11010 }, /* dock mic */
5073 /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
5074 * the speaker output becomes too low by some reason on Thinkpads with
5077 static hda_nid_t preferred_pairs
[] = {
5078 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
5081 struct alc_spec
*spec
= codec
->spec
;
5083 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5084 spec
->gen
.preferred_dacs
= preferred_pairs
;
5085 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
5086 snd_hda_apply_pincfgs(codec
, pincfgs
);
5087 } else if (action
== HDA_FIXUP_ACT_INIT
) {
5088 /* Enable DOCK device */
5089 snd_hda_codec_write(codec
, 0x17, 0,
5090 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5091 /* Enable DOCK device */
5092 snd_hda_codec_write(codec
, 0x19, 0,
5093 AC_VERB_SET_CONFIG_DEFAULT_BYTES_3
, 0);
5097 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
5099 struct alc_spec
*spec
= codec
->spec
;
5100 int hp_pin
= alc_get_hp_pin(spec
);
5102 /* Prevent pop noises when headphones are plugged in */
5103 snd_hda_codec_write(codec
, hp_pin
, 0,
5104 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
5108 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
5109 const struct hda_fixup
*fix
, int action
)
5111 struct alc_spec
*spec
= codec
->spec
;
5112 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
5116 case HDA_FIXUP_ACT_PRE_PROBE
:
5117 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
5118 * it causes a click noise at start up
5120 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5121 spec
->shutup
= alc_shutup_dell_xps13
;
5123 case HDA_FIXUP_ACT_PROBE
:
5124 /* Make the internal mic the default input source. */
5125 for (i
= 0; i
< imux
->num_items
; i
++) {
5126 if (spec
->gen
.imux_pins
[i
] == 0x12) {
5127 spec
->gen
.cur_mux
[0] = i
;
5135 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
5136 const struct hda_fixup
*fix
, int action
)
5138 struct alc_spec
*spec
= codec
->spec
;
5140 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5141 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
5142 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
5144 /* Disable boost for mic-in permanently. (This code is only called
5145 from quirks that guarantee that the headphone is at NID 0x1b.) */
5146 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
5147 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
5149 alc_fixup_headset_mode(codec
, fix
, action
);
5152 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
5153 const struct hda_fixup
*fix
, int action
)
5155 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5156 alc_write_coef_idx(codec
, 0xc4, 0x8000);
5157 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
5158 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
5160 alc_fixup_headset_mode(codec
, fix
, action
);
5163 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
5164 static int find_ext_mic_pin(struct hda_codec
*codec
)
5166 struct alc_spec
*spec
= codec
->spec
;
5167 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5169 unsigned int defcfg
;
5172 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5173 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5175 nid
= cfg
->inputs
[i
].pin
;
5176 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5177 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
5185 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
5186 const struct hda_fixup
*fix
,
5189 struct alc_spec
*spec
= codec
->spec
;
5191 if (action
== HDA_FIXUP_ACT_PROBE
) {
5192 int mic_pin
= find_ext_mic_pin(codec
);
5193 int hp_pin
= alc_get_hp_pin(spec
);
5195 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
5197 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
5201 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
5202 const struct hda_fixup
*fix
,
5205 struct alc_spec
*spec
= codec
->spec
;
5206 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
5209 /* The mic boosts on level 2 and 3 are too noisy
5210 on the internal mic input.
5211 Therefore limit the boost to 0 or 1. */
5213 if (action
!= HDA_FIXUP_ACT_PROBE
)
5216 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
5217 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
5218 unsigned int defcfg
;
5219 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
5221 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
5222 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
5225 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
5226 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
5227 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
5228 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
5229 (0 << AC_AMPCAP_MUTE_SHIFT
));
5233 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
5234 struct hda_jack_callback
*jack
)
5236 struct alc_spec
*spec
= codec
->spec
;
5240 snd_hda_gen_hp_automute(codec
, jack
);
5242 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
5245 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
5249 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
5250 const struct hda_fixup
*fix
, int action
)
5252 struct alc_spec
*spec
= codec
->spec
;
5255 case HDA_FIXUP_ACT_PRE_PROBE
:
5256 snd_hda_override_wcaps(codec
, 0x03, 0);
5257 /* Disable AA-loopback as it causes white noise */
5258 spec
->gen
.mixer_nid
= 0;
5260 case HDA_FIXUP_ACT_INIT
:
5261 /* MIC2-VREF control */
5262 /* Set to manual mode */
5263 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5264 /* Enable Line1 input control by verb */
5265 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
5270 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
5271 const struct hda_fixup
*fix
, int action
)
5273 struct alc_spec
*spec
= codec
->spec
;
5276 case HDA_FIXUP_ACT_PRE_PROBE
:
5277 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
5279 case HDA_FIXUP_ACT_INIT
:
5280 /* MIC2-VREF control */
5281 /* Set to manual mode */
5282 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
5287 /* mute tablet speaker pin (0x14) via dock plugging in addition */
5288 static void asus_tx300_automute(struct hda_codec
*codec
)
5290 struct alc_spec
*spec
= codec
->spec
;
5291 snd_hda_gen_update_outputs(codec
);
5292 if (snd_hda_jack_detect(codec
, 0x1b))
5293 spec
->gen
.mute_bits
|= (1ULL << 0x14);
5296 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
5297 const struct hda_fixup
*fix
, int action
)
5299 struct alc_spec
*spec
= codec
->spec
;
5300 static const struct hda_pintbl dock_pins
[] = {
5301 { 0x1b, 0x21114000 }, /* dock speaker pin */
5306 case HDA_FIXUP_ACT_PRE_PROBE
:
5307 spec
->init_amp
= ALC_INIT_DEFAULT
;
5308 /* TX300 needs to set up GPIO2 for the speaker amp */
5309 alc_setup_gpio(codec
, 0x04);
5310 snd_hda_apply_pincfgs(codec
, dock_pins
);
5311 spec
->gen
.auto_mute_via_amp
= 1;
5312 spec
->gen
.automute_hook
= asus_tx300_automute
;
5313 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
5314 snd_hda_gen_hp_automute
);
5316 case HDA_FIXUP_ACT_PROBE
:
5317 spec
->init_amp
= ALC_INIT_DEFAULT
;
5319 case HDA_FIXUP_ACT_BUILD
:
5320 /* this is a bit tricky; give more sane names for the main
5321 * (tablet) speaker and the dock speaker, respectively
5323 rename_ctl(codec
, "Speaker Playback Switch",
5324 "Dock Speaker Playback Switch");
5325 rename_ctl(codec
, "Bass Speaker Playback Switch",
5326 "Speaker Playback Switch");
5331 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
5332 const struct hda_fixup
*fix
, int action
)
5334 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5335 /* DAC node 0x03 is giving mono output. We therefore want to
5336 make sure 0x14 (front speaker) and 0x15 (headphones) use the
5337 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
5338 hda_nid_t conn1
[2] = { 0x0c };
5339 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
5340 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
5344 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
5345 const struct hda_fixup
*fix
, int action
)
5347 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5348 /* The speaker is routed to the Node 0x06 by a mistake, as a result
5349 we can't adjust the speaker's volume since this node does not has
5350 Amp-out capability. we change the speaker's route to:
5351 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
5352 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
5353 speaker's volume now. */
5355 hda_nid_t conn1
[1] = { 0x0c };
5356 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
5360 /* disable DAC3 (0x06) selection on NID 0x17 as it has no volume amp control */
5361 static void alc295_fixup_disable_dac3(struct hda_codec
*codec
,
5362 const struct hda_fixup
*fix
, int action
)
5364 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5365 hda_nid_t conn
[2] = { 0x02, 0x03 };
5366 snd_hda_override_conn_list(codec
, 0x17, 2, conn
);
5370 /* Hook to update amp GPIO4 for automute */
5371 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
5372 struct hda_jack_callback
*jack
)
5374 struct alc_spec
*spec
= codec
->spec
;
5376 snd_hda_gen_hp_automute(codec
, jack
);
5377 /* mute_led_polarity is set to 0, so we pass inverted value here */
5378 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
5381 /* Manage GPIOs for HP EliteBook Folio 9480m.
5383 * GPIO4 is the headphone amplifier power control
5384 * GPIO3 is the audio output mute indicator LED
5387 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5388 const struct hda_fixup
*fix
,
5391 struct alc_spec
*spec
= codec
->spec
;
5393 alc_fixup_hp_gpio_led(codec
, action
, 0x08, 0);
5394 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5395 /* amp at GPIO4; toggled via alc280_hp_gpio4_automute_hook() */
5396 spec
->gpio_mask
|= 0x10;
5397 spec
->gpio_dir
|= 0x10;
5398 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5402 static void alc275_fixup_gpio4_off(struct hda_codec
*codec
,
5403 const struct hda_fixup
*fix
,
5406 struct alc_spec
*spec
= codec
->spec
;
5408 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5409 spec
->gpio_mask
|= 0x04;
5410 spec
->gpio_dir
|= 0x04;
5411 /* set data bit low */
5415 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5416 const struct hda_fixup
*fix
,
5419 alc_fixup_dual_codecs(codec
, fix
, action
);
5421 case HDA_FIXUP_ACT_PRE_PROBE
:
5422 /* override card longname to provide a unique UCM profile */
5423 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5425 case HDA_FIXUP_ACT_BUILD
:
5426 /* rename Capture controls depending on the codec */
5427 rename_ctl(codec
, "Capture Volume",
5429 "Rear-Panel Capture Volume" :
5430 "Front-Panel Capture Volume");
5431 rename_ctl(codec
, "Capture Switch",
5433 "Rear-Panel Capture Switch" :
5434 "Front-Panel Capture Switch");
5439 /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */
5440 static void alc274_fixup_bind_dacs(struct hda_codec
*codec
,
5441 const struct hda_fixup
*fix
, int action
)
5443 struct alc_spec
*spec
= codec
->spec
;
5444 static hda_nid_t preferred_pairs
[] = {
5445 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02,
5449 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5452 spec
->gen
.preferred_dacs
= preferred_pairs
;
5453 spec
->gen
.auto_mute_via_amp
= 1;
5454 codec
->power_save_node
= 0;
5457 /* The DAC of NID 0x3 will introduce click/pop noise on headphones, so invalidate it */
5458 static void alc285_fixup_invalidate_dacs(struct hda_codec
*codec
,
5459 const struct hda_fixup
*fix
, int action
)
5461 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
5464 snd_hda_override_wcaps(codec
, 0x03, 0);
5467 static const struct hda_jack_keymap alc_headset_btn_keymap
[] = {
5468 { SND_JACK_BTN_0
, KEY_PLAYPAUSE
},
5469 { SND_JACK_BTN_1
, KEY_VOICECOMMAND
},
5470 { SND_JACK_BTN_2
, KEY_VOLUMEUP
},
5471 { SND_JACK_BTN_3
, KEY_VOLUMEDOWN
},
5475 static void alc_headset_btn_callback(struct hda_codec
*codec
,
5476 struct hda_jack_callback
*jack
)
5480 if (jack
->unsol_res
& (7 << 13))
5481 report
|= SND_JACK_BTN_0
;
5483 if (jack
->unsol_res
& (1 << 16 | 3 << 8))
5484 report
|= SND_JACK_BTN_1
;
5487 if (jack
->unsol_res
& (7 << 23))
5488 report
|= SND_JACK_BTN_2
;
5490 /* Volume down key */
5491 if (jack
->unsol_res
& (7 << 10))
5492 report
|= SND_JACK_BTN_3
;
5494 jack
->jack
->button_state
= report
;
5497 static void alc_fixup_headset_jack(struct hda_codec
*codec
,
5498 const struct hda_fixup
*fix
, int action
)
5502 case HDA_FIXUP_ACT_PRE_PROBE
:
5503 snd_hda_jack_detect_enable_callback(codec
, 0x55,
5504 alc_headset_btn_callback
);
5505 snd_hda_jack_add_kctl(codec
, 0x55, "Headset Jack", false,
5506 SND_JACK_HEADSET
, alc_headset_btn_keymap
);
5508 case HDA_FIXUP_ACT_INIT
:
5509 switch (codec
->core
.vendor_id
) {
5513 alc_write_coef_idx(codec
, 0x48, 0xd011);
5514 alc_update_coef_idx(codec
, 0x49, 0x007f, 0x0045);
5515 alc_update_coef_idx(codec
, 0x44, 0x007f << 8, 0x0045 << 8);
5519 alc_write_coef_idx(codec
, 0x48, 0xd011);
5520 alc_update_coef_idx(codec
, 0x49, 0x007f, 0x0045);
5527 static void alc295_fixup_chromebook(struct hda_codec
*codec
,
5528 const struct hda_fixup
*fix
, int action
)
5531 case HDA_FIXUP_ACT_INIT
:
5532 switch (codec
->core
.vendor_id
) {
5534 alc_update_coef_idx(codec
, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */
5535 alc_update_coef_idx(codec
, 0x4a, 0x8000, 0 << 15);
5538 alc_update_coef_idx(codec
, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
5539 alc_update_coef_idx(codec
, 0x1b, 0x8000, 0 << 15);
5546 static void alc_fixup_disable_mic_vref(struct hda_codec
*codec
,
5547 const struct hda_fixup
*fix
, int action
)
5549 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
5550 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
5553 /* for hda_fixup_thinkpad_acpi() */
5554 #include "thinkpad_helper.c"
5556 static void alc_fixup_thinkpad_acpi(struct hda_codec
*codec
,
5557 const struct hda_fixup
*fix
, int action
)
5559 alc_fixup_no_shutup(codec
, fix
, action
); /* reduce click noise */
5560 hda_fixup_thinkpad_acpi(codec
, fix
, action
);
5563 /* for alc295_fixup_hp_top_speakers */
5564 #include "hp_x360_helper.c"
5567 ALC269_FIXUP_SONY_VAIO
,
5568 ALC275_FIXUP_SONY_VAIO_GPIO2
,
5569 ALC269_FIXUP_DELL_M101Z
,
5570 ALC269_FIXUP_SKU_IGNORE
,
5571 ALC269_FIXUP_ASUS_G73JW
,
5572 ALC269_FIXUP_LENOVO_EAPD
,
5573 ALC275_FIXUP_SONY_HWEQ
,
5574 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
5576 ALC269_FIXUP_PCM_44K
,
5577 ALC269_FIXUP_STEREO_DMIC
,
5578 ALC269_FIXUP_HEADSET_MIC
,
5579 ALC269_FIXUP_QUANTA_MUTE
,
5580 ALC269_FIXUP_LIFEBOOK
,
5581 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
5582 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
5583 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
5584 ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
,
5587 ALC269VB_FIXUP_AMIC
,
5588 ALC269VB_FIXUP_DMIC
,
5589 ALC269_FIXUP_HP_MUTE_LED
,
5590 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5591 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
5592 ALC269_FIXUP_HP_MUTE_LED_MIC3
,
5593 ALC269_FIXUP_HP_GPIO_LED
,
5594 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
5595 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
5596 ALC269_FIXUP_INV_DMIC
,
5597 ALC269_FIXUP_LENOVO_DOCK
,
5598 ALC269_FIXUP_NO_SHUTUP
,
5599 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
5600 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
5601 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5602 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
5603 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5604 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
5605 ALC269_FIXUP_HEADSET_MODE
,
5606 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5607 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
5608 ALC269_FIXUP_ASUS_X101_FUNC
,
5609 ALC269_FIXUP_ASUS_X101_VERB
,
5610 ALC269_FIXUP_ASUS_X101
,
5611 ALC271_FIXUP_AMIC_MIC2
,
5612 ALC271_FIXUP_HP_GATE_MIC_JACK
,
5613 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
5614 ALC269_FIXUP_ACER_AC700
,
5615 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
5616 ALC269VB_FIXUP_ASUS_ZENBOOK
,
5617 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
5618 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
5619 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
5620 ALC283_FIXUP_CHROME_BOOK
,
5621 ALC283_FIXUP_SENSE_COMBO_JACK
,
5622 ALC282_FIXUP_ASUS_TX300
,
5623 ALC283_FIXUP_INT_MIC
,
5624 ALC290_FIXUP_MONO_SPEAKERS
,
5625 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5626 ALC290_FIXUP_SUBWOOFER
,
5627 ALC290_FIXUP_SUBWOOFER_HSJACK
,
5628 ALC269_FIXUP_THINKPAD_ACPI
,
5629 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
5630 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
5631 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
5632 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5633 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5634 ALC255_FIXUP_HEADSET_MODE
,
5635 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5636 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5637 ALC292_FIXUP_TPT440_DOCK
,
5638 ALC292_FIXUP_TPT440
,
5639 ALC283_FIXUP_HEADSET_MIC
,
5640 ALC255_FIXUP_MIC_MUTE_LED
,
5641 ALC282_FIXUP_ASPIRE_V5_PINS
,
5642 ALC280_FIXUP_HP_GPIO4
,
5643 ALC286_FIXUP_HP_GPIO_LED
,
5644 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
5645 ALC280_FIXUP_HP_DOCK_PINS
,
5646 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
5647 ALC280_FIXUP_HP_9480M
,
5648 ALC288_FIXUP_DELL_HEADSET_MODE
,
5649 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
5650 ALC288_FIXUP_DELL_XPS_13
,
5651 ALC288_FIXUP_DISABLE_AAMIX
,
5652 ALC292_FIXUP_DELL_E7X
,
5653 ALC292_FIXUP_DISABLE_AAMIX
,
5654 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
5655 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
5656 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5657 ALC275_FIXUP_DELL_XPS
,
5658 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
5659 ALC293_FIXUP_LENOVO_SPK_NOISE
,
5660 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
5661 ALC255_FIXUP_DELL_SPK_NOISE
,
5662 ALC225_FIXUP_DISABLE_MIC_VREF
,
5663 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5664 ALC295_FIXUP_DISABLE_DAC3
,
5665 ALC280_FIXUP_HP_HEADSET_MIC
,
5666 ALC221_FIXUP_HP_FRONT_MIC
,
5667 ALC292_FIXUP_TPT460
,
5668 ALC298_FIXUP_SPK_VOLUME
,
5669 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
5670 ALC269_FIXUP_ATIV_BOOK_8
,
5671 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
5672 ALC256_FIXUP_ASUS_HEADSET_MODE
,
5673 ALC256_FIXUP_ASUS_MIC
,
5674 ALC256_FIXUP_ASUS_AIO_GPIO2
,
5675 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
5676 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
5677 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
5678 ALC233_FIXUP_ACER_HEADSET_MIC
,
5679 ALC294_FIXUP_LENOVO_MIC_LOCATION
,
5680 ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
,
5681 ALC700_FIXUP_INTEL_REFERENCE
,
5682 ALC274_FIXUP_DELL_BIND_DACS
,
5683 ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
5684 ALC298_FIXUP_TPT470_DOCK
,
5685 ALC255_FIXUP_DUMMY_LINEOUT_VERB
,
5686 ALC255_FIXUP_DELL_HEADSET_MIC
,
5687 ALC256_FIXUP_HUAWEI_MBXP_PINS
,
5688 ALC295_FIXUP_HP_X360
,
5689 ALC221_FIXUP_HP_HEADSET_MIC
,
5690 ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
,
5691 ALC295_FIXUP_HP_AUTO_MUTE
,
5692 ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
5693 ALC294_FIXUP_ASUS_MIC
,
5694 ALC294_FIXUP_ASUS_HEADSET_MIC
,
5695 ALC294_FIXUP_ASUS_SPK
,
5696 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
,
5697 ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
5698 ALC255_FIXUP_ACER_HEADSET_MIC
,
5699 ALC295_FIXUP_CHROME_BOOK
,
5700 ALC225_FIXUP_HEADSET_JACK
,
5701 ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
,
5702 ALC225_FIXUP_WYSE_AUTO_MUTE
,
5703 ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
,
5704 ALC286_FIXUP_ACER_AIO_HEADSET_MIC
,
5705 ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
5706 ALC299_FIXUP_PREDATOR_SPK
,
5709 static const struct hda_fixup alc269_fixups
[] = {
5710 [ALC269_FIXUP_SONY_VAIO
] = {
5711 .type
= HDA_FIXUP_PINCTLS
,
5712 .v
.pins
= (const struct hda_pintbl
[]) {
5713 {0x19, PIN_VREFGRD
},
5717 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
5718 .type
= HDA_FIXUP_FUNC
,
5719 .v
.func
= alc275_fixup_gpio4_off
,
5721 .chain_id
= ALC269_FIXUP_SONY_VAIO
5723 [ALC269_FIXUP_DELL_M101Z
] = {
5724 .type
= HDA_FIXUP_VERBS
,
5725 .v
.verbs
= (const struct hda_verb
[]) {
5726 /* Enables internal speaker */
5727 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
5728 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
5732 [ALC269_FIXUP_SKU_IGNORE
] = {
5733 .type
= HDA_FIXUP_FUNC
,
5734 .v
.func
= alc_fixup_sku_ignore
,
5736 [ALC269_FIXUP_ASUS_G73JW
] = {
5737 .type
= HDA_FIXUP_PINS
,
5738 .v
.pins
= (const struct hda_pintbl
[]) {
5739 { 0x17, 0x99130111 }, /* subwoofer */
5743 [ALC269_FIXUP_LENOVO_EAPD
] = {
5744 .type
= HDA_FIXUP_VERBS
,
5745 .v
.verbs
= (const struct hda_verb
[]) {
5746 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5750 [ALC275_FIXUP_SONY_HWEQ
] = {
5751 .type
= HDA_FIXUP_FUNC
,
5752 .v
.func
= alc269_fixup_hweq
,
5754 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
5756 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
5757 .type
= HDA_FIXUP_FUNC
,
5758 .v
.func
= alc_fixup_disable_aamix
,
5760 .chain_id
= ALC269_FIXUP_SONY_VAIO
5762 [ALC271_FIXUP_DMIC
] = {
5763 .type
= HDA_FIXUP_FUNC
,
5764 .v
.func
= alc271_fixup_dmic
,
5766 [ALC269_FIXUP_PCM_44K
] = {
5767 .type
= HDA_FIXUP_FUNC
,
5768 .v
.func
= alc269_fixup_pcm_44k
,
5770 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5772 [ALC269_FIXUP_STEREO_DMIC
] = {
5773 .type
= HDA_FIXUP_FUNC
,
5774 .v
.func
= alc269_fixup_stereo_dmic
,
5776 [ALC269_FIXUP_HEADSET_MIC
] = {
5777 .type
= HDA_FIXUP_FUNC
,
5778 .v
.func
= alc269_fixup_headset_mic
,
5780 [ALC269_FIXUP_QUANTA_MUTE
] = {
5781 .type
= HDA_FIXUP_FUNC
,
5782 .v
.func
= alc269_fixup_quanta_mute
,
5784 [ALC269_FIXUP_LIFEBOOK
] = {
5785 .type
= HDA_FIXUP_PINS
,
5786 .v
.pins
= (const struct hda_pintbl
[]) {
5787 { 0x1a, 0x2101103f }, /* dock line-out */
5788 { 0x1b, 0x23a11040 }, /* dock mic-in */
5792 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5794 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5795 .type
= HDA_FIXUP_PINS
,
5796 .v
.pins
= (const struct hda_pintbl
[]) {
5797 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5801 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5802 .type
= HDA_FIXUP_PINS
,
5803 .v
.pins
= (const struct hda_pintbl
[]) {
5804 { 0x21, 0x0221102f }, /* HP out */
5808 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5809 .type
= HDA_FIXUP_FUNC
,
5810 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5812 [ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
] = {
5813 .type
= HDA_FIXUP_FUNC
,
5814 .v
.func
= alc269_fixup_pincfg_U7x7_headset_mic
,
5816 [ALC269_FIXUP_AMIC
] = {
5817 .type
= HDA_FIXUP_PINS
,
5818 .v
.pins
= (const struct hda_pintbl
[]) {
5819 { 0x14, 0x99130110 }, /* speaker */
5820 { 0x15, 0x0121401f }, /* HP out */
5821 { 0x18, 0x01a19c20 }, /* mic */
5822 { 0x19, 0x99a3092f }, /* int-mic */
5826 [ALC269_FIXUP_DMIC
] = {
5827 .type
= HDA_FIXUP_PINS
,
5828 .v
.pins
= (const struct hda_pintbl
[]) {
5829 { 0x12, 0x99a3092f }, /* int-mic */
5830 { 0x14, 0x99130110 }, /* speaker */
5831 { 0x15, 0x0121401f }, /* HP out */
5832 { 0x18, 0x01a19c20 }, /* mic */
5836 [ALC269VB_FIXUP_AMIC
] = {
5837 .type
= HDA_FIXUP_PINS
,
5838 .v
.pins
= (const struct hda_pintbl
[]) {
5839 { 0x14, 0x99130110 }, /* speaker */
5840 { 0x18, 0x01a19c20 }, /* mic */
5841 { 0x19, 0x99a3092f }, /* int-mic */
5842 { 0x21, 0x0121401f }, /* HP out */
5846 [ALC269VB_FIXUP_DMIC
] = {
5847 .type
= HDA_FIXUP_PINS
,
5848 .v
.pins
= (const struct hda_pintbl
[]) {
5849 { 0x12, 0x99a3092f }, /* int-mic */
5850 { 0x14, 0x99130110 }, /* speaker */
5851 { 0x18, 0x01a19c20 }, /* mic */
5852 { 0x21, 0x0121401f }, /* HP out */
5856 [ALC269_FIXUP_HP_MUTE_LED
] = {
5857 .type
= HDA_FIXUP_FUNC
,
5858 .v
.func
= alc269_fixup_hp_mute_led
,
5860 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5861 .type
= HDA_FIXUP_FUNC
,
5862 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5864 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5865 .type
= HDA_FIXUP_FUNC
,
5866 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5868 [ALC269_FIXUP_HP_MUTE_LED_MIC3
] = {
5869 .type
= HDA_FIXUP_FUNC
,
5870 .v
.func
= alc269_fixup_hp_mute_led_mic3
,
5872 .chain_id
= ALC295_FIXUP_HP_AUTO_MUTE
5874 [ALC269_FIXUP_HP_GPIO_LED
] = {
5875 .type
= HDA_FIXUP_FUNC
,
5876 .v
.func
= alc269_fixup_hp_gpio_led
,
5878 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5879 .type
= HDA_FIXUP_FUNC
,
5880 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5882 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5883 .type
= HDA_FIXUP_FUNC
,
5884 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5886 [ALC269_FIXUP_INV_DMIC
] = {
5887 .type
= HDA_FIXUP_FUNC
,
5888 .v
.func
= alc_fixup_inv_dmic
,
5890 [ALC269_FIXUP_NO_SHUTUP
] = {
5891 .type
= HDA_FIXUP_FUNC
,
5892 .v
.func
= alc_fixup_no_shutup
,
5894 [ALC269_FIXUP_LENOVO_DOCK
] = {
5895 .type
= HDA_FIXUP_PINS
,
5896 .v
.pins
= (const struct hda_pintbl
[]) {
5897 { 0x19, 0x23a11040 }, /* dock mic */
5898 { 0x1b, 0x2121103f }, /* dock headphone */
5902 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5904 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5905 .type
= HDA_FIXUP_FUNC
,
5906 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5908 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5910 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5911 .type
= HDA_FIXUP_PINS
,
5912 .v
.pins
= (const struct hda_pintbl
[]) {
5913 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5914 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5918 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5920 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5921 .type
= HDA_FIXUP_PINS
,
5922 .v
.pins
= (const struct hda_pintbl
[]) {
5923 { 0x16, 0x21014020 }, /* dock line out */
5924 { 0x19, 0x21a19030 }, /* dock mic */
5925 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5929 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5931 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5932 .type
= HDA_FIXUP_PINS
,
5933 .v
.pins
= (const struct hda_pintbl
[]) {
5934 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5938 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5940 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
5941 .type
= HDA_FIXUP_PINS
,
5942 .v
.pins
= (const struct hda_pintbl
[]) {
5943 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5944 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5948 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5950 [ALC269_FIXUP_HEADSET_MODE
] = {
5951 .type
= HDA_FIXUP_FUNC
,
5952 .v
.func
= alc_fixup_headset_mode
,
5954 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
5956 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5957 .type
= HDA_FIXUP_FUNC
,
5958 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
5960 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
5961 .type
= HDA_FIXUP_PINS
,
5962 .v
.pins
= (const struct hda_pintbl
[]) {
5963 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5967 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
5969 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
5970 .type
= HDA_FIXUP_PINS
,
5971 .v
.pins
= (const struct hda_pintbl
[]) {
5972 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5976 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5978 [ALC256_FIXUP_HUAWEI_MBXP_PINS
] = {
5979 .type
= HDA_FIXUP_PINS
,
5980 .v
.pins
= (const struct hda_pintbl
[]) {
5994 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
5996 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
5997 .type
= HDA_FIXUP_FUNC
,
5998 .v
.func
= alc269_fixup_x101_headset_mic
,
6000 [ALC269_FIXUP_ASUS_X101_VERB
] = {
6001 .type
= HDA_FIXUP_VERBS
,
6002 .v
.verbs
= (const struct hda_verb
[]) {
6003 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
6004 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
6005 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
6009 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
6011 [ALC269_FIXUP_ASUS_X101
] = {
6012 .type
= HDA_FIXUP_PINS
,
6013 .v
.pins
= (const struct hda_pintbl
[]) {
6014 { 0x18, 0x04a1182c }, /* Headset mic */
6018 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
6020 [ALC271_FIXUP_AMIC_MIC2
] = {
6021 .type
= HDA_FIXUP_PINS
,
6022 .v
.pins
= (const struct hda_pintbl
[]) {
6023 { 0x14, 0x99130110 }, /* speaker */
6024 { 0x19, 0x01a19c20 }, /* mic */
6025 { 0x1b, 0x99a7012f }, /* int-mic */
6026 { 0x21, 0x0121401f }, /* HP out */
6030 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
6031 .type
= HDA_FIXUP_FUNC
,
6032 .v
.func
= alc271_hp_gate_mic_jack
,
6034 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
6036 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
6037 .type
= HDA_FIXUP_FUNC
,
6038 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6040 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
6042 [ALC269_FIXUP_ACER_AC700
] = {
6043 .type
= HDA_FIXUP_PINS
,
6044 .v
.pins
= (const struct hda_pintbl
[]) {
6045 { 0x12, 0x99a3092f }, /* int-mic */
6046 { 0x14, 0x99130110 }, /* speaker */
6047 { 0x18, 0x03a11c20 }, /* mic */
6048 { 0x1e, 0x0346101e }, /* SPDIF1 */
6049 { 0x21, 0x0321101f }, /* HP out */
6053 .chain_id
= ALC271_FIXUP_DMIC
,
6055 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
6056 .type
= HDA_FIXUP_FUNC
,
6057 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6059 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6061 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
6062 .type
= HDA_FIXUP_FUNC
,
6063 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6065 .chain_id
= ALC269VB_FIXUP_DMIC
,
6067 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
6068 .type
= HDA_FIXUP_VERBS
,
6069 .v
.verbs
= (const struct hda_verb
[]) {
6070 /* class-D output amp +5dB */
6071 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
6072 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
6076 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
6078 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
6079 .type
= HDA_FIXUP_FUNC
,
6080 .v
.func
= alc269_fixup_limit_int_mic_boost
,
6082 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6084 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
6085 .type
= HDA_FIXUP_PINS
,
6086 .v
.pins
= (const struct hda_pintbl
[]) {
6087 { 0x12, 0x99a3092f }, /* int-mic */
6088 { 0x18, 0x03a11d20 }, /* mic */
6089 { 0x19, 0x411111f0 }, /* Unused bogus pin */
6093 [ALC283_FIXUP_CHROME_BOOK
] = {
6094 .type
= HDA_FIXUP_FUNC
,
6095 .v
.func
= alc283_fixup_chromebook
,
6097 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
6098 .type
= HDA_FIXUP_FUNC
,
6099 .v
.func
= alc283_fixup_sense_combo_jack
,
6101 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
6103 [ALC282_FIXUP_ASUS_TX300
] = {
6104 .type
= HDA_FIXUP_FUNC
,
6105 .v
.func
= alc282_fixup_asus_tx300
,
6107 [ALC283_FIXUP_INT_MIC
] = {
6108 .type
= HDA_FIXUP_VERBS
,
6109 .v
.verbs
= (const struct hda_verb
[]) {
6110 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
6111 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
6115 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6117 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
6118 .type
= HDA_FIXUP_PINS
,
6119 .v
.pins
= (const struct hda_pintbl
[]) {
6120 { 0x17, 0x90170112 }, /* subwoofer */
6124 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
6126 [ALC290_FIXUP_SUBWOOFER
] = {
6127 .type
= HDA_FIXUP_PINS
,
6128 .v
.pins
= (const struct hda_pintbl
[]) {
6129 { 0x17, 0x90170112 }, /* subwoofer */
6133 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
6135 [ALC290_FIXUP_MONO_SPEAKERS
] = {
6136 .type
= HDA_FIXUP_FUNC
,
6137 .v
.func
= alc290_fixup_mono_speakers
,
6139 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
6140 .type
= HDA_FIXUP_FUNC
,
6141 .v
.func
= alc290_fixup_mono_speakers
,
6143 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6145 [ALC269_FIXUP_THINKPAD_ACPI
] = {
6146 .type
= HDA_FIXUP_FUNC
,
6147 .v
.func
= alc_fixup_thinkpad_acpi
,
6149 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
6151 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
6152 .type
= HDA_FIXUP_FUNC
,
6153 .v
.func
= alc_fixup_inv_dmic
,
6155 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
6157 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
6158 .type
= HDA_FIXUP_PINS
,
6159 .v
.pins
= (const struct hda_pintbl
[]) {
6160 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6164 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6166 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6167 .type
= HDA_FIXUP_PINS
,
6168 .v
.pins
= (const struct hda_pintbl
[]) {
6169 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6173 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6175 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6176 .type
= HDA_FIXUP_PINS
,
6177 .v
.pins
= (const struct hda_pintbl
[]) {
6178 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6179 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6183 .chain_id
= ALC255_FIXUP_HEADSET_MODE
6185 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
6186 .type
= HDA_FIXUP_PINS
,
6187 .v
.pins
= (const struct hda_pintbl
[]) {
6188 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6192 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6194 [ALC255_FIXUP_HEADSET_MODE
] = {
6195 .type
= HDA_FIXUP_FUNC
,
6196 .v
.func
= alc_fixup_headset_mode_alc255
,
6198 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6200 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
6201 .type
= HDA_FIXUP_FUNC
,
6202 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
6204 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6205 .type
= HDA_FIXUP_PINS
,
6206 .v
.pins
= (const struct hda_pintbl
[]) {
6207 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6208 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6212 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6214 [ALC292_FIXUP_TPT440_DOCK
] = {
6215 .type
= HDA_FIXUP_FUNC
,
6216 .v
.func
= alc_fixup_tpt440_dock
,
6218 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6220 [ALC292_FIXUP_TPT440
] = {
6221 .type
= HDA_FIXUP_FUNC
,
6222 .v
.func
= alc_fixup_disable_aamix
,
6224 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
6226 [ALC283_FIXUP_HEADSET_MIC
] = {
6227 .type
= HDA_FIXUP_PINS
,
6228 .v
.pins
= (const struct hda_pintbl
[]) {
6229 { 0x19, 0x04a110f0 },
6233 [ALC255_FIXUP_MIC_MUTE_LED
] = {
6234 .type
= HDA_FIXUP_FUNC
,
6235 .v
.func
= snd_hda_gen_fixup_micmute_led
,
6237 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
6238 .type
= HDA_FIXUP_PINS
,
6239 .v
.pins
= (const struct hda_pintbl
[]) {
6240 { 0x12, 0x90a60130 },
6241 { 0x14, 0x90170110 },
6242 { 0x17, 0x40000008 },
6243 { 0x18, 0x411111f0 },
6244 { 0x19, 0x01a1913c },
6245 { 0x1a, 0x411111f0 },
6246 { 0x1b, 0x411111f0 },
6247 { 0x1d, 0x40f89b2d },
6248 { 0x1e, 0x411111f0 },
6249 { 0x21, 0x0321101f },
6253 [ALC280_FIXUP_HP_GPIO4
] = {
6254 .type
= HDA_FIXUP_FUNC
,
6255 .v
.func
= alc280_fixup_hp_gpio4
,
6257 [ALC286_FIXUP_HP_GPIO_LED
] = {
6258 .type
= HDA_FIXUP_FUNC
,
6259 .v
.func
= alc286_fixup_hp_gpio_led
,
6261 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
6262 .type
= HDA_FIXUP_FUNC
,
6263 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
6265 [ALC280_FIXUP_HP_DOCK_PINS
] = {
6266 .type
= HDA_FIXUP_PINS
,
6267 .v
.pins
= (const struct hda_pintbl
[]) {
6268 { 0x1b, 0x21011020 }, /* line-out */
6269 { 0x1a, 0x01a1903c }, /* headset mic */
6270 { 0x18, 0x2181103f }, /* line-in */
6274 .chain_id
= ALC280_FIXUP_HP_GPIO4
6276 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
6277 .type
= HDA_FIXUP_PINS
,
6278 .v
.pins
= (const struct hda_pintbl
[]) {
6279 { 0x1b, 0x21011020 }, /* line-out */
6280 { 0x18, 0x2181103f }, /* line-in */
6284 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
6286 [ALC280_FIXUP_HP_9480M
] = {
6287 .type
= HDA_FIXUP_FUNC
,
6288 .v
.func
= alc280_fixup_hp_9480m
,
6290 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
6291 .type
= HDA_FIXUP_FUNC
,
6292 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
6294 .chain_id
= ALC255_FIXUP_MIC_MUTE_LED
6296 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6297 .type
= HDA_FIXUP_PINS
,
6298 .v
.pins
= (const struct hda_pintbl
[]) {
6299 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6300 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6304 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
6306 [ALC288_FIXUP_DISABLE_AAMIX
] = {
6307 .type
= HDA_FIXUP_FUNC
,
6308 .v
.func
= alc_fixup_disable_aamix
,
6310 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
6312 [ALC288_FIXUP_DELL_XPS_13
] = {
6313 .type
= HDA_FIXUP_FUNC
,
6314 .v
.func
= alc_fixup_dell_xps13
,
6316 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
6318 [ALC292_FIXUP_DISABLE_AAMIX
] = {
6319 .type
= HDA_FIXUP_FUNC
,
6320 .v
.func
= alc_fixup_disable_aamix
,
6322 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
6324 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
6325 .type
= HDA_FIXUP_FUNC
,
6326 .v
.func
= alc_fixup_disable_aamix
,
6328 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
6330 [ALC292_FIXUP_DELL_E7X
] = {
6331 .type
= HDA_FIXUP_FUNC
,
6332 .v
.func
= alc_fixup_dell_xps13
,
6334 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
6336 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6337 .type
= HDA_FIXUP_PINS
,
6338 .v
.pins
= (const struct hda_pintbl
[]) {
6339 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6340 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6344 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6346 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
6347 .type
= HDA_FIXUP_PINS
,
6348 .v
.pins
= (const struct hda_pintbl
[]) {
6349 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6353 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6355 [ALC275_FIXUP_DELL_XPS
] = {
6356 .type
= HDA_FIXUP_VERBS
,
6357 .v
.verbs
= (const struct hda_verb
[]) {
6358 /* Enables internal speaker */
6359 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
6360 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
6361 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
6362 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
6366 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
6367 .type
= HDA_FIXUP_VERBS
,
6368 .v
.verbs
= (const struct hda_verb
[]) {
6369 /* Disable pass-through path for FRONT 14h */
6370 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
6371 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
6375 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6377 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
6378 .type
= HDA_FIXUP_FUNC
,
6379 .v
.func
= alc_fixup_disable_aamix
,
6381 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6383 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
6384 .type
= HDA_FIXUP_FUNC
,
6385 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
6387 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
6388 .type
= HDA_FIXUP_FUNC
,
6389 .v
.func
= alc_fixup_disable_aamix
,
6391 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6393 [ALC225_FIXUP_DISABLE_MIC_VREF
] = {
6394 .type
= HDA_FIXUP_FUNC
,
6395 .v
.func
= alc_fixup_disable_mic_vref
,
6397 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6399 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
6400 .type
= HDA_FIXUP_VERBS
,
6401 .v
.verbs
= (const struct hda_verb
[]) {
6402 /* Disable pass-through path for FRONT 14h */
6403 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6404 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6408 .chain_id
= ALC225_FIXUP_DISABLE_MIC_VREF
6410 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
6411 .type
= HDA_FIXUP_FUNC
,
6412 .v
.func
= alc_fixup_disable_aamix
,
6414 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
6416 [ALC221_FIXUP_HP_FRONT_MIC
] = {
6417 .type
= HDA_FIXUP_PINS
,
6418 .v
.pins
= (const struct hda_pintbl
[]) {
6419 { 0x19, 0x02a19020 }, /* Front Mic */
6423 [ALC292_FIXUP_TPT460
] = {
6424 .type
= HDA_FIXUP_FUNC
,
6425 .v
.func
= alc_fixup_tpt440_dock
,
6427 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
6429 [ALC298_FIXUP_SPK_VOLUME
] = {
6430 .type
= HDA_FIXUP_FUNC
,
6431 .v
.func
= alc298_fixup_speaker_volume
,
6433 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
6435 [ALC295_FIXUP_DISABLE_DAC3
] = {
6436 .type
= HDA_FIXUP_FUNC
,
6437 .v
.func
= alc295_fixup_disable_dac3
,
6439 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
6440 .type
= HDA_FIXUP_PINS
,
6441 .v
.pins
= (const struct hda_pintbl
[]) {
6442 { 0x1b, 0x90170151 },
6446 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6448 [ALC269_FIXUP_ATIV_BOOK_8
] = {
6449 .type
= HDA_FIXUP_FUNC
,
6450 .v
.func
= alc_fixup_auto_mute_via_amp
,
6452 .chain_id
= ALC269_FIXUP_NO_SHUTUP
6454 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
6455 .type
= HDA_FIXUP_PINS
,
6456 .v
.pins
= (const struct hda_pintbl
[]) {
6457 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6458 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
6462 .chain_id
= ALC269_FIXUP_HEADSET_MODE
6464 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
6465 .type
= HDA_FIXUP_FUNC
,
6466 .v
.func
= alc_fixup_headset_mode
,
6468 [ALC256_FIXUP_ASUS_MIC
] = {
6469 .type
= HDA_FIXUP_PINS
,
6470 .v
.pins
= (const struct hda_pintbl
[]) {
6471 { 0x13, 0x90a60160 }, /* use as internal mic */
6472 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6476 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6478 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
6479 .type
= HDA_FIXUP_FUNC
,
6480 /* Set up GPIO2 for the speaker amp */
6481 .v
.func
= alc_fixup_gpio4
,
6483 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6484 .type
= HDA_FIXUP_PINS
,
6485 .v
.pins
= (const struct hda_pintbl
[]) {
6486 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6490 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6492 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
6493 .type
= HDA_FIXUP_VERBS
,
6494 .v
.verbs
= (const struct hda_verb
[]) {
6495 /* Enables internal speaker */
6496 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
6497 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
6501 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6503 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
6504 .type
= HDA_FIXUP_FUNC
,
6505 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
6507 [ALC233_FIXUP_ACER_HEADSET_MIC
] = {
6508 .type
= HDA_FIXUP_VERBS
,
6509 .v
.verbs
= (const struct hda_verb
[]) {
6510 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x45 },
6511 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5089 },
6515 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
6517 [ALC294_FIXUP_LENOVO_MIC_LOCATION
] = {
6518 .type
= HDA_FIXUP_PINS
,
6519 .v
.pins
= (const struct hda_pintbl
[]) {
6520 /* Change the mic location from front to right, otherwise there are
6521 two front mics with the same name, pulseaudio can't handle them.
6522 This is just a temporary workaround, after applying this fixup,
6523 there will be one "Front Mic" and one "Mic" in this machine.
6525 { 0x1a, 0x04a19040 },
6529 [ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
] = {
6530 .type
= HDA_FIXUP_PINS
,
6531 .v
.pins
= (const struct hda_pintbl
[]) {
6532 { 0x16, 0x0101102f }, /* Rear Headset HP */
6533 { 0x19, 0x02a1913c }, /* use as Front headset mic, without its own jack detect */
6534 { 0x1a, 0x01a19030 }, /* Rear Headset MIC */
6535 { 0x1b, 0x02011020 },
6539 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6541 [ALC700_FIXUP_INTEL_REFERENCE
] = {
6542 .type
= HDA_FIXUP_VERBS
,
6543 .v
.verbs
= (const struct hda_verb
[]) {
6544 /* Enables internal speaker */
6545 {0x20, AC_VERB_SET_COEF_INDEX
, 0x45},
6546 {0x20, AC_VERB_SET_PROC_COEF
, 0x5289},
6547 {0x20, AC_VERB_SET_COEF_INDEX
, 0x4A},
6548 {0x20, AC_VERB_SET_PROC_COEF
, 0x001b},
6549 {0x58, AC_VERB_SET_COEF_INDEX
, 0x00},
6550 {0x58, AC_VERB_SET_PROC_COEF
, 0x3888},
6551 {0x20, AC_VERB_SET_COEF_INDEX
, 0x6f},
6552 {0x20, AC_VERB_SET_PROC_COEF
, 0x2c0b},
6556 [ALC274_FIXUP_DELL_BIND_DACS
] = {
6557 .type
= HDA_FIXUP_FUNC
,
6558 .v
.func
= alc274_fixup_bind_dacs
,
6560 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
6562 [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
] = {
6563 .type
= HDA_FIXUP_PINS
,
6564 .v
.pins
= (const struct hda_pintbl
[]) {
6565 { 0x1b, 0x0401102f },
6569 .chain_id
= ALC274_FIXUP_DELL_BIND_DACS
6571 [ALC298_FIXUP_TPT470_DOCK
] = {
6572 .type
= HDA_FIXUP_FUNC
,
6573 .v
.func
= alc_fixup_tpt470_dock
,
6575 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
6577 [ALC255_FIXUP_DUMMY_LINEOUT_VERB
] = {
6578 .type
= HDA_FIXUP_PINS
,
6579 .v
.pins
= (const struct hda_pintbl
[]) {
6580 { 0x14, 0x0201101f },
6584 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
6586 [ALC255_FIXUP_DELL_HEADSET_MIC
] = {
6587 .type
= HDA_FIXUP_PINS
,
6588 .v
.pins
= (const struct hda_pintbl
[]) {
6589 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6593 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6595 [ALC295_FIXUP_HP_X360
] = {
6596 .type
= HDA_FIXUP_FUNC
,
6597 .v
.func
= alc295_fixup_hp_top_speakers
,
6599 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC3
6601 [ALC221_FIXUP_HP_HEADSET_MIC
] = {
6602 .type
= HDA_FIXUP_PINS
,
6603 .v
.pins
= (const struct hda_pintbl
[]) {
6604 { 0x19, 0x0181313f},
6608 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6610 [ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
] = {
6611 .type
= HDA_FIXUP_FUNC
,
6612 .v
.func
= alc285_fixup_invalidate_dacs
,
6614 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
6616 [ALC295_FIXUP_HP_AUTO_MUTE
] = {
6617 .type
= HDA_FIXUP_FUNC
,
6618 .v
.func
= alc_fixup_auto_mute_via_amp
,
6620 [ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
] = {
6621 .type
= HDA_FIXUP_PINS
,
6622 .v
.pins
= (const struct hda_pintbl
[]) {
6623 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6627 .chain_id
= ALC269_FIXUP_HEADSET_MIC
6629 [ALC294_FIXUP_ASUS_MIC
] = {
6630 .type
= HDA_FIXUP_PINS
,
6631 .v
.pins
= (const struct hda_pintbl
[]) {
6632 { 0x13, 0x90a60160 }, /* use as internal mic */
6633 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6637 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6639 [ALC294_FIXUP_ASUS_HEADSET_MIC
] = {
6640 .type
= HDA_FIXUP_PINS
,
6641 .v
.pins
= (const struct hda_pintbl
[]) {
6642 { 0x19, 0x01a1103c }, /* use as headset mic */
6646 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6648 [ALC294_FIXUP_ASUS_SPK
] = {
6649 .type
= HDA_FIXUP_VERBS
,
6650 .v
.verbs
= (const struct hda_verb
[]) {
6652 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x40 },
6653 { 0x20, AC_VERB_SET_PROC_COEF
, 0x8800 },
6657 .chain_id
= ALC294_FIXUP_ASUS_HEADSET_MIC
6659 [ALC295_FIXUP_CHROME_BOOK
] = {
6660 .type
= HDA_FIXUP_FUNC
,
6661 .v
.func
= alc295_fixup_chromebook
,
6663 .chain_id
= ALC225_FIXUP_HEADSET_JACK
6665 [ALC225_FIXUP_HEADSET_JACK
] = {
6666 .type
= HDA_FIXUP_FUNC
,
6667 .v
.func
= alc_fixup_headset_jack
,
6669 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
] = {
6670 .type
= HDA_FIXUP_PINS
,
6671 .v
.pins
= (const struct hda_pintbl
[]) {
6672 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6676 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6678 [ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
] = {
6679 .type
= HDA_FIXUP_VERBS
,
6680 .v
.verbs
= (const struct hda_verb
[]) {
6681 /* Disable PCBEEP-IN passthrough */
6682 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
6683 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
6687 .chain_id
= ALC285_FIXUP_LENOVO_HEADPHONE_NOISE
6689 [ALC255_FIXUP_ACER_HEADSET_MIC
] = {
6690 .type
= HDA_FIXUP_PINS
,
6691 .v
.pins
= (const struct hda_pintbl
[]) {
6692 { 0x19, 0x03a11130 },
6693 { 0x1a, 0x90a60140 }, /* use as internal mic */
6697 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
6699 [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
] = {
6700 .type
= HDA_FIXUP_PINS
,
6701 .v
.pins
= (const struct hda_pintbl
[]) {
6702 { 0x16, 0x01011020 }, /* Rear Line out */
6703 { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */
6707 .chain_id
= ALC225_FIXUP_WYSE_AUTO_MUTE
6709 [ALC225_FIXUP_WYSE_AUTO_MUTE
] = {
6710 .type
= HDA_FIXUP_FUNC
,
6711 .v
.func
= alc_fixup_auto_mute_via_amp
,
6713 .chain_id
= ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
6715 [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF
] = {
6716 .type
= HDA_FIXUP_FUNC
,
6717 .v
.func
= alc_fixup_disable_mic_vref
,
6719 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6721 [ALC286_FIXUP_ACER_AIO_HEADSET_MIC
] = {
6722 .type
= HDA_FIXUP_VERBS
,
6723 .v
.verbs
= (const struct hda_verb
[]) {
6724 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x4f },
6725 { 0x20, AC_VERB_SET_PROC_COEF
, 0x5029 },
6729 .chain_id
= ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
6731 [ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
6732 .type
= HDA_FIXUP_PINS
,
6733 .v
.pins
= (const struct hda_pintbl
[]) {
6734 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
6738 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
6740 [ALC299_FIXUP_PREDATOR_SPK
] = {
6741 .type
= HDA_FIXUP_PINS
,
6742 .v
.pins
= (const struct hda_pintbl
[]) {
6743 { 0x21, 0x90170150 }, /* use as headset mic, without its own jack detect */
6749 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
6750 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
6751 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
6752 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
6753 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
6754 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6755 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
6756 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6757 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
6758 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6759 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
6760 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
6761 SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
),
6762 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
6763 SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
6764 SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
),
6765 SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK
),
6766 SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6767 SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6768 SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6769 SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC
),
6770 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC
),
6771 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC
),
6772 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
6773 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
6774 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
6775 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
6776 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
6777 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
6778 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
6779 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6780 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6781 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
6782 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6783 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6784 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
6785 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
6786 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
6787 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6788 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6789 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
6790 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6791 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6792 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6793 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6794 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6795 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6796 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6797 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6798 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6799 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6800 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6801 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6802 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
6803 SND_PCI_QUIRK(0x1028, 0x0738, "Dell Precision 5820", ALC269_FIXUP_NO_SHUTUP
),
6804 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6805 SND_PCI_QUIRK(0x1028, 0x075c, "Dell XPS 27 7760", ALC298_FIXUP_SPK_VOLUME
),
6806 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
6807 SND_PCI_QUIRK(0x1028, 0x07b0, "Dell Precision 7520", ALC295_FIXUP_DISABLE_DAC3
),
6808 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6809 SND_PCI_QUIRK(0x1028, 0x080c, "Dell WYSE", ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
),
6810 SND_PCI_QUIRK(0x1028, 0x082a, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6811 SND_PCI_QUIRK(0x1028, 0x084b, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6812 SND_PCI_QUIRK(0x1028, 0x084e, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6813 SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6814 SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC
),
6815 SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB
),
6816 SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE
),
6817 SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
),
6818 SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
),
6819 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6820 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6821 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
6822 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
6823 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
6824 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
6826 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6827 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6828 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6829 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6830 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6831 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6832 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6833 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6834 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6835 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6836 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6837 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6838 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
6839 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6840 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6841 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6842 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6843 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6844 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6845 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6846 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
6847 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6848 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6850 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6851 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6852 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6853 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6854 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6855 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6856 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6857 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6858 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6859 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
6860 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6861 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6862 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6863 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6864 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6865 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6866 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6867 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6868 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6869 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6870 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6871 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6872 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6873 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6874 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6875 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6876 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6877 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6878 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6879 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
6880 SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6881 SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6882 SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
6883 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
6884 SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360
),
6885 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6886 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6887 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3
),
6888 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6889 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
6890 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6891 SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK
),
6892 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6893 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6894 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6895 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6896 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6897 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6898 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
6899 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
6900 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
6901 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
6902 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
6903 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
6904 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
6905 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
6906 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
6907 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6908 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6909 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
6910 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
6911 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
6912 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
6913 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6914 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6915 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
6916 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6917 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6918 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
6919 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6920 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6921 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
6922 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
6923 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
6924 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6925 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6926 SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
),
6927 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
6928 SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE
),
6929 SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE
),
6930 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
6931 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
6932 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
6933 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
6934 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC
),
6935 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE
),
6936 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
6937 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
6938 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
6939 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
6940 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
6941 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
6942 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
6943 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
6944 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
6945 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
6946 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
6947 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
6948 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
6949 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
6950 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
6951 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
6952 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
6953 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
6954 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6955 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
6956 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
6957 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
6958 SND_PCI_QUIRK(0x17aa, 0x222d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6959 SND_PCI_QUIRK(0x17aa, 0x222e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6960 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
6961 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
6962 SND_PCI_QUIRK(0x17aa, 0x2245, "Thinkpad T470", ALC298_FIXUP_TPT470_DOCK
),
6963 SND_PCI_QUIRK(0x17aa, 0x2246, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6964 SND_PCI_QUIRK(0x17aa, 0x2247, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6965 SND_PCI_QUIRK(0x17aa, 0x2249, "Thinkpad", ALC292_FIXUP_TPT460
),
6966 SND_PCI_QUIRK(0x17aa, 0x224b, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6967 SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6968 SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6969 SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6970 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6971 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6972 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6973 SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6974 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6975 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION
),
6976 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
6977 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
6978 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP
),
6979 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6980 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
6981 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
6982 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6983 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
6984 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
6985 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
6986 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
6987 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
6988 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
6989 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
6990 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
6991 SND_PCI_QUIRK(0x17aa, 0x505d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6992 SND_PCI_QUIRK(0x17aa, 0x505f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6993 SND_PCI_QUIRK(0x17aa, 0x5062, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6994 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6995 SND_PCI_QUIRK(0x17aa, 0x511e, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6996 SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK
),
6997 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
6998 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
6999 SND_PCI_QUIRK(0x19e5, 0x3200, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED
),
7000 SND_PCI_QUIRK(0x19e5, 0x3201, "Huawei MBX", ALC255_FIXUP_MIC_MUTE_LED
),
7001 SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MBXP", ALC256_FIXUP_HUAWEI_MBXP_PINS
),
7002 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
7005 /* Below is a quirk table taken from the old code.
7006 * Basically the device should work as is without the fixup table.
7007 * If BIOS doesn't give a proper info, enable the corresponding
7010 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
7012 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
7013 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
7014 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
7015 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
7016 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
7017 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
7018 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
7019 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
7020 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
7021 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
7022 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
7023 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
7024 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
7025 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
7026 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
7027 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
7028 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
7029 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
7030 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
7031 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
7032 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
7033 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
7034 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
7035 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
7036 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
7037 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
7038 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
7039 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
7040 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
7041 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
7042 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
7043 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
7044 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
7045 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
7046 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
7047 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
7048 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
7049 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
7050 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
7055 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
7056 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
7057 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
7058 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
7059 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
7063 static const struct hda_model_fixup alc269_fixup_models
[] = {
7064 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
7065 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
7066 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
7067 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
7068 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
7069 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
7070 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
7071 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
7072 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
7073 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
7074 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
7075 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
7076 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
7077 {.id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
, .name
= "dell-headset3"},
7078 {.id
= ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
, .name
= "dell-headset4"},
7079 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
7080 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
7081 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
7082 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
7083 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
7084 {.id
= ALC298_FIXUP_TPT470_DOCK
, .name
= "tpt470-dock"},
7085 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
7086 {.id
= ALC700_FIXUP_INTEL_REFERENCE
, .name
= "alc700-ref"},
7087 {.id
= ALC269_FIXUP_SONY_VAIO
, .name
= "vaio"},
7088 {.id
= ALC269_FIXUP_DELL_M101Z
, .name
= "dell-m101z"},
7089 {.id
= ALC269_FIXUP_ASUS_G73JW
, .name
= "asus-g73jw"},
7090 {.id
= ALC269_FIXUP_LENOVO_EAPD
, .name
= "lenovo-eapd"},
7091 {.id
= ALC275_FIXUP_SONY_HWEQ
, .name
= "sony-hweq"},
7092 {.id
= ALC269_FIXUP_PCM_44K
, .name
= "pcm44k"},
7093 {.id
= ALC269_FIXUP_LIFEBOOK
, .name
= "lifebook"},
7094 {.id
= ALC269_FIXUP_LIFEBOOK_EXTMIC
, .name
= "lifebook-extmic"},
7095 {.id
= ALC269_FIXUP_LIFEBOOK_HP_PIN
, .name
= "lifebook-hp-pin"},
7096 {.id
= ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC
, .name
= "lifebook-u7x7"},
7097 {.id
= ALC269VB_FIXUP_AMIC
, .name
= "alc269vb-amic"},
7098 {.id
= ALC269VB_FIXUP_DMIC
, .name
= "alc269vb-dmic"},
7099 {.id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
, .name
= "hp-mute-led-mic1"},
7100 {.id
= ALC269_FIXUP_HP_MUTE_LED_MIC2
, .name
= "hp-mute-led-mic2"},
7101 {.id
= ALC269_FIXUP_HP_MUTE_LED_MIC3
, .name
= "hp-mute-led-mic3"},
7102 {.id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
, .name
= "hp-gpio-mic1"},
7103 {.id
= ALC269_FIXUP_HP_LINE1_MIC1_LED
, .name
= "hp-line1-mic1"},
7104 {.id
= ALC269_FIXUP_NO_SHUTUP
, .name
= "noshutup"},
7105 {.id
= ALC286_FIXUP_SONY_MIC_NO_PRESENCE
, .name
= "sony-nomic"},
7106 {.id
= ALC269_FIXUP_ASPIRE_HEADSET_MIC
, .name
= "aspire-headset-mic"},
7107 {.id
= ALC269_FIXUP_ASUS_X101
, .name
= "asus-x101"},
7108 {.id
= ALC271_FIXUP_HP_GATE_MIC_JACK
, .name
= "acer-ao7xx"},
7109 {.id
= ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
, .name
= "acer-aspire-e1"},
7110 {.id
= ALC269_FIXUP_ACER_AC700
, .name
= "acer-ac700"},
7111 {.id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
, .name
= "limit-mic-boost"},
7112 {.id
= ALC269VB_FIXUP_ASUS_ZENBOOK
, .name
= "asus-zenbook"},
7113 {.id
= ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
, .name
= "asus-zenbook-ux31a"},
7114 {.id
= ALC269VB_FIXUP_ORDISSIMO_EVE2
, .name
= "ordissimo"},
7115 {.id
= ALC282_FIXUP_ASUS_TX300
, .name
= "asus-tx300"},
7116 {.id
= ALC283_FIXUP_INT_MIC
, .name
= "alc283-int-mic"},
7117 {.id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
, .name
= "mono-speakers"},
7118 {.id
= ALC290_FIXUP_SUBWOOFER_HSJACK
, .name
= "alc290-subwoofer"},
7119 {.id
= ALC269_FIXUP_THINKPAD_ACPI
, .name
= "thinkpad"},
7120 {.id
= ALC269_FIXUP_DMIC_THINKPAD_ACPI
, .name
= "dmic-thinkpad"},
7121 {.id
= ALC255_FIXUP_ACER_MIC_NO_PRESENCE
, .name
= "alc255-acer"},
7122 {.id
= ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
, .name
= "alc255-asus"},
7123 {.id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc255-dell1"},
7124 {.id
= ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "alc255-dell2"},
7125 {.id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc293-dell1"},
7126 {.id
= ALC283_FIXUP_HEADSET_MIC
, .name
= "alc283-headset"},
7127 {.id
= ALC255_FIXUP_MIC_MUTE_LED
, .name
= "alc255-dell-mute"},
7128 {.id
= ALC282_FIXUP_ASPIRE_V5_PINS
, .name
= "aspire-v5"},
7129 {.id
= ALC280_FIXUP_HP_GPIO4
, .name
= "hp-gpio4"},
7130 {.id
= ALC286_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
7131 {.id
= ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
, .name
= "hp-gpio2-hotkey"},
7132 {.id
= ALC280_FIXUP_HP_DOCK_PINS
, .name
= "hp-dock-pins"},
7133 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic"},
7134 {.id
= ALC280_FIXUP_HP_9480M
, .name
= "hp-9480m"},
7135 {.id
= ALC288_FIXUP_DELL_HEADSET_MODE
, .name
= "alc288-dell-headset"},
7136 {.id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc288-dell1"},
7137 {.id
= ALC288_FIXUP_DELL_XPS_13
, .name
= "alc288-dell-xps13"},
7138 {.id
= ALC292_FIXUP_DELL_E7X
, .name
= "dell-e7x"},
7139 {.id
= ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
, .name
= "alc293-dell"},
7140 {.id
= ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc298-dell1"},
7141 {.id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
, .name
= "alc298-dell-aio"},
7142 {.id
= ALC275_FIXUP_DELL_XPS
, .name
= "alc275-dell-xps"},
7143 {.id
= ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
, .name
= "alc256-dell-xps13"},
7144 {.id
= ALC293_FIXUP_LENOVO_SPK_NOISE
, .name
= "lenovo-spk-noise"},
7145 {.id
= ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
, .name
= "lenovo-hotkey"},
7146 {.id
= ALC255_FIXUP_DELL_SPK_NOISE
, .name
= "dell-spk-noise"},
7147 {.id
= ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "alc225-dell1"},
7148 {.id
= ALC295_FIXUP_DISABLE_DAC3
, .name
= "alc295-disable-dac3"},
7149 {.id
= ALC280_FIXUP_HP_HEADSET_MIC
, .name
= "alc280-hp-headset"},
7150 {.id
= ALC221_FIXUP_HP_FRONT_MIC
, .name
= "alc221-hp-mic"},
7151 {.id
= ALC298_FIXUP_SPK_VOLUME
, .name
= "alc298-spk-volume"},
7152 {.id
= ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
, .name
= "dell-inspiron-7559"},
7153 {.id
= ALC269_FIXUP_ATIV_BOOK_8
, .name
= "ativ-book"},
7154 {.id
= ALC221_FIXUP_HP_MIC_NO_PRESENCE
, .name
= "alc221-hp-mic"},
7155 {.id
= ALC256_FIXUP_ASUS_HEADSET_MODE
, .name
= "alc256-asus-headset"},
7156 {.id
= ALC256_FIXUP_ASUS_MIC
, .name
= "alc256-asus-mic"},
7157 {.id
= ALC256_FIXUP_ASUS_AIO_GPIO2
, .name
= "alc256-asus-aio"},
7158 {.id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
, .name
= "alc233-asus"},
7159 {.id
= ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
, .name
= "alc233-eapd"},
7160 {.id
= ALC294_FIXUP_LENOVO_MIC_LOCATION
, .name
= "alc294-lenovo-mic"},
7161 {.id
= ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE
, .name
= "alc225-wyse"},
7162 {.id
= ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
, .name
= "alc274-dell-aio"},
7163 {.id
= ALC255_FIXUP_DUMMY_LINEOUT_VERB
, .name
= "alc255-dummy-lineout"},
7164 {.id
= ALC255_FIXUP_DELL_HEADSET_MIC
, .name
= "alc255-dell-headset"},
7165 {.id
= ALC295_FIXUP_HP_X360
, .name
= "alc295-hp-x360"},
7166 {.id
= ALC225_FIXUP_HEADSET_JACK
, .name
= "alc-headset-jack"},
7167 {.id
= ALC295_FIXUP_CHROME_BOOK
, .name
= "alc-chrome-book"},
7168 {.id
= ALC299_FIXUP_PREDATOR_SPK
, .name
= "predator-spk"},
7171 #define ALC225_STANDARD_PINS \
7174 #define ALC256_STANDARD_PINS \
7175 {0x12, 0x90a60140}, \
7176 {0x14, 0x90170110}, \
7179 #define ALC282_STANDARD_PINS \
7182 #define ALC290_STANDARD_PINS \
7185 #define ALC292_STANDARD_PINS \
7186 {0x14, 0x90170110}, \
7189 #define ALC295_STANDARD_PINS \
7190 {0x12, 0xb7a60130}, \
7191 {0x14, 0x90170110}, \
7194 #define ALC298_STANDARD_PINS \
7195 {0x12, 0x90a60130}, \
7198 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
7199 SND_HDA_PIN_QUIRK(0x10ec0221, 0x103c, "HP Workstation", ALC221_FIXUP_HP_HEADSET_MIC
,
7204 {0x21, 0x0221102f}),
7205 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
7208 {0x21, 0x02211030}),
7209 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
7212 {0x21, 0x03211020}),
7213 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
7216 {0x21, 0x03211020}),
7217 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7218 ALC225_STANDARD_PINS
,
7220 {0x14, 0x901701a0}),
7221 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7222 ALC225_STANDARD_PINS
,
7224 {0x14, 0x901701b0}),
7225 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7226 ALC225_STANDARD_PINS
,
7228 {0x14, 0x901701a0}),
7229 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7230 ALC225_STANDARD_PINS
,
7232 {0x14, 0x901701b0}),
7233 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
7234 ALC225_STANDARD_PINS
,
7236 {0x1b, 0x90170110}),
7237 SND_HDA_PIN_QUIRK(0x10ec0233, 0x8086, "Intel NUC Skull Canyon", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7240 {0x21, 0x02211020}),
7241 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
7245 {0x21, 0x02211020}),
7246 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7251 {0x21, 0x0221101f}),
7252 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7257 {0x21, 0x0221101f}),
7258 SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION
,
7262 {0x21, 0x0221101f}),
7263 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7266 {0x21, 0x02211020}),
7267 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7270 {0x21, 0x02211020}),
7271 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7272 {0x21, 0x02211020}),
7273 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7276 {0x21, 0x02211020}),
7277 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
7279 {0x21, 0x02211020}),
7280 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7282 {0x21, 0x02211040}),
7283 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7286 {0x21, 0x02211020}),
7287 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7290 {0x21, 0x02211030}),
7291 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7294 {0x21, 0x0221101f}),
7295 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7298 {0x21, 0x0221101f}),
7299 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7302 {0x21, 0x0221103f}),
7303 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7306 {0x21, 0x0221103f}),
7307 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7310 {0x21, 0x0221103f}),
7311 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7314 {0x21, 0x0221105f}),
7315 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7318 {0x21, 0x0221101f}),
7319 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7323 {0x21, 0x0321102f}),
7324 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7327 {0x21, 0x02211040}),
7328 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7331 {0x21, 0x02211050}),
7332 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7335 {0x21, 0x02211030}),
7336 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7339 {0x21, 0x02211040}),
7340 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7343 {0x21, 0x02211040}),
7344 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7347 {0x21, 0x02211050}),
7348 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7351 {0x21, 0x02211040}),
7352 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7355 {0x21, 0x02211030}),
7356 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7358 {0x21, 0x02211010}),
7359 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7363 {0x21, 0x0221101f}),
7364 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7367 {0x21, 0x02211030}),
7368 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7371 {0x21, 0x02211030}),
7372 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7375 {0x21, 0x02211030}),
7376 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7379 {0x21, 0x02211020}),
7380 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7384 {0x21, 0x0221101f}),
7385 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7386 ALC256_STANDARD_PINS
),
7387 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
7390 {0x21, 0x0221101f}),
7391 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7394 {0x21, 0x04211020}),
7395 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
7398 {0x21, 0x03211020}),
7399 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7402 {0x21, 0x03211020}),
7403 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7406 {0x21, 0x04211020}),
7407 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE
,
7410 {0x21, 0x03211020}),
7411 SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB
,
7415 {0x21, 0x04211020}),
7416 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
7420 {0x1a, 0x04a11020}),
7421 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
7427 {0x1b, 0x02011020}),
7428 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7429 ALC282_STANDARD_PINS
,
7432 {0x21, 0x0321101f}),
7433 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7434 ALC282_STANDARD_PINS
,
7437 {0x21, 0x03211040}),
7438 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7439 ALC282_STANDARD_PINS
,
7442 {0x21, 0x03211020}),
7443 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7444 ALC282_STANDARD_PINS
,
7447 {0x21, 0x0421101f}),
7448 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
7449 ALC282_STANDARD_PINS
,
7452 {0x21, 0x04211020}),
7453 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7454 ALC282_STANDARD_PINS
,
7456 {0x21, 0x0321101f}),
7457 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7460 {0x21, 0x02211030}),
7461 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7462 ALC282_STANDARD_PINS
,
7465 {0x21, 0x0321101f}),
7466 SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE
,
7470 {0x21, 0x04211020}),
7471 SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE
,
7474 {0x21, 0x02211020}),
7475 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
7478 {0x21, 0x0321101f}),
7479 SND_HDA_PIN_QUIRK(0x10ec0289, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7482 {0x21, 0x04211020}),
7483 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7484 ALC290_STANDARD_PINS
,
7487 {0x1a, 0x04a11020}),
7488 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7489 ALC290_STANDARD_PINS
,
7492 {0x1a, 0x04a11020}),
7493 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7494 ALC290_STANDARD_PINS
,
7496 {0x1a, 0x04a11020}),
7497 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7498 ALC290_STANDARD_PINS
,
7500 {0x1a, 0x04a11040}),
7501 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7502 ALC290_STANDARD_PINS
,
7505 {0x1a, 0x04a11040}),
7506 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7507 ALC290_STANDARD_PINS
,
7510 {0x1a, 0x04a11020}),
7511 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
7512 ALC290_STANDARD_PINS
,
7515 {0x1a, 0x04a11020}),
7516 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7517 ALC292_STANDARD_PINS
,
7520 {0x19, 0x01a19030}),
7521 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
7522 ALC292_STANDARD_PINS
,
7526 {0x19, 0x01a1903e}),
7527 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
7528 ALC292_STANDARD_PINS
,
7529 {0x12, 0x90a60140}),
7530 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7531 ALC292_STANDARD_PINS
,
7534 {0x19, 0x21a19030}),
7535 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
7536 ALC292_STANDARD_PINS
,
7537 {0x13, 0x90a60140}),
7538 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_MIC
,
7541 {0x21, 0x04211020}),
7542 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7545 {0x21, 0x03211020}),
7546 SND_HDA_PIN_QUIRK(0x10ec0294, 0x1043, "ASUS", ALC294_FIXUP_ASUS_SPK
,
7549 {0x21, 0x04211020}),
7550 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7552 {0x21, 0x04211020}),
7553 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7554 ALC295_STANDARD_PINS
,
7556 {0x18, 0x21a19030}),
7557 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7558 ALC295_STANDARD_PINS
,
7560 {0x18, 0x21a19050}),
7561 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
7562 ALC295_STANDARD_PINS
),
7563 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7564 ALC298_STANDARD_PINS
,
7565 {0x17, 0x90170110}),
7566 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7567 ALC298_STANDARD_PINS
,
7568 {0x17, 0x90170140}),
7569 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
7570 ALC298_STANDARD_PINS
,
7571 {0x17, 0x90170150}),
7572 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
7577 {0x21, 0x03211030}),
7578 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
7579 ALC225_STANDARD_PINS
,
7581 {0x17, 0x90170110}),
7585 static void alc269_fill_coef(struct hda_codec
*codec
)
7587 struct alc_spec
*spec
= codec
->spec
;
7590 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
7593 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
7594 alc_write_coef_idx(codec
, 0xf, 0x960b);
7595 alc_write_coef_idx(codec
, 0xe, 0x8817);
7598 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
7599 alc_write_coef_idx(codec
, 0xf, 0x960b);
7600 alc_write_coef_idx(codec
, 0xe, 0x8814);
7603 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
7604 /* Power up output pin */
7605 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
7608 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
7609 val
= alc_read_coef_idx(codec
, 0xd);
7610 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
7611 /* Capless ramp up clock control */
7612 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
7614 val
= alc_read_coef_idx(codec
, 0x17);
7615 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
7616 /* Class D power on reset */
7617 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
7622 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
7627 static int patch_alc269(struct hda_codec
*codec
)
7629 struct alc_spec
*spec
;
7632 err
= alc_alloc_spec(codec
, 0x0b);
7637 spec
->gen
.shared_mic_vref_pin
= 0x18;
7638 codec
->power_save_node
= 1;
7641 codec
->patch_ops
.suspend
= alc269_suspend
;
7642 codec
->patch_ops
.resume
= alc269_resume
;
7644 spec
->shutup
= alc_default_shutup
;
7645 spec
->init_hook
= alc_default_init
;
7647 switch (codec
->core
.vendor_id
) {
7649 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
7650 switch (alc_get_coef0(codec
) & 0x00f0) {
7652 if (codec
->bus
->pci
&&
7653 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7654 spec
->cdefine
.platform_type
== 1)
7655 err
= alc_codec_rename(codec
, "ALC271X");
7656 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
7659 if (codec
->bus
->pci
&&
7660 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
7661 codec
->bus
->pci
->subsystem_device
== 0x21f3)
7662 err
= alc_codec_rename(codec
, "ALC3202");
7663 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
7666 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
7669 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7673 spec
->shutup
= alc269_shutup
;
7674 spec
->init_hook
= alc269_fill_coef
;
7675 alc269_fill_coef(codec
);
7680 spec
->codec_variant
= ALC269_TYPE_ALC280
;
7683 spec
->codec_variant
= ALC269_TYPE_ALC282
;
7684 spec
->shutup
= alc282_shutup
;
7685 spec
->init_hook
= alc282_init
;
7689 spec
->codec_variant
= ALC269_TYPE_ALC283
;
7690 spec
->shutup
= alc283_shutup
;
7691 spec
->init_hook
= alc283_init
;
7695 spec
->codec_variant
= ALC269_TYPE_ALC284
;
7698 spec
->codec_variant
= ALC269_TYPE_ALC293
;
7702 spec
->codec_variant
= ALC269_TYPE_ALC286
;
7703 spec
->shutup
= alc286_shutup
;
7706 spec
->codec_variant
= ALC269_TYPE_ALC298
;
7710 spec
->codec_variant
= ALC269_TYPE_ALC255
;
7711 spec
->shutup
= alc256_shutup
;
7712 spec
->init_hook
= alc256_init
;
7716 spec
->codec_variant
= ALC269_TYPE_ALC256
;
7717 spec
->shutup
= alc256_shutup
;
7718 spec
->init_hook
= alc256_init
;
7719 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
7720 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
7723 spec
->codec_variant
= ALC269_TYPE_ALC257
;
7724 spec
->shutup
= alc256_shutup
;
7725 spec
->init_hook
= alc256_init
;
7726 spec
->gen
.mixer_nid
= 0;
7731 spec
->codec_variant
= ALC269_TYPE_ALC215
;
7732 spec
->shutup
= alc225_shutup
;
7733 spec
->init_hook
= alc225_init
;
7734 spec
->gen
.mixer_nid
= 0;
7739 spec
->codec_variant
= ALC269_TYPE_ALC225
;
7740 spec
->shutup
= alc225_shutup
;
7741 spec
->init_hook
= alc225_init
;
7742 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC225, ALC295 and ALC299 */
7747 spec
->codec_variant
= ALC269_TYPE_ALC294
;
7748 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
7749 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
7750 spec
->init_hook
= alc294_init
;
7753 spec
->codec_variant
= ALC269_TYPE_ALC300
;
7754 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC300 */
7759 spec
->codec_variant
= ALC269_TYPE_ALC700
;
7760 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
7761 alc_update_coef_idx(codec
, 0x4a, 1 << 15, 0); /* Combo jack auto trigger control */
7762 spec
->init_hook
= alc294_init
;
7767 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
7768 spec
->has_alc5505_dsp
= 1;
7769 spec
->init_hook
= alc5505_dsp_init
;
7772 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
7773 alc269_fixup_tbl
, alc269_fixups
);
7774 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
7775 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
7777 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7779 alc_auto_parse_customize_define(codec
);
7781 if (has_cdefine_beep(codec
))
7782 spec
->gen
.beep_nid
= 0x01;
7784 /* automatic parse from the BIOS config */
7785 err
= alc269_parse_auto_config(codec
);
7789 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
) {
7790 err
= set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
7795 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7808 static int alc861_parse_auto_config(struct hda_codec
*codec
)
7810 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
7811 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
7812 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
7815 /* Pin config fixes */
7817 ALC861_FIXUP_FSC_AMILO_PI1505
,
7818 ALC861_FIXUP_AMP_VREF_0F
,
7819 ALC861_FIXUP_NO_JACK_DETECT
,
7820 ALC861_FIXUP_ASUS_A6RP
,
7821 ALC660_FIXUP_ASUS_W7J
,
7824 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
7825 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
7826 const struct hda_fixup
*fix
, int action
)
7828 struct alc_spec
*spec
= codec
->spec
;
7831 if (action
!= HDA_FIXUP_ACT_INIT
)
7833 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
7834 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
7835 val
|= AC_PINCTL_IN_EN
;
7836 val
|= AC_PINCTL_VREF_50
;
7837 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
7838 spec
->gen
.keep_vref_in_automute
= 1;
7841 /* suppress the jack-detection */
7842 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
7843 const struct hda_fixup
*fix
, int action
)
7845 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
7846 codec
->no_jack_detect
= 1;
7849 static const struct hda_fixup alc861_fixups
[] = {
7850 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
7851 .type
= HDA_FIXUP_PINS
,
7852 .v
.pins
= (const struct hda_pintbl
[]) {
7853 { 0x0b, 0x0221101f }, /* HP */
7854 { 0x0f, 0x90170310 }, /* speaker */
7858 [ALC861_FIXUP_AMP_VREF_0F
] = {
7859 .type
= HDA_FIXUP_FUNC
,
7860 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7862 [ALC861_FIXUP_NO_JACK_DETECT
] = {
7863 .type
= HDA_FIXUP_FUNC
,
7864 .v
.func
= alc_fixup_no_jack_detect
,
7866 [ALC861_FIXUP_ASUS_A6RP
] = {
7867 .type
= HDA_FIXUP_FUNC
,
7868 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
7870 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
7872 [ALC660_FIXUP_ASUS_W7J
] = {
7873 .type
= HDA_FIXUP_VERBS
,
7874 .v
.verbs
= (const struct hda_verb
[]) {
7875 /* ASUS W7J needs a magic pin setup on unused NID 0x10
7876 * for enabling outputs
7878 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
7884 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
7885 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
7886 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
7887 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
7888 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
7889 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
7890 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
7891 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
7892 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
7898 static int patch_alc861(struct hda_codec
*codec
)
7900 struct alc_spec
*spec
;
7903 err
= alc_alloc_spec(codec
, 0x15);
7908 spec
->gen
.beep_nid
= 0x23;
7911 spec
->power_hook
= alc_power_eapd
;
7914 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
7915 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7917 /* automatic parse from the BIOS config */
7918 err
= alc861_parse_auto_config(codec
);
7922 if (!spec
->gen
.no_analog
) {
7923 err
= set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
7928 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7942 * In addition, an independent DAC
7944 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
7946 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
7947 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
7948 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
7952 ALC660VD_FIX_ASUS_GPIO1
,
7953 ALC861VD_FIX_DALLAS
,
7956 /* exclude VREF80 */
7957 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
7958 const struct hda_fixup
*fix
, int action
)
7960 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7961 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
7962 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
7967 static void alc660vd_fixup_asus_gpio1(struct hda_codec
*codec
,
7968 const struct hda_fixup
*fix
, int action
)
7970 struct alc_spec
*spec
= codec
->spec
;
7972 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
7973 spec
->gpio_mask
|= 0x02;
7974 alc_fixup_gpio(codec
, action
, 0x01);
7977 static const struct hda_fixup alc861vd_fixups
[] = {
7978 [ALC660VD_FIX_ASUS_GPIO1
] = {
7979 .type
= HDA_FIXUP_FUNC
,
7980 .v
.func
= alc660vd_fixup_asus_gpio1
,
7982 [ALC861VD_FIX_DALLAS
] = {
7983 .type
= HDA_FIXUP_FUNC
,
7984 .v
.func
= alc861vd_fixup_dallas
,
7988 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
7989 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
7990 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
7991 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
7997 static int patch_alc861vd(struct hda_codec
*codec
)
7999 struct alc_spec
*spec
;
8002 err
= alc_alloc_spec(codec
, 0x0b);
8007 spec
->gen
.beep_nid
= 0x23;
8009 spec
->shutup
= alc_eapd_shutup
;
8011 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
8012 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8014 /* automatic parse from the BIOS config */
8015 err
= alc861vd_parse_auto_config(codec
);
8019 if (!spec
->gen
.no_analog
) {
8020 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8025 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8037 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
8038 * configuration. Each pin widget can choose any input DACs and a mixer.
8039 * Each ADC is connected from a mixer of all inputs. This makes possible
8040 * 6-channel independent captures.
8042 * In addition, an independent DAC for the multi-playback (not used in this
8047 * BIOS auto configuration
8050 static int alc662_parse_auto_config(struct hda_codec
*codec
)
8052 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
8053 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
8054 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
8055 const hda_nid_t
*ssids
;
8057 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
8058 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
8059 codec
->core
.vendor_id
== 0x10ec0671)
8060 ssids
= alc663_ssids
;
8062 ssids
= alc662_ssids
;
8063 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
8066 static void alc272_fixup_mario(struct hda_codec
*codec
,
8067 const struct hda_fixup
*fix
, int action
)
8069 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
8071 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
8072 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
8073 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
8074 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
8075 (0 << AC_AMPCAP_MUTE_SHIFT
)))
8076 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
8079 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
8081 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
8083 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
8084 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
8088 /* override the 2.1 chmap */
8089 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
8090 const struct hda_fixup
*fix
, int action
)
8092 if (action
== HDA_FIXUP_ACT_BUILD
) {
8093 struct alc_spec
*spec
= codec
->spec
;
8094 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
8098 /* avoid D3 for keeping GPIO up */
8099 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
8101 unsigned int power_state
)
8103 struct alc_spec
*spec
= codec
->spec
;
8104 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_data
)
8109 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
8110 const struct hda_fixup
*fix
, int action
)
8112 struct alc_spec
*spec
= codec
->spec
;
8114 alc_fixup_hp_gpio_led(codec
, action
, 0x01, 0);
8115 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
8116 spec
->mute_led_polarity
= 1;
8117 codec
->power_filter
= gpio_led_power_filter
;
8121 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
8122 struct hda_jack_callback
*jack
)
8124 struct alc_spec
*spec
= codec
->spec
;
8127 snd_hda_gen_hp_automute(codec
, jack
);
8129 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
8131 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
8135 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
8136 const struct hda_fixup
*fix
, int action
)
8138 struct alc_spec
*spec
= codec
->spec
;
8139 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
8140 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
8141 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
8145 static struct coef_fw alc668_coefs
[] = {
8146 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
8147 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
8148 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
8149 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
8150 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
8151 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
8152 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
8153 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
8154 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
8155 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
8156 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
8157 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
8158 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
8159 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
8160 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
8161 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
8162 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
8163 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
8164 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
8165 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
8169 static void alc668_restore_default_value(struct hda_codec
*codec
)
8171 alc_process_coef_fw(codec
, alc668_coefs
);
8175 ALC662_FIXUP_ASPIRE
,
8176 ALC662_FIXUP_LED_GPIO1
,
8177 ALC662_FIXUP_IDEAPAD
,
8179 ALC662_FIXUP_CZC_P10T
,
8180 ALC662_FIXUP_SKU_IGNORE
,
8181 ALC662_FIXUP_HP_RP5800
,
8182 ALC662_FIXUP_ASUS_MODE1
,
8183 ALC662_FIXUP_ASUS_MODE2
,
8184 ALC662_FIXUP_ASUS_MODE3
,
8185 ALC662_FIXUP_ASUS_MODE4
,
8186 ALC662_FIXUP_ASUS_MODE5
,
8187 ALC662_FIXUP_ASUS_MODE6
,
8188 ALC662_FIXUP_ASUS_MODE7
,
8189 ALC662_FIXUP_ASUS_MODE8
,
8190 ALC662_FIXUP_NO_JACK_DETECT
,
8191 ALC662_FIXUP_ZOTAC_Z68
,
8192 ALC662_FIXUP_INV_DMIC
,
8193 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8194 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
8195 ALC662_FIXUP_HEADSET_MODE
,
8196 ALC668_FIXUP_HEADSET_MODE
,
8197 ALC662_FIXUP_BASS_MODE4_CHMAP
,
8198 ALC662_FIXUP_BASS_16
,
8199 ALC662_FIXUP_BASS_1A
,
8200 ALC662_FIXUP_BASS_CHMAP
,
8201 ALC668_FIXUP_AUTO_MUTE
,
8202 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
8203 ALC668_FIXUP_DELL_XPS13
,
8204 ALC662_FIXUP_ASUS_Nx50
,
8205 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8206 ALC668_FIXUP_ASUS_Nx51
,
8207 ALC668_FIXUP_MIC_COEF
,
8208 ALC668_FIXUP_ASUS_G751
,
8209 ALC891_FIXUP_HEADSET_MODE
,
8210 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8211 ALC662_FIXUP_ACER_VERITON
,
8212 ALC892_FIXUP_ASROCK_MOBO
,
8213 ALC662_FIXUP_USI_FUNC
,
8214 ALC662_FIXUP_USI_HEADSET_MODE
,
8215 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
8218 static const struct hda_fixup alc662_fixups
[] = {
8219 [ALC662_FIXUP_ASPIRE
] = {
8220 .type
= HDA_FIXUP_PINS
,
8221 .v
.pins
= (const struct hda_pintbl
[]) {
8222 { 0x15, 0x99130112 }, /* subwoofer */
8226 [ALC662_FIXUP_LED_GPIO1
] = {
8227 .type
= HDA_FIXUP_FUNC
,
8228 .v
.func
= alc662_fixup_led_gpio1
,
8230 [ALC662_FIXUP_IDEAPAD
] = {
8231 .type
= HDA_FIXUP_PINS
,
8232 .v
.pins
= (const struct hda_pintbl
[]) {
8233 { 0x17, 0x99130112 }, /* subwoofer */
8237 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
8239 [ALC272_FIXUP_MARIO
] = {
8240 .type
= HDA_FIXUP_FUNC
,
8241 .v
.func
= alc272_fixup_mario
,
8243 [ALC662_FIXUP_CZC_P10T
] = {
8244 .type
= HDA_FIXUP_VERBS
,
8245 .v
.verbs
= (const struct hda_verb
[]) {
8246 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
8250 [ALC662_FIXUP_SKU_IGNORE
] = {
8251 .type
= HDA_FIXUP_FUNC
,
8252 .v
.func
= alc_fixup_sku_ignore
,
8254 [ALC662_FIXUP_HP_RP5800
] = {
8255 .type
= HDA_FIXUP_PINS
,
8256 .v
.pins
= (const struct hda_pintbl
[]) {
8257 { 0x14, 0x0221201f }, /* HP out */
8261 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8263 [ALC662_FIXUP_ASUS_MODE1
] = {
8264 .type
= HDA_FIXUP_PINS
,
8265 .v
.pins
= (const struct hda_pintbl
[]) {
8266 { 0x14, 0x99130110 }, /* speaker */
8267 { 0x18, 0x01a19c20 }, /* mic */
8268 { 0x19, 0x99a3092f }, /* int-mic */
8269 { 0x21, 0x0121401f }, /* HP out */
8273 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8275 [ALC662_FIXUP_ASUS_MODE2
] = {
8276 .type
= HDA_FIXUP_PINS
,
8277 .v
.pins
= (const struct hda_pintbl
[]) {
8278 { 0x14, 0x99130110 }, /* speaker */
8279 { 0x18, 0x01a19820 }, /* mic */
8280 { 0x19, 0x99a3092f }, /* int-mic */
8281 { 0x1b, 0x0121401f }, /* HP out */
8285 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8287 [ALC662_FIXUP_ASUS_MODE3
] = {
8288 .type
= HDA_FIXUP_PINS
,
8289 .v
.pins
= (const struct hda_pintbl
[]) {
8290 { 0x14, 0x99130110 }, /* speaker */
8291 { 0x15, 0x0121441f }, /* HP */
8292 { 0x18, 0x01a19840 }, /* mic */
8293 { 0x19, 0x99a3094f }, /* int-mic */
8294 { 0x21, 0x01211420 }, /* HP2 */
8298 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8300 [ALC662_FIXUP_ASUS_MODE4
] = {
8301 .type
= HDA_FIXUP_PINS
,
8302 .v
.pins
= (const struct hda_pintbl
[]) {
8303 { 0x14, 0x99130110 }, /* speaker */
8304 { 0x16, 0x99130111 }, /* speaker */
8305 { 0x18, 0x01a19840 }, /* mic */
8306 { 0x19, 0x99a3094f }, /* int-mic */
8307 { 0x21, 0x0121441f }, /* HP */
8311 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8313 [ALC662_FIXUP_ASUS_MODE5
] = {
8314 .type
= HDA_FIXUP_PINS
,
8315 .v
.pins
= (const struct hda_pintbl
[]) {
8316 { 0x14, 0x99130110 }, /* speaker */
8317 { 0x15, 0x0121441f }, /* HP */
8318 { 0x16, 0x99130111 }, /* speaker */
8319 { 0x18, 0x01a19840 }, /* mic */
8320 { 0x19, 0x99a3094f }, /* int-mic */
8324 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8326 [ALC662_FIXUP_ASUS_MODE6
] = {
8327 .type
= HDA_FIXUP_PINS
,
8328 .v
.pins
= (const struct hda_pintbl
[]) {
8329 { 0x14, 0x99130110 }, /* speaker */
8330 { 0x15, 0x01211420 }, /* HP2 */
8331 { 0x18, 0x01a19840 }, /* mic */
8332 { 0x19, 0x99a3094f }, /* int-mic */
8333 { 0x1b, 0x0121441f }, /* HP */
8337 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8339 [ALC662_FIXUP_ASUS_MODE7
] = {
8340 .type
= HDA_FIXUP_PINS
,
8341 .v
.pins
= (const struct hda_pintbl
[]) {
8342 { 0x14, 0x99130110 }, /* speaker */
8343 { 0x17, 0x99130111 }, /* speaker */
8344 { 0x18, 0x01a19840 }, /* mic */
8345 { 0x19, 0x99a3094f }, /* int-mic */
8346 { 0x1b, 0x01214020 }, /* HP */
8347 { 0x21, 0x0121401f }, /* HP */
8351 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8353 [ALC662_FIXUP_ASUS_MODE8
] = {
8354 .type
= HDA_FIXUP_PINS
,
8355 .v
.pins
= (const struct hda_pintbl
[]) {
8356 { 0x14, 0x99130110 }, /* speaker */
8357 { 0x12, 0x99a30970 }, /* int-mic */
8358 { 0x15, 0x01214020 }, /* HP */
8359 { 0x17, 0x99130111 }, /* speaker */
8360 { 0x18, 0x01a19840 }, /* mic */
8361 { 0x21, 0x0121401f }, /* HP */
8365 .chain_id
= ALC662_FIXUP_SKU_IGNORE
8367 [ALC662_FIXUP_NO_JACK_DETECT
] = {
8368 .type
= HDA_FIXUP_FUNC
,
8369 .v
.func
= alc_fixup_no_jack_detect
,
8371 [ALC662_FIXUP_ZOTAC_Z68
] = {
8372 .type
= HDA_FIXUP_PINS
,
8373 .v
.pins
= (const struct hda_pintbl
[]) {
8374 { 0x1b, 0x02214020 }, /* Front HP */
8378 [ALC662_FIXUP_INV_DMIC
] = {
8379 .type
= HDA_FIXUP_FUNC
,
8380 .v
.func
= alc_fixup_inv_dmic
,
8382 [ALC668_FIXUP_DELL_XPS13
] = {
8383 .type
= HDA_FIXUP_FUNC
,
8384 .v
.func
= alc_fixup_dell_xps13
,
8386 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
8388 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
8389 .type
= HDA_FIXUP_FUNC
,
8390 .v
.func
= alc_fixup_disable_aamix
,
8392 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8394 [ALC668_FIXUP_AUTO_MUTE
] = {
8395 .type
= HDA_FIXUP_FUNC
,
8396 .v
.func
= alc_fixup_auto_mute_via_amp
,
8398 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
8400 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8401 .type
= HDA_FIXUP_PINS
,
8402 .v
.pins
= (const struct hda_pintbl
[]) {
8403 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8404 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
8408 .chain_id
= ALC662_FIXUP_HEADSET_MODE
8410 [ALC662_FIXUP_HEADSET_MODE
] = {
8411 .type
= HDA_FIXUP_FUNC
,
8412 .v
.func
= alc_fixup_headset_mode_alc662
,
8414 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8415 .type
= HDA_FIXUP_PINS
,
8416 .v
.pins
= (const struct hda_pintbl
[]) {
8417 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8418 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8422 .chain_id
= ALC668_FIXUP_HEADSET_MODE
8424 [ALC668_FIXUP_HEADSET_MODE
] = {
8425 .type
= HDA_FIXUP_FUNC
,
8426 .v
.func
= alc_fixup_headset_mode_alc668
,
8428 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
8429 .type
= HDA_FIXUP_FUNC
,
8430 .v
.func
= alc_fixup_bass_chmap
,
8432 .chain_id
= ALC662_FIXUP_ASUS_MODE4
8434 [ALC662_FIXUP_BASS_16
] = {
8435 .type
= HDA_FIXUP_PINS
,
8436 .v
.pins
= (const struct hda_pintbl
[]) {
8437 {0x16, 0x80106111}, /* bass speaker */
8441 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8443 [ALC662_FIXUP_BASS_1A
] = {
8444 .type
= HDA_FIXUP_PINS
,
8445 .v
.pins
= (const struct hda_pintbl
[]) {
8446 {0x1a, 0x80106111}, /* bass speaker */
8450 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
8452 [ALC662_FIXUP_BASS_CHMAP
] = {
8453 .type
= HDA_FIXUP_FUNC
,
8454 .v
.func
= alc_fixup_bass_chmap
,
8456 [ALC662_FIXUP_ASUS_Nx50
] = {
8457 .type
= HDA_FIXUP_FUNC
,
8458 .v
.func
= alc_fixup_auto_mute_via_amp
,
8460 .chain_id
= ALC662_FIXUP_BASS_1A
8462 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
8463 .type
= HDA_FIXUP_FUNC
,
8464 .v
.func
= alc_fixup_headset_mode_alc668
,
8465 .chain_id
= ALC662_FIXUP_BASS_CHMAP
8467 [ALC668_FIXUP_ASUS_Nx51
] = {
8468 .type
= HDA_FIXUP_PINS
,
8469 .v
.pins
= (const struct hda_pintbl
[]) {
8470 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8471 { 0x1a, 0x90170151 }, /* bass speaker */
8472 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8476 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
8478 [ALC668_FIXUP_MIC_COEF
] = {
8479 .type
= HDA_FIXUP_VERBS
,
8480 .v
.verbs
= (const struct hda_verb
[]) {
8481 { 0x20, AC_VERB_SET_COEF_INDEX
, 0xc3 },
8482 { 0x20, AC_VERB_SET_PROC_COEF
, 0x4000 },
8486 [ALC668_FIXUP_ASUS_G751
] = {
8487 .type
= HDA_FIXUP_PINS
,
8488 .v
.pins
= (const struct hda_pintbl
[]) {
8489 { 0x16, 0x0421101f }, /* HP */
8493 .chain_id
= ALC668_FIXUP_MIC_COEF
8495 [ALC891_FIXUP_HEADSET_MODE
] = {
8496 .type
= HDA_FIXUP_FUNC
,
8497 .v
.func
= alc_fixup_headset_mode
,
8499 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
8500 .type
= HDA_FIXUP_PINS
,
8501 .v
.pins
= (const struct hda_pintbl
[]) {
8502 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
8503 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
8507 .chain_id
= ALC891_FIXUP_HEADSET_MODE
8509 [ALC662_FIXUP_ACER_VERITON
] = {
8510 .type
= HDA_FIXUP_PINS
,
8511 .v
.pins
= (const struct hda_pintbl
[]) {
8512 { 0x15, 0x50170120 }, /* no internal speaker */
8516 [ALC892_FIXUP_ASROCK_MOBO
] = {
8517 .type
= HDA_FIXUP_PINS
,
8518 .v
.pins
= (const struct hda_pintbl
[]) {
8519 { 0x15, 0x40f000f0 }, /* disabled */
8520 { 0x16, 0x40f000f0 }, /* disabled */
8524 [ALC662_FIXUP_USI_FUNC
] = {
8525 .type
= HDA_FIXUP_FUNC
,
8526 .v
.func
= alc662_fixup_usi_headset_mic
,
8528 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
8529 .type
= HDA_FIXUP_PINS
,
8530 .v
.pins
= (const struct hda_pintbl
[]) {
8531 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
8532 { 0x18, 0x01a1903d },
8536 .chain_id
= ALC662_FIXUP_USI_FUNC
8538 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
8539 .type
= HDA_FIXUP_FUNC
,
8540 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
8544 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
8545 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
8546 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
8547 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
8548 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
8549 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
8550 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
8551 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
8552 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
8553 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8554 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8555 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
8556 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
8557 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
8558 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8559 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8560 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8561 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8562 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
8563 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
8564 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
8565 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
8566 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
8567 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
8568 SND_PCI_QUIRK(0x1043, 0x12ff, "ASUS G751", ALC668_FIXUP_ASUS_G751
),
8569 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8570 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
8571 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
8572 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
8573 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
8574 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
8575 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
8576 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
8577 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
8578 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
8579 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
8580 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
8581 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
8582 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
8583 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
8584 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
8585 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
8586 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
8589 /* Below is a quirk table taken from the old code.
8590 * Basically the device should work as is without the fixup table.
8591 * If BIOS doesn't give a proper info, enable the corresponding
8594 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
8595 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
8596 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
8597 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
8598 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8599 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8600 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8601 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
8602 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
8603 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8604 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
8605 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
8606 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
8607 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
8608 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
8609 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8610 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
8611 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
8612 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8613 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8614 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8615 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8616 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
8617 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
8618 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
8619 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8620 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
8621 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
8622 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8623 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
8624 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8625 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8626 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
8627 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
8628 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
8629 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
8630 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
8631 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
8632 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
8633 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
8634 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
8635 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
8636 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8637 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
8638 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
8639 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
8640 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
8641 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
8642 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
8643 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
8648 static const struct hda_model_fixup alc662_fixup_models
[] = {
8649 {.id
= ALC662_FIXUP_ASPIRE
, .name
= "aspire"},
8650 {.id
= ALC662_FIXUP_IDEAPAD
, .name
= "ideapad"},
8651 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
8652 {.id
= ALC662_FIXUP_HP_RP5800
, .name
= "hp-rp5800"},
8653 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
8654 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
8655 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
8656 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
8657 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
8658 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
8659 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
8660 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
8661 {.id
= ALC662_FIXUP_ZOTAC_Z68
, .name
= "zotac-z68"},
8662 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
8663 {.id
= ALC662_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "alc662-headset-multi"},
8664 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
8665 {.id
= ALC662_FIXUP_HEADSET_MODE
, .name
= "alc662-headset"},
8666 {.id
= ALC668_FIXUP_HEADSET_MODE
, .name
= "alc668-headset"},
8667 {.id
= ALC662_FIXUP_BASS_16
, .name
= "bass16"},
8668 {.id
= ALC662_FIXUP_BASS_1A
, .name
= "bass1a"},
8669 {.id
= ALC668_FIXUP_AUTO_MUTE
, .name
= "automute"},
8670 {.id
= ALC668_FIXUP_DELL_XPS13
, .name
= "dell-xps13"},
8671 {.id
= ALC662_FIXUP_ASUS_Nx50
, .name
= "asus-nx50"},
8672 {.id
= ALC668_FIXUP_ASUS_Nx51
, .name
= "asus-nx51"},
8673 {.id
= ALC668_FIXUP_ASUS_G751
, .name
= "asus-g751"},
8674 {.id
= ALC891_FIXUP_HEADSET_MODE
, .name
= "alc891-headset"},
8675 {.id
= ALC891_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "alc891-headset-multi"},
8676 {.id
= ALC662_FIXUP_ACER_VERITON
, .name
= "acer-veriton"},
8677 {.id
= ALC892_FIXUP_ASROCK_MOBO
, .name
= "asrock-mobo"},
8678 {.id
= ALC662_FIXUP_USI_HEADSET_MODE
, .name
= "usi-headset"},
8679 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
8683 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
8684 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
8688 {0x21, 0x01014020}),
8689 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
8693 {0x1b, 0x0221401f}),
8694 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8698 {0x16, 0x03011020}),
8699 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8703 {0x16, 0x03011020}),
8704 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8708 {0x16, 0x03011020}),
8709 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
8712 {0x16, 0x03011020}),
8713 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
8716 {0x15, 0x0321101f}),
8722 static int patch_alc662(struct hda_codec
*codec
)
8724 struct alc_spec
*spec
;
8727 err
= alc_alloc_spec(codec
, 0x0b);
8733 spec
->shutup
= alc_eapd_shutup
;
8735 /* handle multiple HPs as is */
8736 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
8738 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
8740 switch (codec
->core
.vendor_id
) {
8742 spec
->init_hook
= alc668_restore_default_value
;
8746 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
8747 alc662_fixup_tbl
, alc662_fixups
);
8748 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
8749 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
8751 alc_auto_parse_customize_define(codec
);
8753 if (has_cdefine_beep(codec
))
8754 spec
->gen
.beep_nid
= 0x01;
8756 if ((alc_get_coef0(codec
) & (1 << 14)) &&
8757 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
8758 spec
->cdefine
.platform_type
== 1) {
8759 err
= alc_codec_rename(codec
, "ALC272X");
8764 /* automatic parse from the BIOS config */
8765 err
= alc662_parse_auto_config(codec
);
8769 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
8770 switch (codec
->core
.vendor_id
) {
8772 err
= set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
8778 err
= set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
8781 err
= set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
8788 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
8801 static int alc680_parse_auto_config(struct hda_codec
*codec
)
8803 return alc_parse_auto_config(codec
, NULL
, NULL
);
8808 static int patch_alc680(struct hda_codec
*codec
)
8812 /* ALC680 has no aa-loopback mixer */
8813 err
= alc_alloc_spec(codec
, 0);
8817 /* automatic parse from the BIOS config */
8818 err
= alc680_parse_auto_config(codec
);
8830 static const struct hda_device_id snd_hda_id_realtek
[] = {
8831 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
8832 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
8833 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
8834 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
8835 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
8836 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
8837 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
8838 HDA_CODEC_ENTRY(0x10ec0236, "ALC236", patch_alc269
),
8839 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
8840 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
8841 HDA_CODEC_ENTRY(0x10ec0257, "ALC257", patch_alc269
),
8842 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
8843 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
8844 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
8845 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
8846 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
8847 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
8848 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
8849 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
8850 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
8851 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
8852 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
8853 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
8854 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
8855 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
8856 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
8857 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
8858 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
8859 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
8860 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
8861 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
8862 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
8863 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
8864 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
8865 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
8866 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
8867 HDA_CODEC_ENTRY(0x10ec0300, "ALC300", patch_alc269
),
8868 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
8869 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
8870 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
8871 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
8872 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
8873 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
8874 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
8875 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
8876 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
8877 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
8878 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
8879 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
8880 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
8881 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
8882 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
8883 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
8884 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
8885 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
8886 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
8887 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
8888 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
8889 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
8890 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
8891 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
8892 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
8893 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
8894 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
8895 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
8896 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
8897 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
8898 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
8899 HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882
),
8900 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
8903 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
8905 MODULE_LICENSE("GPL");
8906 MODULE_DESCRIPTION("Realtek HD-audio codec");
8908 static struct hda_codec_driver realtek_driver
= {
8909 .id
= snd_hda_id_realtek
,
8912 module_hda_codec_driver(realtek_driver
);