2 * Universal Interface for Intel High Definition Audio Codec
4 * HD audio interface patch for Realtek ALC codecs
6 * Copyright (c) 2004 Kailang Yang <kailang@realtek.com.tw>
7 * PeiSen Hou <pshou@realtek.com.tw>
8 * Takashi Iwai <tiwai@suse.de>
9 * Jonathan Woithe <jwoithe@just42.net>
11 * This driver is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This driver is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/slab.h>
29 #include <linux/pci.h>
30 #include <linux/dmi.h>
31 #include <linux/module.h>
32 #include <linux/input.h>
33 #include <sound/core.h>
34 #include <sound/jack.h>
35 #include "hda_codec.h"
36 #include "hda_local.h"
37 #include "hda_auto_parser.h"
39 #include "hda_generic.h"
41 /* keep halting ALC5505 DSP, for power saving */
42 #define HALT_REALTEK_ALC5505
44 /* extra amp-initialization sequence types */
54 ALC_HEADSET_MODE_UNKNOWN
,
55 ALC_HEADSET_MODE_UNPLUGGED
,
56 ALC_HEADSET_MODE_HEADSET
,
58 ALC_HEADSET_MODE_HEADPHONE
,
62 ALC_HEADSET_TYPE_UNKNOWN
,
63 ALC_HEADSET_TYPE_CTIA
,
64 ALC_HEADSET_TYPE_OMTP
,
68 ALC_KEY_MICMUTE_INDEX
,
71 struct alc_customize_define
{
73 unsigned char port_connectivity
;
74 unsigned char check_sum
;
75 unsigned char customization
;
76 unsigned char external_amp
;
77 unsigned int enable_pcbeep
:1;
78 unsigned int platform_type
:1;
80 unsigned int override
:1;
81 unsigned int fixup
:1; /* Means that this sku is set by driver, not read from hw */
85 struct hda_gen_spec gen
; /* must be at head */
87 /* codec parameterization */
88 const struct snd_kcontrol_new
*mixers
[5]; /* mixer arrays */
89 unsigned int num_mixers
;
90 unsigned int beep_amp
; /* beep amp value, set via set_beep_amp() */
92 struct alc_customize_define cdefine
;
93 unsigned int parse_flags
; /* flag for snd_hda_parse_pin_defcfg() */
95 /* mute LED for HP laptops, see alc269_fixup_mic_mute_hook() */
96 int mute_led_polarity
;
97 hda_nid_t mute_led_nid
;
98 hda_nid_t cap_mute_led_nid
;
100 unsigned int gpio_led
; /* used for alc269_fixup_hp_gpio_led() */
101 unsigned int gpio_mute_led_mask
;
102 unsigned int gpio_mic_led_mask
;
104 hda_nid_t headset_mic_pin
;
105 hda_nid_t headphone_mic_pin
;
106 int current_headset_mode
;
107 int current_headset_type
;
110 void (*init_hook
)(struct hda_codec
*codec
);
112 void (*power_hook
)(struct hda_codec
*codec
);
114 void (*shutup
)(struct hda_codec
*codec
);
115 void (*reboot_notify
)(struct hda_codec
*codec
);
118 int codec_variant
; /* flag for other variants */
119 unsigned int has_alc5505_dsp
:1;
120 unsigned int no_depop_delay
:1;
124 unsigned int pll_coef_idx
, pll_coef_bit
;
126 struct input_dev
*kb_dev
;
127 u8 alc_mute_keycode_map
[1];
131 * COEF access helper functions
134 static int alc_read_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
135 unsigned int coef_idx
)
139 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
140 val
= snd_hda_codec_read(codec
, nid
, 0, AC_VERB_GET_PROC_COEF
, 0);
144 #define alc_read_coef_idx(codec, coef_idx) \
145 alc_read_coefex_idx(codec, 0x20, coef_idx)
147 static void alc_write_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
148 unsigned int coef_idx
, unsigned int coef_val
)
150 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_COEF_INDEX
, coef_idx
);
151 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_PROC_COEF
, coef_val
);
154 #define alc_write_coef_idx(codec, coef_idx, coef_val) \
155 alc_write_coefex_idx(codec, 0x20, coef_idx, coef_val)
157 static void alc_update_coefex_idx(struct hda_codec
*codec
, hda_nid_t nid
,
158 unsigned int coef_idx
, unsigned int mask
,
159 unsigned int bits_set
)
161 unsigned int val
= alc_read_coefex_idx(codec
, nid
, coef_idx
);
164 alc_write_coefex_idx(codec
, nid
, coef_idx
,
165 (val
& ~mask
) | bits_set
);
168 #define alc_update_coef_idx(codec, coef_idx, mask, bits_set) \
169 alc_update_coefex_idx(codec, 0x20, coef_idx, mask, bits_set)
171 /* a special bypass for COEF 0; read the cached value at the second time */
172 static unsigned int alc_get_coef0(struct hda_codec
*codec
)
174 struct alc_spec
*spec
= codec
->spec
;
177 spec
->coef0
= alc_read_coef_idx(codec
, 0);
181 /* coef writes/updates batch */
189 #define UPDATE_COEFEX(_nid, _idx, _mask, _val) \
190 { .nid = (_nid), .idx = (_idx), .mask = (_mask), .val = (_val) }
191 #define WRITE_COEFEX(_nid, _idx, _val) UPDATE_COEFEX(_nid, _idx, -1, _val)
192 #define WRITE_COEF(_idx, _val) WRITE_COEFEX(0x20, _idx, _val)
193 #define UPDATE_COEF(_idx, _mask, _val) UPDATE_COEFEX(0x20, _idx, _mask, _val)
195 static void alc_process_coef_fw(struct hda_codec
*codec
,
196 const struct coef_fw
*fw
)
198 for (; fw
->nid
; fw
++) {
199 if (fw
->mask
== (unsigned short)-1)
200 alc_write_coefex_idx(codec
, fw
->nid
, fw
->idx
, fw
->val
);
202 alc_update_coefex_idx(codec
, fw
->nid
, fw
->idx
,
208 * Append the given mixer and verb elements for the later use
209 * The mixer array is referred in build_controls(), and init_verbs are
212 static void add_mixer(struct alc_spec
*spec
, const struct snd_kcontrol_new
*mix
)
214 if (snd_BUG_ON(spec
->num_mixers
>= ARRAY_SIZE(spec
->mixers
)))
216 spec
->mixers
[spec
->num_mixers
++] = mix
;
220 * GPIO setup tables, used in initialization
222 /* Enable GPIO mask and set output */
223 static const struct hda_verb alc_gpio1_init_verbs
[] = {
224 {0x01, AC_VERB_SET_GPIO_MASK
, 0x01},
225 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
226 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
230 static const struct hda_verb alc_gpio2_init_verbs
[] = {
231 {0x01, AC_VERB_SET_GPIO_MASK
, 0x02},
232 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x02},
233 {0x01, AC_VERB_SET_GPIO_DATA
, 0x02},
237 static const struct hda_verb alc_gpio3_init_verbs
[] = {
238 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
239 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x03},
240 {0x01, AC_VERB_SET_GPIO_DATA
, 0x03},
245 * Fix hardware PLL issue
246 * On some codecs, the analog PLL gating control must be off while
247 * the default value is 1.
249 static void alc_fix_pll(struct hda_codec
*codec
)
251 struct alc_spec
*spec
= codec
->spec
;
254 alc_update_coefex_idx(codec
, spec
->pll_nid
, spec
->pll_coef_idx
,
255 1 << spec
->pll_coef_bit
, 0);
258 static void alc_fix_pll_init(struct hda_codec
*codec
, hda_nid_t nid
,
259 unsigned int coef_idx
, unsigned int coef_bit
)
261 struct alc_spec
*spec
= codec
->spec
;
263 spec
->pll_coef_idx
= coef_idx
;
264 spec
->pll_coef_bit
= coef_bit
;
268 /* update the master volume per volume-knob's unsol event */
269 static void alc_update_knob_master(struct hda_codec
*codec
,
270 struct hda_jack_callback
*jack
)
273 struct snd_kcontrol
*kctl
;
274 struct snd_ctl_elem_value
*uctl
;
276 kctl
= snd_hda_find_mixer_ctl(codec
, "Master Playback Volume");
279 uctl
= kzalloc(sizeof(*uctl
), GFP_KERNEL
);
282 val
= snd_hda_codec_read(codec
, jack
->nid
, 0,
283 AC_VERB_GET_VOLUME_KNOB_CONTROL
, 0);
284 val
&= HDA_AMP_VOLMASK
;
285 uctl
->value
.integer
.value
[0] = val
;
286 uctl
->value
.integer
.value
[1] = val
;
287 kctl
->put(kctl
, uctl
);
291 static void alc880_unsol_event(struct hda_codec
*codec
, unsigned int res
)
293 /* For some reason, the res given from ALC880 is broken.
294 Here we adjust it properly. */
295 snd_hda_jack_unsol_event(codec
, res
>> 2);
298 /* Change EAPD to verb control */
299 static void alc_fill_eapd_coef(struct hda_codec
*codec
)
303 coef
= alc_get_coef0(codec
);
305 switch (codec
->core
.vendor_id
) {
307 alc_update_coef_idx(codec
, 0x7, 0, 1<<5);
311 alc_update_coef_idx(codec
, 0x7, 0, 1<<13);
314 if ((coef
& 0x00f0) == 0x0010)
315 alc_update_coef_idx(codec
, 0xd, 0, 1<<14);
316 if ((coef
& 0x00f0) == 0x0020)
317 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
318 if ((coef
& 0x00f0) == 0x0030)
319 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
325 alc_update_coef_idx(codec
, 0x4, 1<<15, 0);
341 alc_update_coef_idx(codec
, 0x10, 1<<9, 0);
344 alc_update_coef_idx(codec
, 0xa, 1<<13, 0);
352 alc_update_coef_idx(codec
, 0x10, 1<<15, 0);
355 if ((coef
& 0x00f0) == 0x0030)
356 alc_update_coef_idx(codec
, 0x4, 1<<10, 0); /* EAPD Ctrl */
365 alc_update_coef_idx(codec
, 0xd, 0, 1<<14); /* EAPD Ctrl */
368 alc_update_coef_idx(codec
, 0x7, 3<<13, 0);
371 alc_update_coef_idx(codec
, 0x4, 1<<10, 0);
374 if ((coef
& 0x00f0) == 0x0020 || (coef
& 0x00f0) == 0x0030)
375 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
378 alc_update_coef_idx(codec
, 0x7, 1<<5, 0);
383 alc_update_coef_idx(codec
, 0x7, 1<<1, 0);
388 /* additional initialization for ALC888 variants */
389 static void alc888_coef_init(struct hda_codec
*codec
)
391 switch (alc_get_coef0(codec
) & 0x00f0) {
396 alc_update_coef_idx(codec
, 7, 0, 0x2030); /* Turn EAPD to High */
401 /* turn on/off EAPD control (only if available) */
402 static void set_eapd(struct hda_codec
*codec
, hda_nid_t nid
, int on
)
404 if (get_wcaps_type(get_wcaps(codec
, nid
)) != AC_WID_PIN
)
406 if (snd_hda_query_pin_caps(codec
, nid
) & AC_PINCAP_EAPD
)
407 snd_hda_codec_write(codec
, nid
, 0, AC_VERB_SET_EAPD_BTLENABLE
,
411 /* turn on/off EAPD controls of the codec */
412 static void alc_auto_setup_eapd(struct hda_codec
*codec
, bool on
)
414 /* We currently only handle front, HP */
415 static hda_nid_t pins
[] = {
416 0x0f, 0x10, 0x14, 0x15, 0x17, 0
419 for (p
= pins
; *p
; p
++)
420 set_eapd(codec
, *p
, on
);
423 /* generic shutup callback;
424 * just turning off EAPD and a little pause for avoiding pop-noise
426 static void alc_eapd_shutup(struct hda_codec
*codec
)
428 struct alc_spec
*spec
= codec
->spec
;
430 alc_auto_setup_eapd(codec
, false);
431 if (!spec
->no_depop_delay
)
433 snd_hda_shutup_pins(codec
);
436 /* generic EAPD initialization */
437 static void alc_auto_init_amp(struct hda_codec
*codec
, int type
)
439 alc_fill_eapd_coef(codec
);
440 alc_auto_setup_eapd(codec
, true);
443 snd_hda_sequence_write(codec
, alc_gpio1_init_verbs
);
446 snd_hda_sequence_write(codec
, alc_gpio2_init_verbs
);
449 snd_hda_sequence_write(codec
, alc_gpio3_init_verbs
);
451 case ALC_INIT_DEFAULT
:
452 switch (codec
->core
.vendor_id
) {
454 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x2010);
460 alc_update_coef_idx(codec
, 7, 0, 0x2030);
463 alc888_coef_init(codec
);
472 * Realtek SSID verification
475 /* Could be any non-zero and even value. When used as fixup, tells
476 * the driver to ignore any present sku defines.
478 #define ALC_FIXUP_SKU_IGNORE (2)
480 static void alc_fixup_sku_ignore(struct hda_codec
*codec
,
481 const struct hda_fixup
*fix
, int action
)
483 struct alc_spec
*spec
= codec
->spec
;
484 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
485 spec
->cdefine
.fixup
= 1;
486 spec
->cdefine
.sku_cfg
= ALC_FIXUP_SKU_IGNORE
;
490 static void alc_fixup_no_depop_delay(struct hda_codec
*codec
,
491 const struct hda_fixup
*fix
, int action
)
493 struct alc_spec
*spec
= codec
->spec
;
495 if (action
== HDA_FIXUP_ACT_PROBE
) {
496 spec
->no_depop_delay
= 1;
497 codec
->depop_delay
= 0;
501 static int alc_auto_parse_customize_define(struct hda_codec
*codec
)
503 unsigned int ass
, tmp
, i
;
505 struct alc_spec
*spec
= codec
->spec
;
507 spec
->cdefine
.enable_pcbeep
= 1; /* assume always enabled */
509 if (spec
->cdefine
.fixup
) {
510 ass
= spec
->cdefine
.sku_cfg
;
511 if (ass
== ALC_FIXUP_SKU_IGNORE
)
516 if (!codec
->bus
->pci
)
518 ass
= codec
->core
.subsystem_id
& 0xffff;
519 if (ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
523 if (codec
->core
.vendor_id
== 0x10ec0260)
525 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
528 codec_info(codec
, "%s: SKU not ready 0x%08x\n",
529 codec
->core
.chip_name
, ass
);
535 for (i
= 1; i
< 16; i
++) {
539 if (((ass
>> 16) & 0xf) != tmp
)
542 spec
->cdefine
.port_connectivity
= ass
>> 30;
543 spec
->cdefine
.enable_pcbeep
= (ass
& 0x100000) >> 20;
544 spec
->cdefine
.check_sum
= (ass
>> 16) & 0xf;
545 spec
->cdefine
.customization
= ass
>> 8;
547 spec
->cdefine
.sku_cfg
= ass
;
548 spec
->cdefine
.external_amp
= (ass
& 0x38) >> 3;
549 spec
->cdefine
.platform_type
= (ass
& 0x4) >> 2;
550 spec
->cdefine
.swap
= (ass
& 0x2) >> 1;
551 spec
->cdefine
.override
= ass
& 0x1;
553 codec_dbg(codec
, "SKU: Nid=0x%x sku_cfg=0x%08x\n",
554 nid
, spec
->cdefine
.sku_cfg
);
555 codec_dbg(codec
, "SKU: port_connectivity=0x%x\n",
556 spec
->cdefine
.port_connectivity
);
557 codec_dbg(codec
, "SKU: enable_pcbeep=0x%x\n", spec
->cdefine
.enable_pcbeep
);
558 codec_dbg(codec
, "SKU: check_sum=0x%08x\n", spec
->cdefine
.check_sum
);
559 codec_dbg(codec
, "SKU: customization=0x%08x\n", spec
->cdefine
.customization
);
560 codec_dbg(codec
, "SKU: external_amp=0x%x\n", spec
->cdefine
.external_amp
);
561 codec_dbg(codec
, "SKU: platform_type=0x%x\n", spec
->cdefine
.platform_type
);
562 codec_dbg(codec
, "SKU: swap=0x%x\n", spec
->cdefine
.swap
);
563 codec_dbg(codec
, "SKU: override=0x%x\n", spec
->cdefine
.override
);
568 /* return the position of NID in the list, or -1 if not found */
569 static int find_idx_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
572 for (i
= 0; i
< nums
; i
++)
577 /* return true if the given NID is found in the list */
578 static bool found_in_nid_list(hda_nid_t nid
, const hda_nid_t
*list
, int nums
)
580 return find_idx_in_nid_list(nid
, list
, nums
) >= 0;
583 /* check subsystem ID and set up device-specific initialization;
584 * return 1 if initialized, 0 if invalid SSID
586 /* 32-bit subsystem ID for BIOS loading in HD Audio codec.
587 * 31 ~ 16 : Manufacture ID
589 * 7 ~ 0 : Assembly ID
590 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
592 static int alc_subsystem_id(struct hda_codec
*codec
, const hda_nid_t
*ports
)
594 unsigned int ass
, tmp
, i
;
596 struct alc_spec
*spec
= codec
->spec
;
598 if (spec
->cdefine
.fixup
) {
599 ass
= spec
->cdefine
.sku_cfg
;
600 if (ass
== ALC_FIXUP_SKU_IGNORE
)
605 ass
= codec
->core
.subsystem_id
& 0xffff;
606 if (codec
->bus
->pci
&&
607 ass
!= codec
->bus
->pci
->subsystem_device
&& (ass
& 1))
610 /* invalid SSID, check the special NID pin defcfg instead */
612 * 31~30 : port connectivity
615 * 19~16 : Check sum (15:1)
620 if (codec
->core
.vendor_id
== 0x10ec0260)
622 ass
= snd_hda_codec_get_pincfg(codec
, nid
);
624 "realtek: No valid SSID, checking pincfg 0x%08x for NID 0x%x\n",
628 if ((ass
>> 30) != 1) /* no physical connection */
633 for (i
= 1; i
< 16; i
++) {
637 if (((ass
>> 16) & 0xf) != tmp
)
640 codec_dbg(codec
, "realtek: Enabling init ASM_ID=0x%04x CODEC_ID=%08x\n",
641 ass
& 0xffff, codec
->core
.vendor_id
);
645 * 2 : 0 --> Desktop, 1 --> Laptop
646 * 3~5 : External Amplifier control
649 tmp
= (ass
& 0x38) >> 3; /* external Amp control */
652 spec
->init_amp
= ALC_INIT_GPIO1
;
655 spec
->init_amp
= ALC_INIT_GPIO2
;
658 spec
->init_amp
= ALC_INIT_GPIO3
;
662 spec
->init_amp
= ALC_INIT_DEFAULT
;
666 /* is laptop or Desktop and enable the function "Mute internal speaker
667 * when the external headphone out jack is plugged"
672 * 10~8 : Jack location
673 * 12~11: Headphone out -> 00: PortA, 01: PortE, 02: PortD, 03: Resvered
675 * 15 : 1 --> enable the function "Mute internal speaker
676 * when the external headphone out jack is plugged"
678 if (!spec
->gen
.autocfg
.hp_pins
[0] &&
679 !(spec
->gen
.autocfg
.line_out_pins
[0] &&
680 spec
->gen
.autocfg
.line_out_type
== AUTO_PIN_HP_OUT
)) {
682 tmp
= (ass
>> 11) & 0x3; /* HP to chassis */
684 if (found_in_nid_list(nid
, spec
->gen
.autocfg
.line_out_pins
,
685 spec
->gen
.autocfg
.line_outs
))
687 spec
->gen
.autocfg
.hp_pins
[0] = nid
;
692 /* Check the validity of ALC subsystem-id
693 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
694 static void alc_ssid_check(struct hda_codec
*codec
, const hda_nid_t
*ports
)
696 if (!alc_subsystem_id(codec
, ports
)) {
697 struct alc_spec
*spec
= codec
->spec
;
699 "realtek: Enable default setup for auto mode as fallback\n");
700 spec
->init_amp
= ALC_INIT_DEFAULT
;
707 static void alc_fixup_inv_dmic(struct hda_codec
*codec
,
708 const struct hda_fixup
*fix
, int action
)
710 struct alc_spec
*spec
= codec
->spec
;
712 spec
->gen
.inv_dmic_split
= 1;
716 #ifdef CONFIG_SND_HDA_INPUT_BEEP
717 /* additional beep mixers; the actual parameters are overwritten at build */
718 static const struct snd_kcontrol_new alc_beep_mixer
[] = {
719 HDA_CODEC_VOLUME("Beep Playback Volume", 0, 0, HDA_INPUT
),
720 HDA_CODEC_MUTE_BEEP("Beep Playback Switch", 0, 0, HDA_INPUT
),
725 static int alc_build_controls(struct hda_codec
*codec
)
727 struct alc_spec
*spec
= codec
->spec
;
730 err
= snd_hda_gen_build_controls(codec
);
734 for (i
= 0; i
< spec
->num_mixers
; i
++) {
735 err
= snd_hda_add_new_ctls(codec
, spec
->mixers
[i
]);
740 #ifdef CONFIG_SND_HDA_INPUT_BEEP
741 /* create beep controls if needed */
742 if (spec
->beep_amp
) {
743 const struct snd_kcontrol_new
*knew
;
744 for (knew
= alc_beep_mixer
; knew
->name
; knew
++) {
745 struct snd_kcontrol
*kctl
;
746 kctl
= snd_ctl_new1(knew
, codec
);
749 kctl
->private_value
= spec
->beep_amp
;
750 err
= snd_hda_ctl_add(codec
, 0, kctl
);
757 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_BUILD
);
766 static int alc_init(struct hda_codec
*codec
)
768 struct alc_spec
*spec
= codec
->spec
;
771 spec
->init_hook(codec
);
774 alc_auto_init_amp(codec
, spec
->init_amp
);
776 snd_hda_gen_init(codec
);
778 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_INIT
);
783 static inline void alc_shutup(struct hda_codec
*codec
)
785 struct alc_spec
*spec
= codec
->spec
;
787 if (spec
&& spec
->shutup
)
790 snd_hda_shutup_pins(codec
);
793 static void alc_reboot_notify(struct hda_codec
*codec
)
795 struct alc_spec
*spec
= codec
->spec
;
797 if (spec
&& spec
->reboot_notify
)
798 spec
->reboot_notify(codec
);
803 /* power down codec to D3 at reboot/shutdown; set as reboot_notify ops */
804 static void alc_d3_at_reboot(struct hda_codec
*codec
)
806 snd_hda_codec_set_power_to_all(codec
, codec
->core
.afg
, AC_PWRST_D3
);
807 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
808 AC_VERB_SET_POWER_STATE
, AC_PWRST_D3
);
812 #define alc_free snd_hda_gen_free
815 static void alc_power_eapd(struct hda_codec
*codec
)
817 alc_auto_setup_eapd(codec
, false);
820 static int alc_suspend(struct hda_codec
*codec
)
822 struct alc_spec
*spec
= codec
->spec
;
824 if (spec
&& spec
->power_hook
)
825 spec
->power_hook(codec
);
831 static int alc_resume(struct hda_codec
*codec
)
833 struct alc_spec
*spec
= codec
->spec
;
835 if (!spec
->no_depop_delay
)
836 msleep(150); /* to avoid pop noise */
837 codec
->patch_ops
.init(codec
);
838 regcache_sync(codec
->core
.regmap
);
839 hda_call_check_power_status(codec
, 0x01);
846 static const struct hda_codec_ops alc_patch_ops
= {
847 .build_controls
= alc_build_controls
,
848 .build_pcms
= snd_hda_gen_build_pcms
,
851 .unsol_event
= snd_hda_jack_unsol_event
,
853 .resume
= alc_resume
,
854 .suspend
= alc_suspend
,
855 .check_power_status
= snd_hda_gen_check_power_status
,
857 .reboot_notify
= alc_reboot_notify
,
861 #define alc_codec_rename(codec, name) snd_hda_codec_set_name(codec, name)
864 * Rename codecs appropriately from COEF value or subvendor id
866 struct alc_codec_rename_table
{
867 unsigned int vendor_id
;
868 unsigned short coef_mask
;
869 unsigned short coef_bits
;
873 struct alc_codec_rename_pci_table
{
874 unsigned int codec_vendor_id
;
875 unsigned short pci_subvendor
;
876 unsigned short pci_subdevice
;
880 static struct alc_codec_rename_table rename_tbl
[] = {
881 { 0x10ec0221, 0xf00f, 0x1003, "ALC231" },
882 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
883 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
884 { 0x10ec0269, 0xf0f0, 0x3010, "ALC258" },
885 { 0x10ec0269, 0x00f0, 0x0010, "ALC269VB" },
886 { 0x10ec0269, 0xffff, 0xa023, "ALC259" },
887 { 0x10ec0269, 0xffff, 0x6023, "ALC281X" },
888 { 0x10ec0269, 0x00f0, 0x0020, "ALC269VC" },
889 { 0x10ec0269, 0x00f0, 0x0030, "ALC269VD" },
890 { 0x10ec0662, 0xffff, 0x4020, "ALC656" },
891 { 0x10ec0887, 0x00f0, 0x0030, "ALC887-VD" },
892 { 0x10ec0888, 0x00f0, 0x0030, "ALC888-VD" },
893 { 0x10ec0888, 0xf0f0, 0x3020, "ALC886" },
894 { 0x10ec0899, 0x2000, 0x2000, "ALC899" },
895 { 0x10ec0892, 0xffff, 0x8020, "ALC661" },
896 { 0x10ec0892, 0xffff, 0x8011, "ALC661" },
897 { 0x10ec0892, 0xffff, 0x4011, "ALC656" },
901 static struct alc_codec_rename_pci_table rename_pci_tbl
[] = {
902 { 0x10ec0280, 0x1028, 0, "ALC3220" },
903 { 0x10ec0282, 0x1028, 0, "ALC3221" },
904 { 0x10ec0283, 0x1028, 0, "ALC3223" },
905 { 0x10ec0288, 0x1028, 0, "ALC3263" },
906 { 0x10ec0292, 0x1028, 0, "ALC3226" },
907 { 0x10ec0293, 0x1028, 0, "ALC3235" },
908 { 0x10ec0255, 0x1028, 0, "ALC3234" },
909 { 0x10ec0668, 0x1028, 0, "ALC3661" },
910 { 0x10ec0275, 0x1028, 0, "ALC3260" },
911 { 0x10ec0899, 0x1028, 0, "ALC3861" },
912 { 0x10ec0298, 0x1028, 0, "ALC3266" },
913 { 0x10ec0256, 0x1028, 0, "ALC3246" },
914 { 0x10ec0225, 0x1028, 0, "ALC3253" },
915 { 0x10ec0295, 0x1028, 0, "ALC3254" },
916 { 0x10ec0299, 0x1028, 0, "ALC3271" },
917 { 0x10ec0670, 0x1025, 0, "ALC669X" },
918 { 0x10ec0676, 0x1025, 0, "ALC679X" },
919 { 0x10ec0282, 0x1043, 0, "ALC3229" },
920 { 0x10ec0233, 0x1043, 0, "ALC3236" },
921 { 0x10ec0280, 0x103c, 0, "ALC3228" },
922 { 0x10ec0282, 0x103c, 0, "ALC3227" },
923 { 0x10ec0286, 0x103c, 0, "ALC3242" },
924 { 0x10ec0290, 0x103c, 0, "ALC3241" },
925 { 0x10ec0668, 0x103c, 0, "ALC3662" },
926 { 0x10ec0283, 0x17aa, 0, "ALC3239" },
927 { 0x10ec0292, 0x17aa, 0, "ALC3232" },
931 static int alc_codec_rename_from_preset(struct hda_codec
*codec
)
933 const struct alc_codec_rename_table
*p
;
934 const struct alc_codec_rename_pci_table
*q
;
936 for (p
= rename_tbl
; p
->vendor_id
; p
++) {
937 if (p
->vendor_id
!= codec
->core
.vendor_id
)
939 if ((alc_get_coef0(codec
) & p
->coef_mask
) == p
->coef_bits
)
940 return alc_codec_rename(codec
, p
->name
);
943 if (!codec
->bus
->pci
)
945 for (q
= rename_pci_tbl
; q
->codec_vendor_id
; q
++) {
946 if (q
->codec_vendor_id
!= codec
->core
.vendor_id
)
948 if (q
->pci_subvendor
!= codec
->bus
->pci
->subsystem_vendor
)
950 if (!q
->pci_subdevice
||
951 q
->pci_subdevice
== codec
->bus
->pci
->subsystem_device
)
952 return alc_codec_rename(codec
, q
->name
);
960 * Digital-beep handlers
962 #ifdef CONFIG_SND_HDA_INPUT_BEEP
963 #define set_beep_amp(spec, nid, idx, dir) \
964 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
966 static const struct snd_pci_quirk beep_white_list
[] = {
967 SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
968 SND_PCI_QUIRK(0x1043, 0x115d, "ASUS", 1),
969 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
970 SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1),
971 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
972 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
973 SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1),
974 SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1),
975 SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1),
979 static inline int has_cdefine_beep(struct hda_codec
*codec
)
981 struct alc_spec
*spec
= codec
->spec
;
982 const struct snd_pci_quirk
*q
;
983 q
= snd_pci_quirk_lookup(codec
->bus
->pci
, beep_white_list
);
986 return spec
->cdefine
.enable_pcbeep
;
989 #define set_beep_amp(spec, nid, idx, dir) /* NOP */
990 #define has_cdefine_beep(codec) 0
993 /* parse the BIOS configuration and set up the alc_spec */
994 /* return 1 if successful, 0 if the proper config is not found,
995 * or a negative error code
997 static int alc_parse_auto_config(struct hda_codec
*codec
,
998 const hda_nid_t
*ignore_nids
,
999 const hda_nid_t
*ssid_nids
)
1001 struct alc_spec
*spec
= codec
->spec
;
1002 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
1005 err
= snd_hda_parse_pin_defcfg(codec
, cfg
, ignore_nids
,
1011 alc_ssid_check(codec
, ssid_nids
);
1013 err
= snd_hda_gen_parse_auto_config(codec
, cfg
);
1020 /* common preparation job for alc_spec */
1021 static int alc_alloc_spec(struct hda_codec
*codec
, hda_nid_t mixer_nid
)
1023 struct alc_spec
*spec
= kzalloc(sizeof(*spec
), GFP_KERNEL
);
1029 snd_hda_gen_spec_init(&spec
->gen
);
1030 spec
->gen
.mixer_nid
= mixer_nid
;
1031 spec
->gen
.own_eapd_ctl
= 1;
1032 codec
->single_adc_amp
= 1;
1033 /* FIXME: do we need this for all Realtek codec models? */
1034 codec
->spdif_status_reset
= 1;
1035 codec
->patch_ops
= alc_patch_ops
;
1037 err
= alc_codec_rename_from_preset(codec
);
1045 static int alc880_parse_auto_config(struct hda_codec
*codec
)
1047 static const hda_nid_t alc880_ignore
[] = { 0x1d, 0 };
1048 static const hda_nid_t alc880_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
1049 return alc_parse_auto_config(codec
, alc880_ignore
, alc880_ssids
);
1058 ALC880_FIXUP_MEDION_RIM
,
1060 ALC880_FIXUP_LG_LW25
,
1062 ALC880_FIXUP_EAPD_COEF
,
1063 ALC880_FIXUP_TCL_S700
,
1064 ALC880_FIXUP_VOL_KNOB
,
1065 ALC880_FIXUP_FUJITSU
,
1067 ALC880_FIXUP_UNIWILL
,
1068 ALC880_FIXUP_UNIWILL_DIG
,
1070 ALC880_FIXUP_ASUS_W5A
,
1071 ALC880_FIXUP_3ST_BASE
,
1073 ALC880_FIXUP_3ST_DIG
,
1074 ALC880_FIXUP_5ST_BASE
,
1076 ALC880_FIXUP_5ST_DIG
,
1077 ALC880_FIXUP_6ST_BASE
,
1079 ALC880_FIXUP_6ST_DIG
,
1080 ALC880_FIXUP_6ST_AUTOMUTE
,
1083 /* enable the volume-knob widget support on NID 0x21 */
1084 static void alc880_fixup_vol_knob(struct hda_codec
*codec
,
1085 const struct hda_fixup
*fix
, int action
)
1087 if (action
== HDA_FIXUP_ACT_PROBE
)
1088 snd_hda_jack_detect_enable_callback(codec
, 0x21,
1089 alc_update_knob_master
);
1092 static const struct hda_fixup alc880_fixups
[] = {
1093 [ALC880_FIXUP_GPIO1
] = {
1094 .type
= HDA_FIXUP_VERBS
,
1095 .v
.verbs
= alc_gpio1_init_verbs
,
1097 [ALC880_FIXUP_GPIO2
] = {
1098 .type
= HDA_FIXUP_VERBS
,
1099 .v
.verbs
= alc_gpio2_init_verbs
,
1101 [ALC880_FIXUP_MEDION_RIM
] = {
1102 .type
= HDA_FIXUP_VERBS
,
1103 .v
.verbs
= (const struct hda_verb
[]) {
1104 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1105 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1109 .chain_id
= ALC880_FIXUP_GPIO2
,
1111 [ALC880_FIXUP_LG
] = {
1112 .type
= HDA_FIXUP_PINS
,
1113 .v
.pins
= (const struct hda_pintbl
[]) {
1114 /* disable bogus unused pins */
1115 { 0x16, 0x411111f0 },
1116 { 0x18, 0x411111f0 },
1117 { 0x1a, 0x411111f0 },
1121 [ALC880_FIXUP_LG_LW25
] = {
1122 .type
= HDA_FIXUP_PINS
,
1123 .v
.pins
= (const struct hda_pintbl
[]) {
1124 { 0x1a, 0x0181344f }, /* line-in */
1125 { 0x1b, 0x0321403f }, /* headphone */
1129 [ALC880_FIXUP_W810
] = {
1130 .type
= HDA_FIXUP_PINS
,
1131 .v
.pins
= (const struct hda_pintbl
[]) {
1132 /* disable bogus unused pins */
1133 { 0x17, 0x411111f0 },
1137 .chain_id
= ALC880_FIXUP_GPIO2
,
1139 [ALC880_FIXUP_EAPD_COEF
] = {
1140 .type
= HDA_FIXUP_VERBS
,
1141 .v
.verbs
= (const struct hda_verb
[]) {
1142 /* change to EAPD mode */
1143 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1144 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
1148 [ALC880_FIXUP_TCL_S700
] = {
1149 .type
= HDA_FIXUP_VERBS
,
1150 .v
.verbs
= (const struct hda_verb
[]) {
1151 /* change to EAPD mode */
1152 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
1153 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
1157 .chain_id
= ALC880_FIXUP_GPIO2
,
1159 [ALC880_FIXUP_VOL_KNOB
] = {
1160 .type
= HDA_FIXUP_FUNC
,
1161 .v
.func
= alc880_fixup_vol_knob
,
1163 [ALC880_FIXUP_FUJITSU
] = {
1164 /* override all pins as BIOS on old Amilo is broken */
1165 .type
= HDA_FIXUP_PINS
,
1166 .v
.pins
= (const struct hda_pintbl
[]) {
1167 { 0x14, 0x0121401f }, /* HP */
1168 { 0x15, 0x99030120 }, /* speaker */
1169 { 0x16, 0x99030130 }, /* bass speaker */
1170 { 0x17, 0x411111f0 }, /* N/A */
1171 { 0x18, 0x411111f0 }, /* N/A */
1172 { 0x19, 0x01a19950 }, /* mic-in */
1173 { 0x1a, 0x411111f0 }, /* N/A */
1174 { 0x1b, 0x411111f0 }, /* N/A */
1175 { 0x1c, 0x411111f0 }, /* N/A */
1176 { 0x1d, 0x411111f0 }, /* N/A */
1177 { 0x1e, 0x01454140 }, /* SPDIF out */
1181 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1183 [ALC880_FIXUP_F1734
] = {
1184 /* almost compatible with FUJITSU, but no bass and SPDIF */
1185 .type
= HDA_FIXUP_PINS
,
1186 .v
.pins
= (const struct hda_pintbl
[]) {
1187 { 0x14, 0x0121401f }, /* HP */
1188 { 0x15, 0x99030120 }, /* speaker */
1189 { 0x16, 0x411111f0 }, /* N/A */
1190 { 0x17, 0x411111f0 }, /* N/A */
1191 { 0x18, 0x411111f0 }, /* N/A */
1192 { 0x19, 0x01a19950 }, /* mic-in */
1193 { 0x1a, 0x411111f0 }, /* N/A */
1194 { 0x1b, 0x411111f0 }, /* N/A */
1195 { 0x1c, 0x411111f0 }, /* N/A */
1196 { 0x1d, 0x411111f0 }, /* N/A */
1197 { 0x1e, 0x411111f0 }, /* N/A */
1201 .chain_id
= ALC880_FIXUP_VOL_KNOB
,
1203 [ALC880_FIXUP_UNIWILL
] = {
1204 /* need to fix HP and speaker pins to be parsed correctly */
1205 .type
= HDA_FIXUP_PINS
,
1206 .v
.pins
= (const struct hda_pintbl
[]) {
1207 { 0x14, 0x0121411f }, /* HP */
1208 { 0x15, 0x99030120 }, /* speaker */
1209 { 0x16, 0x99030130 }, /* bass speaker */
1213 [ALC880_FIXUP_UNIWILL_DIG
] = {
1214 .type
= HDA_FIXUP_PINS
,
1215 .v
.pins
= (const struct hda_pintbl
[]) {
1216 /* disable bogus unused pins */
1217 { 0x17, 0x411111f0 },
1218 { 0x19, 0x411111f0 },
1219 { 0x1b, 0x411111f0 },
1220 { 0x1f, 0x411111f0 },
1224 [ALC880_FIXUP_Z71V
] = {
1225 .type
= HDA_FIXUP_PINS
,
1226 .v
.pins
= (const struct hda_pintbl
[]) {
1227 /* set up the whole pins as BIOS is utterly broken */
1228 { 0x14, 0x99030120 }, /* speaker */
1229 { 0x15, 0x0121411f }, /* HP */
1230 { 0x16, 0x411111f0 }, /* N/A */
1231 { 0x17, 0x411111f0 }, /* N/A */
1232 { 0x18, 0x01a19950 }, /* mic-in */
1233 { 0x19, 0x411111f0 }, /* N/A */
1234 { 0x1a, 0x01813031 }, /* line-in */
1235 { 0x1b, 0x411111f0 }, /* N/A */
1236 { 0x1c, 0x411111f0 }, /* N/A */
1237 { 0x1d, 0x411111f0 }, /* N/A */
1238 { 0x1e, 0x0144111e }, /* SPDIF */
1242 [ALC880_FIXUP_ASUS_W5A
] = {
1243 .type
= HDA_FIXUP_PINS
,
1244 .v
.pins
= (const struct hda_pintbl
[]) {
1245 /* set up the whole pins as BIOS is utterly broken */
1246 { 0x14, 0x0121411f }, /* HP */
1247 { 0x15, 0x411111f0 }, /* N/A */
1248 { 0x16, 0x411111f0 }, /* N/A */
1249 { 0x17, 0x411111f0 }, /* N/A */
1250 { 0x18, 0x90a60160 }, /* mic */
1251 { 0x19, 0x411111f0 }, /* N/A */
1252 { 0x1a, 0x411111f0 }, /* N/A */
1253 { 0x1b, 0x411111f0 }, /* N/A */
1254 { 0x1c, 0x411111f0 }, /* N/A */
1255 { 0x1d, 0x411111f0 }, /* N/A */
1256 { 0x1e, 0xb743111e }, /* SPDIF out */
1260 .chain_id
= ALC880_FIXUP_GPIO1
,
1262 [ALC880_FIXUP_3ST_BASE
] = {
1263 .type
= HDA_FIXUP_PINS
,
1264 .v
.pins
= (const struct hda_pintbl
[]) {
1265 { 0x14, 0x01014010 }, /* line-out */
1266 { 0x15, 0x411111f0 }, /* N/A */
1267 { 0x16, 0x411111f0 }, /* N/A */
1268 { 0x17, 0x411111f0 }, /* N/A */
1269 { 0x18, 0x01a19c30 }, /* mic-in */
1270 { 0x19, 0x0121411f }, /* HP */
1271 { 0x1a, 0x01813031 }, /* line-in */
1272 { 0x1b, 0x02a19c40 }, /* front-mic */
1273 { 0x1c, 0x411111f0 }, /* N/A */
1274 { 0x1d, 0x411111f0 }, /* N/A */
1275 /* 0x1e is filled in below */
1276 { 0x1f, 0x411111f0 }, /* N/A */
1280 [ALC880_FIXUP_3ST
] = {
1281 .type
= HDA_FIXUP_PINS
,
1282 .v
.pins
= (const struct hda_pintbl
[]) {
1283 { 0x1e, 0x411111f0 }, /* N/A */
1287 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1289 [ALC880_FIXUP_3ST_DIG
] = {
1290 .type
= HDA_FIXUP_PINS
,
1291 .v
.pins
= (const struct hda_pintbl
[]) {
1292 { 0x1e, 0x0144111e }, /* SPDIF */
1296 .chain_id
= ALC880_FIXUP_3ST_BASE
,
1298 [ALC880_FIXUP_5ST_BASE
] = {
1299 .type
= HDA_FIXUP_PINS
,
1300 .v
.pins
= (const struct hda_pintbl
[]) {
1301 { 0x14, 0x01014010 }, /* front */
1302 { 0x15, 0x411111f0 }, /* N/A */
1303 { 0x16, 0x01011411 }, /* CLFE */
1304 { 0x17, 0x01016412 }, /* surr */
1305 { 0x18, 0x01a19c30 }, /* mic-in */
1306 { 0x19, 0x0121411f }, /* HP */
1307 { 0x1a, 0x01813031 }, /* line-in */
1308 { 0x1b, 0x02a19c40 }, /* front-mic */
1309 { 0x1c, 0x411111f0 }, /* N/A */
1310 { 0x1d, 0x411111f0 }, /* N/A */
1311 /* 0x1e is filled in below */
1312 { 0x1f, 0x411111f0 }, /* N/A */
1316 [ALC880_FIXUP_5ST
] = {
1317 .type
= HDA_FIXUP_PINS
,
1318 .v
.pins
= (const struct hda_pintbl
[]) {
1319 { 0x1e, 0x411111f0 }, /* N/A */
1323 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1325 [ALC880_FIXUP_5ST_DIG
] = {
1326 .type
= HDA_FIXUP_PINS
,
1327 .v
.pins
= (const struct hda_pintbl
[]) {
1328 { 0x1e, 0x0144111e }, /* SPDIF */
1332 .chain_id
= ALC880_FIXUP_5ST_BASE
,
1334 [ALC880_FIXUP_6ST_BASE
] = {
1335 .type
= HDA_FIXUP_PINS
,
1336 .v
.pins
= (const struct hda_pintbl
[]) {
1337 { 0x14, 0x01014010 }, /* front */
1338 { 0x15, 0x01016412 }, /* surr */
1339 { 0x16, 0x01011411 }, /* CLFE */
1340 { 0x17, 0x01012414 }, /* side */
1341 { 0x18, 0x01a19c30 }, /* mic-in */
1342 { 0x19, 0x02a19c40 }, /* front-mic */
1343 { 0x1a, 0x01813031 }, /* line-in */
1344 { 0x1b, 0x0121411f }, /* HP */
1345 { 0x1c, 0x411111f0 }, /* N/A */
1346 { 0x1d, 0x411111f0 }, /* N/A */
1347 /* 0x1e is filled in below */
1348 { 0x1f, 0x411111f0 }, /* N/A */
1352 [ALC880_FIXUP_6ST
] = {
1353 .type
= HDA_FIXUP_PINS
,
1354 .v
.pins
= (const struct hda_pintbl
[]) {
1355 { 0x1e, 0x411111f0 }, /* N/A */
1359 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1361 [ALC880_FIXUP_6ST_DIG
] = {
1362 .type
= HDA_FIXUP_PINS
,
1363 .v
.pins
= (const struct hda_pintbl
[]) {
1364 { 0x1e, 0x0144111e }, /* SPDIF */
1368 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1370 [ALC880_FIXUP_6ST_AUTOMUTE
] = {
1371 .type
= HDA_FIXUP_PINS
,
1372 .v
.pins
= (const struct hda_pintbl
[]) {
1373 { 0x1b, 0x0121401f }, /* HP with jack detect */
1376 .chained_before
= true,
1377 .chain_id
= ALC880_FIXUP_6ST_BASE
,
1381 static const struct snd_pci_quirk alc880_fixup_tbl
[] = {
1382 SND_PCI_QUIRK(0x1019, 0x0f69, "Coeus G610P", ALC880_FIXUP_W810
),
1383 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS W5A", ALC880_FIXUP_ASUS_W5A
),
1384 SND_PCI_QUIRK(0x1043, 0x1964, "ASUS Z71V", ALC880_FIXUP_Z71V
),
1385 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS", ALC880_FIXUP_GPIO1
),
1386 SND_PCI_QUIRK(0x147b, 0x1045, "ABit AA8XE", ALC880_FIXUP_6ST_AUTOMUTE
),
1387 SND_PCI_QUIRK(0x1558, 0x5401, "Clevo GPIO2", ALC880_FIXUP_GPIO2
),
1388 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo", ALC880_FIXUP_EAPD_COEF
),
1389 SND_PCI_QUIRK(0x1584, 0x9050, "Uniwill", ALC880_FIXUP_UNIWILL_DIG
),
1390 SND_PCI_QUIRK(0x1584, 0x9054, "Uniwill", ALC880_FIXUP_F1734
),
1391 SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_FIXUP_UNIWILL
),
1392 SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_FIXUP_VOL_KNOB
),
1393 SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_FIXUP_W810
),
1394 SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM
),
1395 SND_PCI_QUIRK(0x1631, 0xe011, "PB 13201056", ALC880_FIXUP_6ST_AUTOMUTE
),
1396 SND_PCI_QUIRK(0x1734, 0x107c, "FSC Amilo M1437", ALC880_FIXUP_FUJITSU
),
1397 SND_PCI_QUIRK(0x1734, 0x1094, "FSC Amilo M1451G", ALC880_FIXUP_FUJITSU
),
1398 SND_PCI_QUIRK(0x1734, 0x10ac, "FSC AMILO Xi 1526", ALC880_FIXUP_F1734
),
1399 SND_PCI_QUIRK(0x1734, 0x10b0, "FSC Amilo Pi1556", ALC880_FIXUP_FUJITSU
),
1400 SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_FIXUP_LG
),
1401 SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG
),
1402 SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG
),
1403 SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_FIXUP_LG_LW25
),
1404 SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700
),
1406 /* Below is the copied entries from alc880_quirks.c.
1407 * It's not quite sure whether BIOS sets the correct pin-config table
1408 * on these machines, thus they are kept to be compatible with
1409 * the old static quirks. Once when it's confirmed to work without
1410 * these overrides, it'd be better to remove.
1412 SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG
),
1413 SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST
),
1414 SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG
),
1415 SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG
),
1416 SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG
),
1417 SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG
),
1418 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG
),
1419 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST
),
1420 SND_PCI_QUIRK(0x1039, 0x1234, NULL
, ALC880_FIXUP_6ST_DIG
),
1421 SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST
),
1422 SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST
),
1423 SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST
),
1424 SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST
),
1425 SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST
),
1426 SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG
),
1427 SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG
),
1428 SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG
),
1429 SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG
),
1430 SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG
),
1431 SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG
),
1432 SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG
),
1433 SND_PCI_QUIRK(0x2668, 0x8086, NULL
, ALC880_FIXUP_6ST_DIG
), /* broken BIOS */
1434 SND_PCI_QUIRK(0x8086, 0x2668, NULL
, ALC880_FIXUP_6ST_DIG
),
1435 SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1436 SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1437 SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1438 SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1439 SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1440 SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1441 SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG
),
1442 SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1443 SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1444 SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG
),
1446 SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST
),
1447 SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG
),
1448 SND_PCI_QUIRK(0xe803, 0x1019, NULL
, ALC880_FIXUP_6ST_DIG
),
1452 static const struct hda_model_fixup alc880_fixup_models
[] = {
1453 {.id
= ALC880_FIXUP_3ST
, .name
= "3stack"},
1454 {.id
= ALC880_FIXUP_3ST_DIG
, .name
= "3stack-digout"},
1455 {.id
= ALC880_FIXUP_5ST
, .name
= "5stack"},
1456 {.id
= ALC880_FIXUP_5ST_DIG
, .name
= "5stack-digout"},
1457 {.id
= ALC880_FIXUP_6ST
, .name
= "6stack"},
1458 {.id
= ALC880_FIXUP_6ST_DIG
, .name
= "6stack-digout"},
1459 {.id
= ALC880_FIXUP_6ST_AUTOMUTE
, .name
= "6stack-automute"},
1465 * OK, here we have finally the patch for ALC880
1467 static int patch_alc880(struct hda_codec
*codec
)
1469 struct alc_spec
*spec
;
1472 err
= alc_alloc_spec(codec
, 0x0b);
1477 spec
->gen
.need_dac_fix
= 1;
1478 spec
->gen
.beep_nid
= 0x01;
1480 codec
->patch_ops
.unsol_event
= alc880_unsol_event
;
1482 snd_hda_pick_fixup(codec
, alc880_fixup_models
, alc880_fixup_tbl
,
1484 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1486 /* automatic parse from the BIOS config */
1487 err
= alc880_parse_auto_config(codec
);
1491 if (!spec
->gen
.no_analog
)
1492 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
1494 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1507 static int alc260_parse_auto_config(struct hda_codec
*codec
)
1509 static const hda_nid_t alc260_ignore
[] = { 0x17, 0 };
1510 static const hda_nid_t alc260_ssids
[] = { 0x10, 0x15, 0x0f, 0 };
1511 return alc_parse_auto_config(codec
, alc260_ignore
, alc260_ssids
);
1518 ALC260_FIXUP_HP_DC5750
,
1519 ALC260_FIXUP_HP_PIN_0F
,
1522 ALC260_FIXUP_GPIO1_TOGGLE
,
1523 ALC260_FIXUP_REPLACER
,
1524 ALC260_FIXUP_HP_B1900
,
1526 ALC260_FIXUP_FSC_S7020
,
1527 ALC260_FIXUP_FSC_S7020_JWSE
,
1528 ALC260_FIXUP_VAIO_PINS
,
1531 static void alc260_gpio1_automute(struct hda_codec
*codec
)
1533 struct alc_spec
*spec
= codec
->spec
;
1534 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
1535 spec
->gen
.hp_jack_present
);
1538 static void alc260_fixup_gpio1_toggle(struct hda_codec
*codec
,
1539 const struct hda_fixup
*fix
, int action
)
1541 struct alc_spec
*spec
= codec
->spec
;
1542 if (action
== HDA_FIXUP_ACT_PROBE
) {
1543 /* although the machine has only one output pin, we need to
1544 * toggle GPIO1 according to the jack state
1546 spec
->gen
.automute_hook
= alc260_gpio1_automute
;
1547 spec
->gen
.detect_hp
= 1;
1548 spec
->gen
.automute_speaker
= 1;
1549 spec
->gen
.autocfg
.hp_pins
[0] = 0x0f; /* copy it for automute */
1550 snd_hda_jack_detect_enable_callback(codec
, 0x0f,
1551 snd_hda_gen_hp_automute
);
1552 snd_hda_add_verbs(codec
, alc_gpio1_init_verbs
);
1556 static void alc260_fixup_kn1(struct hda_codec
*codec
,
1557 const struct hda_fixup
*fix
, int action
)
1559 struct alc_spec
*spec
= codec
->spec
;
1560 static const struct hda_pintbl pincfgs
[] = {
1561 { 0x0f, 0x02214000 }, /* HP/speaker */
1562 { 0x12, 0x90a60160 }, /* int mic */
1563 { 0x13, 0x02a19000 }, /* ext mic */
1564 { 0x18, 0x01446000 }, /* SPDIF out */
1565 /* disable bogus I/O pins */
1566 { 0x10, 0x411111f0 },
1567 { 0x11, 0x411111f0 },
1568 { 0x14, 0x411111f0 },
1569 { 0x15, 0x411111f0 },
1570 { 0x16, 0x411111f0 },
1571 { 0x17, 0x411111f0 },
1572 { 0x19, 0x411111f0 },
1577 case HDA_FIXUP_ACT_PRE_PROBE
:
1578 snd_hda_apply_pincfgs(codec
, pincfgs
);
1580 case HDA_FIXUP_ACT_PROBE
:
1581 spec
->init_amp
= ALC_INIT_NONE
;
1586 static void alc260_fixup_fsc_s7020(struct hda_codec
*codec
,
1587 const struct hda_fixup
*fix
, int action
)
1589 struct alc_spec
*spec
= codec
->spec
;
1590 if (action
== HDA_FIXUP_ACT_PROBE
)
1591 spec
->init_amp
= ALC_INIT_NONE
;
1594 static void alc260_fixup_fsc_s7020_jwse(struct hda_codec
*codec
,
1595 const struct hda_fixup
*fix
, int action
)
1597 struct alc_spec
*spec
= codec
->spec
;
1598 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1599 spec
->gen
.add_jack_modes
= 1;
1600 spec
->gen
.hp_mic
= 1;
1604 static const struct hda_fixup alc260_fixups
[] = {
1605 [ALC260_FIXUP_HP_DC5750
] = {
1606 .type
= HDA_FIXUP_PINS
,
1607 .v
.pins
= (const struct hda_pintbl
[]) {
1608 { 0x11, 0x90130110 }, /* speaker */
1612 [ALC260_FIXUP_HP_PIN_0F
] = {
1613 .type
= HDA_FIXUP_PINS
,
1614 .v
.pins
= (const struct hda_pintbl
[]) {
1615 { 0x0f, 0x01214000 }, /* HP */
1619 [ALC260_FIXUP_COEF
] = {
1620 .type
= HDA_FIXUP_VERBS
,
1621 .v
.verbs
= (const struct hda_verb
[]) {
1622 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1623 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3040 },
1627 [ALC260_FIXUP_GPIO1
] = {
1628 .type
= HDA_FIXUP_VERBS
,
1629 .v
.verbs
= alc_gpio1_init_verbs
,
1631 [ALC260_FIXUP_GPIO1_TOGGLE
] = {
1632 .type
= HDA_FIXUP_FUNC
,
1633 .v
.func
= alc260_fixup_gpio1_toggle
,
1635 .chain_id
= ALC260_FIXUP_HP_PIN_0F
,
1637 [ALC260_FIXUP_REPLACER
] = {
1638 .type
= HDA_FIXUP_VERBS
,
1639 .v
.verbs
= (const struct hda_verb
[]) {
1640 { 0x1a, AC_VERB_SET_COEF_INDEX
, 0x07 },
1641 { 0x1a, AC_VERB_SET_PROC_COEF
, 0x3050 },
1645 .chain_id
= ALC260_FIXUP_GPIO1_TOGGLE
,
1647 [ALC260_FIXUP_HP_B1900
] = {
1648 .type
= HDA_FIXUP_FUNC
,
1649 .v
.func
= alc260_fixup_gpio1_toggle
,
1651 .chain_id
= ALC260_FIXUP_COEF
,
1653 [ALC260_FIXUP_KN1
] = {
1654 .type
= HDA_FIXUP_FUNC
,
1655 .v
.func
= alc260_fixup_kn1
,
1657 [ALC260_FIXUP_FSC_S7020
] = {
1658 .type
= HDA_FIXUP_FUNC
,
1659 .v
.func
= alc260_fixup_fsc_s7020
,
1661 [ALC260_FIXUP_FSC_S7020_JWSE
] = {
1662 .type
= HDA_FIXUP_FUNC
,
1663 .v
.func
= alc260_fixup_fsc_s7020_jwse
,
1665 .chain_id
= ALC260_FIXUP_FSC_S7020
,
1667 [ALC260_FIXUP_VAIO_PINS
] = {
1668 .type
= HDA_FIXUP_PINS
,
1669 .v
.pins
= (const struct hda_pintbl
[]) {
1670 /* Pin configs are missing completely on some VAIOs */
1671 { 0x0f, 0x01211020 },
1672 { 0x10, 0x0001003f },
1673 { 0x11, 0x411111f0 },
1674 { 0x12, 0x01a15930 },
1675 { 0x13, 0x411111f0 },
1676 { 0x14, 0x411111f0 },
1677 { 0x15, 0x411111f0 },
1678 { 0x16, 0x411111f0 },
1679 { 0x17, 0x411111f0 },
1680 { 0x18, 0x411111f0 },
1681 { 0x19, 0x411111f0 },
1687 static const struct snd_pci_quirk alc260_fixup_tbl
[] = {
1688 SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_FIXUP_GPIO1
),
1689 SND_PCI_QUIRK(0x1025, 0x007f, "Acer Aspire 9500", ALC260_FIXUP_COEF
),
1690 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_FIXUP_GPIO1
),
1691 SND_PCI_QUIRK(0x103c, 0x280a, "HP dc5750", ALC260_FIXUP_HP_DC5750
),
1692 SND_PCI_QUIRK(0x103c, 0x30ba, "HP Presario B1900", ALC260_FIXUP_HP_B1900
),
1693 SND_PCI_QUIRK(0x104d, 0x81bb, "Sony VAIO", ALC260_FIXUP_VAIO_PINS
),
1694 SND_PCI_QUIRK(0x104d, 0x81e2, "Sony VAIO TX", ALC260_FIXUP_HP_PIN_0F
),
1695 SND_PCI_QUIRK(0x10cf, 0x1326, "FSC LifeBook S7020", ALC260_FIXUP_FSC_S7020
),
1696 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FIXUP_GPIO1
),
1697 SND_PCI_QUIRK(0x152d, 0x0729, "Quanta KN1", ALC260_FIXUP_KN1
),
1698 SND_PCI_QUIRK(0x161f, 0x2057, "Replacer 672V", ALC260_FIXUP_REPLACER
),
1699 SND_PCI_QUIRK(0x1631, 0xc017, "PB V7900", ALC260_FIXUP_COEF
),
1703 static const struct hda_model_fixup alc260_fixup_models
[] = {
1704 {.id
= ALC260_FIXUP_GPIO1
, .name
= "gpio1"},
1705 {.id
= ALC260_FIXUP_COEF
, .name
= "coef"},
1706 {.id
= ALC260_FIXUP_FSC_S7020
, .name
= "fujitsu"},
1707 {.id
= ALC260_FIXUP_FSC_S7020_JWSE
, .name
= "fujitsu-jwse"},
1713 static int patch_alc260(struct hda_codec
*codec
)
1715 struct alc_spec
*spec
;
1718 err
= alc_alloc_spec(codec
, 0x07);
1723 /* as quite a few machines require HP amp for speaker outputs,
1724 * it's easier to enable it unconditionally; even if it's unneeded,
1725 * it's almost harmless.
1727 spec
->gen
.prefer_hp_amp
= 1;
1728 spec
->gen
.beep_nid
= 0x01;
1730 spec
->shutup
= alc_eapd_shutup
;
1732 snd_hda_pick_fixup(codec
, alc260_fixup_models
, alc260_fixup_tbl
,
1734 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
1736 /* automatic parse from the BIOS config */
1737 err
= alc260_parse_auto_config(codec
);
1741 if (!spec
->gen
.no_analog
)
1742 set_beep_amp(spec
, 0x07, 0x05, HDA_INPUT
);
1744 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
1755 * ALC882/883/885/888/889 support
1757 * ALC882 is almost identical with ALC880 but has cleaner and more flexible
1758 * configuration. Each pin widget can choose any input DACs and a mixer.
1759 * Each ADC is connected from a mixer of all inputs. This makes possible
1760 * 6-channel independent captures.
1762 * In addition, an independent DAC for the multi-playback (not used in this
1770 ALC882_FIXUP_ABIT_AW9D_MAX
,
1771 ALC882_FIXUP_LENOVO_Y530
,
1772 ALC882_FIXUP_PB_M5210
,
1773 ALC882_FIXUP_ACER_ASPIRE_7736
,
1774 ALC882_FIXUP_ASUS_W90V
,
1776 ALC889_FIXUP_FRONT_HP_NO_PRESENCE
,
1777 ALC889_FIXUP_VAIO_TT
,
1778 ALC888_FIXUP_EEE1601
,
1781 ALC883_FIXUP_ACER_EAPD
,
1786 ALC882_FIXUP_ASUS_W2JC
,
1787 ALC882_FIXUP_ACER_ASPIRE_4930G
,
1788 ALC882_FIXUP_ACER_ASPIRE_8930G
,
1789 ALC882_FIXUP_ASPIRE_8930G_VERBS
,
1790 ALC885_FIXUP_MACPRO_GPIO
,
1791 ALC889_FIXUP_DAC_ROUTE
,
1792 ALC889_FIXUP_MBP_VREF
,
1793 ALC889_FIXUP_IMAC91_VREF
,
1794 ALC889_FIXUP_MBA11_VREF
,
1795 ALC889_FIXUP_MBA21_VREF
,
1796 ALC889_FIXUP_MP11_VREF
,
1797 ALC889_FIXUP_MP41_VREF
,
1798 ALC882_FIXUP_INV_DMIC
,
1799 ALC882_FIXUP_NO_PRIMARY_HP
,
1800 ALC887_FIXUP_ASUS_BASS
,
1801 ALC887_FIXUP_BASS_CHMAP
,
1802 ALC1220_FIXUP_GB_DUAL_CODECS
,
1805 static void alc889_fixup_coef(struct hda_codec
*codec
,
1806 const struct hda_fixup
*fix
, int action
)
1808 if (action
!= HDA_FIXUP_ACT_INIT
)
1810 alc_update_coef_idx(codec
, 7, 0, 0x2030);
1813 /* toggle speaker-output according to the hp-jack state */
1814 static void alc882_gpio_mute(struct hda_codec
*codec
, int pin
, int muted
)
1816 unsigned int gpiostate
, gpiomask
, gpiodir
;
1818 gpiostate
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1819 AC_VERB_GET_GPIO_DATA
, 0);
1822 gpiostate
|= (1 << pin
);
1824 gpiostate
&= ~(1 << pin
);
1826 gpiomask
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1827 AC_VERB_GET_GPIO_MASK
, 0);
1828 gpiomask
|= (1 << pin
);
1830 gpiodir
= snd_hda_codec_read(codec
, codec
->core
.afg
, 0,
1831 AC_VERB_GET_GPIO_DIRECTION
, 0);
1832 gpiodir
|= (1 << pin
);
1835 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1836 AC_VERB_SET_GPIO_MASK
, gpiomask
);
1837 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1838 AC_VERB_SET_GPIO_DIRECTION
, gpiodir
);
1842 snd_hda_codec_write(codec
, codec
->core
.afg
, 0,
1843 AC_VERB_SET_GPIO_DATA
, gpiostate
);
1846 /* set up GPIO at initialization */
1847 static void alc885_fixup_macpro_gpio(struct hda_codec
*codec
,
1848 const struct hda_fixup
*fix
, int action
)
1850 if (action
!= HDA_FIXUP_ACT_INIT
)
1852 alc882_gpio_mute(codec
, 0, 0);
1853 alc882_gpio_mute(codec
, 1, 0);
1856 /* Fix the connection of some pins for ALC889:
1857 * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
1858 * work correctly (bko#42740)
1860 static void alc889_fixup_dac_route(struct hda_codec
*codec
,
1861 const struct hda_fixup
*fix
, int action
)
1863 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1864 /* fake the connections during parsing the tree */
1865 hda_nid_t conn1
[2] = { 0x0c, 0x0d };
1866 hda_nid_t conn2
[2] = { 0x0e, 0x0f };
1867 snd_hda_override_conn_list(codec
, 0x14, 2, conn1
);
1868 snd_hda_override_conn_list(codec
, 0x15, 2, conn1
);
1869 snd_hda_override_conn_list(codec
, 0x18, 2, conn2
);
1870 snd_hda_override_conn_list(codec
, 0x1a, 2, conn2
);
1871 } else if (action
== HDA_FIXUP_ACT_PROBE
) {
1872 /* restore the connections */
1873 hda_nid_t conn
[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
1874 snd_hda_override_conn_list(codec
, 0x14, 5, conn
);
1875 snd_hda_override_conn_list(codec
, 0x15, 5, conn
);
1876 snd_hda_override_conn_list(codec
, 0x18, 5, conn
);
1877 snd_hda_override_conn_list(codec
, 0x1a, 5, conn
);
1881 /* Set VREF on HP pin */
1882 static void alc889_fixup_mbp_vref(struct hda_codec
*codec
,
1883 const struct hda_fixup
*fix
, int action
)
1885 struct alc_spec
*spec
= codec
->spec
;
1886 static hda_nid_t nids
[3] = { 0x14, 0x15, 0x19 };
1889 if (action
!= HDA_FIXUP_ACT_INIT
)
1891 for (i
= 0; i
< ARRAY_SIZE(nids
); i
++) {
1892 unsigned int val
= snd_hda_codec_get_pincfg(codec
, nids
[i
]);
1893 if (get_defcfg_device(val
) != AC_JACK_HP_OUT
)
1895 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1896 val
|= AC_PINCTL_VREF_80
;
1897 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1898 spec
->gen
.keep_vref_in_automute
= 1;
1903 static void alc889_fixup_mac_pins(struct hda_codec
*codec
,
1904 const hda_nid_t
*nids
, int num_nids
)
1906 struct alc_spec
*spec
= codec
->spec
;
1909 for (i
= 0; i
< num_nids
; i
++) {
1911 val
= snd_hda_codec_get_pin_target(codec
, nids
[i
]);
1912 val
|= AC_PINCTL_VREF_50
;
1913 snd_hda_set_pin_ctl(codec
, nids
[i
], val
);
1915 spec
->gen
.keep_vref_in_automute
= 1;
1918 /* Set VREF on speaker pins on imac91 */
1919 static void alc889_fixup_imac91_vref(struct hda_codec
*codec
,
1920 const struct hda_fixup
*fix
, int action
)
1922 static hda_nid_t nids
[2] = { 0x18, 0x1a };
1924 if (action
== HDA_FIXUP_ACT_INIT
)
1925 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1928 /* Set VREF on speaker pins on mba11 */
1929 static void alc889_fixup_mba11_vref(struct hda_codec
*codec
,
1930 const struct hda_fixup
*fix
, int action
)
1932 static hda_nid_t nids
[1] = { 0x18 };
1934 if (action
== HDA_FIXUP_ACT_INIT
)
1935 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1938 /* Set VREF on speaker pins on mba21 */
1939 static void alc889_fixup_mba21_vref(struct hda_codec
*codec
,
1940 const struct hda_fixup
*fix
, int action
)
1942 static hda_nid_t nids
[2] = { 0x18, 0x19 };
1944 if (action
== HDA_FIXUP_ACT_INIT
)
1945 alc889_fixup_mac_pins(codec
, nids
, ARRAY_SIZE(nids
));
1948 /* Don't take HP output as primary
1949 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1950 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
1952 static void alc882_fixup_no_primary_hp(struct hda_codec
*codec
,
1953 const struct hda_fixup
*fix
, int action
)
1955 struct alc_spec
*spec
= codec
->spec
;
1956 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
1957 spec
->gen
.no_primary_hp
= 1;
1958 spec
->gen
.no_multi_io
= 1;
1962 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
1963 const struct hda_fixup
*fix
, int action
);
1965 /* For dual-codec configuration, we need to disable some features to avoid
1966 * conflicts of kctls and PCM streams
1968 static void alc_fixup_dual_codecs(struct hda_codec
*codec
,
1969 const struct hda_fixup
*fix
, int action
)
1971 struct alc_spec
*spec
= codec
->spec
;
1973 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
1975 /* disable vmaster */
1976 spec
->gen
.suppress_vmaster
= 1;
1977 /* auto-mute and auto-mic switch don't work with multiple codecs */
1978 spec
->gen
.suppress_auto_mute
= 1;
1979 spec
->gen
.suppress_auto_mic
= 1;
1980 /* disable aamix as well */
1981 spec
->gen
.mixer_nid
= 0;
1982 /* add location prefix to avoid conflicts */
1983 codec
->force_pin_prefix
= 1;
1986 static void rename_ctl(struct hda_codec
*codec
, const char *oldname
,
1987 const char *newname
)
1989 struct snd_kcontrol
*kctl
;
1991 kctl
= snd_hda_find_mixer_ctl(codec
, oldname
);
1993 strcpy(kctl
->id
.name
, newname
);
1996 static void alc1220_fixup_gb_dual_codecs(struct hda_codec
*codec
,
1997 const struct hda_fixup
*fix
,
2000 alc_fixup_dual_codecs(codec
, fix
, action
);
2002 case HDA_FIXUP_ACT_PRE_PROBE
:
2003 /* override card longname to provide a unique UCM profile */
2004 strcpy(codec
->card
->longname
, "HDAudio-Gigabyte-ALC1220DualCodecs");
2006 case HDA_FIXUP_ACT_BUILD
:
2007 /* rename Capture controls depending on the codec */
2008 rename_ctl(codec
, "Capture Volume",
2010 "Rear-Panel Capture Volume" :
2011 "Front-Panel Capture Volume");
2012 rename_ctl(codec
, "Capture Switch",
2014 "Rear-Panel Capture Switch" :
2015 "Front-Panel Capture Switch");
2020 static const struct hda_fixup alc882_fixups
[] = {
2021 [ALC882_FIXUP_ABIT_AW9D_MAX
] = {
2022 .type
= HDA_FIXUP_PINS
,
2023 .v
.pins
= (const struct hda_pintbl
[]) {
2024 { 0x15, 0x01080104 }, /* side */
2025 { 0x16, 0x01011012 }, /* rear */
2026 { 0x17, 0x01016011 }, /* clfe */
2030 [ALC882_FIXUP_LENOVO_Y530
] = {
2031 .type
= HDA_FIXUP_PINS
,
2032 .v
.pins
= (const struct hda_pintbl
[]) {
2033 { 0x15, 0x99130112 }, /* rear int speakers */
2034 { 0x16, 0x99130111 }, /* subwoofer */
2038 [ALC882_FIXUP_PB_M5210
] = {
2039 .type
= HDA_FIXUP_PINCTLS
,
2040 .v
.pins
= (const struct hda_pintbl
[]) {
2041 { 0x19, PIN_VREF50
},
2045 [ALC882_FIXUP_ACER_ASPIRE_7736
] = {
2046 .type
= HDA_FIXUP_FUNC
,
2047 .v
.func
= alc_fixup_sku_ignore
,
2049 [ALC882_FIXUP_ASUS_W90V
] = {
2050 .type
= HDA_FIXUP_PINS
,
2051 .v
.pins
= (const struct hda_pintbl
[]) {
2052 { 0x16, 0x99130110 }, /* fix sequence for CLFE */
2056 [ALC889_FIXUP_CD
] = {
2057 .type
= HDA_FIXUP_PINS
,
2058 .v
.pins
= (const struct hda_pintbl
[]) {
2059 { 0x1c, 0x993301f0 }, /* CD */
2063 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE
] = {
2064 .type
= HDA_FIXUP_PINS
,
2065 .v
.pins
= (const struct hda_pintbl
[]) {
2066 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2070 .chain_id
= ALC889_FIXUP_CD
,
2072 [ALC889_FIXUP_VAIO_TT
] = {
2073 .type
= HDA_FIXUP_PINS
,
2074 .v
.pins
= (const struct hda_pintbl
[]) {
2075 { 0x17, 0x90170111 }, /* hidden surround speaker */
2079 [ALC888_FIXUP_EEE1601
] = {
2080 .type
= HDA_FIXUP_VERBS
,
2081 .v
.verbs
= (const struct hda_verb
[]) {
2082 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2083 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0838 },
2087 [ALC882_FIXUP_EAPD
] = {
2088 .type
= HDA_FIXUP_VERBS
,
2089 .v
.verbs
= (const struct hda_verb
[]) {
2090 /* change to EAPD mode */
2091 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2092 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3060 },
2096 [ALC883_FIXUP_EAPD
] = {
2097 .type
= HDA_FIXUP_VERBS
,
2098 .v
.verbs
= (const struct hda_verb
[]) {
2099 /* change to EAPD mode */
2100 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2101 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2105 [ALC883_FIXUP_ACER_EAPD
] = {
2106 .type
= HDA_FIXUP_VERBS
,
2107 .v
.verbs
= (const struct hda_verb
[]) {
2108 /* eanable EAPD on Acer laptops */
2109 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2110 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2114 [ALC882_FIXUP_GPIO1
] = {
2115 .type
= HDA_FIXUP_VERBS
,
2116 .v
.verbs
= alc_gpio1_init_verbs
,
2118 [ALC882_FIXUP_GPIO2
] = {
2119 .type
= HDA_FIXUP_VERBS
,
2120 .v
.verbs
= alc_gpio2_init_verbs
,
2122 [ALC882_FIXUP_GPIO3
] = {
2123 .type
= HDA_FIXUP_VERBS
,
2124 .v
.verbs
= alc_gpio3_init_verbs
,
2126 [ALC882_FIXUP_ASUS_W2JC
] = {
2127 .type
= HDA_FIXUP_VERBS
,
2128 .v
.verbs
= alc_gpio1_init_verbs
,
2130 .chain_id
= ALC882_FIXUP_EAPD
,
2132 [ALC889_FIXUP_COEF
] = {
2133 .type
= HDA_FIXUP_FUNC
,
2134 .v
.func
= alc889_fixup_coef
,
2136 [ALC882_FIXUP_ACER_ASPIRE_4930G
] = {
2137 .type
= HDA_FIXUP_PINS
,
2138 .v
.pins
= (const struct hda_pintbl
[]) {
2139 { 0x16, 0x99130111 }, /* CLFE speaker */
2140 { 0x17, 0x99130112 }, /* surround speaker */
2144 .chain_id
= ALC882_FIXUP_GPIO1
,
2146 [ALC882_FIXUP_ACER_ASPIRE_8930G
] = {
2147 .type
= HDA_FIXUP_PINS
,
2148 .v
.pins
= (const struct hda_pintbl
[]) {
2149 { 0x16, 0x99130111 }, /* CLFE speaker */
2150 { 0x1b, 0x99130112 }, /* surround speaker */
2154 .chain_id
= ALC882_FIXUP_ASPIRE_8930G_VERBS
,
2156 [ALC882_FIXUP_ASPIRE_8930G_VERBS
] = {
2157 /* additional init verbs for Acer Aspire 8930G */
2158 .type
= HDA_FIXUP_VERBS
,
2159 .v
.verbs
= (const struct hda_verb
[]) {
2160 /* Enable all DACs */
2161 /* DAC DISABLE/MUTE 1? */
2162 /* setting bits 1-5 disables DAC nids 0x02-0x06
2163 * apparently. Init=0x38 */
2164 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x03 },
2165 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2166 /* DAC DISABLE/MUTE 2? */
2167 /* some bit here disables the other DACs.
2169 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x08 },
2170 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0000 },
2172 * This laptop has a stereo digital microphone.
2173 * The mics are only 1cm apart which makes the stereo
2174 * useless. However, either the mic or the ALC889
2175 * makes the signal become a difference/sum signal
2176 * instead of standard stereo, which is annoying.
2177 * So instead we flip this bit which makes the
2178 * codec replicate the sum signal to both channels,
2179 * turning it into a normal mono mic.
2181 /* DMIC_CONTROL? Init value = 0x0001 */
2182 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x0b },
2183 { 0x20, AC_VERB_SET_PROC_COEF
, 0x0003 },
2184 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2185 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2189 .chain_id
= ALC882_FIXUP_GPIO1
,
2191 [ALC885_FIXUP_MACPRO_GPIO
] = {
2192 .type
= HDA_FIXUP_FUNC
,
2193 .v
.func
= alc885_fixup_macpro_gpio
,
2195 [ALC889_FIXUP_DAC_ROUTE
] = {
2196 .type
= HDA_FIXUP_FUNC
,
2197 .v
.func
= alc889_fixup_dac_route
,
2199 [ALC889_FIXUP_MBP_VREF
] = {
2200 .type
= HDA_FIXUP_FUNC
,
2201 .v
.func
= alc889_fixup_mbp_vref
,
2203 .chain_id
= ALC882_FIXUP_GPIO1
,
2205 [ALC889_FIXUP_IMAC91_VREF
] = {
2206 .type
= HDA_FIXUP_FUNC
,
2207 .v
.func
= alc889_fixup_imac91_vref
,
2209 .chain_id
= ALC882_FIXUP_GPIO1
,
2211 [ALC889_FIXUP_MBA11_VREF
] = {
2212 .type
= HDA_FIXUP_FUNC
,
2213 .v
.func
= alc889_fixup_mba11_vref
,
2215 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2217 [ALC889_FIXUP_MBA21_VREF
] = {
2218 .type
= HDA_FIXUP_FUNC
,
2219 .v
.func
= alc889_fixup_mba21_vref
,
2221 .chain_id
= ALC889_FIXUP_MBP_VREF
,
2223 [ALC889_FIXUP_MP11_VREF
] = {
2224 .type
= HDA_FIXUP_FUNC
,
2225 .v
.func
= alc889_fixup_mba11_vref
,
2227 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2229 [ALC889_FIXUP_MP41_VREF
] = {
2230 .type
= HDA_FIXUP_FUNC
,
2231 .v
.func
= alc889_fixup_mbp_vref
,
2233 .chain_id
= ALC885_FIXUP_MACPRO_GPIO
,
2235 [ALC882_FIXUP_INV_DMIC
] = {
2236 .type
= HDA_FIXUP_FUNC
,
2237 .v
.func
= alc_fixup_inv_dmic
,
2239 [ALC882_FIXUP_NO_PRIMARY_HP
] = {
2240 .type
= HDA_FIXUP_FUNC
,
2241 .v
.func
= alc882_fixup_no_primary_hp
,
2243 [ALC887_FIXUP_ASUS_BASS
] = {
2244 .type
= HDA_FIXUP_PINS
,
2245 .v
.pins
= (const struct hda_pintbl
[]) {
2246 {0x16, 0x99130130}, /* bass speaker */
2250 .chain_id
= ALC887_FIXUP_BASS_CHMAP
,
2252 [ALC887_FIXUP_BASS_CHMAP
] = {
2253 .type
= HDA_FIXUP_FUNC
,
2254 .v
.func
= alc_fixup_bass_chmap
,
2256 [ALC1220_FIXUP_GB_DUAL_CODECS
] = {
2257 .type
= HDA_FIXUP_FUNC
,
2258 .v
.func
= alc1220_fixup_gb_dual_codecs
,
2262 static const struct snd_pci_quirk alc882_fixup_tbl
[] = {
2263 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_FIXUP_ACER_EAPD
),
2264 SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2265 SND_PCI_QUIRK(0x1025, 0x0107, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2266 SND_PCI_QUIRK(0x1025, 0x010a, "Acer Ferrari 5000", ALC883_FIXUP_ACER_EAPD
),
2267 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_FIXUP_ACER_EAPD
),
2268 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_FIXUP_ACER_EAPD
),
2269 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_FIXUP_ACER_EAPD
),
2270 SND_PCI_QUIRK(0x1025, 0x013e, "Acer Aspire 4930G",
2271 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2272 SND_PCI_QUIRK(0x1025, 0x013f, "Acer Aspire 5930G",
2273 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2274 SND_PCI_QUIRK(0x1025, 0x0145, "Acer Aspire 8930G",
2275 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2276 SND_PCI_QUIRK(0x1025, 0x0146, "Acer Aspire 6935G",
2277 ALC882_FIXUP_ACER_ASPIRE_8930G
),
2278 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
2279 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2280 SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
2281 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2282 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
2283 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2284 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210
),
2285 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
2286 ALC882_FIXUP_ACER_ASPIRE_4930G
),
2287 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE
),
2288 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G
),
2289 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736
),
2290 SND_PCI_QUIRK(0x1043, 0x13c2, "Asus A7M", ALC882_FIXUP_EAPD
),
2291 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", ALC882_FIXUP_ASUS_W90V
),
2292 SND_PCI_QUIRK(0x1043, 0x1971, "Asus W2JC", ALC882_FIXUP_ASUS_W2JC
),
2293 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_FIXUP_EEE1601
),
2294 SND_PCI_QUIRK(0x1043, 0x84bc, "ASUS ET2700", ALC887_FIXUP_ASUS_BASS
),
2295 SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3
),
2296 SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT
),
2297 SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP
),
2298 SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP
),
2299 SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP
),
2301 /* All Apple entries are in codec SSIDs */
2302 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF
),
2303 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF
),
2304 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2305 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF
),
2306 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO
),
2307 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO
),
2308 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF
),
2309 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF
),
2310 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD
),
2311 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF
),
2312 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF
),
2313 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF
),
2314 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF
),
2315 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO
),
2316 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC889_FIXUP_IMAC91_VREF
),
2317 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC889_FIXUP_IMAC91_VREF
),
2318 SND_PCI_QUIRK(0x106b, 0x4100, "Macmini 3,1", ALC889_FIXUP_IMAC91_VREF
),
2319 SND_PCI_QUIRK(0x106b, 0x4200, "Mac Pro 4,1/5,1", ALC889_FIXUP_MP41_VREF
),
2320 SND_PCI_QUIRK(0x106b, 0x4300, "iMac 9,1", ALC889_FIXUP_IMAC91_VREF
),
2321 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC889_FIXUP_IMAC91_VREF
),
2322 SND_PCI_QUIRK(0x106b, 0x4900, "iMac 9,1 Aluminum", ALC889_FIXUP_IMAC91_VREF
),
2323 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_MBA11_VREF
),
2325 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD
),
2326 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE
),
2327 SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2328 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD
),
2329 SND_PCI_QUIRK(0x1462, 0xda57, "MSI Z270-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS
),
2330 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3
),
2331 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX
),
2332 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD
),
2333 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD
),
2334 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530
),
2335 SND_PCI_QUIRK(0x8086, 0x0022, "DX58SO", ALC889_FIXUP_COEF
),
2339 static const struct hda_model_fixup alc882_fixup_models
[] = {
2340 {.id
= ALC882_FIXUP_ACER_ASPIRE_4930G
, .name
= "acer-aspire-4930g"},
2341 {.id
= ALC882_FIXUP_ACER_ASPIRE_8930G
, .name
= "acer-aspire-8930g"},
2342 {.id
= ALC883_FIXUP_ACER_EAPD
, .name
= "acer-aspire"},
2343 {.id
= ALC882_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2344 {.id
= ALC882_FIXUP_NO_PRIMARY_HP
, .name
= "no-primary-hp"},
2345 {.id
= ALC1220_FIXUP_GB_DUAL_CODECS
, .name
= "dual-codecs"},
2350 * BIOS auto configuration
2352 /* almost identical with ALC880 parser... */
2353 static int alc882_parse_auto_config(struct hda_codec
*codec
)
2355 static const hda_nid_t alc882_ignore
[] = { 0x1d, 0 };
2356 static const hda_nid_t alc882_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2357 return alc_parse_auto_config(codec
, alc882_ignore
, alc882_ssids
);
2362 static int patch_alc882(struct hda_codec
*codec
)
2364 struct alc_spec
*spec
;
2367 err
= alc_alloc_spec(codec
, 0x0b);
2373 switch (codec
->core
.vendor_id
) {
2380 /* ALC883 and variants */
2381 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2385 snd_hda_pick_fixup(codec
, alc882_fixup_models
, alc882_fixup_tbl
,
2387 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2389 alc_auto_parse_customize_define(codec
);
2391 if (has_cdefine_beep(codec
))
2392 spec
->gen
.beep_nid
= 0x01;
2394 /* automatic parse from the BIOS config */
2395 err
= alc882_parse_auto_config(codec
);
2399 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2400 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2402 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2415 static int alc262_parse_auto_config(struct hda_codec
*codec
)
2417 static const hda_nid_t alc262_ignore
[] = { 0x1d, 0 };
2418 static const hda_nid_t alc262_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2419 return alc_parse_auto_config(codec
, alc262_ignore
, alc262_ssids
);
2426 ALC262_FIXUP_FSC_H270
,
2427 ALC262_FIXUP_FSC_S7110
,
2428 ALC262_FIXUP_HP_Z200
,
2430 ALC262_FIXUP_LENOVO_3000
,
2432 ALC262_FIXUP_BENQ_T31
,
2433 ALC262_FIXUP_INV_DMIC
,
2434 ALC262_FIXUP_INTEL_BAYLEYBAY
,
2437 static const struct hda_fixup alc262_fixups
[] = {
2438 [ALC262_FIXUP_FSC_H270
] = {
2439 .type
= HDA_FIXUP_PINS
,
2440 .v
.pins
= (const struct hda_pintbl
[]) {
2441 { 0x14, 0x99130110 }, /* speaker */
2442 { 0x15, 0x0221142f }, /* front HP */
2443 { 0x1b, 0x0121141f }, /* rear HP */
2447 [ALC262_FIXUP_FSC_S7110
] = {
2448 .type
= HDA_FIXUP_PINS
,
2449 .v
.pins
= (const struct hda_pintbl
[]) {
2450 { 0x15, 0x90170110 }, /* speaker */
2454 .chain_id
= ALC262_FIXUP_BENQ
,
2456 [ALC262_FIXUP_HP_Z200
] = {
2457 .type
= HDA_FIXUP_PINS
,
2458 .v
.pins
= (const struct hda_pintbl
[]) {
2459 { 0x16, 0x99130120 }, /* internal speaker */
2463 [ALC262_FIXUP_TYAN
] = {
2464 .type
= HDA_FIXUP_PINS
,
2465 .v
.pins
= (const struct hda_pintbl
[]) {
2466 { 0x14, 0x1993e1f0 }, /* int AUX */
2470 [ALC262_FIXUP_LENOVO_3000
] = {
2471 .type
= HDA_FIXUP_PINCTLS
,
2472 .v
.pins
= (const struct hda_pintbl
[]) {
2473 { 0x19, PIN_VREF50
},
2477 .chain_id
= ALC262_FIXUP_BENQ
,
2479 [ALC262_FIXUP_BENQ
] = {
2480 .type
= HDA_FIXUP_VERBS
,
2481 .v
.verbs
= (const struct hda_verb
[]) {
2482 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2483 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3070 },
2487 [ALC262_FIXUP_BENQ_T31
] = {
2488 .type
= HDA_FIXUP_VERBS
,
2489 .v
.verbs
= (const struct hda_verb
[]) {
2490 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x07 },
2491 { 0x20, AC_VERB_SET_PROC_COEF
, 0x3050 },
2495 [ALC262_FIXUP_INV_DMIC
] = {
2496 .type
= HDA_FIXUP_FUNC
,
2497 .v
.func
= alc_fixup_inv_dmic
,
2499 [ALC262_FIXUP_INTEL_BAYLEYBAY
] = {
2500 .type
= HDA_FIXUP_FUNC
,
2501 .v
.func
= alc_fixup_no_depop_delay
,
2505 static const struct snd_pci_quirk alc262_fixup_tbl
[] = {
2506 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", ALC262_FIXUP_HP_Z200
),
2507 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110
),
2508 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ
),
2509 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN
),
2510 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270
),
2511 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000
),
2512 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ
),
2513 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31
),
2514 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY
),
2518 static const struct hda_model_fixup alc262_fixup_models
[] = {
2519 {.id
= ALC262_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2525 static int patch_alc262(struct hda_codec
*codec
)
2527 struct alc_spec
*spec
;
2530 err
= alc_alloc_spec(codec
, 0x0b);
2535 spec
->gen
.shared_mic_vref_pin
= 0x18;
2537 spec
->shutup
= alc_eapd_shutup
;
2540 /* pshou 07/11/05 set a zero PCM sample to DAC when FIFO is
2543 alc_update_coefex_idx(codec
, 0x1a, 7, 0, 0x80);
2545 alc_fix_pll_init(codec
, 0x20, 0x0a, 10);
2547 snd_hda_pick_fixup(codec
, alc262_fixup_models
, alc262_fixup_tbl
,
2549 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2551 alc_auto_parse_customize_define(codec
);
2553 if (has_cdefine_beep(codec
))
2554 spec
->gen
.beep_nid
= 0x01;
2556 /* automatic parse from the BIOS config */
2557 err
= alc262_parse_auto_config(codec
);
2561 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
)
2562 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
2564 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2576 /* bind Beep switches of both NID 0x0f and 0x10 */
2577 static int alc268_beep_switch_put(struct snd_kcontrol
*kcontrol
,
2578 struct snd_ctl_elem_value
*ucontrol
)
2580 struct hda_codec
*codec
= snd_kcontrol_chip(kcontrol
);
2584 mutex_lock(&codec
->control_mutex
);
2585 pval
= kcontrol
->private_value
;
2586 kcontrol
->private_value
= (pval
& ~0xff) | 0x0f;
2587 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2589 kcontrol
->private_value
= (pval
& ~0xff) | 0x10;
2590 err
= snd_hda_mixer_amp_switch_put(kcontrol
, ucontrol
);
2592 kcontrol
->private_value
= pval
;
2593 mutex_unlock(&codec
->control_mutex
);
2597 static const struct snd_kcontrol_new alc268_beep_mixer
[] = {
2598 HDA_CODEC_VOLUME("Beep Playback Volume", 0x1d, 0x0, HDA_INPUT
),
2600 .iface
= SNDRV_CTL_ELEM_IFACE_MIXER
,
2601 .name
= "Beep Playback Switch",
2602 .subdevice
= HDA_SUBDEV_AMP_FLAG
,
2603 .info
= snd_hda_mixer_amp_switch_info
,
2604 .get
= snd_hda_mixer_amp_switch_get
,
2605 .put
= alc268_beep_switch_put
,
2606 .private_value
= HDA_COMPOSE_AMP_VAL(0x0f, 3, 1, HDA_INPUT
)
2611 /* set PCBEEP vol = 0, mute connections */
2612 static const struct hda_verb alc268_beep_init_verbs
[] = {
2613 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_UNMUTE(0)},
2614 {0x0f, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2615 {0x10, AC_VERB_SET_AMP_GAIN_MUTE
, AMP_IN_MUTE(1)},
2620 ALC268_FIXUP_INV_DMIC
,
2621 ALC268_FIXUP_HP_EAPD
,
2625 static const struct hda_fixup alc268_fixups
[] = {
2626 [ALC268_FIXUP_INV_DMIC
] = {
2627 .type
= HDA_FIXUP_FUNC
,
2628 .v
.func
= alc_fixup_inv_dmic
,
2630 [ALC268_FIXUP_HP_EAPD
] = {
2631 .type
= HDA_FIXUP_VERBS
,
2632 .v
.verbs
= (const struct hda_verb
[]) {
2633 {0x15, AC_VERB_SET_EAPD_BTLENABLE
, 0},
2637 [ALC268_FIXUP_SPDIF
] = {
2638 .type
= HDA_FIXUP_PINS
,
2639 .v
.pins
= (const struct hda_pintbl
[]) {
2640 { 0x1e, 0x014b1180 }, /* enable SPDIF out */
2646 static const struct hda_model_fixup alc268_fixup_models
[] = {
2647 {.id
= ALC268_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
2648 {.id
= ALC268_FIXUP_HP_EAPD
, .name
= "hp-eapd"},
2652 static const struct snd_pci_quirk alc268_fixup_tbl
[] = {
2653 SND_PCI_QUIRK(0x1025, 0x0139, "Acer TravelMate 6293", ALC268_FIXUP_SPDIF
),
2654 SND_PCI_QUIRK(0x1025, 0x015b, "Acer AOA 150 (ZG5)", ALC268_FIXUP_INV_DMIC
),
2655 /* below is codec SSID since multiple Toshiba laptops have the
2656 * same PCI SSID 1179:ff00
2658 SND_PCI_QUIRK(0x1179, 0xff06, "Toshiba P200", ALC268_FIXUP_HP_EAPD
),
2663 * BIOS auto configuration
2665 static int alc268_parse_auto_config(struct hda_codec
*codec
)
2667 static const hda_nid_t alc268_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2668 return alc_parse_auto_config(codec
, NULL
, alc268_ssids
);
2673 static int patch_alc268(struct hda_codec
*codec
)
2675 struct alc_spec
*spec
;
2678 /* ALC268 has no aa-loopback mixer */
2679 err
= alc_alloc_spec(codec
, 0);
2684 spec
->gen
.beep_nid
= 0x01;
2686 spec
->shutup
= alc_eapd_shutup
;
2688 snd_hda_pick_fixup(codec
, alc268_fixup_models
, alc268_fixup_tbl
, alc268_fixups
);
2689 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
2691 /* automatic parse from the BIOS config */
2692 err
= alc268_parse_auto_config(codec
);
2696 if (err
> 0 && !spec
->gen
.no_analog
&&
2697 spec
->gen
.autocfg
.speaker_pins
[0] != 0x1d) {
2698 add_mixer(spec
, alc268_beep_mixer
);
2699 snd_hda_add_verbs(codec
, alc268_beep_init_verbs
);
2700 if (!query_amp_caps(codec
, 0x1d, HDA_INPUT
))
2701 /* override the amp caps for beep generator */
2702 snd_hda_override_amp_caps(codec
, 0x1d, HDA_INPUT
,
2703 (0x0c << AC_AMPCAP_OFFSET_SHIFT
) |
2704 (0x0c << AC_AMPCAP_NUM_STEPS_SHIFT
) |
2705 (0x07 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
2706 (0 << AC_AMPCAP_MUTE_SHIFT
));
2709 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
2722 static const struct hda_pcm_stream alc269_44k_pcm_analog_playback
= {
2723 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2726 static const struct hda_pcm_stream alc269_44k_pcm_analog_capture
= {
2727 .rates
= SNDRV_PCM_RATE_44100
, /* fixed rate */
2730 /* different alc269-variants */
2732 ALC269_TYPE_ALC269VA
,
2733 ALC269_TYPE_ALC269VB
,
2734 ALC269_TYPE_ALC269VC
,
2735 ALC269_TYPE_ALC269VD
,
2752 * BIOS auto configuration
2754 static int alc269_parse_auto_config(struct hda_codec
*codec
)
2756 static const hda_nid_t alc269_ignore
[] = { 0x1d, 0 };
2757 static const hda_nid_t alc269_ssids
[] = { 0, 0x1b, 0x14, 0x21 };
2758 static const hda_nid_t alc269va_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
2759 struct alc_spec
*spec
= codec
->spec
;
2760 const hda_nid_t
*ssids
;
2762 switch (spec
->codec_variant
) {
2763 case ALC269_TYPE_ALC269VA
:
2764 case ALC269_TYPE_ALC269VC
:
2765 case ALC269_TYPE_ALC280
:
2766 case ALC269_TYPE_ALC284
:
2767 case ALC269_TYPE_ALC293
:
2768 ssids
= alc269va_ssids
;
2770 case ALC269_TYPE_ALC269VB
:
2771 case ALC269_TYPE_ALC269VD
:
2772 case ALC269_TYPE_ALC282
:
2773 case ALC269_TYPE_ALC283
:
2774 case ALC269_TYPE_ALC286
:
2775 case ALC269_TYPE_ALC298
:
2776 case ALC269_TYPE_ALC255
:
2777 case ALC269_TYPE_ALC256
:
2778 case ALC269_TYPE_ALC215
:
2779 case ALC269_TYPE_ALC225
:
2780 case ALC269_TYPE_ALC294
:
2781 case ALC269_TYPE_ALC700
:
2782 ssids
= alc269_ssids
;
2785 ssids
= alc269_ssids
;
2789 return alc_parse_auto_config(codec
, alc269_ignore
, ssids
);
2792 static int find_ext_mic_pin(struct hda_codec
*codec
);
2794 static void alc286_shutup(struct hda_codec
*codec
)
2797 int mic_pin
= find_ext_mic_pin(codec
);
2798 /* don't shut up pins when unloading the driver; otherwise it breaks
2799 * the default pin setup at the next load of the driver
2801 if (codec
->bus
->shutdown
)
2803 for (i
= 0; i
< codec
->init_pins
.used
; i
++) {
2804 struct hda_pincfg
*pin
= snd_array_elem(&codec
->init_pins
, i
);
2805 /* use read here for syncing after issuing each verb */
2806 if (pin
->nid
!= mic_pin
)
2807 snd_hda_codec_read(codec
, pin
->nid
, 0,
2808 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0);
2810 codec
->pins_shutup
= 1;
2813 static void alc269vb_toggle_power_output(struct hda_codec
*codec
, int power_up
)
2815 alc_update_coef_idx(codec
, 0x04, 1 << 11, power_up
? (1 << 11) : 0);
2818 static void alc269_shutup(struct hda_codec
*codec
)
2820 struct alc_spec
*spec
= codec
->spec
;
2822 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
2823 alc269vb_toggle_power_output(codec
, 0);
2824 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
2825 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
2828 snd_hda_shutup_pins(codec
);
2831 static struct coef_fw alc282_coefs
[] = {
2832 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2833 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2834 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2835 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2836 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2837 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2838 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2839 WRITE_COEF(0x0e, 0x6e00), /* LDO1/2/3, DAC/ADC */
2840 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2841 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2842 WRITE_COEF(0x6f, 0x0), /* Class D test 4 */
2843 UPDATE_COEF(0x0c, 0xfe00, 0), /* IO power down directly */
2844 WRITE_COEF(0x34, 0xa0c0), /* ANC */
2845 UPDATE_COEF(0x16, 0x0008, 0), /* AGC MUX */
2846 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2847 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2848 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2849 WRITE_COEF(0x63, 0x2902), /* PLL */
2850 WRITE_COEF(0x68, 0xa080), /* capless control 2 */
2851 WRITE_COEF(0x69, 0x3400), /* capless control 3 */
2852 WRITE_COEF(0x6a, 0x2f3e), /* capless control 4 */
2853 WRITE_COEF(0x6b, 0x0), /* capless control 5 */
2854 UPDATE_COEF(0x6d, 0x0fff, 0x0900), /* class D test 2 */
2855 WRITE_COEF(0x6e, 0x110a), /* class D test 3 */
2856 UPDATE_COEF(0x70, 0x00f8, 0x00d8), /* class D test 5 */
2857 WRITE_COEF(0x71, 0x0014), /* class D test 6 */
2858 WRITE_COEF(0x72, 0xc2ba), /* classD OCP */
2859 UPDATE_COEF(0x77, 0x0f80, 0), /* classD pure DC test */
2860 WRITE_COEF(0x6c, 0xfc06), /* Class D amp control */
2864 static void alc282_restore_default_value(struct hda_codec
*codec
)
2866 alc_process_coef_fw(codec
, alc282_coefs
);
2869 static void alc282_init(struct hda_codec
*codec
)
2871 struct alc_spec
*spec
= codec
->spec
;
2872 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2876 alc282_restore_default_value(codec
);
2880 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2881 coef78
= alc_read_coef_idx(codec
, 0x78);
2883 /* Index 0x78 Direct Drive HP AMP LPM Control 1 */
2884 /* Headphone capless set to high power mode */
2885 alc_write_coef_idx(codec
, 0x78, 0x9004);
2890 snd_hda_codec_write(codec
, hp_pin
, 0,
2891 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2896 snd_hda_codec_write(codec
, hp_pin
, 0,
2897 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
2902 /* Headphone capless set to normal mode */
2903 alc_write_coef_idx(codec
, 0x78, coef78
);
2906 static void alc282_shutup(struct hda_codec
*codec
)
2908 struct alc_spec
*spec
= codec
->spec
;
2909 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2914 alc269_shutup(codec
);
2918 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
2919 coef78
= alc_read_coef_idx(codec
, 0x78);
2920 alc_write_coef_idx(codec
, 0x78, 0x9004);
2925 snd_hda_codec_write(codec
, hp_pin
, 0,
2926 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
2931 snd_hda_codec_write(codec
, hp_pin
, 0,
2932 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
2937 alc_auto_setup_eapd(codec
, false);
2938 snd_hda_shutup_pins(codec
);
2939 alc_write_coef_idx(codec
, 0x78, coef78
);
2942 static struct coef_fw alc283_coefs
[] = {
2943 WRITE_COEF(0x03, 0x0002), /* Power Down Control */
2944 UPDATE_COEF(0x05, 0xff3f, 0x0700), /* FIFO and filter clock */
2945 WRITE_COEF(0x07, 0x0200), /* DMIC control */
2946 UPDATE_COEF(0x06, 0x00f0, 0), /* Analog clock */
2947 UPDATE_COEF(0x08, 0xfffc, 0x0c2c), /* JD */
2948 WRITE_COEF(0x0a, 0xcccc), /* JD offset1 */
2949 WRITE_COEF(0x0b, 0xcccc), /* JD offset2 */
2950 WRITE_COEF(0x0e, 0x6fc0), /* LDO1/2/3, DAC/ADC */
2951 UPDATE_COEF(0x0f, 0xf800, 0x1000), /* JD */
2952 UPDATE_COEF(0x10, 0xfc00, 0x0c00), /* Capless */
2953 WRITE_COEF(0x3a, 0x0), /* Class D test 4 */
2954 UPDATE_COEF(0x0c, 0xfe00, 0x0), /* IO power down directly */
2955 WRITE_COEF(0x22, 0xa0c0), /* ANC */
2956 UPDATE_COEFEX(0x53, 0x01, 0x000f, 0x0008), /* AGC MUX */
2957 UPDATE_COEF(0x1d, 0x00e0, 0), /* DAC simple content protection */
2958 UPDATE_COEF(0x1f, 0x00e0, 0), /* ADC simple content protection */
2959 WRITE_COEF(0x21, 0x8804), /* DAC ADC Zero Detection */
2960 WRITE_COEF(0x2e, 0x2902), /* PLL */
2961 WRITE_COEF(0x33, 0xa080), /* capless control 2 */
2962 WRITE_COEF(0x34, 0x3400), /* capless control 3 */
2963 WRITE_COEF(0x35, 0x2f3e), /* capless control 4 */
2964 WRITE_COEF(0x36, 0x0), /* capless control 5 */
2965 UPDATE_COEF(0x38, 0x0fff, 0x0900), /* class D test 2 */
2966 WRITE_COEF(0x39, 0x110a), /* class D test 3 */
2967 UPDATE_COEF(0x3b, 0x00f8, 0x00d8), /* class D test 5 */
2968 WRITE_COEF(0x3c, 0x0014), /* class D test 6 */
2969 WRITE_COEF(0x3d, 0xc2ba), /* classD OCP */
2970 UPDATE_COEF(0x42, 0x0f80, 0x0), /* classD pure DC test */
2971 WRITE_COEF(0x49, 0x0), /* test mode */
2972 UPDATE_COEF(0x40, 0xf800, 0x9800), /* Class D DC enable */
2973 UPDATE_COEF(0x42, 0xf000, 0x2000), /* DC offset */
2974 WRITE_COEF(0x37, 0xfc06), /* Class D amp control */
2975 UPDATE_COEF(0x1b, 0x8000, 0), /* HP JD control */
2979 static void alc283_restore_default_value(struct hda_codec
*codec
)
2981 alc_process_coef_fw(codec
, alc283_coefs
);
2984 static void alc283_init(struct hda_codec
*codec
)
2986 struct alc_spec
*spec
= codec
->spec
;
2987 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
2990 if (!spec
->gen
.autocfg
.hp_outs
) {
2991 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
2992 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
2995 alc283_restore_default_value(codec
);
3001 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3003 /* Index 0x43 Direct Drive HP AMP LPM Control 1 */
3004 /* Headphone capless set to high power mode */
3005 alc_write_coef_idx(codec
, 0x43, 0x9004);
3007 snd_hda_codec_write(codec
, hp_pin
, 0,
3008 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3013 snd_hda_codec_write(codec
, hp_pin
, 0,
3014 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3018 /* Index 0x46 Combo jack auto switch control 2 */
3019 /* 3k pull low control for Headset jack. */
3020 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3021 /* Headphone capless set to normal mode */
3022 alc_write_coef_idx(codec
, 0x43, 0x9614);
3025 static void alc283_shutup(struct hda_codec
*codec
)
3027 struct alc_spec
*spec
= codec
->spec
;
3028 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3031 if (!spec
->gen
.autocfg
.hp_outs
) {
3032 if (spec
->gen
.autocfg
.line_out_type
== AC_JACK_HP_OUT
)
3033 hp_pin
= spec
->gen
.autocfg
.line_out_pins
[0];
3037 alc269_shutup(codec
);
3041 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3043 alc_write_coef_idx(codec
, 0x43, 0x9004);
3045 /*depop hp during suspend*/
3046 alc_write_coef_idx(codec
, 0x06, 0x2100);
3048 snd_hda_codec_write(codec
, hp_pin
, 0,
3049 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3054 snd_hda_codec_write(codec
, hp_pin
, 0,
3055 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3057 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12);
3061 alc_auto_setup_eapd(codec
, false);
3062 snd_hda_shutup_pins(codec
);
3063 alc_write_coef_idx(codec
, 0x43, 0x9614);
3066 static void alc256_init(struct hda_codec
*codec
)
3068 struct alc_spec
*spec
= codec
->spec
;
3069 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3077 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3082 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x1); /* Low power */
3084 snd_hda_codec_write(codec
, hp_pin
, 0,
3085 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3090 snd_hda_codec_write(codec
, hp_pin
, 0,
3091 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3096 alc_update_coef_idx(codec
, 0x46, 3 << 12, 0);
3097 alc_update_coefex_idx(codec
, 0x57, 0x04, 0x0007, 0x4); /* Hight power */
3100 static void alc256_shutup(struct hda_codec
*codec
)
3102 struct alc_spec
*spec
= codec
->spec
;
3103 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3107 alc269_shutup(codec
);
3111 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3116 snd_hda_codec_write(codec
, hp_pin
, 0,
3117 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3122 snd_hda_codec_write(codec
, hp_pin
, 0,
3123 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3125 alc_update_coef_idx(codec
, 0x46, 0, 3 << 12); /* 3k pull low control for Headset jack. */
3130 alc_auto_setup_eapd(codec
, false);
3131 snd_hda_shutup_pins(codec
);
3134 static void alc_default_init(struct hda_codec
*codec
)
3136 struct alc_spec
*spec
= codec
->spec
;
3137 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3145 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3150 snd_hda_codec_write(codec
, hp_pin
, 0,
3151 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3156 snd_hda_codec_write(codec
, hp_pin
, 0,
3157 AC_VERB_SET_PIN_WIDGET_CONTROL
, PIN_OUT
);
3163 static void alc_default_shutup(struct hda_codec
*codec
)
3165 struct alc_spec
*spec
= codec
->spec
;
3166 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
3170 alc269_shutup(codec
);
3174 hp_pin_sense
= snd_hda_jack_detect(codec
, hp_pin
);
3179 snd_hda_codec_write(codec
, hp_pin
, 0,
3180 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
3185 snd_hda_codec_write(codec
, hp_pin
, 0,
3186 AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x0);
3191 alc_auto_setup_eapd(codec
, false);
3192 snd_hda_shutup_pins(codec
);
3195 static void alc5505_coef_set(struct hda_codec
*codec
, unsigned int index_reg
,
3198 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3199 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
& 0xffff); /* LSB */
3200 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_PROC_COEF
, val
>> 16); /* MSB */
3203 static int alc5505_coef_get(struct hda_codec
*codec
, unsigned int index_reg
)
3207 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_COEF_INDEX
, index_reg
>> 1);
3208 val
= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3210 val
|= snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_GET_PROC_COEF
, 0)
3215 static void alc5505_dsp_halt(struct hda_codec
*codec
)
3219 alc5505_coef_set(codec
, 0x3000, 0x000c); /* DSP CPU stop */
3220 alc5505_coef_set(codec
, 0x880c, 0x0008); /* DDR enter self refresh */
3221 alc5505_coef_set(codec
, 0x61c0, 0x11110080); /* Clock control for PLL and CPU */
3222 alc5505_coef_set(codec
, 0x6230, 0xfc0d4011); /* Disable Input OP */
3223 alc5505_coef_set(codec
, 0x61b4, 0x040a2b03); /* Stop PLL2 */
3224 alc5505_coef_set(codec
, 0x61b0, 0x00005b17); /* Stop PLL1 */
3225 alc5505_coef_set(codec
, 0x61b8, 0x04133303); /* Stop PLL3 */
3226 val
= alc5505_coef_get(codec
, 0x6220);
3227 alc5505_coef_set(codec
, 0x6220, (val
| 0x3000)); /* switch Ringbuffer clock to DBUS clock */
3230 static void alc5505_dsp_back_from_halt(struct hda_codec
*codec
)
3232 alc5505_coef_set(codec
, 0x61b8, 0x04133302);
3233 alc5505_coef_set(codec
, 0x61b0, 0x00005b16);
3234 alc5505_coef_set(codec
, 0x61b4, 0x040a2b02);
3235 alc5505_coef_set(codec
, 0x6230, 0xf80d4011);
3236 alc5505_coef_set(codec
, 0x6220, 0x2002010f);
3237 alc5505_coef_set(codec
, 0x880c, 0x00000004);
3240 static void alc5505_dsp_init(struct hda_codec
*codec
)
3244 alc5505_dsp_halt(codec
);
3245 alc5505_dsp_back_from_halt(codec
);
3246 alc5505_coef_set(codec
, 0x61b0, 0x5b14); /* PLL1 control */
3247 alc5505_coef_set(codec
, 0x61b0, 0x5b16);
3248 alc5505_coef_set(codec
, 0x61b4, 0x04132b00); /* PLL2 control */
3249 alc5505_coef_set(codec
, 0x61b4, 0x04132b02);
3250 alc5505_coef_set(codec
, 0x61b8, 0x041f3300); /* PLL3 control*/
3251 alc5505_coef_set(codec
, 0x61b8, 0x041f3302);
3252 snd_hda_codec_write(codec
, 0x51, 0, AC_VERB_SET_CODEC_RESET
, 0); /* Function reset */
3253 alc5505_coef_set(codec
, 0x61b8, 0x041b3302);
3254 alc5505_coef_set(codec
, 0x61b8, 0x04173302);
3255 alc5505_coef_set(codec
, 0x61b8, 0x04163302);
3256 alc5505_coef_set(codec
, 0x8800, 0x348b328b); /* DRAM control */
3257 alc5505_coef_set(codec
, 0x8808, 0x00020022); /* DRAM control */
3258 alc5505_coef_set(codec
, 0x8818, 0x00000400); /* DRAM control */
3260 val
= alc5505_coef_get(codec
, 0x6200) >> 16; /* Read revision ID */
3262 alc5505_coef_set(codec
, 0x6220, 0x2002010f); /* I/O PAD Configuration */
3264 alc5505_coef_set(codec
, 0x6220, 0x6002018f);
3266 alc5505_coef_set(codec
, 0x61ac, 0x055525f0); /**/
3267 alc5505_coef_set(codec
, 0x61c0, 0x12230080); /* Clock control */
3268 alc5505_coef_set(codec
, 0x61b4, 0x040e2b02); /* PLL2 control */
3269 alc5505_coef_set(codec
, 0x61bc, 0x010234f8); /* OSC Control */
3270 alc5505_coef_set(codec
, 0x880c, 0x00000004); /* DRAM Function control */
3271 alc5505_coef_set(codec
, 0x880c, 0x00000003);
3272 alc5505_coef_set(codec
, 0x880c, 0x00000010);
3274 #ifdef HALT_REALTEK_ALC5505
3275 alc5505_dsp_halt(codec
);
3279 #ifdef HALT_REALTEK_ALC5505
3280 #define alc5505_dsp_suspend(codec) /* NOP */
3281 #define alc5505_dsp_resume(codec) /* NOP */
3283 #define alc5505_dsp_suspend(codec) alc5505_dsp_halt(codec)
3284 #define alc5505_dsp_resume(codec) alc5505_dsp_back_from_halt(codec)
3288 static int alc269_suspend(struct hda_codec
*codec
)
3290 struct alc_spec
*spec
= codec
->spec
;
3292 if (spec
->has_alc5505_dsp
)
3293 alc5505_dsp_suspend(codec
);
3294 return alc_suspend(codec
);
3297 static int alc269_resume(struct hda_codec
*codec
)
3299 struct alc_spec
*spec
= codec
->spec
;
3301 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3302 alc269vb_toggle_power_output(codec
, 0);
3303 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3304 (alc_get_coef0(codec
) & 0x00ff) == 0x018) {
3308 codec
->patch_ops
.init(codec
);
3310 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
)
3311 alc269vb_toggle_power_output(codec
, 1);
3312 if (spec
->codec_variant
== ALC269_TYPE_ALC269VB
&&
3313 (alc_get_coef0(codec
) & 0x00ff) == 0x017) {
3317 regcache_sync(codec
->core
.regmap
);
3318 hda_call_check_power_status(codec
, 0x01);
3320 /* on some machine, the BIOS will clear the codec gpio data when enter
3321 * suspend, and won't restore the data after resume, so we restore it
3325 snd_hda_codec_write(codec
, codec
->core
.afg
, 0, AC_VERB_SET_GPIO_DATA
,
3328 if (spec
->has_alc5505_dsp
)
3329 alc5505_dsp_resume(codec
);
3333 #endif /* CONFIG_PM */
3335 static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec
*codec
,
3336 const struct hda_fixup
*fix
, int action
)
3338 struct alc_spec
*spec
= codec
->spec
;
3340 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3341 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
3344 static void alc269_fixup_hweq(struct hda_codec
*codec
,
3345 const struct hda_fixup
*fix
, int action
)
3347 if (action
== HDA_FIXUP_ACT_INIT
)
3348 alc_update_coef_idx(codec
, 0x1e, 0, 0x80);
3351 static void alc269_fixup_headset_mic(struct hda_codec
*codec
,
3352 const struct hda_fixup
*fix
, int action
)
3354 struct alc_spec
*spec
= codec
->spec
;
3356 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
3357 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3360 static void alc271_fixup_dmic(struct hda_codec
*codec
,
3361 const struct hda_fixup
*fix
, int action
)
3363 static const struct hda_verb verbs
[] = {
3364 {0x20, AC_VERB_SET_COEF_INDEX
, 0x0d},
3365 {0x20, AC_VERB_SET_PROC_COEF
, 0x4000},
3370 if (strcmp(codec
->core
.chip_name
, "ALC271X") &&
3371 strcmp(codec
->core
.chip_name
, "ALC269VB"))
3373 cfg
= snd_hda_codec_get_pincfg(codec
, 0x12);
3374 if (get_defcfg_connect(cfg
) == AC_JACK_PORT_FIXED
)
3375 snd_hda_sequence_write(codec
, verbs
);
3378 static void alc269_fixup_pcm_44k(struct hda_codec
*codec
,
3379 const struct hda_fixup
*fix
, int action
)
3381 struct alc_spec
*spec
= codec
->spec
;
3383 if (action
!= HDA_FIXUP_ACT_PROBE
)
3386 /* Due to a hardware problem on Lenovo Ideadpad, we need to
3387 * fix the sample rate of analog I/O to 44.1kHz
3389 spec
->gen
.stream_analog_playback
= &alc269_44k_pcm_analog_playback
;
3390 spec
->gen
.stream_analog_capture
= &alc269_44k_pcm_analog_capture
;
3393 static void alc269_fixup_stereo_dmic(struct hda_codec
*codec
,
3394 const struct hda_fixup
*fix
, int action
)
3396 /* The digital-mic unit sends PDM (differential signal) instead of
3397 * the standard PCM, thus you can't record a valid mono stream as is.
3398 * Below is a workaround specific to ALC269 to control the dmic
3399 * signal source as mono.
3401 if (action
== HDA_FIXUP_ACT_INIT
)
3402 alc_update_coef_idx(codec
, 0x07, 0, 0x80);
3405 static void alc269_quanta_automute(struct hda_codec
*codec
)
3407 snd_hda_gen_update_outputs(codec
);
3409 alc_write_coef_idx(codec
, 0x0c, 0x680);
3410 alc_write_coef_idx(codec
, 0x0c, 0x480);
3413 static void alc269_fixup_quanta_mute(struct hda_codec
*codec
,
3414 const struct hda_fixup
*fix
, int action
)
3416 struct alc_spec
*spec
= codec
->spec
;
3417 if (action
!= HDA_FIXUP_ACT_PROBE
)
3419 spec
->gen
.automute_hook
= alc269_quanta_automute
;
3422 static void alc269_x101_hp_automute_hook(struct hda_codec
*codec
,
3423 struct hda_jack_callback
*jack
)
3425 struct alc_spec
*spec
= codec
->spec
;
3428 snd_hda_gen_hp_automute(codec
, jack
);
3430 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
3432 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3435 snd_hda_codec_write(codec
, 0x18, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
3439 static void alc269_fixup_x101_headset_mic(struct hda_codec
*codec
,
3440 const struct hda_fixup
*fix
, int action
)
3442 struct alc_spec
*spec
= codec
->spec
;
3443 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3444 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
3445 spec
->gen
.hp_automute_hook
= alc269_x101_hp_automute_hook
;
3450 /* update mute-LED according to the speaker mute state via mic VREF pin */
3451 static void alc269_fixup_mic_mute_hook(void *private_data
, int enabled
)
3453 struct hda_codec
*codec
= private_data
;
3454 struct alc_spec
*spec
= codec
->spec
;
3455 unsigned int pinval
;
3457 if (spec
->mute_led_polarity
)
3459 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->mute_led_nid
);
3460 pinval
&= ~AC_PINCTL_VREFEN
;
3461 pinval
|= enabled
? AC_PINCTL_VREF_HIZ
: AC_PINCTL_VREF_80
;
3462 if (spec
->mute_led_nid
)
3463 snd_hda_set_pin_ctl_cache(codec
, spec
->mute_led_nid
, pinval
);
3466 /* Make sure the led works even in runtime suspend */
3467 static unsigned int led_power_filter(struct hda_codec
*codec
,
3469 unsigned int power_state
)
3471 struct alc_spec
*spec
= codec
->spec
;
3473 if (power_state
!= AC_PWRST_D3
|| nid
== 0 ||
3474 (nid
!= spec
->mute_led_nid
&& nid
!= spec
->cap_mute_led_nid
))
3477 /* Set pin ctl again, it might have just been set to 0 */
3478 snd_hda_set_pin_ctl(codec
, nid
,
3479 snd_hda_codec_get_pin_target(codec
, nid
));
3481 return snd_hda_gen_path_power_filter(codec
, nid
, power_state
);
3484 static void alc269_fixup_hp_mute_led(struct hda_codec
*codec
,
3485 const struct hda_fixup
*fix
, int action
)
3487 struct alc_spec
*spec
= codec
->spec
;
3488 const struct dmi_device
*dev
= NULL
;
3490 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
3493 while ((dev
= dmi_find_device(DMI_DEV_TYPE_OEM_STRING
, NULL
, dev
))) {
3495 if (sscanf(dev
->name
, "HP_Mute_LED_%d_%x", &pol
, &pin
) != 2)
3497 if (pin
< 0x0a || pin
>= 0x10)
3499 spec
->mute_led_polarity
= pol
;
3500 spec
->mute_led_nid
= pin
- 0x0a + 0x18;
3501 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3502 spec
->gen
.vmaster_mute_enum
= 1;
3503 codec
->power_filter
= led_power_filter
;
3505 "Detected mute LED for %x:%d\n", spec
->mute_led_nid
,
3506 spec
->mute_led_polarity
);
3511 static void alc269_fixup_hp_mute_led_mic1(struct hda_codec
*codec
,
3512 const struct hda_fixup
*fix
, int action
)
3514 struct alc_spec
*spec
= codec
->spec
;
3515 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3516 spec
->mute_led_polarity
= 0;
3517 spec
->mute_led_nid
= 0x18;
3518 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3519 spec
->gen
.vmaster_mute_enum
= 1;
3520 codec
->power_filter
= led_power_filter
;
3524 static void alc269_fixup_hp_mute_led_mic2(struct hda_codec
*codec
,
3525 const struct hda_fixup
*fix
, int action
)
3527 struct alc_spec
*spec
= codec
->spec
;
3528 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3529 spec
->mute_led_polarity
= 0;
3530 spec
->mute_led_nid
= 0x19;
3531 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3532 spec
->gen
.vmaster_mute_enum
= 1;
3533 codec
->power_filter
= led_power_filter
;
3537 /* update LED status via GPIO */
3538 static void alc_update_gpio_led(struct hda_codec
*codec
, unsigned int mask
,
3541 struct alc_spec
*spec
= codec
->spec
;
3542 unsigned int oldval
= spec
->gpio_led
;
3544 if (spec
->mute_led_polarity
)
3548 spec
->gpio_led
&= ~mask
;
3550 spec
->gpio_led
|= mask
;
3551 if (spec
->gpio_led
!= oldval
)
3552 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
3556 /* turn on/off mute LED via GPIO per vmaster hook */
3557 static void alc_fixup_gpio_mute_hook(void *private_data
, int enabled
)
3559 struct hda_codec
*codec
= private_data
;
3560 struct alc_spec
*spec
= codec
->spec
;
3562 alc_update_gpio_led(codec
, spec
->gpio_mute_led_mask
, enabled
);
3565 /* turn on/off mic-mute LED via GPIO per capture hook */
3566 static void alc_fixup_gpio_mic_mute_hook(struct hda_codec
*codec
,
3567 struct snd_kcontrol
*kcontrol
,
3568 struct snd_ctl_elem_value
*ucontrol
)
3570 struct alc_spec
*spec
= codec
->spec
;
3573 alc_update_gpio_led(codec
, spec
->gpio_mic_led_mask
,
3574 ucontrol
->value
.integer
.value
[0] ||
3575 ucontrol
->value
.integer
.value
[1]);
3578 static void alc269_fixup_hp_gpio_led(struct hda_codec
*codec
,
3579 const struct hda_fixup
*fix
, int action
)
3581 struct alc_spec
*spec
= codec
->spec
;
3582 static const struct hda_verb gpio_init
[] = {
3583 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3584 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3588 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3589 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3590 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3592 spec
->mute_led_polarity
= 0;
3593 spec
->gpio_mute_led_mask
= 0x08;
3594 spec
->gpio_mic_led_mask
= 0x10;
3595 snd_hda_add_verbs(codec
, gpio_init
);
3599 static void alc286_fixup_hp_gpio_led(struct hda_codec
*codec
,
3600 const struct hda_fixup
*fix
, int action
)
3602 struct alc_spec
*spec
= codec
->spec
;
3603 static const struct hda_verb gpio_init
[] = {
3604 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x22 },
3605 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x22 },
3609 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3610 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3611 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3613 spec
->mute_led_polarity
= 0;
3614 spec
->gpio_mute_led_mask
= 0x02;
3615 spec
->gpio_mic_led_mask
= 0x20;
3616 snd_hda_add_verbs(codec
, gpio_init
);
3620 /* turn on/off mic-mute LED per capture hook */
3621 static void alc269_fixup_hp_cap_mic_mute_hook(struct hda_codec
*codec
,
3622 struct snd_kcontrol
*kcontrol
,
3623 struct snd_ctl_elem_value
*ucontrol
)
3625 struct alc_spec
*spec
= codec
->spec
;
3626 unsigned int pinval
, enable
, disable
;
3628 pinval
= snd_hda_codec_get_pin_target(codec
, spec
->cap_mute_led_nid
);
3629 pinval
&= ~AC_PINCTL_VREFEN
;
3630 enable
= pinval
| AC_PINCTL_VREF_80
;
3631 disable
= pinval
| AC_PINCTL_VREF_HIZ
;
3636 if (ucontrol
->value
.integer
.value
[0] ||
3637 ucontrol
->value
.integer
.value
[1])
3642 if (spec
->cap_mute_led_nid
)
3643 snd_hda_set_pin_ctl_cache(codec
, spec
->cap_mute_led_nid
, pinval
);
3646 static void alc269_fixup_hp_gpio_mic1_led(struct hda_codec
*codec
,
3647 const struct hda_fixup
*fix
, int action
)
3649 struct alc_spec
*spec
= codec
->spec
;
3650 static const struct hda_verb gpio_init
[] = {
3651 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x08 },
3652 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x08 },
3656 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3657 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3658 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3660 spec
->mute_led_polarity
= 0;
3661 spec
->gpio_mute_led_mask
= 0x08;
3662 spec
->cap_mute_led_nid
= 0x18;
3663 snd_hda_add_verbs(codec
, gpio_init
);
3664 codec
->power_filter
= led_power_filter
;
3668 static void alc280_fixup_hp_gpio4(struct hda_codec
*codec
,
3669 const struct hda_fixup
*fix
, int action
)
3671 /* Like hp_gpio_mic1_led, but also needs GPIO4 low to enable headphone amp */
3672 struct alc_spec
*spec
= codec
->spec
;
3673 static const struct hda_verb gpio_init
[] = {
3674 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
3675 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
3679 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3680 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3681 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3683 spec
->mute_led_polarity
= 0;
3684 spec
->gpio_mute_led_mask
= 0x08;
3685 spec
->cap_mute_led_nid
= 0x18;
3686 snd_hda_add_verbs(codec
, gpio_init
);
3687 codec
->power_filter
= led_power_filter
;
3691 static void gpio2_mic_hotkey_event(struct hda_codec
*codec
,
3692 struct hda_jack_callback
*event
)
3694 struct alc_spec
*spec
= codec
->spec
;
3696 /* GPIO2 just toggles on a keypress/keyrelease cycle. Therefore
3697 send both key on and key off event for every interrupt. */
3698 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 1);
3699 input_sync(spec
->kb_dev
);
3700 input_report_key(spec
->kb_dev
, spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
], 0);
3701 input_sync(spec
->kb_dev
);
3704 static int alc_register_micmute_input_device(struct hda_codec
*codec
)
3706 struct alc_spec
*spec
= codec
->spec
;
3709 spec
->kb_dev
= input_allocate_device();
3710 if (!spec
->kb_dev
) {
3711 codec_err(codec
, "Out of memory (input_allocate_device)\n");
3715 spec
->alc_mute_keycode_map
[ALC_KEY_MICMUTE_INDEX
] = KEY_MICMUTE
;
3717 spec
->kb_dev
->name
= "Microphone Mute Button";
3718 spec
->kb_dev
->evbit
[0] = BIT_MASK(EV_KEY
);
3719 spec
->kb_dev
->keycodesize
= sizeof(spec
->alc_mute_keycode_map
[0]);
3720 spec
->kb_dev
->keycodemax
= ARRAY_SIZE(spec
->alc_mute_keycode_map
);
3721 spec
->kb_dev
->keycode
= spec
->alc_mute_keycode_map
;
3722 for (i
= 0; i
< ARRAY_SIZE(spec
->alc_mute_keycode_map
); i
++)
3723 set_bit(spec
->alc_mute_keycode_map
[i
], spec
->kb_dev
->keybit
);
3725 if (input_register_device(spec
->kb_dev
)) {
3726 codec_err(codec
, "input_register_device failed\n");
3727 input_free_device(spec
->kb_dev
);
3728 spec
->kb_dev
= NULL
;
3735 static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec
*codec
,
3736 const struct hda_fixup
*fix
, int action
)
3738 /* GPIO1 = set according to SKU external amp
3739 GPIO2 = mic mute hotkey
3741 GPIO4 = mic mute LED */
3742 static const struct hda_verb gpio_init
[] = {
3743 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x1e },
3744 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x1a },
3745 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x02 },
3749 struct alc_spec
*spec
= codec
->spec
;
3751 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3752 if (alc_register_micmute_input_device(codec
) != 0)
3755 snd_hda_add_verbs(codec
, gpio_init
);
3756 snd_hda_codec_write_cache(codec
, codec
->core
.afg
, 0,
3757 AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK
, 0x04);
3758 snd_hda_jack_detect_enable_callback(codec
, codec
->core
.afg
,
3759 gpio2_mic_hotkey_event
);
3761 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
3762 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3764 spec
->mute_led_polarity
= 0;
3765 spec
->gpio_mute_led_mask
= 0x08;
3766 spec
->gpio_mic_led_mask
= 0x10;
3774 case HDA_FIXUP_ACT_PROBE
:
3775 spec
->init_amp
= ALC_INIT_DEFAULT
;
3777 case HDA_FIXUP_ACT_FREE
:
3778 input_unregister_device(spec
->kb_dev
);
3779 spec
->kb_dev
= NULL
;
3783 static void alc233_fixup_lenovo_line2_mic_hotkey(struct hda_codec
*codec
,
3784 const struct hda_fixup
*fix
, int action
)
3786 /* Line2 = mic mute hotkey
3787 GPIO2 = mic mute LED */
3788 static const struct hda_verb gpio_init
[] = {
3789 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
3790 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
3794 struct alc_spec
*spec
= codec
->spec
;
3796 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3797 if (alc_register_micmute_input_device(codec
) != 0)
3800 snd_hda_add_verbs(codec
, gpio_init
);
3801 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
3802 gpio2_mic_hotkey_event
);
3804 spec
->gen
.cap_sync_hook
= alc_fixup_gpio_mic_mute_hook
;
3806 spec
->mute_led_polarity
= 0;
3807 spec
->gpio_mic_led_mask
= 0x04;
3815 case HDA_FIXUP_ACT_PROBE
:
3816 spec
->init_amp
= ALC_INIT_DEFAULT
;
3818 case HDA_FIXUP_ACT_FREE
:
3819 input_unregister_device(spec
->kb_dev
);
3820 spec
->kb_dev
= NULL
;
3824 static void alc269_fixup_hp_line1_mic1_led(struct hda_codec
*codec
,
3825 const struct hda_fixup
*fix
, int action
)
3827 struct alc_spec
*spec
= codec
->spec
;
3829 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
3830 spec
->gen
.vmaster_mute
.hook
= alc269_fixup_mic_mute_hook
;
3831 spec
->gen
.cap_sync_hook
= alc269_fixup_hp_cap_mic_mute_hook
;
3832 spec
->mute_led_polarity
= 0;
3833 spec
->mute_led_nid
= 0x1a;
3834 spec
->cap_mute_led_nid
= 0x18;
3835 spec
->gen
.vmaster_mute_enum
= 1;
3836 codec
->power_filter
= led_power_filter
;
3840 static void alc_headset_mode_unplugged(struct hda_codec
*codec
)
3842 static struct coef_fw coef0255
[] = {
3843 WRITE_COEF(0x45, 0xd089), /* UAJ function set to menual mode */
3844 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), /* Direct Drive HP Amp control(Set to verb control)*/
3845 WRITE_COEF(0x06, 0x6104), /* Set MIC2 Vref gate with HP */
3846 WRITE_COEFEX(0x57, 0x03, 0x8aa6), /* Direct Drive HP Amp control */
3849 static struct coef_fw coef0255_1
[] = {
3850 WRITE_COEF(0x1b, 0x0c0b), /* LDO and MISC control */
3853 static struct coef_fw coef0256
[] = {
3854 WRITE_COEF(0x1b, 0x0c4b), /* LDO and MISC control */
3857 static struct coef_fw coef0233
[] = {
3858 WRITE_COEF(0x1b, 0x0c0b),
3859 WRITE_COEF(0x45, 0xc429),
3860 UPDATE_COEF(0x35, 0x4000, 0),
3861 WRITE_COEF(0x06, 0x2104),
3862 WRITE_COEF(0x1a, 0x0001),
3863 WRITE_COEF(0x26, 0x0004),
3864 WRITE_COEF(0x32, 0x42a3),
3867 static struct coef_fw coef0288
[] = {
3868 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
3869 UPDATE_COEF(0x50, 0x2000, 0x2000),
3870 UPDATE_COEF(0x56, 0x0006, 0x0006),
3871 UPDATE_COEF(0x66, 0x0008, 0),
3872 UPDATE_COEF(0x67, 0x2000, 0),
3875 static struct coef_fw coef0292
[] = {
3876 WRITE_COEF(0x76, 0x000e),
3877 WRITE_COEF(0x6c, 0x2400),
3878 WRITE_COEF(0x18, 0x7308),
3879 WRITE_COEF(0x6b, 0xc429),
3882 static struct coef_fw coef0293
[] = {
3883 UPDATE_COEF(0x10, 7<<8, 6<<8), /* SET Line1 JD to 0 */
3884 UPDATE_COEFEX(0x57, 0x05, 1<<15|1<<13, 0x0), /* SET charge pump by verb */
3885 UPDATE_COEFEX(0x57, 0x03, 1<<10, 1<<10), /* SET EN_OSW to 1 */
3886 UPDATE_COEF(0x1a, 1<<3, 1<<3), /* Combo JD gating with LINE1-VREFO */
3887 WRITE_COEF(0x45, 0xc429), /* Set to TRS type */
3888 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
3891 static struct coef_fw coef0668
[] = {
3892 WRITE_COEF(0x15, 0x0d40),
3893 WRITE_COEF(0xb7, 0x802b),
3896 static struct coef_fw coef0225
[] = {
3897 UPDATE_COEF(0x4a, 1<<8, 0),
3898 UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
3899 UPDATE_COEF(0x63, 3<<14, 3<<14),
3900 UPDATE_COEF(0x4a, 3<<4, 2<<4),
3901 UPDATE_COEF(0x4a, 3<<10, 3<<10),
3902 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
3903 UPDATE_COEF(0x4a, 3<<10, 0),
3906 static struct coef_fw coef0274
[] = {
3907 UPDATE_COEF(0x4a, 0x0100, 0),
3908 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0),
3909 UPDATE_COEF(0x6b, 0xf000, 0x5000),
3910 UPDATE_COEF(0x4a, 0x0010, 0),
3911 UPDATE_COEF(0x4a, 0x0c00, 0x0c00),
3912 WRITE_COEF(0x45, 0x5289),
3913 UPDATE_COEF(0x4a, 0x0c00, 0),
3917 switch (codec
->core
.vendor_id
) {
3919 alc_process_coef_fw(codec
, coef0255_1
);
3920 alc_process_coef_fw(codec
, coef0255
);
3923 alc_process_coef_fw(codec
, coef0256
);
3924 alc_process_coef_fw(codec
, coef0255
);
3929 alc_process_coef_fw(codec
, coef0274
);
3933 alc_process_coef_fw(codec
, coef0233
);
3938 alc_process_coef_fw(codec
, coef0288
);
3941 alc_process_coef_fw(codec
, coef0292
);
3944 alc_process_coef_fw(codec
, coef0293
);
3947 alc_process_coef_fw(codec
, coef0668
);
3952 alc_process_coef_fw(codec
, coef0225
);
3955 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
3958 codec_dbg(codec
, "Headset jack set to unplugged mode.\n");
3962 static void alc_headset_mode_mic_in(struct hda_codec
*codec
, hda_nid_t hp_pin
,
3965 static struct coef_fw coef0255
[] = {
3966 WRITE_COEFEX(0x57, 0x03, 0x8aa6),
3967 WRITE_COEF(0x06, 0x6100), /* Set MIC2 Vref gate to normal */
3970 static struct coef_fw coef0233
[] = {
3971 UPDATE_COEF(0x35, 0, 1<<14),
3972 WRITE_COEF(0x06, 0x2100),
3973 WRITE_COEF(0x1a, 0x0021),
3974 WRITE_COEF(0x26, 0x008c),
3977 static struct coef_fw coef0288
[] = {
3978 UPDATE_COEF(0x50, 0x2000, 0),
3979 UPDATE_COEF(0x56, 0x0006, 0),
3980 UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
3981 UPDATE_COEF(0x66, 0x0008, 0x0008),
3982 UPDATE_COEF(0x67, 0x2000, 0x2000),
3985 static struct coef_fw coef0292
[] = {
3986 WRITE_COEF(0x19, 0xa208),
3987 WRITE_COEF(0x2e, 0xacf0),
3990 static struct coef_fw coef0293
[] = {
3991 UPDATE_COEFEX(0x57, 0x05, 0, 1<<15|1<<13), /* SET charge pump by verb */
3992 UPDATE_COEFEX(0x57, 0x03, 1<<10, 0), /* SET EN_OSW to 0 */
3993 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
3996 static struct coef_fw coef0688
[] = {
3997 WRITE_COEF(0xb7, 0x802b),
3998 WRITE_COEF(0xb5, 0x1040),
3999 UPDATE_COEF(0xc3, 0, 1<<12),
4002 static struct coef_fw coef0225
[] = {
4003 UPDATE_COEFEX(0x57, 0x05, 1<<14, 1<<14),
4004 UPDATE_COEF(0x4a, 3<<4, 2<<4),
4005 UPDATE_COEF(0x63, 3<<14, 0),
4008 static struct coef_fw coef0274
[] = {
4009 UPDATE_COEFEX(0x57, 0x05, 0x4000, 0x4000),
4010 UPDATE_COEF(0x4a, 0x0010, 0),
4011 UPDATE_COEF(0x6b, 0xf000, 0),
4015 switch (codec
->core
.vendor_id
) {
4018 alc_write_coef_idx(codec
, 0x45, 0xc489);
4019 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4020 alc_process_coef_fw(codec
, coef0255
);
4021 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4026 alc_write_coef_idx(codec
, 0x45, 0x4689);
4027 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4028 alc_process_coef_fw(codec
, coef0274
);
4029 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4033 alc_write_coef_idx(codec
, 0x45, 0xc429);
4034 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4035 alc_process_coef_fw(codec
, coef0233
);
4036 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4041 alc_update_coef_idx(codec
, 0x4f, 0x000c, 0);
4042 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4043 alc_process_coef_fw(codec
, coef0288
);
4044 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4047 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4048 alc_process_coef_fw(codec
, coef0292
);
4051 /* Set to TRS mode */
4052 alc_write_coef_idx(codec
, 0x45, 0xc429);
4053 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4054 alc_process_coef_fw(codec
, coef0293
);
4055 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4058 alc_update_coefex_idx(codec
, 0x57, 0x5, 0, 1<<14);
4062 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4063 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4066 alc_write_coef_idx(codec
, 0x11, 0x0001);
4067 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4068 alc_process_coef_fw(codec
, coef0688
);
4069 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4074 alc_update_coef_idx(codec
, 0x45, 0x3f<<10, 0x31<<10);
4075 snd_hda_set_pin_ctl_cache(codec
, hp_pin
, 0);
4076 alc_process_coef_fw(codec
, coef0225
);
4077 snd_hda_set_pin_ctl_cache(codec
, mic_pin
, PIN_VREF50
);
4080 codec_dbg(codec
, "Headset jack set to mic-in mode.\n");
4083 static void alc_headset_mode_default(struct hda_codec
*codec
)
4085 static struct coef_fw coef0225
[] = {
4086 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4089 static struct coef_fw coef0255
[] = {
4090 WRITE_COEF(0x45, 0xc089),
4091 WRITE_COEF(0x45, 0xc489),
4092 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4093 WRITE_COEF(0x49, 0x0049),
4096 static struct coef_fw coef0233
[] = {
4097 WRITE_COEF(0x06, 0x2100),
4098 WRITE_COEF(0x32, 0x4ea3),
4101 static struct coef_fw coef0288
[] = {
4102 UPDATE_COEF(0x4f, 0xfcc0, 0xc400), /* Set to TRS type */
4103 UPDATE_COEF(0x50, 0x2000, 0x2000),
4104 UPDATE_COEF(0x56, 0x0006, 0x0006),
4105 UPDATE_COEF(0x66, 0x0008, 0),
4106 UPDATE_COEF(0x67, 0x2000, 0),
4109 static struct coef_fw coef0292
[] = {
4110 WRITE_COEF(0x76, 0x000e),
4111 WRITE_COEF(0x6c, 0x2400),
4112 WRITE_COEF(0x6b, 0xc429),
4113 WRITE_COEF(0x18, 0x7308),
4116 static struct coef_fw coef0293
[] = {
4117 UPDATE_COEF(0x4a, 0x000f, 0x000e), /* Combo Jack auto detect */
4118 WRITE_COEF(0x45, 0xC429), /* Set to TRS type */
4119 UPDATE_COEF(0x1a, 1<<3, 0), /* Combo JD gating without LINE1-VREFO */
4122 static struct coef_fw coef0688
[] = {
4123 WRITE_COEF(0x11, 0x0041),
4124 WRITE_COEF(0x15, 0x0d40),
4125 WRITE_COEF(0xb7, 0x802b),
4128 static struct coef_fw coef0274
[] = {
4129 WRITE_COEF(0x45, 0x4289),
4130 UPDATE_COEF(0x4a, 0x0010, 0x0010),
4131 UPDATE_COEF(0x6b, 0x0f00, 0),
4132 UPDATE_COEF(0x49, 0x0300, 0x0300),
4136 switch (codec
->core
.vendor_id
) {
4140 alc_process_coef_fw(codec
, coef0225
);
4144 alc_process_coef_fw(codec
, coef0255
);
4149 alc_process_coef_fw(codec
, coef0274
);
4153 alc_process_coef_fw(codec
, coef0233
);
4158 alc_process_coef_fw(codec
, coef0288
);
4161 alc_process_coef_fw(codec
, coef0292
);
4164 alc_process_coef_fw(codec
, coef0293
);
4167 alc_process_coef_fw(codec
, coef0688
);
4170 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4173 codec_dbg(codec
, "Headset jack set to headphone (default) mode.\n");
4177 static void alc_headset_mode_ctia(struct hda_codec
*codec
)
4179 static struct coef_fw coef0255
[] = {
4180 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4181 WRITE_COEF(0x1b, 0x0c2b),
4182 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4185 static struct coef_fw coef0256
[] = {
4186 WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
4187 WRITE_COEF(0x1b, 0x0c6b),
4188 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4191 static struct coef_fw coef0233
[] = {
4192 WRITE_COEF(0x45, 0xd429),
4193 WRITE_COEF(0x1b, 0x0c2b),
4194 WRITE_COEF(0x32, 0x4ea3),
4197 static struct coef_fw coef0288
[] = {
4198 UPDATE_COEF(0x50, 0x2000, 0x2000),
4199 UPDATE_COEF(0x56, 0x0006, 0x0006),
4200 UPDATE_COEF(0x66, 0x0008, 0),
4201 UPDATE_COEF(0x67, 0x2000, 0),
4204 static struct coef_fw coef0292
[] = {
4205 WRITE_COEF(0x6b, 0xd429),
4206 WRITE_COEF(0x76, 0x0008),
4207 WRITE_COEF(0x18, 0x7388),
4210 static struct coef_fw coef0293
[] = {
4211 WRITE_COEF(0x45, 0xd429), /* Set to ctia type */
4212 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4215 static struct coef_fw coef0688
[] = {
4216 WRITE_COEF(0x11, 0x0001),
4217 WRITE_COEF(0x15, 0x0d60),
4218 WRITE_COEF(0xc3, 0x0000),
4221 static struct coef_fw coef0225
[] = {
4222 UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
4223 UPDATE_COEF(0x49, 1<<8, 1<<8),
4224 UPDATE_COEF(0x4a, 7<<6, 7<<6),
4225 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4229 switch (codec
->core
.vendor_id
) {
4231 alc_process_coef_fw(codec
, coef0255
);
4234 alc_process_coef_fw(codec
, coef0256
);
4239 alc_write_coef_idx(codec
, 0x45, 0xd689);
4243 alc_process_coef_fw(codec
, coef0233
);
4246 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020);/* Headset output enable */
4247 /* ALC298 jack type setting is the same with ALC286/ALC288 */
4250 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xd400);
4252 alc_process_coef_fw(codec
, coef0288
);
4255 alc_process_coef_fw(codec
, coef0292
);
4258 alc_process_coef_fw(codec
, coef0293
);
4261 alc_process_coef_fw(codec
, coef0688
);
4266 alc_process_coef_fw(codec
, coef0225
);
4269 alc_update_coefex_idx(codec
, 0x57, 0x5, 1<<14, 0);
4272 codec_dbg(codec
, "Headset jack set to iPhone-style headset mode.\n");
4276 static void alc_headset_mode_omtp(struct hda_codec
*codec
)
4278 static struct coef_fw coef0255
[] = {
4279 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4280 WRITE_COEF(0x1b, 0x0c2b),
4281 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4284 static struct coef_fw coef0256
[] = {
4285 WRITE_COEF(0x45, 0xe489), /* Set to OMTP Type */
4286 WRITE_COEF(0x1b, 0x0c6b),
4287 WRITE_COEFEX(0x57, 0x03, 0x8ea6),
4290 static struct coef_fw coef0233
[] = {
4291 WRITE_COEF(0x45, 0xe429),
4292 WRITE_COEF(0x1b, 0x0c2b),
4293 WRITE_COEF(0x32, 0x4ea3),
4296 static struct coef_fw coef0288
[] = {
4297 UPDATE_COEF(0x50, 0x2000, 0x2000),
4298 UPDATE_COEF(0x56, 0x0006, 0x0006),
4299 UPDATE_COEF(0x66, 0x0008, 0),
4300 UPDATE_COEF(0x67, 0x2000, 0),
4303 static struct coef_fw coef0292
[] = {
4304 WRITE_COEF(0x6b, 0xe429),
4305 WRITE_COEF(0x76, 0x0008),
4306 WRITE_COEF(0x18, 0x7388),
4309 static struct coef_fw coef0293
[] = {
4310 WRITE_COEF(0x45, 0xe429), /* Set to omtp type */
4311 UPDATE_COEF(0x10, 7<<8, 7<<8), /* SET Line1 JD to 1 */
4314 static struct coef_fw coef0688
[] = {
4315 WRITE_COEF(0x11, 0x0001),
4316 WRITE_COEF(0x15, 0x0d50),
4317 WRITE_COEF(0xc3, 0x0000),
4320 static struct coef_fw coef0225
[] = {
4321 UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
4322 UPDATE_COEF(0x49, 1<<8, 1<<8),
4323 UPDATE_COEF(0x4a, 7<<6, 7<<6),
4324 UPDATE_COEF(0x4a, 3<<4, 3<<4),
4328 switch (codec
->core
.vendor_id
) {
4330 alc_process_coef_fw(codec
, coef0255
);
4333 alc_process_coef_fw(codec
, coef0256
);
4338 alc_write_coef_idx(codec
, 0x45, 0xe689);
4342 alc_process_coef_fw(codec
, coef0233
);
4345 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0010);/* Headset output enable */
4346 /* ALC298 jack type setting is the same with ALC286/ALC288 */
4349 alc_update_coef_idx(codec
, 0x4f, 0xfcc0, 0xe400);
4351 alc_process_coef_fw(codec
, coef0288
);
4354 alc_process_coef_fw(codec
, coef0292
);
4357 alc_process_coef_fw(codec
, coef0293
);
4360 alc_process_coef_fw(codec
, coef0688
);
4365 alc_process_coef_fw(codec
, coef0225
);
4368 codec_dbg(codec
, "Headset jack set to Nokia-style headset mode.\n");
4371 static void alc_determine_headset_type(struct hda_codec
*codec
)
4374 bool is_ctia
= false;
4375 struct alc_spec
*spec
= codec
->spec
;
4376 static struct coef_fw coef0255
[] = {
4377 WRITE_COEF(0x45, 0xd089), /* combo jack auto switch control(Check type)*/
4378 WRITE_COEF(0x49, 0x0149), /* combo jack auto switch control(Vref
4382 static struct coef_fw coef0288
[] = {
4383 UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
4386 static struct coef_fw coef0293
[] = {
4387 UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
4388 WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
4391 static struct coef_fw coef0688
[] = {
4392 WRITE_COEF(0x11, 0x0001),
4393 WRITE_COEF(0xb7, 0x802b),
4394 WRITE_COEF(0x15, 0x0d60),
4395 WRITE_COEF(0xc3, 0x0c00),
4398 static struct coef_fw coef0225
[] = {
4399 UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
4400 UPDATE_COEF(0x49, 1<<8, 1<<8),
4403 static struct coef_fw coef0274
[] = {
4404 UPDATE_COEF(0x4a, 0x0010, 0),
4405 UPDATE_COEF(0x4a, 0x8000, 0),
4406 WRITE_COEF(0x45, 0xd289),
4407 UPDATE_COEF(0x49, 0x0300, 0x0300),
4411 switch (codec
->core
.vendor_id
) {
4414 alc_process_coef_fw(codec
, coef0255
);
4416 val
= alc_read_coef_idx(codec
, 0x46);
4417 is_ctia
= (val
& 0x0070) == 0x0070;
4422 alc_process_coef_fw(codec
, coef0274
);
4424 val
= alc_read_coef_idx(codec
, 0x46);
4425 is_ctia
= (val
& 0x00f0) == 0x00f0;
4429 alc_write_coef_idx(codec
, 0x45, 0xd029);
4431 val
= alc_read_coef_idx(codec
, 0x46);
4432 is_ctia
= (val
& 0x0070) == 0x0070;
4435 alc_update_coef_idx(codec
, 0x8e, 0x0070, 0x0020); /* Headset output enable */
4436 /* ALC298 check jack type is the same with ALC286/ALC288 */
4439 alc_process_coef_fw(codec
, coef0288
);
4441 val
= alc_read_coef_idx(codec
, 0x50);
4442 is_ctia
= (val
& 0x0070) == 0x0070;
4445 alc_write_coef_idx(codec
, 0x6b, 0xd429);
4447 val
= alc_read_coef_idx(codec
, 0x6c);
4448 is_ctia
= (val
& 0x001c) == 0x001c;
4451 alc_process_coef_fw(codec
, coef0293
);
4453 val
= alc_read_coef_idx(codec
, 0x46);
4454 is_ctia
= (val
& 0x0070) == 0x0070;
4457 alc_process_coef_fw(codec
, coef0688
);
4459 val
= alc_read_coef_idx(codec
, 0xbe);
4460 is_ctia
= (val
& 0x1c02) == 0x1c02;
4465 alc_process_coef_fw(codec
, coef0225
);
4467 val
= alc_read_coef_idx(codec
, 0x46);
4468 is_ctia
= (val
& 0x00f0) == 0x00f0;
4475 codec_dbg(codec
, "Headset jack detected iPhone-style headset: %s\n",
4476 is_ctia
? "yes" : "no");
4477 spec
->current_headset_type
= is_ctia
? ALC_HEADSET_TYPE_CTIA
: ALC_HEADSET_TYPE_OMTP
;
4480 static void alc_update_headset_mode(struct hda_codec
*codec
)
4482 struct alc_spec
*spec
= codec
->spec
;
4484 hda_nid_t mux_pin
= spec
->gen
.imux_pins
[spec
->gen
.cur_mux
[0]];
4485 hda_nid_t hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4487 int new_headset_mode
;
4489 if (!snd_hda_jack_detect(codec
, hp_pin
))
4490 new_headset_mode
= ALC_HEADSET_MODE_UNPLUGGED
;
4491 else if (mux_pin
== spec
->headset_mic_pin
)
4492 new_headset_mode
= ALC_HEADSET_MODE_HEADSET
;
4493 else if (mux_pin
== spec
->headphone_mic_pin
)
4494 new_headset_mode
= ALC_HEADSET_MODE_MIC
;
4496 new_headset_mode
= ALC_HEADSET_MODE_HEADPHONE
;
4498 if (new_headset_mode
== spec
->current_headset_mode
) {
4499 snd_hda_gen_update_outputs(codec
);
4503 switch (new_headset_mode
) {
4504 case ALC_HEADSET_MODE_UNPLUGGED
:
4505 alc_headset_mode_unplugged(codec
);
4506 spec
->gen
.hp_jack_present
= false;
4508 case ALC_HEADSET_MODE_HEADSET
:
4509 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_UNKNOWN
)
4510 alc_determine_headset_type(codec
);
4511 if (spec
->current_headset_type
== ALC_HEADSET_TYPE_CTIA
)
4512 alc_headset_mode_ctia(codec
);
4513 else if (spec
->current_headset_type
== ALC_HEADSET_TYPE_OMTP
)
4514 alc_headset_mode_omtp(codec
);
4515 spec
->gen
.hp_jack_present
= true;
4517 case ALC_HEADSET_MODE_MIC
:
4518 alc_headset_mode_mic_in(codec
, hp_pin
, spec
->headphone_mic_pin
);
4519 spec
->gen
.hp_jack_present
= false;
4521 case ALC_HEADSET_MODE_HEADPHONE
:
4522 alc_headset_mode_default(codec
);
4523 spec
->gen
.hp_jack_present
= true;
4526 if (new_headset_mode
!= ALC_HEADSET_MODE_MIC
) {
4527 snd_hda_set_pin_ctl_cache(codec
, hp_pin
,
4528 AC_PINCTL_OUT_EN
| AC_PINCTL_HP_EN
);
4529 if (spec
->headphone_mic_pin
&& spec
->headphone_mic_pin
!= hp_pin
)
4530 snd_hda_set_pin_ctl_cache(codec
, spec
->headphone_mic_pin
,
4533 spec
->current_headset_mode
= new_headset_mode
;
4535 snd_hda_gen_update_outputs(codec
);
4538 static void alc_update_headset_mode_hook(struct hda_codec
*codec
,
4539 struct snd_kcontrol
*kcontrol
,
4540 struct snd_ctl_elem_value
*ucontrol
)
4542 alc_update_headset_mode(codec
);
4545 static void alc_update_headset_jack_cb(struct hda_codec
*codec
,
4546 struct hda_jack_callback
*jack
)
4548 struct alc_spec
*spec
= codec
->spec
;
4549 spec
->current_headset_type
= ALC_HEADSET_TYPE_UNKNOWN
;
4550 snd_hda_gen_hp_automute(codec
, jack
);
4553 static void alc_probe_headset_mode(struct hda_codec
*codec
)
4556 struct alc_spec
*spec
= codec
->spec
;
4557 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4560 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4561 if (cfg
->inputs
[i
].is_headset_mic
&& !spec
->headset_mic_pin
)
4562 spec
->headset_mic_pin
= cfg
->inputs
[i
].pin
;
4563 if (cfg
->inputs
[i
].is_headphone_mic
&& !spec
->headphone_mic_pin
)
4564 spec
->headphone_mic_pin
= cfg
->inputs
[i
].pin
;
4567 spec
->gen
.cap_sync_hook
= alc_update_headset_mode_hook
;
4568 spec
->gen
.automute_hook
= alc_update_headset_mode
;
4569 spec
->gen
.hp_automute_hook
= alc_update_headset_jack_cb
;
4572 static void alc_fixup_headset_mode(struct hda_codec
*codec
,
4573 const struct hda_fixup
*fix
, int action
)
4575 struct alc_spec
*spec
= codec
->spec
;
4578 case HDA_FIXUP_ACT_PRE_PROBE
:
4579 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
| HDA_PINCFG_HEADPHONE_MIC
;
4581 case HDA_FIXUP_ACT_PROBE
:
4582 alc_probe_headset_mode(codec
);
4584 case HDA_FIXUP_ACT_INIT
:
4585 spec
->current_headset_mode
= 0;
4586 alc_update_headset_mode(codec
);
4591 static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec
*codec
,
4592 const struct hda_fixup
*fix
, int action
)
4594 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4595 struct alc_spec
*spec
= codec
->spec
;
4596 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4599 alc_fixup_headset_mode(codec
, fix
, action
);
4602 static void alc255_set_default_jack_type(struct hda_codec
*codec
)
4604 /* Set to iphone type */
4605 static struct coef_fw alc255fw
[] = {
4606 WRITE_COEF(0x1b, 0x880b),
4607 WRITE_COEF(0x45, 0xd089),
4608 WRITE_COEF(0x1b, 0x080b),
4609 WRITE_COEF(0x46, 0x0004),
4610 WRITE_COEF(0x1b, 0x0c0b),
4613 static struct coef_fw alc256fw
[] = {
4614 WRITE_COEF(0x1b, 0x884b),
4615 WRITE_COEF(0x45, 0xd089),
4616 WRITE_COEF(0x1b, 0x084b),
4617 WRITE_COEF(0x46, 0x0004),
4618 WRITE_COEF(0x1b, 0x0c4b),
4621 switch (codec
->core
.vendor_id
) {
4623 alc_process_coef_fw(codec
, alc255fw
);
4626 alc_process_coef_fw(codec
, alc256fw
);
4632 static void alc_fixup_headset_mode_alc255(struct hda_codec
*codec
,
4633 const struct hda_fixup
*fix
, int action
)
4635 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4636 alc255_set_default_jack_type(codec
);
4638 alc_fixup_headset_mode(codec
, fix
, action
);
4641 static void alc_fixup_headset_mode_alc255_no_hp_mic(struct hda_codec
*codec
,
4642 const struct hda_fixup
*fix
, int action
)
4644 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4645 struct alc_spec
*spec
= codec
->spec
;
4646 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4647 alc255_set_default_jack_type(codec
);
4650 alc_fixup_headset_mode(codec
, fix
, action
);
4653 static void alc288_update_headset_jack_cb(struct hda_codec
*codec
,
4654 struct hda_jack_callback
*jack
)
4656 struct alc_spec
*spec
= codec
->spec
;
4659 alc_update_headset_jack_cb(codec
, jack
);
4660 /* Headset Mic enable or disable, only for Dell Dino */
4661 present
= spec
->gen
.hp_jack_present
? 0x40 : 0;
4662 snd_hda_codec_write(codec
, 0x01, 0, AC_VERB_SET_GPIO_DATA
,
4666 static void alc_fixup_headset_mode_dell_alc288(struct hda_codec
*codec
,
4667 const struct hda_fixup
*fix
, int action
)
4669 alc_fixup_headset_mode(codec
, fix
, action
);
4670 if (action
== HDA_FIXUP_ACT_PROBE
) {
4671 struct alc_spec
*spec
= codec
->spec
;
4672 spec
->gen
.hp_automute_hook
= alc288_update_headset_jack_cb
;
4676 static void alc_fixup_auto_mute_via_amp(struct hda_codec
*codec
,
4677 const struct hda_fixup
*fix
, int action
)
4679 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4680 struct alc_spec
*spec
= codec
->spec
;
4681 spec
->gen
.auto_mute_via_amp
= 1;
4685 static void alc_no_shutup(struct hda_codec
*codec
)
4689 static void alc_fixup_no_shutup(struct hda_codec
*codec
,
4690 const struct hda_fixup
*fix
, int action
)
4692 if (action
== HDA_FIXUP_ACT_PROBE
) {
4693 struct alc_spec
*spec
= codec
->spec
;
4694 spec
->shutup
= alc_no_shutup
;
4698 static void alc_fixup_disable_aamix(struct hda_codec
*codec
,
4699 const struct hda_fixup
*fix
, int action
)
4701 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4702 struct alc_spec
*spec
= codec
->spec
;
4703 /* Disable AA-loopback as it causes white noise */
4704 spec
->gen
.mixer_nid
= 0;
4708 /* fixup for Thinkpad docks: add dock pins, avoid HP parser fixup */
4709 static void alc_fixup_tpt440_dock(struct hda_codec
*codec
,
4710 const struct hda_fixup
*fix
, int action
)
4712 static const struct hda_pintbl pincfgs
[] = {
4713 { 0x16, 0x21211010 }, /* dock headphone */
4714 { 0x19, 0x21a11010 }, /* dock mic */
4717 struct alc_spec
*spec
= codec
->spec
;
4719 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4720 spec
->shutup
= alc_no_shutup
; /* reduce click noise */
4721 spec
->reboot_notify
= alc_d3_at_reboot
; /* reduce noise */
4722 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
4723 codec
->power_save_node
= 0; /* avoid click noises */
4724 snd_hda_apply_pincfgs(codec
, pincfgs
);
4728 static void alc_shutup_dell_xps13(struct hda_codec
*codec
)
4730 struct alc_spec
*spec
= codec
->spec
;
4731 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4733 /* Prevent pop noises when headphones are plugged in */
4734 snd_hda_codec_write(codec
, hp_pin
, 0,
4735 AC_VERB_SET_AMP_GAIN_MUTE
, AMP_OUT_MUTE
);
4739 static void alc_fixup_dell_xps13(struct hda_codec
*codec
,
4740 const struct hda_fixup
*fix
, int action
)
4742 struct alc_spec
*spec
= codec
->spec
;
4743 struct hda_input_mux
*imux
= &spec
->gen
.input_mux
;
4747 case HDA_FIXUP_ACT_PRE_PROBE
:
4748 /* mic pin 0x19 must be initialized with Vref Hi-Z, otherwise
4749 * it causes a click noise at start up
4751 snd_hda_codec_set_pin_target(codec
, 0x19, PIN_VREFHIZ
);
4753 case HDA_FIXUP_ACT_PROBE
:
4754 spec
->shutup
= alc_shutup_dell_xps13
;
4756 /* Make the internal mic the default input source. */
4757 for (i
= 0; i
< imux
->num_items
; i
++) {
4758 if (spec
->gen
.imux_pins
[i
] == 0x12) {
4759 spec
->gen
.cur_mux
[0] = i
;
4767 static void alc_fixup_headset_mode_alc662(struct hda_codec
*codec
,
4768 const struct hda_fixup
*fix
, int action
)
4770 struct alc_spec
*spec
= codec
->spec
;
4772 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4773 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
4774 spec
->gen
.hp_mic
= 1; /* Mic-in is same pin as headphone */
4776 /* Disable boost for mic-in permanently. (This code is only called
4777 from quirks that guarantee that the headphone is at NID 0x1b.) */
4778 snd_hda_codec_write(codec
, 0x1b, 0, AC_VERB_SET_AMP_GAIN_MUTE
, 0x7000);
4779 snd_hda_override_wcaps(codec
, 0x1b, get_wcaps(codec
, 0x1b) & ~AC_WCAP_IN_AMP
);
4781 alc_fixup_headset_mode(codec
, fix
, action
);
4784 static void alc_fixup_headset_mode_alc668(struct hda_codec
*codec
,
4785 const struct hda_fixup
*fix
, int action
)
4787 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4788 alc_write_coef_idx(codec
, 0xc4, 0x8000);
4789 alc_update_coef_idx(codec
, 0xc2, ~0xfe, 0);
4790 snd_hda_set_pin_ctl_cache(codec
, 0x18, 0);
4792 alc_fixup_headset_mode(codec
, fix
, action
);
4795 /* Returns the nid of the external mic input pin, or 0 if it cannot be found. */
4796 static int find_ext_mic_pin(struct hda_codec
*codec
)
4798 struct alc_spec
*spec
= codec
->spec
;
4799 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4801 unsigned int defcfg
;
4804 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4805 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
4807 nid
= cfg
->inputs
[i
].pin
;
4808 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
4809 if (snd_hda_get_input_pin_attr(defcfg
) == INPUT_PIN_ATTR_INT
)
4817 static void alc271_hp_gate_mic_jack(struct hda_codec
*codec
,
4818 const struct hda_fixup
*fix
,
4821 struct alc_spec
*spec
= codec
->spec
;
4823 if (action
== HDA_FIXUP_ACT_PROBE
) {
4824 int mic_pin
= find_ext_mic_pin(codec
);
4825 int hp_pin
= spec
->gen
.autocfg
.hp_pins
[0];
4827 if (snd_BUG_ON(!mic_pin
|| !hp_pin
))
4829 snd_hda_jack_set_gating_jack(codec
, mic_pin
, hp_pin
);
4833 static void alc269_fixup_limit_int_mic_boost(struct hda_codec
*codec
,
4834 const struct hda_fixup
*fix
,
4837 struct alc_spec
*spec
= codec
->spec
;
4838 struct auto_pin_cfg
*cfg
= &spec
->gen
.autocfg
;
4841 /* The mic boosts on level 2 and 3 are too noisy
4842 on the internal mic input.
4843 Therefore limit the boost to 0 or 1. */
4845 if (action
!= HDA_FIXUP_ACT_PROBE
)
4848 for (i
= 0; i
< cfg
->num_inputs
; i
++) {
4849 hda_nid_t nid
= cfg
->inputs
[i
].pin
;
4850 unsigned int defcfg
;
4851 if (cfg
->inputs
[i
].type
!= AUTO_PIN_MIC
)
4853 defcfg
= snd_hda_codec_get_pincfg(codec
, nid
);
4854 if (snd_hda_get_input_pin_attr(defcfg
) != INPUT_PIN_ATTR_INT
)
4857 snd_hda_override_amp_caps(codec
, nid
, HDA_INPUT
,
4858 (0x00 << AC_AMPCAP_OFFSET_SHIFT
) |
4859 (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT
) |
4860 (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT
) |
4861 (0 << AC_AMPCAP_MUTE_SHIFT
));
4865 static void alc283_hp_automute_hook(struct hda_codec
*codec
,
4866 struct hda_jack_callback
*jack
)
4868 struct alc_spec
*spec
= codec
->spec
;
4872 snd_hda_gen_hp_automute(codec
, jack
);
4874 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
4877 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
4881 static void alc283_fixup_chromebook(struct hda_codec
*codec
,
4882 const struct hda_fixup
*fix
, int action
)
4884 struct alc_spec
*spec
= codec
->spec
;
4887 case HDA_FIXUP_ACT_PRE_PROBE
:
4888 snd_hda_override_wcaps(codec
, 0x03, 0);
4889 /* Disable AA-loopback as it causes white noise */
4890 spec
->gen
.mixer_nid
= 0;
4892 case HDA_FIXUP_ACT_INIT
:
4893 /* MIC2-VREF control */
4894 /* Set to manual mode */
4895 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
4896 /* Enable Line1 input control by verb */
4897 alc_update_coef_idx(codec
, 0x1a, 0, 1 << 4);
4902 static void alc283_fixup_sense_combo_jack(struct hda_codec
*codec
,
4903 const struct hda_fixup
*fix
, int action
)
4905 struct alc_spec
*spec
= codec
->spec
;
4908 case HDA_FIXUP_ACT_PRE_PROBE
:
4909 spec
->gen
.hp_automute_hook
= alc283_hp_automute_hook
;
4911 case HDA_FIXUP_ACT_INIT
:
4912 /* MIC2-VREF control */
4913 /* Set to manual mode */
4914 alc_update_coef_idx(codec
, 0x06, 0x000c, 0);
4919 /* mute tablet speaker pin (0x14) via dock plugging in addition */
4920 static void asus_tx300_automute(struct hda_codec
*codec
)
4922 struct alc_spec
*spec
= codec
->spec
;
4923 snd_hda_gen_update_outputs(codec
);
4924 if (snd_hda_jack_detect(codec
, 0x1b))
4925 spec
->gen
.mute_bits
|= (1ULL << 0x14);
4928 static void alc282_fixup_asus_tx300(struct hda_codec
*codec
,
4929 const struct hda_fixup
*fix
, int action
)
4931 struct alc_spec
*spec
= codec
->spec
;
4932 /* TX300 needs to set up GPIO2 for the speaker amp */
4933 static const struct hda_verb gpio2_verbs
[] = {
4934 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
4935 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
4936 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
4939 static const struct hda_pintbl dock_pins
[] = {
4940 { 0x1b, 0x21114000 }, /* dock speaker pin */
4945 case HDA_FIXUP_ACT_PRE_PROBE
:
4946 snd_hda_add_verbs(codec
, gpio2_verbs
);
4947 snd_hda_apply_pincfgs(codec
, dock_pins
);
4948 spec
->gen
.auto_mute_via_amp
= 1;
4949 spec
->gen
.automute_hook
= asus_tx300_automute
;
4950 snd_hda_jack_detect_enable_callback(codec
, 0x1b,
4951 snd_hda_gen_hp_automute
);
4953 case HDA_FIXUP_ACT_BUILD
:
4954 /* this is a bit tricky; give more sane names for the main
4955 * (tablet) speaker and the dock speaker, respectively
4957 rename_ctl(codec
, "Speaker Playback Switch",
4958 "Dock Speaker Playback Switch");
4959 rename_ctl(codec
, "Bass Speaker Playback Switch",
4960 "Speaker Playback Switch");
4965 static void alc290_fixup_mono_speakers(struct hda_codec
*codec
,
4966 const struct hda_fixup
*fix
, int action
)
4968 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4969 /* DAC node 0x03 is giving mono output. We therefore want to
4970 make sure 0x14 (front speaker) and 0x15 (headphones) use the
4971 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
4972 hda_nid_t conn1
[2] = { 0x0c };
4973 snd_hda_override_conn_list(codec
, 0x14, 1, conn1
);
4974 snd_hda_override_conn_list(codec
, 0x15, 1, conn1
);
4978 static void alc298_fixup_speaker_volume(struct hda_codec
*codec
,
4979 const struct hda_fixup
*fix
, int action
)
4981 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
4982 /* The speaker is routed to the Node 0x06 by a mistake, as a result
4983 we can't adjust the speaker's volume since this node does not has
4984 Amp-out capability. we change the speaker's route to:
4985 Node 0x02 (Audio Output) -> Node 0x0c (Audio Mixer) -> Node 0x17 (
4986 Pin Complex), since Node 0x02 has Amp-out caps, we can adjust
4987 speaker's volume now. */
4989 hda_nid_t conn1
[1] = { 0x0c };
4990 snd_hda_override_conn_list(codec
, 0x17, 1, conn1
);
4994 /* Hook to update amp GPIO4 for automute */
4995 static void alc280_hp_gpio4_automute_hook(struct hda_codec
*codec
,
4996 struct hda_jack_callback
*jack
)
4998 struct alc_spec
*spec
= codec
->spec
;
5000 snd_hda_gen_hp_automute(codec
, jack
);
5001 /* mute_led_polarity is set to 0, so we pass inverted value here */
5002 alc_update_gpio_led(codec
, 0x10, !spec
->gen
.hp_jack_present
);
5005 /* Manage GPIOs for HP EliteBook Folio 9480m.
5007 * GPIO4 is the headphone amplifier power control
5008 * GPIO3 is the audio output mute indicator LED
5011 static void alc280_fixup_hp_9480m(struct hda_codec
*codec
,
5012 const struct hda_fixup
*fix
,
5015 struct alc_spec
*spec
= codec
->spec
;
5016 static const struct hda_verb gpio_init
[] = {
5017 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x18 },
5018 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x18 },
5022 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
5023 /* Set the hooks to turn the headphone amp on/off
5026 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
5027 spec
->gen
.hp_automute_hook
= alc280_hp_gpio4_automute_hook
;
5029 /* The GPIOs are currently off */
5032 /* GPIO3 is connected to the output mute LED,
5033 * high is on, low is off
5035 spec
->mute_led_polarity
= 0;
5036 spec
->gpio_mute_led_mask
= 0x08;
5038 /* Initialize GPIO configuration */
5039 snd_hda_add_verbs(codec
, gpio_init
);
5043 static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec
*codec
,
5044 const struct hda_fixup
*fix
,
5047 alc_fixup_dual_codecs(codec
, fix
, action
);
5049 case HDA_FIXUP_ACT_PRE_PROBE
:
5050 /* override card longname to provide a unique UCM profile */
5051 strcpy(codec
->card
->longname
, "HDAudio-Lenovo-DualCodecs");
5053 case HDA_FIXUP_ACT_BUILD
:
5054 /* rename Capture controls depending on the codec */
5055 rename_ctl(codec
, "Capture Volume",
5057 "Rear-Panel Capture Volume" :
5058 "Front-Panel Capture Volume");
5059 rename_ctl(codec
, "Capture Switch",
5061 "Rear-Panel Capture Switch" :
5062 "Front-Panel Capture Switch");
5067 /* for hda_fixup_thinkpad_acpi() */
5068 #include "thinkpad_helper.c"
5070 /* for dell wmi mic mute led */
5071 #include "dell_wmi_helper.c"
5074 ALC269_FIXUP_SONY_VAIO
,
5075 ALC275_FIXUP_SONY_VAIO_GPIO2
,
5076 ALC269_FIXUP_DELL_M101Z
,
5077 ALC269_FIXUP_SKU_IGNORE
,
5078 ALC269_FIXUP_ASUS_G73JW
,
5079 ALC269_FIXUP_LENOVO_EAPD
,
5080 ALC275_FIXUP_SONY_HWEQ
,
5081 ALC275_FIXUP_SONY_DISABLE_AAMIX
,
5083 ALC269_FIXUP_PCM_44K
,
5084 ALC269_FIXUP_STEREO_DMIC
,
5085 ALC269_FIXUP_HEADSET_MIC
,
5086 ALC269_FIXUP_QUANTA_MUTE
,
5087 ALC269_FIXUP_LIFEBOOK
,
5088 ALC269_FIXUP_LIFEBOOK_EXTMIC
,
5089 ALC269_FIXUP_LIFEBOOK_HP_PIN
,
5090 ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
,
5093 ALC269VB_FIXUP_AMIC
,
5094 ALC269VB_FIXUP_DMIC
,
5095 ALC269_FIXUP_HP_MUTE_LED
,
5096 ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5097 ALC269_FIXUP_HP_MUTE_LED_MIC2
,
5098 ALC269_FIXUP_HP_GPIO_LED
,
5099 ALC269_FIXUP_HP_GPIO_MIC1_LED
,
5100 ALC269_FIXUP_HP_LINE1_MIC1_LED
,
5101 ALC269_FIXUP_INV_DMIC
,
5102 ALC269_FIXUP_LENOVO_DOCK
,
5103 ALC269_FIXUP_NO_SHUTUP
,
5104 ALC286_FIXUP_SONY_MIC_NO_PRESENCE
,
5105 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
,
5106 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
5107 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
5108 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5109 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
5110 ALC269_FIXUP_HEADSET_MODE
,
5111 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5112 ALC269_FIXUP_ASPIRE_HEADSET_MIC
,
5113 ALC269_FIXUP_ASUS_X101_FUNC
,
5114 ALC269_FIXUP_ASUS_X101_VERB
,
5115 ALC269_FIXUP_ASUS_X101
,
5116 ALC271_FIXUP_AMIC_MIC2
,
5117 ALC271_FIXUP_HP_GATE_MIC_JACK
,
5118 ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
,
5119 ALC269_FIXUP_ACER_AC700
,
5120 ALC269_FIXUP_LIMIT_INT_MIC_BOOST
,
5121 ALC269VB_FIXUP_ASUS_ZENBOOK
,
5122 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
,
5123 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
,
5124 ALC269VB_FIXUP_ORDISSIMO_EVE2
,
5125 ALC283_FIXUP_CHROME_BOOK
,
5126 ALC283_FIXUP_SENSE_COMBO_JACK
,
5127 ALC282_FIXUP_ASUS_TX300
,
5128 ALC283_FIXUP_INT_MIC
,
5129 ALC290_FIXUP_MONO_SPEAKERS
,
5130 ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5131 ALC290_FIXUP_SUBWOOFER
,
5132 ALC290_FIXUP_SUBWOOFER_HSJACK
,
5133 ALC269_FIXUP_THINKPAD_ACPI
,
5134 ALC269_FIXUP_DMIC_THINKPAD_ACPI
,
5135 ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
5136 ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
5137 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
5138 ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
5139 ALC255_FIXUP_HEADSET_MODE
,
5140 ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
,
5141 ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
5142 ALC292_FIXUP_TPT440_DOCK
,
5143 ALC292_FIXUP_TPT440
,
5144 ALC283_FIXUP_HEADSET_MIC
,
5145 ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
,
5146 ALC282_FIXUP_ASPIRE_V5_PINS
,
5147 ALC280_FIXUP_HP_GPIO4
,
5148 ALC286_FIXUP_HP_GPIO_LED
,
5149 ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
,
5150 ALC280_FIXUP_HP_DOCK_PINS
,
5151 ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
,
5152 ALC280_FIXUP_HP_9480M
,
5153 ALC288_FIXUP_DELL_HEADSET_MODE
,
5154 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
,
5155 ALC288_FIXUP_DELL_XPS_13_GPIO6
,
5156 ALC288_FIXUP_DELL_XPS_13
,
5157 ALC288_FIXUP_DISABLE_AAMIX
,
5158 ALC292_FIXUP_DELL_E7X
,
5159 ALC292_FIXUP_DISABLE_AAMIX
,
5160 ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
,
5161 ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
5162 ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5163 ALC275_FIXUP_DELL_XPS
,
5164 ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
,
5165 ALC293_FIXUP_LENOVO_SPK_NOISE
,
5166 ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
,
5167 ALC255_FIXUP_DELL_SPK_NOISE
,
5168 ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
5169 ALC280_FIXUP_HP_HEADSET_MIC
,
5170 ALC221_FIXUP_HP_FRONT_MIC
,
5171 ALC292_FIXUP_TPT460
,
5172 ALC298_FIXUP_SPK_VOLUME
,
5173 ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
,
5174 ALC269_FIXUP_ATIV_BOOK_8
,
5175 ALC221_FIXUP_HP_MIC_NO_PRESENCE
,
5176 ALC256_FIXUP_ASUS_HEADSET_MODE
,
5177 ALC256_FIXUP_ASUS_MIC
,
5178 ALC256_FIXUP_ASUS_AIO_GPIO2
,
5179 ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
,
5180 ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
,
5181 ALC233_FIXUP_LENOVO_MULTI_CODECS
,
5184 static const struct hda_fixup alc269_fixups
[] = {
5185 [ALC269_FIXUP_SONY_VAIO
] = {
5186 .type
= HDA_FIXUP_PINCTLS
,
5187 .v
.pins
= (const struct hda_pintbl
[]) {
5188 {0x19, PIN_VREFGRD
},
5192 [ALC275_FIXUP_SONY_VAIO_GPIO2
] = {
5193 .type
= HDA_FIXUP_VERBS
,
5194 .v
.verbs
= (const struct hda_verb
[]) {
5195 {0x01, AC_VERB_SET_GPIO_MASK
, 0x04},
5196 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04},
5197 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5201 .chain_id
= ALC269_FIXUP_SONY_VAIO
5203 [ALC269_FIXUP_DELL_M101Z
] = {
5204 .type
= HDA_FIXUP_VERBS
,
5205 .v
.verbs
= (const struct hda_verb
[]) {
5206 /* Enables internal speaker */
5207 {0x20, AC_VERB_SET_COEF_INDEX
, 13},
5208 {0x20, AC_VERB_SET_PROC_COEF
, 0x4040},
5212 [ALC269_FIXUP_SKU_IGNORE
] = {
5213 .type
= HDA_FIXUP_FUNC
,
5214 .v
.func
= alc_fixup_sku_ignore
,
5216 [ALC269_FIXUP_ASUS_G73JW
] = {
5217 .type
= HDA_FIXUP_PINS
,
5218 .v
.pins
= (const struct hda_pintbl
[]) {
5219 { 0x17, 0x99130111 }, /* subwoofer */
5223 [ALC269_FIXUP_LENOVO_EAPD
] = {
5224 .type
= HDA_FIXUP_VERBS
,
5225 .v
.verbs
= (const struct hda_verb
[]) {
5226 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
5230 [ALC275_FIXUP_SONY_HWEQ
] = {
5231 .type
= HDA_FIXUP_FUNC
,
5232 .v
.func
= alc269_fixup_hweq
,
5234 .chain_id
= ALC275_FIXUP_SONY_VAIO_GPIO2
5236 [ALC275_FIXUP_SONY_DISABLE_AAMIX
] = {
5237 .type
= HDA_FIXUP_FUNC
,
5238 .v
.func
= alc_fixup_disable_aamix
,
5240 .chain_id
= ALC269_FIXUP_SONY_VAIO
5242 [ALC271_FIXUP_DMIC
] = {
5243 .type
= HDA_FIXUP_FUNC
,
5244 .v
.func
= alc271_fixup_dmic
,
5246 [ALC269_FIXUP_PCM_44K
] = {
5247 .type
= HDA_FIXUP_FUNC
,
5248 .v
.func
= alc269_fixup_pcm_44k
,
5250 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5252 [ALC269_FIXUP_STEREO_DMIC
] = {
5253 .type
= HDA_FIXUP_FUNC
,
5254 .v
.func
= alc269_fixup_stereo_dmic
,
5256 [ALC269_FIXUP_HEADSET_MIC
] = {
5257 .type
= HDA_FIXUP_FUNC
,
5258 .v
.func
= alc269_fixup_headset_mic
,
5260 [ALC269_FIXUP_QUANTA_MUTE
] = {
5261 .type
= HDA_FIXUP_FUNC
,
5262 .v
.func
= alc269_fixup_quanta_mute
,
5264 [ALC269_FIXUP_LIFEBOOK
] = {
5265 .type
= HDA_FIXUP_PINS
,
5266 .v
.pins
= (const struct hda_pintbl
[]) {
5267 { 0x1a, 0x2101103f }, /* dock line-out */
5268 { 0x1b, 0x23a11040 }, /* dock mic-in */
5272 .chain_id
= ALC269_FIXUP_QUANTA_MUTE
5274 [ALC269_FIXUP_LIFEBOOK_EXTMIC
] = {
5275 .type
= HDA_FIXUP_PINS
,
5276 .v
.pins
= (const struct hda_pintbl
[]) {
5277 { 0x19, 0x01a1903c }, /* headset mic, with jack detect */
5281 [ALC269_FIXUP_LIFEBOOK_HP_PIN
] = {
5282 .type
= HDA_FIXUP_PINS
,
5283 .v
.pins
= (const struct hda_pintbl
[]) {
5284 { 0x21, 0x0221102f }, /* HP out */
5288 [ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
] = {
5289 .type
= HDA_FIXUP_FUNC
,
5290 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5292 [ALC269_FIXUP_AMIC
] = {
5293 .type
= HDA_FIXUP_PINS
,
5294 .v
.pins
= (const struct hda_pintbl
[]) {
5295 { 0x14, 0x99130110 }, /* speaker */
5296 { 0x15, 0x0121401f }, /* HP out */
5297 { 0x18, 0x01a19c20 }, /* mic */
5298 { 0x19, 0x99a3092f }, /* int-mic */
5302 [ALC269_FIXUP_DMIC
] = {
5303 .type
= HDA_FIXUP_PINS
,
5304 .v
.pins
= (const struct hda_pintbl
[]) {
5305 { 0x12, 0x99a3092f }, /* int-mic */
5306 { 0x14, 0x99130110 }, /* speaker */
5307 { 0x15, 0x0121401f }, /* HP out */
5308 { 0x18, 0x01a19c20 }, /* mic */
5312 [ALC269VB_FIXUP_AMIC
] = {
5313 .type
= HDA_FIXUP_PINS
,
5314 .v
.pins
= (const struct hda_pintbl
[]) {
5315 { 0x14, 0x99130110 }, /* speaker */
5316 { 0x18, 0x01a19c20 }, /* mic */
5317 { 0x19, 0x99a3092f }, /* int-mic */
5318 { 0x21, 0x0121401f }, /* HP out */
5322 [ALC269VB_FIXUP_DMIC
] = {
5323 .type
= HDA_FIXUP_PINS
,
5324 .v
.pins
= (const struct hda_pintbl
[]) {
5325 { 0x12, 0x99a3092f }, /* int-mic */
5326 { 0x14, 0x99130110 }, /* speaker */
5327 { 0x18, 0x01a19c20 }, /* mic */
5328 { 0x21, 0x0121401f }, /* HP out */
5332 [ALC269_FIXUP_HP_MUTE_LED
] = {
5333 .type
= HDA_FIXUP_FUNC
,
5334 .v
.func
= alc269_fixup_hp_mute_led
,
5336 [ALC269_FIXUP_HP_MUTE_LED_MIC1
] = {
5337 .type
= HDA_FIXUP_FUNC
,
5338 .v
.func
= alc269_fixup_hp_mute_led_mic1
,
5340 [ALC269_FIXUP_HP_MUTE_LED_MIC2
] = {
5341 .type
= HDA_FIXUP_FUNC
,
5342 .v
.func
= alc269_fixup_hp_mute_led_mic2
,
5344 [ALC269_FIXUP_HP_GPIO_LED
] = {
5345 .type
= HDA_FIXUP_FUNC
,
5346 .v
.func
= alc269_fixup_hp_gpio_led
,
5348 [ALC269_FIXUP_HP_GPIO_MIC1_LED
] = {
5349 .type
= HDA_FIXUP_FUNC
,
5350 .v
.func
= alc269_fixup_hp_gpio_mic1_led
,
5352 [ALC269_FIXUP_HP_LINE1_MIC1_LED
] = {
5353 .type
= HDA_FIXUP_FUNC
,
5354 .v
.func
= alc269_fixup_hp_line1_mic1_led
,
5356 [ALC269_FIXUP_INV_DMIC
] = {
5357 .type
= HDA_FIXUP_FUNC
,
5358 .v
.func
= alc_fixup_inv_dmic
,
5360 [ALC269_FIXUP_NO_SHUTUP
] = {
5361 .type
= HDA_FIXUP_FUNC
,
5362 .v
.func
= alc_fixup_no_shutup
,
5364 [ALC269_FIXUP_LENOVO_DOCK
] = {
5365 .type
= HDA_FIXUP_PINS
,
5366 .v
.pins
= (const struct hda_pintbl
[]) {
5367 { 0x19, 0x23a11040 }, /* dock mic */
5368 { 0x1b, 0x2121103f }, /* dock headphone */
5372 .chain_id
= ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
5374 [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
] = {
5375 .type
= HDA_FIXUP_FUNC
,
5376 .v
.func
= alc269_fixup_pincfg_no_hp_to_lineout
,
5378 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5380 [ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5381 .type
= HDA_FIXUP_PINS
,
5382 .v
.pins
= (const struct hda_pintbl
[]) {
5383 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5384 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5388 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5390 [ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5391 .type
= HDA_FIXUP_PINS
,
5392 .v
.pins
= (const struct hda_pintbl
[]) {
5393 { 0x16, 0x21014020 }, /* dock line out */
5394 { 0x19, 0x21a19030 }, /* dock mic */
5395 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5399 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5401 [ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
] = {
5402 .type
= HDA_FIXUP_PINS
,
5403 .v
.pins
= (const struct hda_pintbl
[]) {
5404 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5408 .chain_id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
5410 [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
] = {
5411 .type
= HDA_FIXUP_PINS
,
5412 .v
.pins
= (const struct hda_pintbl
[]) {
5413 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5414 { 0x1b, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5418 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5420 [ALC269_FIXUP_HEADSET_MODE
] = {
5421 .type
= HDA_FIXUP_FUNC
,
5422 .v
.func
= alc_fixup_headset_mode
,
5424 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5426 [ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5427 .type
= HDA_FIXUP_FUNC
,
5428 .v
.func
= alc_fixup_headset_mode_no_hp_mic
,
5430 [ALC269_FIXUP_ASPIRE_HEADSET_MIC
] = {
5431 .type
= HDA_FIXUP_PINS
,
5432 .v
.pins
= (const struct hda_pintbl
[]) {
5433 { 0x19, 0x01a1913c }, /* headset mic w/o jack detect */
5437 .chain_id
= ALC269_FIXUP_HEADSET_MODE
,
5439 [ALC286_FIXUP_SONY_MIC_NO_PRESENCE
] = {
5440 .type
= HDA_FIXUP_PINS
,
5441 .v
.pins
= (const struct hda_pintbl
[]) {
5442 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5446 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5448 [ALC269_FIXUP_ASUS_X101_FUNC
] = {
5449 .type
= HDA_FIXUP_FUNC
,
5450 .v
.func
= alc269_fixup_x101_headset_mic
,
5452 [ALC269_FIXUP_ASUS_X101_VERB
] = {
5453 .type
= HDA_FIXUP_VERBS
,
5454 .v
.verbs
= (const struct hda_verb
[]) {
5455 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0},
5456 {0x20, AC_VERB_SET_COEF_INDEX
, 0x08},
5457 {0x20, AC_VERB_SET_PROC_COEF
, 0x0310},
5461 .chain_id
= ALC269_FIXUP_ASUS_X101_FUNC
5463 [ALC269_FIXUP_ASUS_X101
] = {
5464 .type
= HDA_FIXUP_PINS
,
5465 .v
.pins
= (const struct hda_pintbl
[]) {
5466 { 0x18, 0x04a1182c }, /* Headset mic */
5470 .chain_id
= ALC269_FIXUP_ASUS_X101_VERB
5472 [ALC271_FIXUP_AMIC_MIC2
] = {
5473 .type
= HDA_FIXUP_PINS
,
5474 .v
.pins
= (const struct hda_pintbl
[]) {
5475 { 0x14, 0x99130110 }, /* speaker */
5476 { 0x19, 0x01a19c20 }, /* mic */
5477 { 0x1b, 0x99a7012f }, /* int-mic */
5478 { 0x21, 0x0121401f }, /* HP out */
5482 [ALC271_FIXUP_HP_GATE_MIC_JACK
] = {
5483 .type
= HDA_FIXUP_FUNC
,
5484 .v
.func
= alc271_hp_gate_mic_jack
,
5486 .chain_id
= ALC271_FIXUP_AMIC_MIC2
,
5488 [ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
] = {
5489 .type
= HDA_FIXUP_FUNC
,
5490 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5492 .chain_id
= ALC271_FIXUP_HP_GATE_MIC_JACK
,
5494 [ALC269_FIXUP_ACER_AC700
] = {
5495 .type
= HDA_FIXUP_PINS
,
5496 .v
.pins
= (const struct hda_pintbl
[]) {
5497 { 0x12, 0x99a3092f }, /* int-mic */
5498 { 0x14, 0x99130110 }, /* speaker */
5499 { 0x18, 0x03a11c20 }, /* mic */
5500 { 0x1e, 0x0346101e }, /* SPDIF1 */
5501 { 0x21, 0x0321101f }, /* HP out */
5505 .chain_id
= ALC271_FIXUP_DMIC
,
5507 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST
] = {
5508 .type
= HDA_FIXUP_FUNC
,
5509 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5511 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5513 [ALC269VB_FIXUP_ASUS_ZENBOOK
] = {
5514 .type
= HDA_FIXUP_FUNC
,
5515 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5517 .chain_id
= ALC269VB_FIXUP_DMIC
,
5519 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
] = {
5520 .type
= HDA_FIXUP_VERBS
,
5521 .v
.verbs
= (const struct hda_verb
[]) {
5522 /* class-D output amp +5dB */
5523 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x12 },
5524 { 0x20, AC_VERB_SET_PROC_COEF
, 0x2800 },
5528 .chain_id
= ALC269VB_FIXUP_ASUS_ZENBOOK
,
5530 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
] = {
5531 .type
= HDA_FIXUP_FUNC
,
5532 .v
.func
= alc269_fixup_limit_int_mic_boost
,
5534 .chain_id
= ALC269_FIXUP_HP_MUTE_LED_MIC1
,
5536 [ALC269VB_FIXUP_ORDISSIMO_EVE2
] = {
5537 .type
= HDA_FIXUP_PINS
,
5538 .v
.pins
= (const struct hda_pintbl
[]) {
5539 { 0x12, 0x99a3092f }, /* int-mic */
5540 { 0x18, 0x03a11d20 }, /* mic */
5541 { 0x19, 0x411111f0 }, /* Unused bogus pin */
5545 [ALC283_FIXUP_CHROME_BOOK
] = {
5546 .type
= HDA_FIXUP_FUNC
,
5547 .v
.func
= alc283_fixup_chromebook
,
5549 [ALC283_FIXUP_SENSE_COMBO_JACK
] = {
5550 .type
= HDA_FIXUP_FUNC
,
5551 .v
.func
= alc283_fixup_sense_combo_jack
,
5553 .chain_id
= ALC283_FIXUP_CHROME_BOOK
,
5555 [ALC282_FIXUP_ASUS_TX300
] = {
5556 .type
= HDA_FIXUP_FUNC
,
5557 .v
.func
= alc282_fixup_asus_tx300
,
5559 [ALC283_FIXUP_INT_MIC
] = {
5560 .type
= HDA_FIXUP_VERBS
,
5561 .v
.verbs
= (const struct hda_verb
[]) {
5562 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1a},
5563 {0x20, AC_VERB_SET_PROC_COEF
, 0x0011},
5567 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
5569 [ALC290_FIXUP_SUBWOOFER_HSJACK
] = {
5570 .type
= HDA_FIXUP_PINS
,
5571 .v
.pins
= (const struct hda_pintbl
[]) {
5572 { 0x17, 0x90170112 }, /* subwoofer */
5576 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS_HSJACK
,
5578 [ALC290_FIXUP_SUBWOOFER
] = {
5579 .type
= HDA_FIXUP_PINS
,
5580 .v
.pins
= (const struct hda_pintbl
[]) {
5581 { 0x17, 0x90170112 }, /* subwoofer */
5585 .chain_id
= ALC290_FIXUP_MONO_SPEAKERS
,
5587 [ALC290_FIXUP_MONO_SPEAKERS
] = {
5588 .type
= HDA_FIXUP_FUNC
,
5589 .v
.func
= alc290_fixup_mono_speakers
,
5591 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK
] = {
5592 .type
= HDA_FIXUP_FUNC
,
5593 .v
.func
= alc290_fixup_mono_speakers
,
5595 .chain_id
= ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
5597 [ALC269_FIXUP_THINKPAD_ACPI
] = {
5598 .type
= HDA_FIXUP_FUNC
,
5599 .v
.func
= hda_fixup_thinkpad_acpi
,
5601 .chain_id
= ALC269_FIXUP_SKU_IGNORE
,
5603 [ALC269_FIXUP_DMIC_THINKPAD_ACPI
] = {
5604 .type
= HDA_FIXUP_FUNC
,
5605 .v
.func
= alc_fixup_inv_dmic
,
5607 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
,
5609 [ALC255_FIXUP_ACER_MIC_NO_PRESENCE
] = {
5610 .type
= HDA_FIXUP_PINS
,
5611 .v
.pins
= (const struct hda_pintbl
[]) {
5612 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5616 .chain_id
= ALC255_FIXUP_HEADSET_MODE
5618 [ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
5619 .type
= HDA_FIXUP_PINS
,
5620 .v
.pins
= (const struct hda_pintbl
[]) {
5621 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5625 .chain_id
= ALC255_FIXUP_HEADSET_MODE
5627 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5628 .type
= HDA_FIXUP_PINS
,
5629 .v
.pins
= (const struct hda_pintbl
[]) {
5630 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5631 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5635 .chain_id
= ALC255_FIXUP_HEADSET_MODE
5637 [ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
] = {
5638 .type
= HDA_FIXUP_PINS
,
5639 .v
.pins
= (const struct hda_pintbl
[]) {
5640 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5644 .chain_id
= ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
5646 [ALC255_FIXUP_HEADSET_MODE
] = {
5647 .type
= HDA_FIXUP_FUNC
,
5648 .v
.func
= alc_fixup_headset_mode_alc255
,
5650 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5652 [ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC
] = {
5653 .type
= HDA_FIXUP_FUNC
,
5654 .v
.func
= alc_fixup_headset_mode_alc255_no_hp_mic
,
5656 [ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5657 .type
= HDA_FIXUP_PINS
,
5658 .v
.pins
= (const struct hda_pintbl
[]) {
5659 { 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5660 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5664 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5666 [ALC292_FIXUP_TPT440_DOCK
] = {
5667 .type
= HDA_FIXUP_FUNC
,
5668 .v
.func
= alc_fixup_tpt440_dock
,
5670 .chain_id
= ALC269_FIXUP_LIMIT_INT_MIC_BOOST
5672 [ALC292_FIXUP_TPT440
] = {
5673 .type
= HDA_FIXUP_FUNC
,
5674 .v
.func
= alc_fixup_disable_aamix
,
5676 .chain_id
= ALC292_FIXUP_TPT440_DOCK
,
5678 [ALC283_FIXUP_HEADSET_MIC
] = {
5679 .type
= HDA_FIXUP_PINS
,
5680 .v
.pins
= (const struct hda_pintbl
[]) {
5681 { 0x19, 0x04a110f0 },
5685 [ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
] = {
5686 .type
= HDA_FIXUP_FUNC
,
5687 .v
.func
= alc_fixup_dell_wmi
,
5689 [ALC282_FIXUP_ASPIRE_V5_PINS
] = {
5690 .type
= HDA_FIXUP_PINS
,
5691 .v
.pins
= (const struct hda_pintbl
[]) {
5692 { 0x12, 0x90a60130 },
5693 { 0x14, 0x90170110 },
5694 { 0x17, 0x40000008 },
5695 { 0x18, 0x411111f0 },
5696 { 0x19, 0x01a1913c },
5697 { 0x1a, 0x411111f0 },
5698 { 0x1b, 0x411111f0 },
5699 { 0x1d, 0x40f89b2d },
5700 { 0x1e, 0x411111f0 },
5701 { 0x21, 0x0321101f },
5705 [ALC280_FIXUP_HP_GPIO4
] = {
5706 .type
= HDA_FIXUP_FUNC
,
5707 .v
.func
= alc280_fixup_hp_gpio4
,
5709 [ALC286_FIXUP_HP_GPIO_LED
] = {
5710 .type
= HDA_FIXUP_FUNC
,
5711 .v
.func
= alc286_fixup_hp_gpio_led
,
5713 [ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
] = {
5714 .type
= HDA_FIXUP_FUNC
,
5715 .v
.func
= alc280_fixup_hp_gpio2_mic_hotkey
,
5717 [ALC280_FIXUP_HP_DOCK_PINS
] = {
5718 .type
= HDA_FIXUP_PINS
,
5719 .v
.pins
= (const struct hda_pintbl
[]) {
5720 { 0x1b, 0x21011020 }, /* line-out */
5721 { 0x1a, 0x01a1903c }, /* headset mic */
5722 { 0x18, 0x2181103f }, /* line-in */
5726 .chain_id
= ALC280_FIXUP_HP_GPIO4
5728 [ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
] = {
5729 .type
= HDA_FIXUP_PINS
,
5730 .v
.pins
= (const struct hda_pintbl
[]) {
5731 { 0x1b, 0x21011020 }, /* line-out */
5732 { 0x18, 0x2181103f }, /* line-in */
5736 .chain_id
= ALC269_FIXUP_HP_GPIO_MIC1_LED
5738 [ALC280_FIXUP_HP_9480M
] = {
5739 .type
= HDA_FIXUP_FUNC
,
5740 .v
.func
= alc280_fixup_hp_9480m
,
5742 [ALC288_FIXUP_DELL_HEADSET_MODE
] = {
5743 .type
= HDA_FIXUP_FUNC
,
5744 .v
.func
= alc_fixup_headset_mode_dell_alc288
,
5746 .chain_id
= ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED
5748 [ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5749 .type
= HDA_FIXUP_PINS
,
5750 .v
.pins
= (const struct hda_pintbl
[]) {
5751 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5752 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5756 .chain_id
= ALC288_FIXUP_DELL_HEADSET_MODE
5758 [ALC288_FIXUP_DELL_XPS_13_GPIO6
] = {
5759 .type
= HDA_FIXUP_VERBS
,
5760 .v
.verbs
= (const struct hda_verb
[]) {
5761 {0x01, AC_VERB_SET_GPIO_MASK
, 0x40},
5762 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x40},
5763 {0x01, AC_VERB_SET_GPIO_DATA
, 0x00},
5767 .chain_id
= ALC288_FIXUP_DELL1_MIC_NO_PRESENCE
5769 [ALC288_FIXUP_DISABLE_AAMIX
] = {
5770 .type
= HDA_FIXUP_FUNC
,
5771 .v
.func
= alc_fixup_disable_aamix
,
5773 .chain_id
= ALC288_FIXUP_DELL_XPS_13_GPIO6
5775 [ALC288_FIXUP_DELL_XPS_13
] = {
5776 .type
= HDA_FIXUP_FUNC
,
5777 .v
.func
= alc_fixup_dell_xps13
,
5779 .chain_id
= ALC288_FIXUP_DISABLE_AAMIX
5781 [ALC292_FIXUP_DISABLE_AAMIX
] = {
5782 .type
= HDA_FIXUP_FUNC
,
5783 .v
.func
= alc_fixup_disable_aamix
,
5785 .chain_id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
5787 [ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
] = {
5788 .type
= HDA_FIXUP_FUNC
,
5789 .v
.func
= alc_fixup_disable_aamix
,
5791 .chain_id
= ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
5793 [ALC292_FIXUP_DELL_E7X
] = {
5794 .type
= HDA_FIXUP_FUNC
,
5795 .v
.func
= alc_fixup_dell_xps13
,
5797 .chain_id
= ALC292_FIXUP_DISABLE_AAMIX
5799 [ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5800 .type
= HDA_FIXUP_PINS
,
5801 .v
.pins
= (const struct hda_pintbl
[]) {
5802 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5803 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5807 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5809 [ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
] = {
5810 .type
= HDA_FIXUP_PINS
,
5811 .v
.pins
= (const struct hda_pintbl
[]) {
5812 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5816 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5818 [ALC275_FIXUP_DELL_XPS
] = {
5819 .type
= HDA_FIXUP_VERBS
,
5820 .v
.verbs
= (const struct hda_verb
[]) {
5821 /* Enables internal speaker */
5822 {0x20, AC_VERB_SET_COEF_INDEX
, 0x1f},
5823 {0x20, AC_VERB_SET_PROC_COEF
, 0x00c0},
5824 {0x20, AC_VERB_SET_COEF_INDEX
, 0x30},
5825 {0x20, AC_VERB_SET_PROC_COEF
, 0x00b1},
5829 [ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
] = {
5830 .type
= HDA_FIXUP_VERBS
,
5831 .v
.verbs
= (const struct hda_verb
[]) {
5832 /* Disable pass-through path for FRONT 14h */
5833 {0x20, AC_VERB_SET_COEF_INDEX
, 0x36},
5834 {0x20, AC_VERB_SET_PROC_COEF
, 0x1737},
5838 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5840 [ALC293_FIXUP_LENOVO_SPK_NOISE
] = {
5841 .type
= HDA_FIXUP_FUNC
,
5842 .v
.func
= alc_fixup_disable_aamix
,
5844 .chain_id
= ALC269_FIXUP_THINKPAD_ACPI
5846 [ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
] = {
5847 .type
= HDA_FIXUP_FUNC
,
5848 .v
.func
= alc233_fixup_lenovo_line2_mic_hotkey
,
5850 [ALC255_FIXUP_DELL_SPK_NOISE
] = {
5851 .type
= HDA_FIXUP_FUNC
,
5852 .v
.func
= alc_fixup_disable_aamix
,
5854 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5856 [ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
] = {
5857 .type
= HDA_FIXUP_VERBS
,
5858 .v
.verbs
= (const struct hda_verb
[]) {
5859 /* Disable pass-through path for FRONT 14h */
5860 { 0x20, AC_VERB_SET_COEF_INDEX
, 0x36 },
5861 { 0x20, AC_VERB_SET_PROC_COEF
, 0x57d7 },
5865 .chain_id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
5867 [ALC280_FIXUP_HP_HEADSET_MIC
] = {
5868 .type
= HDA_FIXUP_FUNC
,
5869 .v
.func
= alc_fixup_disable_aamix
,
5871 .chain_id
= ALC269_FIXUP_HEADSET_MIC
,
5873 [ALC221_FIXUP_HP_FRONT_MIC
] = {
5874 .type
= HDA_FIXUP_PINS
,
5875 .v
.pins
= (const struct hda_pintbl
[]) {
5876 { 0x19, 0x02a19020 }, /* Front Mic */
5880 [ALC292_FIXUP_TPT460
] = {
5881 .type
= HDA_FIXUP_FUNC
,
5882 .v
.func
= alc_fixup_tpt440_dock
,
5884 .chain_id
= ALC293_FIXUP_LENOVO_SPK_NOISE
,
5886 [ALC298_FIXUP_SPK_VOLUME
] = {
5887 .type
= HDA_FIXUP_FUNC
,
5888 .v
.func
= alc298_fixup_speaker_volume
,
5890 .chain_id
= ALC298_FIXUP_DELL_AIO_MIC_NO_PRESENCE
,
5892 [ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
] = {
5893 .type
= HDA_FIXUP_PINS
,
5894 .v
.pins
= (const struct hda_pintbl
[]) {
5895 { 0x1b, 0x90170151 },
5899 .chain_id
= ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
5901 [ALC269_FIXUP_ATIV_BOOK_8
] = {
5902 .type
= HDA_FIXUP_FUNC
,
5903 .v
.func
= alc_fixup_auto_mute_via_amp
,
5905 .chain_id
= ALC269_FIXUP_NO_SHUTUP
5907 [ALC221_FIXUP_HP_MIC_NO_PRESENCE
] = {
5908 .type
= HDA_FIXUP_PINS
,
5909 .v
.pins
= (const struct hda_pintbl
[]) {
5910 { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5911 { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
5915 .chain_id
= ALC269_FIXUP_HEADSET_MODE
5917 [ALC256_FIXUP_ASUS_HEADSET_MODE
] = {
5918 .type
= HDA_FIXUP_FUNC
,
5919 .v
.func
= alc_fixup_headset_mode
,
5921 [ALC256_FIXUP_ASUS_MIC
] = {
5922 .type
= HDA_FIXUP_PINS
,
5923 .v
.pins
= (const struct hda_pintbl
[]) {
5924 { 0x13, 0x90a60160 }, /* use as internal mic */
5925 { 0x19, 0x04a11120 }, /* use as headset mic, without its own jack detect */
5929 .chain_id
= ALC256_FIXUP_ASUS_HEADSET_MODE
5931 [ALC256_FIXUP_ASUS_AIO_GPIO2
] = {
5932 .type
= HDA_FIXUP_VERBS
,
5933 .v
.verbs
= (const struct hda_verb
[]) {
5934 /* Set up GPIO2 for the speaker amp */
5935 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x04 },
5936 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x04 },
5937 { 0x01, AC_VERB_SET_GPIO_DATA
, 0x04 },
5941 [ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
] = {
5942 .type
= HDA_FIXUP_PINS
,
5943 .v
.pins
= (const struct hda_pintbl
[]) {
5944 { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
5948 .chain_id
= ALC269_FIXUP_HEADSET_MIC
5950 [ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
] = {
5951 .type
= HDA_FIXUP_VERBS
,
5952 .v
.verbs
= (const struct hda_verb
[]) {
5953 /* Enables internal speaker */
5954 {0x20, AC_VERB_SET_COEF_INDEX
, 0x40},
5955 {0x20, AC_VERB_SET_PROC_COEF
, 0x8800},
5959 .chain_id
= ALC233_FIXUP_ASUS_MIC_NO_PRESENCE
5961 [ALC233_FIXUP_LENOVO_MULTI_CODECS
] = {
5962 .type
= HDA_FIXUP_FUNC
,
5963 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
5967 static const struct snd_pci_quirk alc269_fixup_tbl
[] = {
5968 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC
),
5969 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC
),
5970 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC
),
5971 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700
),
5972 SND_PCI_QUIRK(0x1025, 0x072d, "Acer Aspire V5-571G", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
5973 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC
),
5974 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK
),
5975 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK
),
5976 SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
5977 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572
),
5978 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS
),
5979 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK
),
5980 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z
),
5981 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS
),
5982 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X
),
5983 SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X
),
5984 SND_PCI_QUIRK(0x1028, 0x05ca, "Dell Latitude E7240", ALC292_FIXUP_DELL_E7X
),
5985 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell Latitude E7440", ALC292_FIXUP_DELL_E7X
),
5986 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER
),
5987 SND_PCI_QUIRK(0x1028, 0x05f4, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
5988 SND_PCI_QUIRK(0x1028, 0x05f5, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
5989 SND_PCI_QUIRK(0x1028, 0x05f6, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
),
5990 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
5991 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK
),
5992 SND_PCI_QUIRK(0x1028, 0x062c, "Dell Latitude E5550", ALC292_FIXUP_DELL_E7X
),
5993 SND_PCI_QUIRK(0x1028, 0x062e, "Dell Latitude E7450", ALC292_FIXUP_DELL_E7X
),
5994 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK
),
5995 SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5996 SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
5997 SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13
),
5998 SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
5999 SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK
),
6000 SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
),
6001 SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6002 SND_PCI_QUIRK(0x1028, 0x06da, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6003 SND_PCI_QUIRK(0x1028, 0x06db, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6004 SND_PCI_QUIRK(0x1028, 0x06dd, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6005 SND_PCI_QUIRK(0x1028, 0x06de, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6006 SND_PCI_QUIRK(0x1028, 0x06df, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6007 SND_PCI_QUIRK(0x1028, 0x06e0, "Dell", ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK
),
6008 SND_PCI_QUIRK(0x1028, 0x0704, "Dell XPS 13 9350", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6009 SND_PCI_QUIRK(0x1028, 0x0706, "Dell Inspiron 7559", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6010 SND_PCI_QUIRK(0x1028, 0x0725, "Dell Inspiron 3162", ALC255_FIXUP_DELL_SPK_NOISE
),
6011 SND_PCI_QUIRK(0x1028, 0x075b, "Dell XPS 13 9360", ALC256_FIXUP_DELL_XPS_13_HEADPHONE_NOISE
),
6012 SND_PCI_QUIRK(0x1028, 0x075d, "Dell AIO", ALC298_FIXUP_SPK_VOLUME
),
6013 SND_PCI_QUIRK(0x1028, 0x0798, "Dell Inspiron 17 7000 Gaming", ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER
),
6014 SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6015 SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
),
6016 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2
),
6017 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED
),
6018 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED
),
6019 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY
),
6021 SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6022 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6023 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6024 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6025 SND_PCI_QUIRK(0x103c, 0x2237, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6026 SND_PCI_QUIRK(0x103c, 0x2238, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6027 SND_PCI_QUIRK(0x103c, 0x2239, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6028 SND_PCI_QUIRK(0x103c, 0x224b, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
),
6029 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6030 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6031 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6032 SND_PCI_QUIRK(0x103c, 0x226e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6033 SND_PCI_QUIRK(0x103c, 0x2271, "HP", ALC286_FIXUP_HP_GPIO_LED
),
6034 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6035 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC280_FIXUP_HP_DOCK_PINS
),
6036 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6037 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6038 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6039 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6040 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6041 SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_9480M
),
6042 SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6043 SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6045 SND_PCI_QUIRK(0x103c, 0x221b, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6046 SND_PCI_QUIRK(0x103c, 0x2221, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6047 SND_PCI_QUIRK(0x103c, 0x2225, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6048 SND_PCI_QUIRK(0x103c, 0x2253, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6049 SND_PCI_QUIRK(0x103c, 0x2254, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6050 SND_PCI_QUIRK(0x103c, 0x2255, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6051 SND_PCI_QUIRK(0x103c, 0x2256, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6052 SND_PCI_QUIRK(0x103c, 0x2257, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6053 SND_PCI_QUIRK(0x103c, 0x2259, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6054 SND_PCI_QUIRK(0x103c, 0x225a, "HP", ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
),
6055 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6056 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6057 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6058 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6059 SND_PCI_QUIRK(0x103c, 0x2272, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6060 SND_PCI_QUIRK(0x103c, 0x2273, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6061 SND_PCI_QUIRK(0x103c, 0x2278, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
),
6062 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6063 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6064 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6065 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6066 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6067 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6068 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6069 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6070 SND_PCI_QUIRK(0x103c, 0x2334, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6071 SND_PCI_QUIRK(0x103c, 0x2335, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6072 SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6073 SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
),
6074 SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC
),
6075 SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC
),
6076 SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6077 SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE
),
6078 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6079 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300
),
6080 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6081 SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC
),
6082 SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6083 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6084 SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6085 SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6086 SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE
),
6087 SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC
),
6088 SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC
),
6089 SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC
),
6090 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK
),
6091 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A
),
6092 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC
),
6093 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW
),
6094 SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC
),
6095 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC
),
6096 SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
),
6097 SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6098 SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC
),
6099 SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2
),
6100 SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC
),
6101 SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC
),
6102 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6103 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC
),
6104 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101
),
6105 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6106 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE
),
6107 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2
),
6108 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6109 SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ
),
6110 SND_PCI_QUIRK(0x104d, 0x9099, "Sony VAIO S13", ALC275_FIXUP_SONY_DISABLE_AAMIX
),
6111 SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook", ALC269_FIXUP_LIFEBOOK
),
6112 SND_PCI_QUIRK(0x10cf, 0x159f, "Lifebook E780", ALC269_FIXUP_LIFEBOOK_NO_HP_TO_LINEOUT
),
6113 SND_PCI_QUIRK(0x10cf, 0x15dc, "Lifebook T731", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6114 SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN
),
6115 SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC
),
6116 SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC
),
6117 SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8
),
6118 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC
),
6119 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC
),
6120 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS
),
6121 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE
),
6122 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE
),
6123 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE
),
6124 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE
),
6125 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE
),
6126 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK
),
6127 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK
),
6128 SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK
),
6129 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK
),
6130 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK
),
6131 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK
),
6132 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440
),
6133 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK
),
6134 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK
),
6135 SND_PCI_QUIRK(0x17aa, 0x2211, "Thinkpad W541", ALC292_FIXUP_TPT440_DOCK
),
6136 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad T440", ALC292_FIXUP_TPT440_DOCK
),
6137 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad X240", ALC292_FIXUP_TPT440_DOCK
),
6138 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6139 SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK
),
6140 SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK
),
6141 SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK
),
6142 SND_PCI_QUIRK(0x17aa, 0x2231, "Thinkpad T560", ALC292_FIXUP_TPT460
),
6143 SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460
),
6144 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6145 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6146 SND_PCI_QUIRK(0x17aa, 0x3112, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY
),
6147 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI
),
6148 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC
),
6149 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP
),
6150 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6151 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC
),
6152 SND_PCI_QUIRK(0x17aa, 0x501e, "Thinkpad L440", ALC292_FIXUP_TPT440_DOCK
),
6153 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6154 SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK
),
6155 SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK
),
6156 SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK
),
6157 SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK
),
6158 SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE
),
6159 SND_PCI_QUIRK(0x17aa, 0x5050, "Thinkpad T560p", ALC292_FIXUP_TPT460
),
6160 SND_PCI_QUIRK(0x17aa, 0x5051, "Thinkpad L460", ALC292_FIXUP_TPT460
),
6161 SND_PCI_QUIRK(0x17aa, 0x5053, "Thinkpad T460", ALC292_FIXUP_TPT460
),
6162 SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST
),
6163 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K
),
6164 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD
),
6165 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2
), /* Also known as Malata PC-B1303 */
6168 /* Below is a quirk table taken from the old code.
6169 * Basically the device should work as is without the fixup table.
6170 * If BIOS doesn't give a proper info, enable the corresponding
6173 SND_PCI_QUIRK(0x1043, 0x8330, "ASUS Eeepc P703 P900A",
6175 SND_PCI_QUIRK(0x1043, 0x1013, "ASUS N61Da", ALC269_FIXUP_AMIC
),
6176 SND_PCI_QUIRK(0x1043, 0x1143, "ASUS B53f", ALC269_FIXUP_AMIC
),
6177 SND_PCI_QUIRK(0x1043, 0x1133, "ASUS UJ20ft", ALC269_FIXUP_AMIC
),
6178 SND_PCI_QUIRK(0x1043, 0x1183, "ASUS K72DR", ALC269_FIXUP_AMIC
),
6179 SND_PCI_QUIRK(0x1043, 0x11b3, "ASUS K52DR", ALC269_FIXUP_AMIC
),
6180 SND_PCI_QUIRK(0x1043, 0x11e3, "ASUS U33Jc", ALC269_FIXUP_AMIC
),
6181 SND_PCI_QUIRK(0x1043, 0x1273, "ASUS UL80Jt", ALC269_FIXUP_AMIC
),
6182 SND_PCI_QUIRK(0x1043, 0x1283, "ASUS U53Jc", ALC269_FIXUP_AMIC
),
6183 SND_PCI_QUIRK(0x1043, 0x12b3, "ASUS N82JV", ALC269_FIXUP_AMIC
),
6184 SND_PCI_QUIRK(0x1043, 0x12d3, "ASUS N61Jv", ALC269_FIXUP_AMIC
),
6185 SND_PCI_QUIRK(0x1043, 0x13a3, "ASUS UL30Vt", ALC269_FIXUP_AMIC
),
6186 SND_PCI_QUIRK(0x1043, 0x1373, "ASUS G73JX", ALC269_FIXUP_AMIC
),
6187 SND_PCI_QUIRK(0x1043, 0x1383, "ASUS UJ30Jc", ALC269_FIXUP_AMIC
),
6188 SND_PCI_QUIRK(0x1043, 0x13d3, "ASUS N61JA", ALC269_FIXUP_AMIC
),
6189 SND_PCI_QUIRK(0x1043, 0x1413, "ASUS UL50", ALC269_FIXUP_AMIC
),
6190 SND_PCI_QUIRK(0x1043, 0x1443, "ASUS UL30", ALC269_FIXUP_AMIC
),
6191 SND_PCI_QUIRK(0x1043, 0x1453, "ASUS M60Jv", ALC269_FIXUP_AMIC
),
6192 SND_PCI_QUIRK(0x1043, 0x1483, "ASUS UL80", ALC269_FIXUP_AMIC
),
6193 SND_PCI_QUIRK(0x1043, 0x14f3, "ASUS F83Vf", ALC269_FIXUP_AMIC
),
6194 SND_PCI_QUIRK(0x1043, 0x14e3, "ASUS UL20", ALC269_FIXUP_AMIC
),
6195 SND_PCI_QUIRK(0x1043, 0x1513, "ASUS UX30", ALC269_FIXUP_AMIC
),
6196 SND_PCI_QUIRK(0x1043, 0x1593, "ASUS N51Vn", ALC269_FIXUP_AMIC
),
6197 SND_PCI_QUIRK(0x1043, 0x15a3, "ASUS N60Jv", ALC269_FIXUP_AMIC
),
6198 SND_PCI_QUIRK(0x1043, 0x15b3, "ASUS N60Dp", ALC269_FIXUP_AMIC
),
6199 SND_PCI_QUIRK(0x1043, 0x15c3, "ASUS N70De", ALC269_FIXUP_AMIC
),
6200 SND_PCI_QUIRK(0x1043, 0x15e3, "ASUS F83T", ALC269_FIXUP_AMIC
),
6201 SND_PCI_QUIRK(0x1043, 0x1643, "ASUS M60J", ALC269_FIXUP_AMIC
),
6202 SND_PCI_QUIRK(0x1043, 0x1653, "ASUS U50", ALC269_FIXUP_AMIC
),
6203 SND_PCI_QUIRK(0x1043, 0x1693, "ASUS F50N", ALC269_FIXUP_AMIC
),
6204 SND_PCI_QUIRK(0x1043, 0x16a3, "ASUS F5Q", ALC269_FIXUP_AMIC
),
6205 SND_PCI_QUIRK(0x1043, 0x1723, "ASUS P80", ALC269_FIXUP_AMIC
),
6206 SND_PCI_QUIRK(0x1043, 0x1743, "ASUS U80", ALC269_FIXUP_AMIC
),
6207 SND_PCI_QUIRK(0x1043, 0x1773, "ASUS U20A", ALC269_FIXUP_AMIC
),
6208 SND_PCI_QUIRK(0x1043, 0x1883, "ASUS F81Se", ALC269_FIXUP_AMIC
),
6209 SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_FIXUP_DMIC
),
6210 SND_PCI_QUIRK(0x17aa, 0x3be9, "Quanta Wistron", ALC269_FIXUP_AMIC
),
6211 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_AMIC
),
6212 SND_PCI_QUIRK(0x17ff, 0x059a, "Quanta EL3", ALC269_FIXUP_DMIC
),
6213 SND_PCI_QUIRK(0x17ff, 0x059b, "Quanta JR1", ALC269_FIXUP_DMIC
),
6218 static const struct snd_pci_quirk alc269_fixup_vendor_tbl
[] = {
6219 SND_PCI_QUIRK_VENDOR(0x1025, "Acer Aspire", ALC271_FIXUP_DMIC
),
6220 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED
),
6221 SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO
),
6222 SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad", ALC269_FIXUP_THINKPAD_ACPI
),
6226 static const struct hda_model_fixup alc269_fixup_models
[] = {
6227 {.id
= ALC269_FIXUP_AMIC
, .name
= "laptop-amic"},
6228 {.id
= ALC269_FIXUP_DMIC
, .name
= "laptop-dmic"},
6229 {.id
= ALC269_FIXUP_STEREO_DMIC
, .name
= "alc269-dmic"},
6230 {.id
= ALC271_FIXUP_DMIC
, .name
= "alc271-dmic"},
6231 {.id
= ALC269_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
6232 {.id
= ALC269_FIXUP_HEADSET_MIC
, .name
= "headset-mic"},
6233 {.id
= ALC269_FIXUP_HEADSET_MODE
, .name
= "headset-mode"},
6234 {.id
= ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
, .name
= "headset-mode-no-hp-mic"},
6235 {.id
= ALC269_FIXUP_LENOVO_DOCK
, .name
= "lenovo-dock"},
6236 {.id
= ALC269_FIXUP_HP_GPIO_LED
, .name
= "hp-gpio-led"},
6237 {.id
= ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED
, .name
= "hp-dock-gpio-mic1-led"},
6238 {.id
= ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
6239 {.id
= ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
, .name
= "dell-headset-dock"},
6240 {.id
= ALC283_FIXUP_CHROME_BOOK
, .name
= "alc283-dac-wcaps"},
6241 {.id
= ALC283_FIXUP_SENSE_COMBO_JACK
, .name
= "alc283-sense-combo"},
6242 {.id
= ALC292_FIXUP_TPT440_DOCK
, .name
= "tpt440-dock"},
6243 {.id
= ALC292_FIXUP_TPT440
, .name
= "tpt440"},
6244 {.id
= ALC292_FIXUP_TPT460
, .name
= "tpt460"},
6245 {.id
= ALC233_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
6248 #define ALC225_STANDARD_PINS \
6251 #define ALC256_STANDARD_PINS \
6252 {0x12, 0x90a60140}, \
6253 {0x14, 0x90170110}, \
6256 #define ALC282_STANDARD_PINS \
6259 #define ALC290_STANDARD_PINS \
6262 #define ALC292_STANDARD_PINS \
6263 {0x14, 0x90170110}, \
6266 #define ALC295_STANDARD_PINS \
6267 {0x12, 0xb7a60130}, \
6268 {0x14, 0x90170110}, \
6271 #define ALC298_STANDARD_PINS \
6272 {0x12, 0x90a60130}, \
6275 static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl
[] = {
6276 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1025, "Acer", ALC255_FIXUP_ACER_MIC_NO_PRESENCE
,
6279 {0x21, 0x02211030}),
6280 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6283 {0x21, 0x03211020}),
6284 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1043, "ASUS", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE
,
6287 {0x21, 0x03211020}),
6288 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6289 ALC225_STANDARD_PINS
,
6291 {0x14, 0x901701a0}),
6292 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6293 ALC225_STANDARD_PINS
,
6295 {0x14, 0x901701b0}),
6296 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6297 ALC225_STANDARD_PINS
,
6299 {0x14, 0x901701a0}),
6300 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6301 ALC225_STANDARD_PINS
,
6303 {0x14, 0x901701b0}),
6304 SND_HDA_PIN_QUIRK(0x10ec0225, 0x1028, "Dell", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE
,
6305 ALC225_STANDARD_PINS
,
6307 {0x1b, 0x90170110}),
6308 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE
,
6310 {0x21, 0x02211020}),
6311 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6313 {0x21, 0x02211040}),
6314 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6317 {0x21, 0x02211020}),
6318 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6321 {0x21, 0x02211030}),
6322 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6325 {0x21, 0x0221101f}),
6326 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6329 {0x21, 0x0221101f}),
6330 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6333 {0x21, 0x0221103f}),
6334 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6337 {0x21, 0x0221103f}),
6338 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6341 {0x21, 0x0221103f}),
6342 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6345 {0x21, 0x0221105f}),
6346 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6349 {0x21, 0x0221101f}),
6350 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6354 {0x21, 0x0321102f}),
6355 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6358 {0x21, 0x02211040}),
6359 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6362 {0x21, 0x02211050}),
6363 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6366 {0x21, 0x02211030}),
6367 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6370 {0x21, 0x02211040}),
6371 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6374 {0x21, 0x02211040}),
6375 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6378 {0x21, 0x02211050}),
6379 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5548", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6382 {0x21, 0x02211040}),
6383 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6386 {0x21, 0x02211030}),
6387 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6389 {0x21, 0x02211010}),
6390 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6393 {0x21, 0x02211030}),
6394 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6397 {0x21, 0x02211030}),
6398 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell Inspiron 5468", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6401 {0x21, 0x02211030}),
6402 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6405 {0x21, 0x02211020}),
6406 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE
,
6407 ALC256_STANDARD_PINS
),
6408 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
6411 {0x21, 0x04211020}),
6412 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC
,
6415 {0x21, 0x03211020}),
6416 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4
,
6420 {0x1a, 0x04a11020}),
6421 SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED
,
6427 {0x1b, 0x02011020}),
6428 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP 15 Touchsmart", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6429 ALC282_STANDARD_PINS
,
6432 {0x21, 0x0321101f}),
6433 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6434 ALC282_STANDARD_PINS
,
6437 {0x21, 0x03211040}),
6438 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6439 ALC282_STANDARD_PINS
,
6442 {0x21, 0x03211020}),
6443 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6444 ALC282_STANDARD_PINS
,
6447 {0x21, 0x0421101f}),
6448 SND_HDA_PIN_QUIRK(0x10ec0282, 0x103c, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED
,
6449 ALC282_STANDARD_PINS
,
6452 {0x21, 0x04211020}),
6453 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6454 ALC282_STANDARD_PINS
,
6456 {0x21, 0x0321101f}),
6457 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6460 {0x21, 0x02211030}),
6461 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6462 ALC282_STANDARD_PINS
,
6465 {0x21, 0x0321101f}),
6466 SND_HDA_PIN_QUIRK(0x10ec0288, 0x1028, "Dell", ALC288_FIXUP_DELL_XPS_13_GPIO6
,
6469 {0x21, 0x0321101f}),
6470 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6471 ALC290_STANDARD_PINS
,
6474 {0x1a, 0x04a11020}),
6475 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6476 ALC290_STANDARD_PINS
,
6479 {0x1a, 0x04a11020}),
6480 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6481 ALC290_STANDARD_PINS
,
6483 {0x1a, 0x04a11020}),
6484 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6485 ALC290_STANDARD_PINS
,
6487 {0x1a, 0x04a11040}),
6488 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6489 ALC290_STANDARD_PINS
,
6492 {0x1a, 0x04a11040}),
6493 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6494 ALC290_STANDARD_PINS
,
6497 {0x1a, 0x04a11020}),
6498 SND_HDA_PIN_QUIRK(0x10ec0290, 0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1
,
6499 ALC290_STANDARD_PINS
,
6502 {0x1a, 0x04a11020}),
6503 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
6504 ALC292_STANDARD_PINS
,
6507 {0x19, 0x01a19030}),
6508 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE
,
6509 ALC292_STANDARD_PINS
,
6513 {0x19, 0x01a1903e}),
6514 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE
,
6515 ALC292_STANDARD_PINS
,
6516 {0x12, 0x90a60140}),
6517 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
6518 ALC292_STANDARD_PINS
,
6521 {0x19, 0x21a19030}),
6522 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE
,
6523 ALC292_STANDARD_PINS
,
6524 {0x13, 0x90a60140}),
6525 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6526 ALC295_STANDARD_PINS
,
6528 {0x18, 0x21a19030}),
6529 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6530 ALC295_STANDARD_PINS
,
6532 {0x18, 0x21a19050}),
6533 SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE
,
6534 ALC295_STANDARD_PINS
),
6535 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6536 ALC298_STANDARD_PINS
,
6537 {0x17, 0x90170110}),
6538 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6539 ALC298_STANDARD_PINS
,
6540 {0x17, 0x90170140}),
6541 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE
,
6542 ALC298_STANDARD_PINS
,
6543 {0x17, 0x90170150}),
6544 SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_SPK_VOLUME
,
6549 {0x21, 0x03211030}),
6550 SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
,
6551 ALC225_STANDARD_PINS
,
6554 {0x17, 0x90170110}),
6558 static void alc269_fill_coef(struct hda_codec
*codec
)
6560 struct alc_spec
*spec
= codec
->spec
;
6563 if (spec
->codec_variant
!= ALC269_TYPE_ALC269VB
)
6566 if ((alc_get_coef0(codec
) & 0x00ff) < 0x015) {
6567 alc_write_coef_idx(codec
, 0xf, 0x960b);
6568 alc_write_coef_idx(codec
, 0xe, 0x8817);
6571 if ((alc_get_coef0(codec
) & 0x00ff) == 0x016) {
6572 alc_write_coef_idx(codec
, 0xf, 0x960b);
6573 alc_write_coef_idx(codec
, 0xe, 0x8814);
6576 if ((alc_get_coef0(codec
) & 0x00ff) == 0x017) {
6577 /* Power up output pin */
6578 alc_update_coef_idx(codec
, 0x04, 0, 1<<11);
6581 if ((alc_get_coef0(codec
) & 0x00ff) == 0x018) {
6582 val
= alc_read_coef_idx(codec
, 0xd);
6583 if (val
!= -1 && (val
& 0x0c00) >> 10 != 0x1) {
6584 /* Capless ramp up clock control */
6585 alc_write_coef_idx(codec
, 0xd, val
| (1<<10));
6587 val
= alc_read_coef_idx(codec
, 0x17);
6588 if (val
!= -1 && (val
& 0x01c0) >> 6 != 0x4) {
6589 /* Class D power on reset */
6590 alc_write_coef_idx(codec
, 0x17, val
| (1<<7));
6595 alc_update_coef_idx(codec
, 0x4, 0, 1<<11);
6600 static int patch_alc269(struct hda_codec
*codec
)
6602 struct alc_spec
*spec
;
6605 err
= alc_alloc_spec(codec
, 0x0b);
6610 spec
->gen
.shared_mic_vref_pin
= 0x18;
6611 codec
->power_save_node
= 1;
6614 codec
->patch_ops
.suspend
= alc269_suspend
;
6615 codec
->patch_ops
.resume
= alc269_resume
;
6617 spec
->shutup
= alc_default_shutup
;
6618 spec
->init_hook
= alc_default_init
;
6620 snd_hda_pick_fixup(codec
, alc269_fixup_models
,
6621 alc269_fixup_tbl
, alc269_fixups
);
6622 snd_hda_pick_pin_fixup(codec
, alc269_pin_fixup_tbl
, alc269_fixups
);
6623 snd_hda_pick_fixup(codec
, NULL
, alc269_fixup_vendor_tbl
,
6625 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6627 alc_auto_parse_customize_define(codec
);
6629 if (has_cdefine_beep(codec
))
6630 spec
->gen
.beep_nid
= 0x01;
6632 switch (codec
->core
.vendor_id
) {
6634 spec
->codec_variant
= ALC269_TYPE_ALC269VA
;
6635 switch (alc_get_coef0(codec
) & 0x00f0) {
6637 if (codec
->bus
->pci
&&
6638 codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
6639 spec
->cdefine
.platform_type
== 1)
6640 err
= alc_codec_rename(codec
, "ALC271X");
6641 spec
->codec_variant
= ALC269_TYPE_ALC269VB
;
6644 if (codec
->bus
->pci
&&
6645 codec
->bus
->pci
->subsystem_vendor
== 0x17aa &&
6646 codec
->bus
->pci
->subsystem_device
== 0x21f3)
6647 err
= alc_codec_rename(codec
, "ALC3202");
6648 spec
->codec_variant
= ALC269_TYPE_ALC269VC
;
6651 spec
->codec_variant
= ALC269_TYPE_ALC269VD
;
6654 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
6658 spec
->shutup
= alc269_shutup
;
6659 spec
->init_hook
= alc269_fill_coef
;
6660 alc269_fill_coef(codec
);
6665 spec
->codec_variant
= ALC269_TYPE_ALC280
;
6668 spec
->codec_variant
= ALC269_TYPE_ALC282
;
6669 spec
->shutup
= alc282_shutup
;
6670 spec
->init_hook
= alc282_init
;
6674 spec
->codec_variant
= ALC269_TYPE_ALC283
;
6675 spec
->shutup
= alc283_shutup
;
6676 spec
->init_hook
= alc283_init
;
6680 spec
->codec_variant
= ALC269_TYPE_ALC284
;
6683 spec
->codec_variant
= ALC269_TYPE_ALC293
;
6687 spec
->codec_variant
= ALC269_TYPE_ALC286
;
6688 spec
->shutup
= alc286_shutup
;
6691 spec
->codec_variant
= ALC269_TYPE_ALC298
;
6694 spec
->codec_variant
= ALC269_TYPE_ALC255
;
6697 spec
->codec_variant
= ALC269_TYPE_ALC256
;
6698 spec
->shutup
= alc256_shutup
;
6699 spec
->init_hook
= alc256_init
;
6700 spec
->gen
.mixer_nid
= 0; /* ALC256 does not have any loopback mixer path */
6701 alc_update_coef_idx(codec
, 0x36, 1 << 13, 1 << 5); /* Switch pcbeep path to Line in path*/
6706 spec
->codec_variant
= ALC269_TYPE_ALC215
;
6707 spec
->gen
.mixer_nid
= 0;
6711 spec
->codec_variant
= ALC269_TYPE_ALC225
;
6714 spec
->codec_variant
= ALC269_TYPE_ALC225
;
6715 spec
->gen
.mixer_nid
= 0; /* no loopback on ALC299 */
6720 spec
->codec_variant
= ALC269_TYPE_ALC294
;
6721 spec
->gen
.mixer_nid
= 0; /* ALC2x4 does not have any loopback mixer path */
6722 alc_update_coef_idx(codec
, 0x6b, 0x0018, (1<<4) | (1<<3)); /* UAJ MIC Vref control by verb */
6727 spec
->codec_variant
= ALC269_TYPE_ALC700
;
6728 spec
->gen
.mixer_nid
= 0; /* ALC700 does not have any loopback mixer path */
6729 alc_update_coef_idx(codec
, 0x4a, 0, 1 << 15); /* Combo jack auto trigger control */
6734 if (snd_hda_codec_read(codec
, 0x51, 0, AC_VERB_PARAMETERS
, 0) == 0x10ec5505) {
6735 spec
->has_alc5505_dsp
= 1;
6736 spec
->init_hook
= alc5505_dsp_init
;
6739 /* automatic parse from the BIOS config */
6740 err
= alc269_parse_auto_config(codec
);
6744 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
&& spec
->gen
.mixer_nid
)
6745 set_beep_amp(spec
, spec
->gen
.mixer_nid
, 0x04, HDA_INPUT
);
6747 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6760 static int alc861_parse_auto_config(struct hda_codec
*codec
)
6762 static const hda_nid_t alc861_ignore
[] = { 0x1d, 0 };
6763 static const hda_nid_t alc861_ssids
[] = { 0x0e, 0x0f, 0x0b, 0 };
6764 return alc_parse_auto_config(codec
, alc861_ignore
, alc861_ssids
);
6767 /* Pin config fixes */
6769 ALC861_FIXUP_FSC_AMILO_PI1505
,
6770 ALC861_FIXUP_AMP_VREF_0F
,
6771 ALC861_FIXUP_NO_JACK_DETECT
,
6772 ALC861_FIXUP_ASUS_A6RP
,
6773 ALC660_FIXUP_ASUS_W7J
,
6776 /* On some laptops, VREF of pin 0x0f is abused for controlling the main amp */
6777 static void alc861_fixup_asus_amp_vref_0f(struct hda_codec
*codec
,
6778 const struct hda_fixup
*fix
, int action
)
6780 struct alc_spec
*spec
= codec
->spec
;
6783 if (action
!= HDA_FIXUP_ACT_INIT
)
6785 val
= snd_hda_codec_get_pin_target(codec
, 0x0f);
6786 if (!(val
& (AC_PINCTL_IN_EN
| AC_PINCTL_OUT_EN
)))
6787 val
|= AC_PINCTL_IN_EN
;
6788 val
|= AC_PINCTL_VREF_50
;
6789 snd_hda_set_pin_ctl(codec
, 0x0f, val
);
6790 spec
->gen
.keep_vref_in_automute
= 1;
6793 /* suppress the jack-detection */
6794 static void alc_fixup_no_jack_detect(struct hda_codec
*codec
,
6795 const struct hda_fixup
*fix
, int action
)
6797 if (action
== HDA_FIXUP_ACT_PRE_PROBE
)
6798 codec
->no_jack_detect
= 1;
6801 static const struct hda_fixup alc861_fixups
[] = {
6802 [ALC861_FIXUP_FSC_AMILO_PI1505
] = {
6803 .type
= HDA_FIXUP_PINS
,
6804 .v
.pins
= (const struct hda_pintbl
[]) {
6805 { 0x0b, 0x0221101f }, /* HP */
6806 { 0x0f, 0x90170310 }, /* speaker */
6810 [ALC861_FIXUP_AMP_VREF_0F
] = {
6811 .type
= HDA_FIXUP_FUNC
,
6812 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
6814 [ALC861_FIXUP_NO_JACK_DETECT
] = {
6815 .type
= HDA_FIXUP_FUNC
,
6816 .v
.func
= alc_fixup_no_jack_detect
,
6818 [ALC861_FIXUP_ASUS_A6RP
] = {
6819 .type
= HDA_FIXUP_FUNC
,
6820 .v
.func
= alc861_fixup_asus_amp_vref_0f
,
6822 .chain_id
= ALC861_FIXUP_NO_JACK_DETECT
,
6824 [ALC660_FIXUP_ASUS_W7J
] = {
6825 .type
= HDA_FIXUP_VERBS
,
6826 .v
.verbs
= (const struct hda_verb
[]) {
6827 /* ASUS W7J needs a magic pin setup on unused NID 0x10
6828 * for enabling outputs
6830 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL
, 0x24},
6836 static const struct snd_pci_quirk alc861_fixup_tbl
[] = {
6837 SND_PCI_QUIRK(0x1043, 0x1253, "ASUS W7J", ALC660_FIXUP_ASUS_W7J
),
6838 SND_PCI_QUIRK(0x1043, 0x1263, "ASUS Z35HL", ALC660_FIXUP_ASUS_W7J
),
6839 SND_PCI_QUIRK(0x1043, 0x1393, "ASUS A6Rp", ALC861_FIXUP_ASUS_A6RP
),
6840 SND_PCI_QUIRK_VENDOR(0x1043, "ASUS laptop", ALC861_FIXUP_AMP_VREF_0F
),
6841 SND_PCI_QUIRK(0x1462, 0x7254, "HP DX2200", ALC861_FIXUP_NO_JACK_DETECT
),
6842 SND_PCI_QUIRK(0x1584, 0x2b01, "Haier W18", ALC861_FIXUP_AMP_VREF_0F
),
6843 SND_PCI_QUIRK(0x1584, 0x0000, "Uniwill ECS M31EI", ALC861_FIXUP_AMP_VREF_0F
),
6844 SND_PCI_QUIRK(0x1734, 0x10c7, "FSC Amilo Pi1505", ALC861_FIXUP_FSC_AMILO_PI1505
),
6850 static int patch_alc861(struct hda_codec
*codec
)
6852 struct alc_spec
*spec
;
6855 err
= alc_alloc_spec(codec
, 0x15);
6860 spec
->gen
.beep_nid
= 0x23;
6863 spec
->power_hook
= alc_power_eapd
;
6866 snd_hda_pick_fixup(codec
, NULL
, alc861_fixup_tbl
, alc861_fixups
);
6867 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6869 /* automatic parse from the BIOS config */
6870 err
= alc861_parse_auto_config(codec
);
6874 if (!spec
->gen
.no_analog
)
6875 set_beep_amp(spec
, 0x23, 0, HDA_OUTPUT
);
6877 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6891 * In addition, an independent DAC
6893 static int alc861vd_parse_auto_config(struct hda_codec
*codec
)
6895 static const hda_nid_t alc861vd_ignore
[] = { 0x1d, 0 };
6896 static const hda_nid_t alc861vd_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
6897 return alc_parse_auto_config(codec
, alc861vd_ignore
, alc861vd_ssids
);
6901 ALC660VD_FIX_ASUS_GPIO1
,
6902 ALC861VD_FIX_DALLAS
,
6905 /* exclude VREF80 */
6906 static void alc861vd_fixup_dallas(struct hda_codec
*codec
,
6907 const struct hda_fixup
*fix
, int action
)
6909 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
6910 snd_hda_override_pin_caps(codec
, 0x18, 0x00000734);
6911 snd_hda_override_pin_caps(codec
, 0x19, 0x0000073c);
6915 static const struct hda_fixup alc861vd_fixups
[] = {
6916 [ALC660VD_FIX_ASUS_GPIO1
] = {
6917 .type
= HDA_FIXUP_VERBS
,
6918 .v
.verbs
= (const struct hda_verb
[]) {
6920 {0x01, AC_VERB_SET_GPIO_MASK
, 0x03},
6921 {0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01},
6922 {0x01, AC_VERB_SET_GPIO_DATA
, 0x01},
6926 [ALC861VD_FIX_DALLAS
] = {
6927 .type
= HDA_FIXUP_FUNC
,
6928 .v
.func
= alc861vd_fixup_dallas
,
6932 static const struct snd_pci_quirk alc861vd_fixup_tbl
[] = {
6933 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_FIX_DALLAS
),
6934 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1
),
6935 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba L30-149", ALC861VD_FIX_DALLAS
),
6941 static int patch_alc861vd(struct hda_codec
*codec
)
6943 struct alc_spec
*spec
;
6946 err
= alc_alloc_spec(codec
, 0x0b);
6951 spec
->gen
.beep_nid
= 0x23;
6953 spec
->shutup
= alc_eapd_shutup
;
6955 snd_hda_pick_fixup(codec
, NULL
, alc861vd_fixup_tbl
, alc861vd_fixups
);
6956 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
6958 /* automatic parse from the BIOS config */
6959 err
= alc861vd_parse_auto_config(codec
);
6963 if (!spec
->gen
.no_analog
)
6964 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
6966 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
6978 * ALC662 is almost identical with ALC880 but has cleaner and more flexible
6979 * configuration. Each pin widget can choose any input DACs and a mixer.
6980 * Each ADC is connected from a mixer of all inputs. This makes possible
6981 * 6-channel independent captures.
6983 * In addition, an independent DAC for the multi-playback (not used in this
6988 * BIOS auto configuration
6991 static int alc662_parse_auto_config(struct hda_codec
*codec
)
6993 static const hda_nid_t alc662_ignore
[] = { 0x1d, 0 };
6994 static const hda_nid_t alc663_ssids
[] = { 0x15, 0x1b, 0x14, 0x21 };
6995 static const hda_nid_t alc662_ssids
[] = { 0x15, 0x1b, 0x14, 0 };
6996 const hda_nid_t
*ssids
;
6998 if (codec
->core
.vendor_id
== 0x10ec0272 || codec
->core
.vendor_id
== 0x10ec0663 ||
6999 codec
->core
.vendor_id
== 0x10ec0665 || codec
->core
.vendor_id
== 0x10ec0670 ||
7000 codec
->core
.vendor_id
== 0x10ec0671)
7001 ssids
= alc663_ssids
;
7003 ssids
= alc662_ssids
;
7004 return alc_parse_auto_config(codec
, alc662_ignore
, ssids
);
7007 static void alc272_fixup_mario(struct hda_codec
*codec
,
7008 const struct hda_fixup
*fix
, int action
)
7010 if (action
!= HDA_FIXUP_ACT_PRE_PROBE
)
7012 if (snd_hda_override_amp_caps(codec
, 0x2, HDA_OUTPUT
,
7013 (0x3b << AC_AMPCAP_OFFSET_SHIFT
) |
7014 (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT
) |
7015 (0x03 << AC_AMPCAP_STEP_SIZE_SHIFT
) |
7016 (0 << AC_AMPCAP_MUTE_SHIFT
)))
7017 codec_warn(codec
, "failed to override amp caps for NID 0x2\n");
7020 static const struct snd_pcm_chmap_elem asus_pcm_2_1_chmaps
[] = {
7022 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
} },
7024 .map
= { SNDRV_CHMAP_FL
, SNDRV_CHMAP_FR
,
7025 SNDRV_CHMAP_NA
, SNDRV_CHMAP_LFE
} }, /* LFE only on right */
7029 /* override the 2.1 chmap */
7030 static void alc_fixup_bass_chmap(struct hda_codec
*codec
,
7031 const struct hda_fixup
*fix
, int action
)
7033 if (action
== HDA_FIXUP_ACT_BUILD
) {
7034 struct alc_spec
*spec
= codec
->spec
;
7035 spec
->gen
.pcm_rec
[0]->stream
[0].chmap
= asus_pcm_2_1_chmaps
;
7039 /* avoid D3 for keeping GPIO up */
7040 static unsigned int gpio_led_power_filter(struct hda_codec
*codec
,
7042 unsigned int power_state
)
7044 struct alc_spec
*spec
= codec
->spec
;
7045 if (nid
== codec
->core
.afg
&& power_state
== AC_PWRST_D3
&& spec
->gpio_led
)
7050 static void alc662_fixup_led_gpio1(struct hda_codec
*codec
,
7051 const struct hda_fixup
*fix
, int action
)
7053 struct alc_spec
*spec
= codec
->spec
;
7054 static const struct hda_verb gpio_init
[] = {
7055 { 0x01, AC_VERB_SET_GPIO_MASK
, 0x01 },
7056 { 0x01, AC_VERB_SET_GPIO_DIRECTION
, 0x01 },
7060 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7061 spec
->gen
.vmaster_mute
.hook
= alc_fixup_gpio_mute_hook
;
7063 spec
->mute_led_polarity
= 1;
7064 spec
->gpio_mute_led_mask
= 0x01;
7065 snd_hda_add_verbs(codec
, gpio_init
);
7066 codec
->power_filter
= gpio_led_power_filter
;
7070 static void alc662_usi_automute_hook(struct hda_codec
*codec
,
7071 struct hda_jack_callback
*jack
)
7073 struct alc_spec
*spec
= codec
->spec
;
7076 snd_hda_gen_hp_automute(codec
, jack
);
7078 vref
= spec
->gen
.hp_jack_present
? PIN_VREF80
: 0;
7080 snd_hda_codec_write(codec
, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL
,
7084 static void alc662_fixup_usi_headset_mic(struct hda_codec
*codec
,
7085 const struct hda_fixup
*fix
, int action
)
7087 struct alc_spec
*spec
= codec
->spec
;
7088 if (action
== HDA_FIXUP_ACT_PRE_PROBE
) {
7089 spec
->parse_flags
|= HDA_PINCFG_HEADSET_MIC
;
7090 spec
->gen
.hp_automute_hook
= alc662_usi_automute_hook
;
7094 static struct coef_fw alc668_coefs
[] = {
7095 WRITE_COEF(0x01, 0xbebe), WRITE_COEF(0x02, 0xaaaa), WRITE_COEF(0x03, 0x0),
7096 WRITE_COEF(0x04, 0x0180), WRITE_COEF(0x06, 0x0), WRITE_COEF(0x07, 0x0f80),
7097 WRITE_COEF(0x08, 0x0031), WRITE_COEF(0x0a, 0x0060), WRITE_COEF(0x0b, 0x0),
7098 WRITE_COEF(0x0c, 0x7cf7), WRITE_COEF(0x0d, 0x1080), WRITE_COEF(0x0e, 0x7f7f),
7099 WRITE_COEF(0x0f, 0xcccc), WRITE_COEF(0x10, 0xddcc), WRITE_COEF(0x11, 0x0001),
7100 WRITE_COEF(0x13, 0x0), WRITE_COEF(0x14, 0x2aa0), WRITE_COEF(0x17, 0xa940),
7101 WRITE_COEF(0x19, 0x0), WRITE_COEF(0x1a, 0x0), WRITE_COEF(0x1b, 0x0),
7102 WRITE_COEF(0x1c, 0x0), WRITE_COEF(0x1d, 0x0), WRITE_COEF(0x1e, 0x7418),
7103 WRITE_COEF(0x1f, 0x0804), WRITE_COEF(0x20, 0x4200), WRITE_COEF(0x21, 0x0468),
7104 WRITE_COEF(0x22, 0x8ccc), WRITE_COEF(0x23, 0x0250), WRITE_COEF(0x24, 0x7418),
7105 WRITE_COEF(0x27, 0x0), WRITE_COEF(0x28, 0x8ccc), WRITE_COEF(0x2a, 0xff00),
7106 WRITE_COEF(0x2b, 0x8000), WRITE_COEF(0xa7, 0xff00), WRITE_COEF(0xa8, 0x8000),
7107 WRITE_COEF(0xaa, 0x2e17), WRITE_COEF(0xab, 0xa0c0), WRITE_COEF(0xac, 0x0),
7108 WRITE_COEF(0xad, 0x0), WRITE_COEF(0xae, 0x2ac6), WRITE_COEF(0xaf, 0xa480),
7109 WRITE_COEF(0xb0, 0x0), WRITE_COEF(0xb1, 0x0), WRITE_COEF(0xb2, 0x0),
7110 WRITE_COEF(0xb3, 0x0), WRITE_COEF(0xb4, 0x0), WRITE_COEF(0xb5, 0x1040),
7111 WRITE_COEF(0xb6, 0xd697), WRITE_COEF(0xb7, 0x902b), WRITE_COEF(0xb8, 0xd697),
7112 WRITE_COEF(0xb9, 0x902b), WRITE_COEF(0xba, 0xb8ba), WRITE_COEF(0xbb, 0xaaab),
7113 WRITE_COEF(0xbc, 0xaaaf), WRITE_COEF(0xbd, 0x6aaa), WRITE_COEF(0xbe, 0x1c02),
7114 WRITE_COEF(0xc0, 0x00ff), WRITE_COEF(0xc1, 0x0fa6),
7118 static void alc668_restore_default_value(struct hda_codec
*codec
)
7120 alc_process_coef_fw(codec
, alc668_coefs
);
7124 ALC662_FIXUP_ASPIRE
,
7125 ALC662_FIXUP_LED_GPIO1
,
7126 ALC662_FIXUP_IDEAPAD
,
7128 ALC662_FIXUP_CZC_P10T
,
7129 ALC662_FIXUP_SKU_IGNORE
,
7130 ALC662_FIXUP_HP_RP5800
,
7131 ALC662_FIXUP_ASUS_MODE1
,
7132 ALC662_FIXUP_ASUS_MODE2
,
7133 ALC662_FIXUP_ASUS_MODE3
,
7134 ALC662_FIXUP_ASUS_MODE4
,
7135 ALC662_FIXUP_ASUS_MODE5
,
7136 ALC662_FIXUP_ASUS_MODE6
,
7137 ALC662_FIXUP_ASUS_MODE7
,
7138 ALC662_FIXUP_ASUS_MODE8
,
7139 ALC662_FIXUP_NO_JACK_DETECT
,
7140 ALC662_FIXUP_ZOTAC_Z68
,
7141 ALC662_FIXUP_INV_DMIC
,
7142 ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
7143 ALC668_FIXUP_DELL_MIC_NO_PRESENCE
,
7144 ALC662_FIXUP_HEADSET_MODE
,
7145 ALC668_FIXUP_HEADSET_MODE
,
7146 ALC662_FIXUP_BASS_MODE4_CHMAP
,
7147 ALC662_FIXUP_BASS_16
,
7148 ALC662_FIXUP_BASS_1A
,
7149 ALC662_FIXUP_BASS_CHMAP
,
7150 ALC668_FIXUP_AUTO_MUTE
,
7151 ALC668_FIXUP_DELL_DISABLE_AAMIX
,
7152 ALC668_FIXUP_DELL_XPS13
,
7153 ALC662_FIXUP_ASUS_Nx50
,
7154 ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
7155 ALC668_FIXUP_ASUS_Nx51
,
7156 ALC891_FIXUP_HEADSET_MODE
,
7157 ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
7158 ALC662_FIXUP_ACER_VERITON
,
7159 ALC892_FIXUP_ASROCK_MOBO
,
7160 ALC662_FIXUP_USI_FUNC
,
7161 ALC662_FIXUP_USI_HEADSET_MODE
,
7162 ALC662_FIXUP_LENOVO_MULTI_CODECS
,
7165 static const struct hda_fixup alc662_fixups
[] = {
7166 [ALC662_FIXUP_ASPIRE
] = {
7167 .type
= HDA_FIXUP_PINS
,
7168 .v
.pins
= (const struct hda_pintbl
[]) {
7169 { 0x15, 0x99130112 }, /* subwoofer */
7173 [ALC662_FIXUP_LED_GPIO1
] = {
7174 .type
= HDA_FIXUP_FUNC
,
7175 .v
.func
= alc662_fixup_led_gpio1
,
7177 [ALC662_FIXUP_IDEAPAD
] = {
7178 .type
= HDA_FIXUP_PINS
,
7179 .v
.pins
= (const struct hda_pintbl
[]) {
7180 { 0x17, 0x99130112 }, /* subwoofer */
7184 .chain_id
= ALC662_FIXUP_LED_GPIO1
,
7186 [ALC272_FIXUP_MARIO
] = {
7187 .type
= HDA_FIXUP_FUNC
,
7188 .v
.func
= alc272_fixup_mario
,
7190 [ALC662_FIXUP_CZC_P10T
] = {
7191 .type
= HDA_FIXUP_VERBS
,
7192 .v
.verbs
= (const struct hda_verb
[]) {
7193 {0x14, AC_VERB_SET_EAPD_BTLENABLE
, 0},
7197 [ALC662_FIXUP_SKU_IGNORE
] = {
7198 .type
= HDA_FIXUP_FUNC
,
7199 .v
.func
= alc_fixup_sku_ignore
,
7201 [ALC662_FIXUP_HP_RP5800
] = {
7202 .type
= HDA_FIXUP_PINS
,
7203 .v
.pins
= (const struct hda_pintbl
[]) {
7204 { 0x14, 0x0221201f }, /* HP out */
7208 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7210 [ALC662_FIXUP_ASUS_MODE1
] = {
7211 .type
= HDA_FIXUP_PINS
,
7212 .v
.pins
= (const struct hda_pintbl
[]) {
7213 { 0x14, 0x99130110 }, /* speaker */
7214 { 0x18, 0x01a19c20 }, /* mic */
7215 { 0x19, 0x99a3092f }, /* int-mic */
7216 { 0x21, 0x0121401f }, /* HP out */
7220 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7222 [ALC662_FIXUP_ASUS_MODE2
] = {
7223 .type
= HDA_FIXUP_PINS
,
7224 .v
.pins
= (const struct hda_pintbl
[]) {
7225 { 0x14, 0x99130110 }, /* speaker */
7226 { 0x18, 0x01a19820 }, /* mic */
7227 { 0x19, 0x99a3092f }, /* int-mic */
7228 { 0x1b, 0x0121401f }, /* HP out */
7232 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7234 [ALC662_FIXUP_ASUS_MODE3
] = {
7235 .type
= HDA_FIXUP_PINS
,
7236 .v
.pins
= (const struct hda_pintbl
[]) {
7237 { 0x14, 0x99130110 }, /* speaker */
7238 { 0x15, 0x0121441f }, /* HP */
7239 { 0x18, 0x01a19840 }, /* mic */
7240 { 0x19, 0x99a3094f }, /* int-mic */
7241 { 0x21, 0x01211420 }, /* HP2 */
7245 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7247 [ALC662_FIXUP_ASUS_MODE4
] = {
7248 .type
= HDA_FIXUP_PINS
,
7249 .v
.pins
= (const struct hda_pintbl
[]) {
7250 { 0x14, 0x99130110 }, /* speaker */
7251 { 0x16, 0x99130111 }, /* speaker */
7252 { 0x18, 0x01a19840 }, /* mic */
7253 { 0x19, 0x99a3094f }, /* int-mic */
7254 { 0x21, 0x0121441f }, /* HP */
7258 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7260 [ALC662_FIXUP_ASUS_MODE5
] = {
7261 .type
= HDA_FIXUP_PINS
,
7262 .v
.pins
= (const struct hda_pintbl
[]) {
7263 { 0x14, 0x99130110 }, /* speaker */
7264 { 0x15, 0x0121441f }, /* HP */
7265 { 0x16, 0x99130111 }, /* speaker */
7266 { 0x18, 0x01a19840 }, /* mic */
7267 { 0x19, 0x99a3094f }, /* int-mic */
7271 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7273 [ALC662_FIXUP_ASUS_MODE6
] = {
7274 .type
= HDA_FIXUP_PINS
,
7275 .v
.pins
= (const struct hda_pintbl
[]) {
7276 { 0x14, 0x99130110 }, /* speaker */
7277 { 0x15, 0x01211420 }, /* HP2 */
7278 { 0x18, 0x01a19840 }, /* mic */
7279 { 0x19, 0x99a3094f }, /* int-mic */
7280 { 0x1b, 0x0121441f }, /* HP */
7284 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7286 [ALC662_FIXUP_ASUS_MODE7
] = {
7287 .type
= HDA_FIXUP_PINS
,
7288 .v
.pins
= (const struct hda_pintbl
[]) {
7289 { 0x14, 0x99130110 }, /* speaker */
7290 { 0x17, 0x99130111 }, /* speaker */
7291 { 0x18, 0x01a19840 }, /* mic */
7292 { 0x19, 0x99a3094f }, /* int-mic */
7293 { 0x1b, 0x01214020 }, /* HP */
7294 { 0x21, 0x0121401f }, /* HP */
7298 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7300 [ALC662_FIXUP_ASUS_MODE8
] = {
7301 .type
= HDA_FIXUP_PINS
,
7302 .v
.pins
= (const struct hda_pintbl
[]) {
7303 { 0x14, 0x99130110 }, /* speaker */
7304 { 0x12, 0x99a30970 }, /* int-mic */
7305 { 0x15, 0x01214020 }, /* HP */
7306 { 0x17, 0x99130111 }, /* speaker */
7307 { 0x18, 0x01a19840 }, /* mic */
7308 { 0x21, 0x0121401f }, /* HP */
7312 .chain_id
= ALC662_FIXUP_SKU_IGNORE
7314 [ALC662_FIXUP_NO_JACK_DETECT
] = {
7315 .type
= HDA_FIXUP_FUNC
,
7316 .v
.func
= alc_fixup_no_jack_detect
,
7318 [ALC662_FIXUP_ZOTAC_Z68
] = {
7319 .type
= HDA_FIXUP_PINS
,
7320 .v
.pins
= (const struct hda_pintbl
[]) {
7321 { 0x1b, 0x02214020 }, /* Front HP */
7325 [ALC662_FIXUP_INV_DMIC
] = {
7326 .type
= HDA_FIXUP_FUNC
,
7327 .v
.func
= alc_fixup_inv_dmic
,
7329 [ALC668_FIXUP_DELL_XPS13
] = {
7330 .type
= HDA_FIXUP_FUNC
,
7331 .v
.func
= alc_fixup_dell_xps13
,
7333 .chain_id
= ALC668_FIXUP_DELL_DISABLE_AAMIX
7335 [ALC668_FIXUP_DELL_DISABLE_AAMIX
] = {
7336 .type
= HDA_FIXUP_FUNC
,
7337 .v
.func
= alc_fixup_disable_aamix
,
7339 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
7341 [ALC668_FIXUP_AUTO_MUTE
] = {
7342 .type
= HDA_FIXUP_FUNC
,
7343 .v
.func
= alc_fixup_auto_mute_via_amp
,
7345 .chain_id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
7347 [ALC662_FIXUP_DELL_MIC_NO_PRESENCE
] = {
7348 .type
= HDA_FIXUP_PINS
,
7349 .v
.pins
= (const struct hda_pintbl
[]) {
7350 { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */
7351 /* headphone mic by setting pin control of 0x1b (headphone out) to in + vref_50 */
7355 .chain_id
= ALC662_FIXUP_HEADSET_MODE
7357 [ALC662_FIXUP_HEADSET_MODE
] = {
7358 .type
= HDA_FIXUP_FUNC
,
7359 .v
.func
= alc_fixup_headset_mode_alc662
,
7361 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE
] = {
7362 .type
= HDA_FIXUP_PINS
,
7363 .v
.pins
= (const struct hda_pintbl
[]) {
7364 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
7365 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
7369 .chain_id
= ALC668_FIXUP_HEADSET_MODE
7371 [ALC668_FIXUP_HEADSET_MODE
] = {
7372 .type
= HDA_FIXUP_FUNC
,
7373 .v
.func
= alc_fixup_headset_mode_alc668
,
7375 [ALC662_FIXUP_BASS_MODE4_CHMAP
] = {
7376 .type
= HDA_FIXUP_FUNC
,
7377 .v
.func
= alc_fixup_bass_chmap
,
7379 .chain_id
= ALC662_FIXUP_ASUS_MODE4
7381 [ALC662_FIXUP_BASS_16
] = {
7382 .type
= HDA_FIXUP_PINS
,
7383 .v
.pins
= (const struct hda_pintbl
[]) {
7384 {0x16, 0x80106111}, /* bass speaker */
7388 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
7390 [ALC662_FIXUP_BASS_1A
] = {
7391 .type
= HDA_FIXUP_PINS
,
7392 .v
.pins
= (const struct hda_pintbl
[]) {
7393 {0x1a, 0x80106111}, /* bass speaker */
7397 .chain_id
= ALC662_FIXUP_BASS_CHMAP
,
7399 [ALC662_FIXUP_BASS_CHMAP
] = {
7400 .type
= HDA_FIXUP_FUNC
,
7401 .v
.func
= alc_fixup_bass_chmap
,
7403 [ALC662_FIXUP_ASUS_Nx50
] = {
7404 .type
= HDA_FIXUP_FUNC
,
7405 .v
.func
= alc_fixup_auto_mute_via_amp
,
7407 .chain_id
= ALC662_FIXUP_BASS_1A
7409 [ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
] = {
7410 .type
= HDA_FIXUP_FUNC
,
7411 .v
.func
= alc_fixup_headset_mode_alc668
,
7412 .chain_id
= ALC662_FIXUP_BASS_CHMAP
7414 [ALC668_FIXUP_ASUS_Nx51
] = {
7415 .type
= HDA_FIXUP_PINS
,
7416 .v
.pins
= (const struct hda_pintbl
[]) {
7417 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
7418 { 0x1a, 0x90170151 }, /* bass speaker */
7419 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
7423 .chain_id
= ALC668_FIXUP_ASUS_Nx51_HEADSET_MODE
,
7425 [ALC891_FIXUP_HEADSET_MODE
] = {
7426 .type
= HDA_FIXUP_FUNC
,
7427 .v
.func
= alc_fixup_headset_mode
,
7429 [ALC891_FIXUP_DELL_MIC_NO_PRESENCE
] = {
7430 .type
= HDA_FIXUP_PINS
,
7431 .v
.pins
= (const struct hda_pintbl
[]) {
7432 { 0x19, 0x03a1913d }, /* use as headphone mic, without its own jack detect */
7433 { 0x1b, 0x03a1113c }, /* use as headset mic, without its own jack detect */
7437 .chain_id
= ALC891_FIXUP_HEADSET_MODE
7439 [ALC662_FIXUP_ACER_VERITON
] = {
7440 .type
= HDA_FIXUP_PINS
,
7441 .v
.pins
= (const struct hda_pintbl
[]) {
7442 { 0x15, 0x50170120 }, /* no internal speaker */
7446 [ALC892_FIXUP_ASROCK_MOBO
] = {
7447 .type
= HDA_FIXUP_PINS
,
7448 .v
.pins
= (const struct hda_pintbl
[]) {
7449 { 0x15, 0x40f000f0 }, /* disabled */
7450 { 0x16, 0x40f000f0 }, /* disabled */
7454 [ALC662_FIXUP_USI_FUNC
] = {
7455 .type
= HDA_FIXUP_FUNC
,
7456 .v
.func
= alc662_fixup_usi_headset_mic
,
7458 [ALC662_FIXUP_USI_HEADSET_MODE
] = {
7459 .type
= HDA_FIXUP_PINS
,
7460 .v
.pins
= (const struct hda_pintbl
[]) {
7461 { 0x19, 0x02a1913c }, /* use as headset mic, without its own jack detect */
7462 { 0x18, 0x01a1903d },
7466 .chain_id
= ALC662_FIXUP_USI_FUNC
7468 [ALC662_FIXUP_LENOVO_MULTI_CODECS
] = {
7469 .type
= HDA_FIXUP_FUNC
,
7470 .v
.func
= alc233_alc662_fixup_lenovo_dual_codecs
,
7474 static const struct snd_pci_quirk alc662_fixup_tbl
[] = {
7475 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2
),
7476 SND_PCI_QUIRK(0x1025, 0x022f, "Acer Aspire One", ALC662_FIXUP_INV_DMIC
),
7477 SND_PCI_QUIRK(0x1025, 0x0241, "Packard Bell DOTS", ALC662_FIXUP_INV_DMIC
),
7478 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE
),
7479 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE
),
7480 SND_PCI_QUIRK(0x1025, 0x0349, "eMachines eM250", ALC662_FIXUP_INV_DMIC
),
7481 SND_PCI_QUIRK(0x1025, 0x034a, "Gateway LT27", ALC662_FIXUP_INV_DMIC
),
7482 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE
),
7483 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7484 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7485 SND_PCI_QUIRK(0x1028, 0x05fe, "Dell XPS 15", ALC668_FIXUP_DELL_XPS13
),
7486 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_XPS13
),
7487 SND_PCI_QUIRK(0x1028, 0x060d, "Dell M3800", ALC668_FIXUP_DELL_XPS13
),
7488 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7489 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7490 SND_PCI_QUIRK(0x1028, 0x0696, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7491 SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7492 SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE
),
7493 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800
),
7494 SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE
),
7495 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_ASUS_Nx50
),
7496 SND_PCI_QUIRK(0x1043, 0x13df, "Asus N550JX", ALC662_FIXUP_BASS_1A
),
7497 SND_PCI_QUIRK(0x1043, 0x129d, "Asus N750", ALC662_FIXUP_ASUS_Nx50
),
7498 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
7499 SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16
),
7500 SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51
),
7501 SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51
),
7502 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8
),
7503 SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16
),
7504 SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP
),
7505 SND_PCI_QUIRK(0x1043, 0x8469, "ASUS mobo", ALC662_FIXUP_NO_JACK_DETECT
),
7506 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2
),
7507 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD
),
7508 SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE
),
7509 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS
),
7510 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD
),
7511 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD
),
7512 SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO
),
7513 SND_PCI_QUIRK(0x19da, 0xa130, "Zotac Z68", ALC662_FIXUP_ZOTAC_Z68
),
7514 SND_PCI_QUIRK(0x1b0a, 0x01b8, "ACER Veriton", ALC662_FIXUP_ACER_VERITON
),
7515 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T
),
7518 /* Below is a quirk table taken from the old code.
7519 * Basically the device should work as is without the fixup table.
7520 * If BIOS doesn't give a proper info, enable the corresponding
7523 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1
),
7524 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3
),
7525 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1
),
7526 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3
),
7527 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7528 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7529 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7530 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1
),
7531 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1
),
7532 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7533 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7
),
7534 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7
),
7535 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8
),
7536 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3
),
7537 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1
),
7538 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7539 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2
),
7540 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1
),
7541 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7542 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
7543 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
7544 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7545 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1
),
7546 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3
),
7547 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2
),
7548 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7549 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5
),
7550 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6
),
7551 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7552 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1
),
7553 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7554 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7555 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3
),
7556 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3
),
7557 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1
),
7558 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1
),
7559 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1
),
7560 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1
),
7561 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1
),
7562 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2
),
7563 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2
),
7564 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1
),
7565 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7566 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3
),
7567 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1
),
7568 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1
),
7569 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1
),
7570 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2
),
7571 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1
),
7572 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4
),
7577 static const struct hda_model_fixup alc662_fixup_models
[] = {
7578 {.id
= ALC272_FIXUP_MARIO
, .name
= "mario"},
7579 {.id
= ALC662_FIXUP_ASUS_MODE1
, .name
= "asus-mode1"},
7580 {.id
= ALC662_FIXUP_ASUS_MODE2
, .name
= "asus-mode2"},
7581 {.id
= ALC662_FIXUP_ASUS_MODE3
, .name
= "asus-mode3"},
7582 {.id
= ALC662_FIXUP_ASUS_MODE4
, .name
= "asus-mode4"},
7583 {.id
= ALC662_FIXUP_ASUS_MODE5
, .name
= "asus-mode5"},
7584 {.id
= ALC662_FIXUP_ASUS_MODE6
, .name
= "asus-mode6"},
7585 {.id
= ALC662_FIXUP_ASUS_MODE7
, .name
= "asus-mode7"},
7586 {.id
= ALC662_FIXUP_ASUS_MODE8
, .name
= "asus-mode8"},
7587 {.id
= ALC662_FIXUP_INV_DMIC
, .name
= "inv-dmic"},
7588 {.id
= ALC668_FIXUP_DELL_MIC_NO_PRESENCE
, .name
= "dell-headset-multi"},
7589 {.id
= ALC662_FIXUP_LENOVO_MULTI_CODECS
, .name
= "dual-codecs"},
7593 static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl
[] = {
7594 SND_HDA_PIN_QUIRK(0x10ec0867, 0x1028, "Dell", ALC891_FIXUP_DELL_MIC_NO_PRESENCE
,
7598 {0x21, 0x01014020}),
7599 SND_HDA_PIN_QUIRK(0x10ec0662, 0x1028, "Dell", ALC662_FIXUP_DELL_MIC_NO_PRESENCE
,
7603 {0x1b, 0x0221401f}),
7604 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7608 {0x16, 0x03011020}),
7609 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7613 {0x16, 0x03011020}),
7614 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7618 {0x16, 0x03011020}),
7619 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE
,
7622 {0x16, 0x03011020}),
7623 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE
,
7626 {0x15, 0x0321101f}),
7632 static int patch_alc662(struct hda_codec
*codec
)
7634 struct alc_spec
*spec
;
7637 err
= alc_alloc_spec(codec
, 0x0b);
7643 spec
->shutup
= alc_eapd_shutup
;
7645 /* handle multiple HPs as is */
7646 spec
->parse_flags
= HDA_PINCFG_NO_HP_FIXUP
;
7648 alc_fix_pll_init(codec
, 0x20, 0x04, 15);
7650 switch (codec
->core
.vendor_id
) {
7652 spec
->init_hook
= alc668_restore_default_value
;
7656 snd_hda_pick_fixup(codec
, alc662_fixup_models
,
7657 alc662_fixup_tbl
, alc662_fixups
);
7658 snd_hda_pick_pin_fixup(codec
, alc662_pin_fixup_tbl
, alc662_fixups
);
7659 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PRE_PROBE
);
7661 alc_auto_parse_customize_define(codec
);
7663 if (has_cdefine_beep(codec
))
7664 spec
->gen
.beep_nid
= 0x01;
7666 if ((alc_get_coef0(codec
) & (1 << 14)) &&
7667 codec
->bus
->pci
&& codec
->bus
->pci
->subsystem_vendor
== 0x1025 &&
7668 spec
->cdefine
.platform_type
== 1) {
7669 err
= alc_codec_rename(codec
, "ALC272X");
7674 /* automatic parse from the BIOS config */
7675 err
= alc662_parse_auto_config(codec
);
7679 if (!spec
->gen
.no_analog
&& spec
->gen
.beep_nid
) {
7680 switch (codec
->core
.vendor_id
) {
7682 set_beep_amp(spec
, 0x0b, 0x05, HDA_INPUT
);
7688 set_beep_amp(spec
, 0x0b, 0x04, HDA_INPUT
);
7691 set_beep_amp(spec
, 0x0b, 0x03, HDA_INPUT
);
7696 snd_hda_apply_fixup(codec
, HDA_FIXUP_ACT_PROBE
);
7709 static int alc680_parse_auto_config(struct hda_codec
*codec
)
7711 return alc_parse_auto_config(codec
, NULL
, NULL
);
7716 static int patch_alc680(struct hda_codec
*codec
)
7720 /* ALC680 has no aa-loopback mixer */
7721 err
= alc_alloc_spec(codec
, 0);
7725 /* automatic parse from the BIOS config */
7726 err
= alc680_parse_auto_config(codec
);
7738 static const struct hda_device_id snd_hda_id_realtek
[] = {
7739 HDA_CODEC_ENTRY(0x10ec0215, "ALC215", patch_alc269
),
7740 HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269
),
7741 HDA_CODEC_ENTRY(0x10ec0225, "ALC225", patch_alc269
),
7742 HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269
),
7743 HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269
),
7744 HDA_CODEC_ENTRY(0x10ec0234, "ALC234", patch_alc269
),
7745 HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269
),
7746 HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269
),
7747 HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269
),
7748 HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260
),
7749 HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262
),
7750 HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268
),
7751 HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268
),
7752 HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269
),
7753 HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269
),
7754 HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662
),
7755 HDA_CODEC_ENTRY(0x10ec0274, "ALC274", patch_alc269
),
7756 HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269
),
7757 HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269
),
7758 HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269
),
7759 HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269
),
7760 HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269
),
7761 HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269
),
7762 HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269
),
7763 HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269
),
7764 HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269
),
7765 HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269
),
7766 HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269
),
7767 HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269
),
7768 HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269
),
7769 HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269
),
7770 HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269
),
7771 HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269
),
7772 HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269
),
7773 HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861
),
7774 HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd
),
7775 HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861
),
7776 HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd
),
7777 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882
),
7778 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662
),
7779 HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662
),
7780 HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662
),
7781 HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662
),
7782 HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662
),
7783 HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662
),
7784 HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662
),
7785 HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662
),
7786 HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680
),
7787 HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269
),
7788 HDA_CODEC_ENTRY(0x10ec0701, "ALC701", patch_alc269
),
7789 HDA_CODEC_ENTRY(0x10ec0703, "ALC703", patch_alc269
),
7790 HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc662
),
7791 HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880
),
7792 HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882
),
7793 HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882
),
7794 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882
),
7795 HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882
),
7796 HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882
),
7797 HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882
),
7798 HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882
),
7799 HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882
),
7800 HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882
),
7801 HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662
),
7802 HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882
),
7803 HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882
),
7804 HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882
),
7807 MODULE_DEVICE_TABLE(hdaudio
, snd_hda_id_realtek
);
7809 MODULE_LICENSE("GPL");
7810 MODULE_DESCRIPTION("Realtek HD-audio codec");
7812 static struct hda_codec_driver realtek_driver
= {
7813 .id
= snd_hda_id_realtek
,
7816 module_hda_codec_driver(realtek_driver
);